Commit becc353127bd8f4480917c51380b1ed6392dbc53
1 parent
3311433036
Exists in
master
and in
1 other branch
增加权限
Showing 9 changed files with 241 additions and 54 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.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/Address.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyVisitResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PuerperaResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/VisitResult.java
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
becc353
... | ... | @@ -32,6 +32,34 @@ |
32 | 32 | * 地址 |
33 | 33 | */ |
34 | 34 | private String address; |
35 | + private int provinceId; | |
36 | + private int cityId; | |
37 | + private int areaId; | |
38 | + | |
39 | + public int getAreaId() { | |
40 | + return areaId; | |
41 | + } | |
42 | + | |
43 | + public void setAreaId(int areaId) { | |
44 | + this.areaId = areaId; | |
45 | + } | |
46 | + | |
47 | + public int getCityId() { | |
48 | + return cityId; | |
49 | + } | |
50 | + | |
51 | + public void setCityId(int cityId) { | |
52 | + this.cityId = cityId; | |
53 | + } | |
54 | + | |
55 | + public int getProvinceId() { | |
56 | + return provinceId; | |
57 | + } | |
58 | + | |
59 | + public void setProvinceId(int provinceId) { | |
60 | + this.provinceId = provinceId; | |
61 | + } | |
62 | + | |
35 | 63 | /** |
36 | 64 | * 社区id |
37 | 65 | */ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java
View file @
becc353
... | ... | @@ -189,7 +189,7 @@ |
189 | 189 | } |
190 | 190 | public BabyResult buildResult(Patients patients){ |
191 | 191 | BabyResult babyResult = new BabyResult(); |
192 | - String addr = ""; | |
192 | + /* String addr = ""; | |
193 | 193 | if (StringUtils.isNotEmpty(patients.getAddress())) { |
194 | 194 | try { |
195 | 195 | Map map = JsonUtil.str2Obj(patients.getAddress(), Map.class); |
... | ... | @@ -197,8 +197,8 @@ |
197 | 197 | } catch (Exception e) { |
198 | 198 | addr = ""; |
199 | 199 | } |
200 | - } | |
201 | - babyResult.setAddress(addr); | |
200 | + }*/ | |
201 | + babyResult.setAddress(patients.getAddress()); | |
202 | 202 | |
203 | 203 | babyResult.setCommunityId(StringUtils.isEmpty(patients.getCommunityId()) ? "" : patients.getCommunityId()); |
204 | 204 | String comm="未分配"; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
becc353
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | -import com.lyms.platform.biz.service.*; | |
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; | |
4 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
5 | 8 | import com.lyms.platform.common.enums.YnEnums; |
6 | 9 | import com.lyms.platform.common.result.BaseObjectResponse; |
7 | 10 | |
8 | 11 | |
... | ... | @@ -8,15 +11,16 @@ |
8 | 11 | import com.lyms.platform.operate.web.request.BabyVisitAddRequest; |
9 | 12 | import com.lyms.platform.operate.web.request.VisitAddRequest; |
10 | 13 | import com.lyms.platform.operate.web.request.VisitAddRequest.SimpleVisitPuerpera; |
14 | +import com.lyms.platform.operate.web.result.Address; | |
11 | 15 | import com.lyms.platform.operate.web.result.BabyVisitResult; |
12 | 16 | import com.lyms.platform.operate.web.result.BabyVisitResult.BabyVisit; |
13 | 17 | import com.lyms.platform.operate.web.result.SimpleVisit; |
14 | 18 | import com.lyms.platform.operate.web.result.VisitResult; |
19 | +import com.lyms.platform.permission.service.RegionsService; | |
15 | 20 | import com.lyms.platform.pojo.BabyModel; |
16 | 21 | import com.lyms.platform.pojo.BabyVisitModel; |
17 | 22 | import com.lyms.platform.pojo.Patients; |
18 | 23 | import com.lyms.platform.pojo.VisitModel; |
19 | -import com.lyms.platform.query.BabyModelQuery; | |
20 | 24 | import com.lyms.platform.query.PatientsQuery; |
21 | 25 | import com.lyms.platform.query.VisitQuery; |
22 | 26 | import org.apache.commons.collections.CollectionUtils; |
23 | 27 | |
... | ... | @@ -39,15 +43,14 @@ |
39 | 43 | private VisitService visitService; |
40 | 44 | |
41 | 45 | @Autowired |
42 | - private PuerperaService puerperaService; | |
43 | - | |
44 | - @Autowired | |
45 | 46 | private BabyVisitService babyVisitService; |
46 | 47 | |
47 | 48 | @Autowired |
48 | 49 | private BabyService babyService; |
49 | 50 | @Autowired |
50 | 51 | private PatientsService patientsService; |
52 | + @Autowired | |
53 | + private RegionsService regionsService; | |
51 | 54 | |
52 | 55 | /** |
53 | 56 | * 根据产妇id获取产妇的访视信息 |
... | ... | @@ -82,7 +85,7 @@ |
82 | 85 | private BaseObjectResponse doBiz(Patients puerperaModel) { |
83 | 86 | VisitResult data = new VisitResult(); |
84 | 87 | if (null != puerperaModel) { |
85 | - data.convertToResult1(puerperaModel); | |
88 | + data.convertToResult1(puerperaModel, fullAddress(puerperaModel)); | |
86 | 89 | VisitQuery visitQuery = new VisitQuery(); |
87 | 90 | visitQuery.setParentId(puerperaModel.getId()); |
88 | 91 | List<VisitModel> visits = visitService.queryVisit(visitQuery); |
... | ... | @@ -100,6 +103,24 @@ |
100 | 103 | } |
101 | 104 | |
102 | 105 | /** |
106 | + * 填充地址信息 | |
107 | + * | |
108 | + * @param puerperaModel | |
109 | + * @return | |
110 | + */ | |
111 | + private Address fullAddress(Patients puerperaModel) { | |
112 | + Address address = new Address(); | |
113 | + address.setAreaId(puerperaModel.getAreaId()); | |
114 | + address.setCityId(puerperaModel.getCityId()); | |
115 | + address.setProvinceId(puerperaModel.getProvinceId()); | |
116 | + | |
117 | + address.setArea(regionsService.getRegions(puerperaModel.getAreaId()).getRegionName()); | |
118 | + address.setCity(regionsService.getRegions(puerperaModel.getCityId()).getRegionName()); | |
119 | + address.setProvince(regionsService.getRegions(puerperaModel.getProvinceId()).getRegionName()); | |
120 | + return address; | |
121 | + } | |
122 | + | |
123 | + /** | |
103 | 124 | * 根据身份证号码获取产妇信息 |
104 | 125 | * |
105 | 126 | * @param cardNo 身份证号码 |
... | ... | @@ -125,9 +146,6 @@ |
125 | 146 | // 获取患者id |
126 | 147 | String parentId = visitRequest.getParentId(); |
127 | 148 | if (StringUtils.isNotEmpty(parentId)) { |
128 | - /* PuerperaModelQuery puerperaQuery = new PuerperaModelQuery(); | |
129 | - puerperaQuery.setId(parentId); | |
130 | - PuerperaModel model;*/ | |
131 | 149 | Patients model; |
132 | 150 | PatientsQuery patientsQuery = new PatientsQuery(); |
133 | 151 | patientsQuery.setId(parentId); |
... | ... | @@ -181,6 +199,7 @@ |
181 | 199 | } else { |
182 | 200 | babyVisitService.updateOneBabyVisit(babyVisitAddRequest.convertToDataModel(), babyVisitAddRequest.getId()); |
183 | 201 | } |
202 | + patientsService.updatePatient(babyVisitAddRequest.getPatients()); | |
184 | 203 | |
185 | 204 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
186 | 205 | } |
187 | 206 | |
188 | 207 | |
189 | 208 | |
190 | 209 | |
191 | 210 | |
... | ... | @@ -209,28 +228,26 @@ |
209 | 228 | } |
210 | 229 | |
211 | 230 | private BaseObjectResponse findBabyVisit(Patients puerperaModel) { |
212 | - BabyModelQuery babyQuery = new BabyModelQuery(); | |
231 | +/* BabyModelQuery babyQuery = new BabyModelQuery(); | |
213 | 232 | babyQuery.setParentId(puerperaModel.getId()); |
214 | 233 | babyQuery.setYn(YnEnums.YES.getId()); |
215 | - List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery); | |
234 | + List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery);*/ | |
216 | 235 | BabyVisitResult babyVisitResult = new BabyVisitResult(); |
217 | 236 | List<BabyVisitResult.BabyVisit> data = new ArrayList<BabyVisitResult.BabyVisit>(); |
218 | - for (BabyModel bModel : babies) { | |
219 | - // 根据产妇id查询该产妇下的小孩访视 | |
220 | - List<BabyVisitModel> babyVisits = babyVisitService.findAllVisitByParentId(bModel.getId()); | |
237 | + // 根据产妇id查询该产妇下的小孩访视 | |
238 | + List<BabyVisitModel> babyVisits = babyVisitService.findAllVisitByParentId(puerperaModel.getId()); | |
221 | 239 | |
222 | - // 数据转换 | |
240 | + // 数据转换 | |
223 | 241 | |
224 | - for (BabyVisitModel visit : babyVisits) { | |
225 | - BabyVisit babyVisit = babyVisitResult.new BabyVisit(); | |
226 | - // 转换小孩的访视数据 | |
227 | - data.add(babyVisit.convertToResult(visit)); | |
228 | - } | |
242 | + for (BabyVisitModel visit : babyVisits) { | |
243 | + BabyVisit babyVisit = babyVisitResult.new BabyVisit(); | |
244 | + // 转换小孩的访视数据 | |
245 | + data.add(babyVisit.convertToResult(visit)); | |
229 | 246 | } |
230 | 247 | |
231 | 248 | // TODO 需要转换成具体的result对象 |
232 | 249 | // 设置产妇的信息 |
233 | - babyVisitResult.convertToResult1(puerperaModel); | |
250 | + babyVisitResult.convertToResult1(puerperaModel,fullAddress(puerperaModel)); | |
234 | 251 | babyVisitResult.setData(data); |
235 | 252 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(babyVisitResult); |
236 | 253 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyVisitAddRequest.java
View file @
becc353
... | ... | @@ -4,7 +4,10 @@ |
4 | 4 | import com.lyms.platform.common.core.annotation.form.Form; |
5 | 5 | import com.lyms.platform.common.utils.DateUtil; |
6 | 6 | import com.lyms.platform.pojo.BabyVisitModel; |
7 | +import com.lyms.platform.pojo.Patients; | |
7 | 8 | |
9 | +import java.util.Date; | |
10 | + | |
8 | 11 | @Form |
9 | 12 | public class BabyVisitAddRequest implements IBasicRequestConvert<BabyVisitModel> { |
10 | 13 | /** |
... | ... | @@ -12,6 +15,41 @@ |
12 | 15 | */ |
13 | 16 | private String parentId; |
14 | 17 | |
18 | + | |
19 | + private String address; | |
20 | + | |
21 | + private int provinceId; | |
22 | + private int cityId; | |
23 | + private int areaId; | |
24 | + | |
25 | + public void setAddress(String address) { | |
26 | + this.address = address; | |
27 | + } | |
28 | + | |
29 | + public int getAreaId() { | |
30 | + return areaId; | |
31 | + } | |
32 | + | |
33 | + public void setAreaId(int areaId) { | |
34 | + this.areaId = areaId; | |
35 | + } | |
36 | + | |
37 | + public int getCityId() { | |
38 | + return cityId; | |
39 | + } | |
40 | + | |
41 | + public void setCityId(int cityId) { | |
42 | + this.cityId = cityId; | |
43 | + } | |
44 | + | |
45 | + public int getProvinceId() { | |
46 | + return provinceId; | |
47 | + } | |
48 | + | |
49 | + public void setProvinceId(int provinceId) { | |
50 | + this.provinceId = provinceId; | |
51 | + } | |
52 | + | |
15 | 53 | // 名称 |
16 | 54 | private String name; |
17 | 55 | |
... | ... | @@ -696,6 +734,15 @@ |
696 | 734 | babyVisitModel.setParentId(parentId); |
697 | 735 | babyVisitModel.setId(id); |
698 | 736 | return babyVisitModel; |
737 | + } | |
738 | + public Patients getPatients(){ | |
739 | + Patients patients = new Patients(); | |
740 | + patients.setId(parentId); | |
741 | + patients.setAddress(address); | |
742 | + patients.setAreaId(areaId); | |
743 | + patients.setCityId(cityId); | |
744 | + patients.setProvinceId(provinceId); | |
745 | + return patients; | |
699 | 746 | } |
700 | 747 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/VisitAddRequest.java
View file @
becc353
... | ... | @@ -74,8 +74,40 @@ |
74 | 74 | /** |
75 | 75 | * 地址 |
76 | 76 | */ |
77 | - private Map address; | |
77 | + private String address; | |
78 | 78 | |
79 | + private int provinceId; | |
80 | + private int cityId; | |
81 | + private int areaId; | |
82 | + | |
83 | + public void setAddress(String address) { | |
84 | + this.address = address; | |
85 | + } | |
86 | + | |
87 | + public int getAreaId() { | |
88 | + return areaId; | |
89 | + } | |
90 | + | |
91 | + public void setAreaId(int areaId) { | |
92 | + this.areaId = areaId; | |
93 | + } | |
94 | + | |
95 | + public int getCityId() { | |
96 | + return cityId; | |
97 | + } | |
98 | + | |
99 | + public void setCityId(int cityId) { | |
100 | + this.cityId = cityId; | |
101 | + } | |
102 | + | |
103 | + public int getProvinceId() { | |
104 | + return provinceId; | |
105 | + } | |
106 | + | |
107 | + public void setProvinceId(int provinceId) { | |
108 | + this.provinceId = provinceId; | |
109 | + } | |
110 | + | |
79 | 111 | // 产妇基本信息 end |
80 | 112 | /** |
81 | 113 | * 访视记录id |
82 | 114 | |
... | ... | @@ -232,13 +264,7 @@ |
232 | 264 | this.address = address; |
233 | 265 | }*/ |
234 | 266 | |
235 | - public Map getAddress() { | |
236 | - return address; | |
237 | - } | |
238 | 267 | |
239 | - public void setAddress(Map address) { | |
240 | - this.address = address; | |
241 | - } | |
242 | 268 | |
243 | 269 | public String getNumOfLive() { |
244 | 270 | return numOfLive; |
... | ... | @@ -454,7 +480,10 @@ |
454 | 480 | patients.setDueDate(new Date()); |
455 | 481 | patients.setDeliverOrg(deliverOrg); |
456 | 482 | patients.setDueType(dueType); |
457 | - patients.setAddress(JsonUtil.obj2JsonString(address)); | |
483 | + patients.setAddress(address); | |
484 | + patients.setAreaId(areaId); | |
485 | + patients.setCityId(cityId); | |
486 | + patients.setProvinceId(provinceId); | |
458 | 487 | return patients; |
459 | 488 | } |
460 | 489 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/Address.java
View file @
becc353
1 | +package com.lyms.platform.operate.web.result; | |
2 | + | |
3 | +public class Address { | |
4 | + private Integer provinceId; | |
5 | + private Integer cityId; | |
6 | + private Integer areaId; | |
7 | + private String province; | |
8 | + private String city; | |
9 | + private String area; | |
10 | + private String address; | |
11 | + | |
12 | + public String getArea() { | |
13 | + return area; | |
14 | + } | |
15 | + | |
16 | + public void setArea(String area) { | |
17 | + this.area = area; | |
18 | + } | |
19 | + | |
20 | + public Integer getAreaId() { | |
21 | + return areaId; | |
22 | + } | |
23 | + | |
24 | + public void setAreaId(Integer areaId) { | |
25 | + this.areaId = areaId; | |
26 | + } | |
27 | + | |
28 | + public String getCity() { | |
29 | + return city; | |
30 | + } | |
31 | + | |
32 | + public void setCity(String city) { | |
33 | + this.city = city; | |
34 | + } | |
35 | + | |
36 | + public Integer getCityId() { | |
37 | + return cityId; | |
38 | + } | |
39 | + | |
40 | + public void setCityId(Integer cityId) { | |
41 | + this.cityId = cityId; | |
42 | + } | |
43 | + | |
44 | + public String getAddress() { | |
45 | + return address; | |
46 | + } | |
47 | + | |
48 | + public void setAddress(String address) { | |
49 | + this.address = address; | |
50 | + } | |
51 | + | |
52 | + public String getProvince() { | |
53 | + return province; | |
54 | + } | |
55 | + | |
56 | + public void setProvince(String province) { | |
57 | + this.province = province; | |
58 | + } | |
59 | + | |
60 | + public Integer getProvinceId() { | |
61 | + return provinceId; | |
62 | + } | |
63 | + | |
64 | + public void setProvinceId(Integer provinceId) { | |
65 | + this.provinceId = provinceId; | |
66 | + } | |
67 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyVisitResult.java
View file @
becc353
... | ... | @@ -29,6 +29,8 @@ |
29 | 29 | // 产妇的id |
30 | 30 | private String parentId; |
31 | 31 | |
32 | + private Address address; | |
33 | + | |
32 | 34 | // 具体的访视记录 |
33 | 35 | private List<BabyVisit> data; |
34 | 36 | |
... | ... | @@ -72,6 +74,14 @@ |
72 | 74 | this.data = data; |
73 | 75 | } |
74 | 76 | |
77 | + public Address getAddress() { | |
78 | + return address; | |
79 | + } | |
80 | + | |
81 | + public void setAddress(Address address) { | |
82 | + this.address = address; | |
83 | + } | |
84 | + | |
75 | 85 | /** |
76 | 86 | * 小孩的访视记录 |
77 | 87 | * |
78 | 88 | |
... | ... | @@ -763,11 +773,11 @@ |
763 | 773 | |
764 | 774 | return this; |
765 | 775 | } |
766 | - public BabyVisitResult convertToResult1(Patients destModel) { | |
776 | + public BabyVisitResult convertToResult1(Patients destModel,Address address) { | |
767 | 777 | setAge(destModel.getAge()); |
768 | 778 | setmCardNo(destModel.getCardNo()); |
769 | 779 | setmName(destModel.getUsername()); |
770 | - | |
780 | + setAddress(address); | |
771 | 781 | return this; |
772 | 782 | } |
773 | 783 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PuerperaResult.java
View file @
becc353
... | ... | @@ -128,7 +128,7 @@ |
128 | 128 | } |
129 | 129 | |
130 | 130 | public PuerperaResult convertToResult(Patients model,String comm,String tips) { |
131 | - String addr = ""; | |
131 | + /* String addr = ""; | |
132 | 132 | if (StringUtils.isNotEmpty(model.getAddress())) { |
133 | 133 | try { |
134 | 134 | Map map = JsonUtil.str2Obj(model.getAddress(), Map.class); |
... | ... | @@ -136,8 +136,8 @@ |
136 | 136 | } catch (Exception e) { |
137 | 137 | addr = ""; |
138 | 138 | } |
139 | - } | |
140 | - setAddress(addr); | |
139 | + }*/ | |
140 | + setAddress(model.getAddress()); | |
141 | 141 | setId(model.getId()); |
142 | 142 | setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); |
143 | 143 | setVisit(tips); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/VisitResult.java
View file @
becc353
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | |
24 | 24 | private String deliverOrg; |
25 | 25 | |
26 | - private Map address=new HashMap(); | |
26 | + private Address address; | |
27 | 27 | |
28 | 28 | private List<SimpleVisit> data; |
29 | 29 | |
30 | 30 | |
... | ... | @@ -85,11 +85,11 @@ |
85 | 85 | this.deliverOrg = deliverOrg; |
86 | 86 | } |
87 | 87 | |
88 | - public Map getAddress() { | |
88 | + public Address getAddress() { | |
89 | 89 | return address; |
90 | 90 | } |
91 | 91 | |
92 | - public void setAddress(Map address) { | |
92 | + public void setAddress(Address address) { | |
93 | 93 | this.address = address; |
94 | 94 | } |
95 | 95 | |
96 | 96 | |
... | ... | @@ -101,21 +101,10 @@ |
101 | 101 | this.data = data; |
102 | 102 | } |
103 | 103 | |
104 | - public void convertToResult(PuerperaModel model) { | |
104 | + | |
105 | + public void convertToResult1(Patients model,Address address) { | |
105 | 106 | try { |
106 | - setAddress(JsonUtil.str2Obj(model.getAddress(), Map.class)); | |
107 | - } catch (Exception e) { | |
108 | - } | |
109 | - setAge(model.getAge()); | |
110 | - setCardNo(model.getCardNo()); | |
111 | - setDeliverOrg(model.getDeliverOrg()); | |
112 | - setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); | |
113 | - setDueType(model.getDueType()); | |
114 | - setName(model.getName()); | |
115 | - } | |
116 | - public void convertToResult1(Patients model) { | |
117 | - try { | |
118 | - setAddress(JsonUtil.str2Obj(model.getAddress(), Map.class)); | |
107 | + setAddress(address); | |
119 | 108 | } catch (Exception e) { |
120 | 109 | } |
121 | 110 |