Commit dca58212f081da374e054f635ce709d291db73fb
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 4 changed files
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java
View file @
dca5821
... | ... | @@ -394,7 +394,7 @@ |
394 | 394 | } catch (Exception e) { |
395 | 395 | index++; |
396 | 396 | } |
397 | - if (CollectionUtils.isEmpty(babyStatisticsManagerWeekAgeGroupQueryModelList) || babyStatisticsManagerWeekAgeGroupQueryModelList.get(index) == null) { | |
397 | + if (CollectionUtils.isEmpty(babyStatisticsManagerWeekAgeGroupQueryModelList) || babyStatisticsManagerWeekAgeGroupQueryModelList.size() < index || babyStatisticsManagerWeekAgeGroupQueryModelList.get(index) == null) { | |
398 | 398 | BabyStatisticsManagerWeekAgeGroupQueryModel babyStatisticsManagerWeekAgeGroupQueryModel = new BabyStatisticsManagerWeekAgeGroupQueryModel(); |
399 | 399 | babyStatisticsManagerWeekAgeGroupQueryModel.setCount("0"); |
400 | 400 | babyStatisticsManagerWeekAgeGroupQueryModel.setWeekAge(i.toString()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
dca5821
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | import com.lyms.platform.common.utils.DateUtil; |
8 | 8 | import com.lyms.platform.common.utils.JsonUtil; |
9 | 9 | import com.lyms.platform.operate.web.request.MatDeliverAddRequest; |
10 | +import com.lyms.platform.operate.web.result.HighScoreResult; | |
10 | 11 | import com.lyms.platform.operate.web.utils.*; |
11 | 12 | import com.lyms.platform.permission.model.Organization; |
12 | 13 | import com.lyms.platform.permission.model.Users; |
... | ... | @@ -79,7 +80,7 @@ |
79 | 80 | map.put("pliveType", getBasicConfig(data.getPliveTypeId())); |
80 | 81 | map.put("pprofessionType", getBasicConfig(data.getPprofessionTypeId())); |
81 | 82 | map.put("plevelType", getBasicConfig(data.getPlevelTypeId())); |
82 | - //TODO 家庭人均收入 | |
83 | + //TODO 家庭人均收入(暂时去掉) | |
83 | 84 | |
84 | 85 | /* 孕妇联系方式 */ |
85 | 86 | map.put("residence", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), |
... | ... | @@ -108,7 +109,7 @@ |
108 | 109 | map.put("correctionLastMenses", DateUtil.getyyyy_MM_dd(data.getLastMenses())); |
109 | 110 | map.put("dueDate", DateUtil.getyyyy_MM_dd(data.getDueDate())); |
110 | 111 | map.put("vcCardNo", data.getVcCardNo()); |
111 | - //TODO 条码 | |
112 | + //TODO 条码(暂时去掉) | |
112 | 113 | //档案编号 |
113 | 114 | map.put("fileCode", data.getFileCode()); |
114 | 115 | map.put("mremark", data.getMremark()); |
... | ... | @@ -185,8 +186,23 @@ |
185 | 186 | map.put("fmWeek",patients.getFmWeek()); |
186 | 187 | map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
187 | 188 | map.put("mremark",patients.getMremark()); |
188 | - map.put("oRiskFactor",patients.getoRiskFactor());//TODO 高危需要处理 | |
189 | - map.put("riskScore",patients.getRiskScore()); | |
189 | + | |
190 | + //TODO 高危需要处理,高危因素名称+颜色+高危评分 | |
191 | + HighScoreResult highScoreResult = null; | |
192 | + if (StringUtils.isNotEmpty(data.getHighrisk())){ | |
193 | + List<String> ids = JsonUtil.toList(data.getHighrisk(), String.class); | |
194 | + if (CollectionUtils.isNotEmpty(ids)){ | |
195 | + highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); | |
196 | + } | |
197 | + } | |
198 | + map.put("highRisk",highScoreResult); | |
199 | + | |
200 | + Map<String,Object> otherRisk = new HashMap<>(); | |
201 | + if (StringUtils.isNotEmpty(data.getOtherHighRisk())){ | |
202 | + ResolveUtils.queryOtherRisk(data.getOtherHighRisk(),otherRisk,basicConfigService); | |
203 | + } | |
204 | + map.put("otherHighRisk",otherRisk); | |
205 | + | |
190 | 206 | //产检基本信息 |
191 | 207 | map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckTime())); |
192 | 208 | //TODO 产检孕周 |
... | ... | @@ -479,8 +495,21 @@ |
479 | 495 | map.put("fmWeek",patients.getFmWeek()); |
480 | 496 | map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
481 | 497 | map.put("mremark",patients.getMremark()); |
482 | - map.put("oRiskFactor",patients.getoRiskFactor()); | |
483 | - map.put("riskScore",patients.getRiskScore()); | |
498 | + //TODO 高危需要处理,高危因素名称+颜色+高危评分 | |
499 | + HighScoreResult highScoreResult = null; | |
500 | + if (StringUtils.isNotEmpty(data.getRiskFactor())){ | |
501 | + List<String> ids = JsonUtil.toList(data.getRiskFactor(), String.class); | |
502 | + if (CollectionUtils.isNotEmpty(ids)){ | |
503 | + highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); | |
504 | + } | |
505 | + } | |
506 | + map.put("highRisk",highScoreResult); | |
507 | + | |
508 | + Map<String,Object> otherRisk = new HashMap<>(); | |
509 | + if (StringUtils.isNotEmpty(data.getOtherRisk())){ | |
510 | + ResolveUtils.queryOtherRisk(data.getOtherRisk(),otherRisk,basicConfigService); | |
511 | + } | |
512 | + map.put("otherHighRisk",otherRisk); | |
484 | 513 | //产检基本信息 |
485 | 514 | map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckDate())); |
486 | 515 | map.put("currentDueDate",data.getCurrentDueDate()); |
487 | 516 | |
488 | 517 | |
489 | 518 | |
... | ... | @@ -630,40 +659,13 @@ |
630 | 659 | map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
631 | 660 | map.put("mremark",patients.getMremark()); |
632 | 661 | |
633 | - String riskFactor = ""; | |
634 | - if (StringUtils.isNotEmpty(patients.getoRiskFactor())){ | |
635 | - riskFactor = patients.getoRiskFactor(); | |
636 | - } | |
637 | - | |
662 | + //高危因素 | |
663 | + HighScoreResult highScoreResult = null; | |
638 | 664 | if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ |
639 | - if (StringUtils.isEmpty(riskFactor)){ | |
640 | - riskFactor = commonService.resloveFactor(patients.getRiskFactorId()); | |
641 | - }else { | |
642 | - riskFactor = riskFactor + "," + commonService.resloveFactor(patients.getRiskFactorId()); | |
643 | - } | |
665 | + highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService); | |
644 | 666 | } |
645 | - map.put("oRiskFactor",riskFactor); | |
646 | 667 | |
647 | - String riskLevel = ""; | |
648 | - | |
649 | - if (StringUtils.isNotEmpty(patients.getRiskLevelId())){ | |
650 | - List<String> riskLevels = JsonUtil.toList(patients.getRiskLevelId(), String.class); | |
651 | - if (CollectionUtils.isNotEmpty(riskLevels)){ | |
652 | - StringBuilder sb = new StringBuilder(); | |
653 | - for (String r : riskLevels){ | |
654 | - sb.append(FunvCommonUtil.getBaseicConfigByid(r, basicConfigService)).append(","); | |
655 | - } | |
656 | - | |
657 | - if (sb.toString().endsWith(",")){ | |
658 | - riskLevel = sb.substring(0, sb.length() - 1); | |
659 | - }else { | |
660 | - riskLevel = sb.toString(); | |
661 | - } | |
662 | - | |
663 | - } | |
664 | - } | |
665 | - map.put("riskLevel", riskLevel); | |
666 | - map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(), UnitConstants.FEN)); | |
668 | + map.put("riskFactorId", highScoreResult); | |
667 | 669 | |
668 | 670 | map.put("deliveryDate", data.getDueDate()); |
669 | 671 | map.put("dueWeek", data.getDueWeek()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
View file @
dca5821
1 | 1 | package com.lyms.platform.operate.web.utils; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.BasicConfigService; |
4 | +import com.lyms.platform.common.enums.RiskDefaultTypeEnum; | |
4 | 5 | import com.lyms.platform.common.enums.YnEnums; |
5 | 6 | import com.lyms.platform.common.utils.JsonUtil; |
7 | +import com.lyms.platform.operate.web.result.HighScoreResult; | |
6 | 8 | import com.lyms.platform.pojo.BasicConfig; |
9 | +import com.lyms.platform.query.BasicConfigQuery; | |
10 | +import org.apache.commons.collections.CollectionUtils; | |
7 | 11 | import org.apache.commons.lang.StringUtils; |
12 | +import org.apache.commons.lang.math.NumberUtils; | |
8 | 13 | |
9 | 14 | import java.util.*; |
10 | 15 | |
... | ... | @@ -352,7 +357,6 @@ |
352 | 357 | } |
353 | 358 | return ""; |
354 | 359 | } |
355 | - | |
356 | 360 | |
357 | 361 | |
358 | 362 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
View file @
dca5821
1 | 1 | package com.lyms.platform.operate.web.utils; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.BasicConfigService; |
4 | +import com.lyms.platform.common.enums.RiskDefaultTypeEnum; | |
4 | 5 | import com.lyms.platform.common.utils.JsonUtil; |
6 | +import com.lyms.platform.operate.web.result.HighScoreResult; | |
7 | +import com.lyms.platform.pojo.BasicConfig; | |
8 | +import com.lyms.platform.query.BasicConfigQuery; | |
9 | +import org.apache.commons.collections.CollectionUtils; | |
10 | +import org.apache.commons.lang.StringUtils; | |
11 | +import org.apache.commons.lang.math.NumberUtils; | |
12 | +import org.springframework.beans.factory.annotation.Autowired; | |
5 | 13 | |
6 | -import java.util.HashMap; | |
7 | -import java.util.Iterator; | |
8 | -import java.util.Map; | |
9 | -import java.util.Set; | |
14 | +import java.util.*; | |
10 | 15 | |
11 | 16 | /** |
12 | 17 | * Created by Administrator on 2017/1/9 0009. |
13 | 18 | |
... | ... | @@ -144,7 +149,104 @@ |
144 | 149 | return ""; |
145 | 150 | } |
146 | 151 | |
152 | + /** | |
153 | + * 解析高危 | |
154 | + * @param id | |
155 | + * @param n | |
156 | + * @param basicConfigService | |
157 | + * @return | |
158 | + */ | |
159 | + public static HighScoreResult queryRisk(List<String> id, boolean n,BasicConfigService basicConfigService) { | |
160 | + HighScoreResult highScoreResult = new HighScoreResult(); | |
161 | + BasicConfigQuery | |
162 | + basicConfigQuery = new BasicConfigQuery(); | |
163 | + List data = new ArrayList(); | |
164 | + List dat1a = new ArrayList(); | |
165 | + Integer score = null; | |
166 | + if (CollectionUtils.isNotEmpty(id)) { | |
167 | + score = 0; | |
168 | + for (String i : id) { | |
169 | + basicConfigQuery.setId(i); | |
170 | + List<BasicConfig> basicConfigs = basicConfigService.queryBasicConfig(basicConfigQuery); | |
171 | + if (CollectionUtils.isNotEmpty(basicConfigs)) { | |
172 | + for (BasicConfig basicConfig : basicConfigs) { | |
173 | + Map<String, Object> map = new HashMap<>(); | |
174 | + map.put("id", basicConfig.getId()); | |
175 | + map.put("name", basicConfig.getName()); | |
176 | + map.put("code", basicConfig.getCode()); | |
177 | + basicConfigQuery.setId(basicConfig.getParentId()); | |
178 | + List<BasicConfig> basicConfigs2 = basicConfigService.queryBasicConfig(basicConfigQuery); | |
179 | + if (CollectionUtils.isNotEmpty(basicConfigs2)) { | |
180 | + for (BasicConfig bc : basicConfigs2) { | |
181 | + String name = bc.getName(); | |
182 | + if (name.indexOf("预警") > -1) { | |
183 | + name = name.replace("预警", ""); | |
184 | + } | |
185 | + map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
186 | + } | |
187 | + } | |
188 | + if (StringUtils.isNotEmpty(basicConfig.getCode())) { | |
189 | + score += NumberUtils.toInt(basicConfig.getCode(), 0); | |
190 | + } | |
191 | + if (n) { | |
192 | + BasicConfig basicConfig1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); | |
193 | + if (null != basicConfig1) { | |
194 | + Map<String, Object> map1 = new HashMap<>(); | |
195 | + map1.put("id", basicConfig1.getId()); | |
196 | + String name = basicConfig1.getName(); | |
197 | + if (name.indexOf("预警") > -1) { | |
198 | + name = name.replace("预警", ""); | |
199 | + } | |
200 | + map1.put("name", name); | |
201 | + map1.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
202 | + dat1a.add(map1); | |
203 | + } | |
204 | + } | |
205 | + data.add(map); | |
206 | + } | |
207 | + } | |
208 | + } | |
209 | + } | |
210 | + highScoreResult.setHighRisk(data); | |
211 | + highScoreResult.setScore(score); | |
212 | + highScoreResult.setLevel(dat1a); | |
213 | + return highScoreResult; | |
214 | + } | |
147 | 215 | |
216 | + public static Map queryOtherRisk(String otherHighRisk,Map<String,Object>map,BasicConfigService basicConfigService){ | |
217 | + if (StringUtils.isEmpty(otherHighRisk)){ | |
218 | + return map; | |
219 | + } | |
220 | + | |
221 | + String color = ""; | |
222 | + String pingfen = ""; | |
223 | + String yinsu = ""; | |
224 | + | |
225 | + Map otherMap = JsonUtil.jkstr2Obj(otherHighRisk, Map.class); | |
226 | + if (otherMap!=null){ | |
227 | + if (otherMap.get("fyyse")!=null){ | |
228 | + String id = otherMap.get("fyyse").toString(); | |
229 | + color = FunvCommonUtil.getBaseicConfigByid(id,basicConfigService); | |
230 | + if (color.indexOf("预警") > -1) { | |
231 | + color = color.replace("预警", ""); | |
232 | + } | |
233 | + } | |
234 | + if (otherMap.get("fxpf")!=null){ | |
235 | + String id = otherMap.get("fxpf").toString(); | |
236 | + pingfen = FunvCommonUtil.getBaseicConfigByid(id,basicConfigService); | |
237 | + } | |
238 | + if (otherMap.get("fxysu")!=null){ | |
239 | + yinsu = otherMap.get("fxysu").toString(); | |
240 | + } | |
241 | + } | |
242 | + map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(color)); | |
243 | + map.put("score",pingfen); | |
244 | + map.put("name",yinsu); | |
245 | + return map; | |
246 | + } | |
247 | + | |
248 | + | |
249 | + | |
148 | 250 | public static void main(String[] str) { |
149 | 251 | // String ssss = "{\"qztp\":true,\"yesOrNo\":\"no\",\"tpzb\":true,\"zxqqz\":true,\"zxqqq\":true,\"tpzl\":true," + |
150 | 252 | // "\"zxmxgxybfzxqq\":true,\"chcx\":true,\"rshbmxgxy\":true,\"tmzp\":true,\"rsqgxy\":true,\"qt\":false,\"qtText\":\"11\"}"; |
151 | 253 | |
... | ... | @@ -154,12 +256,10 @@ |
154 | 256 | // String a = replace(m); |
155 | 257 | // System.out.print("哈哈.................... " + a); |
156 | 258 | |
157 | - String s = "{\"qt\":true,\"jsjmj\":true,\"ydqjd\":\"5769ef930cf2d37f03479390\",\"qtText\":\"其他\",\"yesOrNO\":\"yes\",\"dc\":true}"; | |
158 | - Map m = JsonUtil.str2Obj(s,Map.class); | |
259 | +// String s = "{\"qt\":true,\"jsjmj\":true,\"ydqjd\":\"5769ef930cf2d37f03479390\",\"qtText\":\"其他\",\"yesOrNO\":\"yes\",\"dc\":true}"; | |
260 | +// Map m = JsonUtil.str2Obj(s,Map.class); | |
261 | +// String a = replaceYDFMW(m,1); | |
159 | 262 | |
160 | - String a = replaceYDFMW(m,1); | |
161 | - | |
162 | - System.out.print("......................... "+ a); | |
163 | 263 | } |
164 | 264 | |
165 | 265 | } |