From 1feab42ac5865beb38629f13da78a3433a9ec491 Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 14 Jul 2023 18:14:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequirementEntityController.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/controller/RequirementEntityController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/controller/RequirementEntityController.java index 930322f..1734600 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/controller/RequirementEntityController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/controller/RequirementEntityController.java @@ -230,18 +230,23 @@ public class RequirementEntityController extends JeecgController hb(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="id",required=true) String id) { - List listids = Arrays.asList(ids.split(",")); - for (int i = 0 ; i < listids.size(); i++){ - if(!id.equals(listids.get(i))){ - RequirementEntity requirementEntity = requirementEntityService.getById(listids.get(i)); - requirementEntity.setEntityStatus(9); - requirementEntityService.updateById(requirementEntity); - } - } RequirementEntity requirementEntity1 = requirementEntityService.getById(id); - requirementEntity1.setEntityStatus(2); - requirementEntityService.updateById(requirementEntity1); - return Result.OK("成功"); + if(requirementEntity1.getEntityStatus()==9){ + return Result.error("该实体已废弃,需撤回废弃后再保留"); + }else{ + List listids = Arrays.asList(ids.split(",")); + for (int i = 0 ; i < listids.size(); i++){ + if(!id.equals(listids.get(i))){ + RequirementEntity requirementEntity = requirementEntityService.getById(listids.get(i)); + requirementEntity.setEntityStatus(9); + requirementEntityService.updateById(requirementEntity); + } + } + requirementEntity1.setEntityStatus(2); + requirementEntityService.updateById(requirementEntity1); + return Result.OK("成功"); + } + } /**