diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml b/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml
index 607d9855..bf0c5abb 100644
--- a/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml
@@ -100,8 +100,17 @@
activation
1.1.1
-
-
+
+
+ net.sourceforge.javacsv
+ javacsv
+ 2.0
+
+
+ de.siegmar
+ fastcsv
+ 2.2.1
+
diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventory.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventory.java
new file mode 100644
index 00000000..95c4e11a
--- /dev/null
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventory.java
@@ -0,0 +1,59 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.supervise.portal.biz.gdinventory;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yxt.common.core.domain.EntityWithId;
+import lombok.Data;
+
+/**
+ * Project: yxt_supervise
+ * File: GdInventory.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdInventory
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 19:59
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Data
+@TableName("gd_inventory")
+public class GdInventory extends EntityWithId {
+ private String orgCode; // 企业组织机构代码证
+ private String warehouseCode; // 仓库/门店编号
+ private String warehouseName; // 仓库/门店名称
+ private String prodCode; // 商品编码
+ private String prodBarCode; // 商品条码
+ private String prodName; // 商品名称
+ private int warehouseType; // 仓库类型
+ private int prodNum; // 商品数量
+ private double prodValue; // 商品货值
+ private String suppliderName; // 供应商
+ private String datadate; // 数据日期
+}
diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryMapper.java
new file mode 100644
index 00000000..7d29ce57
--- /dev/null
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryMapper.java
@@ -0,0 +1,46 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.supervise.portal.biz.gdinventory;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * Project: yxt_supervise
+ * File: GdInventoryMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdInventoryMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 20:30
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Mapper
+public interface GdInventoryMapper extends BaseMapper {
+}
diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOk.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOk.java
new file mode 100644
index 00000000..01f0bfe1
--- /dev/null
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOk.java
@@ -0,0 +1,59 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.supervise.portal.biz.gdinventory;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yxt.common.core.domain.EntityWithId;
+import lombok.Data;
+
+/**
+ * Project: yxt_supervise
+ * File: GdInventoryOk.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdInventoryOk
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 20:17
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Data
+@TableName("gd_inventory_ok")
+public class GdInventoryOk extends EntityWithId {
+ private String orgCode; // 企业组织机构代码证
+ private String warehouseCode; // 仓库/门店编号
+ private String warehouseName; // 仓库/门店名称
+ private String prodCode; // 商品编码
+ private String prodBarCode; // 商品条码
+ private String prodName; // 商品名称
+ private int warehouseType; // 仓库类型
+ private int prodNum; // 商品数量
+ private double prodValue; // 商品货值
+ private String suppliderName; // 供应商
+ private String datadate; // 数据日期
+}
diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java
new file mode 100644
index 00000000..b6903fbd
--- /dev/null
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java
@@ -0,0 +1,46 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.supervise.portal.biz.gdinventory;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * Project: yxt_supervise
+ * File: GdInventoryOkMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdInventoryOkMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 20:31
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Mapper
+public interface GdInventoryOkMapper extends BaseMapper {
+}
diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java
new file mode 100644
index 00000000..b3ad0899
--- /dev/null
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java
@@ -0,0 +1,46 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.supervise.portal.biz.gdinventory;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * Project: yxt_supervise
+ * File: GdInventoryOkService.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdInventoryOkService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 20:35
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Service
+public class GdInventoryOkService extends ServiceImpl {
+}
diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryRest.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryRest.java
new file mode 100644
index 00000000..3af69cae
--- /dev/null
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryRest.java
@@ -0,0 +1,64 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' /| |// '. *
+ * / /||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | /\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.supervise.portal.biz.gdinventory;
+
+import com.yxt.common.core.result.ResultBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Project: yxt_supervise
+ * File: GdInventoryRest.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdInventoryRest
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 18:37
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@RestController("com.yxt.supervise.portal.biz.gdinventory.GdInventoryRest")
+@RequestMapping("/gd")
+public class GdInventoryRest {
+
+ @Autowired
+ private GdInventoryService gdInventoryService;
+
+ @GetMapping("/implInventory")
+ public ResultBean implInventory() {
+
+ // gdInventoryService.doCheck();
+ // gdInventoryService.importFromCsvFilePathHutool("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.csv");
+ // gdInventoryService.importFromCsvFilePathFastCsv("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.csv");
+ // gdInventoryService.importFromCsvFilePathJavaCsv("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.csv");
+ gdInventoryService.importFromXlsx("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.xlsx");
+ return ResultBean.fireSuccess();
+ }
+}
diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java
new file mode 100644
index 00000000..a79b4f7c
--- /dev/null
+++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java
@@ -0,0 +1,330 @@
+/*********************************************************
+ *********************************************************
+ ******************** *******************
+ ************* ************
+ ******* _oo0oo_ *******
+ *** o8888888o ***
+ * 88" . "88 *
+ * (| -_- |) *
+ * 0\ = /0 *
+ * ___/`---'\___ *
+ * .' \\| |// '. *
+ * / \\||| : |||// \ *
+ * / _||||| -:- |||||- \ *
+ * | | \\\ - /// | | *
+ * | \_| ''\---/'' |_/ | *
+ * \ .-\__ '-' ___/-. / *
+ * ___'. .' /--.--\ `. .'___ *
+ * ."" '< `.___\_<|>_/___.' >' "". *
+ * | | : `- \`.;`\ _ /`;.`/ - ` : | | *
+ * \ \ `_. \_ __\ /__ _/ .-` / / *
+ * =====`-.____`.___ \_____/___.-`___.-'===== *
+ * `=---=' *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
+ *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
+ *********************************************************/
+package com.yxt.supervise.portal.biz.gdinventory;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.text.csv.*;
+import cn.hutool.poi.excel.ExcelUtil;
+import cn.hutool.poi.excel.sax.handler.RowHandler;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yxt.supervise.portal.extexcel.CsvTool;
+import com.yxt.supervise.portal.extexcel.ExcelTool;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Project: yxt_supervise
+ * File: GdInventoryService.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdInventoryService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 20:34
+ *
+ * @author liupopo
+ * @version 1.0
+ * @since 1.0
+ */
+@Service
+public class GdInventoryService extends ServiceImpl {
+
+ private static List codeList = null;
+
+ @Autowired
+ private GdRescategoryProdService gdRescategoryProdService;
+ @Autowired
+ private GdInventoryOkService gdInventoryOkService;
+
+ public void doCheck() {
+
+ if (codeList == null) {
+ codeList = gdRescategoryProdService.listCode();
+ }
+
+ List list = super.list();
+ long ll = list.size();
+ int x = 0;
+ int y = 0;
+ int num = 0;
+ List okList = new ArrayList<>();
+
+ for (GdInventory entity : list) {
+ if (codeList.contains(entity.getProdCode().trim())) {
+ GdInventoryOk ok = new GdInventoryOk();
+ BeanUtil.copyProperties(entity, ok, "id");
+ // gdInventoryOkService.save(ok);
+
+ okList.add(ok);
+ if (500 == num) {
+ gdInventoryOkService.saveBatch(okList);
+ num = 0;
+ okList.clear();
+ } else {
+ num++;
+ }
+
+ x++;
+ System.out.println("XX " + entity.getProdCode() + "-" + entity.getProdName() + "size:" + ll + ",X:" + x + ",Y:" + y);
+ } else {
+ y++;
+ System.out.println("-" + entity.getProdCode() + "-" + entity.getProdName() + "size:" + ll + ",X:" + x + ",Y:" + y);
+ }
+
+ }
+ if (okList != null && !okList.isEmpty()) {
+ gdInventoryOkService.saveBatch(okList);
+ }
+ }
+
+ public void importFromCsvFilePathFastCsv(String filePath) {
+
+ long millis = System.currentTimeMillis();
+ de.siegmar.fastcsv.reader.CsvReader red = null;
+ try {
+ red = de.siegmar.fastcsv.reader.CsvReader.builder().build(Paths.get(filePath), Charset.forName("GB2312"));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ Iterator iterator = red.stream().iterator();
+ int x = 0;
+ int num = 0;
+ List toInsertList = new ArrayList<>();
+ while (iterator.hasNext()) {
+ de.siegmar.fastcsv.reader.CsvRow r = iterator.next();
+ if (x > 0) {
+ GdInventory gd = createGdInventoryFromRowFastCsv(r);
+ toInsertList.add(gd);
+ if (800 == num) {
+ this.saveBatch(toInsertList);
+ num = 0;
+ toInsertList.clear();
+ } else {
+ num++;
+ }
+ }
+ x++;
+ System.out.println(",X:" + x);
+
+ }
+ if (toInsertList != null && !toInsertList.isEmpty()) {
+ this.saveBatch(toInsertList);
+ }
+
+ System.out.println("用时:" + (System.currentTimeMillis() - millis));
+ }
+
+ private GdInventory createGdInventoryFromRowFastCsv(de.siegmar.fastcsv.reader.CsvRow r) {
+ GdInventory gd = new GdInventory();
+ gd.setOrgCode(r.getField(0)); // 企业组织机构代码证
+ gd.setWarehouseCode(r.getField(1)); // 仓库/门店编号
+ gd.setWarehouseName(r.getField(2)); // 仓库/门店名称
+ gd.setProdCode(r.getField(3)); // 商品编码
+ gd.setProdBarCode(r.getField(4)); // 商品条码
+ gd.setProdName(r.getField(5)); // 商品名称
+ gd.setWarehouseType(CsvTool.readIntegerFastCsv(r, 6)); // 仓库类型
+ gd.setProdNum(CsvTool.readIntegerFastCsv(r, 7)); // 商品数量
+ gd.setProdValue(CsvTool.readDoubleFastCsv(r, 8)); // 商品货值
+ gd.setSuppliderName(r.getField(9)); // 供应商
+ gd.setDatadate(r.getField(10)); // 数据日期
+ return gd;
+ }
+
+
+ public void importFromCsvFilePathJavaCsv(String filePath) {
+
+ long millis = System.currentTimeMillis();
+ int x = 0;
+ int num = 0;
+ List toInsertList = new ArrayList<>();
+
+ try {
+ com.csvreader.CsvReader r = new com.csvreader.CsvReader(filePath, ',', Charset.forName("GBK"));
+ //读取表头
+ r.readHeaders();
+ //逐条读取记录,直至读完
+ while (r.readRecord()) {
+ GdInventory gd = createGdInventoryFromRowJavaCsv(r);
+ toInsertList.add(gd);
+ if (800 == num) {
+ this.saveBatch(toInsertList);
+ num = 0;
+ toInsertList.clear();
+ } else {
+ num++;
+ }
+ x++;
+ System.out.println(",X:" + x);
+
+ }
+ r.close();
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException(e);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+
+ if (toInsertList != null && !toInsertList.isEmpty()) {
+ this.saveBatch(toInsertList);
+ }
+
+ System.out.println("用时:" + (System.currentTimeMillis() - millis));
+ }
+
+ private GdInventory createGdInventoryFromRowJavaCsv(com.csvreader.CsvReader r) throws IOException {
+ GdInventory gd = new GdInventory();
+ gd.setOrgCode(r.get(0)); // 企业组织机构代码证
+ gd.setWarehouseCode(r.get(1)); // 仓库/门店编号
+ gd.setWarehouseName(r.get(2)); // 仓库/门店名称
+ gd.setProdCode(r.get(3)); // 商品编码
+ gd.setProdBarCode(r.get(4)); // 商品条码
+ gd.setProdName(r.get(5)); // 商品名称
+ gd.setWarehouseType(CsvTool.readIntegerJavaCsv(r, 6)); // 仓库类型
+ gd.setProdNum(CsvTool.readIntegerJavaCsv(r, 7)); // 商品数量
+ gd.setProdValue(CsvTool.readDoubleJavaCsv(r, 8)); // 商品货值
+ gd.setSuppliderName(r.get(9)); // 供应商
+ gd.setDatadate(r.get(10)); // 数据日期
+ return gd;
+ }
+
+
+ public void importFromCsvFilePathHutool(String filePath) {
+
+ long millis = System.currentTimeMillis();
+ CsvReader red = CsvUtil.getReader();
+ CsvData read = red.read(FileUtil.file(filePath));
+ // read.getHeader();
+ Iterator iterator = read.iterator();
+ int x = 0;
+ int num = 0;
+ List toInsertList = new ArrayList<>();
+ while (iterator.hasNext()) {
+ CsvRow r = iterator.next();
+ if (x > 0) {
+ GdInventory gd = createGdInventoryFromRowHutool(r);
+ toInsertList.add(gd);
+ if (800 == num) {
+ this.saveBatch(toInsertList);
+ num = 0;
+ toInsertList.clear();
+ } else {
+ num++;
+ }
+ }
+ x++;
+ System.out.println(",X:" + x);
+
+ }
+ if (toInsertList != null && !toInsertList.isEmpty()) {
+ this.saveBatch(toInsertList);
+ }
+
+ System.out.println("用时:" + (System.currentTimeMillis() - millis));
+ }
+
+ private GdInventory createGdInventoryFromRowHutool(CsvRow r) {
+ GdInventory gd = new GdInventory();
+ gd.setOrgCode(r.get(0)); // 企业组织机构代码证
+ gd.setWarehouseCode(r.get(1)); // 仓库/门店编号
+ gd.setWarehouseName(r.get(2)); // 仓库/门店名称
+ gd.setProdCode(r.get(3)); // 商品编码
+ gd.setProdBarCode(r.get(4)); // 商品条码
+ gd.setProdName(r.get(5)); // 商品名称
+ gd.setWarehouseType(CsvTool.readInteger(r, 6)); // 仓库类型
+ gd.setProdNum(CsvTool.readInteger(r, 7)); // 商品数量
+ gd.setProdValue(CsvTool.readDouble(r, 8)); // 商品货值
+ gd.setSuppliderName(r.get(9)); // 供应商
+ gd.setDatadate(r.get(10)); // 数据日期
+ return gd;
+ }
+
+ public void importFromXlsx(String filePath) {
+ long millis = System.currentTimeMillis();
+ ExcelUtil.readBySax(filePath, 0, createRowHandler());
+ System.out.println("用时:" + (System.currentTimeMillis() - millis));
+ }
+
+ private RowHandler createRowHandler() {
+ return new RowHandler() {
+
+ private List toInsertList = new ArrayList<>();
+ private int x = 0;
+ private int num = 0;
+
+ @Override
+ public void handle(int i, long l, List