Commit 41588bf834811aec62c8882c217960f7ae5d3be3
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 13 changed files
- platform-common/src/main/java/com/lyms/platform/common/utils/PropertiesUtils.java
- platform-data-api/src/main/java/com/lyms/platform/data/util/SaveMessageService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.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/PostReviewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HighScoreResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MessageCenterService.java
- platform-operate-api/src/main/resources/config.properties
platform-common/src/main/java/com/lyms/platform/common/utils/PropertiesUtils.java
View file @
41588bf
1 | +package com.lyms.platform.common.utils; | |
2 | + | |
3 | +import org.springframework.core.io.ClassPathResource; | |
4 | +import org.springframework.core.io.support.EncodedResource; | |
5 | +import org.springframework.core.io.support.PropertiesLoaderUtils; | |
6 | + | |
7 | +import java.io.IOException; | |
8 | +import java.util.Properties; | |
9 | + | |
10 | +/** | |
11 | + * Created by Administrator on 2016/8/2. | |
12 | + */ | |
13 | +public class PropertiesUtils { | |
14 | + | |
15 | + private static Properties props = new Properties(); | |
16 | + | |
17 | + private static final String FILE_PATH = "config.properties"; | |
18 | + | |
19 | + static{ | |
20 | + try { | |
21 | + props = PropertiesLoaderUtils.loadProperties(new EncodedResource(new ClassPathResource(FILE_PATH), "UTF8")); | |
22 | + } catch (IOException e) { | |
23 | + | |
24 | + } | |
25 | + } | |
26 | + | |
27 | + /** | |
28 | + * | |
29 | + * @param propertyKey 键名称 | |
30 | + * @return 键值 | |
31 | + */ | |
32 | + public static String getPropertyValue(String propertyKey){ | |
33 | + String propertyValue = ""; | |
34 | + if(StringUtils.isNotEmpty(propertyKey)){ | |
35 | + propertyValue = props.getProperty(propertyKey); | |
36 | + if (StringUtils.isNotEmpty(propertyValue)) | |
37 | + { | |
38 | + propertyValue = propertyValue.trim(); | |
39 | + } | |
40 | + } | |
41 | + return propertyValue; | |
42 | + } | |
43 | +} |
platform-data-api/src/main/java/com/lyms/platform/data/util/SaveMessageService.java
View file @
41588bf
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.utils.HttpRequest; |
4 | 4 | import com.lyms.platform.common.utils.JsonUtil; |
5 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
5 | 6 | import com.lyms.platform.common.utils.StringUtils; |
6 | 7 | import com.lyms.platform.data.pojo.MessageListRequest; |
7 | 8 | import com.lyms.platform.data.pojo.MessageRequest; |
8 | 9 | |
... | ... | @@ -15,12 +16,12 @@ |
15 | 16 | */ |
16 | 17 | public class SaveMessageService { |
17 | 18 | |
18 | - public static final String URL = "http://192.168.5.3:8080/v1/saveCreatedSMS"; | |
19 | - | |
19 | + public static final String CENTER_BASE_URL= PropertiesUtils.getPropertyValue("center_base_url"); | |
20 | + public static final String CENTER_TOKEN = PropertiesUtils.getPropertyValue("center_token"); | |
20 | 21 | public static boolean saveSmsCenter(MessageListRequest list) |
21 | 22 | { |
22 | 23 | String json = JsonUtil.obj2JsonString(list); |
23 | - String result = HttpRequest.sendPost(URL,json,"YMer2016"); | |
24 | + String result = HttpRequest.sendPost(CENTER_BASE_URL+"saveCreatedSMS",json,CENTER_TOKEN); | |
24 | 25 | if (StringUtils.isNotEmpty(result)) |
25 | 26 | { |
26 | 27 | Map<String,String> map = JsonUtil.str2Obj(result, Map.class); |
... | ... | @@ -36,7 +37,7 @@ |
36 | 37 | public static boolean isExistSms(String patientId,String tempId) |
37 | 38 | { |
38 | 39 | String param = "patientId="+patientId+"&tempId="+tempId; |
39 | - String result = HttpRequest.sendGet(URL, param, "YMer2016"); | |
40 | + String result = HttpRequest.sendGet(CENTER_BASE_URL, param, CENTER_TOKEN); | |
40 | 41 | if (StringUtils.isNotEmpty(result)) |
41 | 42 | { |
42 | 43 | Map<String,String> map = JsonUtil.str2Obj(result, Map.class); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
View file @
41588bf
... | ... | @@ -40,19 +40,6 @@ |
40 | 40 | |
41 | 41 | @Autowired |
42 | 42 | private AntenatalExaminationFacade antenatalExaminationFacade; |
43 | - /** | |
44 | - * 查询产妇信息 | |
45 | - * @param bookbuildingQueryRequest | |
46 | - * @return | |
47 | - */ | |
48 | - @ResponseBody | |
49 | - @RequestMapping(method = RequestMethod.GET, value = "/getBookbuildingInfo") | |
50 | - public BaseListResponse getBookbuildingInfo(@Valid BookbuildingQueryRequest bookbuildingQueryRequest) { | |
51 | - BaseListResponse baseListResponse = new BaseListResponse(); | |
52 | - baseListResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
53 | - baseListResponse.setErrormsg("成功"); | |
54 | - return baseListResponse; | |
55 | - } | |
56 | 43 | |
57 | 44 | |
58 | 45 | /** |
... | ... | @@ -139,6 +126,17 @@ |
139 | 126 | @ResponseBody |
140 | 127 | public BaseObjectResponse getBabyBuildBaseConfig(){ |
141 | 128 | return bookbuildingFacade.getYunBuildBaseConfig(); |
129 | + } | |
130 | + | |
131 | + /** | |
132 | + *查询孕妇建档基本信息 | |
133 | + * @return | |
134 | + */ | |
135 | + @RequestMapping(value = "/queryYunBuildInfo", method = RequestMethod.GET) | |
136 | + @ResponseBody | |
137 | + public BaseObjectResponse queryYunBuildInfo(@RequestParam(required = false) String cardNo,@RequestParam(required = false) String phone){ | |
138 | + BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,phone); | |
139 | + return objectResponse; | |
142 | 140 | } |
143 | 141 | |
144 | 142 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
41588bf
... | ... | @@ -10,10 +10,7 @@ |
10 | 10 | import com.lyms.platform.common.utils.JsonUtil; |
11 | 11 | import com.lyms.platform.common.utils.SystemConfig; |
12 | 12 | import com.lyms.platform.operate.web.request.*; |
13 | -import com.lyms.platform.operate.web.result.AntData; | |
14 | -import com.lyms.platform.operate.web.result.AntenatalExaminationResult; | |
15 | -import com.lyms.platform.operate.web.result.AntexChuResult; | |
16 | -import com.lyms.platform.operate.web.result.AntexListResult; | |
13 | +import com.lyms.platform.operate.web.result.*; | |
17 | 14 | import com.lyms.platform.permission.model.Organization; |
18 | 15 | import com.lyms.platform.permission.service.OrganizationService; |
19 | 16 | import com.lyms.platform.pojo.*; |
20 | 17 | |
21 | 18 | |
22 | 19 | |
23 | 20 | |
24 | 21 | |
25 | 22 | |
26 | 23 | |
... | ... | @@ -149,35 +146,64 @@ |
149 | 146 | * |
150 | 147 | * @return |
151 | 148 | */ |
152 | - public List findLastRisk(String parentId) { | |
149 | + public HighScoreResult findLastRisk(String parentId) { | |
153 | 150 | List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(parentId); |
154 | 151 | AntenatalExaminationModel model = null; |
155 | 152 | if (CollectionUtils.isNotEmpty(list)) { |
156 | 153 | model = list.get(0); |
157 | 154 | } |
155 | + HighScoreResult highScoreResult = new HighScoreResult(); | |
158 | 156 | try { |
159 | - if (null != model && StringUtils.isNotEmpty(model.getRiskFactor())) { | |
157 | + //复诊 | |
158 | + if (null != model && StringUtils.isNotEmpty(model.getRiskFactor()) && !"{}".equals(model.getRiskFactor())) { | |
160 | 159 | List list1 = JsonUtil.toList(model.getRiskFactor(), List.class); |
161 | - return queryRisk(list1); | |
160 | + highScoreResult = queryRisk(list1); | |
162 | 161 | } |
163 | - } catch (Exception e) { | |
164 | - } | |
165 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
166 | - antExChuQuery.setParentId(parentId); | |
167 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
168 | - List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
169 | - AntExChuModel antExChuModel = null; | |
170 | - if (CollectionUtils.isNotEmpty(list1)) { | |
171 | - antExChuModel = list1.get(0); | |
172 | - } | |
173 | - try { | |
174 | - if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { | |
162 | + if (null != model &&!"{}".equals(model.getOtherRisk())) { | |
163 | + Map map = JsonUtil.str2Obj(model.getOtherRisk(), Map.class); | |
164 | + | |
165 | + //风险因素 | |
166 | + Map map1 = new HashMap(); | |
167 | + map1.put("id", ""); | |
168 | + map1.put("name", map.get("fxysu")); | |
169 | + highScoreResult.getHighRisk().add(map1); | |
170 | + //风险评分 | |
171 | + Object idObj = map.get("fxpf"); | |
172 | + if (null != idObj) { | |
173 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString()); | |
174 | + highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0)); | |
175 | + } | |
176 | + } | |
177 | + //初诊 | |
178 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
179 | + antExChuQuery.setParentId(parentId); | |
180 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
181 | + List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
182 | + AntExChuModel antExChuModel = null; | |
183 | + if (CollectionUtils.isNotEmpty(list1)) { | |
184 | + antExChuModel = list1.get(0); | |
185 | + } | |
186 | + if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk()) && !"{}".equals(antExChuModel.getHighrisk())) { | |
175 | 187 | List list2 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
176 | - return queryRisk(list2); | |
188 | + highScoreResult = queryRisk(list2); | |
177 | 189 | } |
190 | + if (null != antExChuModel && !"{}".equals(antExChuModel.getOtherHighRisk())) { | |
191 | + Map map = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class); | |
192 | + //风险因素 | |
193 | + Map map1 = new HashMap(); | |
194 | + map1.put("id", ""); | |
195 | + map1.put("name", map.get("fxysu")); | |
196 | + highScoreResult.getHighRisk().add(map1); | |
197 | + //风险评分 | |
198 | + Object idObj = map.get("fxpf"); | |
199 | + if (null != idObj) { | |
200 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString()); | |
201 | + highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0)); | |
202 | + } | |
203 | + } | |
178 | 204 | } catch (Exception e) { |
179 | 205 | } |
180 | - return Collections.emptyList(); | |
206 | + return highScoreResult; | |
181 | 207 | } |
182 | 208 | |
183 | 209 | /** |
... | ... | @@ -367,7 +393,7 @@ |
367 | 393 | return "0"; |
368 | 394 | } |
369 | 395 | int day = DateUtil.getDays(date, new Date()); |
370 | - int start = 15 * 7; | |
396 | + int start = 15 * 7+3; | |
371 | 397 | int end = 20 * 7 + 6; |
372 | 398 | if (day >= start && day <= end) { |
373 | 399 | SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery(); |
... | ... | @@ -387,7 +413,7 @@ |
387 | 413 | * @param queryRequest |
388 | 414 | * @return |
389 | 415 | */ |
390 | - public BaseResponse queryAntenatalExamination(AntenatalExaminationQueryRequest queryRequest,Integer userId) { | |
416 | + public BaseResponse queryAntenatalExamination(AntenatalExaminationQueryRequest queryRequest, Integer userId) { | |
391 | 417 | |
392 | 418 | Patients patients = null; |
393 | 419 | Patients patients1 = null; |
394 | 420 | |
395 | 421 | |
... | ... | @@ -399,17 +425,17 @@ |
399 | 425 | List<Patients> list = patientsService.queryPatient(patientsQuery); |
400 | 426 | if (CollectionUtils.isNotEmpty(list)) { |
401 | 427 | patients = list.get(0); |
402 | - patients1=patients; | |
428 | + patients1 = patients; | |
403 | 429 | } |
404 | 430 | } else { |
405 | - List<Integer> list1 =autoMatchFacade.matchOrgId(userId); | |
406 | - String hospital =null; | |
407 | - if(CollectionUtils.isNotEmpty(list1)){ | |
408 | - hospital= list1.get(0) + ""; | |
431 | + List<Integer> list1 = autoMatchFacade.matchOrgId(userId); | |
432 | + String hospital = null; | |
433 | + if (CollectionUtils.isNotEmpty(list1)) { | |
434 | + hospital = list1.get(0) + ""; | |
409 | 435 | } |
410 | 436 | //查询产妇数据 |
411 | - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(),null, hospital); | |
412 | - patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(),null, null); | |
437 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital); | |
438 | + patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null); | |
413 | 439 | } |
414 | 440 | |
415 | 441 | if (null == patients) { |
416 | 442 | |
417 | 443 | |
418 | 444 | |
419 | 445 | |
420 | 446 | |
... | ... | @@ -422,24 +448,58 @@ |
422 | 448 | antExChuQuery.setYn(YnEnums.YES.getId()); |
423 | 449 | //获取初诊记录 |
424 | 450 | List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery); |
425 | - AntExChuModel antExChuModel = null; | |
451 | + /* AntExChuModel antExChuModel = null; | |
426 | 452 | if (CollectionUtils.isNotEmpty(antExChulist)) { |
427 | 453 | antExChuModel = antExChulist.get(0); |
428 | - } | |
454 | + }*/ | |
455 | + HighScoreResult highScoreResult = findLastRisk(patients.getId()); | |
429 | 456 | //查询产前检查记录 |
430 | - List list = antenatalExaminationService.findAllByParentId(patients1.getId()); | |
431 | - List data = new ArrayList(); | |
457 | + List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(patients.getId()); | |
458 | + /* List data = new ArrayList(); | |
432 | 459 | if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { |
433 | 460 | List l = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
434 | 461 | data = queryRiskName(l); |
435 | 462 | } |
436 | - | |
463 | + if(CollectionUtils.isNotEmpty(list)){ | |
464 | + AntenatalExaminationModel antEx= list.get(0); | |
465 | + try{ | |
466 | + if(!"{}".equals(antEx.getOtherRisk())){ | |
467 | + JsonUtil.str2Obj(antEx.getOtherRisk(), java.util.Map.class); | |
468 | + } | |
469 | + }catch (Exception e){ | |
470 | + } | |
471 | + data.add(); | |
472 | + }*/ | |
437 | 473 | antexListResult.convertToResult(list, patients, antExChulist); |
438 | - antexListResult.setIsSieve(cap(patients.getLastMenses(), patients1.getId())); | |
439 | - antexListResult.setRiskFactor(data); | |
474 | + antexListResult.setData(handlAntData(antExChulist,list)); | |
475 | + antexListResult.setIsSieve(cap(patients.getLastMenses(), patients.getId())); | |
476 | + antexListResult.setRiskFactor(highScoreResult.getHighRisk()); | |
477 | + antexListResult.setRiskScore(highScoreResult.getScore()+""); | |
440 | 478 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(antexListResult); |
441 | 479 | } |
442 | 480 | |
481 | + public List handlAntData(List<AntExChuModel> antExChulist,List<AntenatalExaminationModel> list){ | |
482 | + List<AntData> dataList = new ArrayList<>(); | |
483 | + Organization organization=null; | |
484 | + if(CollectionUtils.isNotEmpty(antExChulist)){ | |
485 | + for(AntExChuModel antExChuModel1:antExChulist){ | |
486 | + if (null != antExChuModel1.getHospitalId()) { | |
487 | + organization = organizationService.getOrganization(Integer.valueOf(antExChuModel1.getHospitalId())); | |
488 | + } | |
489 | + dataList.add(new AntData(antExChuModel1,null != organization ? organization.getName() : "")); | |
490 | + } | |
491 | + } | |
492 | + if(CollectionUtils.isNotEmpty(list)){ | |
493 | + for(AntenatalExaminationModel model:list){ | |
494 | + if (null != model.getHospitalId()) { | |
495 | + organization = organizationService.getOrganization(Integer.valueOf(model.getHospitalId())); | |
496 | + } | |
497 | + dataList.add(new AntData(model, null != organization ? organization.getName() : "")); | |
498 | + } | |
499 | + } | |
500 | + return dataList; | |
501 | + } | |
502 | + | |
443 | 503 | private List queryRiskName(List l) { |
444 | 504 | List data = new ArrayList(); |
445 | 505 | for (int i = 0; i < l.size(); i++) { |
446 | 506 | |
... | ... | @@ -469,14 +529,15 @@ |
469 | 529 | try { |
470 | 530 | if (StringUtils.isNotEmpty(examinationModel.getRiskFactor())) { |
471 | 531 | List list1 = JsonUtil.toList(examinationModel.getRiskFactor(), List.class); |
472 | - antenatalExaminationResult.setRiskFactor(queryRisk(list1)); | |
532 | + HighScoreResult highScoreResult = queryRisk(list1); | |
533 | + antenatalExaminationResult.setRiskFactor(highScoreResult.getHighRisk()); | |
473 | 534 | } |
474 | 535 | } catch (Exception e) { |
475 | 536 | } |
476 | 537 | try { |
477 | 538 | if (StringUtils.isNotEmpty(examinationModel.getDiagnosis())) { |
478 | 539 | List list = JsonUtil.toList(examinationModel.getDiagnosis(), List.class); |
479 | - antenatalExaminationResult.setDiagnosis(queryRisk(list)); | |
540 | + antenatalExaminationResult.setDiagnosis(queryRisk(list).getHighRisk()); | |
480 | 541 | } |
481 | 542 | } catch (Exception e) { |
482 | 543 | } |
483 | 544 | |
... | ... | @@ -510,14 +571,14 @@ |
510 | 571 | try { |
511 | 572 | if (StringUtils.isNotEmpty(antExChuModel.getDiagnosis())) { |
512 | 573 | List list = JsonUtil.toList(antExChuModel.getDiagnosis(), List.class); |
513 | - antexChuResult.setDiagnosis(queryRisk(list)); | |
574 | + antexChuResult.setDiagnosis(queryRisk(list).getHighRisk()); | |
514 | 575 | } |
515 | 576 | } catch (Exception e) { |
516 | 577 | } |
517 | 578 | try { |
518 | 579 | if (StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { |
519 | 580 | List list1 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
520 | - antexChuResult.setHighrisk(queryRisk(list1)); | |
581 | + antexChuResult.setHighrisk(queryRisk(list1).getHighRisk()); | |
521 | 582 | } |
522 | 583 | } catch (Exception e) { |
523 | 584 | } |
524 | 585 | |
525 | 586 | |
... | ... | @@ -536,11 +597,14 @@ |
536 | 597 | return new BaseObjectResponse().setData(object).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
537 | 598 | } |
538 | 599 | |
539 | - public List queryRisk(List<String> id) { | |
600 | + public HighScoreResult queryRisk(List<String> id) { | |
601 | + HighScoreResult highScoreResult = new HighScoreResult(); | |
540 | 602 | BasicConfigQuery |
541 | 603 | basicConfigQuery = new BasicConfigQuery(); |
542 | 604 | List data = new ArrayList(); |
605 | + Integer score = null; | |
543 | 606 | if (CollectionUtils.isNotEmpty(id)) { |
607 | + score = 0; | |
544 | 608 | for (String i : id) { |
545 | 609 | basicConfigQuery.setId(i); |
546 | 610 | List<BasicConfig> basicConfigs = basicConfigService.queryBasicConfig(basicConfigQuery); |
547 | 611 | |
... | ... | @@ -549,12 +613,17 @@ |
549 | 613 | Map<String, Object> map = new HashMap<>(); |
550 | 614 | map.put("id", basicConfig.getId()); |
551 | 615 | map.put("name", basicConfig.getName()); |
616 | + if (StringUtils.isNotEmpty(basicConfig.getCode())) { | |
617 | + score += NumberUtils.toInt(basicConfig.getCode(), 0); | |
618 | + } | |
552 | 619 | data.add(map); |
553 | 620 | } |
554 | 621 | } |
555 | 622 | } |
556 | 623 | } |
557 | - return data; | |
624 | + highScoreResult.setHighRisk(data); | |
625 | + highScoreResult.setScore(score); | |
626 | + return highScoreResult; | |
558 | 627 | } |
559 | 628 | |
560 | 629 | public BaseResponse getEnums() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
41588bf
... | ... | @@ -6,10 +6,7 @@ |
6 | 6 | import com.lyms.platform.common.result.BaseListResponse; |
7 | 7 | import com.lyms.platform.common.result.BaseObjectResponse; |
8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
9 | -import com.lyms.platform.common.utils.DateUtil; | |
10 | -import com.lyms.platform.common.utils.JsonUtil; | |
11 | -import com.lyms.platform.common.utils.StringUtils; | |
12 | -import com.lyms.platform.common.utils.SystemConfig; | |
9 | +import com.lyms.platform.common.utils.*; | |
13 | 10 | import com.lyms.platform.operate.web.request.*; |
14 | 11 | import com.lyms.platform.operate.web.result.*; |
15 | 12 | import com.lyms.platform.permission.model.Organization; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
41588bf
... | ... | @@ -100,11 +100,20 @@ |
100 | 100 | PersonModel resperson = null; |
101 | 101 | if (yunRequest.getPregnantPhone() != null || yunRequest.getPregnantCertificateNum() != null) |
102 | 102 | { |
103 | + | |
103 | 104 | PersonModelQuery personModelQuery = new PersonModelQuery(); |
104 | - personModelQuery.setPhone(yunRequest.getPregnantPhone()); | |
105 | 105 | personModelQuery.setCardNo(yunRequest.getPregnantCertificateNum()); |
106 | 106 | personModelQuery.setYn(YnEnums.YES.getId()); |
107 | 107 | List<PersonModel> personModels = personService.queryPersons(personModelQuery); |
108 | + | |
109 | + if (personModels == null || personModels.size() == 0) | |
110 | + { | |
111 | + personModelQuery.setPhone(yunRequest.getPregnantPhone()); | |
112 | + personModelQuery.setCardNo(null); | |
113 | + personModels = personService.queryPersons(personModelQuery); | |
114 | + } | |
115 | + | |
116 | + | |
108 | 117 | PersonModel pmodel = new PersonModel(); |
109 | 118 | pmodel.setName(yunRequest.getPregnantName()); |
110 | 119 | pmodel.setBirth(DateUtil.parseYMD(yunRequest.getBirthday())); |
... | ... | @@ -693,6 +702,34 @@ |
693 | 702 | } |
694 | 703 | yunBookbuildingService.deletePregnantById(id); |
695 | 704 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
705 | + } | |
706 | + | |
707 | + /** | |
708 | + * 查询孕妇基本信息 通过手机号码或者身份证 | |
709 | + * @param cardNo | |
710 | + * @param phone | |
711 | + * @return | |
712 | + */ | |
713 | + public BaseObjectResponse queryYunBuildInfo(String cardNo, String phone) { | |
714 | + Patients pat = null; | |
715 | + if (StringUtils.isNotEmpty(cardNo) || StringUtils.isNotEmpty(phone)) | |
716 | + { | |
717 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
718 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
719 | + patientsQuery.setCardNo(cardNo); | |
720 | + patientsQuery.setPhone(phone); | |
721 | + | |
722 | + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
723 | + if (CollectionUtils.isNotEmpty(patients)) | |
724 | + { | |
725 | + pat = patients.get(0); | |
726 | + } | |
727 | + } | |
728 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
729 | + objectResponse.setData(pat); | |
730 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
731 | + objectResponse.setErrormsg("成功"); | |
732 | + return objectResponse; | |
696 | 733 | } |
697 | 734 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
41588bf
... | ... | @@ -148,6 +148,7 @@ |
148 | 148 | babyModel.setMphone(patients.getPhone()); |
149 | 149 | babyModel.setMbirth(patients.getBirth()); |
150 | 150 | babyModel.setMcertNo(patients.getCardNo()); |
151 | + babyModel.setMcertTypeId(patients.getPcerteTypeId()); | |
151 | 152 | //父亲信息 |
152 | 153 | babyModel.setFjob(patients.getHworkUnit()); |
153 | 154 | babyModel.setFname(patients.getHusbandName()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
41588bf
... | ... | @@ -2,7 +2,6 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.*; |
4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
5 | -import com.lyms.platform.common.enums.ServiceObjEnums; | |
6 | 5 | import com.lyms.platform.common.enums.SmsServiceEnums; |
7 | 6 | import com.lyms.platform.common.enums.YnEnums; |
8 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
... | ... | @@ -55,7 +54,6 @@ |
55 | 54 | private AntenatalExaminationFacade antenatalExaminationFacade; |
56 | 55 | |
57 | 56 | |
58 | - | |
59 | 57 | /** |
60 | 58 | * 修改产妇的社区 |
61 | 59 | * |
... | ... | @@ -202,7 +200,7 @@ |
202 | 200 | patientsQuery.setName(riskPatientsQueryRequest.getName()); |
203 | 201 | patientsQuery.sethScore(riskPatientsQueryRequest.gethScore()); |
204 | 202 | patientsQuery.setrFactor(riskPatientsQueryRequest.getrFactor()); |
205 | - if(null!=riskPatientsQueryRequest.getServiceType()){ | |
203 | + if (null != riskPatientsQueryRequest.getServiceType()) { | |
206 | 204 | patientsQuery.setServiceType(Integer.valueOf(riskPatientsQueryRequest.getServiceType())); |
207 | 205 | } |
208 | 206 | patientsQuery.setAge(riskPatientsQueryRequest.getAge()); |
209 | 207 | |
... | ... | @@ -241,14 +239,15 @@ |
241 | 239 | patientBaseResult.convert(patients); |
242 | 240 | } |
243 | 241 | try { |
244 | - patientBaseResult.setRiskFactor(antenatalExaminationFacade.findLastRisk(patients.getId())); | |
242 | + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId()); | |
243 | + patientBaseResult.setRiskFactor(highScoreResult.getHighRisk()); | |
244 | + patientBaseResult.setRiskScore(highScoreResult.getScore()+""); | |
245 | 245 | } catch (Exception e) { |
246 | 246 | } |
247 | 247 | return new BaseObjectResponse().setData(patientBaseResult).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); |
248 | 248 | } |
249 | 249 | |
250 | 250 | |
251 | - | |
252 | 251 | /** |
253 | 252 | * 转成全部产妇的返回数据 |
254 | 253 | * |
255 | 254 | |
256 | 255 | |
257 | 256 | |
... | ... | @@ -328,24 +327,20 @@ |
328 | 327 | return data; |
329 | 328 | } |
330 | 329 | |
331 | - public BaseResponse patientGuildSms(PatientGuideSmsRequest patientGuideSmsRequest){ | |
330 | + public BaseResponse patientGuildSms(PatientGuideSmsRequest patientGuideSmsRequest) { | |
332 | 331 | MessageListRequest smsList = new MessageListRequest(); |
333 | - List<MessageRequest> messages = new ArrayList<>(); | |
332 | + List<MessageRequest> messages = new ArrayList<>(); | |
334 | 333 | List<Patients> sendModels = new ArrayList<>(); |
335 | - if (CollectionUtils.isNotEmpty(patientGuideSmsRequest.getIds())) | |
336 | - { | |
337 | - for(String patientId:patientGuideSmsRequest.getIds()){ | |
338 | - Patients patients= patientsService.findOnePatientById(patientId); | |
339 | - if(null!=patients){ | |
334 | + if (CollectionUtils.isNotEmpty(patientGuideSmsRequest.getIds())) { | |
335 | + for (String patientId : patientGuideSmsRequest.getIds()) { | |
336 | + Patients patients = patientsService.findOnePatientById(patientId); | |
337 | + if (null != patients) { | |
340 | 338 | sendModels.add(patients); |
341 | 339 | } |
342 | 340 | } |
343 | - if (CollectionUtils.isNotEmpty(sendModels)) | |
344 | - { | |
345 | - for (Patients model : sendModels) | |
346 | - { | |
347 | - if (model != null && com.lyms.platform.common.utils.StringUtils.isNotEmpty(model.getPhone())) | |
348 | - { | |
341 | + if (CollectionUtils.isNotEmpty(sendModels)) { | |
342 | + for (Patients model : sendModels) { | |
343 | + if (model != null && com.lyms.platform.common.utils.StringUtils.isNotEmpty(model.getPhone())) { | |
349 | 344 | MessageRequest mr = new MessageRequest(); |
350 | 345 | mr.setContent(patientGuideSmsRequest.getSmsContent()); |
351 | 346 | mr.setObjType(Integer.valueOf(patientGuideSmsRequest.getType())); |
... | ... | @@ -362,8 +357,7 @@ |
362 | 357 | } |
363 | 358 | } |
364 | 359 | |
365 | - if (CollectionUtils.isNotEmpty(messages)) | |
366 | - { | |
360 | + if (CollectionUtils.isNotEmpty(messages)) { | |
367 | 361 | smsList.setTypeId(1); |
368 | 362 | smsList.setMessages(messages); |
369 | 363 | //调用发送接口 TODO |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
41588bf
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | try { |
103 | 103 | if(StringUtils.isNotEmpty(postReviewModel.getDiagnosis())){ |
104 | 104 | List list = JsonUtil.toList(postReviewModel.getDiagnosis(), List.class); |
105 | - postReviewResult.setDiagnosis(examinationFacade.queryRisk(list)); | |
105 | + postReviewResult.setDiagnosis(examinationFacade.queryRisk(list).getHighRisk()); | |
106 | 106 | } |
107 | 107 | } catch (Exception e) { |
108 | 108 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java
View file @
41588bf
... | ... | @@ -159,7 +159,6 @@ |
159 | 159 | setName(patients.getUsername()); |
160 | 160 | setPhone(patients.getPhone()); |
161 | 161 | setRemarks(patients.getMremark()); |
162 | - setRiskScore("60"); | |
163 | 162 | setCardNo(patients.getCardNo()); |
164 | 163 | |
165 | 164 | setVcCardNo(patients.getVcCardNo()); |
... | ... | @@ -170,18 +169,7 @@ |
170 | 169 | if(null!=patients.getLastMenses()){ |
171 | 170 | setLastMenses(DateUtil.getyyyy_MM_dd(patients.getLastMenses())); |
172 | 171 | } |
173 | - List<AntData> dataList = new ArrayList<>(); | |
174 | - if(CollectionUtils.isNotEmpty(antExChuModel)){ | |
175 | - for(AntExChuModel antExChuModel1:antExChuModel){ | |
176 | - dataList.add(new AntData(antExChuModel1,"")); | |
177 | - } | |
178 | - } | |
179 | - if(CollectionUtils.isNotEmpty(destModel)){ | |
180 | - for(AntenatalExaminationModel model:destModel){ | |
181 | - dataList.add(new AntData(model,"")); | |
182 | - } | |
183 | - } | |
184 | - setData(dataList); | |
172 | + | |
185 | 173 | return this; |
186 | 174 | } |
187 | 175 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HighScoreResult.java
View file @
41588bf
1 | +package com.lyms.platform.operate.web.result; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +/** | |
6 | + * Created by Administrator on 2016/8/2 0002. | |
7 | + */ | |
8 | +public class HighScoreResult { | |
9 | + private List highRisk ; | |
10 | + private Integer score=0; | |
11 | + | |
12 | + public List getHighRisk() { | |
13 | + return highRisk; | |
14 | + } | |
15 | + | |
16 | + public void setHighRisk(List highRisk) { | |
17 | + this.highRisk = highRisk; | |
18 | + } | |
19 | + | |
20 | + public Integer getScore() { | |
21 | + return score; | |
22 | + } | |
23 | + | |
24 | + public void setScore(Integer score) { | |
25 | + this.score = score; | |
26 | + } | |
27 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MessageCenterService.java
View file @
41588bf
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | |
4 | 4 | import com.lyms.platform.common.utils.HttpRequest; |
5 | 5 | import com.lyms.platform.common.utils.JsonUtil; |
6 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
6 | 7 | import com.lyms.platform.common.utils.StringUtils; |
7 | 8 | import com.lyms.platform.operate.web.request.MessageListRequest; |
8 | 9 | |
9 | 10 | |
10 | 11 | |
... | ... | @@ -13,13 +14,19 @@ |
13 | 14 | * Created by Administrator on 2016/7/5. |
14 | 15 | */ |
15 | 16 | public class MessageCenterService { |
17 | + public static final String CENTER_BASE_URL= PropertiesUtils.getPropertyValue("center_base_url"); | |
18 | + public static final String CENTER_TOKEN = PropertiesUtils.getPropertyValue("center_token"); | |
16 | 19 | |
17 | - public static final String URL = "http://192.168.5.3:8080/v1/saveCreatedSMS"; | |
18 | - | |
20 | + /** | |
21 | + * 服务配置修改 修改这个类短信不发送或者开启发送 | |
22 | + * @param configs | |
23 | + * @param hid | |
24 | + * @return | |
25 | + */ | |
19 | 26 | public static boolean serviceConfig(List<Map<String,String>> configs,String hid) |
20 | 27 | { |
21 | 28 | String json = JsonUtil.obj2JsonString(configs); |
22 | - String result = HttpRequest.sendPost(URL, json, "YMer2016"); | |
29 | + String result = HttpRequest.sendPost(CENTER_BASE_URL+"serviceConfig/{"+hid+"}", json, CENTER_TOKEN); | |
23 | 30 | if (StringUtils.isNotEmpty(result)) |
24 | 31 | { |
25 | 32 | Map<String,String> map = JsonUtil.str2Obj(result, Map.class); |
26 | 33 | |
... | ... | @@ -32,10 +39,15 @@ |
32 | 39 | } |
33 | 40 | |
34 | 41 | |
42 | + /** | |
43 | + * 保存到短信中心 短信 | |
44 | + * @param list | |
45 | + * @return | |
46 | + */ | |
35 | 47 | public static boolean saveSmsCenter(MessageListRequest list) |
36 | 48 | { |
37 | 49 | String json = JsonUtil.obj2JsonString(list); |
38 | - String result = HttpRequest.sendPost(URL,json,"YMer2016"); | |
50 | + String result = HttpRequest.sendPost(CENTER_BASE_URL+"saveCreatedSMS", json, CENTER_TOKEN); | |
39 | 51 | if (StringUtils.isNotEmpty(result)) |
40 | 52 | { |
41 | 53 | Map<String,String> map = JsonUtil.str2Obj(result, Map.class); |
... | ... | @@ -47,10 +59,5 @@ |
47 | 59 | return false; |
48 | 60 | } |
49 | 61 | |
50 | - | |
51 | - public static void main(String[] areg) | |
52 | - { | |
53 | - | |
54 | - } | |
55 | 62 | } |