Commit 9198f561 by hzc

修改下发对象的获取,审核人的获取

parent 9ddbd2a0
...@@ -7,6 +7,7 @@ import com.keymobile.indicators.model.entity.ConfigInfo; ...@@ -7,6 +7,7 @@ import com.keymobile.indicators.model.entity.ConfigInfo;
import com.keymobile.indicators.model.entity.RoleModel; import com.keymobile.indicators.model.entity.RoleModel;
import com.keymobile.indicators.model.entity.dataenter.TaskRule; import com.keymobile.indicators.model.entity.dataenter.TaskRule;
import com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj; import com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj;
import com.keymobile.indicators.model.entity.dataenter.TaskRuleTargetRoles;
import com.keymobile.indicators.result.Result; import com.keymobile.indicators.result.Result;
import com.keymobile.indicators.service.ConfigInfoService; import com.keymobile.indicators.service.ConfigInfoService;
import com.keymobile.indicators.service.SystemAuthService; import com.keymobile.indicators.service.SystemAuthService;
...@@ -153,35 +154,21 @@ public class TaskRuleCtrl { ...@@ -153,35 +154,21 @@ public class TaskRuleCtrl {
@ApiOperation("根据规则类型获取可配置的角色") @ApiOperation("根据规则类型获取可配置的角色")
@GetMapping("findTaskRoles") @GetMapping("findTaskRoles")
public List<RoleModel> findTaskRoles(@ApiParam("规则类型:1 省 2 市 3 县") public List<RoleModel> findTaskRoles(@ApiParam("机构编码")
@RequestParam(value = "ruleType", required = false) Integer ruleType) { @RequestParam(value = "orgNo") String orgNo) {
List<RoleModel> result = new ArrayList<>(); List<RoleModel> result = new ArrayList<>();
ConfigInfo configInfo = null; TaskRuleTargetRoles taskRuleTargetRoles = taskRuleService.getByOrgNo(orgNo);
switch (ruleType) { System.out.println("taskRuleTargetRoles:"+taskRuleTargetRoles);
case 1: if (taskRuleTargetRoles != null) {
configInfo = String roleNamesStr = taskRuleTargetRoles.getEnterRoleNames();
configInfoService.getConfigInfoById(Constants.RULE_PROVINCE_ENTER_ROLE); String roleIdsStr = taskRuleTargetRoles.getEnterRoleIds();
break;
case 2: List<String> roleNames = Arrays.asList(StringUtils.split(roleNamesStr, Constants.SEP_COMMA));
configInfo = List<String> roleIds = Arrays.asList(StringUtils.split(roleIdsStr, Constants.SEP_COMMA));
configInfoService.getConfigInfoById(Constants.RULE_CITY_ENTER_ROLE); for (int i= 0; i < roleIds.size(); i++) {
break;
case 3:
configInfo =
configInfoService.getConfigInfoById(Constants.RULE_COUNTY_ENTER_ROLE);
break;
default:
break;
}
if (configInfo != null) {
String value = configInfo.getCfValue();
List<String> ids = Arrays.asList(StringUtils.split(value, Constants.SEP_COMMA));
List<JSONObject> roles = systemAuthService.getRolesByIds(ids);
for (int i= 0; i < roles.size(); i++) {
JSONObject role = roles.get(i);
RoleModel r = new RoleModel(); RoleModel r = new RoleModel();
r.setId(role.getString("id")); r.setId(roleIds.get(i));
r.setName(role.getString("disname")); r.setName(roleNames.get(i));
result.add(r); result.add(r);
} }
} }
......
...@@ -167,7 +167,8 @@ public class TaskRuleServiceImpl implements TaskRuleService { ...@@ -167,7 +167,8 @@ public class TaskRuleServiceImpl implements TaskRuleService {
List<JSONObject> roles = systemAuthService.getRolesByIds(ids); List<JSONObject> roles = systemAuthService.getRolesByIds(ids);
if (CollectionUtils.isNotEmpty(roles)) { if (CollectionUtils.isNotEmpty(roles)) {
targetRoles.setAuditRoleNames(toGetRoleNames(roles, aids)); targetRoles.setAuditRoleNames(toGetRoleNames(roles, aids));
targetRoles.setEnterRoleIds(toGetRoleNames(roles, eids)); // targetRoles.setEnterRoleIds(toGetRoleNames(roles, eids));
targetRoles.setEnterRoleNames(toGetRoleNames(roles, eids));
} }
} }
} }
......
...@@ -77,6 +77,9 @@ public class TaskServiceImpl implements TaskService { ...@@ -77,6 +77,9 @@ public class TaskServiceImpl implements TaskService {
@Autowired @Autowired
private NoticeInfoService noticeInfoService; private NoticeInfoService noticeInfoService;
@Autowired
private TaskRuleTargetRolesMapper taskRuleTargetRolesMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Task createTask(Task task) { public Task createTask(Task task) {
...@@ -281,16 +284,8 @@ public class TaskServiceImpl implements TaskService { ...@@ -281,16 +284,8 @@ public class TaskServiceImpl implements TaskService {
Task task = taskMapper.getById(taskId); Task task = taskMapper.getById(taskId);
String ruleLevel = task.getRuleLevel(); String ruleLevel = task.getRuleLevel();
String orgNo = task.getOrgNo(); String orgNo = task.getOrgNo();
ConfigInfo configInfo = null; TaskRuleTargetRoles taskRuleTargetRoles = taskRuleTargetRolesMapper.getByOrgNo(orgNo);
if(StringUtils.isNotBlank(orgNo)){
if(orgNo.length()==2){
configInfo = configInfoService.getConfigInfoById(Constants.RULE_PROVINCE_AUDIT_ROLE);
}else if(orgNo.length()==4){
configInfo = configInfoService.getConfigInfoById(Constants.RULE_CITY_AUDIT_ROLE);
}else if(orgNo.length()==6){
configInfo = configInfoService.getConfigInfoById(Constants.RULE_COUNTY_AUDIT_ROLE);
}
}
// ConfigInfo configInfo = null; // ConfigInfo configInfo = null;
// if (Constants.PRIVINCE_TO_CITY.equals(ruleLevel)) { // if (Constants.PRIVINCE_TO_CITY.equals(ruleLevel)) {
// configInfo = configInfoService.getConfigInfoById(Constants.RULE_PROVINCE_AUDIT_ROLE); // configInfo = configInfoService.getConfigInfoById(Constants.RULE_PROVINCE_AUDIT_ROLE);
...@@ -299,9 +294,9 @@ public class TaskServiceImpl implements TaskService { ...@@ -299,9 +294,9 @@ public class TaskServiceImpl implements TaskService {
// } else if (Constants.CITY_TO_COUNTY.equals(ruleLevel)) { // } else if (Constants.CITY_TO_COUNTY.equals(ruleLevel)) {
// configInfo = configInfoService.getConfigInfoById(Constants.RULE_COUNTY_AUDIT_ROLE); // configInfo = configInfoService.getConfigInfoById(Constants.RULE_COUNTY_AUDIT_ROLE);
// } // }
if (configInfo != null) { if (taskRuleTargetRoles != null) {
String indDept = task.getRefIndDept(); String indDept = task.getRefIndDept();
List<RoleRefUserModel> users = getUserByRoleIdStr(configInfo.getCfValue()); List<RoleRefUserModel> users = getUserByRoleIdStr(taskRuleTargetRoles.getAuditRoleIds());
if (CollectionUtils.isNotEmpty(users)) { if (CollectionUtils.isNotEmpty(users)) {
StringBuilder userIds = new StringBuilder(Constants.SEP_COMMA); StringBuilder userIds = new StringBuilder(Constants.SEP_COMMA);
StringBuilder userNames = new StringBuilder(Constants.SEP_COMMA); StringBuilder userNames = new StringBuilder(Constants.SEP_COMMA);
......
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