zhongrj
2024-02-21 051ccdbfdc1daec64187d28af1ca11e55649cd1e
src/main/java/org/springblade/modules/taskPlaceSelfCheck/service/impl/TaskPlaceSelfCheckServiceImpl.java
@@ -63,12 +63,12 @@
   /**
    * 查询消防自查记任务表
    *
    * @param id 消防自查记任务表ID
    * @param taskPlaceSelfCheck 消防自查记任务表ID
    * @return 消防自查记任务表
    */
   @Override
   public TaskPlaceSelfCheckDTO selectTaskPlaceSelfCheckById(Long id) {
      return this.baseMapper.selectTaskPlaceSelfCheckById(id);
   public TaskPlaceSelfCheckDTO selectTaskPlaceSelfCheckById(TaskPlaceSelfCheckEntity taskPlaceSelfCheck) {
      return this.baseMapper.selectTaskPlaceSelfCheckById(taskPlaceSelfCheck);
   }
   /**
@@ -90,7 +90,7 @@
      // 1.保存任务表
      ITaskService bean2 = SpringUtils.getBean(ITaskService.class);
      Long aLong = bean2.saveTask(CommonConstant.NUMBER_ONE, DictConstant.FIRE_SELF_CHECK_NOTICE, 1,
         "", AuthUtil.getUserId(), taskPlaceSelfCheck.getHouseCode(), CommonConstant.NUMBER_TWO, 4);
         "", AuthUtil.getUserId(), taskPlaceSelfCheck.getHouseCode(), CommonConstant.NUMBER_TWO, 1);
      if (aLong <= 0) {
         return false;
      }
@@ -120,8 +120,8 @@
   @Transactional(rollbackFor = Exception.class)
   public Boolean updateTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception {
      // 1.更新任务表
      ITaskService bean2 = SpringUtils.getBean(ITaskService.class);
      Long aLong = bean2.updateTask(null, null, null, taskPlaceSelfCheck.getReasonFailure(), AuthUtil.getUserId(), taskPlaceSelfCheck.getTaskId(), taskPlaceSelfCheck.getStatus());
      ITaskService taskService = SpringUtils.getBean(ITaskService.class);
      Long aLong = taskService.updateTask(null, null, null, taskPlaceSelfCheck.getReasonFailure(), AuthUtil.getUserId(), taskPlaceSelfCheck.getTaskId(), taskPlaceSelfCheck.getStatus());
      if (aLong <= 0) {
         return false;
      }
@@ -130,13 +130,16 @@
      if (save) {
         // 3.更新题目记录
         List<TaskPlaceRecordVO> taskPlaceRecordList = taskPlaceSelfCheck.getTaskPlaceRecordVOList();
         ITaskPlaceRecordService bean = SpringUtil.getBean(ITaskPlaceRecordService.class);
         List<TaskPlaceRecordEntity> collect = taskPlaceRecordList.stream().filter(item -> item.getState().equals(0)).collect(Collectors.toList());
         boolean b = bean.updateBatchById(collect);
         if (b) {
            return b;
         if (taskPlaceRecordList != null && taskPlaceRecordList.size() > 0) {
            ITaskPlaceRecordService bean = SpringUtil.getBean(ITaskPlaceRecordService.class);
            List<TaskPlaceRecordEntity> copy = BeanUtil.copy(taskPlaceRecordList, TaskPlaceRecordEntity.class);
            boolean b = bean.saveOrUpdateBatch(copy);
            if (b) {
               return b;
            }
            throw new Exception("保存失败!");
         }
         throw new Exception("保存失败!");
         return save;
      }
      throw new Exception("保存失败!");
   }