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("成功"); + } + } /**