From 150e69bc607dde94bb5f49f4c5009f7495b8c69b Mon Sep 17 00:00:00 2001 From: yangfei Date: Tue, 19 Jun 2018 18:08:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E5=8D=B1=E5=84=BF=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=80=81=E4=BD=93=E5=BC=B1=E5=84=BF=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/query/BabyModelQuery.java | 27 ++++++++++++++++++ .../web/controller/BabyBuildController.java | 15 +++++++++- .../web/facade/AntenatalExaminationFacade.java | 33 +++++++++------------- .../operate/web/facade/BabyBookbuildingFacade.java | 7 +++-- .../operate/web/request/BabyManageRequest.java | 22 +++++++++++++++ 5 files changed, 82 insertions(+), 22 deletions(-) diff --git a/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java index edd1916..a68b4fd 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java @@ -124,6 +124,11 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { //是否体弱 0 非高危 1高危 private Integer weakSon; + //高危儿多项 + private List highRiskInfos; + //体弱儿多项 + private List weakSonInfos; + //高危ID private String highRiskInfo; @@ -168,6 +173,22 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { //身长别体重 private String heightWeight; + public List getHighRiskInfos() { + return highRiskInfos; + } + + public void setHighRiskInfos(List highRiskInfos) { + this.highRiskInfos = highRiskInfos; + } + + public List getWeakSonInfos() { + return weakSonInfos; + } + + public void setWeakSonInfos(List weakSonInfos) { + this.weakSonInfos = weakSonInfos; + } + public String getHighRiskInfo() { return highRiskInfo; } @@ -689,6 +710,12 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { if (CollectionUtils.isNotEmpty(enableListNot)) { condition = condition.and("enable", enableListNot, MongoOper.NIN); } + if (null != highRiskInfos) { + condition = condition.and("highRiskInfo", highRiskInfos, MongoOper.IN); + } + if (null != weakSonInfos) { + condition = condition.and("weakSonInfo", weakSonInfos, MongoOper.IN); + } if (null != hospitalIdList) { condition = condition.and("hospitalId", hospitalIdList, MongoOper.IN); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java index b50e71c..1c1cb63 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java @@ -17,6 +17,7 @@ import com.lyms.platform.operate.web.request.BabyManageRequest; import com.lyms.platform.operate.web.request.BookbuildingQueryRequest; import com.lyms.platform.operate.web.result.QueryHospitalListRequest; import com.lyms.platform.operate.web.result.QueryHospitalListResult; +import com.lyms.platform.operate.web.utils.CollectionUtils; import com.lyms.platform.permission.service.CouponService; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -28,6 +29,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.UnsupportedEncodingException; +import java.util.List; /* @@ -198,6 +200,8 @@ public class BabyBuildController extends BaseController { @RequestParam(value = "highRiskType", required = false) Integer highRiskType, @RequestParam(value = "diagnose", required = false) String diagnose, @RequestParam(value = "dateRange", required = false) String dateRange, + @RequestParam(value = "highRiskInfos", required = false) List highRiskInfos, + @RequestParam(value = "weakSonInfo", required = false) List weakSonInfos, @RequestParam("page") Integer page, @RequestParam("limit") Integer limit, @RequestParam(value = "showDetail",defaultValue = "0") Integer showDetail, @@ -212,9 +216,18 @@ public class BabyBuildController extends BaseController { @RequestParam(value = "hospitalCityId",required = false) String hospitalCityId, @RequestParam(value = "hospitalAreaId",required = false) String hospitalAreaId, @RequestParam(value = "hospitalId",required = false) String hospitalId, - @RequestParam(value = "isArea",required = false) String isArea){ + @RequestParam(value = "isArea",required = false) String isArea) { + + if (CollectionUtils.isNotEmpty(highRiskInfos)){ + System.out.println(highRiskInfos.size() + ":highRiskInfos" ); + } + if (CollectionUtils.isNotEmpty(weakSonInfos)){ + System.out.println("weakSonInfos:" + weakSonInfos.size()); + } LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); BabyManageRequest request = new BabyManageRequest(); + request.setWeakSonInfos(weakSonInfos); + request.setHighRiskInfos(highRiskInfos); request.setShowDetail(showDetail); request.setBuildDoctor(buildDoctor); request.setQueryNo(queryNo); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java index 8223bb8..287b9fb 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java @@ -682,8 +682,8 @@ public class AntenatalExaminationFacade { boolean isHightRisk = false; if (patient.getRiskScore() != null) { if (patient.getRiskScore() > 0) {//高危评分大于0 - if(CollectionUtils.isNotEmpty(patient.getRiskFactorId())){ - if(!"d42eec03-aa86-45b8-a4e0-78a0ff365fb6".equals(patient.getRiskFactorId().get(0))){ + if (CollectionUtils.isNotEmpty(patient.getRiskFactorId())) { + if (!"d42eec03-aa86-45b8-a4e0-78a0ff365fb6".equals(patient.getRiskFactorId().get(0))) { isHightRisk = true; } } @@ -750,9 +750,9 @@ public class AntenatalExaminationFacade { if (isHightRisk) { //风险名称 String riskNmae = queryRiskNameStr(patient.getRiskFactorId()); - content = com.lyms.platform.common.utils.StringUtils.replaceNameRisk(patient.getUsername(), riskNmae, templateModel.getContent(),doctorName); + content = com.lyms.platform.common.utils.StringUtils.replaceNameRisk(patient.getUsername(), riskNmae, templateModel.getContent(), doctorName); } else { - content = com.lyms.platform.common.utils.StringUtils.replaceName(patient.getUsername(), templateModel.getContent(),doctorName); + content = com.lyms.platform.common.utils.StringUtils.replaceName(patient.getUsername(), templateModel.getContent(), doctorName); } mr.setFirst("【" + messagePrefix + "】" + content); @@ -1666,6 +1666,10 @@ public class AntenatalExaminationFacade { List listData = new ArrayList(); Patients patients = iterator.next(); Patients patients2 = null; + + List patientIds = new ArrayList<>(); + patientIds.add(patientId); + //建档记录 if (null != patients.getHospitalId()) { organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())); @@ -1689,16 +1693,15 @@ public class AntenatalExaminationFacade { patientsQuery.setBuildType(1); List patients1 = patientsService.queryPatient(patientsQuery); if (CollectionUtils.isNotEmpty(patients1)) { + for (Patients ps : patients1) { + patientIds.add(ps.getId()); + } patients2 = patients1.get(0); } //初诊记录 AntExChuQuery antExChuQuery = new AntExChuQuery(); antExChuQuery.setYn(YnEnums.YES.getId()); - if (patients2 != null) { - antExChuQuery.setParentIds(Arrays.asList(patientId, patients2.getId())); - } else { - antExChuQuery.setParentId(patientId); - } + antExChuQuery.setParentIds(patientIds); List antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); if (CollectionUtils.isNotEmpty(antExChuModels)) { for (AntExChuModel an : antExChuModels) { @@ -1712,11 +1715,7 @@ public class AntenatalExaminationFacade { //复诊记录 AntExQuery antExQuery = new AntExQuery(); antExQuery.setYn(YnEnums.YES.getId()); - if (patients2 != null) { - antExQuery.setParentIds(Arrays.asList(patientId, patients2.getId())); - } else { - antExQuery.setParentId(patientId); - } + antExQuery.setParentIds(patientIds); List list1 = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); @@ -1733,11 +1732,7 @@ public class AntenatalExaminationFacade { MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); matDeliverQuery.setYn(YnEnums.YES.getId()); - if (patients2 != null) { - matDeliverQuery.setParentIdList(Arrays.asList(patientId, patients2.getId())); - } else { - matDeliverQuery.setParentId(patientId); - } + matDeliverQuery.setParentIdList(patientIds); List l = matDeliverService.query(matDeliverQuery); if (CollectionUtils.isNotEmpty(l)) { MaternalDeliverModel model = l.get(0); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java index 9d7fe30..a7dd5fb 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java @@ -2038,6 +2038,11 @@ public class BabyBookbuildingFacade { babyQuery.setWeakSonInfo(request.getWeakSonInfo()); //高危儿详情 babyQuery.setHighRiskInfo(request.getHighRiskInfo()); + //多项体弱儿因素查询条件 + babyQuery.setWeakSonInfos(request.getWeakSonInfos()); + //多项体弱儿因素查询 + babyQuery.setHighRiskInfos(request.getHighRiskInfos()); + if(String.valueOf("true").equals(request.getIsArea())){ List list = new ArrayList(); list.add("1");//转诊,建档已接受 @@ -2283,8 +2288,6 @@ public class BabyBookbuildingFacade { } } - - if(org.apache.commons.lang.StringUtils.isNotEmpty(request.getDateRange())){ String[] dates = request.getDateRange().split(" - "); babyQuery.setBuildDateStart(DateUtil.parseYMD(dates[0])); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java index 82182bc..56cea20 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java @@ -2,6 +2,8 @@ package com.lyms.platform.operate.web.request; import com.lyms.platform.common.dao.BaseQuery; +import java.util.List; + /** * Created by lqy on 2016/6/17. */ @@ -40,6 +42,10 @@ public class BabyManageRequest extends BaseQuery { private String weakSonInfo; //高危儿详情 private String highRiskInfo; + //高危儿多项 + private List highRiskInfos; + //体弱儿多项 + private List weakSonInfos; //建档医生id private String buildDoctor; private String dateRange; @@ -70,6 +76,22 @@ public class BabyManageRequest extends BaseQuery { //1-需要隐藏姓名、电话、地址 private int showDetail; + public List getHighRiskInfos() { + return highRiskInfos; + } + + public void setHighRiskInfos(List highRiskInfos) { + this.highRiskInfos = highRiskInfos; + } + + public List getWeakSonInfos() { + return weakSonInfos; + } + + public void setWeakSonInfos(List weakSonInfos) { + this.weakSonInfos = weakSonInfos; + } + public String getWeakSonInfo() { return weakSonInfo; } -- 1.8.3.1