From 3848ff83401d249c1caa5cb57658665b29afed95 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 18 Mar 2024 17:08:11 +0800
Subject: [PATCH] 校核接口修改
---
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java
index 8c20540..126107a 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java
@@ -2,8 +2,10 @@
import cn.gistack.sm.sjztmd.entity.AttResBase;
import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation;
+import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState;
import cn.gistack.sm.sjztmd.service.IAttResBaseService;
import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationService;
+import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationStateService;
import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO;
import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam;
import cn.gistack.sm.sjztmd.wrapper.AttResBaseWrapper;
@@ -21,6 +23,7 @@
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
+import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -40,12 +43,13 @@
public class TbResGeneralInvestigationController {
private ITbResGeneralInvestigationService tbResGeneralInvestigationService;
+ private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService;
private IAttResBaseService attResBaseService;
@ApiOperation(value = "中台水库-分页列表查询", notes = "中台水库-分页列表查询")
@GetMapping(value = "/queryPageResList")
public R queryPageResList(AttResBaseGeneralInvestigationVO attResBase, Query query) {
- IPage<AttResBaseGeneralInvestigationVO> pageList = attResBaseService.selectAttResBaseGeneralInvestigation(Condition.getPage(query), attResBase);
+ Object pageList = attResBaseService.selectAttResBaseGeneralInvestigation(Condition.getPage(query), attResBase);
return R.data(pageList);
}
@@ -72,19 +76,25 @@
@PostMapping("/checkInfoByResGuid")
public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) {
- if (tbResGeneralInvestigation.getResGuid() == null || tbResGeneralInvestigation.getCheckState() == null) {
+ if (tbResGeneralInvestigation.getTbStateId() == null || tbResGeneralInvestigation.getCheckState() == null) {
return R.fail(-1,"参数不对");
}
+ //查询根据状态id查询普查记录表
QueryWrapper queryWrapper = new QueryWrapper();
- queryWrapper.eq("\"res_guid\"", tbResGeneralInvestigation.getResGuid());
+ queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigation.getTbStateId());
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));
+ TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState();
+ tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getTbStateId());
+ tbResGeneralInvestigationState.setCheckState(tbResGeneralInvestigation.getCheckState());
+
+ //更新普查记录表状态和状态表状态
+ return R.status(tbResGeneralInvestigationService.updateBatchById(editList) && tbResGeneralInvestigationStateService.updateById(tbResGeneralInvestigationState));
}
@ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改")
@@ -105,8 +115,9 @@
@PostMapping("/remove")
@ApiOperation(value = "物理删除", notes = "传入id")
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String id) {
- return R.status(tbResGeneralInvestigationService.removeById(id));
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+// return R.status(tbResGeneralInvestigationService.removeBatchByIds(Arrays.asList(ids.split(","))));
+ return R.status(tbResGeneralInvestigationService.removeByIds(Arrays.asList(ids.split(","))));
}
@PostMapping("/getInvestigationListByStateId")
--
Gitblit v1.9.3