Commit e14767303369437e15c354437195f294652ba286
1 parent
e348ff650d
Exists in
master
and in
6 other branches
唐山滦县孕产妇健康管理登记表
Showing 3 changed files with 119 additions and 0 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java
View file @
e147673
| ... | ... | @@ -408,6 +408,69 @@ |
| 408 | 408 | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | + | |
| 412 | + public static void WriteTsLxExport(OutputStream out,List<Map<String, Object>> data){ | |
| 413 | + WritableWorkbook wwb; | |
| 414 | + try{ | |
| 415 | + wwb = Workbook.createWorkbook(out); | |
| 416 | + WritableSheet ws = wwb.createSheet("sheet", 0); // 创建一个工作表 | |
| 417 | + /** | |
| 418 | + * 设置单元格样式 | |
| 419 | + */ | |
| 420 | + WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); | |
| 421 | + WritableCellFormat wcf = new WritableCellFormat(wf); | |
| 422 | + ws.setRowView(0, 300); // 设置指定行高 | |
| 423 | + // 设置列宽 | |
| 424 | + for (int j = 0; j < 15; j++) | |
| 425 | + { | |
| 426 | + ws.setColumnView(j, 15); | |
| 427 | + } | |
| 428 | + //创建Excel标题格式 | |
| 429 | + ws.mergeCells(0, 0, 0, 1); | |
| 430 | + ws.addCell(new Label(0, 0, "编号")); | |
| 431 | + ws.mergeCells(1, 0, 1, 1); | |
| 432 | + ws.addCell(new Label(1, 0, "姓名")); | |
| 433 | + ws.mergeCells(2, 0, 2, 1); | |
| 434 | + ws.addCell(new Label(2, 0, "家庭住址")); | |
| 435 | + ws.mergeCells(3, 0, 3, 1); | |
| 436 | + ws.addCell(new Label(3, 0, "联系电话")); | |
| 437 | + ws.mergeCells(4, 0, 4, 1); | |
| 438 | + ws.addCell(new Label(4, 0, "末次月经")); | |
| 439 | + ws.mergeCells(5, 0, 10, 0); | |
| 440 | + ws.addCell(new Label(5, 0, "产前检查")); | |
| 441 | + ws.addCell(new Label(5, 1, "一")); | |
| 442 | + ws.addCell(new Label(6,1,"二")); | |
| 443 | + ws.addCell(new Label(7,1,"三")); | |
| 444 | + ws.addCell(new Label(8,1,"四")); | |
| 445 | + ws.addCell(new Label(9, 1, "五")); | |
| 446 | + ws.mergeCells(10, 0, 10, 1); | |
| 447 | + ws.addCell(new Label(10, 0, "产检统计")); | |
| 448 | + ws.mergeCells(11, 0, 11, 1); | |
| 449 | + ws.addCell(new Label(11, 0, "出院小结")); | |
| 450 | + ws.mergeCells(12, 0, 13, 0); | |
| 451 | + ws.addCell(new Label(12, 0, "产后访视")); | |
| 452 | + ws.addCell(new Label(12, 1, "7天内")); | |
| 453 | + ws.addCell(new Label(13, 1, "42天内")); | |
| 454 | + ws.mergeCells(14, 0, 14, 1); | |
| 455 | + ws.addCell(new Label(14,0,"备注")); | |
| 456 | + | |
| 457 | + int k = 0; | |
| 458 | + //填充数据 | |
| 459 | + for(int i = 0;i<data.size();i++){ | |
| 460 | + ws.addCell(new Label(k,i+2,"")); | |
| 461 | + k++; | |
| 462 | + } | |
| 463 | + | |
| 464 | + wwb.write(); | |
| 465 | + wwb.close(); | |
| 466 | + | |
| 467 | + }catch (Exception e){ | |
| 468 | + ExceptionUtils.catchException(e, e.getMessage()); | |
| 469 | + } | |
| 470 | + } | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 411 | 474 | // public static void main(String[] args) { |
| 412 | 475 | // ExcelUtil.writeExclFile("F:\\需求文档\\my.xls"); |
| 413 | 476 | // } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
e147673
| ... | ... | @@ -146,6 +146,22 @@ |
| 146 | 146 | patientFacade.exportAllPuer(patientsQueryRequest,loginState.getId(),response); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | + | |
| 150 | + /** | |
| 151 | + * 导出孕产妇健康管理登记表(唐山滦县) | |
| 152 | + * @param patientsQueryRequest | |
| 153 | + * @param request | |
| 154 | + * @return | |
| 155 | + */ | |
| 156 | + @RequestMapping(value = "/exportTsLxData", method = RequestMethod.GET) | |
| 157 | + @TokenRequired | |
| 158 | + public void exportTsLxData(@Valid RiskPatientsQueryRequest patientsQueryRequest,HttpServletRequest request,HttpServletResponse response) { | |
| 159 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 160 | + patientFacade.tsLxExport(patientsQueryRequest,loginState.getId(),response); | |
| 161 | + } | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 149 | 165 | /** |
| 150 | 166 | * 区县产妇统计 |
| 151 | 167 | * @param patientsQueryRequest |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
e147673
| ... | ... | @@ -25,6 +25,13 @@ |
| 25 | 25 | import com.lyms.platform.query.BabyModelQuery; |
| 26 | 26 | import com.lyms.platform.query.DataPermissionsModelQuery; |
| 27 | 27 | import com.lyms.platform.query.PatientsQuery; |
| 28 | +import jxl.Workbook; | |
| 29 | +import jxl.format.Colour; | |
| 30 | +import jxl.format.UnderlineStyle; | |
| 31 | +import jxl.write.WritableCellFormat; | |
| 32 | +import jxl.write.WritableFont; | |
| 33 | +import jxl.write.WritableSheet; | |
| 34 | +import jxl.write.WritableWorkbook; | |
| 28 | 35 | import org.apache.commons.collections.CollectionUtils; |
| 29 | 36 | import org.slf4j.Logger; |
| 30 | 37 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -1027,6 +1034,39 @@ |
| 1027 | 1034 | ExceptionUtils.catchException(e, e.getMessage()); |
| 1028 | 1035 | } |
| 1029 | 1036 | } |
| 1037 | + | |
| 1038 | + | |
| 1039 | + /** | |
| 1040 | + * | |
| 1041 | + *唐山(滦县)需求导出孕产妇健康管理登记表 | |
| 1042 | + * | |
| 1043 | + */ | |
| 1044 | + public void tsLxExport(RiskPatientsQueryRequest patientsQueryRequest, Integer userId, | |
| 1045 | + HttpServletResponse response){ | |
| 1046 | + response.setContentType("application/octet-stream"); | |
| 1047 | + response.setHeader("Content-Disposition", "attachment;fileName=" + "datas.xls"); | |
| 1048 | + try{ | |
| 1049 | + BaseListResponse listResponse = null; | |
| 1050 | + List<Map<String, Object>> datas = new ArrayList<>(); | |
| 1051 | + if (patientsQueryRequest.getQueryType() == 1) { | |
| 1052 | + //全部孕妇 | |
| 1053 | + listResponse = (BaseListResponse) queryHighRisk(patientsQueryRequest, null, 1, userId, null, Boolean.FALSE); | |
| 1054 | + List list = listResponse.getData(); | |
| 1055 | + | |
| 1056 | + }else if(patientsQueryRequest.getQueryType() == 2){ | |
| 1057 | + //全部产妇 | |
| 1058 | + | |
| 1059 | + } | |
| 1060 | + OutputStream out = response.getOutputStream(); | |
| 1061 | + ExcelUtil.WriteTsLxExport(out, datas); | |
| 1062 | + }catch (Exception e){ | |
| 1063 | + ExceptionUtils.catchException(e, e.getMessage()); | |
| 1064 | + } | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + } | |
| 1068 | + | |
| 1069 | + | |
| 1030 | 1070 | |
| 1031 | 1071 | |
| 1032 | 1072 | private String getLevel(List<Map> levels) { |