Browse Source

导入接口

master
wangpengfei 2 years ago
parent
commit
b0599b1111
  1. 74
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragejmd/GdInstorageJmd.java
  2. 33
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelog/GdInstorageLog.java
  3. 25
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstoragelogerr/GdInstorageLogErr.java
  4. 1
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinstorageyc/GdInstorageYc.java
  5. 29
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventorylogerr/GdInventoryLogErr.java
  6. 33
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java
  7. 8
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLog.java
  8. 8
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdlinventorylog/GdIinventoryLogVo.java
  9. 16
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdrescategoryprod/GdRescategoryProd.java
  10. 68
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsalesgd/GdSalesGd.java
  11. 69
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslog/GdSalesLog.java
  12. 38
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdsaleslogerr/GdSalesLogErr.java
  13. 86
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfo.java
  14. 107
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDetailsVo.java
  15. 107
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoDto.java
  16. 76
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeign.java
  17. 70
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoFeignFallback.java
  18. 105
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoQuery.java
  19. 107
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/storeinfo/StoreInfoVo.java
  20. 6
      yxt_supervise/supervise-customer/supervise-customer-biz/pom.xml
  21. 17
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdMapper.java
  22. 12
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdRest.java
  23. 257
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragegd/GdInstorageGdService.java
  24. 72
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdMapper.java
  25. 66
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragejmd/GdInstorageJmdService.java
  26. 9
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogMapper.java
  27. 24
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelog/GdInstorageLogService.java
  28. 9
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrMapper.java
  29. 9
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstoragelogerr/GdInstorageLogErrService.java
  30. 28
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcMapper.java
  31. 3
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorageyc/GdInstorageYcService.java
  32. 13
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java
  33. 42
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.xml
  34. 29
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java
  35. 17
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java
  36. 9
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrMapper.java
  37. 9
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylogerr/GdInventoryLogErrService.java
  38. 55
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkMapper.java
  39. 23
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java
  40. 390
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java
  41. 22
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcMapper.java
  42. 111
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryyc/GdInventoryYcService.java
  43. 47
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdMapper.java
  44. 80
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdrescategoryprod/GdRescategoryProdService.java
  45. 4
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesMapper.java
  46. 8
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesRest.java
  47. 169
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsales/GdSalesService.java
  48. 52
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdMapper.java
  49. 51
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesgd/GdSalesGdService.java
  50. 47
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogMapper.java
  51. 74
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslog/GdSalesLogService.java
  52. 47
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrMapper.java
  53. 47
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsaleslogerr/GdSalesLogErrService.java
  54. 3
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcMapper.java
  55. 3
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdsalesyc/GdSalesYcService.java
  56. 51
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndex.java
  57. 46
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexMapper.java
  58. 180
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeindex/StoreIndexService.java
  59. 73
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.java
  60. 13
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.xml
  61. 125
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoRest.java
  62. 341
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoService.java
  63. 10
      yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/ReportSalesDayLogDto.java
  64. 2
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/ReportApplication.java

74
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 <br/>
* File: GdInstorageJmd.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmd <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/5 10:45 <br/>
*
* @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; // 入库定单号
}

33
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; // 单据日期
}

25
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; // 单据日期
}

1
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; // 采购日期
}

29
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; // 单据日期
}

33
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; // 单据日期
}

8
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 {
}

8
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 {
}

16
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;
}

68
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 <br/>
* File: GdSalesGd.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGd <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:09 <br/>
*
* @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; // 数据日期
}

69
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 <br/>
* File: GdSalesLog.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLog <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:10 <br/>
*
* @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; // 单据日期',
}

38
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 <br/>
* File: GdSalesLogErr.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErr <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:11 <br/>
*
* @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; //商品名称
}

86
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(宇信通监管) <br/>
* File: StoreInfo.java <br/>
* Class: com.supervise.api.storeinfo.StoreInfo <br/>
* Description: 门店信息. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @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;
}

107
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(宇信通监管) <br/>
* File: StoreInfoVo.java <br/>
* Class: com.supervise.api.storeinfo.StoreInfoVo <br/>
* Description: 门店信息 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @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;
}

107
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(宇信通监管) <br/>
* File: StoreInfoDto.java <br/>
* Class: com.supervise.api.storeinfo.StoreInfoDto <br/>
* Description: 门店信息 数据传输对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @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;
}

76
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(宇信通监管) <br/>
* File: StoreInfoFeign.java <br/>
* Class: com.supervise.api.storeinfo.StoreInfoFeign <br/>
* Description: 门店信息. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @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<PagerVo<StoreInfoVo>> listPage(@RequestBody PagerQuery<StoreInfoQuery> 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<StoreInfoDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid);
}

70
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(宇信通监管) <br/>
* File: StoreInfoFeignFallback.java <br/>
* Class: com.supervise.api.storeinfo.StoreInfoFeignFallback <br/>
* Description: 门店信息. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @author dongjianzhao
* @version 1.0
* @since 1.0
*/
@Component
public class StoreInfoFeignFallback implements StoreInfoFeign {
@Override
public ResultBean<PagerVo<StoreInfoVo>> listPage(PagerQuery<StoreInfoQuery> 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<StoreInfoDetailsVo> fetchDetailsBySid(String sid){
ResultBean rb = ResultBean.fireFail();
return rb.setMsg("接口yxt_supervise/storeinfo/fetchDetailsBySid无法访问");
}
}

105
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(宇信通监管) <br/>
* File: StoreInfoQuery.java <br/>
* Class: com.supervise.api.storeinfo.StoreInfoQuery <br/>
* Description: 门店信息 查询条件. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @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;
}

107
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(宇信通监管) <br/>
* File: StoreInfoVo.java <br/>
* Class: com.supervise.api.storeinfo.StoreInfoVo <br/>
* Description: 门店信息 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @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;
}

6
yxt_supervise/supervise-customer/supervise-customer-biz/pom.xml

@ -123,6 +123,12 @@
<classifier>jdk15</classifier>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.yxt.supervise</groupId>
<artifactId>supervise-report-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

17
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<GdInstorageGd> {
IPage<GdInstorageGdVo> selectPageVo(IPage<GdInstorageGd> page, @Param(Constants.WRAPPER) Wrapper<GdInstorageGd> qw);
List<GdInstorageGdExcelVo> exportExcel(@Param(Constants.WRAPPER) Wrapper<GdInstorageGd> 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);
}

12
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<GdInstorageLog> uploadGdData(@RequestParam("file") MultipartFile file) {
return gdInstorageGdService.uploadAndInsert(file);
}
}

257
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<GdInstorageGdMapper, GdInstorageGd> {
@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<GdInstorageGdVo> listPageVo(PagerQuery<GdInstorageGdQuery> pq) {
GdInstorageGdQuery query = pq.getParams();
@ -84,4 +139,206 @@ public class GdInstorageGdService extends MybatisBaseService<GdInstorageGdMapper
List<GdInstorageGdExcelVo> 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<GdInstorageLog> uploadAndInsert(MultipartFile file) {
ResultBean rb = ResultBean.fireFail();
ResultBean<FileUploadResult> 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<GdInstorageGd> toInsertListGd = new ArrayList<>();
private List<GdInstorageYc> toInsertListYc = new ArrayList<>();
private List<GdInstorageJmd> toInsertListJmd = new ArrayList<>();
private List<GdInstorage> toInsertList = new ArrayList<>();
private List<GdInstorageLogErr> 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<Object> 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<Object> 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;
}
}

72
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 <br/>
* File: GdInstorageJmdMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmdMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/5 10:46 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdInstorageJmdMapper extends BaseMapper<GdInstorageJmd> {
@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<Map<String, Object>> 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<Map<String, Object>> listOfProductDay(@Param("orderDate") String orderDate);
}

66
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 <br/>
* File: GdInstorageJmdService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmdService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/5 10:46 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdInstorageJmdService extends ServiceImpl<GdInstorageJmdMapper, GdInstorageJmd> {
public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate);
}
public double amountOfDay(String orderDate) {
return baseMapper.amountOfDay(orderDate);
}
public List<Map<String, Object>> listOfStoreDay(String orderDate) {
return baseMapper.listOfStoreDay(orderDate);
}
public List<Map<String, Object>> listOfProductDay(String orderDate) {
return baseMapper.listOfProductDay(orderDate);
}
}

9
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<GdInstorageLog> {
}

24
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<GdInstorageLogMapper, GdInstorageLog> {
public PagerVo<GdInstorageLog> listPageVo(PagerQuery<GdRukuQuery> pq) {
GdRukuQuery query = pq.getParams();
QueryWrapper<GdInstorageLog> qw = new QueryWrapper<>();
qw.orderByDesc("orderDate");
IPage<GdInstorageLog> page = PagerUtil.queryToPage(pq);
IPage<GdInstorageLog> pagging = baseMapper.selectPage(page, qw);
PagerVo<GdInstorageLog> p = PagerUtil.pageToVo(pagging, null);
return p;
}
}

9
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<GdInstorageLogErr> {
}

9
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<GdInstorageLogErrMapper, GdInstorageLogErr> {
}

28
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<GdInstorageYc> {
IPage<GdInstorageYcVo> selectPageVo(IPage<GdInstorageYc> page, @Param(Constants.WRAPPER) Wrapper<GdInstorageYc> qw);
List<GdInstorageYcExcelVo> exportExcel(@Param(Constants.WRAPPER) Wrapper<GdInstorageYc> 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<Map<String, Object>> 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<Map<String, Object>> listOfJmdProductDay(@Param("orderDate")String orderDate);
}

3
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<GdInstorageYcMapper, GdInstorageYc> {
public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate);
}
public PagerVo<GdInstorageYcVo> listPageVo(PagerQuery<GdInstorageYcQuery> pq) {
GdInstorageYcQuery query = pq.getParams();
QueryWrapper<GdInstorageYc> qw = new QueryWrapper<>();

13
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<GdInventoryLog> {
}

42
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.supervise.customer.biz.gdinstoragegd.GdInstorageGdMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGdVo">
SELECT
colc2,
cold3,
colf5,
coli8,
colk10,
coll11,
colm12,
coln13,
colr17
FROM
gd_instorage_gd
<where>
${ew.sqlSegment}
</where>
order by cold3 desc
</select>
<select id="exportExcel" resultType="com.yxt.supervise.customer.api.gdinstoragegd.GdInstorageGdExcelVo">
SELECT
colc2,
cold3,
coli8,
coll11,
colm12,
coln13,
colr17
FROM
gd_instorage_gd
<where>
${ew.sqlSegment}
</where>
order by cold3 desc
</select>
</mapper>

29
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 {
}

17
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<GdInventoryLogMapper, GdInventoryLog> {
}

9
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<GdInventoryLogErr> {
}

9
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<GdInventoryLogErrMapper, GdInventoryLogErr> {
}

55
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<GdInventoryOk> {
IPage<GdInventoryOkVo> selectPageVo(IPage<GdInventoryOk> page, @Param(Constants.WRAPPER) Wrapper<GdInventoryOk> qw);
//查询导出的数据
List<GdInventoryOkExcelVo> exportExcel(@Param(Constants.WRAPPER) Wrapper<GdInventoryOk> 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<Map<String, Object>> listOfWarehouse();
@Select("select warehouseCode, warehouseName, warehouseType, prodCode, prodBarCode, prodName, prodNum, prodValue from gd_inventory_ok order by warehouseType")
List<Map<String, Object>> 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<Map<String, String>> numberOfProduct();
@Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok")
double amountCurrent();
}

23
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<GdInventoryLog> 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();
}
}

390
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<GdInventoryOkMapper, GdInventoryOk> {
@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<GdInventoryOkVo> listPageVo(PagerQuery<GdInventoryOkQuery> pq) {
GdInventoryOkQuery query = pq.getParams();
QueryWrapper<GdInventoryOk> qw = new QueryWrapper<>();
@ -89,5 +135,339 @@ public class GdInventoryOkService extends MybatisBaseService<GdInventoryOkMapper
List<GdInventoryOkExcelVo> pagging = baseMapper.exportExcel(qw);
return pagging;
}
public ResultBean<GdInventoryLog> uploadAndResetData(MultipartFile file) {
ResultBean rb = ResultBean.fireFail();
ResultBean<FileUploadResult> 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<GdInventoryOk> toInsertList = new ArrayList<>();
private List<GdInventoryYc> toInsertListYc = new ArrayList<>();
private List<GdInventoryLogErr> 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<String, Object> readMapFromRow(List<Object> r) {
Map<String, Object> 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<Object> 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<Object> 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<String, Object> 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<String, Object> 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<Map<String, Object>> 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<String, Object> 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<Map<String, Object>> 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<String, Object> 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<Map<String, Object>> 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<String, Object> 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<Map<String, Object>> 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<String, Object> 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);
}
}

22
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<GdInventoryYc> {
IPage<GdInventoryYcVo> selectPageVo(IPage<GdInventoryYc> page, @Param(Constants.WRAPPER) Wrapper<GdInventoryYc> qw);
//查询导出的数据
List<GdInventoryYcExcelVo> exportExcel(@Param(Constants.WRAPPER) Wrapper<GdInventoryYc> 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<Map<String, Object>> listOfWarehouse();
@Select("select warehouseCode, warehouseName, warehouseType, prodCode, prodBarCode, prodName, prodNum, prodValue from gd_inventory_yc order by warehouseType")
List<Map<String, Object>> 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();
}

111
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<GdInventoryYcMapper, GdInventoryYc> {
@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<Map<String, Object>> listOfWarehouse() {
return baseMapper.listOfWarehouse();
}
public List<Map<String, Object>> listOfProd() {
return baseMapper.listOfProd();
}
public PagerVo<GdInventoryYcVo> listPageVo(PagerQuery<GdInventoryYcQuery> pq) {
GdInventoryYcQuery query = pq.getParams();
QueryWrapper<GdInventoryYc> qw = new QueryWrapper<>();
@ -86,4 +121,80 @@ public class GdInventoryYcService extends MybatisBaseService<GdInventoryYcMapper
List<GdInventoryYcExcelVo> 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<Map<String, Object>> 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<String, Object> 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<Map<String, Object>> 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<String, Object> 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);
}
}

47
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 <br/>
* File: GdRescategoryProdMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinventory.GdRescategoryProdMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/11/30 20:32 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdRescategoryProdMapper extends BaseMapper<GdRescategoryProd> {
}

80
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 <br/>
* File: GdRescategoryProdService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinventory.GdRescategoryProdService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/11/30 20:36 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdRescategoryProdService extends ServiceImpl<GdRescategoryProdMapper, GdRescategoryProd> {
private static List<String> codeList = null;
public List<String> listCode() {
List<String> res = new ArrayList<>();
List<GdRescategoryProd> list = super.list();
list.forEach(entity -> res.add(entity.getProdCode().trim()));
return res;
}
public List<String> 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;
}
}

4
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<GdSales> {
@Delete("delete from gd_sales where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate);
//分页查询销售数据
IPage<GdSalesVo> selectPageVo(IPage<GdSales> page, @Param(Constants.WRAPPER) Wrapper<GdSales> qw);

8
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<GdSalesLog> uploadGdData(@RequestParam("file") MultipartFile file) {
return gdSalesService.uploadAndInsert(file);
}
}

169
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<GdSalesMapper, GdSales> {
@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<GdSalesVo> listPageVo(PagerQuery<GdSalesQuery> pq) {
GdSalesQuery query = pq.getParams();
QueryWrapper<GdSales> qw = new QueryWrapper<>();
@ -91,4 +140,122 @@ public class GdSalesService extends MybatisBaseService<GdSalesMapper, GdSales> {
List<GdSalesExcelVo> pagging = baseMapper.exportExcel(qw);
return pagging;
}
public ResultBean<GdSalesLog> uploadAndInsert(MultipartFile file) {
ResultBean rb = ResultBean.fireFail();
ResultBean<FileUploadResult> 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<GdSalesGd> toInsertListGd = new ArrayList<>();
private List<GdSalesYc> toInsertListYc = new ArrayList<>();
private List<GdSales> toInsertList = new ArrayList<>();
private List<GdSalesLogErr> errList = new ArrayList<>();
private int x = 0, y = 0, errnum = 0;
private String odate = null;
private GdSalesGd rowToEntity(List<Object> 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<Object> 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();
}
};
}
}

52
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 <br/>
* File: GdSalesGdMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGdMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:20 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesGdMapper extends BaseMapper<GdSalesGd> {
@Delete("delete from gd_sales_gd where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate);
}

51
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 <br/>
* File: GdSalesGdService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGdService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:21 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesGdService extends ServiceImpl<GdSalesGdMapper, GdSalesGd> {
public void clearByDataDate(String dataDate) {
baseMapper.clearByDataDate(dataDate);
}
}

47
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 <br/>
* File: GdSalesLogMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:14 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesLogMapper extends BaseMapper<GdSalesLog> {
}

74
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 <br/>
* File: GdSalesLogService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:14 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesLogService extends ServiceImpl<GdSalesLogMapper, GdSalesLog> {
public PagerVo<GdSalesLog> listPageVo(PagerQuery<GdSalesQuery> pq) {
GdSalesQuery query = pq.getParams();
QueryWrapper<GdSalesLog> 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<GdSalesLog> page = PagerUtil.queryToPage(pq);
IPage<GdSalesLog> pagging = baseMapper.selectPage(page, qw);
PagerVo<GdSalesLog> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public GdSalesLog fetchById(String logId) {
return baseMapper.selectById(logId);
}
}

47
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 <br/>
* File: GdSalesLogErrMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErrMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:13 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesLogErrMapper extends BaseMapper<GdSalesLogErr> {
}

47
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 <br/>
* File: GdSalesLogErrService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErrService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:13 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesLogErrService extends ServiceImpl<GdSalesLogErrMapper, GdSalesLogErr> {
}

3
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<GdSalesYc> {
@Delete("delete from gd_sales_yc where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate);
//分页查询销售数据
IPage<GdSalesYcVo> selectPageVo(IPage<GdSalesYc> page, @Param(Constants.WRAPPER) Wrapper<GdSalesYc> qw);

3
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<GdSalesYcMapper,GdSalesYc> {
public void clearByDataDate(String dataDate) {
baseMapper.clearByDataDate(dataDate);
}
public PagerVo<GdSalesYcVo> listPageVo(PagerQuery<GdSalesYcQuery> pq) {
GdSalesYcQuery query = pq.getParams();
QueryWrapper<GdSalesYc> qw = new QueryWrapper<>();

51
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 <br/>
* File: StoreIndex.java <br/>
* Class: com.yxt.supervise.portal.biz.storeindex.StoreIndex <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/1 22:43 <br/>
*
* @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; //类型
}

46
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 <br/>
* File: StoreIndexMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.storeindex.StoreIndexMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/1 22:45 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface StoreIndexMapper extends BaseMapper<StoreIndex> {
}

180
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 <br/>
* File: StoreIndexService.java <br/>
* Class: com.yxt.supervise.portal.biz.storeindex.StoreIndexService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/1 22:45 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class StoreIndexService extends ServiceImpl<StoreIndexMapper, StoreIndex> {
private static List<String> oneCodeList = ListUtil.toLinkedList("101", "199", "112");
private static Map<String, String> oneNameMap = MapUtil.builder(new HashMap<String, String>())
.put("101", "[101]365常温仓")
.put("199", "[199]365配送残品仓")
.put("112", "[112]供应链仓").build();
private static Map<String, String> oneTypeMap = MapUtil.builder(new HashMap<String, String>())
.put("101", "配送中心")
.put("199", "配送中心")
.put("112", "配送中心").build();
private static List<String> codeList = null;
private static List<String> codeNoJmdList = null;
private static List<String> codeJmdList = null;
private static Map<String, String> nameMap = null;
private static Map<String, String> typeMap = null;
public List<String> listCode() {
List<String> res = new ArrayList<>();
List<StoreIndex> list = super.list();
list.forEach(entity -> res.add(entity.getCode().trim()));
return res;
}
public List<String> allStoreCodeList() {
if (codeList == null) {
codeList = this.listCode();
}
return codeList;
}
public List<String> listCodeNoJmd() {
List<String> res = new ArrayList<>();
QueryWrapper<StoreIndex> qw = new QueryWrapper<>();
qw.ne("type", "连锁外加盟(销配结算)");
List<StoreIndex> list = super.list(qw);
list.forEach(entity -> res.add(entity.getCode().trim()));
return res;
}
public List<String> listCodeJmd() {
List<String> res = new ArrayList<>();
QueryWrapper<StoreIndex> qw = new QueryWrapper<>();
qw.eq("type", "连锁外加盟(销配结算)");
List<StoreIndex> 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<String, String> mapNames() {
Map<String, String> res = new HashMap<>();
List<StoreIndex> list = super.list();
list.forEach(entity -> res.put(entity.getCode().trim(), entity.getName().trim()));
return res;
}
private Map<String, String> mapTypes() {
Map<String, String> res = new HashMap<>();
List<StoreIndex> 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;
}
}

73
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(宇信通监管) <br/>
* File: StoreInfoMapper.java <br/>
* Class: com.supervise.biz.storeinfo.StoreInfoMapper <br/>
* Description: 门店信息. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @author dongjianzhao
* @version 1.0
* @since 1.0
*/
@Mapper
public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
//@Update("update store_info set name=#{msg} where id=#{id}")
//IPage<StoreInfoVo> voPage(IPage<StoreInfo> page, @Param(Constants.WRAPPER) QueryWrapper<StoreInfo> qw);
IPage<StoreInfoVo> selectPageVo(IPage<StoreInfo> page, @Param(Constants.WRAPPER) Wrapper<StoreInfo> qw);
List<StoreInfoVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<StoreInfo> qw);
@Select("select * from store_info")
List<StoreInfoVo> 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<StoreInfo> 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);
}

13
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/storeinfo/StoreInfoMapper.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.supervise.customer.biz.storeinfo.StoreInfoMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.supervise.customer.api.storeinfo.StoreInfoVo">
SELECT * FROM store_info <where> ${ew.sqlSegment} </where>
</select>
<select id="selectListAllVo" resultType="com.yxt.supervise.customer.api.storeinfo.StoreInfoVo">
SELECT * FROM store_info <where> ${ew.sqlSegment} </where>
</select>
</mapper>

125
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(宇信通监管) <br/>
* File: StoreInfoFeignFallback.java <br/>
* Class: com.supervise.biz.storeinfo.StoreInfoRest <br/>
* Description: 门店信息. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @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<PagerVo<StoreInfoVo>> listPage(@RequestBody PagerQuery<StoreInfoQuery> pq){
ResultBean rb = ResultBean.fireFail();
PagerVo<StoreInfoVo> 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<StoreInfoDetailsVo> 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;
}
}

341
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(宇信通监管) <br/>
* File: StoreInfoService.java <br/>
* Class: com.supervise.biz.storeinfo.StoreInfoService <br/>
* Description: 门店信息 业务逻辑. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-11 11:40:30 <br/>
*
* @author dongjianzhao
* @version 1.0
* @since 1.0
*/
@Slf4j
@Service
public class StoreInfoService extends MybatisBaseService<StoreInfoMapper, StoreInfo> {
private QueryWrapper<StoreInfo> createQueryWrapper(StoreInfoQuery query) {
// todo: 这里根据具体业务调整查询条件
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
QueryWrapper<StoreInfo> qw = new QueryWrapper<>();
return qw;
}
public PagerVo<StoreInfoVo> listPageVo(PagerQuery<StoreInfoQuery> pq) {
StoreInfoQuery query = pq.getParams();
QueryWrapper<StoreInfo> qw = createQueryWrapper(query);
IPage<StoreInfo> page = PagerUtil.queryToPage(pq);
IPage<StoreInfoVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<StoreInfoVo> 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<String> lisss = new ArrayList<>();
List<String> 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<StoreInfo> selectLimitStores() {
return baseMapper.selectLimitStores();
}
public StoreInfo selectByCodeAndLimit(String storeCode) {
return baseMapper.selectByCodeAndLimit(storeCode);
}
private static List<String> cacheCodeListOfYc = null; //烟草门店的门店编号列表
private static List<String> 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<StoreInfo> listOfYc() {
QueryWrapper<StoreInfo> qw = new QueryWrapper<>();
qw.eq("isycjyfw", "1");
List<StoreInfo> list = super.list(qw);
return list;
}
private List<String> listCodeOfYc() {
List<String> res = new ArrayList<>();
List<StoreInfo> list = listOfYc();
list.forEach(entity -> res.add(entity.getCode().trim()));
return res;
}
/**
* 烟草门店列表(不含加盟店)
*
* @return
*/
public List<StoreInfo> listOfYcNoJmd() {
QueryWrapper<StoreInfo> 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<StoreInfo> list = super.list(qw);
return list;
}
private List<String> listCodeOfYcNoJmd() {
List<String> res = new ArrayList<>();
List<StoreInfo> list = listOfYcNoJmd();
list.forEach(entity -> res.add(entity.getCode().trim()));
return res;
}
}

10
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 {
}

2
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) {

Loading…
Cancel
Save