diff --git a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java index e8a5614d..37a1ee93 100644 --- a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java +++ b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java @@ -242,19 +242,25 @@ public class InvWarehouseController extends BaseController { return ResultVOUtils.error(500, "修改失败,请先移除该仓库关联用户!"); } + // 先判断是否有相同名字的仓库 + boolean checkResult = invWarehouseService.checkDuplicateName(invWarehouseEntity.getParentId(), invWarehouseEntity.getName()); + if (checkResult) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "仓库名称重复!"); + } + //更新仓库信息 invWarehouseEntity.setUpdateTime(new Date()); boolean b = invWarehouseService.updateInvSubWarehouse(invWarehouseEntity); - //如果要是一级仓库就吧全部子集都刷成一样的寄售仓库 - if (StrUtil.isBlank(invWarehouseEntity.getParentCode())) { - List invWarehouseEntityList = invWarehouseService.selectLowWarehouseAll(invWarehouseEntity.getCode()); - for (InvWarehouseEntity obj : invWarehouseEntityList) { - obj.setAdvanceType(invWarehouseEntity.getAdvanceType()); - obj.setUpdateTime(new Date()); - invWarehouseService.updateInvSubWarehouse(obj); - } - } +// //如果要是一级仓库就吧全部子集都刷成一样的寄售仓库 +// if (StrUtil.isBlank(invWarehouseEntity.getParentCode())) { +// List invWarehouseEntityList = invWarehouseService.selectLowWarehouseAll(invWarehouseEntity.getCode()); +// for (InvWarehouseEntity obj : invWarehouseEntityList) { +// obj.setAdvanceType(invWarehouseEntity.getAdvanceType()); +// obj.setUpdateTime(new Date()); +// invWarehouseService.updateInvSubWarehouse(obj); +// } +// } //更新部门信息 diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index 39bc4950..3beeeb25 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -309,6 +309,8 @@ public class SysUserController extends BaseController { for (DeptUserEntity deptUserEntity : deptUserEntities) { if(deptUserEntity.getDeptId() == 1){ checkDeptId=true; + }else{ + deptCodeList.add(deptUserEntity.getDeptId()); } } if(checkDeptId==false){ diff --git a/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml b/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml index 953f1165..e938ce0a 100644 --- a/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml +++ b/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml @@ -79,7 +79,7 @@ delete from auth_dept_user - where userId = #{userId} + where userId = #{userId} and deptId != 1 delete