guoxing 2 years ago
parent
commit
fe07a0a8da
  1. 1
      base-ui/package.json
  2. 14
      base-ui/src/router/codemenu.js
  3. 93
      base-ui/src/router/index.js
  4. 28
      base-ui/src/views/kucun/kcxxcx/index.vue
  5. 183
      base-ui/src/views/supervise/monitoringCenter/index.vue
  6. 4
      base-ui/vue.config.js
  7. 23
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java
  8. 80
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java
  9. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdMapper.java
  10. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdService.java
  11. 6
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcMapper.java
  12. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcService.java
  13. 3
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java
  14. 83
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java
  15. 2
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java
  16. 21
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryYcService.java
  17. 32
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesMapper.java
  18. 85
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportday.java
  19. 14
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayMapper.java
  20. 172
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayService.java
  21. 187
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java
  22. 25
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java
  23. 23
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java
  24. 3
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleMapper.java
  25. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleService.java
  26. 33
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/storeinfo/StoreInfoService.java
  27. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/extexcel/ExcelTool.java
  28. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/在途商品汇总统计表.xlsx
  29. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表-20230109.xlsx
  30. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx
  31. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/销售汇总日报表.xlsx

1
base-ui/package.json

@ -18,6 +18,7 @@
"core-js": "^3.26.1", "core-js": "^3.26.1",
"echarts": "^5.4.1", "echarts": "^5.4.1",
"element-ui": "2.13.2", "element-ui": "2.13.2",
"ezuikit-js": "^0.7.0",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",

14
base-ui/src/router/codemenu.js

@ -99,6 +99,20 @@ const codemenu = [
meta: { title: '入库明细表(原始导入)' } meta: { title: '入库明细表(原始导入)' }
}] }]
}, },
/* {
path: '/monitoringCenter',
component: Layout,
redirect: '/monitoringCenter/index',
meta: {
title: '监控中心'
},
children: [{
path: '/monitoringCenter/index',
component: () => import('@/views/supervise/monitoringCenter/index.vue'),
name: 'monitoringCenterIndex',
meta: { title: '视频监控' }
}]
},*/
{ {
path: '/gdinstoragelog', path: '/gdinstoragelog',
component: Layout, component: Layout,

93
base-ui/src/router/index.js

@ -54,76 +54,57 @@ export const constantRoutes = [
}, },
] ]
}, },
// 客户中心
{ {
path: '1', path: 'customer',
component: Layout, component: Layout,
meta: { title: '客户中心' }, meta: { title: '客户中心' },
children: [ children: [
{ {
path: 'cgsq/PurchaseApplicationManagement', path: '/supervise/purchaseapplicationmanagement/purchaseapplicationmanagement',
component: () => import('@/views/supervise/purchaseapplicationmanagement/purchaseapplicationmanagement.vue'), component: () => import('@/views/supervise/purchaseapplicationmanagement/purchaseapplicationmanagement.vue'),
name: 'PurchaseApplicationManagement', name: 'purchaseapplicationmanagement',
meta: {title: '采购申请管理',noCache: true,} meta: {title: '采购申请管理',noCache: true,}
}, },
{ {
path: 'xzgys', path: '/supervise/supplierbankinfo/supplierbankinfo',
component: () => import('@/views/supervise/supplierbankinfo/supplierbankinfo.vue'), component: () => import('@/views/supervise/supplierbankinfo/supplierbankinfo.vue'),
name: 'supplierManagement', name: 'supplierManagement',
meta: {title: '供应商管理',noCache: true} meta: {title: '供应商管理',noCache: true}
}, },
{ {
path: '/404', path: 'dataReporting',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '厂商扣点汇总表',noCache: true}
},
{
path: 'cgsq',
component: Layout, component: Layout,
meta: {title: '数据上报'}, meta: {title: '数据上报'},
children: [ children: [
{ {
path: '/404', path: '/kucun/rkmx/index',
component: () => import('@/views/404'), component: () => import('@/views/kucun/rkmx/index.vue'),
name: 'manufacturerPreference', name: 'receiptDetailsReporting',
meta: {title: '综合数据上报',noCache: true} meta: {title: '入库明细上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '入库上报',noCache: true}
}, },
{ {
path: '/404', path: '/kucun/kcxxcx/index',
component: () => import('@/views/404'), component: () => import('@/views/kucun/kcxxcx/index.vue'),
name: 'manufacturerPreference', name: 'inventoryDetailsReporting',
meta: {title: '库上报',noCache: true} meta: {title: '库存明细上报',noCache: true}
}, },
{ {
path: '/404', path: '/kucun/pfsjgl/index',
component: () => import('@/views/404'), component: () => import('@/views/kucun/pfsjgl/index.vue'),
name: 'manufacturerPreference', name: 'wholesaleDataReporting',
meta: {title: '库存上报',noCache: true} meta: {title: '批发数据上报',noCache: true}
}, },
{ {
path: '/404', path: '/kucun/xssjgl/index.vue',
component: () => import('@/views/404'), component: () => import('@/views/kucun/xssjgl/index.vue'),
name: 'manufacturerPreference', name: 'salesDetailsReporting',
meta: {title: '销售上报',noCache: true} meta: {title: '销售明细上报',noCache: true}
}, },
{ {
path: '/404', path: '/404',
component: () => import('@/views/404'), component: () => import('@/views/404'),
name: 'manufacturerPreference', name: 'manufacturerPreference',
meta: {title: '仓库调拨上报',noCache: true} meta: {title: '仓库调拨上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '配送批发上报',noCache: true}
} }
], ],
}, },
@ -180,7 +161,7 @@ export const constantRoutes = [
}, },
// 审批中心 // 审批中心
{ {
path: '', path: 'approvalCenter',
component: Layout, component: Layout,
meta: { title: '审批中心' }, meta: { title: '审批中心' },
children: [ children: [
@ -211,7 +192,7 @@ export const constantRoutes = [
] ]
}, },
{ {
path: '', path: 'messageCenter',
component: Layout, component: Layout,
meta: { title: '消息中心' }, meta: { title: '消息中心' },
children: [ children: [
@ -230,12 +211,12 @@ export const constantRoutes = [
] ]
}, },
{ {
path: '', path: 'reportCenter',
component: Layout, component: Layout,
meta: { title: '报表中心' }, meta: { title: '报表中心' },
children: [ children: [
{ {
path: 'reportCenter/salesReport', path: '/reportCenter/salesReport',
component: () => import('@/views/reportCenter/salesReport.vue'), component: () => import('@/views/reportCenter/salesReport.vue'),
name: 'salesReport', name: 'salesReport',
meta: {title: '销售报表',noCache: true,} meta: {title: '销售报表',noCache: true,}
@ -249,7 +230,7 @@ export const constantRoutes = [
] ]
}, },
{ {
path: '', path: 'riskControlManagement',
component: Layout, component: Layout,
meta: { title: '风控管理' }, meta: { title: '风控管理' },
children: [ children: [
@ -262,15 +243,29 @@ export const constantRoutes = [
] ]
}, },
{ {
path: '', path: '/monitoringCenter',
component: Layout,
redirect: '/monitoringCenter/index',
meta: {
title: '监控中心'
},
children: [{
path: '/monitoringCenter/index',
component: () => import('@/views/supervise/monitoringCenter/index.vue'),
name: 'monitoringCenterIndex',
meta: { title: '视频监控' }
}]
},
{
path: 'systemManagement',
component: Layout, component: Layout,
meta: { title: '系统管理' }, meta: { title: '系统管理' },
children: [ children: [
{ {
path: 'risk/thresholdAnalysis', path: '/404',
component: () => import('@/views/risk/thresholdAnalysis.vue'), component: () => import('@/views/404'),
name: 'thresholdAnalysis', name: 'thresholdAnalysis',
meta: {title: '阀值分析',noCache: true,} meta: {title: '用户管理',noCache: true,}
} }
] ]
}, },

28
base-ui/src/views/kucun/kcxxcx/index.vue

@ -36,8 +36,8 @@
<el-card class="box-card"> <el-card class="box-card">
<div>{{ hzResultMesssage }}</div> <div>{{ hzResultMesssage }}</div>
<div> <div>
<el-button :disabled="!hzFilePath" size="small" type="primary" @click="doDownloadHz">下载汇总文件</el-button> <el-button :disabled="!hzFilePath" size="small" type="primary" @click="doDownloadHz">下载库存汇总文件</el-button>
<el-button :disabled="!ychzFilePath" size="small" type="primary" @click="doDownloadHzYc">下载烟草汇总文件</el-button> <!-- <el-button :disabled="!ychzFilePath" size="small" type="primary" @click="doDownloadHzYc">下载烟草汇总文件</el-button> -->
</div> </div>
</el-card> </el-card>
</div> </div>
@ -46,7 +46,7 @@
</template> </template>
<script> <script>
import { kchz, kchzyc, resetAllCache } from '@/api/kucun/kucun' import { kchz, resetAllCache } from '@/api/kucun/kucun'
export default { export default {
name: 'KucunKcxxcxIndex', name: 'KucunKcxxcxIndex',
// components: { }, // components: { },
@ -126,17 +126,17 @@ export default {
if (this.fullscreenloading) this.fullscreenloading.close() if (this.fullscreenloading) this.fullscreenloading.close()
this.fullscreenloading = null this.fullscreenloading = null
}) })
kchzyc() // kchzyc()
.then(res => { // .then(res => {
if (this.fullscreenloading) this.fullscreenloading.close() // if (this.fullscreenloading) this.fullscreenloading.close()
this.fullscreenloading = null // this.fullscreenloading = null
console.log('444', res) // console.log('444', res)
_this.ychzFilePath = res.data // _this.ychzFilePath = res.data
}) // })
.catch(e => { // .catch(e => {
if (this.fullscreenloading) this.fullscreenloading.close() // if (this.fullscreenloading) this.fullscreenloading.close()
this.fullscreenloading = null // this.fullscreenloading = null
}) // })
}, },
doDownloadHz() { doDownloadHz() {
window.open(this.hzFilePath, '_blank') window.open(this.hzFilePath, '_blank')

183
base-ui/src/views/supervise/monitoringCenter/index.vue

@ -0,0 +1,183 @@
<template>
<div class="imgDemo">
<div style="text-align:center;height: 1500px;">
<div id="video-container" >
</div>
<div style="text-align:center;" >
<el-button type="primary" size="small" @click="togglePlay">{{ play ? '正在播放' : '停止' }}</el-button>
<!-- <el-tooltip effect="dark" :content="play ? '正在播放' : '停止'" >
<i :class="play ? 'el-icon-video-pause' : 'el-icon-video-play'" @click="togglePlay" ></i>
</el-tooltip>-->
<el-button type="primary" size="small" @click="isCapturePicture">视频截图</el-button>
<!-- <el-tooltip effect="dark" content="视频截图">
<i class="el-icon-camera" @click="isCapturePicture"></i>
</el-tooltip>-->
<!-- <el-tooltip effect="dark" :content="enableZ ? '电子放大-已开启' : '电子放大-已关闭'">
<i :class="enableZ ? 'el-icon-zoom-out' : 'el-icon-zoom-in'" @click="toggleZoom"></i>
</el-tooltip>-->
<el-button type="primary" size="small" @click="isFullScreen">全屏</el-button>
<!-- <div effect="dark" content="全屏">
<div @click="isFullScreen" style="width: 100px;height: 100px;background: image('![](../assets/images/place.png)') "></div>
</div>-->
</div>
</div>
</div>
</template>
<script>
import EZUIKit from 'ezuikit-js';
// import { login1 } from '@/api/system/user/login.js'
export default {
name: '',
data() {
return {
token: '',
player: null,
enableZ:false, //
play: false //
}
},
created(){
this.getVideoData()
},
methods: {
getVideoData(){
this.player = new EZUIKit.EZUIKitPlayer({
id: 'video-container', // ID
accessToken: 'at.cnqo1upn5o4m2zkh6htzpd6a5u5cxklx-2315mkg9mw-11hq79z-g6qxd1wmw',
url: 'ezopen://open.ys7.com/109860978/1.hd.live',
audio: 1, // 0 - 1 -
autoplay: true,
templete: "security",
header: ["capturePicture"],
footer: ['talk','fullScreen'],
width: 608,
plugin: ['talk'],
height: 437
})
},
// /
/* toggleZoom(){
console.log(this.enableZ);
console.log(this.player);
console.log(!this.player || !this.play);
if(!this.player ) return;
switch (this.enableZ) {
case true:
console.log("1111111111111111");
this.player.closeZoom();
this.enableZ = false;
break;
case false:
console.log("2222222222222222");
this.player.enableZoom();
this.enableZ = true;
break;
default:
break;
}
},*/
// /
togglePlay(){
if(!this.player) return;
switch (this.play) {
case true:
this.player.stop();
this.play = false;
break;
case false:
this.player.play();
this.play = true;
break;
default:
break;
}
},
//
isCapturePicture(){
if(!this.player || !this.play) return;
this.player.capturePicture();
},
//
isFullScreen(){
if(!this.player || !this.play) return;
this.player.fullScreen();
}
},
beforeDestroy() {
this.player && this.player.stop() //
}
// getToken(){
// let params = {
// password: "329653",
// roleSid: "",
// token: "",
// userName: "15097329653",
// verifyCode: ""
// }
// login1(params).then(res => {
// this.token = res.data.token
// window.sessionStorage.setItem('token', res.data.token)
// })
// }
}
</script>
<style lang="scss" scoped>
.imgDemo {
width: 100%;
height: 100%;
background: radial-gradient(#fff,#f5f7f4, #fff);
}
canvas {
}
#video-container{
position: relative;
}
::v-deep #video-container iframe{
width: 100% !important;
}
.mask{
position: absolute;
top:0;
left:0;
width:100%;
height:500px;
background: rgba(255, 255, 255, .6) url('../../../assets/images/place.png') no-repeat center;
background-size: 100px;
}
.controll{
display: flex;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 48px;
line-height: 48px;
background: rgba(0, 0, 0, 0.65);
padding: 0 15px;
z-index: 2;
opacity:0;
transition: all 0.3s;
.left{
width: 50%;
i{
margin-right: 10px;
}
}
.right{
width: 50%;
text-align: right;
}
i{
vertical-align: middle;
color: #fff;
font-size: 30px;
}
}
#video-container:hover .controll{
opacity: 0.65;
}
</style>

4
base-ui/vue.config.js

@ -41,9 +41,9 @@ module.exports = {
proxy: { proxy: {
'/api': { // 匹配所有以 '/api'开头的请求路径 '/api': { // 匹配所有以 '/api'开头的请求路径
// target: 'http://26077a35f5.wicp.vip', // target: 'http://26077a35f5.wicp.vip',
// target: process.env.VUE_APP_URL, // 代理目标的基础路径 target: process.env.VUE_APP_URL, // 代理目标的基础路径
// target: "http://192.168.1.102:4523/mock/613533", // 代理目标的基础路径 // target: "http://192.168.1.102:4523/mock/613533", // 代理目标的基础路径
target: "http://127.0.0.1:4523/m1/1913288-0-default", // target: "http://127.0.0.1:4523/m1/1913288-0-default",
changeOrigin: true, // 支持跨域 changeOrigin: true, // 支持跨域
pathRewrite: { // 重写路径: 去掉路径中开头的'/api' pathRewrite: { // 重写路径: 去掉路径中开头的'/api'
'^/api': '' '^/api': ''

23
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java

@ -83,4 +83,27 @@ public interface GdInstorageCountMapper extends BaseMapper<GdInstorageCount> {
*/ */
@Select("SELECT name,code,CONVERT(billTotalPrice,DECIMAL(12,2)) billTotalPrice,billDate,arrivalDate FROM hz_gysddmxb") @Select("SELECT name,code,CONVERT(billTotalPrice,DECIMAL(12,2)) billTotalPrice,billDate,arrivalDate FROM hz_gysddmxb")
List<Map<String, Object>> ddmxb(); List<Map<String, Object>> ddmxb();
/**
* 烟草订单明细表
*
* @return
*/
@Select("SELECT prs.storeName storeName ,prt.code code ,CONVERT(SUM(prs.price),DECIMAL(12,2)) price,prt.purchaseDate purchaseDate, " +
"prt.arrivalDate arrivalDate " +
" FROM purchase_requisition_store prs " +
"LEFT JOIN `purchase_requisition_tobacco` prt ON prt.sid=prs.mainsid " +
"GROUP BY prs.storeCode ORDER BY prs.storeName ")
List<Map<String, Object>> ycddmxb();
@Select("SELECT CONCAT('[',prs.storeCode,']',prs.storeName) storeName , " +
"CONVERT(SUM(prs.price),DECIMAL(12,2)) ddspjz, " +
"CONVERT(IFNULL(SUM(giy.colq16),0),DECIMAL(12,2)) colq16, " +
"CONVERT(IF(SUM(prs.price)-IFNULL(SUM(giy.colq16),0)>0,SUM(prs.price)-IFNULL(SUM(giy.colq16),0),0),DECIMAL(12,2)) ztprodValue1, " +
"CONVERT(IF(IFNULL(SUM(giy.colq16),0)-SUM(prs.price)>0,IFNULL(SUM(giy.colq16),0)-SUM(prs.price),0),DECIMAL(12,2)) ztprodValue2 " +
" FROM `purchase_requisition_store` prs " +
"LEFT JOIN `purchase_requisition_tobacco_details` prtd ON prs.sid=prtd.mainsid " +
"LEFT JOIN `gd_instorage_yc` giy ON giy.colb1=prs.storeCode " +
"GROUP BY prs.storeCode ")
List<Map<String, Object>> ycspdhmxb();
} }

80
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java

@ -136,10 +136,10 @@ public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper,
writer.writeCellValue(7, y, map.get("sfyq")); writer.writeCellValue(7, y, map.get("sfyq"));
} }
writer.writeCellValue(0, countRow, "合计"); writer.writeCellValue(0, countRow, "合计");
writer.writeCellValue(2, countRow, NumberUtil.decimalFormat("0.00", cbilltotalprice)); writer.writeCellValue(2, countRow, cbilltotalprice);
writer.writeCellValue(3, countRow, NumberUtil.decimalFormat("0.00", cprodvalue)); writer.writeCellValue(3, countRow, cprodvalue);
writer.writeCellValue(4, countRow, NumberUtil.decimalFormat("0.00", cwdhjz)); writer.writeCellValue(4, countRow, cwdhjz);
writer.writeCellValue(5, countRow, NumberUtil.decimalFormat("0.00", ccchjz)); writer.writeCellValue(5, countRow, ccchjz);
// 商品到货明细表 // 商品到货明细表
writer.setSheet(1); writer.setSheet(1);
@ -174,12 +174,12 @@ public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper,
} }
writer.writeCellValue(0, countRow2, "合计"); writer.writeCellValue(0, countRow2, "合计");
writer.writeCellValue(3, countRow2, Math.round(cnumber)); writer.writeCellValue(3, countRow2, Math.round(cnumber));
writer.writeCellValue(4, countRow2, NumberUtil.decimalFormat("0.00", cptotalPrice)); writer.writeCellValue(4, countRow2, cptotalPrice);
writer.writeCellValue(5, countRow2, Math.round(cprodNum)); writer.writeCellValue(5, countRow2, Math.round(cprodNum));
writer.writeCellValue(6, countRow2, NumberUtil.decimalFormat("0.00", cprodValue)); writer.writeCellValue(6, countRow2, cprodValue);
writer.writeCellValue(7, countRow2, Math.round(cztnumber)); writer.writeCellValue(7, countRow2, Math.round(cztnumber));
writer.writeCellValue(8, countRow2, NumberUtil.decimalFormat("0.00", cztprodValue1)); writer.writeCellValue(8, countRow2, cztprodValue1);
writer.writeCellValue(9, countRow2, NumberUtil.decimalFormat("0.00", cztprodValue2)); writer.writeCellValue(9, countRow2, cztprodValue2);
// 订单明细表 // 订单明细表
writer.setSheet(2); writer.setSheet(2);
@ -204,13 +204,62 @@ public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper,
writer.writeCellValue(5, y, map.get("arrivalDate")); writer.writeCellValue(5, y, map.get("arrivalDate"));
} }
writer.writeCellValue(1, countRow3, "合计金额"); writer.writeCellValue(1, countRow3, "合计金额");
writer.writeCellValue(3, countRow3, NumberUtil.decimalFormat("0.00", cbillTotalPrice)); writer.writeCellValue(3, countRow3, cbillTotalPrice);
// 烟草商品到货明细表 // 烟草商品到货明细表
// writer.setSheet(3); writer.setSheet(3);
writer.writeCellValue(0, 1, "编号:ycspdhmxb" + dfmt1);
writer.writeCellValue(4, 1, "上报时间:" + dfmt2);
List<Map<String, Object>> list4 = baseMapper.ycspdhmxb();
if (list4 != null && !list4.isEmpty()) {
int size4 = list4.size();
int countRow4 = size4 + 3;
double ccddspjz = 0, cccolq16 = 0, ccztprodValue1 = 0, ccztprodValue2 = 0;
for (int y = 3; y < countRow2; y++) {
Map<String, Object> map = list4.get(y - 3);
writer.writeCellValue(0, y, "市烟草");
writer.writeCellValue(1, y, map.get("storeName"));
writer.writeCellValue(2, y, map.get("ddspjz"));
ccddspjz = ccddspjz + ExcelTool.toDouble(map.get("ddspjz"));
writer.writeCellValue(3, y, map.get("colq16"));
cccolq16 = cccolq16 + ExcelTool.toDouble(map.get("colq16"));
writer.writeCellValue(4, y, map.get("ztprodValue1"));
ccztprodValue1 = ccztprodValue1 + ExcelTool.toDouble(map.get("ztprodValue1"));
writer.writeCellValue(5, y, map.get("ztprodValue2"));
ccztprodValue2 = ccztprodValue2 + ExcelTool.toDouble(map.get("ztprodValue2"));
}
writer.writeCellValue(1, countRow4, "合计");
writer.writeCellValue(2, countRow4, ccddspjz);
writer.writeCellValue(3, countRow4, cccolq16);
writer.writeCellValue(4, countRow4, ccztprodValue1);
writer.writeCellValue(5, countRow4, ccztprodValue2);
}
// 烟草订单明细表 // 烟草订单明细表
// writer.setSheet(4); writer.setSheet(4);
writer.writeCellValue(0, 1, "编号:ycddmxb" + dfmt1);
writer.writeCellValue(4, 1, "数据时间:" + dfmt);
List<Map<String, Object>> list5 = baseMapper.ycddmxb();
if (list5 != null && !list5.isEmpty()) {
int size5 = list5.size();
int countRow5 = size5 + 3;
xh = 0;
double cPrice = 0;
for (int y = 3; y < countRow5; y++) {
Map<String, Object> map = list5.get(y - 3);
xh++;
writer.writeCellValue(0, y, xh);
writer.writeCellValue(1, y, map.get("storeName"));
writer.writeCellValue(2, y, map.get("code"));
writer.writeCellValue(3, y, map.get("price"));
cPrice = cPrice + ExcelTool.toDouble(map.get("price"));
writer.writeCellValue(4, y, map.get("purchaseDate"));
writer.writeCellValue(5, y, map.get("arrivalDate"));
}
writer.writeCellValue(1, countRow5, "合计金额");
writer.writeCellValue(3, countRow5, cPrice);
}
writer.flush(); writer.flush();
writer.close(); writer.close();
@ -218,4 +267,13 @@ public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper,
return rb.success().setData(url); return rb.success().setData(url);
} }
public double amountZaitu() {
double wdhjz = 0;
List<Map<String, Object>> list = baseMapper.gysdhhzb();
for (Map<String, Object> map : list) {
wdhjz = wdhjz + ExcelTool.toDouble(map.get("wdhjz"));
}
return wdhjz;
}
} }

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdMapper.java

@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/** /**
* Project: yxt_supervise <br/> * Project: yxt_supervise <br/>
@ -47,4 +48,7 @@ import org.apache.ibatis.annotations.Param;
public interface GdInstorageJmdMapper extends BaseMapper<GdInstorageJmd> { public interface GdInstorageJmdMapper extends BaseMapper<GdInstorageJmd> {
@Delete("delete from gd_instorage_jmd where orderDate=#{orderDate} ") @Delete("delete from gd_instorage_jmd where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate); void clearByOrderDate(@Param("orderDate") String orderDate);
@Select("SELECT IFNULL(sum(colq16),0) as amount FROM gd_instorage_jmd where orderDate=#{orderDate} ")
double amountOfDay(@Param("orderDate") String orderDate);
} }

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdService.java

@ -47,4 +47,8 @@ public class GdInstorageJmdService extends ServiceImpl<GdInstorageJmdMapper, GdI
public void clearByOrderDate(String orderDate) { public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate); baseMapper.clearByOrderDate(orderDate);
} }
public double amountOfDay(String orderDate) {
return baseMapper.amountOfDay(orderDate);
}
} }

6
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcMapper.java

@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/** /**
* Project: yxt_supervise <br/> * Project: yxt_supervise <br/>
@ -47,4 +48,9 @@ import org.apache.ibatis.annotations.Param;
public interface GdInstorageYcMapper extends BaseMapper<GdInstorageYc> { public interface GdInstorageYcMapper extends BaseMapper<GdInstorageYc> {
@Delete("delete from gd_instorage_yc where orderDate=#{orderDate} ") @Delete("delete from gd_instorage_yc where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate); void clearByOrderDate(@Param("orderDate") String orderDate);
@Select("select IFNULL(sum(t.colq16),0) 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` ='连锁外加盟(销配结算)' ) t ")
double amountOfDayJmd(@Param("orderDate") String orderDate);
} }

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcService.java

@ -46,4 +46,8 @@ public class GdInstorageYcService extends ServiceImpl<GdInstorageYcMapper, GdIns
public void clearByOrderDate(String orderDate) { public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate); baseMapper.clearByOrderDate(orderDate);
} }
public double amountOfDayJmd(String orderDate) {
return baseMapper.amountOfDayJmd( orderDate);
}
} }

3
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java

@ -98,4 +98,7 @@ public interface GdInventoryOkMapper extends BaseMapper<GdInventoryOk> {
@Select("select prodCode,CONVERT(IFNULL(sum(prodNum),0),CHAR) pnum from gd_inventory_ok group by prodCode") @Select("select prodCode,CONVERT(IFNULL(sum(prodNum),0),CHAR) pnum from gd_inventory_ok group by prodCode")
List<Map<String, String>> numberOfProduct(); List<Map<String, String>> numberOfProduct();
@Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok")
double amountCurrent();
} }

83
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java

@ -32,6 +32,8 @@ import cn.hutool.poi.excel.ExcelWriter;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.supervise.portal.extexcel.ExcelTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -63,10 +65,23 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
@Value("${image.xlsxtmpl:static/upload/}") @Value("${image.xlsxtmpl:static/upload/}")
private String xlsxtmplPath; private String xlsxtmplPath;
@Autowired
private GdInventoryYcService gdInventoryYcService;
public void clearData() { public void clearData() {
baseMapper.clearData(); baseMapper.clearData();
} }
// 仓库库存明细表
public List<Map<String, Object>> listOfWarehouse() {
return baseMapper.listOfWarehouse();
}
// 仓库商品明细表
public List<Map<String, Object>> listOfProd(){
return baseMapper.listOfProd();
}
/** /**
* 库存汇总 * 库存汇总
* *
@ -88,6 +103,12 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
// double val1Not112 = baseMapper.countVal1Not112(); // double val1Not112 = baseMapper.countVal1Not112();
double val2 = baseMapper.countVal2(); 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(); Date curDate = new Date();
String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS"); String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS");
String dfmt = DateUtil.format(curDate, "yyyy-MM-dd"); String dfmt = DateUtil.format(curDate, "yyyy-MM-dd");
@ -104,6 +125,8 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
// FileUtil.copy(FileUtil.file(resource), file, true); // FileUtil.copy(FileUtil.file(resource), file, true);
FileUtil.copy(srcFile, file, true); FileUtil.copy(srcFile, file, true);
ExcelWriter writer = ExcelUtil.getWriter(file); ExcelWriter writer = ExcelUtil.getWriter(file);
// 库存汇总日报表
writer.setSheet(0); writer.setSheet(0);
writer.writeCellValue(0, 1, "编号:" + timestr); writer.writeCellValue(0, 1, "编号:" + timestr);
writer.writeCellValue(3, 1, datefmt1); writer.writeCellValue(3, 1, datefmt1);
@ -124,17 +147,22 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
} }
// writer.writeCellValue(1, 4, type1); // writer.writeCellValue(1, 4, type1);
writer.writeCellValue(1, 6, type2); writer.writeCellValue(1, 6, type2);
writer.writeCellValue(1, 7, typeYc);
writer.writeCellValue(2, 3, prod112); writer.writeCellValue(2, 3, prod112);
writer.writeCellValue(2, 4, prod101); writer.writeCellValue(2, 4, prod101);
writer.writeCellValue(2, 5, prod199); writer.writeCellValue(2, 5, prod199);
writer.writeCellValue(2, 6, prod2); writer.writeCellValue(2, 6, prod2);
writer.writeCellValue(2, 7, prodYc);
writer.writeCellValue(3, 3, val112); writer.writeCellValue(3, 3, val112);
writer.writeCellValue(3, 4, val101); writer.writeCellValue(3, 4, val101);
writer.writeCellValue(3, 5, val199); writer.writeCellValue(3, 5, val199);
writer.writeCellValue(3, 6, val2); writer.writeCellValue(3, 6, val2);
writer.writeCellValue(3, 7, valYc);
writer.writeCellValue(3, 8, hj0);
// writer.flush(); // writer.flush();
// writer.close(); // writer.close();
// 仓库库存明细表
List<Map<String, Object>> list = baseMapper.listOfWarehouse(); List<Map<String, Object>> list = baseMapper.listOfWarehouse();
// writer = ExcelUtil.getWriter(file); // writer = ExcelUtil.getWriter(file);
writer.setSheet(1); writer.setSheet(1);
@ -142,17 +170,21 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
writer.writeCellValue(3, 1, datefmt1); writer.writeCellValue(3, 1, datefmt1);
int size = list.size(); int size = list.size();
int countRow = size + 3; int countRow = size + 3;
double hz1 = 0;
for (int y = 3; y < countRow; y++) { for (int y = 3; y < countRow; y++) {
Map<String, Object> map = list.get(y - 3); Map<String, Object> map = list.get(y - 3);
writer.writeCellValue(0, y, map.get("warehouseName")); writer.writeCellValue(0, y, map.get("warehouseName"));
writer.writeCellValue(1, y, map.get("warehouseType")); writer.writeCellValue(1, y, map.get("warehouseType"));
writer.writeCellValue(2, y, map.get("coun")); writer.writeCellValue(2, y, map.get("coun"));
writer.writeCellValue(3, y, map.get("su")); writer.writeCellValue(3, y, map.get("su"));
hz1 = hz1 + ExcelTool.toDouble(map.get("su"));
} }
writer.writeCellValue(0, countRow, "合计"); writer.writeCellValue(0, countRow, "合计");
writer.writeCellValue(3, countRow, hz1);
// writer.flush(); // writer.flush();
// writer.close(); // writer.close();
// 仓库商品明细表
List<Map<String, Object>> listp = baseMapper.listOfProd(); List<Map<String, Object>> listp = baseMapper.listOfProd();
// writer = ExcelUtil.getWriter(file); // writer = ExcelUtil.getWriter(file);
writer.setSheet(2); writer.setSheet(2);
@ -160,6 +192,7 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
writer.writeCellValue(6, 1, datefmt2); writer.writeCellValue(6, 1, datefmt2);
int sizep = listp.size(); int sizep = listp.size();
int countRowp = sizep + 3; int countRowp = sizep + 3;
double hz2 = 0;
for (int y = 3; y < countRowp; y++) { for (int y = 3; y < countRowp; y++) {
Map<String, Object> map = listp.get(y - 3); Map<String, Object> map = listp.get(y - 3);
writer.writeCellValue(0, y, map.get("warehouseCode")); writer.writeCellValue(0, y, map.get("warehouseCode"));
@ -170,7 +203,53 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
writer.writeCellValue(5, y, map.get("prodName")); writer.writeCellValue(5, y, map.get("prodName"));
writer.writeCellValue(6, y, map.get("prodNum")); writer.writeCellValue(6, y, map.get("prodNum"));
writer.writeCellValue(7, y, map.get("prodValue")); 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.flush();
writer.close(); writer.close();
@ -189,4 +268,8 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
list.forEach(m -> map.put(m.get("prodCode"), m.get("pnum"))); list.forEach(m -> map.put(m.get("prodCode"), m.get("pnum")));
return map; return map;
} }
public double amountCurrent() {
return baseMapper.amountCurrent();
}
} }

2
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java

@ -385,7 +385,7 @@ public class GdInventoryService extends ServiceImpl<GdInventoryMapper, GdInvento
} }
} }
if (checkYcProd(typeCode) && storeInfoService.containsCodeOfYc(warehouseCode)) { if (checkYcProd(prodCode) && storeInfoService.containsCodeOfYcNoJmd(warehouseCode)) {
GdInventoryYc yc = new GdInventoryYc(); GdInventoryYc yc = new GdInventoryYc();
Map<String, Object> map = readMapFromRow(r); Map<String, Object> map = readMapFromRow(r);

21
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryYcService.java

@ -60,10 +60,31 @@ public class GdInventoryYcService extends ServiceImpl<GdInventoryYcMapper, GdInv
private String urlPrefix; private String urlPrefix;
@Value("${image.xlsxtmpl:static/upload/}") @Value("${image.xlsxtmpl:static/upload/}")
private String xlsxtmplPath; private String xlsxtmplPath;
public void clearData() { public void clearData() {
baseMapper.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 ResultBean kchzyc() { public ResultBean kchzyc() {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();

32
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesMapper.java

@ -29,6 +29,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/** /**
* Project: yxt_supervise <br/> * Project: yxt_supervise <br/>
@ -48,4 +52,32 @@ public interface GdSalesMapper extends BaseMapper<GdSales> {
@Delete("delete from gd_sales where dataDate=#{dataDate} ") @Delete("delete from gd_sales where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate); void clearByDataDate(@Param("dataDate") String dataDate);
@Select("select t2.storeCode,si.name,t2.amount from( " +
" select storeCode,sum(t1.price) as amount from( " +
" select storeCode,saleNum*salePrice as price from gd_sales where dataDate=#{dataDate} " +
" ) t1 group by t1.storeCode " +
") t2 left join store_index si on t2.storecode=si.code ")
List<Map<String, Object>> listOfStoreOnDay(@Param("dataDate") String orderDate);
@Select("select count(1) from (select storeCode from gd_sales where dataDate=#{dataDate} group by storeCode) t")
int countStoreOnDay(@Param("dataDate") String orderDate);
@Select("select count(1) from (select prodCode from gd_sales where dataDate=#{dataDate} group by prodCode) t")
int countProductOnDay(@Param("dataDate") String orderDate);
@Select("select si.name,t1.* from ( " +
" select storeCode,orderType,orderNo,prodCode,prodName,saleNum,salePrice,saleNum*salePrice as amount from gd_sales where dataDate=#{dataDate} " +
") t1 left join store_index si on t1.storecode=si.code ")
List<Map<String, Object>> listOfProductOnDay(@Param("dataDate") String orderDate);
@Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " +
" select gs.saleNum,gs.salePrice from gd_sales gs left join store_index si on gs.storeCode=si.code " +
" where gs.dataDate=#{dataDate} and si.`type` ='连网连锁店' ) t ")
double amountOfLsdOnDay(@Param("dataDate") String orderDate);
@Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " +
" select gs.saleNum,gs.salePrice from gd_sales gs left join store_index si on gs.storeCode=si.code " +
" where gs.dataDate=#{dataDate} and si.`type` ='连锁内加盟' ) t ")
double amountOfLsnjmOnDay(String orderDate);
} }

85
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportday.java

@ -0,0 +1,85 @@
package com.yxt.supervise.portal.biz.gdsales;
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_sales_reportday")
public class GdSalesReportday 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 String kmdatea; // 科目/日,大前天
private String kmdateb; // 科目/日,前天
private String kmdatec; // 科目/日,昨天
private double xjlla = 0; // 现金流量-经营活动产生的现金流量(元),大前天
private double xjllb = 0; // 现金流量-经营活动产生的现金流量(元),前天
private double xjllc = 0; // 现金流量-经营活动产生的现金流量(元),昨天
private double xsxja = 0; // 销售商品收到的现金(元),大前天
private double xsxjb = 0; // 销售商品收到的现金(元),前天
private double xsxjc = 0; // 销售商品收到的现金(元),昨天
private double qtxja = 0; // 收到其他与经营活动有关的现金(元),大前天
private double qtxjb = 0; // 收到其他与经营活动有关的现金(元),前天
private double qtxjc = 0; // 收到其他与经营活动有关的现金(元),昨天
private double cwfxhja = 0; // 财务分析本项合计,大前天
private double cwfxhjb = 0; // 财务分析本项合计,前天
private double cwfxhjc = 0; // 财务分析本项合计,昨天
private double zcfza = 0; // 资产负债-流动资产(元),大前天
private double zcfzb = 0; // 资产负债-流动资产(元),前天
private double zcfzc = 0; // 资产负债-流动资产(元),昨天
private double yszka = 0; // 应收账款(元),大前天
private double yszkb = 0; // 应收账款(元),前天
private double yszkc = 0; // 应收账款(元),昨天
private double ldfza = 0; // 流动负债(元),大前天
private double ldfzb = 0; // 流动负债(元),前天
private double ldfzc = 0; // 流动负债(元),昨天
private double yskxa = 0; // 预收款项(元),大前天
private double yskxb = 0; // 预收款项(元),前天
private double yskxc = 0; // 预收款项(元),昨天
private String qczhz; // 期初总货值
private String ycqchz; // 烟草期初货值
private String xmdatea; // 项目/日,前天
private String xmdateb; // 项目/日,昨天
private String xmdatec; // 项目/日,今天
private double zthza = 0; // 在途货值(元),前天
private double zthzb = 0; // 在途货值(元),昨天
private double zthzc = 0; // 在途货值(元),今天
private double kchza = 0; // 库存货值(元),前天
private double kchzb = 0; // 库存货值(元),昨天
private double kchzc = 0; // 库存货值(元),今天
private double zhyea = 0; // 帐户余额(元)账户余额为前一天余额,前天
private double zhyeb = 0; // 帐户余额(元)账户余额为前一天余额,昨天
private double zhyec = 0; // 帐户余额(元)账户余额为前一天余额,今天
private double yjyszka = 0; // 预警应收帐款(元),前天
private double yjyszkb = 0; // 预警应收帐款(元),昨天
private double yjyszkc = 0; // 预警应收帐款(元),今天
private double yjhja = 0; // 主要预警指标本项合计,前天
private double yjhjb = 0; // 主要预警指标本项合计,昨天
private double yjhjc = 0; // 主要预警指标本项合计,今天
private double lwlsdze = 0; // 连网连锁店,总额(元)
private double lwlsdyszk = 0; // 连网连锁店,应收帐款(元)
private double lwlsdkcje = 0; // 连网连锁店,扣除应收金额(元)
private double lsnjmze = 0; // 连锁内加盟,总额(元)
private double lsnjmyszk = 0; // 连锁内加盟,应收帐款(元)
private double lsnjmkcje = 0; // 连锁内加盟,扣除应收金额(元)
private double pszxze = 0; // 配送中心,总额(元)
private double pszxyszk = 0; // 配送中心,应收帐款(元)
private double pszxkcje = 0; // 配送中心,扣除应收金额(元)
private double lswjmze = 0; // 连锁外加盟(销配结算),总额(元)
private double lswjmyszk = 0; // 连锁外加盟(销配结算),应收帐款(元)
private double lswjmkcje = 0; // 连锁外加盟(销配结算),扣除应收金额(元)
private double ycmdze = 0; // 36524集团报烟门店仓,总额(元)
private double ycmdyszk = 0; // 36524集团报烟门店仓,应收帐款(元)
private double ycmdkcje = 0; // 36524集团报烟门店仓,扣除应收金额(元)
private double ycjmdze = 0; // 烟草连锁外加盟(销配结算),总额(元)
private double ycjmdyszk = 0; // 烟草连锁外加盟(销配结算),应收帐款(元)
private double ycjmdkcje = 0; // 烟草连锁外加盟(销配结算),扣除应收金额(元)
}

14
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayMapper.java

@ -0,0 +1,14 @@
package com.yxt.supervise.portal.biz.gdsales;
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;
@Mapper
public interface GdSalesReportdayMapper extends BaseMapper<GdSalesReportday> {
@Delete("delete from gd_sales_reportday where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate);
}

172
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayService.java

@ -0,0 +1,172 @@
package com.yxt.supervise.portal.biz.gdsales;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountService;
import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmdService;
import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageYcService;
import com.yxt.supervise.portal.biz.gdinventory.GdInventoryOkService;
import com.yxt.supervise.portal.biz.gdwholesale.GdWholesaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class GdSalesReportdayService extends ServiceImpl<GdSalesReportdayMapper, GdSalesReportday> {
@Autowired
private GdSalesService gdSalesService;
@Autowired
private GdSalesYcService gdSalesYcService;
@Autowired
private GdWholesaleService gdWholesaleService;
@Autowired
private GdInstorageJmdService gdInstorageJmdService;
@Autowired
private GdInstorageYcService gdInstorageYcService;
@Autowired
private GdInventoryOkService gdInventoryOkService;
@Autowired
private GdInstorageCountService gdInstorageCountService;
public GdSalesReportday clearAndInitByOrderDate(String orderDate) {
this.clearByOrderDate(orderDate); // 清除数据日的数据
Date curDate = new Date();
String dfmt = DateUtil.format(curDate, "yyyy-MM-dd");
String dfmt2 = DateUtil.format(curDate, "yyyy-MM-dd HH:mm");
String preOrderDate = dayAgo(orderDate, -1); // 前一天
String befOrderDate = dayAgo(orderDate, -2); // 前两天
String thrOrderDate = dayAgo(orderDate, -3); // 前三天
GdSalesReportday preRp = fetchByOrderDate(preOrderDate);
if (preRp == null)
preRp = new GdSalesReportday();
GdSalesReportday rp = new GdSalesReportday();
rp.setOrderDate(orderDate); // 单据日期
rp.setSerialNumber("xsjyrbb" + orderDate.replace("-", "")); // 编号
rp.setReportTime(dfmt2); // 上报时间
rp.setKmdatea(befOrderDate); // 科目/日,大前天
rp.setKmdateb(preOrderDate); // 科目/日,前天
rp.setKmdatec(orderDate); // 科目/日,昨天
// rp.setXjlla(""); // 现金流量-经营活动产生的现金流量(元),大前天
// rp.setXjllb(""); // 现金流量-经营活动产生的现金流量(元),前天
// rp.setXjllc(""); // 现金流量-经营活动产生的现金流量(元),昨天
rp.setXsxja(preRp.getXsxjb()); // 销售商品收到的现金(元),大前天
rp.setXsxjb(preRp.getXsxjc()); // 销售商品收到的现金(元),前天
rp.setXsxjc(0); // 销售商品收到的现金(元),昨天 //后面计算
// rp.setQtxja(""); // 收到其他与经营活动有关的现金(元),大前天
// rp.setQtxjb(""); // 收到其他与经营活动有关的现金(元),前天
// rp.setQtxjc(""); // 收到其他与经营活动有关的现金(元),昨天
rp.setCwfxhja(preRp.getCwfxhjb()); // 财务分析本项合计,大前天
rp.setCwfxhjb(preRp.getCwfxhjc()); // 财务分析本项合计,前天
rp.setCwfxhjc(0); // 财务分析本项合计,昨天 //后面计算
// rp.setZcfza(""); // 资产负债-流动资产(元),大前天
// rp.setZcfzb(""); // 资产负债-流动资产(元),前天
// rp.setZcfzc(""); // 资产负债-流动资产(元),昨天
// rp.setYszka(""); // 应收账款(元),大前天
// rp.setYszkb(""); // 应收账款(元),前天
// rp.setYszkc(""); // 应收账款(元),昨天
// rp.setLdfza(""); // 流动负债(元),大前天
// rp.setLdfzb(""); // 流动负债(元),前天
// rp.setLdfzc(""); // 流动负债(元),昨天
// rp.setYskxa(""); // 预收款项(元),大前天
// rp.setYskxb(""); // 预收款项(元),前天
// rp.setYskxc(""); // 预收款项(元),昨天
rp.setQczhz(""); // 期初总货值
rp.setYcqchz(""); // 烟草期初货值
rp.setXmdatea(StrUtil.isBlank(preRp.getXmdateb()) ? preOrderDate : preRp.getXmdateb()); // 项目/日,前天
rp.setXmdateb(StrUtil.isBlank(preRp.getXmdatec()) ? orderDate : preRp.getXmdatec()); // 项目/日,昨天
rp.setXmdatec(dfmt); // 项目/日,今天
rp.setZthza(preRp.getZthzb()); // 在途货值(元),前天
rp.setZthzb(preRp.getZthzc()); // 在途货值(元),昨天
rp.setZthzc(0); // 在途货值(元),今天 // 计算
rp.setKchza(preRp.getKchzb()); // 库存货值(元),前天
rp.setKchzb(preRp.getKchzc()); // 库存货值(元),昨天
rp.setKchzc(0); // 库存货值(元),今天 // 计算
// rp.setZhyea(""); // 帐户余额(元)账户余额为前一天余额,前天
// rp.setZhyeb(""); // 帐户余额(元)账户余额为前一天余额,昨天
// rp.setZhyec(""); // 帐户余额(元)账户余额为前一天余额,今天
// rp.setYjyszka(""); // 预警应收帐款(元),前天
// rp.setYjyszkb(""); // 预警应收帐款(元),昨天
// rp.setYjyszkc(""); // 预警应收帐款(元),今天
// rp.setYjhja(""); // 主要预警指标本项合计,前天
// rp.setYjhjb(""); // 主要预警指标本项合计,昨天
// rp.setYjhjc(""); // 主要预警指标本项合计,今天
double xsLwlsd = gdSalesService.amountOfLwlsdDay(orderDate);
rp.setLwlsdze(xsLwlsd); // 连网连锁店,总额(元)
// rp.setLwlsdyszk(""); // 连网连锁店,应收帐款(元)
rp.setLwlsdkcje(xsLwlsd); // 连网连锁店,扣除应收金额(元)
double xsLsnjm = gdSalesService.amountOfLsnjmDay(orderDate);
rp.setLsnjmze(xsLsnjm); // 连锁内加盟,总额(元)
// rp.setLsnjmyszk(""); // 连锁内加盟,应收帐款(元)
rp.setLsnjmkcje(xsLsnjm); // 连锁内加盟,扣除应收金额(元)
double xsPszx = gdWholesaleService.amountOfDay(orderDate);
rp.setPszxze(xsPszx); // 配送中心,总额(元)
// rp.setPszxyszk(""); // 配送中心,应收帐款(元)
rp.setPszxkcje(xsPszx); // 配送中心,扣除应收金额(元)
double xsLswjm = gdInstorageJmdService.amountOfDay(orderDate);
rp.setLswjmze(xsLswjm); // 连锁外加盟(销配结算),总额(元)
// rp.setLswjmyszk(""); // 连锁外加盟(销配结算),应收帐款(元)
rp.setLswjmkcje(xsLswjm); // 连锁外加盟(销配结算),扣除应收金额(元)
double xsYc = gdSalesYcService.amountOfDay(orderDate);
rp.setYcmdze(xsYc); // 36524集团报烟门店仓,总额(元)
// rp.setYcmdyszk(""); // 36524集团报烟门店仓,应收帐款(元)
rp.setYcmdkcje(xsYc); // 36524集团报烟门店仓,扣除应收金额(元)
double xsYcJmd = gdInstorageYcService.amountOfDayJmd(orderDate);
rp.setYcjmdze(xsYcJmd); // 烟草连锁外加盟(销配结算),总额(元)
// rp.setYcjmdyszk(""); // 烟草连锁外加盟(销配结算),应收帐款(元)
rp.setYcjmdkcje(xsYcJmd); // 烟草连锁外加盟(销配结算),扣除应收金额(元)
double xshz1 = Math.round((xsLwlsd + xsLsnjm + xsPszx + xsLswjm + xsYc + xsYcJmd) * 100) / 100;
rp.setXsxjc(xshz1); // 销售商品收到的现金(元),昨天 //后面计算
rp.setCwfxhjc(xshz1); // 财务分析本项合计,昨天 //后面计算
//在途货值
double zthz = gdInstorageCountService.amountZaitu();
rp.setZthzc(0); // 在途货值(元),今天 // 计算
//库存货值
double kzhz = gdInventoryOkService.amountCurrent();
rp.setKchzc(0); // 库存货值(元),今天 // 计算
baseMapper.insert(rp);
return rp;
}
public GdSalesReportday fetchByOrderDate(String orderDate) {
QueryWrapper<GdSalesReportday> qw = new QueryWrapper<>();
qw.eq("orderDate", orderDate);
List<GdSalesReportday> list = list(qw);
if (list == null || list.isEmpty())
return null;
return list.get(0);
}
private String dayAgo(String orderDate, int offset) {
DateTime nowDate = DateUtil.parse(orderDate, "yyyy-MM-dd");
DateTime preDate = DateUtil.offsetDay(nowDate, offset);
return DateUtil.format(preDate, "yyyy-MM-dd");
}
/**
* 清理数据日期的数据
*
* @param orderDate
*/
public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate);
}
}

187
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java

@ -28,7 +28,6 @@ package com.yxt.supervise.portal.biz.gdsales;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter; import cn.hutool.poi.excel.ExcelWriter;
@ -90,6 +89,8 @@ public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
private StoreInfoService storeInfoService; private StoreInfoService storeInfoService;
@Autowired @Autowired
private StoreIndexService storeIndexService; private StoreIndexService storeIndexService;
@Autowired
private GdSalesReportdayService gdSalesReportdayService;
public ResultBean<GdSalesLog> uploadAndInsert(MultipartFile file) { public ResultBean<GdSalesLog> uploadAndInsert(MultipartFile file) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
@ -162,6 +163,7 @@ public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
odate = dataDate; odate = dataDate;
GdSalesGd gd = rowToEntity(r); GdSalesGd gd = rowToEntity(r);
toInsertListGd.add(gd); toInsertListGd.add(gd);
// 监管商品销售数据
if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(storeCode)) { if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(storeCode)) {
GdSales gw = new GdSales(); GdSales gw = new GdSales();
BeanUtil.copyProperties(gd, gw); BeanUtil.copyProperties(gd, gw);
@ -169,6 +171,7 @@ public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
y++; y++;
} }
// 烟草销售数据
if (checkYcProd(typeTwo) && storeInfoService.containsCodeOfYc(storeCode)) { if (checkYcProd(typeTwo) && storeInfoService.containsCodeOfYc(storeCode)) {
GdSalesYc gyc = new GdSalesYc(); GdSalesYc gyc = new GdSalesYc();
BeanUtil.copyProperties(gd, gyc); BeanUtil.copyProperties(gd, gyc);
@ -218,6 +221,8 @@ public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
if (gdLog == null) if (gdLog == null)
return rb.setMsg("上传记录未找到"); return rb.setMsg("上传记录未找到");
String orderDate = gdLog.getOrderDate(); String orderDate = gdLog.getOrderDate();
GdSalesReportday reportday = gdSalesReportdayService.clearAndInitByOrderDate(orderDate);
Date curDate = new Date(); Date curDate = new Date();
String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS"); String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS");
@ -236,20 +241,110 @@ public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
// 销售汇总日报表 // 销售汇总日报表
writer.setSheet(0); writer.setSheet(0);
writer.writeCellValue(0, 1, "编号:xshzrbb" + dfmt1); xshzrbb(writer, reportday);
writer.writeCellValue(2, 1, "上报时间:" + dfmt2);
// 门店销售明细表 // 门店销售明细表
// writer.setSheet(1); writer.setSheet(1);
int storeCount = baseMapper.countStoreOnDay(orderDate);
List<Map<String, Object>> list1 = baseMapper.listOfStoreOnDay(orderDate);
// writer.writeCellValue(0, 1, "编号:mdxsmxb" + dfmt1);
writer.merge(1, 1, 0, 2, "编号:mdxsmxb" + dfmt1, false);
writer.writeCellValue(3, 1, "渠道数量: " + storeCount);
writer.writeCellValue(4, 1, " 上报时间:" + dfmt2);
int size1 = list1.size();
int countRow1 = size1 + 3;
double hj1 = 0;
int xh = 0;
for (int y = 3; y < countRow1; y++) {
Map<String, Object> map = list1.get(y - 3);
xh++;
writer.writeCellValue(0, y, xh);
// writer.writeCellValue(1, y, map.get("name"));
writer.merge(y, y, 1, 3, map.get("name"), false);
writer.writeCellValue(4, y, map.get("amount"));
hj1 = hj1 + ExcelTool.toDouble(map.get("amount"));
}
// writer.writeCellValue(1, countRow1, "合计");
writer.merge(countRow1, countRow1, 0, 3, "合计", false);
writer.writeCellValue(4, countRow1, hj1);
// 门店商品销售明细表 // 门店商品销售明细表
// writer.setSheet(2); writer.setSheet(2);
int productCount = baseMapper.countProductOnDay(orderDate);
List<Map<String, Object>> list2 = baseMapper.listOfProductOnDay(orderDate);
// writer.writeCellValue(0, 1, "编号:mdspxsmxb" + dfmt1);
writer.merge(1, 1, 0, 2, "编号:mdspxsmxb" + dfmt1, false);
// writer.writeCellValue(3, 1, "商品数量: " + productCount);
writer.merge(1, 1, 3, 4, "商品数量: " + productCount, false);
// writer.writeCellValue(4, 1, " 上报时间:" + dfmt2);
writer.merge(1, 1, 5, 7, "上报时间:" + dfmt2, false);
int size2 = list2.size();
int countRow2 = size2 + 3;
double hj2 = 0;
for (int y = 3; y < countRow2; y++) {
Map<String, Object> map = list2.get(y - 3);
writer.writeCellValue(0, y, map.get("name"));
writer.writeCellValue(1, y, map.get("orderType"));
writer.writeCellValue(2, y, map.get("orderNo"));
writer.writeCellValue(3, y, map.get("prodCode"));
writer.writeCellValue(4, y, map.get("prodName"));
writer.writeCellValue(5, y, Math.round(ExcelTool.toDouble( map.get("saleNum"))));
writer.writeCellValue(6, y, map.get("salePrice"));
writer.writeCellValue(7, y, map.get("amount"));
hj2 = hj2 + ExcelTool.toDouble(map.get("amount"));
}
writer.merge(countRow2, countRow2, 0, 6, "合计", false);
writer.writeCellValue(7, countRow2, hj2);
// 烟草门店销售明细表 // 烟草门店销售明细表
// writer.setSheet(3); writer.setSheet(3);
int storeCountyc = gdSalesYcService.countStoreOnDay(orderDate);
List<Map<String, Object>> list1yc = gdSalesYcService.listOfStoreOnDay(orderDate);
// writer.writeCellValue(0, 1, "编号:ycmdxsmxb" + dfmt1);
writer.merge(1, 1, 0, 2, "编号:ycmdxsmxb" + dfmt1, false);
writer.writeCellValue(3, 1, "渠道数量: " + storeCountyc);
writer.writeCellValue(4, 1, " 上报时间:" + dfmt2);
int size1yc = list1yc.size();
int countRow1yc = size1yc + 3;
double hj1yc = 0;
xh = 0;
for (int y = 3; y < countRow1yc; y++) {
Map<String, Object> map = list1yc.get(y - 3);
xh++;
writer.writeCellValue(0, y, xh);
// writer.writeCellValue(1, y, map.get("name"));
writer.merge(y, y, 1, 3, map.get("name"), false);
writer.writeCellValue(4, y, map.get("amount"));
hj1yc = hj1yc + ExcelTool.toDouble(map.get("amount"));
}
// writer.writeCellValue(1, countRow1yc, "合计");
writer.merge(countRow1yc, countRow1yc, 0, 3, "合计", false);
writer.writeCellValue(4, countRow1yc, hj1yc);
// 烟草门店商品销售明细表 // 烟草门店商品销售明细表
// writer.setSheet(4); writer.setSheet(4);
int productCountyc = gdSalesYcService.countProductOnDay(orderDate);
List<Map<String, Object>> list2yc = gdSalesYcService.listOfProductOnDay(orderDate);
writer.merge(1, 1, 0, 2, "编号:ycmdspxsmxb" + dfmt1, false);
writer.merge(1, 1, 3, 4, "商品数量: " + productCountyc, false);
writer.merge(1, 1, 5, 7, "上报时间:" + dfmt2, false);
int size2yc = list2yc.size();
int countRow2yc = size2yc + 3;
double hj2yc = 0;
for (int y = 3; y < countRow2yc; y++) {
Map<String, Object> map = list2yc.get(y - 3);
writer.writeCellValue(0, y, map.get("name"));
writer.writeCellValue(1, y, map.get("orderType"));
writer.writeCellValue(2, y, map.get("orderNo"));
writer.writeCellValue(3, y, map.get("prodCode"));
writer.writeCellValue(4, y, map.get("prodName"));
writer.writeCellValue(5, y, Math.round(ExcelTool.toDouble( map.get("saleNum"))));
writer.writeCellValue(6, y, map.get("salePrice"));
writer.writeCellValue(7, y, map.get("amount"));
hj2yc = hj2yc + ExcelTool.toDouble(map.get("amount"));
}
writer.merge(countRow2yc, countRow2yc, 0, 6, "合计", false);
writer.writeCellValue(7, countRow2yc, hj2yc);
writer.flush(); writer.flush();
writer.close(); writer.close();
@ -260,4 +355,82 @@ public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
return rb.success().setData(gdLog); return rb.success().setData(gdLog);
} }
private void xshzrbb(ExcelWriter writer, GdSalesReportday reportday) {
writer.writeCellValue(0, 1, "编号:" + reportday.getSerialNumber());
writer.writeCellValue(2, 1, "上报时间:" + reportday.getReportTime());
writer.writeCellValue(1, 3, reportday.getKmdatea()); // 科目/日,大前天
writer.writeCellValue(2, 3, reportday.getKmdateb()); // 科目/日,前天
writer.writeCellValue(3, 3, reportday.getKmdatec()); // 科目/日,昨天
writer.writeCellValue(1, 4, reportday.getXjlla()); // 现金流量-经营活动产生的现金流量(元),大前天
writer.writeCellValue(2, 4, reportday.getXjllb()); // 现金流量-经营活动产生的现金流量(元),前天
writer.writeCellValue(3, 4, reportday.getXjllc()); // 现金流量-经营活动产生的现金流量(元),昨天
writer.writeCellValue(1, 5, reportday.getXsxja()); // 销售商品收到的现金(元),大前天
writer.writeCellValue(2, 5, reportday.getXsxjb()); // 销售商品收到的现金(元),前天
writer.writeCellValue(3, 5, reportday.getXsxjc()); // 销售商品收到的现金(元),昨天
writer.writeCellValue(1, 6, reportday.getQtxja()); // 收到其他与经营活动有关的现金(元),大前天
writer.writeCellValue(2, 6, reportday.getQtxjb()); // 收到其他与经营活动有关的现金(元),前天
writer.writeCellValue(3, 6, reportday.getQtxjc()); // 收到其他与经营活动有关的现金(元),昨天
writer.writeCellValue(1, 7, reportday.getCwfxhja()); // 财务分析本项合计,大前天
writer.writeCellValue(2, 7, reportday.getCwfxhjb()); // 财务分析本项合计,前天
writer.writeCellValue(3, 7, reportday.getCwfxhjc()); // 财务分析本项合计,昨天
writer.writeCellValue(1, 8, reportday.getZcfza()); // 资产负债-流动资产(元),大前天
writer.writeCellValue(2, 8, reportday.getZcfzb()); // 资产负债-流动资产(元),前天
writer.writeCellValue(3, 8, reportday.getZcfzc()); // 资产负债-流动资产(元),昨天
writer.writeCellValue(1, 9, reportday.getYszka()); // 应收账款(元),大前天
writer.writeCellValue(2, 9, reportday.getYszkb()); // 应收账款(元),前天
writer.writeCellValue(3, 9, reportday.getYszkc()); // 应收账款(元),昨天
writer.writeCellValue(1, 10, reportday.getLdfza()); // 流动负债(元),大前天
writer.writeCellValue(2, 10, reportday.getLdfzb()); // 流动负债(元),前天
writer.writeCellValue(3, 10, reportday.getLdfzc()); // 流动负债(元),昨天
writer.writeCellValue(1, 11, reportday.getYskxa()); // 预收款项(元),大前天
writer.writeCellValue(2, 11, reportday.getYskxb()); // 预收款项(元),前天
writer.writeCellValue(3, 11, reportday.getYskxc()); // 预收款项(元),昨天
writer.writeCellValue(1, 12, "期初总货值:" + reportday.getQczhz()); // 期初总货值
writer.writeCellValue(3, 12, "烟草期初货值:" + reportday.getYcqchz()); // 烟草期初货值
writer.writeCellValue(1, 13, reportday.getXmdatea()); // 项目/日,前天
writer.writeCellValue(2, 13, reportday.getXmdateb()); // 项目/日,昨天
writer.writeCellValue(3, 13, reportday.getXmdatec()); // 项目/日,今天
writer.writeCellValue(1, 14, reportday.getZthza()); // 在途货值(元),前天
writer.writeCellValue(2, 14, reportday.getZthzb()); // 在途货值(元),昨天
writer.writeCellValue(3, 14, reportday.getZthzc()); // 在途货值(元),今天
writer.writeCellValue(1, 15, reportday.getKchza()); // 库存货值(元),前天
writer.writeCellValue(2, 15, reportday.getKchzb()); // 库存货值(元),昨天
writer.writeCellValue(3, 15, reportday.getKchzc()); // 库存货值(元),今天
writer.writeCellValue(1, 16, reportday.getZhyea()); // 帐户余额(元)账户余额为前一天余额,前天
writer.writeCellValue(2, 16, reportday.getZhyeb()); // 帐户余额(元)账户余额为前一天余额,昨天
writer.writeCellValue(3, 16, reportday.getZhyec()); // 帐户余额(元)账户余额为前一天余额,今天
writer.writeCellValue(1, 17, reportday.getYjyszka()); // 预警应收帐款(元),前天
writer.writeCellValue(2, 17, reportday.getYjyszkb()); // 预警应收帐款(元),昨天
writer.writeCellValue(3, 17, reportday.getYjyszkc()); // 预警应收帐款(元),今天
writer.writeCellValue(1, 18, reportday.getYjhja()); // 主要预警指标本项合计,前天
writer.writeCellValue(2, 18, reportday.getYjhjb()); // 主要预警指标本项合计,昨天
writer.writeCellValue(3, 18, reportday.getYjhjc()); // 主要预警指标本项合计,今天
writer.writeCellValue(1, 21, reportday.getLwlsdze()); // 连网连锁店,总额(元)
writer.writeCellValue(2, 21, reportday.getLwlsdyszk()); // 连网连锁店,应收帐款(元)
writer.writeCellValue(3, 21, reportday.getLwlsdkcje()); // 连网连锁店,扣除应收金额(元)
writer.writeCellValue(1, 22, reportday.getLsnjmze()); // 连锁内加盟,总额(元)
writer.writeCellValue(2, 22, reportday.getLsnjmyszk()); // 连锁内加盟,应收帐款(元)
writer.writeCellValue(3, 22, reportday.getLsnjmkcje()); // 连锁内加盟,扣除应收金额(元)
writer.writeCellValue(1, 23, reportday.getPszxze()); // 配送中心,总额(元)
writer.writeCellValue(2, 23, reportday.getPszxyszk()); // 配送中心,应收帐款(元)
writer.writeCellValue(3, 23, reportday.getPszxkcje()); // 配送中心,扣除应收金额(元)
writer.writeCellValue(1, 24, reportday.getLswjmze()); // 连锁外加盟(销配结算),总额(元)
writer.writeCellValue(2, 24, reportday.getLswjmyszk()); // 连锁外加盟(销配结算),应收帐款(元)
writer.writeCellValue(3, 24, reportday.getLswjmkcje()); // 连锁外加盟(销配结算),扣除应收金额(元)
writer.writeCellValue(1, 25, reportday.getYcmdze()); // 36524集团报烟门店仓,总额(元)
writer.writeCellValue(2, 25, reportday.getYcmdyszk()); // 36524集团报烟门店仓,应收帐款(元)
writer.writeCellValue(3, 25, reportday.getYcmdkcje()); // 36524集团报烟门店仓,扣除应收金额(元)
writer.writeCellValue(1, 26, reportday.getYcjmdze()); // 烟草连锁外加盟(销配结算),总额(元)
writer.writeCellValue(2, 26, reportday.getYcjmdyszk()); // 烟草连锁外加盟(销配结算),应收帐款(元)
writer.writeCellValue(3, 26, reportday.getYcjmdkcje()); // 烟草连锁外加盟(销配结算),扣除应收金额(元)
}
public double amountOfLwlsdDay(String orderDate) {
return baseMapper.amountOfLsdOnDay(orderDate);
}
public double amountOfLsnjmDay(String orderDate) {
return baseMapper.amountOfLsnjmOnDay(orderDate);
}
} }

25
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java

@ -29,6 +29,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/** /**
* Project: yxt_supervise <br/> * Project: yxt_supervise <br/>
@ -47,4 +51,25 @@ import org.apache.ibatis.annotations.Param;
public interface GdSalesYcMapper extends BaseMapper<GdSalesYc> { public interface GdSalesYcMapper extends BaseMapper<GdSalesYc> {
@Delete("delete from gd_sales_yc where dataDate=#{dataDate} ") @Delete("delete from gd_sales_yc where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate); void clearByDataDate(@Param("dataDate") String dataDate);
@Select("select count(1) from (select storeCode from gd_sales_yc where dataDate=#{dataDate} group by storeCode) t")
int countStoreOnDay(@Param("dataDate") String orderDate);
@Select("select t2.storeCode,si.name,t2.amount from( " +
" select storeCode,sum(t1.price) as amount from( " +
" select storeCode,saleNum*salePrice as price from gd_sales_yc where dataDate=#{dataDate} " +
" ) t1 group by t1.storeCode " +
") t2 left join store_index si on t2.storecode=si.code ")
List<Map<String, Object>> listOfStoreOnDay(@Param("dataDate") String orderDate);
@Select("select count(1) from (select prodCode from gd_sales_yc where dataDate=#{dataDate} group by prodCode) t")
int countProductOnDay(@Param("dataDate") String orderDate);
@Select("select si.name,t1.* from ( " +
" select storeCode,orderType,orderNo,prodCode,prodName,saleNum,salePrice,saleNum*salePrice as amount from gd_sales_yc where dataDate=#{dataDate} " +
") t1 left join store_index si on t1.storecode=si.code ")
List<Map<String, Object>> listOfProductOnDay(@Param("dataDate") String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where dataDate=#{dataDate}")
double amountOfDay(String orderDate);
} }

23
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java

@ -28,6 +28,9 @@ package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/** /**
* Project: yxt_supervise <br/> * Project: yxt_supervise <br/>
* File: GdSalesYcService.java <br/> * File: GdSalesYcService.java <br/>
@ -47,4 +50,24 @@ public class GdSalesYcService extends ServiceImpl<GdSalesYcMapper, GdSalesYc> {
public void clearByDataDate(String dataDate) { public void clearByDataDate(String dataDate) {
baseMapper.clearByDataDate(dataDate); baseMapper.clearByDataDate(dataDate);
} }
public int countStoreOnDay(String orderDate) {
return baseMapper.countStoreOnDay(orderDate);
}
public List<Map<String, Object>> listOfStoreOnDay(String orderDate) {
return baseMapper.listOfStoreOnDay(orderDate);
}
public int countProductOnDay(String orderDate) {
return baseMapper.countProductOnDay(orderDate);
}
public List<Map<String, Object>> listOfProductOnDay(String orderDate) {
return baseMapper.listOfProductOnDay(orderDate);
}
public double amountOfDay(String orderDate) {
return baseMapper.amountOfDay(orderDate);
}
} }

3
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleMapper.java

@ -36,4 +36,7 @@ public interface GdWholesaleMapper extends BaseMapper<GdWholesale> {
// " FROM gd_wholesale where dataDate=#{dataDate} ") // " FROM gd_wholesale where dataDate=#{dataDate} ")
@Select("SELECT * FROM gd_wholesale where dataDate=#{dataDate} ") @Select("SELECT * FROM gd_wholesale where dataDate=#{dataDate} ")
List<GdWholesale> excelListByOrderDate(@Param("dataDate") String orderDate); List<GdWholesale> excelListByOrderDate(@Param("dataDate") String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_wholesale where dataDate=#{dataDate} ")
double amountOfDay(String orderDate);
} }

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleService.java

@ -180,4 +180,8 @@ public class GdWholesaleService extends ServiceImpl<GdWholesaleMapper, GdWholesa
return rb.success().setData(gwl); return rb.success().setData(gwl);
} }
public double amountOfDay(String orderDate) {
return baseMapper.amountOfDay(orderDate);
}
} }

33
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/storeinfo/StoreInfoService.java

@ -275,9 +275,11 @@ public class StoreInfoService extends MybatisBaseService<StoreInfoMapper, StoreI
} }
private static List<String> cacheCodeListOfYc = null; //烟草门店的门店编号列表 private static List<String> cacheCodeListOfYc = null; //烟草门店的门店编号列表
private static List<String> cacheCodeListOfYcNoJmd = null; //烟草门店的门店编号列表(不含加盟店)
public static void clearCacheCodeListOfYc() { public static void clearCacheCodeListOfYc() {
cacheCodeListOfYc = null; cacheCodeListOfYc = null;
cacheCodeListOfYcNoJmd = null;
} }
public boolean containsCodeOfYc(String code) { public boolean containsCodeOfYc(String code) {
@ -289,6 +291,15 @@ public class StoreInfoService extends MybatisBaseService<StoreInfoMapper, StoreI
} }
public boolean containsCodeOfYcNoJmd(String code) {
if (StringUtils.isBlank(code))
return false;
if (cacheCodeListOfYcNoJmd == null)
cacheCodeListOfYcNoJmd = listCodeOfYcNoJmd();
return cacheCodeListOfYcNoJmd.contains(code.trim());
}
/** /**
* 烟草门店列表 * 烟草门店列表
* *
@ -307,4 +318,26 @@ public class StoreInfoService extends MybatisBaseService<StoreInfoMapper, StoreI
list.forEach(entity -> res.add(entity.getCode().trim())); list.forEach(entity -> res.add(entity.getCode().trim()));
return res; 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;
}
} }

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/extexcel/ExcelTool.java

@ -66,7 +66,7 @@ public class ExcelTool {
public static int toInt(Object obj) { public static int toInt(Object obj) {
if (obj == null) if (obj == null)
return 0; return 0;
String s = ""+ obj; String s = "" + obj;
if (StringUtils.isBlank(s)) if (StringUtils.isBlank(s))
return 0; return 0;
int rs = 0; int rs = 0;
@ -81,6 +81,8 @@ public class ExcelTool {
public static double toDouble(Object obj) { public static double toDouble(Object obj) {
if (obj == null) if (obj == null)
return 0; return 0;
if (obj instanceof Double)
return (Double) obj;
String s = obj.toString(); String s = obj.toString();
if (StringUtils.isBlank(s)) if (StringUtils.isBlank(s))
return 0; return 0;

BIN
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/在途商品汇总统计表.xlsx

Binary file not shown.

BIN
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表-20230109.xlsx

Binary file not shown.

BIN
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx

Binary file not shown.

BIN
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/销售汇总日报表.xlsx

Binary file not shown.
Loading…
Cancel
Save