Commit c742e7d1e355f8edaf9a3cd048f2a0c536ad1536
1 parent
67d0db51ad
Exists in
master
and in
1 other branch
增加社区id
Showing 8 changed files with 61 additions and 48 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IVisitDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/VisitDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/VisitService.java
- platform-common/src/main/java/com/lyms/platform/common/constants/ConstantInterface.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/PatientFacade.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/result/PuerperaResult.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IVisitDao.java
View file @
c742e7d
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/VisitDaoImpl.java
View file @
c742e7d
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/VisitService.java
View file @
c742e7d
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | public List<VisitModel> queryVisit(VisitQuery visitQuery) { |
31 | 31 | MongoQuery query = visitQuery.convertToQuery(); |
32 | 32 | if (StringUtils.isNotEmpty(visitQuery.getNeed())) { |
33 | - visitQuery.mysqlBuild(iVisitDao.queryPuerperaCount(visitQuery.convertToQuery())); | |
33 | + visitQuery.mysqlBuild(iVisitDao.queryVisitCount(visitQuery.convertToQuery())); | |
34 | 34 | query.start(visitQuery.getOffset()).end(visitQuery.getLimit()); |
35 | 35 | } |
36 | 36 | |
... | ... | @@ -40,6 +40,9 @@ |
40 | 40 | |
41 | 41 | public Page<VisitModel> queryVisitsAndPage(int start, int end) { |
42 | 42 | return iVisitDao.findPage(MongoCondition.newInstance().toMongoQuery().start(start).end(end).addOrder(Direction.ASC, "id")); |
43 | + } | |
44 | + public int queryVisitCount(VisitQuery visitQuery){ | |
45 | + return iVisitDao.queryVisitCount(visitQuery.convertToQuery()); | |
43 | 46 | } |
44 | 47 | } |
platform-common/src/main/java/com/lyms/platform/common/constants/ConstantInterface.java
View file @
c742e7d
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java
View file @
c742e7d
... | ... | @@ -5,8 +5,7 @@ |
5 | 5 | import java.util.List; |
6 | 6 | import java.util.Map; |
7 | 7 | |
8 | -import com.lyms.platform.biz.service.CommunityConfigService; | |
9 | -import com.lyms.platform.biz.service.PatientsService; | |
8 | +import com.lyms.platform.biz.service.*; | |
10 | 9 | import com.lyms.platform.common.utils.DateUtil; |
11 | 10 | import com.lyms.platform.common.utils.JsonUtil; |
12 | 11 | import com.lyms.platform.pojo.CommunityConfig; |
... | ... | @@ -17,8 +16,6 @@ |
17 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
18 | 17 | import org.springframework.stereotype.Component; |
19 | 18 | |
20 | -import com.lyms.platform.biz.service.BabyService; | |
21 | -import com.lyms.platform.biz.service.PuerperaService; | |
22 | 19 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
23 | 20 | import com.lyms.platform.common.enums.YnEnums; |
24 | 21 | import com.lyms.platform.common.result.BaseListResponse; |
... | ... | @@ -43,6 +40,8 @@ |
43 | 40 | |
44 | 41 | @Autowired |
45 | 42 | private BabyService babyService; |
43 | + @Autowired | |
44 | + private VisitFacade visitFacade; | |
46 | 45 | |
47 | 46 | /** |
48 | 47 | * 根据条件查询符合条件的新生儿 |
... | ... | @@ -224,7 +223,8 @@ |
224 | 223 | babyResult.setMotherName("母亲名字"); |
225 | 224 | babyResult.setMotherPhone(patients.getPhone()); |
226 | 225 | babyResult.setId(patients.getId()); |
227 | - babyResult.setVisit(patients.getIsVisit() == 0 ? "未访视" : "已访视"); | |
226 | + String tips= visitFacade.getFindTips(patients.getId()); | |
227 | + babyResult.setVisit(tips); | |
228 | 228 | babyResult.setVisitStatus(patients.getIsVisit()); |
229 | 229 | return babyResult; |
230 | 230 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
c742e7d
... | ... | @@ -34,6 +34,8 @@ |
34 | 34 | private PatientsService patientsService; |
35 | 35 | @Autowired |
36 | 36 | private CommunityConfigService communityConfigService; |
37 | + @Autowired | |
38 | + private VisitFacade visitFacade; | |
37 | 39 | |
38 | 40 | |
39 | 41 | /** |
... | ... | @@ -98,8 +100,8 @@ |
98 | 100 | comm= communityConfig.getName(); |
99 | 101 | } |
100 | 102 | } |
101 | - | |
102 | - data.add(result.convertToResult(model,comm)); | |
103 | + String tips= visitFacade.getFindTips(model.getId()); | |
104 | + data.add(result.convertToResult(model,comm,tips)); | |
103 | 105 | } |
104 | 106 | } |
105 | 107 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
c742e7d
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | -import java.util.ArrayList; | |
4 | -import java.util.List; | |
5 | - | |
6 | 3 | import com.lyms.platform.biz.service.*; |
7 | -import com.lyms.platform.pojo.*; | |
8 | -import com.lyms.platform.query.PatientsQuery; | |
9 | -import org.apache.commons.collections.CollectionUtils; | |
10 | -import org.apache.commons.lang.StringUtils; | |
11 | -import org.springframework.beans.factory.annotation.Autowired; | |
12 | -import org.springframework.stereotype.Component; | |
13 | - | |
14 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
15 | 5 | import com.lyms.platform.common.enums.YnEnums; |
16 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
17 | 7 | |
18 | 8 | |
19 | 9 | |
20 | 10 | |
... | ... | @@ -22,13 +12,24 @@ |
22 | 12 | import com.lyms.platform.operate.web.result.BabyVisitResult.BabyVisit; |
23 | 13 | import com.lyms.platform.operate.web.result.SimpleVisit; |
24 | 14 | import com.lyms.platform.operate.web.result.VisitResult; |
15 | +import com.lyms.platform.pojo.BabyModel; | |
16 | +import com.lyms.platform.pojo.BabyVisitModel; | |
17 | +import com.lyms.platform.pojo.Patients; | |
18 | +import com.lyms.platform.pojo.VisitModel; | |
25 | 19 | import com.lyms.platform.query.BabyModelQuery; |
26 | -import com.lyms.platform.query.PuerperaModelQuery; | |
20 | +import com.lyms.platform.query.PatientsQuery; | |
27 | 21 | import com.lyms.platform.query.VisitQuery; |
22 | +import org.apache.commons.collections.CollectionUtils; | |
23 | +import org.apache.commons.lang.StringUtils; | |
24 | +import org.springframework.beans.factory.annotation.Autowired; | |
25 | +import org.springframework.stereotype.Component; | |
28 | 26 | |
27 | +import java.util.ArrayList; | |
28 | +import java.util.List; | |
29 | + | |
29 | 30 | /** |
30 | 31 | * 产后访视门面 |
31 | - * | |
32 | + * | |
32 | 33 | * @author Administrator |
33 | 34 | */ |
34 | 35 | @Component |
... | ... | @@ -50,7 +51,7 @@ |
50 | 51 | |
51 | 52 | /** |
52 | 53 | * 根据产妇id获取产妇的访视信息 |
53 | - * | |
54 | + * | |
54 | 55 | * @param id |
55 | 56 | * @return |
56 | 57 | */ |
57 | 58 | |
... | ... | @@ -60,13 +61,12 @@ |
60 | 61 | |
61 | 62 | /** |
62 | 63 | * 根据产妇身份证号获取产妇访视记录 |
63 | - * | |
64 | - * @param cardNo | |
65 | - * 身份证号 | |
64 | + * | |
65 | + * @param cardNo 身份证号 | |
66 | 66 | * @return |
67 | 67 | */ |
68 | 68 | public BaseObjectResponse findOneByCardNo(String cardNo) { |
69 | - Patients puerperaModel= findOnePuerperaByCardNo(cardNo); | |
69 | + Patients puerperaModel = findOnePuerperaByCardNo(cardNo); | |
70 | 70 | if (null == puerperaModel) { |
71 | 71 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("产妇信息不存在"); |
72 | 72 | } |
... | ... | @@ -75,7 +75,7 @@ |
75 | 75 | |
76 | 76 | /** |
77 | 77 | * 构建产妇的访视记录信息 |
78 | - * | |
78 | + * | |
79 | 79 | * @param puerperaModel |
80 | 80 | * @return |
81 | 81 | */ |
... | ... | @@ -101,9 +101,8 @@ |
101 | 101 | |
102 | 102 | /** |
103 | 103 | * 根据身份证号码获取产妇信息 |
104 | - * | |
105 | - * @param cardNo | |
106 | - * 身份证号码 | |
104 | + * | |
105 | + * @param cardNo 身份证号码 | |
107 | 106 | * @return 产妇信息 |
108 | 107 | */ |
109 | 108 | private Patients findOnePuerperaByCardNo(String cardNo) { |
... | ... | @@ -118,9 +117,8 @@ |
118 | 117 | |
119 | 118 | /** |
120 | 119 | * 增加产妇访视记录 |
121 | - * | |
122 | - * @param visitRequest | |
123 | - * 产妇访视记录请求 | |
120 | + * | |
121 | + * @param visitRequest 产妇访视记录请求 | |
124 | 122 | * @return 返回结果 |
125 | 123 | */ |
126 | 124 | public BaseResponse addOneVisit(VisitAddRequest visitRequest) { |
... | ... | @@ -148,7 +146,7 @@ |
148 | 146 | } else { |
149 | 147 | // 表示是新的产妇直接新增 |
150 | 148 | // parentId = puerperaService.addPuerpera(visitRequest.getPuerpera().build()).getId(); |
151 | - parentId =patientsService.addPatient(visitRequest.getPatients()).getId(); | |
149 | + parentId = patientsService.addPatient(visitRequest.getPatients()).getId(); | |
152 | 150 | } |
153 | 151 | |
154 | 152 | // 如果为空表示新增 |
... | ... | @@ -165,7 +163,7 @@ |
165 | 163 | |
166 | 164 | /** |
167 | 165 | * 增加一条小孩的访视记录 |
168 | - * | |
166 | + * | |
169 | 167 | * @param babyVisitAddRequest |
170 | 168 | * @return |
171 | 169 | */ |
172 | 170 | |
... | ... | @@ -187,11 +185,19 @@ |
187 | 185 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
188 | 186 | } |
189 | 187 | |
188 | + public String getFindTips(String parentId) { | |
189 | + VisitQuery visitQuery = new VisitQuery(); | |
190 | + visitQuery.setParentId(parentId); | |
191 | + | |
192 | + int count = visitService.queryVisitCount(visitQuery); | |
193 | + | |
194 | + return count > 0 ? "未访视" : "访视" + count + "次"; | |
195 | + } | |
196 | + | |
190 | 197 | /** |
191 | 198 | * 根据产妇的身份证号码获取小孩的访视记录 |
192 | - * | |
193 | - * @param cardNo | |
194 | - * 产妇身份证号码 | |
199 | + * | |
200 | + * @param cardNo 产妇身份证号码 | |
195 | 201 | */ |
196 | 202 | public BaseObjectResponse findBabyVisitByMotherCardNo(String cardNo) { |
197 | 203 | // 根据身份证号获取到产妇信息 |
198 | 204 | |
199 | 205 | |
200 | 206 | |
... | ... | @@ -203,18 +209,18 @@ |
203 | 209 | } |
204 | 210 | |
205 | 211 | private BaseObjectResponse findBabyVisit(Patients puerperaModel) { |
206 | - BabyModelQuery babyQuery = new BabyModelQuery(); | |
212 | + BabyModelQuery babyQuery = new BabyModelQuery(); | |
207 | 213 | babyQuery.setParentId(puerperaModel.getId()); |
208 | 214 | babyQuery.setYn(YnEnums.YES.getId()); |
209 | - List<BabyModel> babies= babyService.queryBabyWithQuery(babyQuery); | |
215 | + List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery); | |
210 | 216 | BabyVisitResult babyVisitResult = new BabyVisitResult(); |
211 | 217 | List<BabyVisitResult.BabyVisit> data = new ArrayList<BabyVisitResult.BabyVisit>(); |
212 | - for(BabyModel bModel:babies){ | |
213 | - // 根据产妇id查询该产妇下的小孩访视 | |
218 | + for (BabyModel bModel : babies) { | |
219 | + // 根据产妇id查询该产妇下的小孩访视 | |
214 | 220 | List<BabyVisitModel> babyVisits = babyVisitService.findAllVisitByParentId(bModel.getId()); |
215 | 221 | |
216 | 222 | // 数据转换 |
217 | - | |
223 | + | |
218 | 224 | for (BabyVisitModel visit : babyVisits) { |
219 | 225 | BabyVisit babyVisit = babyVisitResult.new BabyVisit(); |
220 | 226 | // 转换小孩的访视数据 |
... | ... | @@ -231,7 +237,7 @@ |
231 | 237 | |
232 | 238 | /** |
233 | 239 | * 根据小孩id查询 |
234 | - * | |
240 | + * | |
235 | 241 | * @param babyId |
236 | 242 | * @return |
237 | 243 | */ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PuerperaResult.java
View file @
c742e7d
... | ... | @@ -127,7 +127,7 @@ |
127 | 127 | return this; |
128 | 128 | } |
129 | 129 | |
130 | - public PuerperaResult convertToResult(Patients model,String comm) { | |
130 | + public PuerperaResult convertToResult(Patients model,String comm,String tips) { | |
131 | 131 | String addr = ""; |
132 | 132 | if (StringUtils.isNotEmpty(model.getAddress())) { |
133 | 133 | try { |
... | ... | @@ -140,7 +140,7 @@ |
140 | 140 | setAddress(addr); |
141 | 141 | setId(model.getId()); |
142 | 142 | setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); |
143 | - setVisit(model.getIsVisit() == 0 ? "未访视" : "已访视"); | |
143 | + setVisit(tips); | |
144 | 144 | setCommunityId(StringUtils.isEmpty(model.getCommunityId()) ? "" : model.getCommunityId()); |
145 | 145 | setCommunity(comm); |
146 | 146 | setPhone(model.getPhone()); |