2 жил өмнө
parent
commit
aad21938ae

+ 14 - 13
platform-service/src/main/java/com/platform/service/fill/impl/FillGatherTaskServiceImpl.java

@@ -58,8 +58,9 @@ public class FillGatherTaskServiceImpl extends BaseServiceImpl<FillGatherTaskMap
         for(int i=0;i<detailIds.size();i++){
             FillGatherTaskDetail detail = new FillGatherTaskDetail();
             detail.setId(detailIds.get(i));
+            fillGatherTaskDetailMapper.deleteByPrimaryKey(detail);
         }
-        fillGatherTaskDetailMapper.deleteByPrimaryKey(detailIds);
+
     }
     @Override
     public int updateDetails(FillGatherTaskDTO dto) {
@@ -69,8 +70,8 @@ public class FillGatherTaskServiceImpl extends BaseServiceImpl<FillGatherTaskMap
         task.setId(dto.getId());
         if (dto.getIsAdd()==0){
             //删除
-            task.setTotalNum(task1.getTotalNum()-dto.getSbIds().size());
-            task.setWaitNum(task1.getTotalNum()-dto.getSbIds().size());
+            task.setTotalNum(task1.getTotalNum()-dto.getDetailIds().size());
+            task.setWaitNum(task1.getTotalNum()-dto.getDetailIds().size());
             deleteDetails(dto.getDetailIds());
         }else if (dto.getIsAdd()==1){
             task.setTotalNum(task1.getTotalNum()+dto.getSbIds().size());
@@ -79,16 +80,16 @@ public class FillGatherTaskServiceImpl extends BaseServiceImpl<FillGatherTaskMap
             String content = getContentByGatherId(task1.getGatherId());
             saveDetails(content,dto.getSbIds(),dto.getSortNums(),task.getId());
         }
-        task.setStatus(FillGatherTaskStatusEnum.PROCESSING.getValue());
-        mapper.updateByPrimaryKey(task);
-        // 3、通知相关人员(巡检人和主管)
-        sendMessageToChecker(task,1);
-        sendMessageToChecker(task,2);
-        // 4、启动超时监控预警信息
-        int initMin = task.getRequireHour()*60;
-        int hours = task.getWarningHour() == null ? initMin + 120 : task.getWarningHour()*60 + initMin;
-        log.info("-----------hours------------"+hours);
-        RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_FILL_PREFIX + RedisKeyConstants.EXPIRE_BUSINESS_SEP + task.getId(), task.getId(), hours, TimeUnit.MINUTES);
+//        task.setStatus(FillGatherTaskStatusEnum.PROCESSING.getValue());
+//        mapper.updateByPrimaryKey(task);
+//        // 3、通知相关人员(巡检人和主管)
+//        sendMessageToChecker(task,1);
+//        sendMessageToChecker(task,2);
+//        // 4、启动超时监控预警信息
+//        int initMin = task.getRequireHour()*60;
+//        int hours = task.getWarningHour() == null ? initMin + 120 : task.getWarningHour()*60 + initMin;
+//        log.info("-----------hours------------"+hours);
+//        RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_FILL_PREFIX + RedisKeyConstants.EXPIRE_BUSINESS_SEP + task.getId(), task.getId(), hours, TimeUnit.MINUTES);
         return 0;
     }