From a0e1b5dc36c135840d388a37d84bf19240f37ab1 Mon Sep 17 00:00:00 2001 From: chuang <994001556@qq.com> Date: Tue, 11 Apr 2023 18:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=8D=95=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E5=85=A5=E6=96=87=E4=BB=B6=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/jnpf/mobilePort/utils/FileCopy.java | 28 +++++++++++++------ .../resources/templates/export/paymentDoc.ftl | 6 ++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/mobilePort/utils/FileCopy.java b/SC-boot/linkage-scm/src/main/java/jnpf/mobilePort/utils/FileCopy.java index 38c0a7ba..df36640e 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/mobilePort/utils/FileCopy.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/mobilePort/utils/FileCopy.java @@ -12,10 +12,7 @@ import jnpf.purchaseorder.utils.VehiclePictureFolderUtils; import jnpf.util.FilePathUtil; import jnpf.util.JsonUtil; import jnpf.util.context.SpringContext; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.NumberToTextConverter; import org.springframework.util.FileCopyUtils; import org.springframework.web.multipart.MultipartFile; @@ -154,8 +151,8 @@ public class FileCopy { // System.out.println(objects1); List objects2 = reader.readColumn(0, 0, 1); // 公司名字 - String companyStr = String.valueOf(objects2.get(0)); - companyStr=companyStr.substring(0,companyStr.lastIndexOf("公司")+2); +// String companyStr = String.valueOf(objects2.get(0)); +// companyStr=companyStr.substring(0,companyStr.lastIndexOf("公司")+2); // 销售合同编码 String infoStr = String.valueOf(objects2.get(1)); @@ -182,7 +179,7 @@ public class FileCopy { Cell cell = row.createCell(19); - Cell cell1 = row.createCell(20); +// Cell cell1 = row.createCell(20); Cell cell2 = row.createCell(21); Cell cell3 = row.createCell(22); Cell cell4 = row.createCell(23); @@ -230,7 +227,7 @@ public class FileCopy { cell.setCellValue(String.valueOf(o1).equals("null") ? "" : JsonUtil.getListToJsonArray((List>)o1).toString()); cell4.setCellValue(String.valueOf(o2).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o2).toString()); - cell1.setCellValue(companyStr); +// cell1.setCellValue(companyStr); cell2.setCellValue(str); cell3.setCellValue(str3); cell5.setCellType(CellType.STRING); @@ -243,8 +240,21 @@ public class FileCopy { strCell1.setCellType(CellType.STRING); strCell1.setCellValue(FileCopy.setSteColumn(strCell1)); + + + if (strCell2.getCellType() == CellType.NUMERIC) { + //hssfCell.setCellType(1);//设置为String + //String str_temp = String.valueOf(hssfCell.getRichStringCellValue());//得到值 + DataFormatter dataFormatter = new DataFormatter(); + FormulaEvaluator fe = writer.getWorkbook() + .getCreationHelper() + .createFormulaEvaluator(); + String str_temp = dataFormatter.formatCellValue(strCell2, fe); + strCell2.setCellValue(str_temp); + }else { + strCell2.setCellValue(FileCopy.setSteColumn(strCell2)); + } strCell2.setCellType(CellType.STRING); - strCell2.setCellValue(FileCopy.setSteColumn(strCell2)); strCell3.setCellType(CellType.STRING); strCell3.setCellValue(FileCopy.setSteColumn(strCell3)); strCell4.setCellType(CellType.STRING); diff --git a/SC-boot/linkage-scm/src/main/resources/templates/export/paymentDoc.ftl b/SC-boot/linkage-scm/src/main/resources/templates/export/paymentDoc.ftl index 8889a53c..927cdb09 100644 --- a/SC-boot/linkage-scm/src/main/resources/templates/export/paymentDoc.ftl +++ b/SC-boot/linkage-scm/src/main/resources/templates/export/paymentDoc.ftl @@ -15,7 +15,7 @@
-

城市矿产请示

+

${customerName!"城市矿产"}请示

流程编号:QS-CSKC-2023-000000066723

@@ -28,7 +28,7 @@ class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label " style="text-align: center; background-color: rgb(231, 242, 251); color: black;">标题 ${customerName!""}的请示 + style="color: black;">${customerName!"城市矿产"}的请示 @@ -38,7 +38,7 @@ style="text-align: center; background-color: rgb(231, 242, 251); color: black;">拟稿单位 ${fullName!""} + style="color: black;">${fullName!"济钢集团/济钢城市矿产科技有限公司"} 拟稿日期