Commit 49c26974e801b1806a6c1a1117711f86d2471d7b
1 parent
77a9845e37
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 52 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
49c2697
... | ... | @@ -801,9 +801,16 @@ |
801 | 801 | query.addCriteria(Criteria.where("$where").is(formatBmi)); |
802 | 802 | PageResult pageResult = findMongoPage(PatientWeight.class, query.with(new Sort(Sort.Direction.DESC, "modified")), riskPatientsQueryRequest.getPage(), riskPatientsQueryRequest.getLimit()); |
803 | 803 | List <PatientWeight> patientWeightList = (List <PatientWeight>) pageResult.getGrid(); |
804 | + | |
805 | + //根据建档时间查询 | |
806 | + String bookbuildingDate=null; | |
807 | + if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getBookbuildingDate())) { | |
808 | + bookbuildingDate=riskPatientsQueryRequest.getBookbuildingDate(); | |
809 | + } | |
810 | + | |
804 | 811 | List <Map> data = new ArrayList <>(); |
805 | 812 | if (CollectionUtils.isNotEmpty(patientWeightList)) { |
806 | - data = convertToQuanWeight(patientWeightList); | |
813 | + data = convertToQuanWeight(patientWeightList,bookbuildingDate); | |
807 | 814 | } |
808 | 815 | return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS) |
809 | 816 | .setData(data).setPageInfo(new PageInfo(pageResult.getPage(), pageResult.getLastPage(), pageResult.getCount(), pageResult.getLimit())); |
... | ... | @@ -1671,7 +1678,7 @@ |
1671 | 1678 | return data; |
1672 | 1679 | } |
1673 | 1680 | |
1674 | - private List <Map> convertToQuanWeight(List <PatientWeight> patientWeightList) { | |
1681 | + private List <Map> convertToQuanWeight(List <PatientWeight> patientWeightList,String bookbuildingDate) { | |
1675 | 1682 | List <Map> data = new ArrayList <>(); |
1676 | 1683 | int batchSize = 4; |
1677 | 1684 | int end = 0; |
... | ... | @@ -1681,7 +1688,7 @@ |
1681 | 1688 | if (end > patientWeightList.size()) { |
1682 | 1689 | end = patientWeightList.size(); |
1683 | 1690 | } |
1684 | - listFuture.add(commonThreadPool.submit(new QuanWeightWorker(patientWeightList.subList(i, end), mongoTemplate, | |
1691 | + listFuture.add(commonThreadPool.submit(new QuanWeightWorker(patientWeightList.subList(i, end),bookbuildingDate, mongoTemplate, | |
1685 | 1692 | commonService, basicConfigService, trackDownRecordService,trackDownService,matDeliverService))); |
1686 | 1693 | } |
1687 | 1694 | for (Future f : listFuture) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java
View file @
49c2697
... | ... | @@ -189,6 +189,17 @@ |
189 | 189 | // 0 全部 1 正常 2 异常 |
190 | 190 | private Integer isUp; |
191 | 191 | |
192 | + //体重异常管理-接收建档时间筛选用 | |
193 | + private String bookbuildingDate; | |
194 | + | |
195 | + public String getBookbuildingDate() { | |
196 | + return bookbuildingDate; | |
197 | + } | |
198 | + | |
199 | + public void setBookbuildingDate(String bookbuildingDate) { | |
200 | + this.bookbuildingDate = bookbuildingDate; | |
201 | + } | |
202 | + | |
192 | 203 | public Integer getIsUp() { |
193 | 204 | return isUp; |
194 | 205 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanWeightWorker.java
View file @
49c2697
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | import com.lyms.platform.query.MatDeliverQuery; |
22 | 22 | import com.lyms.platform.query.TrackDownRecordQuery; |
23 | 23 | import org.apache.commons.collections.CollectionUtils; |
24 | +import org.apache.commons.lang3.time.DateUtils; | |
24 | 25 | import org.slf4j.Logger; |
25 | 26 | import org.slf4j.LoggerFactory; |
26 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
27 | 28 | |
... | ... | @@ -42,12 +43,14 @@ |
42 | 43 | private static final Logger logger = LoggerFactory.getLogger(PatientFacade.class); |
43 | 44 | private ITrackDownService trackDownService; |
44 | 45 | private List<PatientWeight> patientWeightList; |
46 | + private String bookbuildingDate; | |
45 | 47 | private MongoTemplate mongoTemplate; |
46 | 48 | private CommonService commonService; |
47 | 49 | private BasicConfigService basicConfigService; |
48 | 50 | private TrackDownRecordService trackDownRecordService; |
49 | 51 | private MatDeliverService matDeliverService; |
50 | 52 | public QuanWeightWorker(List<PatientWeight> patientWeightList, |
53 | + String bookbuildingDate, | |
51 | 54 | MongoTemplate mongoTemplate, |
52 | 55 | CommonService commonService, |
53 | 56 | BasicConfigService basicConfigService, |
... | ... | @@ -56,6 +59,7 @@ |
56 | 59 | MatDeliverService matDeliverService |
57 | 60 | ) { |
58 | 61 | this.patientWeightList = patientWeightList; |
62 | + this.bookbuildingDate = bookbuildingDate; | |
59 | 63 | this.mongoTemplate = mongoTemplate; |
60 | 64 | this.commonService = commonService; |
61 | 65 | this.basicConfigService = basicConfigService; |
62 | 66 | |
... | ... | @@ -67,9 +71,34 @@ |
67 | 71 | |
68 | 72 | @Override |
69 | 73 | public List<Map> call() throws Exception { |
74 | + //根据建档时间查询整理传来的时间 | |
75 | + Date bookbuildingDateStart=null; | |
76 | + Date bookbuildingDateEnd=null; | |
77 | + if (StringUtils.isNotEmpty(bookbuildingDate)) { | |
78 | + String[] dates = bookbuildingDate.split(" - "); | |
79 | + bookbuildingDateStart=DateUtil.parseYMD(dates[0]); | |
80 | + if (dates.length == 2) { | |
81 | +// bookbuildingDateEnd=DateUtil.parseYMDHMS(dates[1]+" 23:59:59"); | |
82 | + bookbuildingDateEnd=new Date(DateUtil.parseYMD(dates[1]).getTime() + 24 * 60 * 60 * 1000 - 1); | |
83 | + } | |
84 | + } | |
70 | 85 | List<Map> data = new ArrayList<>(); |
71 | 86 | for (PatientWeight patientWeight : patientWeightList){ |
72 | - List <Patients> patientsList = mongoTemplate.find(Query.query(Criteria.where("id").is(patientWeight.getPatientId()).and("yn").ne("0")), Patients.class); | |
87 | + Criteria criteriaPatients=Criteria.where("id").is(patientWeight.getPatientId()).and("yn").ne("0"); | |
88 | + //根据建档时间查询 拼查询语句 | |
89 | + if(null!=bookbuildingDateStart&&null!=bookbuildingDateEnd){ | |
90 | + criteriaPatients=criteriaPatients.and("bookbuildingDate").gte(bookbuildingDateStart).lte(bookbuildingDateEnd); | |
91 | + }else { | |
92 | + if(null!=bookbuildingDateStart){ | |
93 | + criteriaPatients=criteriaPatients.and("bookbuildingDate").gte(bookbuildingDateStart); | |
94 | + } | |
95 | + if(null!=bookbuildingDateEnd){ | |
96 | + criteriaPatients=criteriaPatients.and("bookbuildingDate").lte(bookbuildingDateEnd); | |
97 | + } | |
98 | + } | |
99 | + Query queryPatients=Query.query(criteriaPatients); | |
100 | + List <Patients> patientsList = mongoTemplate.find(queryPatients, Patients.class); | |
101 | + | |
73 | 102 | if(CollectionUtils.isNotEmpty(patientsList)){ |
74 | 103 | Patients patients = patientsList.get(0); |
75 | 104 | Map map = new HashMap(); |
... | ... | @@ -187,6 +216,7 @@ |
187 | 216 | map.put("patientId", patients.getId()); |
188 | 217 | map.put("pid", patients.getPid()); |
189 | 218 | map.put("cardNo", patients.getCardNo()); |
219 | + map.put("bookbuildingDate", DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
190 | 220 | |
191 | 221 | |
192 | 222 | } |