|
@@ -48,7 +48,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
queryWrapper.eq("name", addDeptInfoVO.getName());
|
|
|
- if (this.count(queryWrapper) > 1) {
|
|
|
+ if (this.count(queryWrapper) > 0) {
|
|
|
throw new CommonException(CommonErrorCode.IS_EXISTS, "添加失败,科室已存在");
|
|
|
}
|
|
|
//添加科室
|
|
@@ -71,6 +71,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean updateDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
|
|
|
+ //判断科室是否已被删除
|
|
|
QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("is_deleted",IsDeleteEnum.Y.getKey());
|
|
|
queryWrapper.eq("id",updateDeptInfoVO.getId());
|
|
@@ -78,6 +79,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"科室已删除");
|
|
|
}
|
|
|
+ //修改操作
|
|
|
DeptInfo deptInfo = this.getById(updateDeptInfoVO.getId());
|
|
|
BeanUtil.copyProperties(updateDeptInfoVO, deptInfo);
|
|
|
deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
|
|
@@ -93,6 +95,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean deleteDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
|
|
|
+ //判断科室是否已被删除
|
|
|
QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("is_deleted",IsDeleteEnum.Y.getKey());
|
|
|
queryWrapper.eq("id",updateDeptInfoVO.getId());
|
|
@@ -100,6 +103,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"科室已删除");
|
|
|
}
|
|
|
+ //删除操作
|
|
|
DeptInfo deptInfo = new DeptInfo();
|
|
|
BeanUtil.copyProperties(updateDeptInfoVO, deptInfo);
|
|
|
deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
|