linwei
2024-02-20 e67a8a7477096a295d65afa1c366d2b59f8752fc
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;
      }
@@ -116,4 +116,31 @@
      return false;
   }
   @Override
   @Transactional(rollbackFor = Exception.class)
   public Boolean updateTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception {
      // 1.更新任务表
      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;
      }
      // 2.更新任务详情
      boolean save = updateById(taskPlaceSelfCheck);
      if (save) {
         // 3.更新题目记录
         List<TaskPlaceRecordVO> taskPlaceRecordList = taskPlaceSelfCheck.getTaskPlaceRecordVOList();
         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("保存失败!");
         }
         return save;
      }
      throw new Exception("保存失败!");
   }
}