|
@@ -79,7 +79,7 @@ public class TmDepartmentServiceImpl extends ServiceImpl<ITmDepartmentMapper, Tm
|
|
|
if(dept.getId().equals(dept.getParentId())){
|
|
|
throw new BusinessException(ResultCode.DEPT_EDIT_ERROR);
|
|
|
}
|
|
|
- if(dept.getLevel() >4){
|
|
|
+ if(dept.getLevel() != null && dept.getLevel() >4){
|
|
|
throw new BusinessException(ResultCode.DEPT_ADD_ERROR);
|
|
|
}
|
|
|
List<TmDepartment> sonByDeptId = this.getSonByDeptId(dept.getId());
|
|
@@ -197,7 +197,7 @@ public class TmDepartmentServiceImpl extends ServiceImpl<ITmDepartmentMapper, Tm
|
|
|
if(tmDepartment == null){
|
|
|
throw new BusinessException(ResultCode.NOT_DEPT.code,ResultCode.NOT_DEPT.msg +":"+deptId);
|
|
|
}
|
|
|
- if(tmDepartment.getDeptType()==1 ){
|
|
|
+ if(tmDepartment.getDeptType()==0 || tmDepartment.getDeptType()==1 ){
|
|
|
return tmDepartment.getId();
|
|
|
}
|
|
|
return getZdDeptId(tmDepartment.getParentId());
|