Commit 48a608c03135739b58045a4d2e86cd6ebaa81d0f
1 parent
6efa4e5826
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 85 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
48a608c
... | ... | @@ -336,6 +336,32 @@ |
336 | 336 | patientFacade.exportAllPuer(patientsQueryRequest, loginState.getId(), response); |
337 | 337 | } |
338 | 338 | |
339 | + @RequestMapping(value = "/exportAreaData", method = RequestMethod.GET) | |
340 | + @TokenRequired | |
341 | + public void exportAreaData(@Valid RiskPatientsQueryRequest patientsQueryRequest, HttpServletRequest request, HttpServletResponse response) { | |
342 | + | |
343 | + | |
344 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
345 | + patientsQueryRequest.setFmHospital(patientsQueryRequest.gethId()); | |
346 | + patientsQueryRequest.sethId(null); | |
347 | + | |
348 | + patientsQueryRequest.setFmWeekStart(patientsQueryRequest.getStartDueWeek()); | |
349 | + patientsQueryRequest.setFmWeekEnd(patientsQueryRequest.getEndDueWeek()); | |
350 | + patientsQueryRequest.setStartDueWeek(null); | |
351 | + patientsQueryRequest.setEndDueWeek(null); | |
352 | + | |
353 | + patientsQueryRequest.setFmTime(patientsQueryRequest.getFmTime()); | |
354 | + patientsQueryRequest.setBuildTime(patientsQueryRequest.getBuildTime()); | |
355 | + | |
356 | + patientsQueryRequest.setFmStartAge(patientsQueryRequest.getStartAge()); | |
357 | + patientsQueryRequest.setFmEndAge(patientsQueryRequest.getEndAge()); | |
358 | + patientsQueryRequest.setStartAge(null); | |
359 | + patientsQueryRequest.setEndAge(null); | |
360 | + | |
361 | + | |
362 | + patientFacade.exportAreaData(patientsQueryRequest, loginState.getId(), response); | |
363 | + } | |
364 | + | |
339 | 365 | /** |
340 | 366 | * 诸城重点孕妇登记表导出 |
341 | 367 | * |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
48a608c
... | ... | @@ -1870,6 +1870,8 @@ |
1870 | 1870 | data.put("age", rp.getAge()); |
1871 | 1871 | data.put("dueWeek", rp.getDueWeek()); |
1872 | 1872 | data.put("cTime", rp.getcTime()); |
1873 | + data.put("rLevel", getLevel(rp.getrLevel())); | |
1874 | + data.put("rFactor", rp.getrFactor()); | |
1873 | 1875 | data.put("nextCheckTime", rp.getNextCheckTime()); |
1874 | 1876 | data.put("cTimes", rp.getcTimes()); |
1875 | 1877 | data.put("cHTimes", rp.getcHTimes()); |
... | ... | @@ -1884,6 +1886,8 @@ |
1884 | 1886 | cnames.put("name", "姓名"); |
1885 | 1887 | cnames.put("age", "分娩年龄"); |
1886 | 1888 | cnames.put("dueWeek", "分娩日期"); |
1889 | + cnames.put("rLevel", "高危等级"); | |
1890 | + cnames.put("rFactor", "高危风险因素"); | |
1887 | 1891 | cnames.put("cTime", "产后时间"); |
1888 | 1892 | cnames.put("nextCheckTime", "预约下次复查"); |
1889 | 1893 | cnames.put("cTimes", "总复查次数"); |
... | ... | @@ -1920,6 +1924,61 @@ |
1920 | 1924 | cnames.put("registerAddr", "户籍地"); |
1921 | 1925 | } |
1922 | 1926 | } |
1927 | + | |
1928 | + | |
1929 | + OutputStream out = response.getOutputStream(); | |
1930 | + ExcelUtil.toExcel(out, datas, cnames); | |
1931 | + } catch (Exception e) { | |
1932 | + ExceptionUtils.catchException(e, e.getMessage()); | |
1933 | + } | |
1934 | + } | |
1935 | + | |
1936 | + | |
1937 | + public void exportAreaData(RiskPatientsQueryRequest patientsQueryRequest, Integer userId, | |
1938 | + HttpServletResponse response) { | |
1939 | + response.setContentType("application/octet-stream"); | |
1940 | + response.setHeader("Content-Disposition", "attachment;fileName=" + "datas.xls"); | |
1941 | + try { | |
1942 | + BaseListResponse listResponse = null; | |
1943 | + List<Map<String, Object>> datas = new ArrayList<>(); | |
1944 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
1945 | + listResponse = (BaseListResponse) queryHighRisk(patientsQueryRequest, null, 3, userId, "true", Boolean.TRUE); | |
1946 | + List list = listResponse.getData(); | |
1947 | + for (Object obj : list) { | |
1948 | + Map<String, Object> data = new HashMap<>(); | |
1949 | + QuanChanResult rp = (QuanChanResult) obj; | |
1950 | + data.put("name", rp.getName()); | |
1951 | + data.put("age", rp.getAge()); | |
1952 | + data.put("dueWeek", rp.getDueWeek()); | |
1953 | + data.put("cTime", rp.getcTime()); | |
1954 | + data.put("rLevel", getLevel(rp.getrLevel())); | |
1955 | + data.put("rFactor", rp.getrFactor()); | |
1956 | + data.put("nextCheckTime", rp.getNextCheckTime()); | |
1957 | + data.put("cTimes", rp.getcTimes()); | |
1958 | + data.put("cHTimes", rp.getcHTimes()); | |
1959 | + data.put("checkDoctor", rp.getCheckDoctor()); | |
1960 | + data.put("lName", rp.getlName()); | |
1961 | + data.put("phone", patientsQueryRequest.getIsEncry() == 0 ? rp.getRealPhone() : com.lyms.platform.common.utils.StringUtils.encryPhone(rp.getRealPhone())); | |
1962 | + data.put("addr", rp.getAddr()); | |
1963 | + data.put("serviceType", "服务类型"); | |
1964 | + data.put("serviceStatus", "服务类型"); | |
1965 | + datas.add(data); | |
1966 | + } | |
1967 | + cnames.put("name", "姓名"); | |
1968 | + cnames.put("age", "分娩年龄"); | |
1969 | + cnames.put("dueWeek", "分娩日期"); | |
1970 | + cnames.put("cTime", "产后时间"); | |
1971 | + cnames.put("rLevel", "高危等级"); | |
1972 | + cnames.put("rFactor", "高危风险因素"); | |
1973 | + cnames.put("nextCheckTime", "预约下次复查"); | |
1974 | + cnames.put("cTimes", "总复查次数"); | |
1975 | + cnames.put("cHTimes", "本院复查次数"); | |
1976 | + cnames.put("checkDoctor", "检查医生"); | |
1977 | + cnames.put("phone", "联系方式"); | |
1978 | + cnames.put("lName", "登记人"); | |
1979 | + cnames.put("addr", "居住地"); | |
1980 | + cnames.put("serviceType", "服务类型"); | |
1981 | + cnames.put("serviceStatus", "服务状态"); | |
1923 | 1982 | |
1924 | 1983 | |
1925 | 1984 | OutputStream out = response.getOutputStream(); |