From dffbc6a283fb82de3e2274d31815621a69ea38cc Mon Sep 17 00:00:00 2001 From: sk1551 <15175617877@163.com> Date: Wed, 9 Sep 2020 16:37:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=A8=E8=AE=A1=E5=88=92=E5=92=8C=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=20=20=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../benyi/controller/ByPlanweekController.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByPlanweekController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByPlanweekController.java index d75ad6b31..ddc8195b4 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByPlanweekController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByPlanweekController.java @@ -3,6 +3,11 @@ package com.ruoyi.project.benyi.controller; import java.util.List; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.project.benyi.domain.ByPlanweekitem; +import com.ruoyi.project.benyi.domain.ByPlanweekitem; +import com.ruoyi.project.benyi.service.impl.ByPlanweekServiceImpl; +import com.ruoyi.project.benyi.service.IByPlanweekitemService; + import com.ruoyi.project.common.SchoolCommon; import com.ruoyi.project.system.service.IByClassService; import com.ruoyi.project.system.service.ISysUserService; @@ -42,6 +47,8 @@ public class ByPlanweekController extends BaseController { private IByClassService byClassService; @Autowired private ISysUserService userService; + @Autowired + private IByPlanweekitemService byPlanweekItemService; /** * 查询周计划(家长和教育部门)列表 @@ -142,6 +149,15 @@ public class ByPlanweekController extends BaseController { @Log(title = "周计划(家长和教育部门)", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { + //首先判断当前id下是否存在子目录 + for (int i = 0; i < ids.length; i++) { + ByPlanweekitem byPlanweekitem = new ByPlanweekitem(); + byPlanweekitem.setWid(ids[i]); + List list = byPlanweekItemService.selectByPlanweekitemList(byPlanweekitem); + if (list != null && list.size() > 0) { + return AjaxResult.error("选中的计划下存在子计划,无法删除"); + } + } return toAjax(byPlanweekService.deleteByPlanweekByIds(ids)); } }