xieb
2024-01-11 f828eacec5b5da55faf874bf15c458a6d2a97ec4
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java
@@ -21,7 +21,9 @@
import springfox.documentation.annotations.ApiIgnore;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @PROJECT_NAME: skjcmanager
@@ -56,9 +58,30 @@
         queryWrapper.like("\"res_name\"", param.getResName());
      if (!StringUtil.isBlank(param.getResGuid()))
         queryWrapper.like("\"res_guid\"", param.getResGuid());
      if (!StringUtil.isBlank(param.getCreateUser()))
         queryWrapper.like("\"create_user\"", param.getCreateUser());
      return R.data(tbResGeneralInvestigationService.page(Condition.getPage(query), queryWrapper));
   }
   @ApiOperation(value = "白蚁普查-校核接口", notes = "白蚁普查-添加或者修改")
   @PostMapping("/checkInfoByResGuid")
   public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) {
      if (tbResGeneralInvestigation.getResGuid() == null || tbResGeneralInvestigation.getCheckState() == null) {
         return R.fail(-1,"参数不对");
      }
      QueryWrapper queryWrapper = new QueryWrapper();
      queryWrapper.eq("\"res_guid\"", tbResGeneralInvestigation.getResGuid());
      List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper);
      List<TbResGeneralInvestigation> editList = list.stream().map(categoryEntity -> {
            categoryEntity.setCheckState(tbResGeneralInvestigation.getCheckState());  // 给每个categoryEntity对象的EvaluateTaskId属性设置新值
            return categoryEntity;  // 返回修改后的对象
         })
         .collect(Collectors.toList());
      return R.status(tbResGeneralInvestigationService.updateBatchById(editList));
   }
   @ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改")
   @PostMapping(value = "/submit")
   public R submit(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) {