Commit f3eafe512b8d408a92c0eb90d990755ad4934554
1 parent
aac68cbd93
Exists in
master
and in
6 other branches
update
Showing 5 changed files with 98 additions and 13 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyBookbuildingService.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.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/request/BabyManageRequest.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyBookbuildingService.java
View file @
f3eafe5
1 | 1 | package com.lyms.platform.biz.service; |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.dao.operator.MongoQuery; |
4 | +import com.lyms.platform.common.utils.DateUtil; | |
4 | 5 | import com.lyms.platform.pojo.*; |
6 | +import com.lyms.platform.query.BabyCheckModelQuery; | |
5 | 7 | import com.lyms.platform.query.BabyModelQuery; |
6 | 8 | import com.lyms.platform.query.PatientsQuery; |
7 | 9 | import org.apache.commons.collections.CollectionUtils; |
8 | 10 | import org.apache.commons.lang.StringUtils; |
9 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
10 | 12 | import org.springframework.data.domain.Sort; |
13 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
14 | +import org.springframework.data.mongodb.core.query.Criteria; | |
15 | +import org.springframework.data.mongodb.core.query.Query; | |
16 | +import org.springframework.data.mongodb.core.query.Update; | |
11 | 17 | import org.springframework.stereotype.Service; |
12 | 18 | |
13 | 19 | import com.lyms.platform.biz.dal.IBabyBookBuildingDao; |
14 | 20 | |
... | ... | @@ -23,8 +29,10 @@ |
23 | 29 | private IBabyBookBuildingDao babyBookBuildingDao; |
24 | 30 | @Autowired |
25 | 31 | private PatientsService patientsService; |
26 | - | |
27 | 32 | |
33 | + @Autowired | |
34 | + private MongoTemplate mongoTemplate; | |
35 | + | |
28 | 36 | public BabyModel addBabyBookbuilding(BabyModel babyModel) { |
29 | 37 | return babyBookBuildingDao.addBaby(babyModel); |
30 | 38 | } |
... | ... | @@ -117,7 +125,43 @@ |
117 | 125 | |
118 | 126 | public List<BabyModel> queryBabyBuildByCond(BabyModelQuery babyQuery,String sortkey,Sort.Direction sort) { |
119 | 127 | MongoQuery query = babyQuery.convertToQuery(); |
120 | - List<BabyModel> list=babyBookBuildingDao.queryBabyWithQuery(query); | |
128 | + | |
129 | + //不要动。这里是查询一个儿童所有检查记录是否有高危详情判断是否高危儿(以后可能用到) | |
130 | +// if(null!=babyQuery.getHealthHigh()){ | |
131 | +// List<BabyModel> list=babyBookBuildingDao.queryBabyWithQuery(query); | |
132 | +// if(babyQuery.getHealthHigh()==0){ | |
133 | +// for (BabyModel babyModel : list) { | |
134 | +// Query query2 =Query.query(Criteria.where("buildId").is(babyModel.getId())); | |
135 | +// List<BabyCheckModel> babyCheckModelList = mongoTemplate.find(query2,BabyCheckModel.class); | |
136 | +// int i=0; | |
137 | +// for (BabyCheckModel babyCheckModel : babyCheckModelList) { | |
138 | +// if(CollectionUtils.isEmpty(babyCheckModel.getHighRiskInfo())){ | |
139 | +// i++; | |
140 | +// } | |
141 | +// } | |
142 | +// if (i==0) { | |
143 | +// list.remove(babyModel); | |
144 | +// } | |
145 | +// } | |
146 | +// }else{ | |
147 | +// for (BabyModel babyModel : list) { | |
148 | +// Query query2 =Query.query(Criteria.where("buildId").is(babyModel.getId())); | |
149 | +// List<BabyCheckModel> babyCheckModelList = mongoTemplate.find(query2,BabyCheckModel.class); | |
150 | +// int i=0; | |
151 | +// for (BabyCheckModel babyCheckModel : babyCheckModelList) { | |
152 | +// if(CollectionUtils.isNotEmpty(babyCheckModel.getHighRiskInfo())){ | |
153 | +// i++; | |
154 | +// } | |
155 | +// } | |
156 | +// if (i==0) { | |
157 | +// list.remove(babyModel); | |
158 | +// } | |
159 | +// } | |
160 | +// } | |
161 | +// | |
162 | +// } | |
163 | + | |
164 | + | |
121 | 165 | if (StringUtils.isNotEmpty(babyQuery.getNeed())) { |
122 | 166 | babyQuery.mysqlBuild(babyBookBuildingDao.queryBabyManageCount(babyQuery.convertToQuery())); |
123 | 167 | query.start(babyQuery.getOffset()).end(babyQuery.getLimit()); |
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
f3eafe5
... | ... | @@ -379,6 +379,17 @@ |
379 | 379 | //儿童高危-其它高危 |
380 | 380 | private String wcOtherHighRisk; |
381 | 381 | |
382 | + //隆华、滦平 儿保管理全部 加健康/高危 筛查 0:健康,1:高危 | |
383 | + private Integer healthHigh; | |
384 | + | |
385 | + public Integer getHealthHigh() { | |
386 | + return healthHigh; | |
387 | + } | |
388 | + | |
389 | + public void setHealthHigh(Integer healthHigh) { | |
390 | + this.healthHigh = healthHigh; | |
391 | + } | |
392 | + | |
382 | 393 | public String getWcOtherHighRisk() { |
383 | 394 | return wcOtherHighRisk; |
384 | 395 | } |
385 | 396 | |
386 | 397 | |
387 | 398 | |
... | ... | @@ -2006,18 +2017,33 @@ |
2006 | 2017 | cor2 = con.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); |
2007 | 2018 | } |
2008 | 2019 | } |
2009 | - //隆华、滦平 是否结案 条件查询 | |
2020 | + | |
2021 | + //隆华、滦平定制 | |
2010 | 2022 | Criteria cor3=MongoCondition.newInstance().getCriteria();//这里不能给null return拼接不能为空 |
2011 | - if(null != endCase){ | |
2012 | - if(endCase==1){ | |
2013 | - cor3=Criteria.where("endCase").is(endCase); | |
2014 | - }else{ | |
2015 | - MongoCondition con = MongoCondition.newInstance(); | |
2016 | - MongoCondition con1 = MongoCondition.newInstance("endCase", endCase, MongoOper.IS); | |
2017 | - MongoCondition con2 = MongoCondition.newInstance("endCase",false,MongoOper.EXISTS);//只建档没检查的也算没结案 | |
2018 | - cor3=con.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
2023 | + if(StringUtils.isNotEmpty(hospitalId)&&(hospitalId=="2100001605"||hospitalId=="2100001377")){ | |
2024 | + //是否结案0:未结案,1:已结案 条件查询 | |
2025 | + | |
2026 | + if(null != endCase){ | |
2027 | + if(endCase==1){ | |
2028 | + cor3=Criteria.where("endCase").is(endCase); | |
2029 | + }else{ | |
2030 | + MongoCondition con = MongoCondition.newInstance(); | |
2031 | + MongoCondition con1 = MongoCondition.newInstance("endCase", endCase, MongoOper.IS); | |
2032 | + MongoCondition con2 = MongoCondition.newInstance("endCase",false,MongoOper.EXISTS);//只建档没检查的也算没结案 | |
2033 | + cor3=con.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
2034 | + } | |
2019 | 2035 | } |
2036 | + //隆华、滦平 是否结案 条件查询 健康0/高危1,有没有高危详情来判断 | |
2037 | + if(null!=healthHigh){ | |
2038 | + if(healthHigh==0){ | |
2039 | + condition=condition.and("highRiskInfo", false, MongoOper.EXISTS); | |
2040 | + }else { | |
2041 | + condition=condition.and("highRiskInfo", true, MongoOper.EXISTS); | |
2042 | + } | |
2043 | + | |
2044 | + } | |
2020 | 2045 | } |
2046 | + | |
2021 | 2047 | |
2022 | 2048 | /** |
2023 | 2049 | * 多个orCondition 需要添加Criteria来控制json同级两个and或者or来解决mongodb执行查询问题 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
f3eafe5
... | ... | @@ -267,7 +267,8 @@ |
267 | 267 | @RequestParam(value = "dueWeekStart", required = false) Integer dueWeekStart, |
268 | 268 | @RequestParam(value = "dueWeekEnd", required = false) Integer dueWeekEnd, |
269 | 269 | @RequestParam(value = "lastCheckDoctor", required = false) String lastCheckDoctor, |
270 | - @RequestParam(value = "riskCode", required = false) String riskCode | |
270 | + @RequestParam(value = "riskCode", required = false) String riskCode, | |
271 | + @RequestParam(value = "healthHigh", required = false) Integer healthHigh | |
271 | 272 | ) { |
272 | 273 | |
273 | 274 | if (CollectionUtils.isNotEmpty(highRiskInfos)) { |
... | ... | @@ -376,6 +377,7 @@ |
376 | 377 | request.setDueWeekEnd(dueWeekEnd); |
377 | 378 | request.setLastCheckDoctor(lastCheckDoctor); |
378 | 379 | request.setRiskCode(riskCode); |
380 | + request.setHealthHigh(healthHigh); | |
379 | 381 | |
380 | 382 | return babyBookbuildingFacade.queryBabyList(request, loginState.getId()); |
381 | 383 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
f3eafe5
... | ... | @@ -3347,7 +3347,9 @@ |
3347 | 3347 | |
3348 | 3348 | babyQuery.setStreetId(StringUtils.isEmpty(request.getStreetId()) ? null : request.getStreetId()); |
3349 | 3349 | babyQuery.setQueryNo(request.getQueryNo()); |
3350 | - System.out.println(babyQuery.convertToQuery().convertToMongoQuery().toString()); | |
3350 | + //秦皇岛-儿保管理-全部 加健康/高危筛选 | |
3351 | + babyQuery.setHealthHigh(null!=request.getHealthHigh()?request.getHealthHigh():null); | |
3352 | +// System.out.println(babyQuery.convertToQuery().convertToMongoQuery().toString()); | |
3351 | 3353 | List <BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); |
3352 | 3354 | |
3353 | 3355 | return models; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
View file @
f3eafe5
... | ... | @@ -112,6 +112,17 @@ |
112 | 112 | private String lastCheckDoctor; |
113 | 113 | private String riskCode; |
114 | 114 | |
115 | + //秦皇岛儿保管理全部 加健康/高危 筛查 0:健康,1:高危 | |
116 | + private Integer healthHigh; | |
117 | + | |
118 | + public Integer getHealthHigh() { | |
119 | + return healthHigh; | |
120 | + } | |
121 | + | |
122 | + public void setHealthHigh(Integer healthHigh) { | |
123 | + this.healthHigh = healthHigh; | |
124 | + } | |
125 | + | |
115 | 126 | public Integer getIsShowPhone() { |
116 | 127 | return isShowPhone; |
117 | 128 | } |