Commit 9198f561 by hzc

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

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