Commit e1ed32c63219096b99b49119368ad3ec1db4d64a
1 parent
87e23791d0
Exists in
master
and in
8 other branches
孕妇分娩后 变成产妇
Showing 2 changed files with 45 additions and 5 deletions
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
View file @
e1ed32c
| ... | ... | @@ -23,7 +23,16 @@ |
| 23 | 23 | private Date start; |
| 24 | 24 | |
| 25 | 25 | private Date end; |
| 26 | + private String hospitalId; | |
| 26 | 27 | |
| 28 | + public String getHospitalId() { | |
| 29 | + return hospitalId; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public void setHospitalId(String hospitalId) { | |
| 33 | + this.hospitalId = hospitalId; | |
| 34 | + } | |
| 35 | + | |
| 27 | 36 | public Date getEnd() { |
| 28 | 37 | return end; |
| 29 | 38 | } |
| ... | ... | @@ -53,6 +62,9 @@ |
| 53 | 62 | MongoCondition condition=MongoCondition.newInstance(); |
| 54 | 63 | if(null!=parentId){ |
| 55 | 64 | condition= condition.and("parentId",parentId, MongoOper.IS); |
| 65 | + } | |
| 66 | + if(null!=hospitalId){ | |
| 67 | + condition= condition.and("hospitalId",hospitalId, MongoOper.IS); | |
| 56 | 68 | } |
| 57 | 69 | if(null!=pid){ |
| 58 | 70 | condition= condition.and("pid",pid, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
View file @
e1ed32c
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.AntenatalExaminationService; | |
| 3 | 4 | import com.lyms.platform.biz.service.PatientsService; |
| 4 | 5 | import com.lyms.platform.biz.service.SieveService; |
| 5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 7 | |
| 7 | 8 | |
| ... | ... | @@ -14,13 +15,16 @@ |
| 14 | 15 | import com.lyms.platform.operate.web.result.SieveDetailResult; |
| 15 | 16 | import com.lyms.platform.operate.web.result.SieveListResult; |
| 16 | 17 | import com.lyms.platform.operate.web.result.SieveResult; |
| 17 | -import com.lyms.platform.pojo.Patients; | |
| 18 | -import com.lyms.platform.pojo.SieveModel; | |
| 19 | -import com.lyms.platform.pojo.SieveResultModel; | |
| 18 | +import com.lyms.platform.pojo.*; | |
| 19 | +import com.lyms.platform.query.AntExChuQuery; | |
| 20 | +import com.lyms.platform.query.AntExQuery; | |
| 20 | 21 | import com.lyms.platform.query.SieveQuery; |
| 21 | 22 | import com.lyms.platform.query.SieveResultQuery; |
| 22 | 23 | import org.apache.commons.collections.CollectionUtils; |
| 24 | +import org.apache.commons.lang.StringUtils; | |
| 25 | +import org.apache.commons.lang.math.NumberUtils; | |
| 23 | 26 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | +import org.springframework.data.domain.Sort; | |
| 24 | 28 | import org.springframework.stereotype.Component; |
| 25 | 29 | |
| 26 | 30 | import java.util.ArrayList; |
| 27 | 31 | |
| ... | ... | @@ -39,8 +43,9 @@ |
| 39 | 43 | private PatientsService patientsService; |
| 40 | 44 | @Autowired |
| 41 | 45 | private AutoMatchFacade autoMatchFacade; |
| 46 | + @Autowired | |
| 47 | + private AntenatalExaminationService antenatalExaminationService; | |
| 42 | 48 | |
| 43 | - | |
| 44 | 49 | /** |
| 45 | 50 | * 增加一条产筛结果记录 |
| 46 | 51 | * |
| 47 | 52 | |
| ... | ... | @@ -133,13 +138,36 @@ |
| 133 | 138 | sieveQuery.setPage(cqSieveQueryRequest.getPage()); |
| 134 | 139 | sieveQuery.setLimit(cqSieveQueryRequest.getLimit()); |
| 135 | 140 | sieveQuery.setNeed("1"); |
| 136 | - sieveQuery.setHospitalId(autoMatchFacade.getHospitalId(userId)); | |
| 141 | + String hospitalId=autoMatchFacade.getHospitalId(userId); | |
| 142 | + sieveQuery.setHospitalId(hospitalId); | |
| 137 | 143 | //查询产筛list |
| 138 | 144 | List<SieveModel> list = sieveService.queryList(sieveQuery); |
| 139 | 145 | List<SieveListResult> data = new ArrayList<>(); |
| 140 | 146 | if (CollectionUtils.isNotEmpty(list)) { |
| 141 | 147 | for (SieveModel sieveModel : list) { |
| 142 | 148 | SieveListResult sieveListResult = new SieveListResult(); |
| 149 | + AntExQuery antExQuery=new AntExQuery(); | |
| 150 | + antExQuery.setYn(YnEnums.YES.getId()); | |
| 151 | + antExQuery.setHospitalId(hospitalId); | |
| 152 | + antExQuery.setParentId(sieveModel.getParentId()); | |
| 153 | + List<AntenatalExaminationModel> list1 = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
| 154 | + if(CollectionUtils.isNotEmpty(list1)){ | |
| 155 | + if(StringUtils.isNotEmpty(list1.get(0).getTireNumber())){ | |
| 156 | + sieveModel.setTireNumber(NumberUtils.toInt(list1.get(0).getTireNumber())); | |
| 157 | + } | |
| 158 | + }else{ | |
| 159 | + AntExChuQuery antExChuQuery=new AntExChuQuery(); | |
| 160 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 161 | + antExChuQuery.setParentId(sieveModel.getParentId()); | |
| 162 | + antExChuQuery.setHospitalId(hospitalId); | |
| 163 | + List<AntExChuModel> antExChuModels= antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 164 | + if(CollectionUtils.isNotEmpty(antExChuModels)){ | |
| 165 | + if(StringUtils.isNotEmpty(antExChuModels.get(0).getTireNumber())){ | |
| 166 | + sieveModel.setTireNumber(NumberUtils.toInt(antExChuModels.get(0).getTireNumber())); | |
| 167 | + } | |
| 168 | + } | |
| 169 | + } | |
| 170 | + | |
| 143 | 171 | sieveListResult.convertToResult(sieveModel); |
| 144 | 172 | data.add(sieveListResult); |
| 145 | 173 | } |