From 5fed0043691f57449e9f2bb4b8fa5e0597a44f7a Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 25 Jul 2022 15:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9=E9=87=8F=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BatchTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BatchTest.java b/src/BatchTest.java index 84bbfcb..9447ffc 100644 --- a/src/BatchTest.java +++ b/src/BatchTest.java @@ -1,5 +1,6 @@ import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.util.DateUtils; import com.alibaba.excel.util.StringUtils; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSONObject; @@ -10,6 +11,7 @@ import org.springframework.web.client.RestTemplate; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.net.URLEncoder; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; @@ -34,7 +36,7 @@ public class BatchTest { String[] headArr = new String[]{"ID", "地址", "省份", "城市", "区域", "乡镇街道", "街道编码", "居委村委", "标准化地址", "是否涉农", "地址验证", "经度", "维度", "百度经度", "百度纬度"}; List> head = this.formatHead(headArr); // 默认两行数据 - String aimFilePath = file.substring(0, file.lastIndexOf(".xlsx")) + "结果.xlsx" ; + String aimFilePath = file.substring(0, file.lastIndexOf(".xlsx")) + "结果" + DateUtils.format(new Date(), "yyyyMMddHHmm") + ".xlsx" ; List> dataList = ExcelUtils.read(new FileInputStream(file)); if (dataList.size() > 1000000) { throw new RuntimeException("该批次数据量超过1000000条");