Commit 4e3da7529573635ad9013819e28bf25adbcaf935
1 parent
5e724641ba
Exists in
master
and in
6 other branches
修复bug
Showing 3 changed files with 84 additions and 71 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyAfterVisitServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/InitDataUtils.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/BabyAfterVisitInfoModelWork.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyAfterVisitServiceImpl.java
View file @
4e3da75
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | import com.lyms.platform.operate.web.request.BabyAfterVisitRequest; |
18 | 18 | import com.lyms.platform.operate.web.service.BabyAfterVisitService; |
19 | 19 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
20 | +import com.lyms.platform.operate.web.utils.InitDataUtils; | |
20 | 21 | import com.lyms.platform.operate.web.worker.BabyAfterVisitInfoModelWork; |
21 | 22 | import com.lyms.platform.operate.web.worker.BabyAfterVisitStatisticsModelWork; |
22 | 23 | import com.lyms.platform.permission.dao.master.BabyPatientExtendEarScreenMapper; |
... | ... | @@ -875,6 +876,12 @@ |
875 | 876 | if (StringUtils.isNotEmpty(doctor)) { |
876 | 877 | update.set("checkDoctor", doctor); |
877 | 878 | } |
879 | + List<String> projectStrs = InitDataUtils.getPositiveProjectByKey(babyEyeCheck); | |
880 | + if (CollectionUtils.isNotEmpty(projectStrs)) { | |
881 | + String join = String.join(",", projectStrs); | |
882 | + update.set("positiveProject", join); | |
883 | + } | |
884 | + | |
878 | 885 | mongoTemplate.updateFirst(query, update, modelClass); |
879 | 886 | } |
880 | 887 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/InitDataUtils.java
View file @
4e3da75
1 | 1 | package com.lyms.platform.operate.web.utils; |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.enums.*; |
4 | +import com.lyms.platform.pojo.BabyEyeCheck; | |
4 | 5 | import org.slf4j.Logger; |
5 | 6 | import org.slf4j.LoggerFactory; |
6 | 7 | |
7 | -import java.util.ArrayList; | |
8 | -import java.util.HashMap; | |
9 | -import java.util.List; | |
10 | -import java.util.Map; | |
8 | +import java.util.*; | |
11 | 9 | |
10 | +import static com.lyms.platform.operate.web.service.BabyAfterVisitService.POSITIVE_PROJECT_TYPE; | |
12 | 11 | |
12 | + | |
13 | 13 | /** |
14 | 14 | * 添加类的一句话简单描述。 |
15 | 15 | * <p/> |
... | ... | @@ -284,6 +284,77 @@ |
284 | 284 | list.add(resultMap); |
285 | 285 | } |
286 | 286 | return list; |
287 | + } | |
288 | + | |
289 | + /** | |
290 | + * 阳性 | |
291 | + * @param babyEyeCheck | |
292 | + * @return | |
293 | + */ | |
294 | + public static List<String> getPositiveProjectByKey(BabyEyeCheck babyEyeCheck) { | |
295 | + List<String> projectStrs = new Vector<>(); | |
296 | + String projectStr; | |
297 | + String extRightEyelook = babyEyeCheck.getExtRightEyelook(); | |
298 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, extRightEyelook)) { | |
299 | + projectStr = getProjectStr("extRightEyelook"); | |
300 | + projectStrs.add(projectStr); | |
301 | + } | |
302 | + String blinkRightReflex = babyEyeCheck.getBlinkRightReflex(); | |
303 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, blinkRightReflex)) { | |
304 | + projectStr = getProjectStr("blinkRightReflex"); | |
305 | + projectStrs.add(projectStr); | |
306 | + } | |
307 | + String pupillaryRightReflex = babyEyeCheck.getPupillaryRightReflex(); | |
308 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, pupillaryRightReflex)) { | |
309 | + projectStr = getProjectStr("pupillaryRightReflex"); | |
310 | + projectStrs.add(projectStr); | |
311 | + } | |
312 | + String redRightReflex = babyEyeCheck.getRedRightReflex(); | |
313 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, redRightReflex)) { | |
314 | + projectStr = getProjectStr("redRightReflex"); | |
315 | + projectStrs.add(projectStr); | |
316 | + } | |
317 | + String extLeftEyelook = babyEyeCheck.getExtLeftEyelook(); | |
318 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, extLeftEyelook)) { | |
319 | + projectStr = getProjectStr("extLeftEyelook"); | |
320 | + projectStrs.add(projectStr); | |
321 | + } | |
322 | + String blinkLefttReflex = babyEyeCheck.getBlinkLefttReflex(); | |
323 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, blinkLefttReflex)) { | |
324 | + projectStr = getProjectStr("blinkLefttReflex"); | |
325 | + projectStrs.add(projectStr); | |
326 | + } | |
327 | + String pupillaryLeftReflex = babyEyeCheck.getPupillaryLeftReflex(); | |
328 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, pupillaryLeftReflex)) { | |
329 | + projectStr = getProjectStr("pupillaryLeftReflex"); | |
330 | + projectStrs.add(projectStr); | |
331 | + } | |
332 | + String redLeftReflex = babyEyeCheck.getRedLeftReflex(); | |
333 | + if (Objects.equals(POSITIVE_PROJECT_TYPE, redLeftReflex)) { | |
334 | + projectStr = getProjectStr("redLeftReflex"); | |
335 | + projectStrs.add(projectStr); | |
336 | + } | |
337 | + return projectStrs; | |
338 | + } | |
339 | + | |
340 | + /** | |
341 | + * key value 映射 | |
342 | + * | |
343 | + * @param key | |
344 | + * @return | |
345 | + */ | |
346 | + private static String getProjectStr(String key){ | |
347 | + HashMap<String, String> map = new HashMap<>(16); | |
348 | + map.put("extRightEyelook", "外眼观察(右)"); | |
349 | + map.put("blinkRightReflex", "瞬目反射(右)"); | |
350 | + map.put("pupillaryRightReflex", "瞳孔对光反射(右)"); | |
351 | + map.put("redRightReflex", "瞳孔红光反射(右)"); | |
352 | + map.put("extLeftEyelook", "外眼观察(左)"); | |
353 | + map.put("blinkLefttReflex", "瞬目反射(左)"); | |
354 | + map.put("pupillaryLeftReflex", "孔对光反射(左)"); | |
355 | + map.put("redLeftReflex","瞳孔红光反射(左)"); | |
356 | + String projectStr = map.get(key); | |
357 | + return projectStr; | |
287 | 358 | } |
288 | 359 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/BabyAfterVisitInfoModelWork.java
View file @
4e3da75
1 | 1 | package com.lyms.platform.operate.web.worker; |
2 | 2 | |
3 | 3 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
4 | +import com.lyms.platform.operate.web.utils.InitDataUtils; | |
4 | 5 | import com.lyms.platform.pojo.BabyAfterVisitInfoModel; |
5 | 6 | import com.lyms.platform.pojo.BabyAfterVisitStatisticsModel; |
6 | 7 | import com.lyms.platform.pojo.BabyEyeCheck; |
... | ... | @@ -70,7 +71,7 @@ |
70 | 71 | if (CollectionUtils.isNotEmpty(babyEyeChecks)) { |
71 | 72 | BabyEyeCheck babyEyeCheck = babyEyeChecks.get(0); |
72 | 73 | if (Objects.nonNull(babyEyeCheck)) { |
73 | - List<String> projectStrs = getPositiveProjectByKey(babyEyeCheck); | |
74 | + List<String> projectStrs = InitDataUtils.getPositiveProjectByKey(babyEyeCheck); | |
74 | 75 | babyAfterVisitInfoModel.setPositiveProject(String.join(",", projectStrs)); |
75 | 76 | babyAfterVisitInfoModel.setCreateTime(new Date()); |
76 | 77 | babyAfterVisitInfoModel.setCheckDoctor(babyEyeCheck.getOperaterId()); |
... | ... | @@ -89,72 +90,6 @@ |
89 | 90 | } |
90 | 91 | } |
91 | 92 | return infoModels; |
92 | - } | |
93 | - | |
94 | - private List<String> getPositiveProjectByKey(BabyEyeCheck babyEyeCheck) { | |
95 | - List<String> projectStrs = new Vector<>(); | |
96 | - String projectStr; | |
97 | - String extRightEyelook = babyEyeCheck.getExtRightEyelook(); | |
98 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, extRightEyelook)) { | |
99 | - projectStr = getProjectStr("extRightEyelook"); | |
100 | - projectStrs.add(projectStr); | |
101 | - } | |
102 | - String blinkRightReflex = babyEyeCheck.getBlinkRightReflex(); | |
103 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, blinkRightReflex)) { | |
104 | - projectStr = getProjectStr("blinkRightReflex"); | |
105 | - projectStrs.add(projectStr); | |
106 | - } | |
107 | - String pupillaryRightReflex = babyEyeCheck.getPupillaryRightReflex(); | |
108 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, pupillaryRightReflex)) { | |
109 | - projectStr = getProjectStr("pupillaryRightReflex"); | |
110 | - projectStrs.add(projectStr); | |
111 | - } | |
112 | - String redRightReflex = babyEyeCheck.getRedRightReflex(); | |
113 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, redRightReflex)) { | |
114 | - projectStr = getProjectStr("redRightReflex"); | |
115 | - projectStrs.add(projectStr); | |
116 | - } | |
117 | - String extLeftEyelook = babyEyeCheck.getExtLeftEyelook(); | |
118 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, extLeftEyelook)) { | |
119 | - projectStr = getProjectStr("extLeftEyelook"); | |
120 | - projectStrs.add(projectStr); | |
121 | - } | |
122 | - String blinkLefttReflex = babyEyeCheck.getBlinkLefttReflex(); | |
123 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, blinkLefttReflex)) { | |
124 | - projectStr = getProjectStr("blinkLefttReflex"); | |
125 | - projectStrs.add(projectStr); | |
126 | - } | |
127 | - String pupillaryLeftReflex = babyEyeCheck.getPupillaryLeftReflex(); | |
128 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, pupillaryLeftReflex)) { | |
129 | - projectStr = getProjectStr("pupillaryLeftReflex"); | |
130 | - projectStrs.add(projectStr); | |
131 | - } | |
132 | - String redLeftReflex = babyEyeCheck.getRedLeftReflex(); | |
133 | - if (Objects.equals(POSITIVE_PROJECT_TYPE, redLeftReflex)) { | |
134 | - projectStr = getProjectStr("redLeftReflex"); | |
135 | - projectStrs.add(projectStr); | |
136 | - } | |
137 | - return projectStrs; | |
138 | - } | |
139 | - | |
140 | - /** | |
141 | - * key value 映射 | |
142 | - * | |
143 | - * @param key | |
144 | - * @return | |
145 | - */ | |
146 | - private String getProjectStr(String key){ | |
147 | - HashMap<String, String> map = new HashMap<>(16); | |
148 | - map.put("extRightEyelook", "外眼观察(右)"); | |
149 | - map.put("blinkRightReflex", "瞬目反射(右)"); | |
150 | - map.put("pupillaryRightReflex", "瞳孔对光反射(右)"); | |
151 | - map.put("redRightReflex", "瞳孔红光反射(右)"); | |
152 | - map.put("extLeftEyelook", "外眼观察(左)"); | |
153 | - map.put("blinkLefttReflex", "瞬目反射(左)"); | |
154 | - map.put("pupillaryLeftReflex", "孔对光反射(左)"); | |
155 | - map.put("redLeftReflex","瞳孔红光反射(左)"); | |
156 | - String projectStr = map.get(key); | |
157 | - return projectStr; | |
158 | 93 | } |
159 | 94 | } |