Commit 26762fba by 张祺

修改任务生成的问题

parent 5b3dc947
...@@ -165,4 +165,10 @@ public class Constants { ...@@ -165,4 +165,10 @@ public class Constants {
* ruleType=3 县级对标 * ruleType=3 县级对标
*/ */
public static final int RULE_TYPE_COUNTY = 3; public static final int RULE_TYPE_COUNTY = 3;
public static final String PRIVINCE_TO_CITY = "省对市";
public static final String PRIVINCE_TO_COUNTY = "省对县";
public static final String CITY_TO_COUNTY = "市对县";
} }
...@@ -277,21 +277,14 @@ public class TaskServiceImpl implements TaskService { ...@@ -277,21 +277,14 @@ public class TaskServiceImpl implements TaskService {
Result result = null; Result result = null;
Date now = new Date(); Date now = new Date();
Task task = taskMapper.getById(taskId); Task task = taskMapper.getById(taskId);
Integer ruleType = task.getRuleType(); String ruleLevel = task.getRuleLevel();
ConfigInfo configInfo = null; ConfigInfo configInfo = null;
switch (ruleType) { if (Constants.PRIVINCE_TO_CITY.equals(ruleLevel)) {
case Constants.RULE_TYPE_PROVINCE:
configInfo = configInfoService.getConfigInfoById(Constants.RULE_PROVINCE_AUDIT_ROLE); configInfo = configInfoService.getConfigInfoById(Constants.RULE_PROVINCE_AUDIT_ROLE);
break; } else if (Constants.PRIVINCE_TO_COUNTY.equals(ruleLevel)) {
case Constants.RULE_TYPE_CITY:
configInfo = configInfoService.getConfigInfoById(Constants.RULE_CITY_AUDIT_ROLE); configInfo = configInfoService.getConfigInfoById(Constants.RULE_CITY_AUDIT_ROLE);
break; } else if (Constants.CITY_TO_COUNTY.equals(ruleLevel)) {
case Constants.RULE_TYPE_COUNTY:
configInfo = configInfoService.getConfigInfoById(Constants.RULE_COUNTY_AUDIT_ROLE); configInfo = configInfoService.getConfigInfoById(Constants.RULE_COUNTY_AUDIT_ROLE);
break;
default:
configInfo = configInfoService.getConfigInfoById(Constants.RULE_PROVINCE_AUDIT_ROLE);
break;
} }
if (configInfo != null) { if (configInfo != null) {
String indDept = task.getRefIndDept(); String indDept = task.getRefIndDept();
...@@ -346,15 +339,15 @@ public class TaskServiceImpl implements TaskService { ...@@ -346,15 +339,15 @@ public class TaskServiceImpl implements TaskService {
LogManager.logInfo(Constants.LOG_CONTEXT_API, "{}提交任务id:{},name:{}到审核", LogManager.logInfo(Constants.LOG_CONTEXT_API, "{}提交任务id:{},name:{}到审核",
user, taskId, task.getRuleName()); user, taskId, task.getRuleName());
} else { } else {
result = Result.genFailedResult("此配置此任务审批人,ruleType=" + ruleType + ",归属部门=" + indDept); result = Result.genFailedResult("此配置此任务审批人,ruleLevel=" + ruleLevel + ",归属部门=" + indDept);
} }
} else { } else {
result = Result.genFailedResult("系统配置的角色没有用户,ruleType=" + ruleType); result = Result.genFailedResult("系统配置的角色没有用户,ruleLevel=" + ruleLevel);
} }
} else { } else {
result = Result.genFailedResult("系统没有配置此任务的审批角色,ruleType=" + ruleType); result = Result.genFailedResult("系统没有配置此任务的审批角色,ruleLevel=" + ruleLevel);
LogManager.logInfo(Constants.LOG_CONTEXT_API, "提交任务taskId={}失败没有配置ruleType={}的审批角色", LogManager.logInfo(Constants.LOG_CONTEXT_API, "提交任务taskId={}失败没有配置ruleLevel={}的审批角色",
taskId, ruleType); taskId, ruleLevel);
} }
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment