Commit c68123018a335aac5a8a9ad3e19c166e52fe2cb8

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 7 changed files

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommunityConfigService.java View file @ c681230
... ... @@ -47,7 +47,7 @@
47 47 public List<CommunityConfig> queryArea(CommunityQuery communityQuery) {
48 48 MongoCondition mongoCondition = MongoCondition.newInstance();
49 49 if(null != communityQuery.getKeyword()) {
50   - mongoCondition.orCondition(new MongoCondition[]{new MongoCondition("name", communityQuery.getKeyword(), MongoOper.LIKE), new MongoCondition("parentId", communityQuery.getKeyword(), MongoOper.LIKE), new MongoCondition("id", communityQuery.getKeyword(), MongoOper.IS)});
  50 + mongoCondition.orCondition(new MongoCondition[]{new MongoCondition("name", communityQuery.getKeyword(), MongoOper.LIKE), new MongoCondition("parentId", communityQuery.getKeyword(), MongoOper.IS), new MongoCondition("id", communityQuery.getKeyword(), MongoOper.IS)});
51 51 }
52 52 mongoCondition.andCondition(new MongoCondition("yn", YnEnums.YES.getId(), MongoOper.IS).and("type", 1, MongoOper.IS));
53 53  
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java View file @ c681230
1 1 package com.lyms.platform.permission.model;
2 2  
  3 +import com.lyms.platform.common.result.IdTextModel;
  4 +
3 5 import java.util.Date;
4 6  
5 7 public class Organization {
6 8  
7 9  
8 10  
9 11  
10 12  
11 13  
... ... @@ -20,28 +22,57 @@
20 22 private Date created;
21 23 private String shortCode;
22 24  
23   - private String levelStr;
24   - private String typeStr;
  25 + private IdTextModel levelObj;
  26 + private IdTextModel typeObj;
  27 + private Regions province;
  28 + private Regions city;
  29 + private Regions area;
25 30  
26   - public String getShortCode() {
27   - return shortCode;
  31 + public Regions getProvince() {
  32 + return province;
28 33 }
29 34  
30   - public String getLevelStr() {
31   - return levelStr;
  35 + public void setProvince(Regions province) {
  36 + this.province = province;
32 37 }
33 38  
34   - public void setLevelStr(String levelStr) {
35   - this.levelStr = levelStr;
  39 + public Regions getCity() {
  40 + return city;
36 41 }
37 42  
38   - public String getTypeStr() {
39   - return typeStr;
  43 + public void setCity(Regions city) {
  44 + this.city = city;
40 45 }
41 46  
42   - public void setTypeStr(String typeStr) {
43   - this.typeStr = typeStr;
  47 + public Regions getArea() {
  48 + return area;
44 49 }
  50 +
  51 + public void setArea(Regions area) {
  52 + this.area = area;
  53 + }
  54 +
  55 + public IdTextModel getLevelObj() {
  56 + return levelObj;
  57 + }
  58 +
  59 + public void setLevelObj(IdTextModel levelObj) {
  60 + this.levelObj = levelObj;
  61 + }
  62 +
  63 + public IdTextModel getTypeObj() {
  64 + return typeObj;
  65 + }
  66 +
  67 + public void setTypeObj(IdTextModel typeObj) {
  68 + this.typeObj = typeObj;
  69 + }
  70 +
  71 + public String getShortCode() {
  72 + return shortCode;
  73 + }
  74 +
  75 +
45 76  
46 77 public void setShortCode(String shortCode) {
47 78 this.shortCode = shortCode;
platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationLevelEnum.java View file @ c681230
1 1 package com.lyms.platform.common.enums;
2 2  
  3 +import com.lyms.platform.common.result.IdTextModel;
  4 +
3 5 import java.util.HashMap;
4 6  
5 7 /**
6 8  
... ... @@ -36,10 +38,10 @@
36 38 this.text = text;
37 39 }
38 40  
39   - public static String getById(int id) {
  41 + public static IdTextModel getById(int id) {
40 42 for (OrganizationLevelEnum e : OrganizationLevelEnum.values()) {
41 43 if(e.getId().equals(id)) {
42   - return e.getText();
  44 + return new IdTextModel(e.getId().toString(), e.getText());
43 45 }
44 46 }
45 47 return null;
platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationTypeEnum.java View file @ c681230
1 1 package com.lyms.platform.common.enums;
2 2  
  3 +import com.lyms.platform.common.result.IdTextModel;
  4 +
3 5 /**
4 6 * 机构类型
5 7 * Created by Zhang.Rui on 2016/4/7.
6 8  
... ... @@ -35,10 +37,10 @@
35 37 this.text = text;
36 38 }
37 39  
38   - public static String getById(int id) {
  40 + public static IdTextModel getById(int id) {
39 41 for (OrganizationTypeEnum e : OrganizationTypeEnum.values()) {
40 42 if(e.getId().equals(id)) {
41   - return e.getText();
  43 + return new IdTextModel(e.getId().toString(), e.getText());
42 44 }
43 45 }
44 46 return null;
platform-common/src/main/java/com/lyms/platform/common/result/IdTextModel.java View file @ c681230
  1 +package com.lyms.platform.common.result;
  2 +
  3 +/**
  4 + * Created by Zhang.Rui on 2016/4/29.
  5 + */
  6 +public class IdTextModel {
  7 + private String id;
  8 + private String text;
  9 +
  10 + public String getId() {
  11 + return id;
  12 + }
  13 +
  14 + public void setId(String id) {
  15 + this.id = id;
  16 + }
  17 +
  18 + public String getText() {
  19 + return text;
  20 + }
  21 +
  22 + public void setText(String text) {
  23 + this.text = text;
  24 + }
  25 +
  26 + public IdTextModel(String id, String text) {
  27 + this.id = id;
  28 + this.text = text;
  29 + }
  30 +
  31 + public IdTextModel() {
  32 +
  33 + }
  34 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java View file @ c681230
... ... @@ -103,7 +103,7 @@
103 103 if(null != communityConfig.getParentId()) {
104 104 communityConfig.setParent(communityConfigService.queryAreaById(communityConfig.getParentId()));
105 105 } else {
106   - communityConfig.setParent(new CommunityConfig("0", "root"));
  106 +// communityConfig.setParent(new CommunityConfig("0", "root"));
107 107 }
108 108 }
109 109 return FrontEndResult.ini().setData(communityConfigList).setPageInfo(communityQuery.getPageInfo()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java View file @ c681230
... ... @@ -205,7 +205,6 @@
205 205 organizationQuery.setSort("id desc");
206 206 organizationQuery.setYn(YnEnums.YES.getId());
207 207 organizationQuery.setPage(page);
208   - organizationQuery.setProvinceId(areaId);
209 208 organizationQuery.setLimit(limit);
210 209 organizationQuery.setKeyword(keyword);
211 210  
... ... @@ -222,8 +221,17 @@
222 221 List<Organization> organizations = organizationService.queryOrganization(organizationQuery);
223 222  
224 223 for(Organization organization : organizations) {
225   - organization.setTypeStr(OrganizationLevelEnum.getById(organization.getLevel()));
226   - organization.setLevelStr(OrganizationTypeEnum.getById(organization.getType()));
  224 + organization.setTypeObj(OrganizationLevelEnum.getById(organization.getLevel()));
  225 + organization.setLevelObj(OrganizationTypeEnum.getById(organization.getType()));
  226 + if(null != organization.getProvinceId()) {
  227 + organization.setProvince(regionsService.getRegions(organization.getProvinceId()));
  228 + }
  229 + if(null != organization.getCityId()) {
  230 + organization.setCity(regionsService.getRegions(organization.getCityId()));
  231 + }
  232 + if(null != organization.getAreaId()) {
  233 + organization.setArea(regionsService.getRegions(organization.getAreaId()));
  234 + }
227 235 }
228 236  
229 237 FrontEndResult frontEndResult = new FrontEndResult();