如果关闭多级审核,遇到任务审核菜单直接跳过
This commit is contained in:
@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jsh.erp.constants.ExceptionConstants;
|
import com.jsh.erp.constants.ExceptionConstants;
|
||||||
import com.jsh.erp.datasource.entities.Function;
|
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.User;
|
||||||
import com.jsh.erp.datasource.entities.UserBusiness;
|
import com.jsh.erp.datasource.entities.UserBusiness;
|
||||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||||
import com.jsh.erp.service.functions.FunctionService;
|
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.service.userBusiness.UserBusinessService;
|
||||||
import com.jsh.erp.utils.BaseResponseInfo;
|
import com.jsh.erp.utils.BaseResponseInfo;
|
||||||
import com.jsh.erp.utils.ErpInfo;
|
import com.jsh.erp.utils.ErpInfo;
|
||||||
@@ -44,6 +46,9 @@ public class FunctionController {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserBusinessService userBusinessService;
|
private UserBusinessService userBusinessService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SystemConfigService systemConfigService;
|
||||||
|
|
||||||
@GetMapping(value = "/checkIsNumberExist")
|
@GetMapping(value = "/checkIsNumberExist")
|
||||||
@ApiOperation(value = "检查编号是否存在")
|
@ApiOperation(value = "检查编号是否存在")
|
||||||
public String checkIsNumberExist(@RequestParam Long id,
|
public String checkIsNumberExist(@RequestParam Long id,
|
||||||
@@ -90,9 +95,15 @@ public class FunctionController {
|
|||||||
if(funList!=null && funList.size()>0){
|
if(funList!=null && funList.size()>0){
|
||||||
fc = funList.get(0).getValue();
|
fc = funList.get(0).getValue();
|
||||||
}
|
}
|
||||||
|
//获取系统配置信息-是否开启多级审核
|
||||||
|
String approvalFlag = "0";
|
||||||
|
List<SystemConfig> list = systemConfigService.getSystemConfig();
|
||||||
|
if(list.size()>0) {
|
||||||
|
approvalFlag = list.get(0).getMultiLevelApprovalFlag();
|
||||||
|
}
|
||||||
List<Function> dataList = functionService.getRoleFunction(pNumber);
|
List<Function> dataList = functionService.getRoleFunction(pNumber);
|
||||||
if (dataList.size() != 0) {
|
if (dataList.size() != 0) {
|
||||||
dataArray = getMenuByFunction(dataList, fc);
|
dataArray = getMenuByFunction(dataList, fc, approvalFlag);
|
||||||
//增加首页菜单项
|
//增加首页菜单项
|
||||||
JSONObject homeItem = new JSONObject();
|
JSONObject homeItem = new JSONObject();
|
||||||
homeItem.put("id", 0);
|
homeItem.put("id", 0);
|
||||||
@@ -108,9 +119,13 @@ public class FunctionController {
|
|||||||
return dataArray;
|
return dataArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONArray getMenuByFunction(List<Function> dataList, String fc) throws Exception {
|
public JSONArray getMenuByFunction(List<Function> dataList, String fc, String approvalFlag) throws Exception {
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
for (Function function : dataList) {
|
for (Function function : dataList) {
|
||||||
|
//如果关闭多级审核,遇到任务审核菜单直接跳过
|
||||||
|
if("0".equals(approvalFlag) && "/workflow".equals(function.getUrl())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
List<Function> newList = functionService.getRoleFunction(function.getNumber());
|
List<Function> newList = functionService.getRoleFunction(function.getNumber());
|
||||||
item.put("id", function.getId());
|
item.put("id", function.getId());
|
||||||
@@ -119,7 +134,7 @@ public class FunctionController {
|
|||||||
item.put("url", function.getUrl());
|
item.put("url", function.getUrl());
|
||||||
item.put("component", function.getComponent());
|
item.put("component", function.getComponent());
|
||||||
if (newList.size()>0) {
|
if (newList.size()>0) {
|
||||||
JSONArray childrenArr = getMenuByFunction(newList, fc);
|
JSONArray childrenArr = getMenuByFunction(newList, fc, approvalFlag);
|
||||||
if(childrenArr.size()>0) {
|
if(childrenArr.size()>0) {
|
||||||
item.put("children", childrenArr);
|
item.put("children", childrenArr);
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user