Commit 29b2da34c6d53268e299eb98b8c2f66427fb78b3
1 parent
699783fc0c
Exists in
master
and in
1 other branch
统计
Showing 5 changed files with 104 additions and 12 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskReportResult.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
29b2da3
| ... | ... | @@ -93,7 +93,7 @@ |
| 93 | 93 | @TokenRequired |
| 94 | 94 | public BaseResponse queryAllPatPuerpera(@Valid RiskPatientsQueryRequest patientsQueryRequest,HttpServletRequest request) { |
| 95 | 95 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 96 | - return patientFacade.queryHighRisk(patientsQueryRequest, Boolean.TRUE, null, loginState.getId(), "true", Boolean.FALSE); | |
| 96 | + return patientFacade.queryHighRisk1(patientsQueryRequest, null, null, loginState.getId(), "true", Boolean.FALSE); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
29b2da3
| ... | ... | @@ -421,6 +421,27 @@ |
| 421 | 421 | return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(patientsQuery.getPageInfo()); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | + | |
| 425 | + public BaseResponse queryHighRisk1(RiskPatientsQueryRequest riskPatientsQueryRequest, Boolean isHighRisk, Integer type, Integer userId, String needPage, boolean isRegion) { | |
| 426 | + //组合请求 | |
| 427 | + PatientsQuery patientsQuery = complayRequest(riskPatientsQueryRequest, isHighRisk, type, userId, needPage, isRegion); | |
| 428 | + | |
| 429 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
| 430 | + //查询符合条件的孕妇 | |
| 431 | + StopWatch stopWatch = new StopWatch("queryPatient2 -" + hospital); | |
| 432 | + stopWatch.start(); | |
| 433 | + List<Patients> patientses = patientsService.queryPatient1(patientsQuery, "modified"); | |
| 434 | + stopWatch.stop(); | |
| 435 | + | |
| 436 | + logger.info(stopWatch.toString()); | |
| 437 | + List data = new ArrayList<>(); | |
| 438 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 439 | + //如果是查高危孕妇 | |
| 440 | + data = convertToHighRisk(patientses, userId, hospital); | |
| 441 | + } | |
| 442 | + return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(patientsQuery.getPageInfo()); | |
| 443 | + } | |
| 444 | + | |
| 424 | 445 | public BaseResponse findPatient(PatientQueryRequest patientQueryRequest, Integer userId) { |
| 425 | 446 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 426 | 447 | patientsQuery.setPid(patientQueryRequest.getPid()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
29b2da3
| ... | ... | @@ -10,10 +10,7 @@ |
| 10 | 10 | import com.lyms.platform.common.result.BaseListResponse; |
| 11 | 11 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 12 | 12 | import com.lyms.platform.common.result.BaseResponse; |
| 13 | -import com.lyms.platform.common.utils.DateUtil; | |
| 14 | -import com.lyms.platform.common.utils.JsonUtil; | |
| 15 | -import com.lyms.platform.common.utils.StringUtils; | |
| 16 | -import com.lyms.platform.common.utils.SystemConfig; | |
| 13 | +import com.lyms.platform.common.utils.*; | |
| 17 | 14 | import com.lyms.platform.operate.web.request.BabyCheckRequest; |
| 18 | 15 | import com.lyms.platform.operate.web.request.RiskPatientsQueryRequest; |
| 19 | 16 | import com.lyms.platform.operate.web.result.*; |
| ... | ... | @@ -101,7 +98,7 @@ |
| 101 | 98 | //总的孕妇条数 |
| 102 | 99 | int allPatientCount = patientsService.queryPatientCount(patientsQuery); |
| 103 | 100 | |
| 104 | - List results = new ArrayList<>(); | |
| 101 | + List<RiskReportResult> results = new ArrayList<>(); | |
| 105 | 102 | |
| 106 | 103 | BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); |
| 107 | 104 | basicConfigQuery.setYn(YnEnums.YES.getId()); |
| 108 | 105 | |
| ... | ... | @@ -131,14 +128,14 @@ |
| 131 | 128 | for (Future f : futures) |
| 132 | 129 | { |
| 133 | 130 | try { |
| 134 | - results.addAll((List) f.get()); | |
| 135 | - } catch (InterruptedException e) { | |
| 136 | - e.printStackTrace(); | |
| 137 | - } catch (ExecutionException e) { | |
| 138 | - e.printStackTrace(); | |
| 131 | + results.addAll((List<RiskReportResult>) f.get()); | |
| 132 | + } catch (Exception e) { | |
| 133 | + ExceptionUtils.catchException(e, "high risk count error."); | |
| 139 | 134 | } |
| 140 | 135 | } |
| 141 | 136 | } |
| 137 | + | |
| 138 | + Collections.sort(results,new RiskReportResult()); | |
| 142 | 139 | |
| 143 | 140 | return new BaseListResponse() |
| 144 | 141 | .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(results); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
View file @
29b2da3
| ... | ... | @@ -69,6 +69,63 @@ |
| 69 | 69 | //服务状态 |
| 70 | 70 | private String serviceStatus; |
| 71 | 71 | |
| 72 | + //户籍地 | |
| 73 | + private String hjAddress; | |
| 74 | + | |
| 75 | + //居住地址 | |
| 76 | + private String jzAddress; | |
| 77 | + | |
| 78 | + //首次建档医院 | |
| 79 | + private String firstHospital; | |
| 80 | + | |
| 81 | + | |
| 82 | + //当前产检医院 | |
| 83 | + private String currentCheckHospital; | |
| 84 | + | |
| 85 | + public String getHjAddress() { | |
| 86 | + if(null==hjAddress){ | |
| 87 | + return SPIT; | |
| 88 | + } | |
| 89 | + return hjAddress; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setHjAddress(String hjAddress) { | |
| 93 | + this.hjAddress = hjAddress; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public String getJzAddress() { | |
| 97 | + if(null==jzAddress){ | |
| 98 | + return SPIT; | |
| 99 | + } | |
| 100 | + return jzAddress; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setJzAddress(String jzAddress) { | |
| 104 | + this.jzAddress = jzAddress; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public String getFirstHospital() { | |
| 108 | + if(null==firstHospital){ | |
| 109 | + return SPIT; | |
| 110 | + } | |
| 111 | + return firstHospital; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void setFirstHospital(String firstHospital) { | |
| 115 | + this.firstHospital = firstHospital; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public String getCurrentCheckHospital() { | |
| 119 | + if(null==currentCheckHospital){ | |
| 120 | + return SPIT; | |
| 121 | + } | |
| 122 | + return currentCheckHospital; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public void setCurrentCheckHospital(String currentCheckHospital) { | |
| 126 | + this.currentCheckHospital = currentCheckHospital; | |
| 127 | + } | |
| 128 | + | |
| 72 | 129 | public String getServiceType() { |
| 73 | 130 | return serviceType; |
| 74 | 131 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskReportResult.java
View file @
29b2da3
| 1 | 1 | package com.lyms.platform.operate.web.result; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.lyms.platform.common.utils.StringUtils; | |
| 5 | + | |
| 6 | +import java.util.Comparator; | |
| 4 | 7 | import java.util.List; |
| 5 | 8 | |
| 6 | 9 | /** |
| 7 | 10 | * 高危报表结果 |
| 8 | 11 | * Created by lqy on 2016/11/28 |
| 9 | 12 | */ |
| 10 | -public class RiskReportResult { | |
| 13 | +public class RiskReportResult implements Comparator<RiskReportResult> { | |
| 11 | 14 | |
| 12 | 15 | //高危因素Id |
| 13 | 16 | private String highRiskId; |
| ... | ... | @@ -63,5 +66,19 @@ |
| 63 | 66 | public void setPercent(String percent) { |
| 64 | 67 | this.percent = percent; |
| 65 | 68 | } |
| 69 | + | |
| 70 | + @Override | |
| 71 | + public int compare(RiskReportResult o1, RiskReportResult o2) { | |
| 72 | + if (o1 != null && o2 != null) | |
| 73 | + { | |
| 74 | + if (StringUtils.isNotEmpty(o2.getRiskCount()) && StringUtils.isNotEmpty(o1.getRiskCount())) | |
| 75 | + { | |
| 76 | + return Integer.parseInt(o2.getRiskCount()) - Integer.parseInt(o1.getRiskCount()); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + return 0; | |
| 80 | + } | |
| 81 | + | |
| 82 | + | |
| 66 | 83 | } |