启用父部门状态排除顶级节点

pull/314/head
RuoYi 2021-07-30 11:57:33 +08:00
parent 42c7c4fdc6
commit db9bd47422
2 changed files with 4 additions and 3 deletions

View File

@ -133,7 +133,7 @@ public class SysJobController extends BaseController
{ {
if (!CronUtils.isValid(job.getCronExpression())) if (!CronUtils.isValid(job.getCronExpression()))
{ {
return AjaxResult.error("新增任务'" + job.getJobName() + "'失败Cron表达式不正确"); return error("新增任务'" + job.getJobName() + "'失败Cron表达式不正确");
} }
else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
{ {
@ -167,7 +167,7 @@ public class SysJobController extends BaseController
{ {
if (!CronUtils.isValid(job.getCronExpression())) if (!CronUtils.isValid(job.getCronExpression()))
{ {
return AjaxResult.error("修改任务'" + job.getJobName() + "'失败Cron表达式不正确"); return error("修改任务'" + job.getJobName() + "'失败Cron表达式不正确");
} }
else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
{ {

View File

@ -227,7 +227,8 @@ public class SysDeptServiceImpl implements ISysDeptService
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
} }
int result = deptMapper.updateDept(dept); int result = deptMapper.updateDept(dept);
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())) if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
&& !StringUtils.equals("0", dept.getAncestors()))
{ {
// 如果该部门是启用状态,则启用该部门的所有上级部门 // 如果该部门是启用状态,则启用该部门的所有上级部门
updateParentDeptStatusNormal(dept); updateParentDeptStatusNormal(dept);