Commit 41344127ee57d31eac7fc9c2c825f90c18e46ce4
1 parent
4e5aed4d1f
Exists in
master
and in
8 other branches
add data import : basic config
Showing 15 changed files with 196 additions and 174 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/RegionsMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/RegionsService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RegionsServiceImpl.java
- platform-common/src/main/java/com/lyms/platform/common/utils/SystemConfig.java
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RegionController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyVisitAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/VisitAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AddressInner.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/RegionsMapper.java
View file @
4134412
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
View file @
4134412
| 1 | 1 | package com.lyms.platform.permission.model; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.result.IdTextModel; |
| 4 | +import com.lyms.platform.pojo.BasicConfig; | |
| 4 | 5 | |
| 5 | 6 | import java.util.Date; |
| 6 | 7 | |
| ... | ... | @@ -10,9 +11,9 @@ |
| 10 | 11 | private Integer type; |
| 11 | 12 | private Integer level; |
| 12 | 13 | private Integer areaManage; |
| 13 | - private Integer provinceId; | |
| 14 | - private Integer cityId; | |
| 15 | - private Integer areaId; | |
| 14 | + private String provinceId; | |
| 15 | + private String cityId; | |
| 16 | + private String areaId; | |
| 16 | 17 | private String address; |
| 17 | 18 | private String description; |
| 18 | 19 | private Integer publishId; |
| ... | ... | @@ -24,9 +25,9 @@ |
| 24 | 25 | |
| 25 | 26 | private IdTextModel levelObj; |
| 26 | 27 | private IdTextModel typeObj; |
| 27 | - private Regions province; | |
| 28 | - private Regions city; | |
| 29 | - private Regions area; | |
| 28 | + private BasicConfig province; | |
| 29 | + private BasicConfig city; | |
| 30 | + private BasicConfig area; | |
| 30 | 31 | private String foreignId; |
| 31 | 32 | |
| 32 | 33 | public String getForeignId() { |
| 33 | 34 | |
| 34 | 35 | |
| 35 | 36 | |
| 36 | 37 | |
| 37 | 38 | |
| ... | ... | @@ -37,27 +38,27 @@ |
| 37 | 38 | this.foreignId = foreignId; |
| 38 | 39 | } |
| 39 | 40 | |
| 40 | - public Regions getProvince() { | |
| 41 | + public BasicConfig getProvince() { | |
| 41 | 42 | return province; |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | - public void setProvince(Regions province) { | |
| 45 | + public void setProvince(BasicConfig province) { | |
| 45 | 46 | this.province = province; |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | - public Regions getCity() { | |
| 49 | + public BasicConfig getCity() { | |
| 49 | 50 | return city; |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | - public void setCity(Regions city) { | |
| 53 | + public void setCity(BasicConfig city) { | |
| 53 | 54 | this.city = city; |
| 54 | 55 | } |
| 55 | 56 | |
| 56 | - public Regions getArea() { | |
| 57 | + public BasicConfig getArea() { | |
| 57 | 58 | return area; |
| 58 | 59 | } |
| 59 | 60 | |
| 60 | - public void setArea(Regions area) { | |
| 61 | + public void setArea(BasicConfig area) { | |
| 61 | 62 | this.area = area; |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | |
| 65 | 66 | |
| 66 | 67 | |
| 67 | 68 | |
| 68 | 69 | |
| ... | ... | @@ -138,32 +139,32 @@ |
| 138 | 139 | |
| 139 | 140 | } |
| 140 | 141 | |
| 141 | - public Integer getProvinceId() { | |
| 142 | + public String getProvinceId() { | |
| 142 | 143 | return provinceId; |
| 143 | 144 | } |
| 144 | 145 | |
| 145 | 146 | |
| 146 | - public void setProvinceId(Integer provinceId) { | |
| 147 | + public void setProvinceId(String provinceId) { | |
| 147 | 148 | this.provinceId = provinceId; |
| 148 | 149 | |
| 149 | 150 | } |
| 150 | 151 | |
| 151 | - public Integer getCityId() { | |
| 152 | + public String getCityId() { | |
| 152 | 153 | return cityId; |
| 153 | 154 | } |
| 154 | 155 | |
| 155 | 156 | |
| 156 | - public void setCityId(Integer cityId) { | |
| 157 | + public void setCityId(String cityId) { | |
| 157 | 158 | this.cityId = cityId; |
| 158 | 159 | |
| 159 | 160 | } |
| 160 | 161 | |
| 161 | - public Integer getAreaId() { | |
| 162 | + public String getAreaId() { | |
| 162 | 163 | return areaId; |
| 163 | 164 | } |
| 164 | 165 | |
| 165 | 166 | |
| 166 | - public void setAreaId(Integer areaId) { | |
| 167 | + public void setAreaId(String areaId) { | |
| 167 | 168 | this.areaId = areaId; |
| 168 | 169 | |
| 169 | 170 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
View file @
4134412
| ... | ... | @@ -12,9 +12,9 @@ |
| 12 | 12 | private Integer type; |
| 13 | 13 | private Integer level; |
| 14 | 14 | private Integer areaManage; |
| 15 | - private Integer provinceId; | |
| 16 | - private Integer cityId; | |
| 17 | - private Integer areaId; | |
| 15 | + private String provinceId; | |
| 16 | + private String cityId; | |
| 17 | + private String areaId; | |
| 18 | 18 | private String address; |
| 19 | 19 | private String description; |
| 20 | 20 | private Integer publishId; |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| ... | ... | @@ -91,32 +91,32 @@ |
| 91 | 91 | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public Integer getProvinceId() { | |
| 94 | + public String getProvinceId() { | |
| 95 | 95 | return provinceId; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | - public void setProvinceId(Integer provinceId) { | |
| 99 | + public void setProvinceId(String provinceId) { | |
| 100 | 100 | this.provinceId = provinceId; |
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - public Integer getCityId() { | |
| 104 | + public String getCityId() { | |
| 105 | 105 | return cityId; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | - public void setCityId(Integer cityId) { | |
| 109 | + public void setCityId(String cityId) { | |
| 110 | 110 | this.cityId = cityId; |
| 111 | 111 | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - public Integer getAreaId() { | |
| 114 | + public String getAreaId() { | |
| 115 | 115 | return areaId; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| 119 | - public void setAreaId(Integer areaId) { | |
| 119 | + public void setAreaId(String areaId) { | |
| 120 | 120 | this.areaId = areaId; |
| 121 | 121 | |
| 122 | 122 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/RegionsService.java
View file @
4134412
| ... | ... | @@ -8,17 +8,17 @@ |
| 8 | 8 | import java.util.List; |
| 9 | 9 | |
| 10 | 10 | public interface RegionsService { |
| 11 | - public void addRegions(Regions obj); | |
| 12 | - | |
| 13 | - public void updateRegions(Regions obj); | |
| 14 | - | |
| 15 | - public void deleteRegions(Integer id); | |
| 16 | - | |
| 17 | - public Regions getRegions(Integer id); | |
| 18 | - | |
| 19 | - public int queryRegionsCount(RegionsQuery query); | |
| 20 | - | |
| 21 | - public List<Regions> queryRegions(RegionsQuery query); | |
| 11 | +// public void addRegions(Regions obj); | |
| 12 | +// | |
| 13 | +// public void updateRegions(Regions obj); | |
| 14 | +// | |
| 15 | +// public void deleteRegions(Integer id); | |
| 16 | +// | |
| 17 | +// public Regions getRegions(String id); | |
| 18 | +// | |
| 19 | +// public int queryRegionsCount(RegionsQuery query); | |
| 20 | +// | |
| 21 | +// public List<Regions> queryRegions(RegionsQuery query); | |
| 22 | 22 | |
| 23 | 23 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RegionsServiceImpl.java
View file @
4134412
| ... | ... | @@ -13,44 +13,44 @@ |
| 13 | 13 | @Service |
| 14 | 14 | public class RegionsServiceImpl implements RegionsService { |
| 15 | 15 | |
| 16 | - @Autowired | |
| 17 | - private RegionsMapper regionsMapper; | |
| 18 | - | |
| 19 | - @Override | |
| 20 | - public void addRegions(Regions obj) { | |
| 21 | - regionsMapper.addRegions(obj); | |
| 22 | - } | |
| 23 | - | |
| 24 | - @Override | |
| 25 | - public void updateRegions(Regions obj) { | |
| 26 | - regionsMapper.updateRegions(obj); | |
| 27 | - } | |
| 28 | - | |
| 29 | - @Override | |
| 30 | - public void deleteRegions(Integer id) { | |
| 31 | - regionsMapper.deleteRegions(id); | |
| 32 | - } | |
| 33 | - | |
| 34 | - @Override | |
| 35 | - public Regions getRegions(Integer id) { | |
| 36 | - if (id == null) { | |
| 37 | - return null; | |
| 38 | - } | |
| 39 | - return regionsMapper.getRegions(id); | |
| 40 | - } | |
| 41 | - | |
| 42 | - @Override | |
| 43 | - public int queryRegionsCount(RegionsQuery query) { | |
| 44 | - return regionsMapper.queryRegionsCount(query); | |
| 45 | - } | |
| 46 | - | |
| 47 | - @Override | |
| 48 | - public List<Regions> queryRegions(RegionsQuery query) { | |
| 49 | - if (query.getNeed() != null) { | |
| 50 | - query.mysqlBuild(regionsMapper.queryRegionsCount(query)); | |
| 51 | - } | |
| 52 | - return regionsMapper.queryRegions(query); | |
| 53 | - } | |
| 16 | +// @Autowired | |
| 17 | +// private RegionsMapper regionsMapper; | |
| 18 | +// | |
| 19 | +// @Override | |
| 20 | +// public void addRegions(Regions obj) { | |
| 21 | +// regionsMapper.addRegions(obj); | |
| 22 | +// } | |
| 23 | +// | |
| 24 | +// @Override | |
| 25 | +// public void updateRegions(Regions obj) { | |
| 26 | +// regionsMapper.updateRegions(obj); | |
| 27 | +// } | |
| 28 | +// | |
| 29 | +// @Override | |
| 30 | +// public void deleteRegions(Integer id) { | |
| 31 | +// regionsMapper.deleteRegions(id); | |
| 32 | +// } | |
| 33 | +// | |
| 34 | +// @Override | |
| 35 | +// public Regions getRegions(String id) { | |
| 36 | +// if (id == null) { | |
| 37 | +// return null; | |
| 38 | +// } | |
| 39 | +// return regionsMapper.getRegions(id); | |
| 40 | +// } | |
| 41 | +// | |
| 42 | +// @Override | |
| 43 | +// public int queryRegionsCount(RegionsQuery query) { | |
| 44 | +// return regionsMapper.queryRegionsCount(query); | |
| 45 | +// } | |
| 46 | +// | |
| 47 | +// @Override | |
| 48 | +// public List<Regions> queryRegions(RegionsQuery query) { | |
| 49 | +// if (query.getNeed() != null) { | |
| 50 | +// query.mysqlBuild(regionsMapper.queryRegionsCount(query)); | |
| 51 | +// } | |
| 52 | +// return regionsMapper.queryRegions(query); | |
| 53 | +// } | |
| 54 | 54 | |
| 55 | 55 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/SystemConfig.java
View file @
4134412
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
4134412
| ... | ... | @@ -32,31 +32,31 @@ |
| 32 | 32 | * ๅฐๅ |
| 33 | 33 | */ |
| 34 | 34 | private String address; |
| 35 | - private int provinceId; | |
| 36 | - private int cityId; | |
| 37 | - private int areaId; | |
| 35 | + private String provinceId; | |
| 36 | + private String cityId; | |
| 37 | + private String areaId; | |
| 38 | 38 | |
| 39 | - public int getAreaId() { | |
| 39 | + public String getAreaId() { | |
| 40 | 40 | return areaId; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - public void setAreaId(int areaId) { | |
| 43 | + public void setAreaId(String areaId) { | |
| 44 | 44 | this.areaId = areaId; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public int getCityId() { | |
| 47 | + public String getCityId() { | |
| 48 | 48 | return cityId; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - public void setCityId(int cityId) { | |
| 51 | + public void setCityId(String cityId) { | |
| 52 | 52 | this.cityId = cityId; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public int getProvinceId() { | |
| 55 | + public String getProvinceId() { | |
| 56 | 56 | return provinceId; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - public void setProvinceId(int provinceId) { | |
| 59 | + public void setProvinceId(String provinceId) { | |
| 60 | 60 | this.provinceId = provinceId; |
| 61 | 61 | } |
| 62 | 62 |
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java
View file @
4134412
| ... | ... | @@ -96,6 +96,7 @@ |
| 96 | 96 | config.setName(data.getDcName()); |
| 97 | 97 | config.setParentId(data.getDcParentid()); |
| 98 | 98 | config.setTypeId(data.getDcDatatypeid()); |
| 99 | + config.setYn(YnEnums.YES.getId()); | |
| 99 | 100 | BasicConfig db = basicConfigService.getOneBasicConfigById(data.getDcId()); |
| 100 | 101 | if (db == null) { |
| 101 | 102 | basicConfigService.addBasicConfig(config); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
View file @
4134412
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | import javax.validation.Valid; |
| 6 | 6 | |
| 7 | 7 | import com.lyms.platform.biz.param.CommunityQuery; |
| 8 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 8 | 9 | import com.lyms.platform.biz.service.PatientsService; |
| 9 | 10 | import com.lyms.platform.common.annotation.TokenRequired; |
| 10 | 11 | import com.lyms.platform.common.base.BaseController; |
| ... | ... | @@ -14,6 +15,7 @@ |
| 14 | 15 | import com.lyms.platform.operate.web.result.FrontEndResult; |
| 15 | 16 | import com.lyms.platform.permission.model.Regions; |
| 16 | 17 | import com.lyms.platform.permission.service.RegionsService; |
| 18 | +import com.lyms.platform.pojo.BasicConfig; | |
| 17 | 19 | import com.lyms.platform.pojo.Patients; |
| 18 | 20 | import com.lyms.platform.query.PatientsQuery; |
| 19 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -43,7 +45,7 @@ |
| 43 | 45 | @Autowired |
| 44 | 46 | private PatientsService patientsService; |
| 45 | 47 | @Autowired |
| 46 | - private RegionsService regionsService; | |
| 48 | + private BasicConfigService basicConfigService; | |
| 47 | 49 | |
| 48 | 50 | |
| 49 | 51 | |
| 50 | 52 | |
| ... | ... | @@ -100,11 +102,10 @@ |
| 100 | 102 | @TokenRequired |
| 101 | 103 | public FrontEndResult queryCommunity(CommunityQuery communityQuery) { |
| 102 | 104 | List<CommunityConfig> communityConfigList = communityConfigService.queryCommunity(communityQuery); |
| 103 | - Regions regions = regionsService.getRegions(Integer.valueOf(communityQuery.getId())); | |
| 104 | - if(null == regions) { | |
| 105 | + BasicConfig config = basicConfigService.getOneBasicConfigById(communityQuery.getId()); | |
| 106 | + if(null == config) { | |
| 105 | 107 | return FrontEndResult.ini(ErrorCodeConstants.PARAMETER_ERROR, "address ID error"); |
| 106 | 108 | } |
| 107 | - communityQuery.setLevel(String.valueOf(regions.getLevel())); | |
| 108 | 109 | if(null != communityConfigList) { |
| 109 | 110 | return FrontEndResult.ini().setData(communityConfigList).setPageInfo(communityQuery.getPageInfo()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆฅ่ฏขๆๅ"); |
| 110 | 111 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
4134412
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 4 | 5 | import com.lyms.platform.common.annotation.TokenRequired; |
| 5 | 6 | import com.lyms.platform.common.base.BaseController; |
| 6 | 7 | import com.lyms.platform.common.base.LoginContext; |
| 7 | 8 | |
| ... | ... | @@ -9,9 +10,11 @@ |
| 9 | 10 | import com.lyms.platform.common.enums.OrganizationTypeEnum; |
| 10 | 11 | import com.lyms.platform.common.enums.YnEnums; |
| 11 | 12 | import com.lyms.platform.common.utils.ResultUtils; |
| 13 | +import com.lyms.platform.common.utils.SystemConfig; | |
| 12 | 14 | import com.lyms.platform.operate.web.result.FrontEndResult; |
| 13 | 15 | import com.lyms.platform.permission.model.*; |
| 14 | 16 | import com.lyms.platform.permission.service.*; |
| 17 | +import com.lyms.platform.pojo.BasicConfig; | |
| 15 | 18 | import org.apache.commons.lang.StringUtils; |
| 16 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | 20 | import org.springframework.stereotype.Controller; |
| ... | ... | @@ -34,7 +37,7 @@ |
| 34 | 37 | @Autowired |
| 35 | 38 | private OrganizationService organizationService; |
| 36 | 39 | @Autowired |
| 37 | - private RegionsService regionsService; | |
| 40 | + private BasicConfigService basicConfigService; | |
| 38 | 41 | @Autowired |
| 39 | 42 | private DepartmentsService departmentsService; |
| 40 | 43 | |
| ... | ... | @@ -94,9 +97,9 @@ |
| 94 | 97 | @RequestParam(value = "type", required = false) Integer type, |
| 95 | 98 | @RequestParam(value = "level", required = false) Integer level, |
| 96 | 99 | @RequestParam(value = "areaManage", required = false) Integer areaManage, |
| 97 | - @RequestParam(value = "provinceId", required = false) Integer provinceId, | |
| 98 | - @RequestParam(value = "cityId", required = false) Integer cityId, | |
| 99 | - @RequestParam(value = "areaId", required = false) Integer areaId, | |
| 100 | + @RequestParam(value = "provinceId", required = false) String provinceId, | |
| 101 | + @RequestParam(value = "cityId", required = false) String cityId, | |
| 102 | + @RequestParam(value = "areaId", required = false) String areaId, | |
| 100 | 103 | @RequestParam(value = "address", required = false) String address, |
| 101 | 104 | @RequestParam(value = "description", required = false) String description, |
| 102 | 105 | @RequestParam(value = "shortCode", required = false) String shortCode) { |
| ... | ... | @@ -143,9 +146,9 @@ |
| 143 | 146 | @RequestParam(value = "type") Integer type, |
| 144 | 147 | @RequestParam(value = "level") Integer level, |
| 145 | 148 | @RequestParam(value = "areaManage",required = false) Integer areaManage, |
| 146 | - @RequestParam(value = "provinceId") Integer provinceId, | |
| 147 | - @RequestParam(value = "cityId") Integer cityId, | |
| 148 | - @RequestParam(value = "areaId") Integer areaId, | |
| 149 | + @RequestParam(value = "provinceId") String provinceId, | |
| 150 | + @RequestParam(value = "cityId") String cityId, | |
| 151 | + @RequestParam(value = "areaId") String areaId, | |
| 149 | 152 | @RequestParam(value = "address") String address, |
| 150 | 153 | @RequestParam(value = "description", required = false) String description, |
| 151 | 154 | @RequestParam(value = "shortCode", required = false) String shortCode) { |
| 152 | 155 | |
| ... | ... | @@ -205,17 +208,11 @@ |
| 205 | 208 | @RequestParam(value = "keyword", required = false) String keyword, |
| 206 | 209 | @RequestParam(value = "page", required = false) Integer page, |
| 207 | 210 | @RequestParam(value = "limit", required = false) Integer limit, |
| 208 | - @RequestParam(value = "areaId", required = false) Integer areaId) { | |
| 211 | + @RequestParam(value = "areaId", required = false) String areaId) { | |
| 209 | 212 | |
| 210 | 213 | limit = limit == null ? 10 : limit; |
| 211 | 214 | page = page == null ? 1 : page; |
| 212 | 215 | |
| 213 | - Regions regions = null; | |
| 214 | - if(null != areaId) { | |
| 215 | - regions = regionsService.getRegions(areaId); | |
| 216 | - } | |
| 217 | - | |
| 218 | - | |
| 219 | 216 | OrganizationQuery organizationQuery = new OrganizationQuery(); |
| 220 | 217 | organizationQuery.setId(id); |
| 221 | 218 | organizationQuery.setNeed("true"); |
| 222 | 219 | |
| 223 | 220 | |
| ... | ... | @@ -225,15 +222,25 @@ |
| 225 | 222 | organizationQuery.setLimit(limit); |
| 226 | 223 | organizationQuery.setKeyword(keyword); |
| 227 | 224 | |
| 228 | - if(null != regions && regions.getLevel().equals(1)) { | |
| 229 | - organizationQuery.setProvinceId(areaId); | |
| 225 | + BasicConfig config = null; | |
| 226 | + if(null != areaId) { | |
| 227 | + config = basicConfigService.getOneBasicConfigById(areaId); | |
| 230 | 228 | } |
| 231 | - if(null != regions && regions.getLevel().equals(2)) { | |
| 232 | - organizationQuery.setCityId(areaId); | |
| 229 | + if (config != null) { | |
| 230 | + if (SystemConfig.CHINA_BASIC_ID.equals(config.getParentId())) { | |
| 231 | + organizationQuery.setProvinceId(areaId); | |
| 232 | + } else { | |
| 233 | + BasicConfig p1 = basicConfigService.getOneBasicConfigById(config.getParentId()); | |
| 234 | + if (p1 != null && SystemConfig.CHINA_BASIC_ID.equals(p1.getParentId())) { | |
| 235 | + organizationQuery.setCityId(areaId); | |
| 236 | + } else { | |
| 237 | + BasicConfig p2 = basicConfigService.getOneBasicConfigById(p1.getParentId()); | |
| 238 | + if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p2.getParentId())) { | |
| 239 | + organizationQuery.setAreaId(areaId); | |
| 240 | + } | |
| 241 | + } | |
| 242 | + } | |
| 233 | 243 | } |
| 234 | - if(null != regions && regions.getLevel().equals(3)) { | |
| 235 | - organizationQuery.setAreaId(areaId); | |
| 236 | - } | |
| 237 | 244 | |
| 238 | 245 | List<Organization> organizations = organizationService.queryOrganization(organizationQuery); |
| 239 | 246 | |
| 240 | 247 | |
| 241 | 248 | |
| ... | ... | @@ -241,13 +248,13 @@ |
| 241 | 248 | organization.setTypeObj(OrganizationLevelEnum.getById(organization.getLevel())); |
| 242 | 249 | organization.setLevelObj(OrganizationTypeEnum.getById(organization.getType())); |
| 243 | 250 | if(null != organization.getProvinceId()) { |
| 244 | - organization.setProvince(regionsService.getRegions(organization.getProvinceId())); | |
| 251 | + organization.setProvince(basicConfigService.getOneBasicConfigById(organization.getProvinceId())); | |
| 245 | 252 | } |
| 246 | 253 | if(null != organization.getCityId()) { |
| 247 | - organization.setCity(regionsService.getRegions(organization.getCityId())); | |
| 254 | + organization.setCity(basicConfigService.getOneBasicConfigById(organization.getCityId())); | |
| 248 | 255 | } |
| 249 | 256 | if(null != organization.getAreaId()) { |
| 250 | - organization.setArea(regionsService.getRegions(organization.getAreaId())); | |
| 257 | + organization.setArea(basicConfigService.getOneBasicConfigById(organization.getAreaId())); | |
| 251 | 258 | } |
| 252 | 259 | } |
| 253 | 260 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RegionController.java
View file @
4134412
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 4 | 5 | import com.lyms.platform.common.annotation.TokenRequired; |
| 5 | 6 | import com.lyms.platform.common.base.BaseController; |
| 7 | +import com.lyms.platform.common.enums.YnEnums; | |
| 6 | 8 | import com.lyms.platform.common.utils.ResultUtils; |
| 7 | -import com.lyms.platform.permission.model.Regions; | |
| 8 | -import com.lyms.platform.permission.model.RegionsQuery; | |
| 9 | -import com.lyms.platform.permission.service.RegionsService; | |
| 9 | +import com.lyms.platform.common.utils.SystemConfig; | |
| 10 | +import com.lyms.platform.pojo.BasicConfig; | |
| 11 | +import com.lyms.platform.query.BasicConfigQuery; | |
| 10 | 12 | import org.apache.commons.collections.CollectionUtils; |
| 13 | +import org.apache.commons.lang.StringUtils; | |
| 11 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 15 | import org.springframework.stereotype.Controller; |
| 13 | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 14 | 17 | |
| 15 | 18 | |
| 16 | 19 | |
| 17 | 20 | |
| 18 | 21 | |
| ... | ... | @@ -25,23 +28,28 @@ |
| 25 | 28 | */ |
| 26 | 29 | @Controller |
| 27 | 30 | public class RegionController extends RestController{ |
| 31 | + | |
| 28 | 32 | @Autowired |
| 29 | - private RegionsService regionsService; | |
| 33 | + private BasicConfigService basicConfigService; | |
| 34 | + | |
| 30 | 35 | @TokenRequired |
| 31 | 36 | @RequestMapping(value = "/regions",method = RequestMethod.GET) |
| 32 | - public void getRegions(@RequestParam(value = "parentId", required = false) Integer parentId, | |
| 37 | + public void getRegions(@RequestParam(value = "parentId") String parentId, | |
| 33 | 38 | HttpServletResponse httpServletResponse){ |
| 34 | - RegionsQuery regionsQuery= new RegionsQuery(); | |
| 35 | - regionsQuery.setParentId(parentId); | |
| 36 | - List<Regions> regionses = regionsService.queryRegions(regionsQuery); | |
| 39 | + if ("0".equals(parentId) || StringUtils.isBlank(parentId)) { | |
| 40 | + parentId = SystemConfig.CHINA_BASIC_ID; | |
| 41 | + } | |
| 42 | + BasicConfigQuery query = new BasicConfigQuery(); | |
| 43 | + query.setYn(YnEnums.YES.getId()); | |
| 44 | + query.setParentId(parentId); | |
| 45 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(query); | |
| 37 | 46 | List<Map<String,Object>> list =new ArrayList<Map<String, Object>>(); |
| 38 | - if(CollectionUtils.isNotEmpty(regionses)){ | |
| 39 | - for (Regions regions :regionses){ | |
| 47 | + if(CollectionUtils.isNotEmpty(configList)){ | |
| 48 | + for (BasicConfig config :configList){ | |
| 40 | 49 | Map<String,Object> region=new HashMap<String, Object>(); |
| 41 | - region.put("id",regions.getId()); | |
| 42 | - region.put("level",regions.getLevel()); | |
| 43 | - region.put("regionName",regions.getRegionName()); | |
| 44 | - region.put("parentId", regions.getParentId()); | |
| 50 | + region.put("id",config.getId()); | |
| 51 | + region.put("regionName",config.getName()); | |
| 52 | + region.put("parentId", config.getParentId()); | |
| 45 | 53 | list.add(region); |
| 46 | 54 | } |
| 47 | 55 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
4134412
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | -import com.lyms.platform.biz.service.BabyService; | |
| 4 | -import com.lyms.platform.biz.service.BabyVisitService; | |
| 5 | -import com.lyms.platform.biz.service.PatientsService; | |
| 6 | -import com.lyms.platform.biz.service.VisitService; | |
| 3 | +import com.lyms.platform.biz.service.*; | |
| 7 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 8 | 5 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
| ... | ... | @@ -15,10 +12,7 @@ |
| 15 | 12 | import com.lyms.platform.operate.web.result.BabyVisitResult.BabyVisit; |
| 16 | 13 | import com.lyms.platform.permission.model.Regions; |
| 17 | 14 | import com.lyms.platform.permission.service.RegionsService; |
| 18 | -import com.lyms.platform.pojo.BabyModel; | |
| 19 | -import com.lyms.platform.pojo.BabyVisitModel; | |
| 20 | -import com.lyms.platform.pojo.Patients; | |
| 21 | -import com.lyms.platform.pojo.VisitModel; | |
| 15 | +import com.lyms.platform.pojo.*; | |
| 22 | 16 | import com.lyms.platform.query.PatientsQuery; |
| 23 | 17 | import com.lyms.platform.query.VisitQuery; |
| 24 | 18 | import org.apache.commons.collections.CollectionUtils; |
| ... | ... | @@ -48,7 +42,7 @@ |
| 48 | 42 | @Autowired |
| 49 | 43 | private PatientsService patientsService; |
| 50 | 44 | @Autowired |
| 51 | - private RegionsService regionsService; | |
| 45 | + private BasicConfigService basicConfigService; | |
| 52 | 46 | |
| 53 | 47 | /** |
| 54 | 48 | * ๆ นๆฎไบงๅฆid่ทๅไบงๅฆ็่ฎฟ่งไฟกๆฏ |
| 55 | 49 | |
| 56 | 50 | |
| ... | ... | @@ -115,14 +109,14 @@ |
| 115 | 109 | return address; |
| 116 | 110 | } |
| 117 | 111 | |
| 118 | - private AddressInner getName(int id) { | |
| 112 | + private AddressInner getName(String id) { | |
| 119 | 113 | AddressInner addressInner= new AddressInner(); |
| 120 | 114 | addressInner.setId(id); |
| 121 | - Regions regions = regionsService.getRegions(id); | |
| 122 | - if (null == regions) { | |
| 115 | + BasicConfig config = basicConfigService.getOneBasicConfigById(id); | |
| 116 | + if (null == config) { | |
| 123 | 117 | return addressInner; |
| 124 | 118 | } |
| 125 | - addressInner.setName(regions.getRegionName()); | |
| 119 | + addressInner.setName(config.getName()); | |
| 126 | 120 | return addressInner; |
| 127 | 121 | } |
| 128 | 122 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyVisitAddRequest.java
View file @
4134412
| ... | ... | @@ -18,35 +18,35 @@ |
| 18 | 18 | |
| 19 | 19 | private String address; |
| 20 | 20 | |
| 21 | - private int provinceId; | |
| 22 | - private int cityId; | |
| 23 | - private int areaId; | |
| 21 | + private String provinceId; | |
| 22 | + private String cityId; | |
| 23 | + private String areaId; | |
| 24 | 24 | |
| 25 | 25 | public void setAddress(String address) { |
| 26 | 26 | this.address = address; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public int getAreaId() { | |
| 29 | + public String getAreaId() { | |
| 30 | 30 | return areaId; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - public void setAreaId(int areaId) { | |
| 33 | + public void setAreaId(String areaId) { | |
| 34 | 34 | this.areaId = areaId; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public int getCityId() { | |
| 37 | + public String getCityId() { | |
| 38 | 38 | return cityId; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public void setCityId(int cityId) { | |
| 41 | + public void setCityId(String cityId) { | |
| 42 | 42 | this.cityId = cityId; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public int getProvinceId() { | |
| 45 | + public String getProvinceId() { | |
| 46 | 46 | return provinceId; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public void setProvinceId(int provinceId) { | |
| 49 | + public void setProvinceId(String provinceId) { | |
| 50 | 50 | this.provinceId = provinceId; |
| 51 | 51 | } |
| 52 | 52 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/VisitAddRequest.java
View file @
4134412
| ... | ... | @@ -67,35 +67,35 @@ |
| 67 | 67 | */ |
| 68 | 68 | private String address; |
| 69 | 69 | |
| 70 | - private int provinceId; | |
| 71 | - private int cityId; | |
| 72 | - private int areaId; | |
| 70 | + private String provinceId; | |
| 71 | + private String cityId; | |
| 72 | + private String areaId; | |
| 73 | 73 | |
| 74 | 74 | public void setAddress(String address) { |
| 75 | 75 | this.address = address; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public int getAreaId() { | |
| 78 | + public String getAreaId() { | |
| 79 | 79 | return areaId; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public void setAreaId(int areaId) { | |
| 82 | + public void setAreaId(String areaId) { | |
| 83 | 83 | this.areaId = areaId; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - public int getCityId() { | |
| 86 | + public String getCityId() { | |
| 87 | 87 | return cityId; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - public void setCityId(int cityId) { | |
| 90 | + public void setCityId(String cityId) { | |
| 91 | 91 | this.cityId = cityId; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public int getProvinceId() { | |
| 94 | + public String getProvinceId() { | |
| 95 | 95 | return provinceId; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - public void setProvinceId(int provinceId) { | |
| 98 | + public void setProvinceId(String provinceId) { | |
| 99 | 99 | this.provinceId = provinceId; |
| 100 | 100 | } |
| 101 | 101 | |
| ... | ... | @@ -565,9 +565,9 @@ |
| 565 | 565 | |
| 566 | 566 | private String address; |
| 567 | 567 | |
| 568 | - private int provinceId; | |
| 569 | - private int cityId; | |
| 570 | - private int areaId; | |
| 568 | + private String provinceId; | |
| 569 | + private String cityId; | |
| 570 | + private String areaId; | |
| 571 | 571 | |
| 572 | 572 | private String phone; |
| 573 | 573 | |
| 574 | 574 | |
| 575 | 575 | |
| 576 | 576 | |
| 577 | 577 | |
| 578 | 578 | |
| ... | ... | @@ -579,27 +579,27 @@ |
| 579 | 579 | this.phone = phone; |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | - public int getAreaId() { | |
| 582 | + public String getAreaId() { | |
| 583 | 583 | return areaId; |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | - public void setAreaId(int areaId) { | |
| 586 | + public void setAreaId(String areaId) { | |
| 587 | 587 | this.areaId = areaId; |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - public int getCityId() { | |
| 590 | + public String getCityId() { | |
| 591 | 591 | return cityId; |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - public void setCityId(int cityId) { | |
| 594 | + public void setCityId(String cityId) { | |
| 595 | 595 | this.cityId = cityId; |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | - public int getProvinceId() { | |
| 598 | + public String getProvinceId() { | |
| 599 | 599 | return provinceId; |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | - public void setProvinceId(int provinceId) { | |
| 602 | + public void setProvinceId(String provinceId) { | |
| 603 | 603 | this.provinceId = provinceId; |
| 604 | 604 | } |
| 605 | 605 | |
| ... | ... | @@ -726,9 +726,9 @@ |
| 726 | 726 | result = prime * result + ((dueType == null) ? 0 : dueType.hashCode()); |
| 727 | 727 | result = prime * result + ((id == null) ? 0 : id.hashCode()); |
| 728 | 728 | result = prime * result + ((name == null) ? 0 : name.hashCode()); |
| 729 | - result = prime * result + cityId; | |
| 730 | - result = prime * result + areaId; | |
| 731 | - result = prime * result + provinceId; | |
| 729 | + result = prime * result + cityId==null?0:cityId.hashCode(); | |
| 730 | + result = prime * result + areaId==null?0:areaId.hashCode(); | |
| 731 | + result = prime * result + provinceId==null?0:provinceId.hashCode(); | |
| 732 | 732 | return result; |
| 733 | 733 | } |
| 734 | 734 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AddressInner.java
View file @
4134412
| ... | ... | @@ -4,14 +4,14 @@ |
| 4 | 4 | * Created by Administrator on 2016/4/29 0029. |
| 5 | 5 | */ |
| 6 | 6 | public class AddressInner { |
| 7 | - private int id; | |
| 7 | + private String id; | |
| 8 | 8 | private String name; |
| 9 | 9 | |
| 10 | - public int getId() { | |
| 10 | + public String getId() { | |
| 11 | 11 | return id; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - public void setId(int id) { | |
| 14 | + public void setId(String id) { | |
| 15 | 15 | this.id = id; |
| 16 | 16 | } |
| 17 | 17 |