|
@@ -87,6 +87,13 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
|
|
|
if (itemEndTime.before(inspectionItemPlan.getPlanEnd())) {
|
|
|
throw new BizException("日程时间不能晚于工作周期结束时间");
|
|
|
}
|
|
|
+ //事项计划同一乐团同一天不能重复
|
|
|
+ Date dayStartTime = DateUtil.trunc(inspectionItemPlan.getPlanStart());
|
|
|
+ Date dayEndTime = DateUtil.trunc(inspectionItemPlan.getPlanStart());
|
|
|
+ int dayMusicGroupItemPlanCount = inspectionItemPlanDao.getMusicGroupItemPlanCount(inspectionItemPlan.getItemId(), inspectionItemPlan.getMusicGroupId(), dayStartTime, dayEndTime);
|
|
|
+ if(dayMusicGroupItemPlanCount > 0){
|
|
|
+ throw new BizException("该乐团当天已有巡查安排,请核查");
|
|
|
+ }
|
|
|
//获取乐团教学点的GPS信息
|
|
|
MusicGroup musicGroup = musicGroupDao.get(inspectionItemPlan.getMusicGroupId());
|
|
|
School school = schoolDao.get(musicGroup.getSchoolId());
|
|
@@ -154,7 +161,7 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
|
|
|
Date nowDate = new Date();
|
|
|
Date startTime = DateUtil.getFirstDayOfMonth(nowDate);
|
|
|
Date endTime = DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(nowDate));
|
|
|
- List<InspectionItemPlan> startPlans = inspectionItemPlanDao.getStartPlan(startTime,endTime);
|
|
|
+ List<InspectionItemPlan> startPlans = inspectionItemPlanDao.getStartPlan(startTime, endTime);
|
|
|
Set<Integer> userIds = startPlans.stream().map(InspectionItemPlan::getUserId).collect(Collectors.toSet());
|
|
|
//发送推送信息
|
|
|
Map<Integer, String> userMap = new HashMap<>();
|