Commit baa54dee by jianan

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

parent 132ce465
...@@ -72,7 +72,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -72,7 +72,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
Long mdDropOptionId = schedule.getMdDropOptionId(); Long mdDropOptionId = schedule.getMdDropOptionId();
// 判断日程是否重复 // 判断日程是否重复
if (!CommonUtil.isNullOrBlank(taskTimeFrom) && !CommonUtil.isNullOrBlank(taskTimeEnd)) { 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) { if (count > 0) {
resp.setCommonResult(new CommonResult(false, "该时间段内该类型日程已存在")); resp.setCommonResult(new CommonResult(false, "该时间段内该类型日程已存在"));
return resp; return resp;
...@@ -170,7 +170,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -170,7 +170,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
} }
List<ScheduleTrackVO> showList = new ArrayList<>(); List<ScheduleTrackVO> showList = new ArrayList<>();
try { try {
List<ScheduleTrack> dataList = scheduleTrackMapper.queryScheduleTrackList(practitionerId); List<ScheduleTrack> dataList = scheduleTrackMapper.queryScheduleTrackList(practitionerId, trackDate);
Map<Long, MdDropOptions> taskTypeMap = this.getScheduleTaskTypeMap(); Map<Long, MdDropOptions> taskTypeMap = this.getScheduleTaskTypeMap();
String optionName = null; String optionName = null;
for (ScheduleTrack schedule: dataList) { for (ScheduleTrack schedule: dataList) {
......
...@@ -12,7 +12,7 @@ public interface ScheduleTrackMapper { ...@@ -12,7 +12,7 @@ public interface ScheduleTrackMapper {
void insert(ScheduleTrack schedule); 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, int checkTimePeriodConflict(@Param("trackTime")Date trackTime, @Param("taskTimeFrom")String taskTimeFrom,
@Param("taskTimeEnd")String taskTimeEnd, @Param("practitionerId")Long practitionerId); @Param("taskTimeEnd")String taskTimeEnd, @Param("practitionerId")Long practitionerId);
...@@ -29,7 +29,7 @@ public interface ScheduleTrackMapper { ...@@ -29,7 +29,7 @@ public interface ScheduleTrackMapper {
String queryNameByPractitionerId(Long practitionerId); 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); @Param("taskTimeFrom")String taskTimeFrom, @Param("taskTimeEnd")String taskTimeEnd);
} }
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
FROM ag_mkt_schedule_task_tracking t FROM ag_mkt_schedule_task_tracking t
LEFT JOIN ag_acl_customer c on t.customer_id=c.id LEFT JOIN ag_acl_customer c on t.customer_id=c.id
WHERE practitioner_id = #{practitionerId,jdbcType=BIGINT} WHERE practitioner_id = #{practitionerId,jdbcType=BIGINT}
AND DATEDIFF(#{trackDate,jdbcType=VARCHAR},track_time) &lt; 365
ORDER BY task_time_from ORDER BY task_time_from
</select> </select>
...@@ -189,6 +190,7 @@ ...@@ -189,6 +190,7 @@
FROM FROM
ag_mkt_schedule_task_tracking t ag_mkt_schedule_task_tracking t
WHERE 1=1 WHERE 1=1
AND DATEDIFF(#{trackDate,jdbcType=VARCHAR},track_time) &lt; 365
AND md_drop_option_id in 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 (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' WHERE m.scenario_code = 'pep_schedule_task_others'
...@@ -229,6 +231,7 @@ ...@@ -229,6 +231,7 @@
created_at, created_by, updated_at, updated_by, updator_type, creator_type created_at, created_by, updated_at, updated_by, updator_type, creator_type
from ag_mkt_schedule_task_tracking t from ag_mkt_schedule_task_tracking t
where t.practitioner_id = #{practitionerId,jdbcType=BIGINT} where t.practitioner_id = #{practitionerId,jdbcType=BIGINT}
and DATEDIFF(#{trackDate,jdbcType=VARCHAR},track_time) &lt; 365
and md_drop_option_id in 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 (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' WHERE m.scenario_code = 'pep_schedule_task_others'
...@@ -252,7 +255,7 @@ ...@@ -252,7 +255,7 @@
AND practitioner_id = #{practitionerId,jdbcType=BIGINT} AND practitioner_id = #{practitionerId,jdbcType=BIGINT}
AND task_time_from = STR_TO_DATE(#{taskTimeFrom,jdbcType=VARCHAR}, '%H:%i:%s') 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_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> </select>
</mapper> </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