瀏覽代碼

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

RuoYi 3 年之前
父節點
當前提交
db9bd47422

+ 2 - 2
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java

@@ -133,7 +133,7 @@ public class SysJobController extends BaseController
     {
         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))
         {
@@ -167,7 +167,7 @@ public class SysJobController extends BaseController
     {
         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))
         {

+ 2 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@@ -227,7 +227,8 @@ public class SysDeptServiceImpl implements ISysDeptService
             updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
         }
         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);