Commit c67a2605b4c452e4a06a1941f31829ce4529caed
1 parent
58adf87c07
Exists in
master
and in
8 other branches
增加设置parentid
Showing 5 changed files with 66 additions and 16 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/SieveService.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/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntData.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/SieveService.java
View file @
c67a260
1 | 1 | package com.lyms.platform.biz.service; |
2 | 2 | |
3 | +import com.lyms.platform.biz.dal.ISieveApplyOrderDao; | |
3 | 4 | import com.lyms.platform.biz.dal.ISieveDao; |
4 | 5 | import com.lyms.platform.common.enums.YnEnums; |
6 | +import com.lyms.platform.common.utils.DateUtil; | |
7 | +import com.lyms.platform.pojo.SieveApplyOrderModel; | |
5 | 8 | import com.lyms.platform.pojo.SieveModel; |
6 | 9 | import com.lyms.platform.pojo.SieveResultModel; |
10 | +import com.lyms.platform.query.SieveApplyOrderQuery; | |
7 | 11 | import com.lyms.platform.query.SieveQuery; |
8 | 12 | import com.lyms.platform.query.SieveResultQuery; |
13 | +import org.apache.commons.collections.CollectionUtils; | |
9 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
10 | 15 | import org.springframework.data.domain.Sort; |
11 | 16 | import org.springframework.stereotype.Service; |
... | ... | @@ -21,6 +26,8 @@ |
21 | 26 | |
22 | 27 | @Autowired |
23 | 28 | private ISieveDao iSieveDao; |
29 | + @Autowired | |
30 | + private ISieveApplyOrderDao sieveApplyOrderDao; | |
24 | 31 | |
25 | 32 | public SieveResultModel addSieve(SieveResultModel obj) { |
26 | 33 | obj.setModified(new Date()); |
... | ... | @@ -32,7 +39,8 @@ |
32 | 39 | public SieveResultModel findById(String id) { |
33 | 40 | return iSieveDao.findById(id); |
34 | 41 | } |
35 | - public List<SieveResultModel> queryListSieveResult(SieveResultQuery sieveResultQuery){ | |
42 | + | |
43 | + public List<SieveResultModel> queryListSieveResult(SieveResultQuery sieveResultQuery) { | |
36 | 44 | return iSieveDao.queryListSieveResult(sieveResultQuery.convertToQuery()); |
37 | 45 | } |
38 | 46 | |
... | ... | @@ -50,6 +58,36 @@ |
50 | 58 | |
51 | 59 | public List<SieveModel> queryList(SieveQuery sieveQuery) { |
52 | 60 | return iSieveDao.queryList(sieveQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); |
61 | + } | |
62 | + | |
63 | + /** | |
64 | + * 根据id删除数据 | |
65 | + * | |
66 | + * @param mongoQuery | |
67 | + */ | |
68 | + public void deleteById(SieveQuery mongoQuery) { | |
69 | + iSieveDao.deleteById(mongoQuery.convertToQuery()); | |
70 | + } | |
71 | + | |
72 | + public void deleteSieve(String parentId, String hospitalId,Date lastMenses) { | |
73 | + | |
74 | + int days = DateUtil.daysBetween(lastMenses, new Date()); | |
75 | + //判断是否在区间 | |
76 | + if (days >= 108 && days <= 146) { | |
77 | + SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery(); | |
78 | + sieveApplyOrderQuery.setParentId(parentId); | |
79 | + sieveApplyOrderQuery.setYn(YnEnums.YES.getId()); | |
80 | + sieveApplyOrderQuery.setHospitalId(hospitalId); | |
81 | + List<SieveApplyOrderModel> list = sieveApplyOrderDao.queryList(sieveApplyOrderQuery.convertToQuery()); | |
82 | + if (CollectionUtils.isEmpty(list)) { | |
83 | + //做分娩的时候需要删除产筛数据 | |
84 | + SieveQuery sieveQuery = new SieveQuery(); | |
85 | + sieveQuery.setParentId(parentId); | |
86 | + sieveQuery.setYn(YnEnums.YES.getId()); | |
87 | + sieveQuery.setHospitalId(hospitalId); | |
88 | + deleteById(sieveQuery); | |
89 | + } | |
90 | + } | |
53 | 91 | } |
54 | 92 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
c67a260
... | ... | @@ -439,7 +439,7 @@ |
439 | 439 | if (null != an.getHospitalId()) { |
440 | 440 | organization = organizationService.getOrganization(Integer.valueOf(an.getHospitalId())); |
441 | 441 | } |
442 | - data.add(new AntData(an, null != organization ? organization.getName() : "")); | |
442 | + data.add(new AntData(an, null != organization ? organization.getName() : "",patients.getLastMenses())); | |
443 | 443 | } |
444 | 444 | } |
445 | 445 | |
... | ... | @@ -473,7 +473,7 @@ |
473 | 473 | if (null != postReviewModel.getHospitalId()) { |
474 | 474 | organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); |
475 | 475 | } |
476 | - data.add(new AntData(postReviewModel, null != organization ? organization.getName() : "")); | |
476 | + data.add(new AntData(postReviewModel, null != organization ? organization.getName() : "",patients.getDueDate())); | |
477 | 477 | } |
478 | 478 | } |
479 | 479 | |
... | ... | @@ -649,7 +649,8 @@ |
649 | 649 | if (null != model.getHospitalId()) { |
650 | 650 | organization = organizationService.getOrganization(Integer.valueOf(model.getHospitalId())); |
651 | 651 | } |
652 | - dataList.add(new AntData(model, null != organization ? organization.getName() : "")); | |
652 | + Patients patients =patientsService.findOnePatientById(model.getParentId()); | |
653 | + dataList.add(new AntData(model, null != organization ? organization.getName() : "",patients.getLastMenses())); | |
653 | 654 | } |
654 | 655 | } |
655 | 656 | return dataList; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
c67a260
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | @Autowired |
43 | 43 | private AntenatalExaminationService antenatalExaminationService; |
44 | 44 | @Autowired |
45 | - private BasicConfigService basicConfigService; | |
45 | + private SieveService sieveService; | |
46 | 46 | @Autowired |
47 | 47 | private AutoMatchFacade autoMatchFacade; |
48 | 48 | @Autowired |
... | ... | @@ -157,10 +157,14 @@ |
157 | 157 | maternalDeliverModel.setBaby(babies); |
158 | 158 | } |
159 | 159 | } |
160 | - List list1 = autoMatchFacade.matchOrgId(userId); | |
161 | - if (CollectionUtils.isNotEmpty(list1)) { | |
162 | - maternalDeliverModel.setHospitalId(list1.get(0) + ""); | |
163 | - } | |
160 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
161 | + maternalDeliverModel.setHospitalId(hospitalId); | |
162 | + //做分娩的时候需要删除产筛数据 | |
163 | + SieveQuery sieveQuery = new SieveQuery(); | |
164 | + sieveQuery.setParentId(deliverAddRequest.getParentId()); | |
165 | + sieveQuery.setYn(YnEnums.YES.getId()); | |
166 | + sieveQuery.setHospitalId(hospitalId); | |
167 | + sieveService.deleteById(sieveQuery); | |
164 | 168 | |
165 | 169 | maternalDeliverModel.setYn(YnEnums.YES.getId()); |
166 | 170 | matDeliverService.addMatDeliver(maternalDeliverModel); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
View file @
c67a260
... | ... | @@ -50,6 +50,10 @@ |
50 | 50 | |
51 | 51 | @Autowired |
52 | 52 | private PersonService personService; |
53 | + @Autowired | |
54 | + private SieveService sieveService; | |
55 | + @Autowired | |
56 | + private AutoMatchFacade autoMatchFacade; | |
53 | 57 | |
54 | 58 | |
55 | 59 | /** |
... | ... | @@ -149,7 +153,8 @@ |
149 | 153 | model.setPatientId(pat.getId()); |
150 | 154 | model.setCreated(new Date()); |
151 | 155 | model.setModified(new Date()); |
152 | - | |
156 | + String hospital=autoMatchFacade.getHospitalId(userId); | |
157 | + sieveService.deleteSieve(pat.getId(),hospital,pat.getLastMenses()); | |
153 | 158 | stopPregnancyService.addStopPreg(model); |
154 | 159 | BaseResponse objectResponse = new BaseResponse(); |
155 | 160 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntData.java
View file @
c67a260
... | ... | @@ -49,9 +49,10 @@ |
49 | 49 | this.title = title; |
50 | 50 | } |
51 | 51 | |
52 | - public AntData(AntenatalExaminationModel model,String hospitalName) { | |
52 | + public AntData(AntenatalExaminationModel model,String hospitalName,Date lastMenses) { | |
53 | 53 | this.id = model.getId(); |
54 | - this.dueWeek = model.getCurrentDueDate(); | |
54 | + int days = DateUtil.daysBetween(lastMenses, model.getCheckDate()); | |
55 | + this.dueWeek = StringUtils.dueWeek(days); | |
55 | 56 | if(null!=model.getCheckDate()){ |
56 | 57 | this.checkTime = DateUtil.getyyyy_MM_dd(model.getCheckDate()); |
57 | 58 | } |
... | ... | @@ -63,7 +64,7 @@ |
63 | 64 | |
64 | 65 | public AntData(AntExChuModel model,String hospitalName) { |
65 | 66 | this.id = model.getId(); |
66 | - int days = DateUtil.daysBetween(model.getLastMenses(), model.getCreated()); | |
67 | + int days = DateUtil.daysBetween(model.getLastMenses(), model.getCheckTime()); | |
67 | 68 | this.dueWeek = StringUtils.dueWeek(days); |
68 | 69 | if(null!=model.getCheckTime()){ |
69 | 70 | this.checkTime = DateUtil.getyyyy_MM_dd(model.getCheckTime()); |
... | ... | @@ -88,7 +89,7 @@ |
88 | 89 | |
89 | 90 | public AntData(MaternalDeliverModel model,Date lastMenses,String hospitalName) { |
90 | 91 | this.id = model.getId(); |
91 | - int days = DateUtil.daysBetween(lastMenses,model.getCreated()); | |
92 | + int days = DateUtil.daysBetween(lastMenses,DateUtil.parseYMD(model.getDueDate())); | |
92 | 93 | this.dueWeek = StringUtils.dueWeek(days); |
93 | 94 | this.checkTime = DateUtil.getyyyy_MM_dd(model.getCreated()); |
94 | 95 | this.title="孕妇分娩"; |
95 | 96 | |
... | ... | @@ -97,9 +98,10 @@ |
97 | 98 | this.hospitalId=model.getHospitalId(); |
98 | 99 | } |
99 | 100 | |
100 | - public AntData(PostReviewModel postReviewModel,String hospitalName) { | |
101 | + public AntData(PostReviewModel postReviewModel,String hospitalName,Date dueDate) { | |
101 | 102 | this.id=postReviewModel.getId(); |
102 | - this.dueWeek=postReviewModel.getDay(); | |
103 | + int days = DateUtil.daysBetween(dueDate,DateUtil.parseYMD(postReviewModel.getCheckTime())); | |
104 | + this.dueWeek= StringUtils.dueWeek(days); | |
103 | 105 | this.checkTime=postReviewModel.getCheckTime(); |
104 | 106 | this.title="产后复查"; |
105 | 107 | this.type="5"; |