From 9959aa980dd82e51cbf3577784fb429347971d34 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Thu, 12 Oct 2017 14:12:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E6=A3=80=E8=8A=82=E7=82=B9=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/dal/impl/AntenatalExaminationDaoImpl.java | 2 +- .../com/lyms/platform/pojo/AntExRecordModel.java | 11 + .../com/lyms/platform/query/AntExRecordQuery.java | 16 ++ .../web/controller/AreaCountController.java | 56 ++--- .../operate/web/facade/AreaCountFacade.java | 229 ++++++++++++++++----- .../platform/operate/web/facade/PatientFacade.java | 10 + .../web/request/RiskPatientsQueryRequest.java | 21 ++ 7 files changed, 252 insertions(+), 93 deletions(-) diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntenatalExaminationDaoImpl.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntenatalExaminationDaoImpl.java index 1b1dc5b..8ecf04c 100644 --- a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntenatalExaminationDaoImpl.java +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntenatalExaminationDaoImpl.java @@ -166,7 +166,7 @@ public class AntenatalExaminationDaoImpl extends BaseMongoDAOImpl> list = getCheckPointList( time, hospitalId, + provinceId, cityId, areaId, page, limit, userId,patientsQuery); + + return new BaseListResponse().setData(list).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setPageInfo(patientsQuery.getPageInfo()); + } + + + + private List getCheckPointList(String time, String hospitalId, + String provinceId, String cityId, + String areaId, Integer page, Integer limit, + Integer userId,PatientsQuery patientsQuery) + { List hospitalIds = new ArrayList<>(); if (StringUtils.isNotEmpty(hospitalId)) { hospitalIds.add(hospitalId); @@ -388,7 +410,7 @@ public class AreaCountFacade { endTime = DateUtil.parseYMD(times[1]); } } - PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setYn(YnEnums.YES.getId()); patientsQuery.setHospitalList(hospitalIds); @@ -401,7 +423,7 @@ public class AreaCountFacade { patientsQuery.setBookbuildingDateStart(startTime); patientsQuery.setBookbuildingDateEnd(endTime); - patientsQuery.setNeed("true"); + patientsQuery.setPage(page); patientsQuery.setLimit(limit); @@ -455,10 +477,49 @@ public class AreaCountFacade { } } + return list; + } - return new BaseListResponse().setData(list).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setPageInfo(patientsQuery.getPageInfo()); + + public void getCheckPointBuildDetailExport(String time, String hospitalId, String provinceId, String cityId, String areaId, + Integer userId, HttpServletResponse httpServletResponse) { + + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setNeed("true"); + List> list = getCheckPointList( time, hospitalId, + provinceId, cityId, areaId, null, null, userId,patientsQuery); + + List> results = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(list)) + { + for (Map map : list) + { + Map result = new HashMap<>(); + result.put("createDate", map.get("CREATE_DATE") == null ? "" : DateUtil.getyyyy_MM_dd((Date)map.get("CREATE_DATE"))); //建档日期 + result.put("name", map.get("NAME")); //姓名 + result.put("buildWeek", map.get("YZ_NAME")); //建档孕周 + result.put("hospitalName", map.get("HOSPITAL_NAME")); //建档机构 + result.put("doctor",map.get("DOCTOR_NAME")); //建档医生 + result.put("homeAddr", map.get("HOME_ADDR")); //居住地 + result.put("hjAddr",map.get("HJ_ADDR")); //户籍地 + result.put("telNo",map.get("TEL_NO")); //联系电话 + results.add(result); + } + } + + Map cnames = new LinkedHashMap<>(); + cnames.put("createDate", "建档日期"); //建档日期 + cnames.put("name", "姓名"); //姓名 + cnames.put("buildWeek", "建档孕周"); //建档孕周 + cnames.put("hospitalName", "建档机构"); //建档机构 + cnames.put("doctor","建档医生"); //建档医生 + cnames.put("homeAddr","居住地"); //居住地 + cnames.put("hjAddr","户籍地"); //户籍地 + cnames.put("telNo","联系电话"); //联系电话 + ResponseUtil.responseExcel(cnames, results, httpServletResponse); } + /** * 产检明细 * @param nodeType 1 首次 2 全部 @@ -499,17 +560,121 @@ public class AreaCountFacade { } } - return null; + AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); + antExRecordQuery.setBirthStart(startTime); + antExRecordQuery.setBuildTimeEnd(endTime); + antExRecordQuery.setHospitalList(hospitalIds); + antExRecordQuery.setPage(page); + antExRecordQuery.setLimit(limit); + antExRecordQuery.setNeed("true"); + antExRecordQuery.setIsFirst(nodeType); + + + if (nodeName != null) + { + if (nodeName == 0) + { + antExRecordQuery.setcDueWeekStart(0); + antExRecordQuery.setcDueWeekEnd((12 + 1) * 7 - 1); + } + else if (nodeName == 1) + { + antExRecordQuery.setcDueWeekStart(16); + antExRecordQuery.setcDueWeekEnd((20 + 1) * 7 - 1); + } + else if (nodeName == 2) + { + antExRecordQuery.setcDueWeekStart(21); + antExRecordQuery.setcDueWeekEnd((24 + 1) * 7 - 1); + } + else if (nodeName == 3) + { + antExRecordQuery.setcDueWeekStart(28); + antExRecordQuery.setcDueWeekEnd((36 + 1) * 7 - 1); + } + else if (nodeName == 4) + { + antExRecordQuery.setcDueWeekStart(37); + antExRecordQuery.setcDueWeekEnd((40 + 1) * 7 - 1); + } + } + + + List list = recordService.queryAntExRecords(antExRecordQuery); + + List results = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(list)) + { + for(AntExRecordModel model : list) + { + Map map = new HashMap<>(); + map.put("EXAMINE_DATE", DateUtil.getyyyy_MM_dd(model.getCheckTime())); //产检日期 + map.put("NAME",model.getName()); //姓名 + map.put("YZ_NAME", StringUtils.dueWeek(model.getcDay())); //产检孕周 + map.put("EXAMINE_HISTORY_NUM",""); //产检第次 + + + String chospital = ""; + if (org.apache.commons.lang.StringUtils.isNotEmpty(model.getHospitalId())) { + Organization organization = organizationService.getOrganization(Integer.parseInt(model.getHospitalId())); + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { + chospital = organization.getName(); + } + } + + map.put("EXAMINE_HOSPITAL",chospital); //产检机构 + + + //建档医生 + String bookbuildingDoctor = ""; + if (org.apache.commons.lang.StringUtils.isNotEmpty(model.getBuildDoctor()) && FunvCommonUtil.isNumeric(model.getBuildDoctor())) { + Users users = usersService.getUsers(Integer.parseInt(model.getBuildDoctor())); + if (users != null && users.getYn() == YnEnums.YES.getId()) { + bookbuildingDoctor = users.getName(); + } + } + + map.put("DOCTOR_NAME",bookbuildingDoctor); //建档医生 + + + + String checkDoctor = ""; + if (org.apache.commons.lang.StringUtils.isNotEmpty(model.getCheckDoctor()) && FunvCommonUtil.isNumeric(model.getCheckDoctor())) { + Users users = usersService.getUsers(Integer.parseInt(model.getCheckDoctor())); + if (users != null && users.getYn() == YnEnums.YES.getId()) { + checkDoctor = users.getName(); + } + } + + map.put("DOCTOR_NAME", checkDoctor); //产检医生 + + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setYn(YnEnums.YES.getId()); + patientsQuery.setId(model.getParentId()); + List patientsList = patientsService.queryPatient(patientsQuery); + + + String buildHosp = ""; + if (CollectionUtils.isNotEmpty(patientsList)) + { + if (org.apache.commons.lang.StringUtils.isNotEmpty(patientsList.get(0).getHospitalId())) { + Organization organization = organizationService.getOrganization(Integer.parseInt(patientsList.get(0).getHospitalId())); + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { + buildHosp = organization.getName(); + } + } + } + map.put("JD_HOSPITAL",buildHosp); //建档机构 + map.put("TEL_NO",map.get("TEL_NO")); //联系电话 + results.add(map); + results.add(map); + } + } + return new BaseListResponse().setData(list).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setPageInfo(antExRecordQuery.getPageInfo()); } } -// public BaseResponse getCheckPointBuildDetail(String time, String hospitalId, String provinceId, String cityId, String areaId, Integer page, Integer limit, Integer userId) { -// -// PageInfo pageInfo = new PageInfo(page, 0, count, limit); -// -// List> checkBuildtList = JdbcUtil.getOracleListDataBySql(DRIVER, JDBC, NAME, PWD, sql); -// return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(checkBuildtList).setPageInfo(pageInfo); -// } + @@ -548,37 +713,5 @@ public class AreaCountFacade { // ResponseUtil.responseExcel(cnames,results,httpServletResponse); // } -// public void getCheckPointBuildDetailExport(String time, String hospitalId, String provinceId, String cityId, String areaId, -// Integer userId, HttpServletResponse httpServletResponse) { -// -// -// List> results = new ArrayList<>(); -// if (CollectionUtils.isNotEmpty(ticketList)) -// { -// for (Map map : ticketList) -// { -// Map result = new HashMap<>(); -// result.put("createDate", map.get("CREATE_DATE") == null ? "" : DateUtil.getyyyy_MM_dd((Date)map.get("CREATE_DATE"))); //建档日期 -// result.put("name", map.get("NAME")); //姓名 -// result.put("buildWeek", map.get("YZ_NAME")); //建档孕周 -// result.put("hospitalName", map.get("HOSPITAL_NAME")); //建档机构 -// result.put("doctor",map.get("DOCTOR_NAME")); //建档医生 -// result.put("homeAddr", map.get("HOME_ADDR")); //居住地 -// result.put("hjAddr",map.get("HJ_ADDR")); //户籍地 -// result.put("telNo",map.get("TEL_NO")); //联系电话 -// results.add(result); -// } -// } -// -// Map cnames = new LinkedHashMap<>(); -// cnames.put("createDate", "建档日期"); //建档日期 -// cnames.put("name", "姓名"); //姓名 -// cnames.put("buildWeek", "建档孕周"); //建档孕周 -// cnames.put("hospitalName", "建档机构"); //建档机构 -// cnames.put("doctor","建档医生"); //建档医生 -// cnames.put("homeAddr","居住地"); //居住地 -// cnames.put("hjAddr","户籍地"); //户籍地 -// cnames.put("telNo","联系电话"); //联系电话 -// ResponseUtil.responseExcel(cnames,results,httpServletResponse); -// } + diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java index 5bcdc41..2f7d456 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java @@ -546,6 +546,16 @@ public class PatientFacade { patientsQuery.setFmAgeEnd(riskPatientsQueryRequest.getFmEndAge()); } + //建档孕周 + if (riskPatientsQueryRequest.getBuildWeekStart() != null) + { + patientsQuery.setBuildDaysStart(riskPatientsQueryRequest.getBuildWeekStart()*7); + } + + if (riskPatientsQueryRequest.getBuildWeekEnd() != null) + { + patientsQuery.setBuildDaysEnd((riskPatientsQueryRequest.getBuildWeekEnd() + 1) * 7 - 1); + } return patientsQuery; diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java index ded311c..f57351d 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java @@ -137,6 +137,27 @@ public class RiskPatientsQueryRequest extends BasePageQueryRequest { //分娩日期 private String fmTime; + + //建档孕周 + private Integer buildWeekStart; + private Integer buildWeekEnd; + + public Integer getBuildWeekStart() { + return buildWeekStart; + } + + public void setBuildWeekStart(Integer buildWeekStart) { + this.buildWeekStart = buildWeekStart; + } + + public Integer getBuildWeekEnd() { + return buildWeekEnd; + } + + public void setBuildWeekEnd(Integer buildWeekEnd) { + this.buildWeekEnd = buildWeekEnd; + } + public String getFmTime() { return fmTime; } -- 1.8.3.1