Commit 46d45d3e by 张祺

修改填报对象模型

parent a7ce3599
...@@ -70,6 +70,7 @@ public class DataEnterCtrl { ...@@ -70,6 +70,7 @@ public class DataEnterCtrl {
List<JSONObject> orgs = systemAuthService.getOrgByNos(idList); List<JSONObject> orgs = systemAuthService.getOrgByNos(idList);
for (JSONObject jo : orgs) { for (JSONObject jo : orgs) {
AuthModel authModel = new AuthModel(); AuthModel authModel = new AuthModel();
authModel.setObjType(Constants.OBJ_TYPE_ORG);
authModel.setName(jo.getString("name")); authModel.setName(jo.getString("name"));
authModel.setId(jo.getString("no")); authModel.setId(jo.getString("no"));
objs.add(authModel); objs.add(authModel);
......
...@@ -83,6 +83,7 @@ public class ExcelTempCtrl { ...@@ -83,6 +83,7 @@ public class ExcelTempCtrl {
systemAuthService.getOrgByNos(objIds); systemAuthService.getOrgByNos(objIds);
for (JSONObject jo : orgs) { for (JSONObject jo : orgs) {
AuthModel authModel = new AuthModel(); AuthModel authModel = new AuthModel();
authModel.setObjType(Constants.OBJ_TYPE_ORG);
authModel.setName(jo.getString("name")); authModel.setName(jo.getString("name"));
authModel.setId(jo.getString("no")); authModel.setId(jo.getString("no"));
list.add(authModel); list.add(authModel);
......
...@@ -13,17 +13,20 @@ public class AuthModel { ...@@ -13,17 +13,20 @@ public class AuthModel {
private String name; private String name;
private int objType;
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
AuthModel authModel = (AuthModel) o; AuthModel model = (AuthModel) o;
return Objects.equals(id, authModel.id) && return objType == model.objType &&
Objects.equals(name, authModel.name); Objects.equals(id, model.id) &&
Objects.equals(name, model.name);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, name); return Objects.hash(id, name, objType);
} }
} }
...@@ -442,6 +442,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -442,6 +442,7 @@ public class TaskServiceImpl implements TaskService {
List<JSONObject> list = systemAuthService.getOrgByNos(ids); List<JSONObject> list = systemAuthService.getOrgByNos(ids);
for (JSONObject jo : list) { for (JSONObject jo : list) {
AuthModel model = new AuthModel(); AuthModel model = new AuthModel();
model.setObjType(Constants.OBJ_TYPE_ORG);
model.setId(jo.getString("no")); model.setId(jo.getString("no"));
model.setName(jo.getString("name")); model.setName(jo.getString("name"));
models.add(model); models.add(model);
......
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