Commit ae6097a9a10cb3adb1ebbf1278070960dc1681db
1 parent
3d9de63209
Exists in
master
and in
6 other branches
对接儿保小程序问诊数据
Showing 3 changed files with 329 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
ae6097a
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
13 | 13 | import com.lyms.platform.operate.web.facade.BabyCheckFacade; |
14 | 14 | import com.lyms.platform.operate.web.request.BabyCheckRequest; |
15 | +import com.lyms.platform.operate.web.request.BabyInterrogationRequest; | |
15 | 16 | import com.lyms.platform.operate.web.request.WxBabyMeasureRequest; |
16 | 17 | import com.lyms.platform.permission.service.CouponService; |
17 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -373,6 +374,16 @@ |
373 | 374 | return babyCheckFacade.babyMeasureInfoDetail(param); |
374 | 375 | } |
375 | 376 | |
376 | - | |
377 | + /** | |
378 | + * 获取在儿保小程序中当天填入的最新 --- 问诊信息 | |
379 | + * | |
380 | + * @param param | |
381 | + * @return | |
382 | + */ | |
383 | + @RequestMapping(method = RequestMethod.POST, value = "/interrogation/update") | |
384 | + @ResponseBody | |
385 | + public BaseResponse babyInterrogationInfoDetail(@RequestBody BabyInterrogationRequest param) { | |
386 | + return babyCheckFacade.babyInterrogationInfoDetail(param); | |
387 | + } | |
377 | 388 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
ae6097a
... | ... | @@ -11,12 +11,14 @@ |
11 | 11 | import com.lyms.platform.common.result.*; |
12 | 12 | import com.lyms.platform.common.utils.*; |
13 | 13 | import com.lyms.platform.operate.web.request.BabyCheckRequest; |
14 | +import com.lyms.platform.operate.web.request.BabyInterrogationRequest; | |
14 | 15 | import com.lyms.platform.operate.web.request.WxBabyMeasureRequest; |
15 | 16 | import com.lyms.platform.operate.web.result.*; |
16 | 17 | import com.lyms.platform.operate.web.service.BabyAfterVisitService; |
17 | 18 | import com.lyms.platform.operate.web.service.PatientWeightService; |
18 | 19 | import com.lyms.platform.operate.web.service.impl.BaseServiceImpl; |
19 | 20 | import com.lyms.platform.operate.web.utils.MongoUtil; |
21 | +import com.lyms.platform.operate.web.utils.ReflectUtil; | |
20 | 22 | import com.lyms.platform.permission.dao.master.CouponMapper; |
21 | 23 | import com.lyms.platform.permission.model.Organization; |
22 | 24 | import com.lyms.platform.permission.model.PatientService; |
... | ... | @@ -30,6 +32,7 @@ |
30 | 32 | import org.springframework.data.mongodb.core.MongoTemplate; |
31 | 33 | import org.springframework.data.mongodb.core.query.Criteria; |
32 | 34 | import org.springframework.data.mongodb.core.query.Query; |
35 | +import org.springframework.data.mongodb.core.query.Update; | |
33 | 36 | import org.springframework.stereotype.Component; |
34 | 37 | |
35 | 38 | import java.util.*; |
... | ... | @@ -2699,6 +2702,31 @@ |
2699 | 2702 | } |
2700 | 2703 | } |
2701 | 2704 | return baseResponse; |
2705 | + } | |
2706 | + | |
2707 | + /** | |
2708 | + * 获取在儿保小程序中当天填入的最新 --- 问诊信息 | |
2709 | + * | |
2710 | + * @param param | |
2711 | + * @return | |
2712 | + */ | |
2713 | + public BaseResponse babyInterrogationInfoDetail(BabyInterrogationRequest param) { | |
2714 | + Query query = new Query(); | |
2715 | + query.addCriteria(Criteria.where("mphone").is(param.getMphone()).and("yn").is(YnEnums.YES.getId()). | |
2716 | + and("created").gte(DateUtil.getDayFirstSecond(new Date())).lte(DateUtil.getDayLastSecond(new Date()))); | |
2717 | + List<BabyCheckModel> models = mongoTemplate.find(query, BabyCheckModel.class); | |
2718 | + if (CollectionUtils.isNotEmpty(models)) { | |
2719 | + for (BabyCheckModel model : models) { | |
2720 | + Update update = new Update(); | |
2721 | + Map<String, Object> updateField = ReflectionUtils.getUpdateField(param); | |
2722 | + Set<Map.Entry<String, Object>> entries = updateField.entrySet(); | |
2723 | + for (Map.Entry<String, Object> entry : entries) { | |
2724 | + update.set(entry.getKey(), entry.getValue()); | |
2725 | + } | |
2726 | + mongoTemplate.updateFirst(Query.query(Criteria.where("_id").is(model.getId())), update, BabyCheckModel.class); | |
2727 | + } | |
2728 | + } | |
2729 | + return new BaseResponse(); | |
2702 | 2730 | } |
2703 | 2731 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyInterrogationRequest.java
View file @
ae6097a
1 | +package com.lyms.platform.operate.web.request; | |
2 | + | |
3 | +import org.apache.commons.collections.map.HashedMap; | |
4 | + | |
5 | +import javax.validation.constraints.Pattern; | |
6 | +import java.io.Serializable; | |
7 | +import java.util.Map; | |
8 | + | |
9 | +/** | |
10 | + * | |
11 | + * @Author dongqin | |
12 | + * @Description | |
13 | + * @Date 16:28 2019/8/10 | |
14 | + */ | |
15 | +public class BabyInterrogationRequest implements Serializable { | |
16 | + | |
17 | + private static final long serialVersionUID = 3327190126319885852L; | |
18 | + | |
19 | + @Pattern(regexp = "^1[3|4|5|7|8][0-9]\\\\d{8}$") | |
20 | + private String mphone; | |
21 | + | |
22 | + /** | |
23 | + * 抚养人 | |
24 | + */ | |
25 | + private String mainFoster; | |
26 | + | |
27 | + /** | |
28 | + * 喂养方式 | |
29 | + */ | |
30 | + private String cnqk; | |
31 | + | |
32 | + /** | |
33 | + * 吃奶情况 | |
34 | + */ | |
35 | + private String milkingSituation; | |
36 | + | |
37 | + /** | |
38 | + * 每天吃奶次数 | |
39 | + */ | |
40 | + private String mtcnNum; | |
41 | + | |
42 | + /** | |
43 | + * 小便 | |
44 | + */ | |
45 | + private String pee; | |
46 | + | |
47 | + /** | |
48 | + * 小便次数 | |
49 | + */ | |
50 | + private String xbNum; | |
51 | + | |
52 | + /** | |
53 | + * 大便 | |
54 | + */ | |
55 | + private String excrement; | |
56 | + | |
57 | + /** | |
58 | + * 大便次数 | |
59 | + */ | |
60 | + private String dbNum; | |
61 | + | |
62 | + /** | |
63 | + * 大便天数 | |
64 | + */ | |
65 | + private String dbDayNum; | |
66 | + | |
67 | + /** | |
68 | + * 睡眠 | |
69 | + */ | |
70 | + private String sleep; | |
71 | + | |
72 | + /** | |
73 | + * 户外活动(小时) | |
74 | + */ | |
75 | + private String activity; | |
76 | + | |
77 | + /** | |
78 | + * 维生素D | |
79 | + */ | |
80 | + private String vitaminD; | |
81 | + | |
82 | + /** | |
83 | + * 维生素AD | |
84 | + */ | |
85 | + private String wssAd; | |
86 | + | |
87 | + /** | |
88 | + * 辅食添加 | |
89 | + */ | |
90 | + private String assistFood; | |
91 | + | |
92 | + /** | |
93 | + * 家庭措施 | |
94 | + */ | |
95 | + private String homeMeasure; | |
96 | + | |
97 | + /** | |
98 | + * 两次随访问患病情况 | |
99 | + */ | |
100 | + private Map<String, Object> douhbqk = new HashedMap(); | |
101 | + | |
102 | + /** | |
103 | + * 药物过敏史 | |
104 | + */ | |
105 | + private String drugGllergic; | |
106 | + | |
107 | + /** | |
108 | + * 脐带脱落时间 | |
109 | + */ | |
110 | + private String qdtlTime; | |
111 | + | |
112 | + /** | |
113 | + * 皮肤黄染消退时间 | |
114 | + */ | |
115 | + private String pfhrTime; | |
116 | + | |
117 | + /** | |
118 | + * 问诊其他说明 | |
119 | + */ | |
120 | + private String askOther; | |
121 | + | |
122 | + public String getMphone() { | |
123 | + return mphone; | |
124 | + } | |
125 | + | |
126 | + public void setMphone(String mphone) { | |
127 | + this.mphone = mphone; | |
128 | + } | |
129 | + | |
130 | + public String getMainFoster() { | |
131 | + return mainFoster; | |
132 | + } | |
133 | + | |
134 | + public void setMainFoster(String mainFoster) { | |
135 | + this.mainFoster = mainFoster; | |
136 | + } | |
137 | + | |
138 | + public String getCnqk() { | |
139 | + return cnqk; | |
140 | + } | |
141 | + | |
142 | + public void setCnqk(String cnqk) { | |
143 | + this.cnqk = cnqk; | |
144 | + } | |
145 | + | |
146 | + public String getMilkingSituation() { | |
147 | + return milkingSituation; | |
148 | + } | |
149 | + | |
150 | + public void setMilkingSituation(String milkingSituation) { | |
151 | + this.milkingSituation = milkingSituation; | |
152 | + } | |
153 | + | |
154 | + public String getMtcnNum() { | |
155 | + return mtcnNum; | |
156 | + } | |
157 | + | |
158 | + public void setMtcnNum(String mtcnNum) { | |
159 | + this.mtcnNum = mtcnNum; | |
160 | + } | |
161 | + | |
162 | + public String getPee() { | |
163 | + return pee; | |
164 | + } | |
165 | + | |
166 | + public void setPee(String pee) { | |
167 | + this.pee = pee; | |
168 | + } | |
169 | + | |
170 | + public String getXbNum() { | |
171 | + return xbNum; | |
172 | + } | |
173 | + | |
174 | + public void setXbNum(String xbNum) { | |
175 | + this.xbNum = xbNum; | |
176 | + } | |
177 | + | |
178 | + public String getExcrement() { | |
179 | + return excrement; | |
180 | + } | |
181 | + | |
182 | + public void setExcrement(String excrement) { | |
183 | + this.excrement = excrement; | |
184 | + } | |
185 | + | |
186 | + public String getDbNum() { | |
187 | + return dbNum; | |
188 | + } | |
189 | + | |
190 | + public void setDbNum(String dbNum) { | |
191 | + this.dbNum = dbNum; | |
192 | + } | |
193 | + | |
194 | + public String getDbDayNum() { | |
195 | + return dbDayNum; | |
196 | + } | |
197 | + | |
198 | + public void setDbDayNum(String dbDayNum) { | |
199 | + this.dbDayNum = dbDayNum; | |
200 | + } | |
201 | + | |
202 | + public String getSleep() { | |
203 | + return sleep; | |
204 | + } | |
205 | + | |
206 | + public void setSleep(String sleep) { | |
207 | + this.sleep = sleep; | |
208 | + } | |
209 | + | |
210 | + public String getActivity() { | |
211 | + return activity; | |
212 | + } | |
213 | + | |
214 | + public void setActivity(String activity) { | |
215 | + this.activity = activity; | |
216 | + } | |
217 | + | |
218 | + public String getVitaminD() { | |
219 | + return vitaminD; | |
220 | + } | |
221 | + | |
222 | + public void setVitaminD(String vitaminD) { | |
223 | + this.vitaminD = vitaminD; | |
224 | + } | |
225 | + | |
226 | + public String getWssAd() { | |
227 | + return wssAd; | |
228 | + } | |
229 | + | |
230 | + public void setWssAd(String wssAd) { | |
231 | + this.wssAd = wssAd; | |
232 | + } | |
233 | + | |
234 | + public String getAssistFood() { | |
235 | + return assistFood; | |
236 | + } | |
237 | + | |
238 | + public void setAssistFood(String assistFood) { | |
239 | + this.assistFood = assistFood; | |
240 | + } | |
241 | + | |
242 | + public String getHomeMeasure() { | |
243 | + return homeMeasure; | |
244 | + } | |
245 | + | |
246 | + public void setHomeMeasure(String homeMeasure) { | |
247 | + this.homeMeasure = homeMeasure; | |
248 | + } | |
249 | + | |
250 | + public Map<String, Object> getDouhbqk() { | |
251 | + return douhbqk; | |
252 | + } | |
253 | + | |
254 | + public void setDouhbqk(Map<String, Object> douhbqk) { | |
255 | + this.douhbqk = douhbqk; | |
256 | + } | |
257 | + | |
258 | + public String getDrugGllergic() { | |
259 | + return drugGllergic; | |
260 | + } | |
261 | + | |
262 | + public void setDrugGllergic(String drugGllergic) { | |
263 | + this.drugGllergic = drugGllergic; | |
264 | + } | |
265 | + | |
266 | + public String getQdtlTime() { | |
267 | + return qdtlTime; | |
268 | + } | |
269 | + | |
270 | + public void setQdtlTime(String qdtlTime) { | |
271 | + this.qdtlTime = qdtlTime; | |
272 | + } | |
273 | + | |
274 | + public String getPfhrTime() { | |
275 | + return pfhrTime; | |
276 | + } | |
277 | + | |
278 | + public void setPfhrTime(String pfhrTime) { | |
279 | + this.pfhrTime = pfhrTime; | |
280 | + } | |
281 | + | |
282 | + public String getAskOther() { | |
283 | + return askOther; | |
284 | + } | |
285 | + | |
286 | + public void setAskOther(String askOther) { | |
287 | + this.askOther = askOther; | |
288 | + } | |
289 | +} |