Commit d8829128 by 张祺

修改任务关联指标项和用户模型

parent 921ac44b
......@@ -2,8 +2,7 @@ package com.keymobile.indicators.api.hytobacco;
import com.alibaba.fastjson.JSONObject;
import com.keymobile.indicators.constant.Constants;
import com.keymobile.indicators.model.entity.AuthModel;
import com.keymobile.indicators.model.entity.UserModel;
import com.keymobile.indicators.model.entity.RoleRefUserModel;
import com.keymobile.indicators.model.entity.dataenter.*;
import com.keymobile.indicators.model.entity.indicators.BaseIndDef;
import com.keymobile.indicators.result.Result;
......@@ -11,7 +10,6 @@ import com.keymobile.indicators.service.SystemAuthService;
import com.keymobile.indicators.service.dataenter.TaskRuleService;
import com.keymobile.indicators.service.dataenter.TaskService;
import com.keymobile.indicators.service.hytobacco.IndicatorsRelService;
import com.keymobile.indicators.utils.IdWorker;
import com.keymobile.indicators.utils.SystemUserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -52,14 +50,14 @@ public class TaskCtrl {
String roleIdStr = rule.getToRoleIds();
if (StringUtils.isNotBlank(roleIdStr)) {
String[] roleIds = StringUtils.split(roleIdStr, Constants.SEP_COMMA);
List<UserModel> users = new ArrayList<>();
List<RoleRefUserModel> users = new ArrayList<>();
for (String roleId : roleIds) {
List<JSONObject> list =
systemAuthService.findUserList(roleId, true,
null, null, null, 1, 100);
if (CollectionUtils.isNotEmpty(list)) {
for (JSONObject jo : list) {
UserModel user = new UserModel();
RoleRefUserModel user = new RoleRefUserModel();
user.setId(jo.getString("id"));
user.setDisName(jo.getString("disname"));
if (!users.contains(user)) {
......@@ -110,7 +108,8 @@ public class TaskCtrl {
TaskIndicator taskIndicator = new TaskIndicator();
taskIndicator.setIndFormula(baseIndDef.getIndFormat());
taskIndicator.setRuleId(ruleId);
taskIndicator.setIndSource(Integer.parseInt(baseIndDef.getIndSource()));
taskIndicator.setParentIndId(parentIndId);
taskIndicator.setIndSource(baseIndDef.getIndSource());
taskIndicator.setIndUnit(baseIndDef.getIndUnit());
taskIndicator.setIndId(baseIndDef.getIndId());
if (!taskIndicators.contains(taskIndicator)) {
......@@ -118,7 +117,7 @@ public class TaskCtrl {
} else {
continue;
}
List<BaseIndDef> children = baseIndDef.getChildren();
List<BaseIndDef> children = baseIndDef.getChildrens();
if (CollectionUtils.isNotEmpty(children)) {
taskIndicator.setHasChildren(true);
} else {
......
......@@ -7,8 +7,8 @@ import lombok.Data;
import java.util.Objects;
@Data
@ApiModel("用户对象")
public class UserModel {
@ApiModel("角色关联的用户对象")
public class RoleRefUserModel {
@ApiModelProperty("用户id")
private String id;
......@@ -18,6 +18,9 @@ public class UserModel {
private String orgId;
@ApiModelProperty("在此角色里面对应的指标归属部门")
private String refIndDept;
@Override
public boolean equals(Object o) {
if (this == o) {
......@@ -26,7 +29,7 @@ public class UserModel {
if (o == null || getClass() != o.getClass()) {
return false;
}
UserModel userModel = (UserModel) o;
RoleRefUserModel userModel = (RoleRefUserModel) o;
return Objects.equals(id, userModel.id) &&
Objects.equals(disName, userModel.disName);
}
......
......@@ -40,7 +40,7 @@ public class TaskIndicator extends BaseModel {
/**
* 父指标id
*/
private Integer parentIndId;
private String parentIndId;
/**
* 指标名称
......
......@@ -2,7 +2,7 @@ package com.keymobile.indicators.service.dataenter.impl;
import com.alibaba.fastjson.JSONObject;
import com.keymobile.indicators.constant.Constants;
import com.keymobile.indicators.model.entity.UserModel;
import com.keymobile.indicators.model.entity.RoleRefUserModel;
import com.keymobile.indicators.model.entity.dataenter.*;
import com.keymobile.indicators.model.mapper.indicators.*;
import com.keymobile.indicators.service.SystemAuthService;
......@@ -175,14 +175,14 @@ public class TaskServiceImpl implements TaskService {
break;
case 3:
//角色
List<UserModel> users = new ArrayList<>();
List<RoleRefUserModel> users = new ArrayList<>();
for (String obj : objIds) {
List<JSONObject> list =
systemAuthService.findUserList(obj, true,
null, null, null, 1, 100);
if (CollectionUtils.isNotEmpty(list)) {
for (JSONObject jo : list) {
UserModel user = new UserModel();
RoleRefUserModel user = new RoleRefUserModel();
user.setId(jo.getString("id"));
user.setDisName(jo.getString("disname"));
if (!users.contains(user)) {
......
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