From 97c96219d2648684796a637040ab66c3c3798410 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Fri, 3 Feb 2023 11:51:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/thrsys/ThrDeptController.java | 8 ++++++-- .../com/glxp/api/req/thrsys/FilterThrDeptRequest.java | 1 + src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java index d1e17304..dd0ed916 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java @@ -107,11 +107,15 @@ public class ThrDeptController { thrInvWarehouseService.updateThrInvWarehouse(thrInvWarehouseEntity); } //判断部门是否存在 - filterThrDeptRequest.setCode(thrDeptEntity.getCode()); + filterThrDeptRequest.setName(thrDeptEntity.getName()); filterThrDeptRequest.setThirdSysFk(thrDeptEntity.getThirdSysFk()); + filterThrDeptRequest.setStatus(thrDeptEntity.getStatus()); List thrDeptEntities = thrDeptService.filterThrInvWarehouse(filterThrDeptRequest); - if(thrDeptEntities.size()==0){ + filterThrDeptRequest.setCode(thrDeptEntity.getCode()); + filterThrDeptRequest.setName(null); + List thrDeptEntities1= thrDeptService.filterThrInvWarehouse(filterThrDeptRequest); + if(thrDeptEntities.size()==0 && thrDeptEntities1.size()==0){ thrDeptEntity.setPid(null); // 不能修改父级 pid thrDeptEntity.setUpdateTime(new Date()); boolean b = thrDeptService.updateInvWarehouse(thrDeptEntity); diff --git a/src/main/java/com/glxp/api/req/thrsys/FilterThrDeptRequest.java b/src/main/java/com/glxp/api/req/thrsys/FilterThrDeptRequest.java index a136ecdb..63514c80 100644 --- a/src/main/java/com/glxp/api/req/thrsys/FilterThrDeptRequest.java +++ b/src/main/java/com/glxp/api/req/thrsys/FilterThrDeptRequest.java @@ -16,6 +16,7 @@ public class FilterThrDeptRequest extends ListPageRequest { private Boolean isDefault; private Date updateTime; private String key; + private Integer status; private String pcode; private Integer level; diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml index 3a633886..aeab337f 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml @@ -38,6 +38,9 @@ and thirdSysFk = #{thirdSysFk} + + and status = #{status} +