|
@@ -73,6 +73,9 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
@Autowired
|
|
|
private PatrolInspectionPersonnelService patrolInspectionPersonnelService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PatrolInspectionEventService patrolInspectionEventService;
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> appPlanStatistics(String currentDate) {
|
|
|
Integer planSonCount = 0;
|
|
@@ -246,8 +249,26 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
|
|
|
LocalDateTime inspectionDateTime = LocalDateTime.parse(planSonList.get(0).getInspectionDate() +" "+ planSonList.get(0).getStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
LocalDateTime inspectionDateTime1 = LocalDateTime.parse(planSonList.get(0).getInspectionDate() +" "+ planSonList.get(0).getEndTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
if (inspectionDateTime.isAfter(now)) {
|
|
|
+ PatrolInspectionEvent patrolInspectionEvent = new PatrolInspectionEvent();
|
|
|
+ patrolInspectionEvent.setEventName("早到");
|
|
|
+ patrolInspectionEvent.setEventType(33);
|
|
|
+ patrolInspectionEvent.setEventLevel(1);
|
|
|
+ patrolInspectionEvent.setEventCategory(1);
|
|
|
+ patrolInspectionEvent.setDeviceId(planRecordVo.getDeviceId());
|
|
|
+ patrolInspectionEvent.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ patrolInspectionEvent.setCreateTime(LocalDateTime.now());
|
|
|
+ patrolInspectionEventService.add(patrolInspectionEvent);
|
|
|
throw new BusinessException("计划未开始,不可巡检");
|
|
|
} else if (now.isAfter(inspectionDateTime1)){
|
|
|
+ PatrolInspectionEvent patrolInspectionEvent = new PatrolInspectionEvent();
|
|
|
+ patrolInspectionEvent.setEventName("迟到");
|
|
|
+ patrolInspectionEvent.setEventType(34);
|
|
|
+ patrolInspectionEvent.setEventLevel(1);
|
|
|
+ patrolInspectionEvent.setEventCategory(1);
|
|
|
+ patrolInspectionEvent.setDeviceId(planRecordVo.getDeviceId());
|
|
|
+ patrolInspectionEvent.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ patrolInspectionEvent.setCreateTime(LocalDateTime.now());
|
|
|
+ patrolInspectionEventService.add(patrolInspectionEvent);
|
|
|
throw new BusinessException("巡检时间已过,请联系管理员");
|
|
|
}
|
|
|
|