From 7577ba00b5823736fb95e665c3ab16e2807fdc85 Mon Sep 17 00:00:00 2001 From: Todking Date: Tue, 11 Jan 2022 15:10:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=AF=BC=E5=87=BA=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/ApsNoticeClientsServiceImpl.java | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeClientsServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeClientsServiceImpl.java index e3c9d6e97..4ea63c839 100644 --- a/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeClientsServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/apsKYC/domain/service/Impl/ApsNoticeClientsServiceImpl.java @@ -124,7 +124,7 @@ public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService { } private void setSheetContent(XSSFWorkbook xWorkbook, XSSFSheet xSheet, List apsNoticeClients) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //创建内容样式(头部以下的样式) CellStyle cs = xWorkbook.createCellStyle(); cs.setWrapText(true); @@ -161,31 +161,43 @@ public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService { userName = user.getString("username"); } } - switch (apsNoticeClients.get(i).getStatus()) { - case 0: - xCell2.setCellValue("未读"); - case 1: - xCell2.setCellValue("已读(" + userName + ":" + df.format(apsNoticeClients.get(i).getReadTime()) + ")"); - case 2: - xCell2.setCellValue("同意(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")"); - case 3: - xCell2.setCellValue("拒绝(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")"); + } + switch (apsNoticeClients.get(i).getStatus()) { + case 0: { + xCell2.setCellValue("未读"); + break; + } + case 1: { + xCell2.setCellValue("已读(" + userName + ":" + df.format(apsNoticeClients.get(i).getReadTime()) + ")"); + break; + } + case 2: { + xCell2.setCellValue("同意(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")"); + break; } - //设置第四列 - XSSFCell xCell3 = xRow.createCell(3); - xCell3.setCellStyle(cs); - switch (apsNoticeClients.get(i).getHandle()) { - case 0: - xCell3.setCellValue("未处理"); - case 1: - if (StringUtils.isNotBlank(apsNoticeClients.get(i).getModifier())) { - JSONObject modifier = managerMapper.findDetail(apsNoticeClients.get(i).getModifier()); - if (modifier != null) { - xCell3.setCellValue("已处理(" + modifier.getString("username") + ":" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")"); - } else { - xCell3.setCellValue("已处理(未知用户:" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")"); - } + case 3: { + xCell2.setCellValue("拒绝(" + userName + ":" + df.format(apsNoticeClients.get(i).getStatusTime()) + ")"); + break; + } + } + //设置第四列 + XSSFCell xCell3 = xRow.createCell(3); + xCell3.setCellStyle(cs); + switch (apsNoticeClients.get(i).getHandle()) { + case 0: { + xCell3.setCellValue("未处理"); + break; + } + case 1: { + if (StringUtils.isNotBlank(apsNoticeClients.get(i).getModifier())) { + JSONObject modifier = managerMapper.findDetail(apsNoticeClients.get(i).getModifier()); + if (modifier != null) { + xCell3.setCellValue("已处理(" + modifier.getString("username") + ":" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")"); + } else { + xCell3.setCellValue("已处理(未知用户:" + df.format(apsNoticeClients.get(i).getModifyTime()) + ")"); } + } + break; } } } @@ -195,7 +207,7 @@ public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService { private void setSheetHeader(XSSFWorkbook xWorkbook, XSSFSheet xSheet) { //设置表格的宽度 xSheet.setColumnWidth(0, 20 * 256); 中的数字 20 自行设置为自己适用的 xSheet.setColumnWidth(0, 10 * 256); - xSheet.setColumnWidth(1, 30 * 256); + xSheet.setColumnWidth(1, 25 * 256); xSheet.setColumnWidth(2, 40 * 256); xSheet.setColumnWidth(3, 40 * 256); //创建表格的样式