From 2aeef5a79b2ce0ad5423a992dec76a2ac0f54c17 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Mon, 30 Dec 2024 14:34:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=B0=83=E6=95=B4=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xinelu/common/utils/poi/ExcelUtil.java | 4 +++- .../UploadRobotPublishRecordVo.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/postdischarge-common/src/main/java/com/xinelu/common/utils/poi/ExcelUtil.java b/postdischarge-common/src/main/java/com/xinelu/common/utils/poi/ExcelUtil.java index e26e3452..2369586a 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/utils/poi/ExcelUtil.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/utils/poi/ExcelUtil.java @@ -568,6 +568,8 @@ public class ExcelUtil { if (!styles.containsKey(key)) { CellStyle style = wb.createCellStyle(); style = wb.createCellStyle(); + //自动换行 + //style.setWrapText(true); style.setAlignment(excel.align()); style.setVerticalAlignment(VerticalAlignment.CENTER); style.setBorderRight(BorderStyle.THIN); @@ -677,7 +679,7 @@ public class ExcelUtil { public Cell addCell(Excel attr, Row row, T vo, Field field, int column) { Cell cell = null; try { - // 设置行高 + // 设置行高 (自动换行注释掉) row.setHeight(maxHeight); // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. if (attr.isExport()) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/UploadRobotPublishRecordVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/UploadRobotPublishRecordVo.java index 644c498a..67edd4f0 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/UploadRobotPublishRecordVo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/UploadRobotPublishRecordVo.java @@ -47,7 +47,7 @@ public class UploadRobotPublishRecordVo { */ @ApiModelProperty(value = "就诊时间,格式:yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "就诊时间", width = 30, dateFormat = "yyyy-MM-dd") + @Excel(name = "就诊时间", dateFormat = "yyyy-MM-dd") private LocalDateTime visitDate; /** @@ -66,18 +66,18 @@ public class UploadRobotPublishRecordVo { * 患者姓名 */ @ApiModelProperty(value = "患者姓名") - @Excel(name = "姓名") + @Excel(name = "姓名", width = 10) private String patientName; /** * 患者电话 */ @ApiModelProperty(value = "患者电话") - @Excel(name = "联系电话") + @Excel(name = "联系电话", width = 12) private String patientPhone; @ApiModelProperty(value = "年龄") - @Excel(name = "年龄") + @Excel(name = "年龄", width = 8) private Integer age; /** @@ -98,7 +98,7 @@ public class UploadRobotPublishRecordVo { * 调查分数 */ @ApiModelProperty(value = "调查分数") - @Excel(name = "调查分数") + @Excel(name = "调查分数", width = 8) private BigDecimal totalScore; /** @@ -133,7 +133,7 @@ public class UploadRobotPublishRecordVo { */ @ApiModelProperty(value = "执行时间,格式:yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "随访时间", width = 30, dateFormat = "yyyy-MM-dd") + @Excel(name = "随访时间", dateFormat = "yyyy-MM-dd") private LocalDateTime nodePlanTime; /** @@ -147,8 +147,8 @@ public class UploadRobotPublishRecordVo { * 抽样时间 */ @ApiModelProperty(value = "抽样时间") - @Excel(name = "抽样时间") - private String SampleTime; + @Excel(name = "抽样时间", dateFormat = "yyyy-MM-dd") + private LocalDateTime SampleTime; /** * 话术表 ID