linwei
2024-02-05 9217ec61bae4e02be35f26c84b4993d3d9f97d86
src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java
@@ -90,35 +90,36 @@
            item.setPlaceCheckId(placeCheck.getId());
            item.setCreateUser(AuthUtil.getUserId());
         });
         List<PatrolRecord> collect = patrolRecordVOList.stream().filter(item -> item.getState().equals(0)).collect(Collectors.toList());
         boolean b = bean.saveBatch(collect);
         updateById(placeCheck);
         if (b) {
            // 隐患问题大于0 则创建任务
            try {
               Integer integer = number.get();
               if (integer > 0) {
                  // 保存任务表
                  ITaskService bean2 = SpringUtils.getBean(ITaskService.class);
                  Long aLong = bean2.saveTask(CommonConstant.NUMBER_FOUR, DictConstant.FIRE_RECTIFICATION_NOTICE, 1,
                     "", AuthUtil.getUserId(), placeCheck.getHouseCode(), CommonConstant.NUMBER_EIGHT,4);
                  if (aLong > 0) {
                     // 保存任务详情表
                     ITaskPlaceRectificationService bean1 = SpringUtil.getBean(ITaskPlaceRectificationService.class);
                     TaskPlaceRectificationEntity copy = BeanUtil.copy(placeCheck, TaskPlaceRectificationEntity.class);
                     copy.setTaskId(aLong);
                     copy.setPlaceCheckId(placeCheck.getId());
                     copy.setId(null);
                     copy.setStatus(4);
                     bean1.save(copy);
         // List<PatrolRecord> collect = patrolRecordVOList.stream().filter(item -> item.getState().equals(0)).collect(Collectors.toList());
         if (patrolRecordVOList != null && patrolRecordVOList.size() > 0) {
            boolean b = bean.saveBatch(patrolRecordVOList);
            if (b) {
               // 隐患问题大于0 则创建任务
               try {
                  Integer integer = number.get();
                  if (integer > 0) {
                     // 保存任务表
                     ITaskService bean2 = SpringUtils.getBean(ITaskService.class);
                     Long aLong = bean2.saveTask(CommonConstant.NUMBER_FOUR, DictConstant.FIRE_RECTIFICATION_NOTICE, 1,
                        "", AuthUtil.getUserId(), placeCheck.getHouseCode(), CommonConstant.NUMBER_EIGHT, 4);
                     if (aLong > 0) {
                        // 保存任务详情表
                        ITaskPlaceRectificationService bean1 = SpringUtil.getBean(ITaskPlaceRectificationService.class);
                        TaskPlaceRectificationEntity copy = BeanUtil.copy(placeCheck, TaskPlaceRectificationEntity.class);
                        copy.setTaskId(aLong);
                        copy.setPlaceCheckId(placeCheck.getId());
                        copy.setId(null);
                        copy.setStatus(4);
                        bean1.save(copy);
                     }
                  }
               } catch (Exception e) {
                  logger.error("任务保存失败!", e);
               }
            } catch (Exception e) {
               logger.error("任务保存失败!", e);
               return b;
            }
            return b;
         }
         throw new Exception("保存失败!");
         return save;
      }
      return false;
   }