Commit baa54dee by jianan

长期固定日程期限为下一个365天

parent 132ce465
......@@ -72,7 +72,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
Long mdDropOptionId = schedule.getMdDropOptionId();
// 判断日程是否重复
if (!CommonUtil.isNullOrBlank(taskTimeFrom) && !CommonUtil.isNullOrBlank(taskTimeEnd)) {
int count = scheduleTrackMapper.checkIsExist(practitionerId, trackTime, taskType, taskTimeFrom, taskTimeEnd);
int count = scheduleTrackMapper.checkIsExist(practitionerId, trackTime, mdDropOptionId, taskTimeFrom, taskTimeEnd);
if (count > 0) {
resp.setCommonResult(new CommonResult(false, "该时间段内该类型日程已存在"));
return resp;
......@@ -170,7 +170,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
}
List<ScheduleTrackVO> showList = new ArrayList<>();
try {
List<ScheduleTrack> dataList = scheduleTrackMapper.queryScheduleTrackList(practitionerId);
List<ScheduleTrack> dataList = scheduleTrackMapper.queryScheduleTrackList(practitionerId, trackDate);
Map<Long, MdDropOptions> taskTypeMap = this.getScheduleTaskTypeMap();
String optionName = null;
for (ScheduleTrack schedule: dataList) {
......
......@@ -12,7 +12,7 @@ public interface ScheduleTrackMapper {
void insert(ScheduleTrack schedule);
List<ScheduleTrack> queryScheduleTrackList(@Param("practitionerId")Long practitionerId);
List<ScheduleTrack> queryScheduleTrackList(@Param("practitionerId")Long practitionerId, @Param("trackDate")String trackDate);
int checkTimePeriodConflict(@Param("trackTime")Date trackTime, @Param("taskTimeFrom")String taskTimeFrom,
@Param("taskTimeEnd")String taskTimeEnd, @Param("practitionerId")Long practitionerId);
......@@ -29,7 +29,7 @@ public interface ScheduleTrackMapper {
String queryNameByPractitionerId(Long practitionerId);
int checkIsExist(@Param("practitionerId")Long practitionerId, @Param("trackTime")Date trackTime, @Param("taskType")Integer taskType,
int checkIsExist(@Param("practitionerId")Long practitionerId, @Param("trackTime")Date trackTime, @Param("mdDropOptionId")Long mdDropOptionId,
@Param("taskTimeFrom")String taskTimeFrom, @Param("taskTimeEnd")String taskTimeEnd);
}
......@@ -42,6 +42,7 @@
FROM ag_mkt_schedule_task_tracking t
LEFT JOIN ag_acl_customer c on t.customer_id=c.id
WHERE practitioner_id = #{practitionerId,jdbcType=BIGINT}
AND DATEDIFF(#{trackDate,jdbcType=VARCHAR},track_time) &lt; 365
ORDER BY task_time_from
</select>
......@@ -189,6 +190,7 @@
FROM
ag_mkt_schedule_task_tracking t
WHERE 1=1
AND DATEDIFF(#{trackDate,jdbcType=VARCHAR},track_time) &lt; 365
AND md_drop_option_id in
(SELECT o.id FROM ag_md_drop_options o LEFT JOIN ag_md_drop_master m ON m.id = o.drop_master_id
WHERE m.scenario_code = 'pep_schedule_task_others'
......@@ -229,6 +231,7 @@
created_at, created_by, updated_at, updated_by, updator_type, creator_type
from ag_mkt_schedule_task_tracking t
where t.practitioner_id = #{practitionerId,jdbcType=BIGINT}
and DATEDIFF(#{trackDate,jdbcType=VARCHAR},track_time) &lt; 365
and md_drop_option_id in
(SELECT o.id FROM ag_md_drop_options o LEFT JOIN ag_md_drop_master m ON m.id = o.drop_master_id
WHERE m.scenario_code = 'pep_schedule_task_others'
......@@ -252,7 +255,7 @@
AND practitioner_id = #{practitionerId,jdbcType=BIGINT}
AND task_time_from = STR_TO_DATE(#{taskTimeFrom,jdbcType=VARCHAR}, '%H:%i:%s')
AND task_time_end = STR_TO_DATE(#{taskTimeEnd,jdbcType=VARCHAR}, '%H:%i:%s')
AND task_type = #{taskType,jdbcType=INTEGER}
AND md_drop_option_id = #{mdDropOptionId,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment