|
@@ -85,6 +85,21 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
"科室已删除");
|
|
|
}
|
|
|
+ //判断科室是否重名
|
|
|
+ Boolean boole = false;
|
|
|
+ QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
+ .notIn("id",updateDeptInfoVO.getId());
|
|
|
+ List<DeptInfo> deptInfoList = this.list(queryWrapper);
|
|
|
+ for (DeptInfo deptInfo: deptInfoList) {
|
|
|
+ if(updateDeptInfoVO.getName().equals(deptInfo.getName())){
|
|
|
+ boole = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(boole){
|
|
|
+ throw new CommonException(CommonErrorCode.IS_EXISTS,
|
|
|
+ "科室名称重复");
|
|
|
+ }
|
|
|
//修改操作
|
|
|
DeptInfo deptInfo = this.getById(updateDeptInfoVO.getId());
|
|
|
BeanUtil.copyProperties(updateDeptInfoVO, deptInfo);
|