Commit 8db6bb1a9ac23f16164849042f3e5173090e8460
1 parent
62031bb1b1
Exists in
master
and in
6 other branches
产筛
Showing 4 changed files with 64 additions and 51 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/SieveListResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/SieveWorker.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java
View file @
8db6bb1
... | ... | @@ -86,7 +86,7 @@ |
86 | 86 | @RequestMapping(value = "/querySievePatientInfo",method = RequestMethod.GET) |
87 | 87 | public BaseResponse querySievePatientInfo(@RequestParam(required = false)String cardNo,@RequestParam(required = false)String vcCardNo,HttpServletRequest request) { |
88 | 88 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
89 | - return sieveFacade.querySievePatientInfo(cardNo, vcCardNo,loginState.getId()); | |
89 | + return sieveFacade.querySievePatientInfo(cardNo, vcCardNo, loginState.getId()); | |
90 | 90 | } |
91 | 91 | |
92 | 92 | |
... | ... | @@ -107,6 +107,19 @@ |
107 | 107 | } |
108 | 108 | |
109 | 109 | |
110 | + /** | |
111 | + * 接收产筛申请 | |
112 | + * @param parentId | |
113 | + * @param request | |
114 | + * @return | |
115 | + */ | |
116 | + @ResponseBody | |
117 | + @RequestMapping(value = "/reviceSieve",method = RequestMethod.GET) | |
118 | + @TokenRequired | |
119 | + public BaseResponse reviceSieve(@RequestParam("parentId")String parentId,HttpServletRequest request){ | |
120 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
121 | + return sieveFacade.reviceSieve(parentId, loginState.getId()); | |
122 | + } | |
110 | 123 | |
111 | 124 | |
112 | 125 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
View file @
8db6bb1
... | ... | @@ -394,12 +394,9 @@ |
394 | 394 | sieveQuery.setNeed(needPage); |
395 | 395 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
396 | 396 | sieveQuery.setHospitalId(hospitalId); |
397 | - // System.out.println("产筛列表:"+sieveQuery.convertToQuery().convertToMongoQuery()); | |
398 | 397 | //查询产筛list |
399 | 398 | List<SieveModel> list = sieveService.queryList1(sieveQuery, "order"); |
400 | 399 | List<SieveListResult> data = new ArrayList<>(); |
401 | - | |
402 | - | |
403 | 400 | int batchSize = 4; |
404 | 401 | int end = 0; |
405 | 402 | List<Future> listFuture = new ArrayList<>(); |
... | ... | @@ -408,7 +405,7 @@ |
408 | 405 | if (end > list.size()) { |
409 | 406 | end = list.size(); |
410 | 407 | } |
411 | - listFuture.add(commonThreadPool.submit(new SieveWorker(hospitalId, list.subList(i, end), antenatalExaminationService, patientsService,applyOrderService))); | |
408 | + listFuture.add(commonThreadPool.submit(new SieveWorker(hospitalId, list.subList(i, end), antenatalExaminationService, patientsService,applyOrderService,organizationService))); | |
412 | 409 | } |
413 | 410 | for (Future f : listFuture) { |
414 | 411 | try { |
... | ... | @@ -417,49 +414,6 @@ |
417 | 414 | ExceptionUtils.catchException(e, "cqSieve list get result Future error."); |
418 | 415 | } |
419 | 416 | } |
420 | - | |
421 | - | |
422 | - | |
423 | -/* | |
424 | - if (CollectionUtils.isNotEmpty(list)) { | |
425 | - for (SieveModel sieveModel : list) { | |
426 | - SieveListResult sieveListResult = new SieveListResult(); | |
427 | - AntExQuery antExQuery = new AntExQuery(); | |
428 | - antExQuery.setYn(YnEnums.YES.getId()); | |
429 | - antExQuery.setHospitalId(hospitalId); | |
430 | - antExQuery.setParentId(sieveModel.getParentId()); | |
431 | - List<AntenatalExaminationModel> list1 = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
432 | - if (CollectionUtils.isNotEmpty(list1)) { | |
433 | - if (StringUtils.isNotEmpty(list1.get(0).getTireNumber())) { | |
434 | - sieveModel.setTireNumber(NumberUtils.toInt(list1.get(0).getTireNumber())); | |
435 | - } | |
436 | - } else { | |
437 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
438 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
439 | - antExChuQuery.setParentId(sieveModel.getParentId()); | |
440 | - antExChuQuery.setHospitalId(hospitalId); | |
441 | - List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
442 | - if (CollectionUtils.isNotEmpty(antExChuModels)) { | |
443 | - if (StringUtils.isNotEmpty(antExChuModels.get(0).getTireNumber())) { | |
444 | - sieveModel.setTireNumber(NumberUtils.toInt(antExChuModels.get(0).getTireNumber())); | |
445 | - } | |
446 | - } | |
447 | - } | |
448 | - | |
449 | - sieveListResult.convertToResult(sieveModel); | |
450 | - Patients patients = patientsService.findOnePatientById(sieveModel.getParentId()); | |
451 | - if (null != patients) { | |
452 | - sieveListResult.setIsGravida((patients.getType() == 3 && patients.getFmDate() != null) ? "0" : "1"); | |
453 | - if (null != patients.getDueStatus() && 1 == patients.getDueStatus()) | |
454 | - sieveListResult.setcDueWeek("终止妊娠"); | |
455 | - else if (patients.getType() == 3) { | |
456 | - sieveListResult.setcDueWeek("已分娩"); | |
457 | - } | |
458 | - sieveListResult.setAge(DateUtil.getAge(patients.getBirth()) + "岁"); | |
459 | - } | |
460 | - data.add(sieveListResult); | |
461 | - } | |
462 | - }*/ | |
463 | 417 | return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(sieveQuery.getPageInfo()); |
464 | 418 | } |
465 | 419 | |
... | ... | @@ -684,7 +638,7 @@ |
684 | 638 | patientBaseResult.setRiskFactor(highScoreResult.getHighRisk()); |
685 | 639 | patientBaseResult.setRiskScore(highScoreResult.getScoreStr()); |
686 | 640 | |
687 | - map.put("patientInfo",patientBaseResult); | |
641 | + map.put("patientInfo", patientBaseResult); | |
688 | 642 | |
689 | 643 | SieveApplyOrderQuery sieveApplyOrderQuery1 = new SieveApplyOrderQuery(); |
690 | 644 | sieveApplyOrderQuery1.setParentId(parentId); |
... | ... | @@ -702,7 +656,7 @@ |
702 | 656 | result.put("id",sieveApply.getId()); |
703 | 657 | result.put("parentId",sieveApply.getParentId()); |
704 | 658 | |
705 | - result.put("checkItem",sieveApply.getCheckItem()); | |
659 | + result.put("check",sieveApply.getCheckItem()); | |
706 | 660 | result.put("guide",sieveApply.getGuide()); |
707 | 661 | result.put("checkDate",sieveApply.getCheckDate()); |
708 | 662 | result.put("applyDoctor",sieveApply.getApplyDoctor()); |
... | ... | @@ -726,6 +680,16 @@ |
726 | 680 | |
727 | 681 | } |
728 | 682 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(map); |
683 | + } | |
684 | + | |
685 | + public BaseResponse reviceSieve(String parentId, Integer userId) { | |
686 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
687 | + SieveModel sieve = new SieveModel(); | |
688 | + sieve.setParentId(parentId); | |
689 | + sieve.setHospitalId(hospitalId); | |
690 | + sieve.setReviceStatus(2); | |
691 | + sieveService.updateOneChanQianDiaSieve(sieve); | |
692 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
729 | 693 | } |
730 | 694 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/SieveListResult.java
View file @
8db6bb1
... | ... | @@ -60,6 +60,28 @@ |
60 | 60 | //转诊状态 0转诊 1待接收 2已转出 |
61 | 61 | private Integer referralStatus; |
62 | 62 | |
63 | + //申请接收状态 1未接收 2接收 | |
64 | + private Integer reviceStatus; | |
65 | + | |
66 | + //申请医院 | |
67 | + private String applyHospital; | |
68 | + | |
69 | + public String getApplyHospital() { | |
70 | + return applyHospital; | |
71 | + } | |
72 | + | |
73 | + public void setApplyHospital(String applyHospital) { | |
74 | + this.applyHospital = applyHospital; | |
75 | + } | |
76 | + | |
77 | + public Integer getReviceStatus() { | |
78 | + return reviceStatus; | |
79 | + } | |
80 | + | |
81 | + public void setReviceStatus(Integer reviceStatus) { | |
82 | + this.reviceStatus = reviceStatus; | |
83 | + } | |
84 | + | |
63 | 85 | public Integer getReferralStatus() { |
64 | 86 | return referralStatus; |
65 | 87 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/SieveWorker.java
View file @
8db6bb1
... | ... | @@ -6,6 +6,8 @@ |
6 | 6 | import com.lyms.platform.common.enums.YnEnums; |
7 | 7 | import com.lyms.platform.common.utils.DateUtil; |
8 | 8 | import com.lyms.platform.operate.web.result.SieveListResult; |
9 | +import com.lyms.platform.permission.model.Organization; | |
10 | +import com.lyms.platform.permission.service.OrganizationService; | |
9 | 11 | import com.lyms.platform.pojo.*; |
10 | 12 | import com.lyms.platform.query.AntExChuQuery; |
11 | 13 | import com.lyms.platform.query.AntExQuery; |
... | ... | @@ -13,6 +15,7 @@ |
13 | 15 | import org.apache.commons.collections.CollectionUtils; |
14 | 16 | import org.apache.commons.lang.StringUtils; |
15 | 17 | import org.apache.commons.lang.math.NumberUtils; |
18 | +import org.springframework.beans.factory.annotation.Autowired; | |
16 | 19 | import org.springframework.data.domain.Sort; |
17 | 20 | |
18 | 21 | import java.util.ArrayList; |
19 | 22 | |
... | ... | @@ -35,12 +38,17 @@ |
35 | 38 | |
36 | 39 | private PatientsService patientsService; |
37 | 40 | |
38 | - public SieveWorker(String hospitalId, List<SieveModel> list, AntenatalExaminationService antService, PatientsService patientsService,ApplyOrderService applyOrderService) { | |
41 | + private OrganizationService organizationService; | |
42 | + | |
43 | + public SieveWorker(String hospitalId, List<SieveModel> list, AntenatalExaminationService antService, | |
44 | + PatientsService patientsService,ApplyOrderService applyOrderService, | |
45 | + OrganizationService organizationService) { | |
39 | 46 | this.hospitalId = hospitalId; |
40 | 47 | this.list = list; |
41 | 48 | this.antService = antService; |
42 | 49 | this.patientsService = patientsService; |
43 | 50 | this.applyOrderService = applyOrderService; |
51 | + this.organizationService = organizationService; | |
44 | 52 | } |
45 | 53 | |
46 | 54 | @Override |
... | ... | @@ -48,6 +56,7 @@ |
48 | 56 | List<SieveListResult> results = new ArrayList<>(); |
49 | 57 | for (SieveModel sieveModel : list) { |
50 | 58 | SieveListResult sieveListResult = new SieveListResult(); |
59 | + sieveListResult.setReviceStatus(sieveModel.getReviceStatus()); | |
51 | 60 | AntExQuery antExQuery = new AntExQuery(); |
52 | 61 | antExQuery.setYn(YnEnums.YES.getId()); |
53 | 62 | antExQuery.setHospitalId(hospitalId); |
54 | 63 | |
... | ... | @@ -105,9 +114,14 @@ |
105 | 114 | { |
106 | 115 | referralStatus = 2; |
107 | 116 | } |
117 | + | |
118 | + Organization organization = organizationService.getOrganization(Integer.parseInt(model.getHospitalId())); | |
119 | + sieveListResult.setApplyHospital(organization.getName()); | |
108 | 120 | } |
109 | 121 | |
110 | 122 | sieveListResult.setReferralStatus(referralStatus); |
123 | + | |
124 | + | |
111 | 125 | |
112 | 126 | |
113 | 127 | results.add(sieveListResult); |