aix
2024-06-27 b783839286ff650ed413b6edf17efa8491644737
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java
@@ -78,26 +78,26 @@
      return R.data(tbResGeneralInvestigationService.page(Condition.getPage(query), queryWrapper));
   }
   @ApiOperation(value = "白蚁普查-校核接口", notes = "白蚁普查-添加或者修改")
   @ApiOperation(value = "白蚁普查-校核接口", notes = "白蚁普查-校核接口")
   @PostMapping("/checkInfoByResGuid")
   public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) {
   public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigationState tbResGeneralInvestigationState) {
      if (tbResGeneralInvestigation.getTbStateId() == null || tbResGeneralInvestigation.getCheckState() == null) {
      if (tbResGeneralInvestigationState.getGuid() == null || tbResGeneralInvestigationState.getCheckState() == null) {
         return R.fail(-1,"参数不对");
      }
      //查询根据状态id查询普查记录表
      QueryWrapper queryWrapper = new QueryWrapper();
      queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigation.getTbStateId());
      queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigationState.getGuid());
      List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper);
      List<TbResGeneralInvestigation> editList = list.stream().map(categoryEntity -> {
            categoryEntity.setCheckState(tbResGeneralInvestigation.getCheckState());  // 给每个categoryEntity对象的EvaluateTaskId属性设置新值
            categoryEntity.setCheckState(tbResGeneralInvestigationState.getCheckState());  // 给每个categoryEntity对象的EvaluateTaskId属性设置新值
            return categoryEntity;  // 返回修改后的对象
         })
         .collect(Collectors.toList());
      TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState();
      tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getTbStateId());
      tbResGeneralInvestigationState.setCheckState(tbResGeneralInvestigation.getCheckState());
//      TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState();
//      tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getGuid());
//      tbResGeneralInvestigationState.setCheckState(tbResGeneralInvestigation.getCheckState());
      //更新普查记录表状态和状态表状态
      return R.status(tbResGeneralInvestigationService.updateBatchById(editList) && tbResGeneralInvestigationStateService.updateById(tbResGeneralInvestigationState));