Commit 83feb4f2504912dba0677679dc74ed992d7a3949
1 parent
1eb72cce37
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 83 additions and 4 deletions
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
83feb4f
... | ... | @@ -1063,11 +1063,11 @@ |
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | if (null != pv) { |
1066 | - if (null != pv[0]) { | |
1066 | + if (StringUtils.isNotEmpty(pv[0])) { | |
1067 | 1067 | condition = condition.and("phone", pv[0], MongoOper.IS); |
1068 | 1068 | } |
1069 | 1069 | |
1070 | - if (null != pv[1]) { | |
1070 | + if (StringUtils.isNotEmpty(pv[1])) { | |
1071 | 1071 | condition = condition.and("vcCardNo", pv[1], MongoOper.IS); |
1072 | 1072 | } |
1073 | 1073 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java
View file @
83feb4f
... | ... | @@ -22,6 +22,7 @@ |
22 | 22 | import javax.servlet.http.HttpServletRequest; |
23 | 23 | import java.util.ArrayList; |
24 | 24 | import java.util.List; |
25 | +import java.util.Map; | |
25 | 26 | |
26 | 27 | /** |
27 | 28 | * Created by lqy on 2017-04-11. |
... | ... | @@ -113,7 +114,7 @@ |
113 | 114 | @RequestParam(required = false) String phone, |
114 | 115 | HttpServletRequest request) { |
115 | 116 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
116 | - return lisFacade.getLisAndRisData(vcCardNo,phone, sortType, loginState.getId()); | |
117 | + return lisFacade.getLisAndRisData(vcCardNo, phone, sortType, loginState.getId()); | |
117 | 118 | } |
118 | 119 | |
119 | 120 | |
... | ... | @@ -126,7 +127,7 @@ |
126 | 127 | */ |
127 | 128 | @RequestMapping(method = RequestMethod.GET, value = "/getAppLis") |
128 | 129 | @ResponseBody |
129 | - public List<LisReportModel> getLisAndRisData(@RequestParam("patientIds") String patientIds, | |
130 | + public List<LisReportModel> getAppLisList(@RequestParam("patientIds") String patientIds, | |
130 | 131 | @RequestParam("page") Integer page, |
131 | 132 | @RequestParam("limit") Integer limit, |
132 | 133 | @RequestParam(required = false) Integer status, |
... | ... | @@ -139,6 +140,29 @@ |
139 | 140 | } |
140 | 141 | |
141 | 142 | return lisFacade.getAppLisList(patientIds, status, page, limit); |
143 | + } | |
144 | + | |
145 | + | |
146 | + /** | |
147 | + * 获取增量的未推送的lis数据 | |
148 | + * @param page | |
149 | + * @param limit | |
150 | + * @param token | |
151 | + * @return | |
152 | + */ | |
153 | + @RequestMapping(method = RequestMethod.GET, value = "/getNoSendLis") | |
154 | + @ResponseBody | |
155 | + public List<Map<String,String>> getNoSendLis(@RequestParam("page") Integer page, | |
156 | + @RequestParam("limit") Integer limit, | |
157 | + @RequestHeader("Authorization") String token) { | |
158 | + | |
159 | + if (!"3d19960bf3e81e7d816c4f26051c49ba".equals(token)) | |
160 | + { | |
161 | + ExceptionUtils.catchException("The request token is " + token); | |
162 | + return new ArrayList<>(); | |
163 | + } | |
164 | + | |
165 | + return lisFacade.getNoSendLis(page, limit); | |
142 | 166 | } |
143 | 167 | |
144 | 168 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
83feb4f
... | ... | @@ -570,5 +570,60 @@ |
570 | 570 | } |
571 | 571 | return hospitalNames; |
572 | 572 | } |
573 | + | |
574 | + public List<Map<String,String>> getNoSendLis(Integer page, Integer limit) { | |
575 | + | |
576 | + LisReportQuery query = new LisReportQuery(); | |
577 | + query.setPage(page); | |
578 | + query.setLimit(limit); | |
579 | + query.setNeed("true"); | |
580 | + query.setSort(" PUBLISH_TIME DESC "); | |
581 | + query.setStatus(0); //未推送状态 | |
582 | + | |
583 | + Set<String> patientIds = new HashSet<>(); | |
584 | + List<Map<String,String>> lists = new ArrayList<>(); | |
585 | + | |
586 | + List<LisReportModel> lises = lisService.queryLisDataByQuery(query); | |
587 | + if (CollectionUtils.isNotEmpty(lises)) | |
588 | + { | |
589 | + for(LisReportModel lisReportModel : lises) | |
590 | + { | |
591 | + Map<String,String> map = new HashMap<>(); | |
592 | + if (StringUtils.isNotEmpty(lisReportModel.getHospitalId())) | |
593 | + { | |
594 | + Organization organization = organizationService.getOrganization(Integer.parseInt(lisReportModel.getHospitalId())); | |
595 | + if (organization != null) | |
596 | + { | |
597 | + map.put("hospitalName",organization.getName()); | |
598 | + } | |
599 | + } | |
600 | + | |
601 | + PatientsQuery patientsQuery=new PatientsQuery(); | |
602 | + String[] strs = new String[]{lisReportModel.getPhone(), lisReportModel.getVcCardNo()}; | |
603 | + patientsQuery.setPv(strs); | |
604 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
605 | + List<Patients> list= patientsService.queryPatient(patientsQuery); | |
606 | + if (CollectionUtils.isNotEmpty(list)) | |
607 | + { | |
608 | + Patients pat = list.get(0); | |
609 | + String patientId = pat.getId(); | |
610 | + if (!patientIds.contains(patientId)) | |
611 | + { | |
612 | + patientIds.add(patientId); | |
613 | + map.put("vcCardNo",pat.getVcCardNo()); | |
614 | + map.put("name",pat.getUsername()); | |
615 | + map.put("phone",pat.getPhone()); | |
616 | + map.put("checkTime",DateUtil.getyyyy_MM_dd_hms(lisReportModel.getPublishTime())); | |
617 | + map.put("patientId",patientId); | |
618 | + map.put("hospitalId",lisReportModel.getHospitalId()); | |
619 | + lists.add(map); | |
620 | + } | |
621 | + } | |
622 | + } | |
623 | + } | |
624 | + patientIds.clear(); | |
625 | + | |
626 | + return lists; | |
627 | + } | |
573 | 628 | } |