From ce9657d24c26839165c8ee513ab90a1460715c88 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Fri, 20 Oct 2017 15:24:52 +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 --- .../web/controller/AreaCountController.java | 34 ++++++++ .../operate/web/facade/AreaCountFacade.java | 96 +++++++++++++--------- 2 files changed, 92 insertions(+), 38 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java index e7333dd..fe5b820 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java @@ -131,5 +131,39 @@ public class AreaCountController extends BaseController { cityId, areaId, page, limit, loginState.getId(),nodeName); } + /** + * 产检节点明细导出 + * @param request + * @param time + * @param hospitalId + * @param provinceId + * @param cityId + * @param areaId + * @param page + * @param limit + * @param nodeType + * @param nodeName + * @return + */ + @RequestMapping(method = RequestMethod.GET,value = "/getCheckDetailExport") + @TokenRequired + public void getCheckDetailExport(HttpServletRequest request, + HttpServletResponse response, + @RequestParam(required = false) String time, + @RequestParam(required = false)String hospitalId, + @RequestParam(required = false)String provinceId, + @RequestParam(required = false)String cityId, + @RequestParam(required = false)String areaId, + @RequestParam(required = false) Integer page, + @RequestParam(required = false) Integer limit, + @RequestParam(required = false)Integer nodeType, + @RequestParam(required = false)Integer nodeName + ) + { + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); + areaCountFacade.getCheckDetailExport(nodeType, time, hospitalId, provinceId, + cityId, areaId, loginState.getId(),response, nodeName); + } + } \ No newline at end of file diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java index 3b1e34a..ee94546 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java @@ -577,8 +577,20 @@ public class AreaCountFacade { String provinceId, String cityId, String areaId, Integer page, Integer limit, Integer userId, Integer nodeName) { + AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); + List results = getCheckDetailData( nodeType, time, hospitalId, + provinceId, cityId, areaId, + page, limit, userId, nodeName, "true",antExRecordQuery); + + return new BaseListResponse().setData(results).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setPageInfo(antExRecordQuery.getPageInfo()); + } + public List getCheckDetailData(Integer nodeType, String time, String hospitalId, + String provinceId, String cityId, String areaId, + Integer page, Integer limit, Integer userId, Integer nodeName,String needPage, AntExRecordQuery antExRecordQuery) + { + List hospitalIds = new ArrayList<>(); if (StringUtils.isNotEmpty(hospitalId)) { hospitalIds.add(hospitalId); @@ -599,13 +611,13 @@ public class AreaCountFacade { } } - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); + antExRecordQuery.setBuildTimeStart(startTime); antExRecordQuery.setBuildTimeEnd(endTime); antExRecordQuery.setHospitalList(hospitalIds); antExRecordQuery.setPage(page); antExRecordQuery.setLimit(limit); - antExRecordQuery.setNeed("true"); + antExRecordQuery.setNeed(needPage); if (nodeType != null && nodeType == 1) { antExRecordQuery.setIsFirst(nodeType); @@ -669,7 +681,7 @@ public class AreaCountFacade { end +=batchSize; end = end > list.size() ? list.size() : end; - final List tempList = list.subList(i,end); + final List tempList = list.subList(i,end); Callable callable = new Callable>() { @Override public List call() throws Exception { @@ -781,8 +793,49 @@ public class AreaCountFacade { } } } + return results; + } - return new BaseListResponse().setData(results).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setPageInfo(antExRecordQuery.getPageInfo()); + + //导出 + public void getCheckDetailExport(Integer nodeType, String time, String hospitalId, + String provinceId, String cityId, String areaId, + Integer userId, HttpServletResponse httpServletResponse,Integer nodeName) { + + AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); + List ticketList = getCheckDetailData( nodeType, time, hospitalId, + provinceId, cityId, areaId, + null, null, userId, nodeName, null,antExRecordQuery); + + List> results = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(ticketList)) + { + for (Map map : ticketList) + { + Map result = new HashMap<>(); + result.put("examineDate", map.get("EXAMINE_DATE") == null ? "" : DateUtil.getyyyy_MM_dd((Date)map.get("EXAMINE_DATE"))); //产检日期 + result.put("name", map.get("NAME")); //姓名 + result.put("checkWeek", map.get("YZ_NAME")); //产检孕周 + result.put("examineHistoryNum", map.get("EXAMINE_HISTORY_NUM")); //产检第次 + result.put("examineHospital",map.get("EXAMINE_HOSPITAL")); //产检机构 + result.put("doctorName",map.get("DOCTOR_NAME")); //产检医生 + result.put("jdHospital",map.get("JD_HOSPITAL")); //建档机构 + result.put("telNo",map.get("TEL_NO")); //联系电话 + results.add(result); + } + } + + Map cnames = new LinkedHashMap<>(); + cnames.put("examineDate", "产检日期"); //产检日期 + cnames.put("name", "姓名"); //姓名 + cnames.put("checkWeek", "产检孕周"); //产检孕周 + cnames.put("examineHistoryNum", "产检第次"); //产检第次 + cnames.put("examineHospital","产检机构"); //产检机构 + cnames.put("doctorName","产检医生"); //产检医生 + cnames.put("jdHospital","建档机构"); //建档机构 + cnames.put("telNo","联系电话"); //联系电话 + + ResponseUtil.responseExcel(cnames,results,httpServletResponse); } } @@ -793,40 +846,7 @@ public class AreaCountFacade { -// public void getCheckDetailExport(Integer pointType, String time, String hospitalId, -// String provinceId, String cityId, String areaId, -// Integer userId, HttpServletResponse httpServletResponse,Integer nodeName) { -// -// List> results = new ArrayList<>(); -// if (CollectionUtils.isNotEmpty(ticketList)) -// { -// for (Map map : ticketList) -// { -// Map result = new HashMap<>(); -// result.put("examineDate", map.get("EXAMINE_DATE") == null ? "" : DateUtil.getyyyy_MM_dd((Date)map.get("EXAMINE_DATE"))); //产检日期 -// result.put("name", map.get("NAME")); //姓名 -// result.put("checkWeek", map.get("YZ_NAME")); //产检孕周 -// result.put("examineHistoryNum", map.get("EXAMINE_HISTORY_NUM")); //产检第次 -// result.put("examineHospital",map.get("EXAMINE_HOSPITAL")); //产检机构 -// result.put("doctorName",map.get("DOCTOR_NAME")); //产检医生 -// result.put("jdHospital",map.get("JD_HOSPITAL")); //建档机构 -// result.put("telNo",map.get("TEL_NO")); //联系电话 -// results.add(result); -// } -// } -// -// Map cnames = new LinkedHashMap<>(); -// cnames.put("examineDate", "产检日期"); //产检日期 -// cnames.put("name", "姓名"); //姓名 -// cnames.put("checkWeek", "产检孕周"); //产检孕周 -// cnames.put("examineHistoryNum", "产检第次"); //产检第次 -// cnames.put("examineHospital","产检机构"); //产检机构 -// cnames.put("doctorName","产检医生"); //产检医生 -// cnames.put("jdHospital","建档机构"); //建档机构 -// cnames.put("telNo","联系电话"); //联系电话 -// -// ResponseUtil.responseExcel(cnames,results,httpServletResponse); -// } + -- 1.8.3.1