From cf87e68c4c819fd91116e48f910883218d9ecfd2 Mon Sep 17 00:00:00 2001 From: liupopo Date: Sat, 24 Jun 2023 21:00:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=B1=87=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table_create_report-inventory.sql | 12 +- .../src/api/supervise/gdinventorylog.js | 15 ++ .../views/daydataupload/gdinventory/index.vue | 109 +++++++------- yxt-portal-ui/.env.development | 4 +- yxt-portal-ui/src/views/Home/Home.vue | 4 +- .../src/main/resources/application.yml | 4 +- .../src/main/resources/application.yml | 4 +- .../api/gdinventoryok/GdInventoryLog.java | 33 ----- .../gdinventorylog/GdInventoryLogMapper.java | 15 +- .../gdinventorylog/GdInventoryLogRest.java | 32 ++--- .../gdinventorylog/GdInventoryLogService.java | 101 ++++++++++++- .../ReportInventoryDayGather.java | 129 +++++++++++++++++ .../ReportInventoryDayStore.java | 133 ++++++++++++++++++ .../ReportInventoryDayTobaccoStore.java | 124 ++++++++++++++++ .../biz/gdinventoryok/GdInventoryOkRest.java | 6 +- .../gdinventoryok/GdInventoryOkService.java | 49 ++++--- .../customer/biz/gdsales/GdSalesRest.java | 2 +- .../src/main/resources/application-devv.yml | 6 +- .../src/main/resources/application-test.yml | 3 + .../src/main/resources/application.yml | 4 +- .../xlsx-tmpl/库存汇总表模板.xlsx | Bin 0 -> 11129 bytes .../supervise-report-biz/pom.xml | 6 + .../CsmCashReportCashedTodayMapper.java | 2 + .../CsmCashReportSalesYesterdayMapper.java | 2 + .../CsmCashReportSalesYesterdayService.java | 2 + .../ReportInventoryDayGather.java | 127 ++++++++++++++++- .../ReportInventoryDayGatherMapper.java | 79 +++++++++++ .../ReportInventoryDayGatherService.java | 77 ++++++++++ .../ReportInventoryDayStore.java | 133 ++++++++++++++++++ .../ReportInventoryDayStoreMapper.java | 25 ++++ .../ReportInventoryDayStoreService.java | 31 ++++ .../ReportInventoryDayTobaccoStore.java | 124 ++++++++++++++++ .../ReportInventoryDayTobaccoStoreMapper.java | 25 ++++ ...ReportInventoryDayTobaccoStoreService.java | 31 ++++ .../ReportInventoryService.java | 25 ++++ .../reportinventory/reportInventoryRest.java | 30 ++++ .../report/biz/util/applet/WX_HttpsUtil.java | 3 +- .../src/main/resources/application-devv.yml | 2 +- .../src/main/resources/application-test.yml | 4 +- .../src/main/resources/application.yml | 4 +- .../src/main/resources/application.yml | 4 +- 41 files changed, 1355 insertions(+), 170 deletions(-) delete mode 100644 yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayGather.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayStore.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayTobaccoStore.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表模板.xlsx create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherMapper.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherService.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStore.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreMapper.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreService.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStore.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreMapper.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreService.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryService.java create mode 100644 yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/reportInventoryRest.java diff --git a/docs/databases/table_create_report-inventory.sql b/docs/databases/table_create_report-inventory.sql index 5bc439e2..2fa68038 100644 --- a/docs/databases/table_create_report-inventory.sql +++ b/docs/databases/table_create_report-inventory.sql @@ -9,6 +9,8 @@ CREATE TABLE `report_inventory_day_gather` ( `serialNumber` VARCHAR(100) DEFAULT NULL COMMENT '编号', `reportTime` VARCHAR(100) DEFAULT NULL COMMENT '上报时间', + `sort` int(11) DEFAULT 0 COMMENT '排序', + `storeType` VARCHAR(100) DEFAULT NULL COMMENT '仓库类型', `storeNumber` int(11) DEFAULT 1 COMMENT '仓库数量', `productCountNumber` int(11) DEFAULT 1 COMMENT '品种数量', @@ -30,12 +32,13 @@ CREATE TABLE `report_inventory_day_store` ( `serialNumber` VARCHAR(100) DEFAULT NULL COMMENT '编号', `reportTime` VARCHAR(100) DEFAULT NULL COMMENT '上报时间', - `warehouseType` int(11) DEFAULT NULL COMMENT '仓库类型', + `warehouseType` int(11) DEFAULT 2 COMMENT '仓库类型', `storeCode` VARCHAR(100) DEFAULT NULL COMMENT '门店编号', `storeCodeName` VARCHAR(100) DEFAULT NULL COMMENT '[门店编号]门店名称', - `productCountNumber` int(11) DEFAULT 1 COMMENT '品种数量', + `productCountNumber` int(11) DEFAULT 0 COMMENT '商品数量', `productAmount` DOUBLE(12,2) DEFAULT 0 COMMENT '货值', `countAmount` double(12,2) DEFAULT NULL COMMENT '合计货值', + `countProductNumber` bigint(11) DEFAULT 0 COMMENT '合计品种数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB COMMENT='库存汇总表-仓库库存明细表'; @@ -51,12 +54,13 @@ CREATE TABLE `report_inventory_day_tobacco_store` ( `serialNumber` VARCHAR(100) DEFAULT NULL COMMENT '编号', `reportTime` VARCHAR(100) DEFAULT NULL COMMENT '上报时间', - `warehouseType` int(11) DEFAULT NULL COMMENT '仓库类型', + `warehouseType` int(11) DEFAULT 2 COMMENT '仓库类型', `storeCode` VARCHAR(100) DEFAULT NULL COMMENT '门店编号', `storeCodeName` VARCHAR(100) DEFAULT NULL COMMENT '[门店编号]门店名称', - `productCountNumber` int(11) DEFAULT 1 COMMENT '品种数量', + `productCountNumber` int(11) DEFAULT 0 COMMENT '品种数量', `productAmount` DOUBLE(12,2) DEFAULT 0 COMMENT '货值', `countAmount` double(12,2) DEFAULT NULL COMMENT '合计货值', + `countProductNumber` bigint(11) DEFAULT 0 COMMENT '合计品种数量', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB COMMENT='库存汇总表-烟草仓库库存明细表'; diff --git a/supervise-customer-ui/src/api/supervise/gdinventorylog.js b/supervise-customer-ui/src/api/supervise/gdinventorylog.js index f6c4697a..da1f8864 100644 --- a/supervise-customer-ui/src/api/supervise/gdinventorylog.js +++ b/supervise-customer-ui/src/api/supervise/gdinventorylog.js @@ -55,5 +55,20 @@ export default { method: 'post', data: params }) + }, + // 创建某一天的库存报表 + kcReport: function(params) { + return request({ + baseURL: '/api/report', + url: '/reportinventory/kcReport', + params: params + }) + }, + // 创建某一天的库存报表 + kcExcel: function(params) { + return request({ + url: '/customer/v1/gdinventorylog/kcExcel', + params: params + }) } } diff --git a/supervise-customer-ui/src/views/daydataupload/gdinventory/index.vue b/supervise-customer-ui/src/views/daydataupload/gdinventory/index.vue index 6e174ebe..d1fdd2a9 100644 --- a/supervise-customer-ui/src/views/daydataupload/gdinventory/index.vue +++ b/supervise-customer-ui/src/views/daydataupload/gdinventory/index.vue @@ -85,7 +85,7 @@
{{ hzResultMesssage }}
下载库存汇总文件 - +
@@ -99,6 +99,7 @@ import Pagination from '@/components/pagination' import pageye from '@/components/pagination/pageye' import req from '@/api/supervise/gdinventorylog' + export default { name: 'DaydatauploadGdinventoryLog', components: { @@ -123,22 +124,22 @@ }, tableLoading: false, dataList: [], - btnList: [ - { - type: 'primary', - size: 'small', - icon: 'upload', - btnKey: 'showUploadXlsx', - btnLabel: '上传库存信息' - }, - { - type: 'info', - size: 'small', - icon: 'cross', - btnKey: 'doClose', - btnLabel: '关闭' - }], - dialogVisible: false, + btnList: [{ + type: 'primary', + size: 'small', + icon: 'upload', + btnKey: 'showUploadXlsx', + btnLabel: '上传库存信息' + }, + { + type: 'info', + size: 'small', + icon: 'cross', + btnKey: 'doClose', + btnLabel: '关闭' + } + ], + dialogVisible: false, updateAction: '/api/customer' + '/v1/gdinventoryok/uploadGdData', name: '库存数据导入', fileList: [], @@ -207,19 +208,19 @@ console.log('GdinventoryLog-loadList-ee:', e) }) }, - doClose() { - this.$store.dispatch('tagsView/delView', this.$route) - this.$router.go(-1) - }, - showUploadXlsx() { - this.dialogVisible = true - }, - dialogClose() { - this.currentLog = {} - this.fileList = [] - this.filecandown = true - this.dialogVisible = false - }, + doClose() { + this.$store.dispatch('tagsView/delView', this.$route) + this.$router.go(-1) + }, + showUploadXlsx() { + this.dialogVisible = true + }, + dialogClose() { + this.currentLog = {} + this.fileList = [] + this.filecandown = true + this.dialogVisible = false + }, // 返回 handleReturn() { this.$router.go(-1) @@ -246,31 +247,33 @@ console.log('222', resp) const rdata = resp.data const _this = this - _this.fullscreenloading.text = '数据导入完成,进行汇总' + _this.fullscreenloading.text = '数据导入完成,正在生成报表~' + this.fileList = [] _this.uploadResultMesssage = '共导入数据:' + rdata.allNum + ' 条;普通商品数据:' + rdata.validNum + ' 条;烟草商品数据:' + rdata.errRowNum + ' 条;用时:' + rdata.durations + ' 毫秒。' - - kchz() + const param = { + orderDate: rdata.orderDate + } + req.kcReport(param) .then(res => { - if (this.fullscreenloading) this.fullscreenloading.close() - this.fullscreenloading = null console.log('333', res) - _this.hzFilePath = res.data + _this.fullscreenloading.text = '报表数据完成,创建Excel文件' + + req.kcExcel({ logid: rdata.id }) + .then(res => { + if (this.fullscreenloading) this.fullscreenloading.close() + this.fullscreenloading = null + console.log('444', res) + _this.hzFilePath = res.data.fileUrl + }) + .catch(e => { + if (this.fullscreenloading) this.fullscreenloading.close() + this.fullscreenloading = null + }) }) .catch(e => { if (this.fullscreenloading) this.fullscreenloading.close() this.fullscreenloading = null }) - // kchzyc() - // .then(res => { - // if (this.fullscreenloading) this.fullscreenloading.close() - // this.fullscreenloading = null - // console.log('444', res) - // _this.ychzFilePath = res.data - // }) - // .catch(e => { - // if (this.fullscreenloading) this.fullscreenloading.close() - // this.fullscreenloading = null - // }) }, doDownloadHz() { window.open(this.hzFilePath, '_blank') @@ -291,18 +294,6 @@ }, doDownloadHzYc() { window.open(this.ychzFilePath, '_blank') - }, - resetCache() { - resetAllCache() - .then(res => { - this.$message({ - message: '缓存数据已重置!', - type: 'success' - }) - }) - .catch(e => { - console.log('resetAllCache', e) - }) } } } diff --git a/yxt-portal-ui/.env.development b/yxt-portal-ui/.env.development index 25971c4e..888c35d1 100644 --- a/yxt-portal-ui/.env.development +++ b/yxt-portal-ui/.env.development @@ -5,5 +5,5 @@ ENV = 'development' VUE_APP_BASE_API = '/api' ## 配置测试和本地开发时的 接口地址 -# VUE_APP_URL = "http://127.0.0.1:8112" -VUE_APP_URL = "http://8.130.39.13:8112" +VUE_APP_URL = "http://127.0.0.1:8112" +# VUE_APP_URL = "http://8.130.39.13:8112" diff --git a/yxt-portal-ui/src/views/Home/Home.vue b/yxt-portal-ui/src/views/Home/Home.vue index 438e5e95..e06d4175 100644 --- a/yxt-portal-ui/src/views/Home/Home.vue +++ b/yxt-portal-ui/src/views/Home/Home.vue @@ -440,8 +440,8 @@ if (index === 11) { window.open('/#/index', '_blank') } else if (index === 0) { - // window.open('http://127.0.0.1:9531/#/' + '?token=' + getStorage(), '_blank') - window.open('http://jianguan.yyundong.com/customer/#/' + '?token=' + getStorage(), '_blank') + window.open('http://127.0.0.1:9531/#/' + '?token=' + getStorage(), '_blank') + // window.open('http://jianguan.yyundong.com/customer/#/' + '?token=' + getStorage(), '_blank') } else if (index === 1) { // window.open('http://192.168.3.8:9531#/' + '?token=' + getStorage(), '_blank') window.open('http://jianguan.yyundong.com/report/#/' + '?token=' + getStorage(), '_blank') diff --git a/yxt-supervise-cyf/yxt-supervise-cyf-biz/src/main/resources/application.yml b/yxt-supervise-cyf/yxt-supervise-cyf-biz/src/main/resources/application.yml index 14cccaf6..d1cca09a 100644 --- a/yxt-supervise-cyf/yxt-supervise-cyf-biz/src/main/resources/application.yml +++ b/yxt-supervise-cyf/yxt-supervise-cyf-biz/src/main/resources/application.yml @@ -2,8 +2,8 @@ spring: application: name: yxt-supervise-cyf profiles: - active: devv -# active: test +# active: devv + active: test messages: # 国际化资源文件路径 basename: i18n/messages diff --git a/yxt_supervise/gateway/src/main/resources/application.yml b/yxt_supervise/gateway/src/main/resources/application.yml index 693cf83e..6e56994f 100644 --- a/yxt_supervise/gateway/src/main/resources/application.yml +++ b/yxt_supervise/gateway/src/main/resources/application.yml @@ -12,8 +12,8 @@ spring: application: name: gateway-server profiles: -# active: devv - active: test + active: devv +# active: test cloud: gateway: routes: diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java deleted file mode 100644 index 38dfe962..00000000 --- a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/gdinventoryok/GdInventoryLog.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yxt.supervise.customer.api.gdinventoryok; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.yxt.common.core.domain.EntityWithId; -import lombok.Data; - -import java.util.Date; - -@Data -@TableName("gd_inventory_log") -public class GdInventoryLog extends EntityWithId { - - public GdInventoryLog() { - } - - public GdInventoryLog(String fileFullPath) { - this.fileFullPath = fileFullPath; - } - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime = new Date(); // 记录创建时间/ - private String remarks; // 备注说明/ - private String fileFullPath; // 文件完整路径/ - private String outFilePath; // 汇总文件路径 -// private String outfile; //输出文件名 - private String fileUrl; //文件下载地址 - private int allNum; // 总记录数/ - private int validNum; // 有效记录数/ - private long durations; // 程序运行时长/ - private int errRowNum; // 出错的条数/ - private String orderDate; // 单据日期 -} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java index fa97294d..79c99743 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogMapper.java @@ -2,11 +2,13 @@ package com.yxt.supervise.customer.biz.gdinventorylog; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; -import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryLog; +import com.yxt.supervise.customer.api.gdinventorylog.GdInventoryLog; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; +import java.util.List; + /** * @author wangpengfei * @date 2023/3/29 13:57 @@ -14,5 +16,14 @@ import org.apache.ibatis.annotations.Select; @Mapper public interface GdInventoryLogMapper extends BaseMapper { @Select("select * from gd_inventory_log where orderDate=#{orderDate}") - public GdInstorageLog getLogByOrderDate(@Param("oderDate") String orderDate); + public GdInstorageLog getLogByOrderDate(@Param("orderDate") String orderDate); + + @Select("select * from report_inventory_day_gather where orderDate=#{orderDate} order by sort desc") + List reportInventoryDayGather(@Param("orderDate") String orderDate); + + @Select("select * from report_inventory_day_store where orderDate=#{orderDate} ") + List reportInventoryDayStore(@Param("orderDate") String orderDate); + + @Select("select * from report_inventory_day_tobacco_store where orderDate=#{orderDate} ") + List reportInventoryDayTobaccoStore(@Param("orderDate") String orderDate); } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java index 5477b224..bec4ef55 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogRest.java @@ -1,28 +1,15 @@ package com.yxt.supervise.customer.biz.gdinventorylog; -import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.metadata.IPage; 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.gdinventorylog.GdInventoryLogQuery; -import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryLog; -import com.yxt.supervise.customer.api.gdsales.GdSales; -import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; -import com.yxt.supervise.customer.api.gdsales.GdSalesVo; +import com.yxt.supervise.customer.api.gdinventorylog.GdInventoryLog; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; 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; +import org.springframework.web.bind.annotation.*; /** * @author wangpengfei @@ -43,4 +30,17 @@ public class GdInventoryLogRest { IPage pv = gdInventoryLogService.listPage(pq); return rb.success().setData(pv); } + + @GetMapping("/kcExcel") + public ResultBean kcExcel(@RequestParam("logid") String logid) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(logid)) { + return rb.setMsg("上传日志SID不可为空"); + } + + GdInventoryLog log = gdInventoryLogService.buildExcelById(logid); + if (log == null) + return rb.setMsg("未得到上传日志"); + return rb.success().setData(log); + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java index 15ce4a42..3e18417b 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/GdInventoryLogService.java @@ -1,6 +1,9 @@ package com.yxt.supervise.customer.biz.gdinventorylog; +import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; +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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -8,10 +11,16 @@ import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; import com.yxt.supervise.customer.api.gdinventorylog.GdInventoryLogQuery; -import com.yxt.supervise.customer.api.gdinventoryok.GdInventoryLog; +import com.yxt.supervise.customer.api.gdinventorylog.GdInventoryLog; import lombok.extern.slf4j.Slf4j; +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 * @date 2023/3/29 14:00 @@ -19,6 +28,14 @@ import org.springframework.stereotype.Service; @Slf4j @Service public class GdInventoryLogService extends ServiceImpl { + + @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 GdInstorageLog getLogByOrderDate(String orderDate) { //GdRukuQuery query = pq.getParams(); return baseMapper.getLogByOrderDate(orderDate); @@ -33,11 +50,91 @@ public class GdInventoryLogService extends ServiceImpl iPage = PagerUtil.queryToPage(pq); IPage page = baseMapper.selectPage(iPage, qw); return page; } + + public GdInventoryLog buildExcelById(String logsid) { + GdInventoryLog gdInventoryLog = baseMapper.selectById(logsid); + if (gdInventoryLog == null) + return null; + String orderDate = gdInventoryLog.getOrderDate(); + + String xlsxpath = xlsxtmplPath + "库存汇总表模板.xlsx"; + File srcFile = FileUtil.file(xlsxpath); + String tfile = "kchzb/库存汇总表" + orderDate + ".xlsx"; + + String url = urlPrefix + tfile; + String toFileName = uploadPath + tfile; + File file = FileUtil.file(toFileName); + FileUtil.copy(srcFile, file, true); + + ExcelWriter writer = ExcelUtil.getWriter(file); + + List gatherList = baseMapper.reportInventoryDayGather(orderDate); + if (gatherList != null && !gatherList.isEmpty()) { + ReportInventoryDayGather gather = gatherList.get(0); + // 库存汇总日报表 + writer.setSheet(0); + writer.writeCellValue(0, 1, "编号:" + gather.getSerialNumber()); + writer.writeCellValue(3, 1, gather.getReportTime()); + int countRow = gatherList.size() + 3; + for (int y = 3; y < countRow; y++) { + ReportInventoryDayGather map = gatherList.get(y - 3); + writer.writeCellValue(0, y, map.getStoreType()); + writer.writeCellValue(1, y, map.getStoreNumber()); + writer.writeCellValue(2, y, map.getProductCountNumber()); + writer.writeCellValue(3, y, map.getProductAmount()); + } + writer.writeCellValue(0, countRow, "合计"); + writer.writeCellValue(3, countRow, gather.getCountAmount()); + } + + List storeList = baseMapper.reportInventoryDayStore(orderDate); + if (storeList != null && !storeList.isEmpty()) { + ReportInventoryDayStore store = storeList.get(0); + // 仓库库存明细表 + writer.setSheet(1); + int countRow = storeList.size() + 1; + for (int y = 1; y < countRow; y++) { + ReportInventoryDayStore map = storeList.get(y - 1); + writer.writeCellValue(0, y, map.getStoreCodeName()); + writer.writeCellValue(1, y, map.getProductCountNumber()); + writer.writeCellValue(2, y, map.getProductAmount()); + } + writer.writeCellValue(0, countRow, "总计"); + writer.writeCellValue(1, countRow, store.getCountProductNumber()); + writer.writeCellValue(2, countRow, store.getCountAmount()); + } + + List ycList = baseMapper.reportInventoryDayTobaccoStore(orderDate); + if (ycList != null && !ycList.isEmpty()) { + ReportInventoryDayTobaccoStore store = ycList.get(0); + // 烟草仓库库存明细表 + writer.setSheet(2); + int countRow = ycList.size() + 1; + for (int y = 1; y < countRow; y++) { + ReportInventoryDayTobaccoStore map = ycList.get(y - 1); + writer.writeCellValue(0, y, map.getStoreCodeName()); + writer.writeCellValue(1, y, map.getProductCountNumber()); + writer.writeCellValue(2, y, map.getProductAmount()); + } + writer.writeCellValue(0, countRow, "总计"); + writer.writeCellValue(1, countRow, store.getCountProductNumber()); + writer.writeCellValue(2, countRow, store.getCountAmount()); + } + + writer.flush(); + writer.close(); + + gdInventoryLog.setFileFullPath(tfile); + gdInventoryLog.setFileUrl(url); + baseMapper.updateById(gdInventoryLog); + return gdInventoryLog; + + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayGather.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayGather.java new file mode 100644 index 00000000..75d4c9a9 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayGather.java @@ -0,0 +1,129 @@ +package com.yxt.supervise.customer.biz.gdinventorylog; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; + +import java.util.Date; + +@TableName("report_inventory_day_gather") +public class ReportInventoryDayGather extends EntityWithId { + + public ReportInventoryDayGather() { + } + + public ReportInventoryDayGather(String storeType) { + this.storeType = storeType; + } + + public ReportInventoryDayGather(String orderDate, String serialNumber, String reportTime, String storeType) { + this.orderDate = orderDate; + this.serialNumber = serialNumber; + this.reportTime = reportTime; + this.storeType = storeType; + } + + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime = new Date(); // 记录创建时间 + private String remarks; // 备注说明 + private String orderDate; // 单据日期 + private String serialNumber; // 编号 + private String reportTime; // 上报时间 + private int sort = 0; // 排序 + private String storeType; // 仓库类型 + private int storeNumber = 1; // 仓库数量 + private int productCountNumber = 1; // 品种数量 + private double productAmount; // 货值 + private double countAmount; // 合计货值 + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getOrderDate() { + return orderDate; + } + + public void setOrderDate(String orderDate) { + this.orderDate = orderDate; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getReportTime() { + return reportTime; + } + + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } + + public int getSort() { + return sort; + } + + public void setSort(int sort) { + this.sort = sort; + } + + public String getStoreType() { + return storeType; + } + + public void setStoreType(String storeType) { + this.storeType = storeType; + } + + public int getStoreNumber() { + return storeNumber; + } + + public void setStoreNumber(int storeNumber) { + this.storeNumber = storeNumber; + } + + public int getProductCountNumber() { + return productCountNumber; + } + + public void setProductCountNumber(int productCountNumber) { + this.productCountNumber = productCountNumber; + } + + public double getProductAmount() { + return productAmount; + } + + public void setProductAmount(double productAmount) { + this.productAmount = productAmount; + } + + public double getCountAmount() { + return countAmount; + } + + public void setCountAmount(double countAmount) { + this.countAmount = countAmount; + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayStore.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayStore.java new file mode 100644 index 00000000..f6d5eb5e --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayStore.java @@ -0,0 +1,133 @@ +package com.yxt.supervise.customer.biz.gdinventorylog; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; + +import java.util.Date; + + +@TableName("report_inventory_day_store") +public class ReportInventoryDayStore extends EntityWithId { + public ReportInventoryDayStore() { + } + + public ReportInventoryDayStore(String orderDate, String storeCode, String storeCodeName) { + this.orderDate = orderDate; + this.storeCode = storeCode; + this.storeCodeName = storeCodeName; + } + + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime = new Date(); // 记录创建时间 + private String remarks; // 备注说明', + private String orderDate; // 单据日期', + private String serialNumber; // 编号', + private String reportTime; // 上报时间', + private int warehouseType = 2; // 仓库类型', + private String storeCode; // 门店编号', + private String storeCodeName; // [门店编号]门店名称', + private int productCountNumber; // 品种数量', + private double productAmount; // 货值', + private double countAmount; // 合计货值', + private long countProductNumber; // 合计品种数量', + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getOrderDate() { + return orderDate; + } + + public void setOrderDate(String orderDate) { + this.orderDate = orderDate; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getReportTime() { + return reportTime; + } + + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } + + public int getWarehouseType() { + return warehouseType; + } + + public void setWarehouseType(int warehouseType) { + this.warehouseType = warehouseType; + } + + public String getStoreCode() { + return storeCode; + } + + public void setStoreCode(String storeCode) { + this.storeCode = storeCode; + } + + public String getStoreCodeName() { + return storeCodeName; + } + + public void setStoreCodeName(String storeCodeName) { + this.storeCodeName = storeCodeName; + } + + public int getProductCountNumber() { + return productCountNumber; + } + + public void setProductCountNumber(int productCountNumber) { + this.productCountNumber = productCountNumber; + } + + public double getProductAmount() { + return productAmount; + } + + public void setProductAmount(double productAmount) { + this.productAmount = productAmount; + } + + public double getCountAmount() { + return countAmount; + } + + public void setCountAmount(double countAmount) { + this.countAmount = countAmount; + } + + public long getCountProductNumber() { + return countProductNumber; + } + + public void setCountProductNumber(long countProductNumber) { + this.countProductNumber = countProductNumber; + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayTobaccoStore.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayTobaccoStore.java new file mode 100644 index 00000000..2f20f37e --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventorylog/ReportInventoryDayTobaccoStore.java @@ -0,0 +1,124 @@ +package com.yxt.supervise.customer.biz.gdinventorylog; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; + +import java.util.Date; + +@TableName("report_inventory_day_tobacco_store") +public class ReportInventoryDayTobaccoStore extends EntityWithId { + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime = new Date(); // 记录创建时间 + private String remarks ; // 备注说明 + private String orderDate ; // 单据日期 + private String serialNumber ; // 编号 + private String reportTime ; // 上报时间 + private int warehouseType=2; // 仓库类型 + private String storeCode ; // 门店编号 + private String storeCodeName ; // [门店编号]门店名称 + private int productCountNumber; // 品种数量 + private double productAmount; // 货值 + private double countAmount; // 合计货值 + private long countProductNumber; // 合计品种数量 + + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getOrderDate() { + return orderDate; + } + + public void setOrderDate(String orderDate) { + this.orderDate = orderDate; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getReportTime() { + return reportTime; + } + + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } + + public int getWarehouseType() { + return warehouseType; + } + + public void setWarehouseType(int warehouseType) { + this.warehouseType = warehouseType; + } + + public String getStoreCode() { + return storeCode; + } + + public void setStoreCode(String storeCode) { + this.storeCode = storeCode; + } + + public String getStoreCodeName() { + return storeCodeName; + } + + public void setStoreCodeName(String storeCodeName) { + this.storeCodeName = storeCodeName; + } + + public int getProductCountNumber() { + return productCountNumber; + } + + public void setProductCountNumber(int productCountNumber) { + this.productCountNumber = productCountNumber; + } + + public double getProductAmount() { + return productAmount; + } + + public void setProductAmount(double productAmount) { + this.productAmount = productAmount; + } + + public double getCountAmount() { + return countAmount; + } + + public void setCountAmount(double countAmount) { + this.countAmount = countAmount; + } + + public long getCountProductNumber() { + return countProductNumber; + } + + public void setCountProductNumber(long countProductNumber) { + this.countProductNumber = countProductNumber; + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java index 74ff39a9..dbd3d4b6 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkRest.java @@ -4,17 +4,13 @@ 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.gdinventorylog.GdInventoryLog; import com.yxt.supervise.customer.api.gdinventoryok.*; -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.gdinstoragegd.GdInstorageGdService; import com.yxt.supervise.customer.biz.gdinstoragelog.GdInstorageLogService; import com.yxt.supervise.customer.biz.gdinventorylog.GdInventoryLogService; import com.yxt.supervise.customer.biz.gdinventoryyc.GdInventoryYcService; import com.yxt.supervise.customer.biz.gdsaleslog.GdSalesLogService; -//import com.yxt.supervise.customer.kafka.messageproducer.MessageProducerRest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java index 65390dc0..d5ebea42 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java @@ -1,19 +1,15 @@ package com.yxt.supervise.customer.biz.gdinventoryok; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.ListUtil; 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.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.read.builder.ExcelReaderBuilder; import com.alibaba.excel.read.listener.ReadListener; -import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.yxt.common.base.config.component.FileUploadComponent; @@ -23,31 +19,22 @@ 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.gdinventorylogerr.GdInventoryLogErr; +import com.yxt.supervise.customer.api.gdinventorylog.GdInventoryLog; 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.api.purchaserequisition.PurchaseRequisition; -import com.yxt.supervise.customer.api.purchaserequisitionpro.PurchaseRequisitionPro; 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 com.yxt.supervise.customer.tools.StrTool; 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.io.File; -import java.math.BigDecimal; import java.util.*; /** @@ -156,7 +143,7 @@ public class GdInventoryOkService extends MybatisBaseService toInsertList = new ArrayList<>(); + private List toInsertListYc = new ArrayList<>(); private boolean checkYcProd(String typeCode) { if (StrUtil.isBlank(typeCode)) @@ -184,6 +172,7 @@ public class GdInventoryOkService extends MybatisBaseService= BATCH_COUNT) { + gdInventoryYcService.saveBatch(toInsertListYc); + // 存储完成清理 list + toInsertListYc.clear(); + } + } else { z++; - } - - toInsertList.add(obj); - // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM - if (toInsertList.size() >= BATCH_COUNT) { - GdInventoryOkService.this.saveBatch(toInsertList); - // 存储完成清理 list - toInsertList.clear();; + toInsertList.add(obj); + // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM + if (toInsertList.size() >= BATCH_COUNT) { + GdInventoryOkService.this.saveBatch(toInsertList); + // 存储完成清理 list + toInsertList.clear(); + } } } } @@ -214,6 +210,9 @@ public class GdInventoryOkService extends MybatisBaseServicelg) zmTRQwa-T*~WZ*R~naI1p`14B*I3xCYp1SdbNM!~9e-YJ~)Yt=MRYXxh={yOfLK+m~ zrAjHQ4NgB+Jc|c*7#Hprsfh^lhb`*FpHt3b3vH^nA9U%G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378~E33p#*ws}Yu21tG zq6CV@0zV`JAG}$?*m(W2Ji57q z{OhFfbGP@y+`xCw`;8ygcpfi!4+wyZ3SReKwymp}mk0^q;=rXu-|G5c-cKT}O! z!RU8;WxWLu{u_4Q4*C|HUUhyCTKt#Jug&zo27BGDzuW6zukCMaynjCATRz^a@bB@+ z{;u{fcHZ0BzGaX7(QbHI-hU1HZ!Xze^|u_TKk6S|z~qnmUyP{#_0TUG|7x!f9SHIZ ziT;Kr~j6}^2ZA13oY!$ZGW4=FDt*;EN`v6 kWgGmlQuP8D|G^5w>nR{D2Koy)kYA38*q1p^lD_KwKVS+38vpfastcsv 2.2.1 + + net.sf.json-lib + json-lib + jdk15 + 2.4 + diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportcashedtoday/CsmCashReportCashedTodayMapper.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportcashedtoday/CsmCashReportCashedTodayMapper.java index 7cfc19a1..bd9c740f 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportcashedtoday/CsmCashReportCashedTodayMapper.java +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportcashedtoday/CsmCashReportCashedTodayMapper.java @@ -2,10 +2,12 @@ package com.yxt.supervise.report.biz.csmcashreportcashedtoday; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.yxt.supervise.report.api.csmcashreportcashedtoday.CsmCashReportCashedToday; +import org.apache.ibatis.annotations.Mapper; /** * @author wangpengfei * @date 2023/6/21 10:56 */ +@Mapper public interface CsmCashReportCashedTodayMapper extends BaseMapper { } diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayMapper.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayMapper.java index ca1f8d8d..c3a99d7f 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayMapper.java +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayMapper.java @@ -2,10 +2,12 @@ package com.yxt.supervise.report.biz.csmcashreportsalesyesterday; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.yxt.supervise.report.api.csmcashreportsalesyesterday.CsmCashReportSalesYesterday; +import org.apache.ibatis.annotations.Mapper; /** * @author wangpengfei * @date 2023/6/21 10:57 */ +@Mapper public interface CsmCashReportSalesYesterdayMapper extends BaseMapper { } diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayService.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayService.java index cfd37a9d..0b871125 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayService.java +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/csmcashreportsalesyesterday/CsmCashReportSalesYesterdayService.java @@ -5,11 +5,13 @@ import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.core.result.ResultBean; import com.yxt.supervise.report.api.csmcashreportcashedtoday.CsmCashReportCashedTodayDto; import com.yxt.supervise.report.api.csmcashreportsalesyesterday.CsmCashReportSalesYesterday; +import org.springframework.stereotype.Service; /** * @author wangpengfei * @date 2023/6/21 10:57 */ +@Service public class CsmCashReportSalesYesterdayService extends MybatisBaseService { public ResultBean save(CsmCashReportCashedTodayDto dto) { ResultBean rb=new ResultBean(); diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGather.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGather.java index 69ead614..3599383f 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGather.java +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGather.java @@ -1,4 +1,129 @@ package com.yxt.supervise.report.biz.reportinventory; -public class ReportInventoryDayGather { +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; + +import java.util.Date; + +@TableName("report_inventory_day_gather") +public class ReportInventoryDayGather extends EntityWithId { + + public ReportInventoryDayGather() { + } + + public ReportInventoryDayGather(String storeType) { + this.storeType = storeType; + } + + public ReportInventoryDayGather(String orderDate, String serialNumber, String reportTime, String storeType) { + this.orderDate = orderDate; + this.serialNumber = serialNumber; + this.reportTime = reportTime; + this.storeType = storeType; + } + + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime = new Date(); // 记录创建时间 + private String remarks; // 备注说明 + private String orderDate; // 单据日期 + private String serialNumber; // 编号 + private String reportTime; // 上报时间 + private int sort = 0; // 排序 + private String storeType; // 仓库类型 + private int storeNumber = 1; // 仓库数量 + private int productCountNumber = 1; // 品种数量 + private double productAmount; // 货值 + private double countAmount; // 合计货值 + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getOrderDate() { + return orderDate; + } + + public void setOrderDate(String orderDate) { + this.orderDate = orderDate; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getReportTime() { + return reportTime; + } + + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } + + public int getSort() { + return sort; + } + + public void setSort(int sort) { + this.sort = sort; + } + + public String getStoreType() { + return storeType; + } + + public void setStoreType(String storeType) { + this.storeType = storeType; + } + + public int getStoreNumber() { + return storeNumber; + } + + public void setStoreNumber(int storeNumber) { + this.storeNumber = storeNumber; + } + + public int getProductCountNumber() { + return productCountNumber; + } + + public void setProductCountNumber(int productCountNumber) { + this.productCountNumber = productCountNumber; + } + + public double getProductAmount() { + return productAmount; + } + + public void setProductAmount(double productAmount) { + this.productAmount = productAmount; + } + + public double getCountAmount() { + return countAmount; + } + + public void setCountAmount(double countAmount) { + this.countAmount = countAmount; + } } diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherMapper.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherMapper.java new file mode 100644 index 00000000..7e5c8f20 --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherMapper.java @@ -0,0 +1,79 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +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; + +@Mapper +public interface ReportInventoryDayGatherMapper extends BaseMapper { + + @Delete("delete from report_inventory_day_gather where orderDate=#{orderDate} ") + void clearDay(@Param("orderDate") String orderDate); + + @Select("select " + + " warehouseCode, " + + " max(warehouseName) warehouseName " + + "from gd_inventory_ok gio where warehouseType=1 " + + "group by warehouseCode ") + List> warehouseList(); + + @Select("select count(1) from ( " + + "select " + + " prodCode " + + "from gd_inventory_ok gio where warehouseCode=#{warehouseCode} " + + "group by prodCode " + + ") t ") + int whProduct(@Param("warehouseCode") String warehouseCode); + + @Select("select " + + " sum(prodValue) " + + "from gd_inventory_ok gio where warehouseCode=#{warehouseCode} ") + double whAmount(@Param("warehouseCode") String warehouseCode); + + @Select("select count(1) from ( " + + "select " + + " warehouseCode " + + "from gd_inventory_ok gio where warehouseType=2 " + + "group by warehouseCode " + + ") t ") + int countStoreNumber(); + + @Select("select count(1) from ( " + + "select " + + " prodCode " + + "from gd_inventory_ok gio where warehouseType=2 " + + "group by prodCode " + + ") t") + int countProductCountNumber(); + + @Select("select " + + " sum(prodValue) " + + "from gd_inventory_ok gio where warehouseType=2") + double countProductAmount(); + + @Select("select count(1) from ( " + + "select " + + " warehouseCode " + + "from gd_inventory_yc giy where warehouseType=2 " + + "group by warehouseCode " + + ") t") + int countStoreNumberYc(); + + @Select("select count(1) from ( " + + "select " + + " prodCode " + + "from gd_inventory_yc giy where warehouseType=2 " + + "group by prodCode " + + ") t") + int countProductCountNumberYc(); + + @Select("select " + + " sum(prodValue) " + + "from gd_inventory_yc giy where warehouseType=2 ") + double countProductAmountYc(); +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherService.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherService.java new file mode 100644 index 00000000..19c3631c --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayGatherService.java @@ -0,0 +1,77 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service +public class ReportInventoryDayGatherService extends ServiceImpl { + public void clearAndBuildOfDay(String orderDate) { + baseMapper.clearDay(orderDate); + + List whInList = new ArrayList<>(); + + double countAmount = 0.0; + String serialNumber = "" + System.currentTimeMillis(); + String reportTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm"); + + List> whList = baseMapper.warehouseList(); + for (Map map : whList) { + String warehouseCode = map.get("warehouseCode"); + String warehouseName = map.get("warehouseName"); + String type = "[" + warehouseCode + "]" + warehouseName; + ReportInventoryDayGather ridg = new ReportInventoryDayGather(orderDate, serialNumber, reportTime, type); + if ("112".equals(warehouseCode)) + ridg.setSort(9); + else if ("101".equals(warehouseCode)) + ridg.setSort(8); + else + ridg.setSort(7); + + int productCountNumber = baseMapper.whProduct(warehouseCode); + ridg.setProductCountNumber(productCountNumber); + + double productAmount = baseMapper.whAmount(warehouseCode); + ridg.setProductAmount(productAmount); + countAmount = countAmount + productAmount; + + whInList.add(ridg); + } + String type1 = "36524集团门店仓"; + ReportInventoryDayGather ridg1 = new ReportInventoryDayGather(orderDate, serialNumber, reportTime, type1); + ridg1.setSort(2); + int storeNumber = baseMapper.countStoreNumber(); + ridg1.setStoreNumber(storeNumber); + int productCountNumber = baseMapper.countProductCountNumber(); + ridg1.setProductCountNumber(productCountNumber); + double productAmount = baseMapper.countProductAmount(); + ridg1.setProductAmount(productAmount); + countAmount = countAmount + productAmount; + + whInList.add(ridg1); + + String typeYc = "36524集团门店仓"; + ReportInventoryDayGather ridgYc = new ReportInventoryDayGather(orderDate, serialNumber, reportTime, typeYc); + ridgYc.setSort(1); + int storeNumberYc = baseMapper.countStoreNumberYc(); + ridgYc.setStoreNumber(storeNumberYc); + int productCountNumberYc = baseMapper.countProductCountNumberYc(); + ridgYc.setProductCountNumber(productCountNumberYc); + double productAmountYc = baseMapper.countProductAmountYc(); + ridgYc.setProductAmount(productAmountYc); + countAmount = countAmount + productAmountYc; + + whInList.add(ridgYc); + + for (ReportInventoryDayGather ri : whInList) { + ri.setCountAmount(countAmount); + } + + super.saveBatch(whInList); + } +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStore.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStore.java new file mode 100644 index 00000000..76852634 --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStore.java @@ -0,0 +1,133 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; + +import java.util.Date; + + +@TableName("report_inventory_day_store") +public class ReportInventoryDayStore extends EntityWithId { + public ReportInventoryDayStore() { + } + + public ReportInventoryDayStore(String orderDate, String storeCode, String storeCodeName) { + this.orderDate = orderDate; + this.storeCode = storeCode; + this.storeCodeName = storeCodeName; + } + + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime = new Date(); // 记录创建时间 + private String remarks; // 备注说明', + private String orderDate; // 单据日期', + private String serialNumber; // 编号', + private String reportTime; // 上报时间', + private int warehouseType = 2; // 仓库类型', + private String storeCode; // 门店编号', + private String storeCodeName; // [门店编号]门店名称', + private int productCountNumber; // 品种数量', + private double productAmount; // 货值', + private double countAmount; // 合计货值', + private long countProductNumber; // 合计品种数量', + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getOrderDate() { + return orderDate; + } + + public void setOrderDate(String orderDate) { + this.orderDate = orderDate; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getReportTime() { + return reportTime; + } + + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } + + public int getWarehouseType() { + return warehouseType; + } + + public void setWarehouseType(int warehouseType) { + this.warehouseType = warehouseType; + } + + public String getStoreCode() { + return storeCode; + } + + public void setStoreCode(String storeCode) { + this.storeCode = storeCode; + } + + public String getStoreCodeName() { + return storeCodeName; + } + + public void setStoreCodeName(String storeCodeName) { + this.storeCodeName = storeCodeName; + } + + public int getProductCountNumber() { + return productCountNumber; + } + + public void setProductCountNumber(int productCountNumber) { + this.productCountNumber = productCountNumber; + } + + public double getProductAmount() { + return productAmount; + } + + public void setProductAmount(double productAmount) { + this.productAmount = productAmount; + } + + public double getCountAmount() { + return countAmount; + } + + public void setCountAmount(double countAmount) { + this.countAmount = countAmount; + } + + public long getCountProductNumber() { + return countProductNumber; + } + + public void setCountProductNumber(long countProductNumber) { + this.countProductNumber = countProductNumber; + } +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreMapper.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreMapper.java new file mode 100644 index 00000000..0d51094f --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreMapper.java @@ -0,0 +1,25 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +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; + +@Mapper +public interface ReportInventoryDayStoreMapper extends BaseMapper { + + @Delete("delete from report_inventory_day_store where orderDate=#{orderDate} ") + void clearDay(@Param("orderDate") String orderDate); + + @Select("select " + + " warehouseCode storeCode, " + + " max(warehouseName) storeCodeName, " + + " sum(prodNum) productCountNumber, " + + " sum(prodValue) productAmount " + + "from gd_inventory_ok gio where warehouseType=2 " + + "group by warehouseCode ") + List listCountStore(); +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreService.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreService.java new file mode 100644 index 00000000..4f01dcf4 --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayStoreService.java @@ -0,0 +1,31 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ReportInventoryDayStoreService extends ServiceImpl { + public void clearAndBuildOfDay(String orderDate) { + baseMapper.clearDay(orderDate); + + List list = baseMapper.listCountStore(); + + double countAmount = 0.0; // 合计货值', + long countProductNumber = 0; //合计品种数量', + + for (ReportInventoryDayStore rid : list) { + rid.setOrderDate(orderDate); + countAmount = countAmount + rid.getProductAmount(); + countProductNumber = countProductNumber + rid.getProductCountNumber(); + } + for (ReportInventoryDayStore rid : list) { + rid.setCountAmount(countAmount); + rid.setCountProductNumber(countProductNumber); + } + + super.saveBatch(list); + + } +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStore.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStore.java new file mode 100644 index 00000000..fb787ab8 --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStore.java @@ -0,0 +1,124 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; + +import java.util.Date; + +@TableName("report_inventory_day_tobacco_store") +public class ReportInventoryDayTobaccoStore extends EntityWithId { + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime = new Date(); // 记录创建时间 + private String remarks ; // 备注说明 + private String orderDate ; // 单据日期 + private String serialNumber ; // 编号 + private String reportTime ; // 上报时间 + private int warehouseType=2; // 仓库类型 + private String storeCode ; // 门店编号 + private String storeCodeName ; // [门店编号]门店名称 + private int productCountNumber; // 品种数量 + private double productAmount; // 货值 + private double countAmount; // 合计货值 + private long countProductNumber; // 合计品种数量 + + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getOrderDate() { + return orderDate; + } + + public void setOrderDate(String orderDate) { + this.orderDate = orderDate; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getReportTime() { + return reportTime; + } + + public void setReportTime(String reportTime) { + this.reportTime = reportTime; + } + + public int getWarehouseType() { + return warehouseType; + } + + public void setWarehouseType(int warehouseType) { + this.warehouseType = warehouseType; + } + + public String getStoreCode() { + return storeCode; + } + + public void setStoreCode(String storeCode) { + this.storeCode = storeCode; + } + + public String getStoreCodeName() { + return storeCodeName; + } + + public void setStoreCodeName(String storeCodeName) { + this.storeCodeName = storeCodeName; + } + + public int getProductCountNumber() { + return productCountNumber; + } + + public void setProductCountNumber(int productCountNumber) { + this.productCountNumber = productCountNumber; + } + + public double getProductAmount() { + return productAmount; + } + + public void setProductAmount(double productAmount) { + this.productAmount = productAmount; + } + + public double getCountAmount() { + return countAmount; + } + + public void setCountAmount(double countAmount) { + this.countAmount = countAmount; + } + + public long getCountProductNumber() { + return countProductNumber; + } + + public void setCountProductNumber(long countProductNumber) { + this.countProductNumber = countProductNumber; + } +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreMapper.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreMapper.java new file mode 100644 index 00000000..800b577e --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreMapper.java @@ -0,0 +1,25 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +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; + +@Mapper +public interface ReportInventoryDayTobaccoStoreMapper extends BaseMapper { + + @Delete("delete from report_inventory_day_tobacco_store where orderDate=#{orderDate} ") + void clearDay(@Param("orderDate") String orderDate); + + @Select("select " + + " warehouseCode storeCode, " + + " max(warehouseName) storeCodeName, " + + " sum(prodNum) productCountNumber, " + + " sum(prodValue) productAmount " + + "from gd_inventory_yc giy where warehouseType=2 " + + "group by warehouseCode ") + List listCountStore(); +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreService.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreService.java new file mode 100644 index 00000000..a2dc5b04 --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryDayTobaccoStoreService.java @@ -0,0 +1,31 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ReportInventoryDayTobaccoStoreService extends ServiceImpl { + public void clearAndBuildOfDay(String orderDate) { + + baseMapper.clearDay(orderDate); + + List list = baseMapper.listCountStore(); + + double countAmount = 0.0; // 合计货值', + long countProductNumber = 0; //合计品种数量', + + for (ReportInventoryDayTobaccoStore rid : list) { + rid.setOrderDate(orderDate); + countAmount = countAmount + rid.getProductAmount(); + countProductNumber = countProductNumber + rid.getProductCountNumber(); + } + for (ReportInventoryDayTobaccoStore rid : list) { + rid.setCountAmount(countAmount); + rid.setCountProductNumber(countProductNumber); + } + + super.saveBatch(list); + } +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryService.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryService.java new file mode 100644 index 00000000..9759c3a7 --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/ReportInventoryService.java @@ -0,0 +1,25 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +public class ReportInventoryService { + + @Autowired + private ReportInventoryDayGatherService reportInventoryDayGatherService; + @Autowired + private ReportInventoryDayStoreService reportInventoryDayStoreService; + @Autowired + private ReportInventoryDayTobaccoStoreService reportInventoryDayTobaccoStoreService; + + + public void buildInventoryReportByDay(String orderDate) { + reportInventoryDayGatherService.clearAndBuildOfDay(orderDate); + reportInventoryDayStoreService.clearAndBuildOfDay(orderDate); + reportInventoryDayTobaccoStoreService.clearAndBuildOfDay(orderDate); + } +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/reportInventoryRest.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/reportInventoryRest.java new file mode 100644 index 00000000..7ec6fbf1 --- /dev/null +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportinventory/reportInventoryRest.java @@ -0,0 +1,30 @@ +package com.yxt.supervise.report.biz.reportinventory; + +import com.yxt.common.core.result.ResultBean; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController("com.yxt.supervise.report.biz.reportinventory.reportInventoryRest") +@RequestMapping("/reportinventory") +public class reportInventoryRest { + + @Autowired + private ReportInventoryService reportInventoryService; + + @GetMapping("/kcReport") + public ResultBean kcReport(@RequestParam("orderDate") String orderDate) { + ResultBean rb = ResultBean.fireFail(); + if(StringUtils.isBlank(orderDate)){ + return rb.setMsg("数据日期不可为空"); + } + if(10!=orderDate.length()) + return rb.setMsg("数据日期格式不正确"); + + reportInventoryService.buildInventoryReportByDay(orderDate); + return rb.success(); + } +} diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/util/applet/WX_HttpsUtil.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/util/applet/WX_HttpsUtil.java index 3d0efe9b..e45578b2 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/util/applet/WX_HttpsUtil.java +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/util/applet/WX_HttpsUtil.java @@ -1,7 +1,6 @@ package com.yxt.supervise.report.biz.util.applet; - -import com.yxt.supervise.customer.biz.util.MyX509TrustManager; +import com.yxt.supervise.report.biz.util.MyX509TrustManager; import net.sf.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-devv.yml b/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-devv.yml index 4745fb37..cc8bb1f4 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-devv.yml +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-devv.yml @@ -3,7 +3,7 @@ spring: hikari: max-lifetime: 500000 driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/supervise_report?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true + url: jdbc:mysql://127.0.0.1:3306/supervise_supplychain?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true username: root password: root cloud: diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-test.yml b/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-test.yml index 0d57f6e8..60680d91 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-test.yml +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application-test.yml @@ -1,8 +1,8 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver -# url: jdbc:mysql://122.14.222.186:3306/supervise_crm?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true - url: jdbc:mysql://127.0.0.1:3306/supervise_report?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true +# url: jdbc:mysql://122.14.222.186:3306/supervise_report?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true + url: jdbc:mysql://127.0.0.1:3306/supervise_supplychain?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true username: root password: 1LAiGz$t1*Iw cloud: diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application.yml b/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application.yml index e1efb4fe..d9fa8185 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application.yml +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/resources/application.yml @@ -15,8 +15,8 @@ spring: # brokers: localhost:9092 #kafka的网络位置 # auto-create-topics: true profiles: - active: devv -# active: test +# active: devv + active: test messages: # 国际化资源文件路径 basename: i18n/messages diff --git a/yxt_supervise/supervise-system/supervise-system-biz/src/main/resources/application.yml b/yxt_supervise/supervise-system/supervise-system-biz/src/main/resources/application.yml index 195e3c4e..11fdfd4d 100644 --- a/yxt_supervise/supervise-system/supervise-system-biz/src/main/resources/application.yml +++ b/yxt_supervise/supervise-system/supervise-system-biz/src/main/resources/application.yml @@ -2,8 +2,8 @@ spring: application: name: supervise-system profiles: -# active: devv - active: test + active: devv +# active: test messages: # 国际化资源文件路径 basename: i18n/messages