From feb826a9165076a6658917015c63b804f9f219b7 Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 26 Jun 2023 15:34:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/requirementtype/RequirementTypeList.vue | 4 ++-- .../controller/RequirementTypeController.java | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue b/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue index 2577ae6..a4b316c 100644 --- a/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue +++ b/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue @@ -30,10 +30,10 @@ - + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java index e4b755f..e4e65594 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java @@ -109,9 +109,17 @@ public class RequirementTypeController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { - requirementTypeService.removeById(id); - return Result.OK("删除成功!"); + public Result delete(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { + RequirementType requirementType = new RequirementType(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(requirementType, req.getParameterMap()); + queryWrapper.eq("upper_id",id); + List list = requirementTypeService.list(queryWrapper); + if(list.size()>0){ + return Result.error("包含有下级需求类型,无法删除"); + }else{ + requirementTypeService.removeById(id); + return Result.OK("删除成功!"); + } } /**