mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
1、deptService单测完善;2、贴皮veneer service单测剥离真实db,使用纯mock;
This commit is contained in:
+12
-14
@@ -299,20 +299,18 @@ public class DeptServiceImpl implements DeptService {
|
||||
* @param deptDO
|
||||
*/
|
||||
private void validParentDept(DeptDO deptDO) {
|
||||
if (ObjectUtil.isNotNull(deptDO) && ObjectUtil.isNotNull(deptDO.getParentId())) {
|
||||
Long parentId = deptDO.getParentId();
|
||||
DeptDO parentDept = deptMapper.selectById(parentId);
|
||||
if (ObjectUtil.equal(parentId, 0L)) {
|
||||
// 上级部门id是0代表是机构下最顶级的部门
|
||||
return;
|
||||
}
|
||||
if (parentDept == null) {
|
||||
throw new ServiceException(ErrorCodeConstants.DEPT_PARENT_NOT_EXITS);
|
||||
} else if (!CommonStatusEnum.ENABLE.getStatus().equals(parentDept.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeConstants.DEPT_DISABLE, parentDept.getName());
|
||||
} else {
|
||||
validParentDept(parentDept);
|
||||
}
|
||||
Long parentId = deptDO.getParentId();
|
||||
DeptDO parentDept = deptMapper.selectById(parentId);
|
||||
if (ObjectUtil.equal(parentId, 0L)) {
|
||||
// 上级部门id是0代表是机构下最顶级的部门
|
||||
return;
|
||||
}
|
||||
if (parentDept == null) {
|
||||
throw new ServiceException(ErrorCodeConstants.DEPT_PARENT_NOT_EXITS);
|
||||
} else if (!CommonStatusEnum.ENABLE.getStatus().equals(parentDept.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeConstants.DEPT_DISABLE, parentDept.getName());
|
||||
} else {
|
||||
validParentDept(parentDept);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user