From e14767303369437e15c354437195f294652ba286 Mon Sep 17 00:00:00 2001 From: gengxiaokai Date: Thu, 1 Nov 2018 17:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=90=E5=B1=B1=E6=BB=A6=E5=8E=BF=E5=AD=95?= =?UTF-8?q?=E4=BA=A7=E5=A6=87=E5=81=A5=E5=BA=B7=E7=AE=A1=E7=90=86=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/common/utils/ExcelUtil.java | 63 ++++++++++++++++++++++ .../web/controller/PuerperaManageController.java | 16 ++++++ .../platform/operate/web/facade/PatientFacade.java | 40 ++++++++++++++ 3 files changed, 119 insertions(+) diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java b/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java index bf3b80a..d6de6aa 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java @@ -408,6 +408,69 @@ public class ExcelUtil } + + public static void WriteTsLxExport(OutputStream out,List> data){ + WritableWorkbook wwb; + try{ + wwb = Workbook.createWorkbook(out); + WritableSheet ws = wwb.createSheet("sheet", 0); // 创建一个工作表 + /** + * 设置单元格样式 + */ + WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); + WritableCellFormat wcf = new WritableCellFormat(wf); + ws.setRowView(0, 300); // 设置指定行高 + // 设置列宽 + for (int j = 0; j < 15; j++) + { + ws.setColumnView(j, 15); + } + //创建Excel标题格式 + ws.mergeCells(0, 0, 0, 1); + ws.addCell(new Label(0, 0, "编号")); + ws.mergeCells(1, 0, 1, 1); + ws.addCell(new Label(1, 0, "姓名")); + ws.mergeCells(2, 0, 2, 1); + ws.addCell(new Label(2, 0, "家庭住址")); + ws.mergeCells(3, 0, 3, 1); + ws.addCell(new Label(3, 0, "联系电话")); + ws.mergeCells(4, 0, 4, 1); + ws.addCell(new Label(4, 0, "末次月经")); + ws.mergeCells(5, 0, 10, 0); + ws.addCell(new Label(5, 0, "产前检查")); + ws.addCell(new Label(5, 1, "一")); + ws.addCell(new Label(6,1,"二")); + ws.addCell(new Label(7,1,"三")); + ws.addCell(new Label(8,1,"四")); + ws.addCell(new Label(9, 1, "五")); + ws.mergeCells(10, 0, 10, 1); + ws.addCell(new Label(10, 0, "产检统计")); + ws.mergeCells(11, 0, 11, 1); + ws.addCell(new Label(11, 0, "出院小结")); + ws.mergeCells(12, 0, 13, 0); + ws.addCell(new Label(12, 0, "产后访视")); + ws.addCell(new Label(12, 1, "7天内")); + ws.addCell(new Label(13, 1, "42天内")); + ws.mergeCells(14, 0, 14, 1); + ws.addCell(new Label(14,0,"备注")); + + int k = 0; + //填充数据 + for(int i = 0;i> datas = new ArrayList<>(); + if (patientsQueryRequest.getQueryType() == 1) { + //全部孕妇 + listResponse = (BaseListResponse) queryHighRisk(patientsQueryRequest, null, 1, userId, null, Boolean.FALSE); + List list = listResponse.getData(); + + }else if(patientsQueryRequest.getQueryType() == 2){ + //全部产妇 + + } + OutputStream out = response.getOutputStream(); + ExcelUtil.WriteTsLxExport(out, datas); + }catch (Exception e){ + ExceptionUtils.catchException(e, e.getMessage()); + } + + + } + + + + private String getLevel(List levels) { String str = ""; -- 1.8.3.1