From 9f46d82b7de2414dd205e8885db1635db5f7f321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 26 Feb 2023 22:56:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=85=B3=E9=97=AD=E5=A4=9A?= =?UTF-8?q?=E7=BA=A7=E5=AE=A1=E6=A0=B8=EF=BC=8C=E9=81=87=E5=88=B0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=AE=A1=E6=A0=B8=E8=8F=9C=E5=8D=95=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/FunctionController.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java index efb8499e..7ae545a6 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java @@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.datasource.entities.Function; +import com.jsh.erp.datasource.entities.SystemConfig; import com.jsh.erp.datasource.entities.User; import com.jsh.erp.datasource.entities.UserBusiness; import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.service.functions.FunctionService; +import com.jsh.erp.service.systemConfig.SystemConfigService; import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.ErpInfo; @@ -44,6 +46,9 @@ public class FunctionController { @Resource private UserBusinessService userBusinessService; + @Resource + private SystemConfigService systemConfigService; + @GetMapping(value = "/checkIsNumberExist") @ApiOperation(value = "检查编号是否存在") public String checkIsNumberExist(@RequestParam Long id, @@ -90,9 +95,15 @@ public class FunctionController { if(funList!=null && funList.size()>0){ fc = funList.get(0).getValue(); } + //获取系统配置信息-是否开启多级审核 + String approvalFlag = "0"; + List list = systemConfigService.getSystemConfig(); + if(list.size()>0) { + approvalFlag = list.get(0).getMultiLevelApprovalFlag(); + } List dataList = functionService.getRoleFunction(pNumber); if (dataList.size() != 0) { - dataArray = getMenuByFunction(dataList, fc); + dataArray = getMenuByFunction(dataList, fc, approvalFlag); //增加首页菜单项 JSONObject homeItem = new JSONObject(); homeItem.put("id", 0); @@ -108,9 +119,13 @@ public class FunctionController { return dataArray; } - public JSONArray getMenuByFunction(List dataList, String fc) throws Exception { + public JSONArray getMenuByFunction(List dataList, String fc, String approvalFlag) throws Exception { JSONArray dataArray = new JSONArray(); for (Function function : dataList) { + //如果关闭多级审核,遇到任务审核菜单直接跳过 + if("0".equals(approvalFlag) && "/workflow".equals(function.getUrl())) { + continue; + } JSONObject item = new JSONObject(); List newList = functionService.getRoleFunction(function.getNumber()); item.put("id", function.getId()); @@ -119,7 +134,7 @@ public class FunctionController { item.put("url", function.getUrl()); item.put("component", function.getComponent()); if (newList.size()>0) { - JSONArray childrenArr = getMenuByFunction(newList, fc); + JSONArray childrenArr = getMenuByFunction(newList, fc, approvalFlag); if(childrenArr.size()>0) { item.put("children", childrenArr); dataArray.add(item);