Browse Source

分支冲突

fuyuhchuan 10 tháng trước cách đây
mục cha
commit
0d739f49b2

+ 24 - 12
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanSonServiceImpl.java

@@ -12,7 +12,6 @@ import com.usky.fire.domain.*;
 import com.usky.fire.mapper.PatrolInspectionPlanMapper;
 import com.usky.fire.mapper.PatrolInspectionPlanSonMapper;
 import com.usky.fire.mapper.PatrolInspectionRecordMapper;
-import com.usky.fire.mapper.PatrolInspectionSiteMapper;
 import com.usky.fire.service.*;
 import com.usky.fire.service.util.OnlineMethod;
 import com.usky.fire.service.vo.*;
@@ -75,7 +74,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
     private PatrolInspectionPersonnelService patrolInspectionPersonnelService;
 
     @Autowired
-    private PatrolInspectionSiteMapper patrolInspectionSiteMapper;
+    private PatrolInspectionEventService patrolInspectionEventService;
 
     @Override
     public Map<String, Object> appPlanStatistics(String currentDate) {
@@ -247,14 +246,33 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
          * 巡检时间判断
          * */
         LocalDateTime now = LocalDateTime.now();
-        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"));
+        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)) {
+        } 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("巡检时间已过,请联系管理员");
         }
 
+
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapperOne = Wrappers.lambdaQuery();
         queryWrapperOne.select(PatrolInspectionArea::getId, PatrolInspectionArea::getAreaName)
                 .eq(PatrolInspectionArea::getId, planSonList.get(0).getAreaId());
@@ -293,12 +311,6 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
         patrolInspectionRecord.setCompanyId(planRecordVo.getCompanyId());
         patrolInspectionRecord.setCreator(SecurityUtils.getUsername());
         patrolInspectionRecord.setRemarks(planRecordVo.getRemarks());
-        //从主计划表中查找路线id放入记录表中
-        LambdaQueryWrapper<PatrolInspectionPlan> planLambdaQueryWrapper = Wrappers.lambdaQuery();
-        planLambdaQueryWrapper.select(PatrolInspectionPlan::getRouteId)
-                .eq(PatrolInspectionPlan::getId, planRecordVo.getPlanId());
-        Integer routeId = patrolInspectionPlanMapper.selectOne(planLambdaQueryWrapper).getRouteId();
-        patrolInspectionRecord.setRouteId(routeId);
         patrolInspectionRecordMapper.insert(patrolInspectionRecord);
         Integer recordId = patrolInspectionRecord.getId();
         List<PatrolInspectionRecordPicture> recordPictureList = planRecordVo.getRecordPictureList();
@@ -909,4 +921,4 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
         }
         return planSonIdList;
     }
-}
+}

+ 3 - 3
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkReportServiceImpl.java

@@ -167,12 +167,12 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
         report = report2;
         Integer pId = report.get(0).getId();
         List<PmWorkContent> pmWorkContentList = new ArrayList<>();
-        LambdaQueryWrapper<PmWorkContent> wrapper= Wrappers.lambdaQuery();
-        wrapper.eq(PmWorkContent::getReportId,pId);
+        LambdaQueryWrapper<PmWorkContent> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(PmWorkContent::getReportId, pId);
         List<PmWorkContent> contents1 = pmWorkContentMapper.selectList(wrapper);
         for (PmWorkContent pmWorkContent : contents1) {
             Integer pId2 = pmWorkContent.getReportId();
-            if (pId2 == pId){
+            if (pId2 == pId) {
                 pmWorkContentList.add(pmWorkContent);
             }
         }