From b0599b1111f2f3bcb58a3d0bac4cc51750910415 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Tue, 25 Apr 2023 08:49:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/gdinstoragejmd/GdInstorageJmd.java | 74 ++++ .../api/gdinstoragelog/GdInstorageLog.java | 33 ++ .../gdinstoragelogerr/GdInstorageLogErr.java | 25 ++ .../api/gdinstorageyc/GdInstorageYc.java | 1 + .../gdinventorylogerr/GdInventoryLogErr.java | 29 ++ .../api/gdinventoryok/GdInventoryLog.java | 33 ++ .../api/gdlinventorylog/GdIinventoryLog.java | 8 + .../gdlinventorylog/GdIinventoryLogVo.java | 8 + .../gdrescategoryprod/GdRescategoryProd.java | 16 + .../customer/api/gdsalesgd/GdSalesGd.java | 68 +++ .../customer/api/gdsaleslog/GdSalesLog.java | 69 ++++ .../api/gdsaleslogerr/GdSalesLogErr.java | 38 ++ .../customer/api/storeinfo/StoreInfo.java | 86 ++++ .../api/storeinfo/StoreInfoDetailsVo.java | 107 +++++ .../customer/api/storeinfo/StoreInfoDto.java | 107 +++++ .../api/storeinfo/StoreInfoFeign.java | 76 ++++ .../api/storeinfo/StoreInfoFeignFallback.java | 70 ++++ .../api/storeinfo/StoreInfoQuery.java | 105 +++++ .../customer/api/storeinfo/StoreInfoVo.java | 107 +++++ .../supervise-customer-biz/pom.xml | 6 + .../gdinstoragegd/GdInstorageGdMapper.java | 17 +- .../biz/gdinstoragegd/GdInstorageGdRest.java | 12 +- .../gdinstoragegd/GdInstorageGdService.java | 257 ++++++++++++ .../gdinstoragejmd/GdInstorageJmdMapper.java | 72 ++++ .../gdinstoragejmd/GdInstorageJmdService.java | 66 +++ .../gdinstoragelog/GdInstorageLogMapper.java | 9 + .../gdinstoragelog/GdInstorageLogService.java | 24 ++ .../GdInstorageLogErrMapper.java | 9 + .../GdInstorageLogErrService.java | 9 + .../gdinstorageyc/GdInstorageYcMapper.java | 28 ++ .../gdinstorageyc/GdInstorageYcService.java | 3 + .../gdinventorylog/GdInventoryLogMapper.java | 13 + .../gdinventorylog/GdInventoryLogMapper.xml | 42 ++ .../gdinventorylog/GdInventoryLogRest.java | 29 ++ .../gdinventorylog/GdInventoryLogService.java | 17 + .../GdInventoryLogErrMapper.java | 9 + .../GdInventoryLogErrService.java | 9 + .../gdinventoryok/GdInventoryOkMapper.java | 55 +++ .../biz/gdinventoryok/GdInventoryOkRest.java | 23 +- .../gdinventoryok/GdInventoryOkService.java | 390 +++++++++++++++++- .../gdinventoryyc/GdInventoryYcMapper.java | 22 + .../gdinventoryyc/GdInventoryYcService.java | 111 +++++ .../GdRescategoryProdMapper.java | 47 +++ .../GdRescategoryProdService.java | 80 ++++ .../customer/biz/gdsales/GdSalesMapper.java | 4 + .../customer/biz/gdsales/GdSalesRest.java | 8 + .../customer/biz/gdsales/GdSalesService.java | 169 +++++++- .../biz/gdsalesgd/GdSalesGdMapper.java | 52 +++ .../biz/gdsalesgd/GdSalesGdService.java | 51 +++ .../biz/gdsaleslog/GdSalesLogMapper.java | 47 +++ .../biz/gdsaleslog/GdSalesLogService.java | 74 ++++ .../gdsaleslogerr/GdSalesLogErrMapper.java | 47 +++ .../gdsaleslogerr/GdSalesLogErrService.java | 47 +++ .../biz/gdsalesyc/GdSalesYcMapper.java | 3 + .../biz/gdsalesyc/GdSalesYcService.java | 3 + .../customer/biz/storeindex/StoreIndex.java | 51 +++ .../biz/storeindex/StoreIndexMapper.java | 46 +++ .../biz/storeindex/StoreIndexService.java | 180 ++++++++ .../biz/storeinfo/StoreInfoMapper.java | 73 ++++ .../biz/storeinfo/StoreInfoMapper.xml | 13 + .../customer/biz/storeinfo/StoreInfoRest.java | 125 ++++++ .../biz/storeinfo/StoreInfoService.java | 341 +++++++++++++++ .../ReportSalesDayLogDto.java | 10 + .../supervise/report/ReportApplication.java | 2 +- 64 files changed, 3748 insertions(+), 17 deletions(-) create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragejmd/GdInstorageJmd.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelog/GdInstorageLog.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelogerr/GdInstorageLogErr.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylogerr/GdInventoryLogErr.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLog.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLogVo.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdrescategoryprod/GdRescategoryProd.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsalesgd/GdSalesGd.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslog/GdSalesLog.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslogerr/GdSalesLogErr.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfo.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDetailsVo.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDto.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeign.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeignFallback.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoQuery.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoVo.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.xml create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndex.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.xml create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoRest.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoService.java create mode 100644 yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/ReportSalesDayLogDto.java diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragejmd/GdInstorageJmd.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragejmd/GdInstorageJmd.java new file mode 100644 index 00000000..6a669780 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragejmd/GdInstorageJmd.java @@ -0,0 +1,74 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.gdinstoragejmd; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: GdInstorageJmd.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmd
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/5 10:45
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_instorage_jmd") +public class GdInstorageJmd extends EntityWithId { + private String cola0; // 企业组织机构代码证 + private String colb1; // 仓库/门店编号 + private String colc2; // 仓库/门店名称 + private String cold3; // 入库时间 + private String colex; // 供应商编号 + private String cole4; // 供应商名称 + private String colf5; // 单据号 + private String colg6; // 单据类型 + private String colh7; // 货号 + private String coli8; // 商品名称 + private String colj9; // 商品生产日期 + private String colk10; // 商品保质期 + private String coll11; // 商品规格 + private String colm12; // 类别编号 + private String coln13; // 类别名称 + private String colo14; // 一级类别名称 + private String colp15; // 二级类别名称 + private String colq16; // 入库金额 + private String colr17; // 入库数量 + private String cols18; // 成本金额 + private String colt19; // 成本税额 + private String colu20; // 不含税成本 + private String colv21; // 进项税率 + private String orderDate; // 单据日期 + private String supplierCodeUnified; // 供货商编码统一 + private String inOrderNo; // 入库定单号 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelog/GdInstorageLog.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelog/GdInstorageLog.java new file mode 100644 index 00000000..4fd9202c --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelog/GdInstorageLog.java @@ -0,0 +1,33 @@ +package com.yxt.supervise.customer.api.gdinstoragelog; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("gd_instorage_log") +public class GdInstorageLog extends EntityWithId { + + public GdInstorageLog() { + } + + public GdInstorageLog(String fileFullPath) { + this.fileFullPath = fileFullPath; + } + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime = new Date(); // 记录创建时间/ + private String remarks; // 备注说明/ + private String fileFullPath; // 文件完整路径/ + private String fileUrl; //文件下载地址 + private String outFilePath; // 汇总文件路径 + // private String outfile; //输出文件名 + private int allNum; // 总记录数/ + private int validNum; // 有效记录数/ + private long durations; // 程序运行时长/ + private int errRowNum; // 出错的条数/ + private String orderDate; // 单据日期 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelogerr/GdInstorageLogErr.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelogerr/GdInstorageLogErr.java new file mode 100644 index 00000000..7ce061f3 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelogerr/GdInstorageLogErr.java @@ -0,0 +1,25 @@ +package com.yxt.supervise.customer.api.gdinstoragelogerr; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("gd_instorage_log_err") +public class GdInstorageLogErr extends EntityWithId { + private Date createTime = new Date(); // 记录创建时间', + private String remarks; // 备注说明', + private String fileFullPath; // 文件完整路径', + private String errInfo; // 异常信息', + private String rowContent; // 原记录内容', + private int rowNum; // 出错行数', + private String prodCode; //商品编码 + private String prodName; //商品名称 + private String prodNum; //'商品数量 + private String prodValue; //商品货值 + private String supplierCode; //供货商编码 + private String supplierName; //供货商名称 + private String orderDate; // 单据日期 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstorageyc/GdInstorageYc.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstorageyc/GdInstorageYc.java index da479ca7..b1e4b917 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstorageyc/GdInstorageYc.java +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstorageyc/GdInstorageYc.java @@ -68,4 +68,5 @@ public class GdInstorageYc extends EntityWithId { private String supplierCodeUnified; // 供货商编码统一 @ApiModelProperty("入库定单号") private String inOrderNo; // 入库定单号 + private String purchaseDate; // 采购日期 } diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylogerr/GdInventoryLogErr.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylogerr/GdInventoryLogErr.java new file mode 100644 index 00000000..7d1b20b8 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylogerr/GdInventoryLogErr.java @@ -0,0 +1,29 @@ +package com.yxt.supervise.customer.api.gdinventorylogerr; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2023/4/24 13:57 + */ +@Data +@TableName("gd_inventory_log_err") +public class GdInventoryLogErr extends EntityWithId { + private Date createTime = new Date(); // 记录创建时间', + private String remarks; // 备注说明', + private String fileFullPath; // 文件完整路径', + private String errInfo; // 异常信息', + private String rowContent; // 原记录内容', + private int rowNum; // 出错行数', + private String prodCode; //商品编码 + private String prodName; //商品名称 + private String prodNum; //'商品数量 + private String prodValue; //商品货值 + private String supplierCode; //供货商编码 + private String supplierName; //供货商名称 + private String orderDate; // 单据日期 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java new file mode 100644 index 00000000..38dfe962 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java @@ -0,0 +1,33 @@ +package com.yxt.supervise.customer.api.gdinventoryok; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("gd_inventory_log") +public class GdInventoryLog extends EntityWithId { + + public GdInventoryLog() { + } + + public GdInventoryLog(String fileFullPath) { + this.fileFullPath = fileFullPath; + } + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime = new Date(); // 记录创建时间/ + private String remarks; // 备注说明/ + private String fileFullPath; // 文件完整路径/ + private String outFilePath; // 汇总文件路径 +// private String outfile; //输出文件名 + private String fileUrl; //文件下载地址 + private int allNum; // 总记录数/ + private int validNum; // 有效记录数/ + private long durations; // 程序运行时长/ + private int errRowNum; // 出错的条数/ + private String orderDate; // 单据日期 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLog.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLog.java new file mode 100644 index 00000000..8416da72 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLog.java @@ -0,0 +1,8 @@ +package com.yxt.supervise.customer.api.gdlinventorylog; + +/** + * @author wangpengfei + * @date 2023/4/24 13:45 + */ +public class GdIinventoryLog { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLogVo.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLogVo.java new file mode 100644 index 00000000..eeb4c08a --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLogVo.java @@ -0,0 +1,8 @@ +package com.yxt.supervise.customer.api.gdlinventorylog; + +/** + * @author wangpengfei + * @date 2023/4/24 13:46 + */ +public class GdIinventoryLogVo { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdrescategoryprod/GdRescategoryProd.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdrescategoryprod/GdRescategoryProd.java new file mode 100644 index 00000000..52d7de35 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdrescategoryprod/GdRescategoryProd.java @@ -0,0 +1,16 @@ +package com.yxt.supervise.customer.api.gdrescategoryprod; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/4/24 14:04 + */ +@Data +@TableName("gd_rescategory_prod") +public class GdRescategoryProd extends EntityWithId { + private String prodCode; +} + diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsalesgd/GdSalesGd.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsalesgd/GdSalesGd.java new file mode 100644 index 00000000..f0bd852a --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsalesgd/GdSalesGd.java @@ -0,0 +1,68 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.gdsalesgd; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: GdSalesGd.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGd
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:09
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_sales_gd") +public class GdSalesGd extends EntityWithId { + + private String orgCode; // 企业组织机构代码证 + private String orderType; // 订单类型 + private String orderNo; // 销售订单号 + private String prodCode; // 商品编码 + private String prodBarCode; // 商品条码 + private String prodName; // 商品名称 + private String brandCode; // 品牌代码 + private String brandName; // 品牌名称 + private String categoryb; // 商品大类 + private String categorym; // 商品中类 + private String categorys; // 商品小类 + private String customerCode; // 客户代码 + private String customerName; // 客户名称 + private String saleNum; // 销售数量 + private String storeCode; // 销售渠道 + private String salePrice; // 销售价格 + private String saleCost; // 销售成本 + private String profit; // 利润 + private String dataDate; // 数据日期 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslog/GdSalesLog.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslog/GdSalesLog.java new file mode 100644 index 00000000..75b05d65 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslog/GdSalesLog.java @@ -0,0 +1,69 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.gdsaleslog; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +import java.util.Date; + +/** + * Project: yxt_supervise
+ * File: GdSalesLog.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLog
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:10
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_sales_log") +public class GdSalesLog extends EntityWithId { + public GdSalesLog() { + } + + public GdSalesLog(String fileFullPath) { + this.fileFullPath = fileFullPath; + } + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime = new Date(); // 记录创建时间/ + private String remarks; // 备注说明', + private String fileFullPath; // 文件完整路径', + private String outFilePath; // 汇总文件路径', + private String fileUrl; // 文件下载地址', + private int allNum = 0; // 总记录数', + private int validNum = 0; // 有效记录数', + private long durations = 0; // 程序运行时长', + private int errRowNum = 0; // 出错的条数', + private String orderDate; // 单据日期', +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslogerr/GdSalesLogErr.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslogerr/GdSalesLogErr.java new file mode 100644 index 00000000..7950505a --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslogerr/GdSalesLogErr.java @@ -0,0 +1,38 @@ + +package com.yxt.supervise.customer.api.gdsaleslogerr; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +import java.util.Date; + +/** + * Project: yxt_supervise
+ * File: GdSalesLogErr.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErr
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:11
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_sales_log_err") +public class GdSalesLogErr extends EntityWithId { + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime = new Date(); // 记录创建时间', + private String remarks; // 备注说明', + private String fileFullPath; // 文件完整路径', + private String errInfo; // 异常信息', + private String rowContent; // 原记录内容', + private int rowNum; // 出错行数', + private String orderDate; // 单据日期 + private String orderNo; // 销售订单号 + private String prodCode; //商品编码 + private String prodName; //商品名称 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfo.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfo.java new file mode 100644 index 00000000..1934ff1b --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfo.java @@ -0,0 +1,86 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.storeinfo; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfo.java
+ * Class: com.supervise.api.storeinfo.StoreInfo
+ * Description: 门店信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "门店信息", description = "门店信息") +@TableName("store_info") +public class StoreInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("代码") + private String code; // 代码 + @ApiModelProperty("名称") + private String name; // 名称 + @ApiModelProperty("地址") + private String address; // 地址 + @ApiModelProperty("电话") + private String telephone; // 电话 + @ApiModelProperty("联系人") + private String contacts; // 联系人 + @ApiModelProperty("单位类型") + private String type; // 单位类型 + @ApiModelProperty("配货价") + private String productPrice; // 单位类型 + @ApiModelProperty("区域") + private String region; // 区域 + @ApiModelProperty("门店经营商品方案") + private String programme; + @ApiModelProperty("组代码") + private String groupCode; + @ApiModelProperty("经度") + private String longitude; + @ApiModelProperty("纬度") + private String latitude; + @ApiModelProperty("上级") + private String parentSid; // 上级 + @ApiModelProperty("法人") + private String legalPerson; // 法人 + @ApiModelProperty("是否加盟店0不是,1是") + private String isJoin; +// 是否石家庄内0不是,1是 + @ApiModelProperty("是否石家庄内0不是,1是") + private String isSjz; +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDetailsVo.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDetailsVo.java new file mode 100644 index 00000000..0c0567c7 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDetailsVo.java @@ -0,0 +1,107 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.storeinfo; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoVo.java
+ * Class: com.supervise.api.storeinfo.StoreInfoVo
+ * Description: 门店信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "门店信息 视图数据详情", description = "门店信息 视图数据详情") +public class StoreInfoDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("记录版本,锁") + private String lock_version; // 记录版本,锁 + @ApiModelProperty("创建者") + private String create_sid; // 创建者 + @ApiModelProperty("更新者") + private String modify_sid; // 更新者 + @ApiModelProperty("记录是否可用,1:可用,0:不可用") + private String is_enable; // 记录是否可用,1:可用,0:不可用 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录创建时间") + private Date create_timeStart; // 记录创建时间 + private Date create_timeEnd; // 记录创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录最后修改时间") + private Date modify_timeStart; // 记录最后修改时间 + private Date modify_timeEnd; // 记录最后修改时间 + @ApiModelProperty("记录是否被删除,0:未删除,1:已经删除") + private String is_delete; // 记录是否被删除,0:未删除,1:已经删除 + @ApiModelProperty("代码") + private String code; // 代码 + @ApiModelProperty("名称") + private String name; // 名称 + @ApiModelProperty("地址") + private String address; // 地址 + @ApiModelProperty("电话") + private String telephone; // 电话 + @ApiModelProperty("联系人") + private String contacts; // 联系人 + @ApiModelProperty("上级") + private String parentSid; // 上级 + @ApiModelProperty("法人") + private String legalPerson; // 法人 + @ApiModelProperty("单位类型") + private String type; // 单位类型 + @ApiModelProperty("配货价") + private String productPrice; // 单位类型 + @ApiModelProperty("区域") + private String region; // 区域 + @ApiModelProperty("门店经营商品方案") + private String programme; + @ApiModelProperty("组代码") + private String groupCode; + @ApiModelProperty("经度") + private String longitude; + @ApiModelProperty("纬度") + private String latitude; + @ApiModelProperty("是否加盟店0不是,1是") + private String isJoin; + // 是否石家庄内0不是,1是 + @ApiModelProperty("是否石家庄内0不是,1是") + private String isSjz; +} \ No newline at end of file diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDto.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDto.java new file mode 100644 index 00000000..ca58b34a --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDto.java @@ -0,0 +1,107 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.storeinfo; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoDto.java
+ * Class: com.supervise.api.storeinfo.StoreInfoDto
+ * Description: 门店信息 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "门店信息 数据传输对象", description = "门店信息 数据传输对象") +public class StoreInfoDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("记录版本,锁") + private String lock_version; // 记录版本,锁 + @ApiModelProperty("创建者") + private String create_sid; // 创建者 + @ApiModelProperty("更新者") + private String modify_sid; // 更新者 + @ApiModelProperty("记录是否可用,1:可用,0:不可用") + private String is_enable; // 记录是否可用,1:可用,0:不可用 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录创建时间") + private Date create_timeStart; // 记录创建时间 + private Date create_timeEnd; // 记录创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录最后修改时间") + private Date modify_timeStart; // 记录最后修改时间 + private Date modify_timeEnd; // 记录最后修改时间 + @ApiModelProperty("记录是否被删除,0:未删除,1:已经删除") + private String is_delete; // 记录是否被删除,0:未删除,1:已经删除 + @ApiModelProperty("代码") + private String code; // 代码 + @ApiModelProperty("名称") + private String name; // 名称 + @ApiModelProperty("地址") + private String address; // 地址 + @ApiModelProperty("电话") + private String telephone; // 电话 + @ApiModelProperty("联系人") + private String contacts; // 联系人 + @ApiModelProperty("上级") + private String parentSid; // 上级 + @ApiModelProperty("法人") + private String legalPerson; // 法人 + @ApiModelProperty("单位类型") + private String type; // 单位类型 + @ApiModelProperty("配货价") + private String productPrice; // 单位类型 + @ApiModelProperty("区域") + private String region; // 区域 + @ApiModelProperty("门店经营商品方案") + private String programme; + @ApiModelProperty("组代码") + private String groupCode; + @ApiModelProperty("经度") + private String longitude; + @ApiModelProperty("纬度") + private String latitude; + @ApiModelProperty("是否加盟店0不是,1是") + private String isJoin; + // 是否石家庄内0不是,1是 + @ApiModelProperty("是否石家庄内0不是,1是") + private String isSjz; +} \ No newline at end of file diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeign.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeign.java new file mode 100644 index 00000000..365ec487 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeign.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.storeinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoFeign.java
+ * Class: com.supervise.api.storeinfo.StoreInfoFeign
+ * Description: 门店信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "门店信息") +@FeignClient( + contextId = "yxt-supervise-StoreInfo", + name = "yxt-supervise", + path = "v1/storeinfo", + fallback = StoreInfoFeignFallback.class) +public interface StoreInfoFeign { + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + @ResponseBody + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("新增或修改") + @PostMapping("/save") + @ResponseBody + public ResultBean save(@RequestBody StoreInfoDto dto); + + @ApiOperation("根据sid删除记录") + @DeleteMapping("/delBySids") + @ResponseBody + public ResultBean delBySids(@RequestBody String[] sids); + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + @ResponseBody + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid); +} \ No newline at end of file diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeignFallback.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeignFallback.java new file mode 100644 index 00000000..5ce02726 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeignFallback.java @@ -0,0 +1,70 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.storeinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.stereotype.Component; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoFeignFallback.java
+ * Class: com.supervise.api.storeinfo.StoreInfoFeignFallback
+ * Description: 门店信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Component +public class StoreInfoFeignFallback implements StoreInfoFeign { + + @Override + public ResultBean> listPage(PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + return rb.setMsg("接口yxt_supervise/storeinfo/listPage无法访问"); + } + + @Override + public ResultBean save(StoreInfoDto dto){ + return ResultBean.fireFail().setMsg("接口yxt_supervise/storeinfo/save无法访问"); + } + + @Override + public ResultBean delBySids( String[] sids){ + return ResultBean.fireFail().setMsg("接口yxt_supervise/storeinfo/delBySids无法访问"); + } + + @Override + public ResultBean fetchDetailsBySid(String sid){ + ResultBean rb = ResultBean.fireFail(); + return rb.setMsg("接口yxt_supervise/storeinfo/fetchDetailsBySid无法访问"); + } +} \ No newline at end of file diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoQuery.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoQuery.java new file mode 100644 index 00000000..e4acc550 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoQuery.java @@ -0,0 +1,105 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.storeinfo; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoQuery.java
+ * Class: com.supervise.api.storeinfo.StoreInfoQuery
+ * Description: 门店信息 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "门店信息 查询条件", description = "门店信息 查询条件") +public class StoreInfoQuery implements Query { + + @ApiModelProperty("记录版本,锁") + private String lock_version; // 记录版本,锁 + @ApiModelProperty("创建者") + private String create_sid; // 创建者 + @ApiModelProperty("更新者") + private String modify_sid; // 更新者 + @ApiModelProperty("记录是否可用,1:可用,0:不可用") + private String is_enable; // 记录是否可用,1:可用,0:不可用 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录创建时间") + private Date create_timeStart; // 记录创建时间 + private Date create_timeEnd; // 记录创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录最后修改时间") + private Date modify_timeStart; // 记录最后修改时间 + private Date modify_timeEnd; // 记录最后修改时间 + @ApiModelProperty("记录是否被删除,0:未删除,1:已经删除") + private String is_delete; // 记录是否被删除,0:未删除,1:已经删除 + @ApiModelProperty("代码") + private String code; // 代码 + @ApiModelProperty("名称") + private String name; // 名称 + @ApiModelProperty("地址") + private String address; // 地址 + @ApiModelProperty("电话") + private String telephone; // 电话 + @ApiModelProperty("联系人") + private String contacts; // 联系人 + @ApiModelProperty("上级") + private String parentSid; // 上级 + @ApiModelProperty("法人") + private String legalPerson; // 法人 + @ApiModelProperty("单位类型") + private String type; // 单位类型 + @ApiModelProperty("配货价") + private String productPrice; // 单位类型 + @ApiModelProperty("区域") + private String region; // 区域 + @ApiModelProperty("门店经营商品方案") + private String programme; + @ApiModelProperty("组代码") + private String groupCode; + @ApiModelProperty("经度") + private String longitude; + @ApiModelProperty("纬度") + private String latitude; + @ApiModelProperty("是否加盟店0不是,1是") + private String isJoin; + // 是否石家庄内0不是,1是 + @ApiModelProperty("是否石家庄内0不是,1是") + private String isSjz; +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoVo.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoVo.java new file mode 100644 index 00000000..78250b97 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoVo.java @@ -0,0 +1,107 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.api.storeinfo; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoVo.java
+ * Class: com.supervise.api.storeinfo.StoreInfoVo
+ * Description: 门店信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "门店信息 视图数据对象", description = "门店信息 视图数据对象") +public class StoreInfoVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("记录版本,锁") + private String lock_version; // 记录版本,锁 + @ApiModelProperty("创建者") + private String create_sid; // 创建者 + @ApiModelProperty("更新者") + private String modify_sid; // 更新者 + @ApiModelProperty("记录是否可用,1:可用,0:不可用") + private String is_enable; // 记录是否可用,1:可用,0:不可用 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录创建时间") + private Date create_timeStart; // 记录创建时间 + private Date create_timeEnd; // 记录创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @ApiModelProperty("记录最后修改时间") + private Date modify_timeStart; // 记录最后修改时间 + private Date modify_timeEnd; // 记录最后修改时间 + @ApiModelProperty("记录是否被删除,0:未删除,1:已经删除") + private String is_delete; // 记录是否被删除,0:未删除,1:已经删除 + @ApiModelProperty("代码") + private String code; // 代码 + @ApiModelProperty("名称") + private String name; // 名称 + @ApiModelProperty("地址") + private String address; // 地址 + @ApiModelProperty("电话") + private String telephone; // 电话 + @ApiModelProperty("联系人") + private String contacts; // 联系人 + @ApiModelProperty("上级") + private String parentSid; // 上级 + @ApiModelProperty("法人") + private String legalPerson; // 法人 + @ApiModelProperty("单位类型") + private String type; // 单位类型 + @ApiModelProperty("配货价") + private String productPrice; // 单位类型 + @ApiModelProperty("区域") + private String region; // 区域 + @ApiModelProperty("门店经营商品方案") + private String programme; + @ApiModelProperty("组代码") + private String groupCode; + @ApiModelProperty("经度") + private String longitude; + @ApiModelProperty("纬度") + private String latitude; + @ApiModelProperty("是否加盟店0不是,1是") + private String isJoin; + // 是否石家庄内0不是,1是 + @ApiModelProperty("是否石家庄内0不是,1是") + private String isSjz; +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/pom.xml b/yxt_supervise/supervise-customer/supervise-customer-biz/pom.xml index 9e6d517c..e154d646 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/pom.xml +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/pom.xml @@ -123,6 +123,12 @@ jdk15 2.4 + + com.yxt.supervise + supervise-report-api + 0.0.1-SNAPSHOT + compile + diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdMapper.java index abba2c59..f88164c3 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdMapper.java @@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.core.toolkit.Constants; import com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGd; import com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGdExcelVo; import com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGdVo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; +import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLog; +import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogDto; +import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo; +import org.apache.ibatis.annotations.*; import java.util.List; @@ -21,4 +23,15 @@ public interface GdInstorageGdMapper extends BaseMapper { IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); List exportExcel(@Param(Constants.WRAPPER) Wrapper qw); + @Delete("delete from gd_instorage where orderDate=#{orderDate} ") + void clearByOrderDate(@Param("orderDate") String orderDate); + + @Select("select CONVERT(IFNULL(sum(colq16),0),DECIMAL(12,2)) as amount from gd_instorage where orderDate=#{orderDate}") + double amountOfDay(@Param("orderDate") String orderDate); + @Select("select * from report_sales_day_log where orderDate=#{orderDate}") + public ReportSalesDayLogVo getReportLog (@Param("orderDate") String orderDate); + @Insert("insert into report_sales_day_log ") + public int insertReportLog(ReportSalesDayLog reportSalesDayLog); + @Update("update ") + public int udpateReportLog(ReportSalesDayLog reportSalesDayLog); } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdRest.java index bfd827b0..8a277c4f 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdRest.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdRest.java @@ -5,15 +5,14 @@ import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import com.yxt.supervise.customer.api.gdinstoragegd.*; +import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; @@ -53,4 +52,9 @@ public class GdInstorageGdRest implements GdInstorageGdFeign { outputStream.flush(); outputStream.close(); } + @PostMapping("/uploadRkmxb") + public ResultBean uploadGdData(@RequestParam("file") MultipartFile file) { + return gdInstorageGdService.uploadAndInsert(file); + } + } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdService.java index 70c2618e..5e5d916d 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdService.java @@ -1,19 +1,51 @@ package com.yxt.supervise.customer.biz.gdinstoragegd; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.hutool.poi.excel.sax.handler.RowHandler; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.FileUploadResult; +import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGd; import com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGdExcelVo; import com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGdQuery; import com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGdVo; +import com.yxt.supervise.customer.api.gdinstoragejmd.GdInstorageJmd; +import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; +import com.yxt.supervise.customer.api.gdinstoragelogerr.GdInstorageLogErr; +import com.yxt.supervise.customer.api.gdinstorageyc.GdInstorageYc; +import com.yxt.supervise.customer.biz.gdinstorage.GdInstorage; +import com.yxt.supervise.customer.biz.gdinstorage.GdInstorageService; +import com.yxt.supervise.customer.biz.gdinstoragejmd.GdInstorageJmdService; +import com.yxt.supervise.customer.biz.gdinstoragelog.GdInstorageLogService; +import com.yxt.supervise.customer.biz.gdinstoragelogerr.GdInstorageLogErrService; +import com.yxt.supervise.customer.biz.gdinstorageyc.GdInstorageYcService; +import com.yxt.supervise.customer.biz.gdrescategoryprod.GdRescategoryProdService; +import com.yxt.supervise.customer.biz.storeindex.StoreIndexService; +import com.yxt.supervise.customer.biz.storeinfo.StoreInfoService; +import com.yxt.supervise.customer.biz.supplierindex.SupplierIndexService; +import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLog; +import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogDto; +import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo; +import lombok.experimental.Accessors; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.util.ArrayList; import java.util.List; /** @@ -23,6 +55,29 @@ import java.util.List; @Slf4j @Service public class GdInstorageGdService extends MybatisBaseService { + @Autowired + FileUploadComponent fileUploadComponent; + @Autowired + GdInstorageLogService gdInstorageLogService; + @Autowired + SupplierIndexService supplierIndexService; + @Autowired + private StoreInfoService storeInfoService; + @Autowired + private StoreIndexService storeIndexService; + @Autowired + private GdRescategoryProdService gdRescategoryProdService; + @Autowired + private GdInstorageGdService gdInstorageGdService; + @Autowired + private GdInstorageService gdInstorageService; + @Autowired + private GdInstorageYcService gdInstorageYcService; + @Autowired + GdInstorageLogErrService gdInstorageLogErrService; + @Autowired + private GdInstorageJmdService gdInstorageJmdService; + public PagerVo listPageVo(PagerQuery pq) { GdInstorageGdQuery query = pq.getParams(); @@ -84,4 +139,206 @@ public class GdInstorageGdService extends MybatisBaseService pagging = baseMapper.exportExcel(qw); return pagging; } + public class GdSalesThread extends Thread{ + String orderDate; + public GdSalesThread(String orderDate) { + this.orderDate = orderDate; + } + public void run(){ + System.out.println("excel线程开启"); + synchronized (orderDate){ + ReportSalesDayLogVo reportLog=baseMapper.getReportLog(orderDate); + ReportSalesDayLog ReportSalesDayLog=new ReportSalesDayLog(); + if(reportLog.equals(null)|| reportLog.equals("")){ + ReportSalesDayLogDto dto=new ReportSalesDayLogDto(); + BeanUtil.copyProperties(dto, ReportSalesDayLog, "sid"); + baseMapper.insertReportLog(ReportSalesDayLog); + } + BeanUtil.copyProperties(reportLog, ReportSalesDayLog, "sid"); + baseMapper.udpateReportLog(ReportSalesDayLog); + } + System.out.println("excel线程结束"); + } + } + + public ResultBean uploadAndInsert(MultipartFile file) { + ResultBean rb = ResultBean.fireFail(); + + ResultBean fub = fileUploadComponent.uploadFile(file, "rkmxb"); + String filePath = fub.getData().getFilePath(); + String fp = fileUploadComponent.getUploadPath() + filePath; + + long millis = System.currentTimeMillis(); + GdInstorageLog gdlog = new GdInstorageLog(fp); + ExcelUtil.read07BySax(fp, -1, createRowHandler(gdlog)); +// System.out.println("用时:" + (System.currentTimeMillis() - millis)); + gdlog.setDurations(System.currentTimeMillis() - millis); + gdInstorageLogService.save(gdlog); + //gdInstorageGdService.exportExcel() + return rb.success().setData(gdlog); + } + private RowHandler createRowHandler(GdInstorageLog gdlog) { + return new RowHandler() { + + private List toInsertListGd = new ArrayList<>(); + private List toInsertListYc = new ArrayList<>(); + private List toInsertListJmd = new ArrayList<>(); + private List toInsertList = new ArrayList<>(); + private List errList = new ArrayList<>(); + private int x = 0, y = 0, errnum = 0; + private String odate = null; + + private String readOrderDate(String orderdate) { + if (StrUtil.isBlank(orderdate)) + return ""; + return orderdate.substring(0, 10); + + } + + private boolean checkYcProd(String typeCode) { + if (StrUtil.isBlank(typeCode)) + return false; + if (typeCode.length() < 4) + return false; + String subCode = typeCode.substring(0, 4); + return "0811".equals(subCode) || "0813".equals(subCode) || "0815".equals(subCode); + } + + private String ycInOrderNo(String inOrderNo) { + if (StrUtil.isBlank(inOrderNo)) + return ""; + if (inOrderNo.length() < 10) + return ""; + String srdDate = "20" + inOrderNo.substring(4, 10); + DateTime sdate = DateUtil.parse(srdDate, "yyyyMMdd"); + DateTime tdate = DateUtil.offsetDay(sdate, -1); + return DateUtil.format(tdate, "yyyy.MM.dd"); + // return "20" + inOrderNo.substring(4, 10); + // return "20" + inOrderNo.substring(4, 6) + "." + inOrderNo.substring(6, 8) + "." + inOrderNo.substring(8, 10); + } + + @Override + public void handle(int sheetIndex, long rowIndex, List r) { + if (rowIndex > 0) { + String warehouseCode = "" + r.get(1); + GdInstorageGd gd = rowToEntity(r); + + if (StrUtil.isBlank(odate)) { + odate = readOrderDate(gd.getCold3()); + gdlog.setOrderDate(odate); + } + gd.setOrderDate(odate); + + String unifiedCode = supplierIndexService.unifiedCode(gd.getColex()); + if (StrUtil.isBlank(unifiedCode)) { + gd.setSupplierCodeUnified(gd.getColex()); + if ("112".equals(warehouseCode.trim())) { + errnum++; + GdInstorageLogErr gile = new GdInstorageLogErr(); + gile.setRowNum(x + 1); + gile.setErrInfo("未知供应商编号:" + gd.getColex()); + gile.setFileFullPath(gdlog.getFileFullPath()); + gile.setRowContent(JSONUtil.toJsonStr(r)); + + gile.setProdCode("" + r.get(8)); + gile.setProdName("" + r.get(9)); + gile.setProdNum("" + r.get(18)); + gile.setProdValue("" + r.get(17)); + gile.setSupplierCode("" + r.get(4)); + gile.setSupplierName("" + r.get(5)); + gile.setOrderDate(odate); + errList.add(gile); + } + } else { + gd.setSupplierCodeUnified(unifiedCode); + } + + toInsertListGd.add(gd); + if ("112".equals(warehouseCode.trim())) { + GdInstorage gi = new GdInstorage(); + BeanUtil.copyProperties(gd, gi); + toInsertList.add(gi); + y++; + } + + if (checkYcProd(gd.getColm12()) && storeInfoService.containsCodeOfYc(warehouseCode)) { + GdInstorageYc gyc = new GdInstorageYc(); + BeanUtil.copyProperties(gd, gyc); + gyc.setPurchaseDate(ycInOrderNo(gd.getInOrderNo())); + toInsertListYc.add(gyc); + } + + if (gdRescategoryProdService.containsCode(gd.getColh7()) && storeIndexService.containsCodeJmd(warehouseCode)) { + GdInstorageJmd gjmd = new GdInstorageJmd(); + BeanUtil.copyProperties(gd, gjmd); + toInsertListJmd.add(gjmd); + } + + x++; + } + } + @Override + public void doAfterAllAnalysed() { + if (toInsertListGd != null && !toInsertListGd.isEmpty()) { + GdInstorageGd gdInstorageGd = toInsertListGd.get(0); + gdInstorageGdService.clearByOrderDate(gdInstorageGd.getOrderDate()); + gdInstorageGdService.saveBatch(toInsertListGd); + } + if (toInsertList != null && !toInsertList.isEmpty()) { + GdInstorage gdInstorage = toInsertList.get(0); + gdInstorageService.clearByOrderDate(gdInstorage.getOrderDate()); + gdInstorageService.saveBatch(toInsertList); + } + if (toInsertListYc != null && !toInsertListYc.isEmpty()) { + GdInstorageYc gdInstorage = toInsertListYc.get(0); + gdInstorageYcService.clearByOrderDate(gdInstorage.getOrderDate()); + gdInstorageYcService.saveBatch(toInsertListYc); + } + if (toInsertListJmd != null && !toInsertListJmd.isEmpty()) { + GdInstorageJmd gdInstorage = toInsertListJmd.get(0); + gdInstorageJmdService.clearByOrderDate(gdInstorage.getOrderDate()); + gdInstorageJmdService.saveBatch(toInsertListJmd); + } + if (errList != null && !errList.isEmpty()) { + gdInstorageLogErrService.saveBatch(errList); + } + + gdlog.setAllNum(x); + gdlog.setValidNum(y); + gdlog.setErrRowNum(errnum); + RowHandler.super.doAfterAllAnalysed(); + } + }; + } + public void clearByOrderDate(String orderDate) { + baseMapper.clearByOrderDate(orderDate); + } + private GdInstorageGd rowToEntity(List r) { + GdInstorageGd gd = new GdInstorageGd(); + gd.setCola0("" + r.get(0)); // 企业组织机构代码证 + gd.setColb1("" + r.get(1)); // 仓库/门店编号 + gd.setColc2("" + r.get(2)); // 仓库/门店名称 + gd.setCold3("" + r.get(3)); // 入库时间 + gd.setColex("" + r.get(4)); // 供应商编号 + gd.setCole4("" + r.get(5)); // 供应商名称 + gd.setColf5("" + r.get(6)); // 单据号 + gd.setColg6("" + r.get(7)); // 单据类型 + gd.setColh7("" + r.get(8)); // 货号 + gd.setColi8("" + r.get(9)); // 商品名称 + gd.setColj9("" + r.get(10)); // 商品生产日期 + gd.setColk10("" + r.get(11)); // 商品保质期 + gd.setColl11("" + r.get(12)); // 商品规格 + gd.setColm12("" + r.get(13)); // 类别编号 + gd.setColn13("" + r.get(14)); // 类别名称 + gd.setColo14("" + r.get(15)); // 一级类别名称 + gd.setColp15("" + r.get(16)); // 二级类别名称 + gd.setColq16("" + r.get(17)); // 入库金额 + gd.setColr17("" + r.get(18)); // 入库数量 + gd.setCols18("" + r.get(19)); // 成本金额 + gd.setColt19("" + r.get(20)); // 成本税额 + gd.setColu20("" + r.get(21)); // 不含税成本 + gd.setColv21("" + r.get(22)); // 进项税率 + gd.setInOrderNo("" + r.get(23)); // 入库定单号 + return gd; + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdMapper.java new file mode 100644 index 00000000..79da1ae6 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdMapper.java @@ -0,0 +1,72 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdinstoragejmd; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdinstoragejmd.GdInstorageJmd; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +/** + * Project: yxt_supervise
+ * File: GdInstorageJmdMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmdMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/5 10:46
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdInstorageJmdMapper extends BaseMapper { + @Delete("delete from gd_instorage_jmd where orderDate=#{orderDate} ") + void clearByOrderDate(@Param("orderDate") String orderDate); + @Select("SELECT CONVERT(IFNULL(sum(colq16),0),DECIMAL(12,2)) as amount FROM gd_instorage_jmd where orderDate=#{orderDate} ") + double amountOfDay(@Param("orderDate") String orderDate); + + @Select("select colb1 storeCode,colc2 name,sum(colq16) amount from gd_instorage_jmd gij where orderDate=#{orderDate} GROUP BY colb1,colc2 ") + List> listOfStoreDay(@Param("orderDate") String orderDate); + + @Select("select colc2 name, " + + " colb1 storeCode, " + + " colg6 orderType, " + + " colf5 orderNo, " + + " colh7 prodCode, " + + " coli8 prodName, " + + " colr17 saleNum, " + + " '无' as salePrice, " + + " colq16 amount " + + " from gd_instorage_jmd gij where orderDate=#{orderDate} order by colc2 ") + List> listOfProductDay(@Param("orderDate") String orderDate); +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdService.java new file mode 100644 index 00000000..3b0ec399 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdService.java @@ -0,0 +1,66 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdinstoragejmd; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.customer.api.gdinstoragejmd.GdInstorageJmd; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * Project: yxt_supervise
+ * File: GdInstorageJmdService.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmdService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/5 10:46
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdInstorageJmdService extends ServiceImpl { + + public void clearByOrderDate(String orderDate) { + baseMapper.clearByOrderDate(orderDate); + } + + public double amountOfDay(String orderDate) { + return baseMapper.amountOfDay(orderDate); + } + + public List> listOfStoreDay(String orderDate) { + return baseMapper.listOfStoreDay(orderDate); + } + + public List> listOfProductDay(String orderDate) { + return baseMapper.listOfProductDay(orderDate); + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogMapper.java new file mode 100644 index 00000000..6358228f --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogMapper.java @@ -0,0 +1,9 @@ +package com.yxt.supervise.customer.biz.gdinstoragelog; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface GdInstorageLogMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogService.java new file mode 100644 index 00000000..f588d6f5 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogService.java @@ -0,0 +1,24 @@ +package com.yxt.supervise.customer.biz.gdinstoragelog; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; +import com.yxt.supervise.customer.biz.gdinstorage.GdRukuQuery; +import org.springframework.stereotype.Service; + +@Service +public class GdInstorageLogService extends ServiceImpl { + public PagerVo listPageVo(PagerQuery pq) { + GdRukuQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + qw.orderByDesc("orderDate"); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrMapper.java new file mode 100644 index 00000000..eb3c2982 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrMapper.java @@ -0,0 +1,9 @@ +package com.yxt.supervise.customer.biz.gdinstoragelogerr; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdinstoragelogerr.GdInstorageLogErr; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface GdInstorageLogErrMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrService.java new file mode 100644 index 00000000..c53bae50 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrService.java @@ -0,0 +1,9 @@ +package com.yxt.supervise.customer.biz.gdinstoragelogerr; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.customer.api.gdinstoragelogerr.GdInstorageLogErr; +import org.springframework.stereotype.Service; + +@Service +public class GdInstorageLogErrService extends ServiceImpl { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcMapper.java index 856988ed..b719431f 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcMapper.java @@ -8,10 +8,13 @@ import com.yxt.supervise.customer.api.gdinstorageyc.GdInstorageYc; import com.yxt.supervise.customer.api.gdinstorageyc.GdInstorageYcExcelVo; import com.yxt.supervise.customer.api.gdinstorageyc.GdInstorageYcVo; import com.yxt.supervise.customer.api.gdinstorageyc.GdInstorageYc; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; /** * @author wangpengfei @@ -21,4 +24,29 @@ import java.util.List; public interface GdInstorageYcMapper extends BaseMapper { IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); List exportExcel(@Param(Constants.WRAPPER) Wrapper qw); + @Delete("delete from gd_instorage_yc where orderDate=#{orderDate} ") + void clearByOrderDate(@Param("orderDate") String orderDate); + + @Select("select CONVERT(IFNULL(sum(t.colq16),0),DECIMAL(12,2)) as amount from ( " + + " select gig.* from gd_instorage_yc gig left join store_index si on gig.colb1=si.code " + + " where gig.orderDate=#{orderDate} and (si.`type` ='连锁外加盟(销配结算)' OR si.`type` ='连锁外加盟(销配结算)' ) ) t ") + double amountOfDayJmd(@Param("orderDate") String orderDate); + + @Select("select colb1 storeCode,colc2 name,CONVERT(IFNULL(sum(colq16),0),DECIMAL(12,2)) amount from gd_instorage_yc giy where orderDate=#{orderDate} " + + "and colb1 in (select code from store_index si where si.`type` ='连锁外加盟(销配结算)' OR si.`type` ='连锁外加盟(销配结算)' ) " + + "group by colb1,colc2 order by colb1 ") + List> listOfJmdStoreDay(@Param("orderDate") String orderDate); + + @Select("select colc2 name, " + + " colb1 storeCode, " + + " colg6 orderType, " + + " colf5 orderNo, " + + " colh7 prodCode, " + + " coli8 prodName, " + + " colr17 saleNum, " + + " '无' as salePrice, " + + " colq16 amount from gd_instorage_yc giy where orderDate=#{orderDate} " + + "and colb1 in (select code from store_index si where si.`type`='连锁外加盟(销配结算)' OR si.`type` ='连锁外加盟(销配结算)' ) " + + "order by colb1") + List> listOfJmdProductDay(@Param("orderDate")String orderDate); } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcService.java index f6f124dc..488fe768 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcService.java @@ -22,6 +22,9 @@ import java.util.List; */ @Service public class GdInstorageYcService extends MybatisBaseService { + public void clearByOrderDate(String orderDate) { + baseMapper.clearByOrderDate(orderDate); + } public PagerVo listPageVo(PagerQuery pq) { GdInstorageYcQuery query = pq.getParams(); QueryWrapper qw = new QueryWrapper<>(); diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java new file mode 100644 index 00000000..21a5a90e --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java @@ -0,0 +1,13 @@ +package com.yxt.supervise.customer.biz.gdinventorylog; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryLog; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author wangpengfei + * @date 2023/3/29 13:57 + */ +@Mapper +public interface GdInventoryLogMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.xml b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.xml new file mode 100644 index 00000000..d31e8c77 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + \ No newline at end of file diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java new file mode 100644 index 00000000..1d69add2 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java @@ -0,0 +1,29 @@ +package com.yxt.supervise.customer.biz.gdinventorylog; + +import com.alibaba.excel.EasyExcel; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.customer.api.gdinstoragegd.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/3/29 14:00 + */ +@Api(tags = "导入记录") +@RestController +@RequestMapping("v1/gdinventorylog") +public class GdInventoryLogRest { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java new file mode 100644 index 00000000..27fa9896 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java @@ -0,0 +1,17 @@ +package com.yxt.supervise.customer.biz.gdinventorylog; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryLog; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author wangpengfei + * @date 2023/3/29 14:00 + */ +@Slf4j +@Service + +public class GdInventoryLogService extends ServiceImpl { +} + diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrMapper.java new file mode 100644 index 00000000..82dfe126 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrMapper.java @@ -0,0 +1,9 @@ +package com.yxt.supervise.customer.biz.gdinventorylogerr; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdinventorylogerr.GdInventoryLogErr; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface GdInventoryLogErrMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrService.java new file mode 100644 index 00000000..439bfd47 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrService.java @@ -0,0 +1,9 @@ +package com.yxt.supervise.customer.biz.gdinventorylogerr; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.customer.api.gdinventorylogerr.GdInventoryLogErr; +import org.springframework.stereotype.Service; + +@Service +public class GdInventoryLogErrService extends ServiceImpl { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkMapper.java index 3b17484b..26137f31 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkMapper.java @@ -10,10 +10,13 @@ import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryOkVo; import com.yxt.supervise.customer.api.gdsales.GdSales; import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; import com.yxt.supervise.customer.api.gdsales.GdSalesVo; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; /** * @author wangpengfei @@ -25,4 +28,56 @@ public interface GdInventoryOkMapper extends BaseMapper { IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); //查询导出的数据 List exportExcel(@Param(Constants.WRAPPER) Wrapper qw); + + @Delete("delete from gd_inventory_ok where 1=1") + void clearData(); + @Select("select IFNULL(count(1),0) from (select warehouseCode from gd_inventory_ok where warehouseType='1' and warehouseCode<>'112' group by warehouseCode) t ") + int countWarehouseType1Not112(); + + @Select("select IFNULL(count(1),0) from (select warehouseCode from gd_inventory_ok where warehouseType='2' group by warehouseCode) t ") + int countWarehouseType2(); + + @Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseCode='112'") + int countProd112(); + + @Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseType='1' and warehouseCode<>'112'") + int countProd1Not112(); + + // @Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseType='2'") + @Select("select IFNULL(count(1),0) FROM (SELECT DISTINCT prodCode from gd_inventory_ok where warehouseType='2') t") + int countProd2(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='112'") + double countVal112(); + + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseType='1' and warehouseCode<>'112'") + double countVal1Not112(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseType='2'") + double countVal2(); + + @Select("select warehouseName,warehouseType,IFNULL(count(1),0) as coun,IFNULL(sum(prodValue),0) as su from gd_inventory_ok gio group by warehouseName,warehouseType order by warehouseType") + List> listOfWarehouse(); + + @Select("select warehouseCode, warehouseName, warehouseType, prodCode, prodBarCode, prodName, prodNum, prodValue from gd_inventory_ok order by warehouseType") + List> listOfProd(); + + @Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseCode='101'") + int countProd101(); + + @Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseCode='199'") + int countProd199(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='101'") + double countVal101(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='199'") + double countVal199(); + + @Select("select prodCode,CONVERT(IFNULL(sum(prodNum),0),CHAR) pnum from gd_inventory_ok group by prodCode") + List> numberOfProduct(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok") + double amountCurrent(); } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java index d1847c03..ccd4deab 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java @@ -9,13 +9,12 @@ import com.yxt.supervise.customer.api.gdsales.GdSales; import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; import com.yxt.supervise.customer.api.gdsales.GdSalesVo; +import com.yxt.supervise.customer.biz.gdinventoryyc.GdInventoryYcService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; @@ -32,6 +31,8 @@ import java.util.List; public class GdInventoryOkRest implements GdInventoryOkFeign { @Autowired GdInventoryOkService gdInventoryOkService; + @Autowired + GdInventoryYcService gdInventoryYcService; //@Override @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") @@ -56,4 +57,18 @@ public class GdInventoryOkRest implements GdInventoryOkFeign { outputStream.flush(); outputStream.close(); } + + @PostMapping("/uploadGdData") + public ResultBean uploadGdData(@RequestParam("file") MultipartFile file) { + return gdInventoryOkService.uploadAndResetData(file); + } + @GetMapping("/kchz") + public ResultBean kchz() { + return gdInventoryOkService.kchz(); + } + + @GetMapping("/kchzyc") + public ResultBean kchzyc() { + return gdInventoryYcService.kchzyc(); + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java index 6b543fbf..f94b4e8b 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java @@ -1,23 +1,44 @@ package com.yxt.supervise.customer.biz.gdinventoryok; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.hutool.poi.excel.ExcelWriter; +import cn.hutool.poi.excel.sax.handler.RowHandler; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.FileUploadResult; +import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; -import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryOk; -import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryOkExcelVo; -import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryOkQuery; -import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryOkVo; +import com.yxt.supervise.customer.api.gdinventorylogerr.GdInventoryLogErr; +import com.yxt.supervise.customer.api.gdinventoryok.*; +import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYc; import com.yxt.supervise.customer.api.gdsales.GdSales; import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; import com.yxt.supervise.customer.api.gdsales.GdSalesVo; +import com.yxt.supervise.customer.biz.gdinventorylog.GdInventoryLogService; +import com.yxt.supervise.customer.biz.gdinventorylogerr.GdInventoryLogErrService; +import com.yxt.supervise.customer.biz.gdinventoryyc.GdInventoryYcService; +import com.yxt.supervise.customer.biz.gdrescategoryprod.GdRescategoryProdService; +import com.yxt.supervise.customer.biz.storeindex.StoreIndexService; +import com.yxt.supervise.customer.biz.storeinfo.StoreInfoService; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.CellStyle; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; -import java.util.List; +import java.io.File; +import java.util.*; /** * @author wangpengfei @@ -25,6 +46,31 @@ import java.util.List; */ @Service public class GdInventoryOkService extends MybatisBaseService { + @Value("${image.upload.path:static/upload/}") + private String uploadPath; + @Value("${image.url.prefix:http://127.0.0.1:8080/upload/}") + private String urlPrefix; + @Value("${image.xlsxtmpl:static/upload/}") + private String xlsxtmplPath; + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + private GdInventoryLogService gdInventoryLogService; + @Autowired + private GdInventoryYcService gdInventoryYcService; + @Autowired + private GdInventoryOkService gdInventoryOkService; + @Autowired + private GdRescategoryProdService gdRescategoryProdService; + @Autowired + private StoreIndexService storeIndexService; + @Autowired + private StoreInfoService storeInfoService; + @Autowired + private GdInventoryLogErrService gdInventoryLogErrService; + public void clearData() { + baseMapper.clearData(); + } public PagerVo listPageVo(PagerQuery pq) { GdInventoryOkQuery query = pq.getParams(); QueryWrapper qw = new QueryWrapper<>(); @@ -89,5 +135,339 @@ public class GdInventoryOkService extends MybatisBaseService pagging = baseMapper.exportExcel(qw); return pagging; } + public ResultBean uploadAndResetData(MultipartFile file) { + ResultBean rb = ResultBean.fireFail(); + + ResultBean fub = fileUploadComponent.uploadFile(file, "kcxxcx"); + String filePath = fub.getData().getFilePath(); + String fp = fileUploadComponent.getUploadPath() + filePath; + + long millis = System.currentTimeMillis(); + baseMapper.clearData(); + gdInventoryYcService.clearData(); + GdInventoryLog gdlog = new GdInventoryLog(fp); + ExcelUtil.read07BySax(fp, -1, createRowHandler(gdlog)); +// System.out.println("用时:" + (System.currentTimeMillis() - millis)); + gdlog.setDurations(System.currentTimeMillis() - millis); + gdInventoryLogService.save(gdlog); + + return rb.success().setData(gdlog); + } + private RowHandler createRowHandler(GdInventoryLog gdlog) { + return new RowHandler() { + + private List toInsertList = new ArrayList<>(); + private List toInsertListYc = new ArrayList<>(); + private List errList = new ArrayList<>(); + private int x = 0, y = 0, z = 0, errnum = 0; + private int num = 0, numyc = 0; + private String odate = null; + + private Map readMapFromRow(List r) { + Map map = new HashMap<>(); + map.put("orgCode", r.get(0));// 企业组织机构代码证 + map.put("warehouseCode", "" + r.get(1));// 仓库/门店编号 + map.put("warehouseName", r.get(2)); // 仓库/门店名称 + map.put("prodCode", "" + r.get(7)); // 商品编码 + map.put("prodBarCode", r.get(8));// 商品条码 + map.put("prodName", r.get(9)); // 商品名称 + map.put("warehouseType", r.get(10)); // 仓库类型 + map.put("prodNum", r.get(11)); // 商品数量 + map.put("prodValue", r.get(12)); // 商品货值 + map.put("suppliderName", r.get(13)); // 供应商 + map.put("datadate", r.get(14)); // 数据日期 + + + map.put("typeCode", r.get(3)); // 类别编号 + map.put("typeName", r.get(4)); // 类别名称 + map.put("typeOne", r.get(5)); // 一级类别名称 + map.put("typeTwo", r.get(6)); // 二级类别名称 + + return map; + } + + private GdInventoryLogErr createErrorInfo(List r, String errInfo) { + GdInventoryLogErr gile = new GdInventoryLogErr(); + gile.setRowNum(x + 1); + gile.setErrInfo(errInfo); + gile.setFileFullPath(gdlog.getFileFullPath()); + gile.setRowContent(JSONUtil.toJsonStr(r)); + gile.setProdCode("" + r.get(7)); + gile.setProdName("" + r.get(9)); + gile.setProdNum("" + r.get(11)); + gile.setProdValue("" + r.get(12)); + gile.setSupplierCode(""); + gile.setSupplierName("" + r.get(13)); + gile.setOrderDate(odate); + return gile; + } + + private boolean checkYcProd(String typeCode) { + if (StrUtil.isBlank(typeCode)) + return false; + if (typeCode.length() < 4) + return false; + String subCode = typeCode.substring(0, 4); + return "0811".equals(subCode) || "0813".equals(subCode) || "0815".equals(subCode); + } + + @Override + public void handle(int sheetIndex, long rowIndex, List r) { + if (rowIndex > 0) { + String typeCode = "" + r.get(3); + String prodCode = "" + r.get(7); + String warehouseCode = "" + r.get(1); + + if (StrUtil.isBlank(odate)) { + odate = "" + r.get(14); + gdlog.setOrderDate(odate); + } + + // System.out.println(",X:" + x + ",prodCode:" + prodCode); + + if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(warehouseCode)) { + GdInventoryOk ok = new GdInventoryOk(); + Map map = readMapFromRow(r); + + try { + BeanUtil.fillBeanWithMap(map, ok, true); + toInsertList.add(ok); + y++; + } catch (Exception e) { + errnum++; + GdInventoryLogErr gile = createErrorInfo(r, e.getMessage()); + errList.add(gile); + } + + if (990 == num) { + gdInventoryOkService.saveBatch(toInsertList); + num = 0; + toInsertList.clear(); + } else { + num++; + } + } + + if (checkYcProd(prodCode) && storeInfoService.containsCodeOfYcNoJmd(warehouseCode)) { + GdInventoryYc yc = new GdInventoryYc(); + Map map = readMapFromRow(r); + + try { + BeanUtil.fillBeanWithMap(map, yc, true); + toInsertListYc.add(yc); + z++; + } catch (Exception e) { + errnum++; + GdInventoryLogErr gile = createErrorInfo(r, e.getMessage()); + errList.add(gile); + } + + if (990 == numyc) { + gdInventoryYcService.saveBatch(toInsertListYc); + numyc = 0; + toInsertListYc.clear(); + } else { + numyc++; + } + } + x++; +// System.out.println(",X:" + x + ",Y:" + y); + } + } + + @Override + public void handleCell(int sheetIndex, long rowIndex, int cellIndex, Object value, CellStyle xssfCellStyle) { + RowHandler.super.handleCell(sheetIndex, rowIndex, cellIndex, value, xssfCellStyle); + } + @Override + public void doAfterAllAnalysed() { + if (toInsertList != null && !toInsertList.isEmpty()) { + gdInventoryOkService.saveBatch(toInsertList); + } + if (toInsertListYc != null && !toInsertListYc.isEmpty()) { + gdInventoryYcService.saveBatch(toInsertListYc); + } + if (errList != null && !errList.isEmpty()) { + gdInventoryLogErrService.saveBatch(errList); + } + + gdlog.setAllNum(x); + gdlog.setValidNum(y); + gdlog.setErrRowNum(errnum); + RowHandler.super.doAfterAllAnalysed(); + } + }; + } + + + public ResultBean kchz() { + ResultBean rb = ResultBean.fireFail(); + + // int type1 = baseMapper.countWarehouseType1Not112(); + int type2 = baseMapper.countWarehouseType2(); + int prod112 = baseMapper.countProd112(); + int prod101 = baseMapper.countProd101(); + int prod199 = baseMapper.countProd199(); + // int prod1Not112 = baseMapper.countProd1Not112(); + int prod2 = baseMapper.countProd2(); + double val112 = baseMapper.countVal112(); + double val101 = baseMapper.countVal101(); + double val199 = baseMapper.countVal199(); + // double val1Not112 = baseMapper.countVal1Not112(); + double val2 = baseMapper.countVal2(); + + int typeYc = gdInventoryYcService.typeYc(); + int prodYc = gdInventoryYcService.prodYc(); + double valYc = gdInventoryYcService.valYc(); + + double hj0 = val112 + val101 + val199 + val2 + valYc; + + Date curDate = new Date(); + String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS"); + String dfmt = DateUtil.format(curDate, "yyyy-MM-dd"); + String datefmt1 = DateUtil.format(curDate, "yyyy-MM-dd HH:mm"); + String datefmt2 = DateUtil.format(curDate, "yyyy/MM/dd HH:mm"); + + // URL resource = ResourceUtil.getResource("xlsx-tmpl/库存汇总表.xlsx"); + String xlsxpath = xlsxtmplPath + "库存汇总表.xlsx"; + File srcFile = FileUtil.file(xlsxpath); + String tfile = "kchzb/库存汇总表" + dfmt + ".xlsx"; + String url = urlPrefix + tfile; + String toFileName = uploadPath + tfile; + File file = FileUtil.file(toFileName); + // FileUtil.copy(FileUtil.file(resource), file, true); + FileUtil.copy(srcFile, file, true); + ExcelWriter writer = ExcelUtil.getWriter(file); + + // 库存汇总日报表 + writer.setSheet(0); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(3, 1, datefmt1); + if (prod112 > 0) { + writer.writeCellValue(1, 3, 1); + } else { + writer.writeCellValue(1, 3, 0); + } + if (prod101 > 0) { + writer.writeCellValue(1, 4, 1); + } else { + writer.writeCellValue(1, 4, 0); + } + if (prod199 > 0) { + writer.writeCellValue(1, 5, 1); + } else { + writer.writeCellValue(1, 5, 0); + } + // writer.writeCellValue(1, 4, type1); + writer.writeCellValue(1, 6, type2); + writer.writeCellValue(1, 7, typeYc); + writer.writeCellValue(2, 3, prod112); + writer.writeCellValue(2, 4, prod101); + writer.writeCellValue(2, 5, prod199); + writer.writeCellValue(2, 6, prod2); + writer.writeCellValue(2, 7, prodYc); + writer.writeCellValue(3, 3, val112); + writer.writeCellValue(3, 4, val101); + writer.writeCellValue(3, 5, val199); + writer.writeCellValue(3, 6, val2); + writer.writeCellValue(3, 7, valYc); + writer.writeCellValue(3, 8, hj0); + // writer.flush(); + // writer.close(); + + // 仓库库存明细表 + List> list = baseMapper.listOfWarehouse(); + // writer = ExcelUtil.getWriter(file); + writer.setSheet(1); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(3, 1, datefmt1); + int size = list.size(); + int countRow = size + 3; + double hz1 = 0; + for (int y = 3; y < countRow; y++) { + Map map = list.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseName")); + writer.writeCellValue(1, y, map.get("warehouseType")); + writer.writeCellValue(2, y, map.get("coun")); + writer.writeCellValue(3, y, map.get("su")); + //hz1 = hz1 + ExcelTool.toDouble(map.get("su")); + } + writer.writeCellValue(0, countRow, "合计"); + writer.writeCellValue(3, countRow, hz1); + // writer.flush(); + // writer.close(); + + // 仓库商品明细表 + List> listp = baseMapper.listOfProd(); + // writer = ExcelUtil.getWriter(file); + writer.setSheet(2); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(6, 1, datefmt2); + int sizep = listp.size(); + int countRowp = sizep + 3; + double hz2 = 0; + for (int y = 3; y < countRowp; y++) { + Map map = listp.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseCode")); + writer.writeCellValue(1, y, map.get("warehouseName")); + writer.writeCellValue(2, y, map.get("warehouseType")); + writer.writeCellValue(3, y, map.get("prodCode")); + writer.writeCellValue(4, y, map.get("prodBarCode")); + writer.writeCellValue(5, y, map.get("prodName")); + writer.writeCellValue(6, y, map.get("prodNum")); + writer.writeCellValue(7, y, map.get("prodValue")); + //hz2 = hz2 + ExcelTool.toDouble(map.get("prodValue")); + } + writer.writeCellValue(0, countRowp, "合计"); + writer.writeCellValue(7, countRowp, hz2); + + // 烟草仓库库存明细表 + List> listyc = gdInventoryYcService.listOfWarehouse(); + writer.setSheet(3); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(3, 1, datefmt1); + int sizeyc = listyc.size(); + int countRowyc = sizeyc + 3; + double hj3 = 0; + for (int y = 3; y < countRowyc; y++) { + Map map = listyc.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseName")); + writer.writeCellValue(1, y, map.get("warehouseType")); + writer.writeCellValue(2, y, map.get("coun")); + writer.writeCellValue(3, y, map.get("su")); + //hj3 = hj3 + ExcelTool.toDouble(map.get("su")); + } + writer.writeCellValue(0, countRowyc, "合计"); + writer.writeCellValue(3, countRowyc, hj3); + +// 烟草仓库商品明细表 + List> listpyc = gdInventoryYcService.listOfProd(); + writer.setSheet(4); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(6, 1, datefmt2); + int sizepyc = listpyc.size(); + int countRowpyc = sizepyc + 3; + double hz4 = 0; + for (int y = 3; y < countRowpyc; y++) { + Map map = listpyc.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseCode")); + writer.writeCellValue(1, y, map.get("warehouseName")); + writer.writeCellValue(2, y, map.get("warehouseType")); + writer.writeCellValue(3, y, map.get("prodCode")); + writer.writeCellValue(4, y, map.get("prodBarCode")); + writer.writeCellValue(5, y, map.get("prodName")); + writer.writeCellValue(6, y, map.get("prodNum")); + writer.writeCellValue(7, y, map.get("prodValue")); + //hz4 = hz4 + ExcelTool.toDouble(map.get("prodValue")); + } + writer.writeCellValue(0, countRowpyc, "合计"); + writer.writeCellValue(7, countRowpyc, hz4); + + writer.flush(); + writer.close(); + + + return rb.success().setData(url); + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcMapper.java index 9604d61a..e4cdfdb4 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcMapper.java @@ -8,10 +8,13 @@ import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYc; import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYcExcelVo; import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYcVo; import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYc; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; /** * @author wangpengfei @@ -23,4 +26,23 @@ public interface GdInventoryYcMapper extends BaseMapper { IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); //查询导出的数据 List exportExcel(@Param(Constants.WRAPPER) Wrapper qw); + @Delete("delete from gd_inventory_yc where 1=1") + void clearData(); + + @Select("select IFNULL(count(1),0) FROM (SELECT DISTINCT prodCode from gd_inventory_yc) t ") + int countProd2(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_yc") + double countVal2(); + @Select("select warehouseName,warehouseType,IFNULL(count(1),0) as coun,IFNULL(sum(prodValue),0) as su from gd_inventory_yc gio group by warehouseName,warehouseType order by warehouseType") + List> listOfWarehouse(); + + @Select("select warehouseCode, warehouseName, warehouseType, prodCode, prodBarCode, prodName, prodNum, prodValue from gd_inventory_yc order by warehouseType") + List> listOfProd(); + + @Select("select IFNULL(count(1),0) FROM (SELECT DISTINCT warehouseCode from gd_inventory_yc) t ") + int countType2(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_yc") + double amountCurrent(); } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcService.java index a76a2a27..3a16ac43 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcService.java @@ -1,10 +1,15 @@ package com.yxt.supervise.customer.biz.gdinventoryyc; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.hutool.poi.excel.ExcelWriter; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYc; import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYcExcelVo; @@ -12,9 +17,13 @@ import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYcQuery; import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYcVo; import com.yxt.supervise.customer.api.gdinventoryyc.GdInventoryYc; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.io.File; +import java.util.Date; import java.util.List; +import java.util.Map; /** * @author wangpengfei @@ -22,6 +31,32 @@ import java.util.List; */ @Service public class GdInventoryYcService extends MybatisBaseService { + @Value("${image.upload.path:static/upload/}") + private String uploadPath; + @Value("${image.url.prefix:http://127.0.0.1:8080/upload/}") + private String urlPrefix; + @Value("${image.xlsxtmpl:static/upload/}") + private String xlsxtmplPath; + public void clearData() { + baseMapper.clearData(); + } + public int typeYc() { + return baseMapper.countType2(); + } + + public int prodYc() { + return baseMapper.countProd2(); + } + + public double valYc() { + return baseMapper.countVal2(); + } + public List> listOfWarehouse() { + return baseMapper.listOfWarehouse(); + } + public List> listOfProd() { + return baseMapper.listOfProd(); + } public PagerVo listPageVo(PagerQuery pq) { GdInventoryYcQuery query = pq.getParams(); QueryWrapper qw = new QueryWrapper<>(); @@ -86,4 +121,80 @@ public class GdInventoryYcService extends MybatisBaseService pagging = baseMapper.exportExcel(qw); return pagging; } + + public ResultBean kchzyc() { + ResultBean rb = ResultBean.fireFail(); + + int type2 = baseMapper.countType2(); + int prod2 = baseMapper.countProd2(); + double val2 = baseMapper.countVal2(); + + Date curDate = new Date(); + String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS"); + String dfmt = DateUtil.format(curDate, "yyyy-MM-dd"); + String datefmt1 = DateUtil.format(curDate, "yyyy-MM-dd HH:mm"); + String datefmt2 = DateUtil.format(curDate, "yyyy/MM/dd HH:mm"); + + // URL resource = ResourceUtil.getResource("xlsx-tmpl/库存汇总表.xlsx"); + String xlsxpath = xlsxtmplPath + "库存汇总表-烟草.xlsx"; + File srcFile = FileUtil.file(xlsxpath); + String tfile = "kchzb/库存汇总表-烟草" + dfmt + ".xlsx"; + String url = urlPrefix + tfile; + String toFileName = uploadPath + tfile; + File file = FileUtil.file(toFileName); + // FileUtil.copy(FileUtil.file(resource), file, true); + FileUtil.copy(srcFile, file, true); + ExcelWriter writer = ExcelUtil.getWriter(file); + writer.setSheet(0); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(3, 1, datefmt1); + + writer.writeCellValue(1, 3, type2); + writer.writeCellValue(2, 3, prod2); + writer.writeCellValue(3, 3, val2); + // writer.flush(); + // writer.close(); + + List> list = baseMapper.listOfWarehouse(); + // writer = ExcelUtil.getWriter(file); + writer.setSheet(1); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(3, 1, datefmt1); + int size = list.size(); + int countRow = size + 3; + for (int y = 3; y < countRow; y++) { + Map map = list.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseName")); + writer.writeCellValue(1, y, map.get("warehouseType")); + writer.writeCellValue(2, y, map.get("coun")); + writer.writeCellValue(3, y, map.get("su")); + } + writer.writeCellValue(0, countRow, "合计"); + // writer.flush(); + // writer.close(); + + List> listp = baseMapper.listOfProd(); + // writer = ExcelUtil.getWriter(file); + writer.setSheet(2); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(6, 1, datefmt2); + int sizep = listp.size(); + int countRowp = sizep + 3; + for (int y = 3; y < countRowp; y++) { + Map map = listp.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseCode")); + writer.writeCellValue(1, y, map.get("warehouseName")); + writer.writeCellValue(2, y, map.get("warehouseType")); + writer.writeCellValue(3, y, map.get("prodCode")); + writer.writeCellValue(4, y, map.get("prodBarCode")); + writer.writeCellValue(5, y, map.get("prodName")); + writer.writeCellValue(6, y, map.get("prodNum")); + writer.writeCellValue(7, y, map.get("prodValue")); + } + writer.flush(); + writer.close(); + + + return rb.success().setData(url); + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdMapper.java new file mode 100644 index 00000000..4e88850f --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdMapper.java @@ -0,0 +1,47 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdrescategoryprod; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdrescategoryprod.GdRescategoryProd; +import org.apache.ibatis.annotations.Mapper; + +/** + * Project: yxt_supervise
+ * File: GdRescategoryProdMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdRescategoryProdMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 20:32
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdRescategoryProdMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdService.java new file mode 100644 index 00000000..0efa70b7 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdService.java @@ -0,0 +1,80 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdrescategoryprod; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.customer.api.gdrescategoryprod.GdRescategoryProd; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Project: yxt_supervise
+ * File: GdRescategoryProdService.java
+ * Class: com.yxt.supervise.portal.biz.gdinventory.GdRescategoryProdService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/11/30 20:36
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdRescategoryProdService extends ServiceImpl { + + private static List codeList = null; + + public List listCode() { + List res = new ArrayList<>(); + List list = super.list(); + list.forEach(entity -> res.add(entity.getProdCode().trim())); + return res; + } + + public List allProdCodeList() { + if (codeList == null) { + codeList = this.listCode(); + } + return codeList; + } + + public boolean containsCode(String code) { + if (StringUtils.isBlank(code)) + return false; + return allProdCodeList().contains(code.trim()); + } + + /** + * 清空缓存 + */ + public static void resetCache() { + codeList = null; + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesMapper.java index 5bf49e62..00c2fc5b 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesMapper.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants; import com.yxt.supervise.customer.api.gdsales.GdSales; import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; import com.yxt.supervise.customer.api.gdsales.GdSalesVo; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -18,6 +19,9 @@ import java.util.List; */ @Mapper public interface GdSalesMapper extends BaseMapper { + + @Delete("delete from gd_sales where dataDate=#{dataDate} ") + void clearByDataDate(@Param("dataDate") String dataDate); //分页查询销售数据 IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesRest.java index dcb648ca..cff04861 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesRest.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesRest.java @@ -6,18 +6,22 @@ import com.alibaba.excel.metadata.data.RichTextStringData; import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; +import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.utils.ExportExcelUtils; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import com.yxt.supervise.customer.api.gdsales.*; +import com.yxt.supervise.customer.api.gdsaleslog.GdSalesLog; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.IndexedColors; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; @@ -64,4 +68,8 @@ public class GdSalesRest implements GdSalesFeign { outputStream.flush(); outputStream.close(); } + @PostMapping("/uploadXssj") + public ResultBean uploadGdData(@RequestParam("file") MultipartFile file) { + return gdSalesService.uploadAndInsert(file); + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesService.java index 5b92dc7a..efef8c7d 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesService.java @@ -1,21 +1,45 @@ package com.yxt.supervise.customer.biz.gdsales; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.hutool.poi.excel.sax.handler.RowHandler; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.FileUploadResult; +import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import com.yxt.supervise.customer.api.gdsales.GdSales; import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; import com.yxt.supervise.customer.api.gdsales.GdSalesVo; +import com.yxt.supervise.customer.api.gdsalesgd.GdSalesGd; +import com.yxt.supervise.customer.api.gdsaleslog.GdSalesLog; +import com.yxt.supervise.customer.api.gdsaleslogerr.GdSalesLogErr; +import com.yxt.supervise.customer.api.gdsalesyc.GdSalesYc; +import com.yxt.supervise.customer.biz.gdinstoragejmd.GdInstorageJmdService; +import com.yxt.supervise.customer.biz.gdinstorageyc.GdInstorageYcService; +import com.yxt.supervise.customer.biz.gdrescategoryprod.GdRescategoryProdService; +import com.yxt.supervise.customer.biz.gdsalesgd.GdSalesGdService; +import com.yxt.supervise.customer.biz.gdsaleslog.GdSalesLogService; +import com.yxt.supervise.customer.biz.gdsaleslogerr.GdSalesLogErrService; +import com.yxt.supervise.customer.biz.gdsalesyc.GdSalesYcService; +import com.yxt.supervise.customer.biz.storeindex.StoreIndexService; +import com.yxt.supervise.customer.biz.storeinfo.StoreInfoService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; +import java.util.ArrayList; import java.util.List; /** @@ -25,7 +49,32 @@ import java.util.List; @Slf4j @Service public class GdSalesService extends MybatisBaseService { - + @Value("${image.upload.path:static/upload/}") + private String uploadPath; + @Value("${image.url.prefix:http://127.0.0.1:8080/upload/}") + private String urlPrefix; + @Value("${image.xlsxtmpl:static/upload/}") + private String xlsxtmplPath; + @Autowired + private GdSalesGdService gdSalesGdService; + @Autowired + private GdSalesYcService gdSalesYcService; + @Autowired + private GdSalesLogService gdSalesLogService; + @Autowired + private GdSalesLogErrService gdSalesLogErrService; + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + private GdRescategoryProdService gdRescategoryProdService; + @Autowired + private StoreInfoService storeInfoService; + @Autowired + private StoreIndexService storeIndexService; + @Autowired + private GdInstorageJmdService gdInstorageJmdService; + @Autowired + private GdInstorageYcService gdInstorageYcService; public PagerVo listPageVo(PagerQuery pq) { GdSalesQuery query = pq.getParams(); QueryWrapper qw = new QueryWrapper<>(); @@ -91,4 +140,122 @@ public class GdSalesService extends MybatisBaseService { List pagging = baseMapper.exportExcel(qw); return pagging; } + public ResultBean uploadAndInsert(MultipartFile file) { + ResultBean rb = ResultBean.fireFail(); + + ResultBean fub = fileUploadComponent.uploadFile(file, "xssj"); + String filePath = fub.getData().getFilePath(); + String fp = fileUploadComponent.getUploadPath() + filePath; + + long millis = System.currentTimeMillis(); + GdSalesLog gdlog = new GdSalesLog(fp); + ExcelUtil.read07BySax(fp, -1, createRowHandler(gdlog)); + gdlog.setDurations(System.currentTimeMillis() - millis); + gdSalesLogService.save(gdlog); + + return rb.success().setData(gdlog); + } + public void clearByDataDate(String dataDate) { + baseMapper.clearByDataDate(dataDate); + } + private RowHandler createRowHandler(GdSalesLog gdlog) { + return new RowHandler() { + + private List toInsertListGd = new ArrayList<>(); + private List toInsertListYc = new ArrayList<>(); + private List toInsertList = new ArrayList<>(); + private List errList = new ArrayList<>(); + private int x = 0, y = 0, errnum = 0; + private String odate = null; + + private GdSalesGd rowToEntity(List r) { + GdSalesGd gd = new GdSalesGd(); + gd.setOrgCode("" + r.get(0)); // 企业组织机构代码证 + gd.setOrderType("" + r.get(1)); // 订单类型 + gd.setOrderNo("" + r.get(2)); // 销售订单号 + gd.setProdCode("" + r.get(3)); // 商品编码 + gd.setProdBarCode("" + r.get(4)); // 商品条码 + gd.setProdName("" + r.get(5)); // 商品名称 + gd.setBrandCode("" + r.get(6)); // 品牌代码 + gd.setBrandName("" + r.get(7)); // 品牌名称 + gd.setCategoryb("" + r.get(8)); // 商品大类 + gd.setCategorym("" + r.get(9)); // 商品中类 + gd.setCategorys("" + r.get(10)); // 商品小类 + gd.setCustomerCode("" + r.get(11)); // 客户代码 + gd.setCustomerName("" + r.get(12)); // 客户名称 + gd.setSaleNum("" + r.get(13)); // 销售数量 + gd.setStoreCode("" + r.get(14)); // 销售渠道 + gd.setSalePrice("" + r.get(15)); // 销售价格 + gd.setSaleCost("" + r.get(16)); // 销售成本 + gd.setProfit("" + r.get(17)); // 利润 + gd.setDataDate("" + r.get(18)); // 数据日期 + return gd; + } + + private boolean checkYcProd(String typeCode) { + if (StrUtil.isBlank(typeCode)) + return false; + if (typeCode.length() < 6) + return false; + String subCode = typeCode.substring(0, 6); + return "[0811]".equals(subCode) || "[0813]".equals(subCode) || "[0815]".equals(subCode); + } + + @Override + public void handle(int sheetIndex, long rowIndex, List r) { + if (rowIndex > 0) { //跳过标题行 + String dataDate = "" + r.get(18); //数据日期 + String prodCode = "" + r.get(3); //商品编码 + String typeTwo = "" + r.get(9); //中类 + String storeCode = "" + r.get(14); //门店编码 + if (StrUtil.isNotBlank(prodCode)) { //商品编码不为空才插入,过滤掉统计行 + if (odate == null) + odate = dataDate; + GdSalesGd gd = rowToEntity(r); + toInsertListGd.add(gd); + // 监管商品销售数据 + if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(storeCode)) { + GdSales gw = new GdSales(); + BeanUtil.copyProperties(gd, gw); + toInsertList.add(gw); + y++; + } + + // 烟草销售数据 + if (checkYcProd(typeTwo) && storeInfoService.containsCodeOfYc(storeCode)) { + GdSalesYc gyc = new GdSalesYc(); + BeanUtil.copyProperties(gd, gyc); + toInsertListYc.add(gyc); + } + x++; + } + } + } + + @Override + public void doAfterAllAnalysed() { + if (toInsertListGd != null && !toInsertListGd.isEmpty()) { + GdSalesGd gd = toInsertListGd.get(0); + gdSalesGdService.clearByDataDate(gd.getDataDate()); + gdSalesGdService.saveBatch(toInsertListGd); + } + if (toInsertList != null && !toInsertList.isEmpty()) { + GdSales gd = toInsertList.get(0); + GdSalesService.this.clearByDataDate(gd.getDataDate()); + GdSalesService.this.saveBatch(toInsertList); + } + if (toInsertListYc != null && !toInsertListYc.isEmpty()) { + GdSalesYc gd = toInsertListYc.get(0); + gdSalesYcService.clearByDataDate(gd.getDataDate()); + gdSalesYcService.saveBatch(toInsertListYc); + } + + gdlog.setAllNum(x); + gdlog.setValidNum(y); + gdlog.setErrRowNum(errnum); + gdlog.setOrderDate(odate); + RowHandler.super.doAfterAllAnalysed(); + } + }; + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdMapper.java new file mode 100644 index 00000000..d078d4de --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdMapper.java @@ -0,0 +1,52 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdsalesgd; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdsalesgd.GdSalesGd; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * Project: yxt_supervise
+ * File: GdSalesGdMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGdMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:20
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdSalesGdMapper extends BaseMapper { + + @Delete("delete from gd_sales_gd where dataDate=#{dataDate} ") + void clearByDataDate(@Param("dataDate") String dataDate); +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdService.java new file mode 100644 index 00000000..2a998a99 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdService.java @@ -0,0 +1,51 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdsalesgd; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.customer.api.gdsalesgd.GdSalesGd; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise
+ * File: GdSalesGdService.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGdService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:21
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdSalesGdService extends ServiceImpl { + + public void clearByDataDate(String dataDate) { + baseMapper.clearByDataDate(dataDate); + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogMapper.java new file mode 100644 index 00000000..98d1afbc --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogMapper.java @@ -0,0 +1,47 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdsaleslog; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdsaleslog.GdSalesLog; +import org.apache.ibatis.annotations.Mapper; + +/** + * Project: yxt_supervise
+ * File: GdSalesLogMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:14
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdSalesLogMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogService.java new file mode 100644 index 00000000..4635654d --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogService.java @@ -0,0 +1,74 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdsaleslog; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; +import com.yxt.supervise.customer.api.gdsaleslog.GdSalesLog; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise
+ * File: GdSalesLogService.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:14
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdSalesLogService extends ServiceImpl { + public PagerVo listPageVo(PagerQuery pq) { + + GdSalesQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StrUtil.isNotBlank(query.getStartTime())) { + qw.ge("orderDate", query.getStartTime()); + } + if (StrUtil.isNotBlank(query.getEndTime())) { + qw.lt("orderDate", query.getEndTime()); + } + qw.orderByDesc("orderDate"); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public GdSalesLog fetchById(String logId) { + return baseMapper.selectById(logId); + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrMapper.java new file mode 100644 index 00000000..bdb9293b --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrMapper.java @@ -0,0 +1,47 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdsaleslogerr; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.supervise.customer.api.gdsaleslogerr.GdSalesLogErr; +import org.apache.ibatis.annotations.Mapper; + +/** + * Project: yxt_supervise
+ * File: GdSalesLogErrMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErrMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdSalesLogErrMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrService.java new file mode 100644 index 00000000..09ede25b --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrService.java @@ -0,0 +1,47 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdsaleslogerr; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.customer.api.gdsaleslogerr.GdSalesLogErr; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise
+ * File: GdSalesLogErrService.java
+ * Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErrService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023/1/7 16:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdSalesLogErrService extends ServiceImpl { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcMapper.java index 464c86bb..568fcb68 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcMapper.java @@ -8,6 +8,7 @@ import com.yxt.supervise.customer.api.gdsalesyc.GdSalesYc; import com.yxt.supervise.customer.api.gdsalesyc.GdSalesYcExcelVo; import com.yxt.supervise.customer.api.gdsalesyc.GdSalesYcVo; import com.yxt.supervise.customer.api.gdsalesyc.GdSalesYc; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -19,6 +20,8 @@ import java.util.List; */ @Mapper public interface GdSalesYcMapper extends BaseMapper { + @Delete("delete from gd_sales_yc where dataDate=#{dataDate} ") + void clearByDataDate(@Param("dataDate") String dataDate); //分页查询销售数据 IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcService.java index fb91c72b..821554c3 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcService.java @@ -22,6 +22,9 @@ import java.util.List; */ @Service public class GdSalesYcService extends MybatisBaseService { + public void clearByDataDate(String dataDate) { + baseMapper.clearByDataDate(dataDate); + } public PagerVo listPageVo(PagerQuery pq) { GdSalesYcQuery query = pq.getParams(); QueryWrapper qw = new QueryWrapper<>(); diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndex.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndex.java new file mode 100644 index 00000000..55f9f021 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndex.java @@ -0,0 +1,51 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.storeindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: StoreIndex.java
+ * Class: com.yxt.supervise.portal.biz.storeindex.StoreIndex
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/1 22:43
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("store_index") +public class StoreIndex extends EntityWithId { + private String code; //代码 + private String name; //名称 + private String type; //类型 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexMapper.java new file mode 100644 index 00000000..44453a13 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexMapper.java @@ -0,0 +1,46 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.storeindex; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * Project: yxt_supervise
+ * File: StoreIndexMapper.java
+ * Class: com.yxt.supervise.portal.biz.storeindex.StoreIndexMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/1 22:45
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface StoreIndexMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexService.java new file mode 100644 index 00000000..ed237c4b --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexService.java @@ -0,0 +1,180 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.storeindex; + +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.map.MapUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Project: yxt_supervise
+ * File: StoreIndexService.java
+ * Class: com.yxt.supervise.portal.biz.storeindex.StoreIndexService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/1 22:45
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class StoreIndexService extends ServiceImpl { + + private static List oneCodeList = ListUtil.toLinkedList("101", "199", "112"); + private static Map oneNameMap = MapUtil.builder(new HashMap()) + .put("101", "[101]365常温仓") + .put("199", "[199]365配送残品仓") + .put("112", "[112]供应链仓").build(); + private static Map oneTypeMap = MapUtil.builder(new HashMap()) + .put("101", "配送中心") + .put("199", "配送中心") + .put("112", "配送中心").build(); + + private static List codeList = null; + private static List codeNoJmdList = null; + private static List codeJmdList = null; + private static Map nameMap = null; + private static Map typeMap = null; + + public List listCode() { + List res = new ArrayList<>(); + List list = super.list(); + list.forEach(entity -> res.add(entity.getCode().trim())); + return res; + } + + public List allStoreCodeList() { + if (codeList == null) { + codeList = this.listCode(); + } + return codeList; + } + + public List listCodeNoJmd() { + List res = new ArrayList<>(); + QueryWrapper qw = new QueryWrapper<>(); + qw.ne("type", "连锁外加盟(销配结算)"); + List list = super.list(qw); + list.forEach(entity -> res.add(entity.getCode().trim())); + return res; + } + + public List listCodeJmd() { + List res = new ArrayList<>(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("type", "连锁外加盟(销配结算)"); + List list = super.list(qw); + list.forEach(entity -> res.add(entity.getCode().trim())); + return res; + } + + public boolean containsCode(String code) { + if (StringUtils.isBlank(code)) + return false; + return allStoreCodeList().contains(code.trim()); + } + + public boolean containsCodeWithOne(String code) { + if (StringUtils.isBlank(code)) + return false; + boolean contains = allStoreCodeList().contains(code.trim()); + if (contains) + return true; + return oneCodeList.contains(code.trim()); + } + + public boolean containsCodeJmd(String code) { + if (StringUtils.isBlank(code)) + return false; + if (codeJmdList == null) + codeJmdList = listCodeJmd(); + return codeJmdList.contains(code.trim()); + } + + public boolean containsCodeWithOneNoJmd(String code) { + if (StringUtils.isBlank(code)) + return false; + if (codeNoJmdList == null) + codeNoJmdList = listCodeNoJmd(); + + boolean contains = codeNoJmdList.contains(code.trim()); + if (contains) + return true; + return oneCodeList.contains(code.trim()); + } + + public String nameOfCode(String code) { + if (nameMap == null) + nameMap = mapNames(); + String trim = code.trim(); + String s = nameMap.get(trim); + if (StringUtils.isBlank(s)) + s = oneNameMap.get(trim); + return s; + } + + public String typeOfCode(String code) { + if (typeMap == null) + typeMap = mapTypes(); + String trim = code.trim(); + String s = typeMap.get(trim); + if (StringUtils.isBlank(s)) + s = oneTypeMap.get(trim); + return s; + } + + private Map mapNames() { + Map res = new HashMap<>(); + List list = super.list(); + list.forEach(entity -> res.put(entity.getCode().trim(), entity.getName().trim())); + return res; + } + + private Map mapTypes() { + Map res = new HashMap<>(); + List list = super.list(); + list.forEach(entity -> res.put(entity.getCode().trim(), entity.getType().trim())); + return res; + } + + public static void clearCache() { + codeList = null; + codeNoJmdList = null; + codeJmdList = null; + nameMap = null; + typeMap = null; + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.java new file mode 100644 index 00000000..c5c7c136 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.java @@ -0,0 +1,73 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.storeinfo; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.yxt.supervise.customer.api.storeinfo.StoreInfo; +import com.yxt.supervise.customer.api.storeinfo.StoreInfoVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoMapper.java
+ * Class: com.supervise.biz.storeinfo.StoreInfoMapper
+ * Description: 门店信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface StoreInfoMapper extends BaseMapper { + + //@Update("update store_info set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from store_info") + List selectListVo(); + @Select("select * from store_info where code =#{code}") + StoreInfo selectByCode(@Param("code")String storeCode); + @Select("select * from store_info where isSjz =1 and(type='连锁内加盟' or type='连网连锁店' or type='配送中心' " + + "or type='连锁外加盟(销配结算)' or type='连锁外加盟(销配结算)')") + List selectLimitStores(); + @Select("select * from store_info where isSjz =1 and code =#{code} and(type='连锁内加盟' or type='连网连锁店' or type='配送中心' " + + "or type='连锁外加盟(销配结算)' or type='连锁外加盟(销配结算)')") + StoreInfo selectByCodeAndLimit(@Param("code")String storeCode); +} \ No newline at end of file diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.xml b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.xml new file mode 100644 index 00000000..1a67c708 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoRest.java new file mode 100644 index 00000000..f6d1dcd1 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoRest.java @@ -0,0 +1,125 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.storeinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.customer.api.storeinfo.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoFeignFallback.java
+ * Class: com.supervise.biz.storeinfo.StoreInfoRest
+ * Description: 门店信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "门店信息") +@RestController("com.supervise.biz.storeinfo.StoreInfoRest") +@RequestMapping("v1/storeinfo") +public class StoreInfoRest implements StoreInfoFeign { + + @Autowired + private StoreInfoService storeInfoService; + + @Override + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = storeInfoService.listPageVo(pq); + return rb.success().setData(pv); + } + + @Override + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody StoreInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + storeInfoService.saveOrUpdateDto(dto); + return rb.success(); + } + + @Override + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + storeInfoService.delBySids(sids); + return rb.success(); + } + + @Override + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + StoreInfoDetailsVo vo = storeInfoService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } + @ApiOperation(" ") + @RequestMapping(value = "/importBrandSort", method = RequestMethod.POST) + public ResultBean importBrandSort(@RequestParam("filename") MultipartFile file, + HttpServletRequest request, HttpServletResponse response){ + ResultBean rb = ResultBean.fireFail(); + String temp = request.getSession().getServletContext() + .getRealPath(File.separator) + + "temp"; // 临时目录 + File tempFile = new File(temp); + if (!tempFile.exists()) { + tempFile.mkdirs(); + } + String name = file.getOriginalFilename();// 获取上传文件名,包括路径 + long size = file.getSize(); + if ((name == null || name.equals("")) && size == 0) + return null; + InputStream in = null; + try { + in = file.getInputStream(); + } catch (IOException e) { + e.printStackTrace(); + } + storeInfoService.readBrandPeriodSorXls1(in,""); + return rb; + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoService.java new file mode 100644 index 00000000..de3b8182 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoService.java @@ -0,0 +1,341 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.storeinfo; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.customer.api.storeinfo.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.CellType; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: StoreInfoService.java
+ * Class: com.supervise.biz.storeinfo.StoreInfoService
+ * Description: 门店信息 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:30
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Slf4j +@Service +public class StoreInfoService extends MybatisBaseService { + private QueryWrapper createQueryWrapper(StoreInfoQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + StoreInfoQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(StoreInfoDto dto) { + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(StoreInfoDto dto) { + StoreInfo entity = new StoreInfo(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(StoreInfoDto dto) { + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + StoreInfo entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public StoreInfoDetailsVo fetchDetailsVoBySid(String sid) { + StoreInfo entity = fetchBySid(sid); + StoreInfoDetailsVo vo = new StoreInfoDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public StoreInfo selectByCode(String storeCode) { + return baseMapper.selectByCode(storeCode); + } + + public void readBrandPeriodSorXls1(InputStream is, String sid) { + HSSFWorkbook hssfWorkbook = null; + try { + hssfWorkbook = new HSSFWorkbook(is); + } catch (IOException e) { + e.printStackTrace(); + } + List lisss = new ArrayList<>(); + List lisss2 = new ArrayList<>(); + HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0); + // 循环行Row + for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { + StoreInfo sd = new StoreInfo(); + HSSFRow hssfRow = hssfSheet.getRow(rowNum); + int i = 0; + try { + if (rowNum >= 1) { + for (; i < hssfRow.getLastCellNum(); i++) { + HSSFCell brandIdHSSFCell = hssfRow.getCell(i); + if (brandIdHSSFCell != null) { + if (i == 1) {//代码 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + StoreInfo storeInfo = baseMapper.selectByCode(value); + if (storeInfo != null) { + sd = storeInfo; +// sd.setIsJoin("1"); + sd.setIsSjz("1"); + } else { + sd.setCode(value); + } + } + } + if (i == 2) {//中文名称 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + if (value.indexOf("]") >= 0) { + String[] split = value.split("]"); + value = split[1]; + } + sd.setName(value); + } + } + if (i == 3) {//单位类型 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setType(value); + } + } + if (i == 4) {//联系人 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setContacts(value); + } + } + if (i == 5) {//电话 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setTelephone(value); + } + } + if (i == 6) {//地址信息1 + brandIdHSSFCell.setCellType(CellType.STRING); + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setAddress(value); + } + if (i == 7) {//经度 + brandIdHSSFCell.setCellType(CellType.STRING); + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setLongitude(value); + } + if (i == 8) {//纬度 + brandIdHSSFCell.setCellType(CellType.STRING); + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setLatitude(value); + } + if (i == 9) {//配货价 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setProductPrice(value); + } + } + if (i == 10) {//区域 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setRegion(value); + } + } + if (i == 11) {//门店经营商品方案 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setProgramme(value); + } + } + if (i == 12) {//组代码 + brandIdHSSFCell.setCellType(CellType.STRING); + if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) { + String value = brandIdHSSFCell.getStringCellValue(); + value = value.trim(); + sd.setGroupCode(value); + } + } + } else { + System.err.println("rowNum=" + rowNum + ",i=" + i + ",value=null"); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + System.err.println("i=" + i + ",value=null"); + } + + lisss.add(rowNum + ""); + if (sd.getId() != null && sd.getId() != 0) { + baseMapper.updateById(sd); + } else { + baseMapper.insert(sd); + } + + log.info("productInformation:{}", JSONObject.toJSONString(sd)); + } + String x = JSON.toJSONString(lisss); + System.out.println(x); + String x1 = JSON.toJSONString(lisss2); + System.out.println(x1); + //return message; + } + + public List selectLimitStores() { + return baseMapper.selectLimitStores(); + } + + public StoreInfo selectByCodeAndLimit(String storeCode) { + return baseMapper.selectByCodeAndLimit(storeCode); + } + + private static List cacheCodeListOfYc = null; //烟草门店的门店编号列表 + private static List cacheCodeListOfYcNoJmd = null; //烟草门店的门店编号列表(不含加盟店) + + public static void clearCacheCodeListOfYc() { + cacheCodeListOfYc = null; + cacheCodeListOfYcNoJmd = null; + } + + public boolean containsCodeOfYc(String code) { + if (StringUtils.isBlank(code)) + return false; + if (cacheCodeListOfYc == null) + cacheCodeListOfYc = listCodeOfYc(); + return cacheCodeListOfYc.contains(code.trim()); + + } + + public boolean containsCodeOfYcNoJmd(String code) { + if (StringUtils.isBlank(code)) + return false; + if (cacheCodeListOfYcNoJmd == null) + cacheCodeListOfYcNoJmd = listCodeOfYcNoJmd(); + return cacheCodeListOfYcNoJmd.contains(code.trim()); + + } + + /** + * 烟草门店列表 + * + * @return + */ + public List listOfYc() { + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("isycjyfw", "1"); + List list = super.list(qw); + return list; + } + + private List listCodeOfYc() { + List res = new ArrayList<>(); + List list = listOfYc(); + list.forEach(entity -> res.add(entity.getCode().trim())); + return res; + } + + /** + * 烟草门店列表(不含加盟店) + * + * @return + */ + public List listOfYcNoJmd() { + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("isycjyfw", "1"); + qw.ne("type", "连锁外加盟(销配结算)"); + qw.ne("type", "连锁外加盟(销配结算)"); + // qw.and(wrapper -> wrapper.ne("type", "连锁外加盟(销配结算)").or().like("remark", query.getName())); + List list = super.list(qw); + return list; + } + + private List listCodeOfYcNoJmd() { + List res = new ArrayList<>(); + List list = listOfYcNoJmd(); + list.forEach(entity -> res.add(entity.getCode().trim())); + return res; + } +} \ No newline at end of file diff --git a/yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/ReportSalesDayLogDto.java b/yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/ReportSalesDayLogDto.java new file mode 100644 index 00000000..f8837e0a --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/ReportSalesDayLogDto.java @@ -0,0 +1,10 @@ +package com.yxt.supervise.report.api.reportsalesdaylog; + +import com.yxt.common.core.dto.Dto; + +/** + * @author wangpengfei + * @date 2023/4/24 17:30 + */ +public class ReportSalesDayLogDto implements Dto { +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/ReportApplication.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/ReportApplication.java index 60ec3590..bb370e9f 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/ReportApplication.java +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/ReportApplication.java @@ -14,7 +14,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; "com.yxt.supervise.report" }) @EnableDiscoveryClient -@EnableFeignClients(basePackages = {"com.yxt.supervise.system"}) +@EnableFeignClients(basePackages = {"com.yxt.supervise.*"}) public class ReportApplication { public static void main(String[] args) {