Browse Source

'salesreport'

master
guoxing 2 years ago
parent
commit
010cd304c0
  1. 66
      base-ui/public/charts/goodsValue.html
  2. 95677
      base-ui/public/charts/js/echarts.js
  3. 75
      base-ui/public/charts/salesAnalysis.html
  4. 163
      base-ui/public/charts/thresholdRisk.html
  5. 12
      base-ui/src/api/kucun/ruku.js
  6. 20
      base-ui/src/api/kucun/sales.js
  7. 51
      base-ui/src/api/supervise/salesreport.js
  8. 272
      base-ui/src/router/index.js
  9. 2
      base-ui/src/views/kucun/pfsjgl/index.vue
  10. 20
      base-ui/src/views/kucun/rkmx/index.vue
  11. 40
      base-ui/src/views/kucun/xssjgl/index.vue
  12. 151
      base-ui/src/views/reportCenter/goodsOnWay.vue
  13. 163
      base-ui/src/views/reportCenter/salesReport.vue
  14. 219
      base-ui/src/views/risk/thresholdAnalysis.vue
  15. 58
      base-ui/src/views/xiaoshou/xstj/tj.vue
  16. 30
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java
  17. 17
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.xml
  18. 144
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java
  19. 9
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java
  20. 2
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java
  21. 2
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java
  22. 68
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSales.java
  23. 68
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesGd.java
  24. 51
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesGdMapper.java
  25. 50
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesGdService.java
  26. 69
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLog.java
  27. 62
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogErr.java
  28. 46
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogErrMapper.java
  29. 46
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogErrService.java
  30. 46
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogMapper.java
  31. 74
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogService.java
  32. 51
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesMapper.java
  33. 48
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesQuery.java
  34. 80
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesRest.java
  35. 263
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java
  36. 68
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYc.java
  37. 50
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java
  38. 50
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java
  39. 6
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisition/PurchaseRequisitionMapper.java
  40. 55
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisition/PurchaseRequisitionRest.java
  41. 3
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisition/PurchaseRequisitionService.java
  42. 11
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProMapper.java
  43. 7
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProMapper.xml
  44. 17
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProRest.java
  45. 7
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProService.java
  46. 14
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitiontobacco/PurchaseRequisitionTobaccoMapper.java
  47. 15
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitiontobacco/PurchaseRequisitionTobaccoRest.java
  48. 8
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitiontobacco/PurchaseRequisitionTobaccoService.java
  49. 2
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/salesdata/SalesDataRest.java
  50. 156
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/salesdata/SalesDataService.java
  51. 9
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierinfo/SupplierInfoMapper.java
  52. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierinfo/SupplierInfoMapper.xml
  53. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierinfo/SupplierInfoService.java
  54. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/在途商品汇总统计表.xlsx
  55. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/销售汇总日报表.xlsx

66
base-ui/public/charts/goodsValue.html

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ECharts</title>
<!-- 引入刚刚下载的 ECharts 文件 -->
<script src="js/echarts.js"></script>
</head>
<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<div id="main" style="width: 600px;height:600px;"></div>
<script type="text/javascript">
var postData =
[
{
"value": 2313123,
"name": "订单总额"
},
{
"value": 4359354,
"name": "实际到货价值"
},
{
"value": 2313123,
"name": "在途货价值"
},
{
"value": 2313123,
"name": "超出价值"
}
];
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
var option = {
legend: {
top: 'bottom'
},
toolbox: {
show: true,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
restore: { show: true },
saveAsImage: { show: true }
}
},
series: [
{
name: 'Nightingale Chart',
type: 'pie',
radius: [50, 250],
center: ['50%', '50%'],
roseType: 'area',
itemStyle: {
borderRadius: 8
},
data: postData
}
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
</body>
</html>

95677
base-ui/public/charts/js/echarts.js

File diff suppressed because it is too large

75
base-ui/public/charts/salesAnalysis.html

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ECharts</title>
<!-- 引入刚刚下载的 ECharts 文件 -->
<script src="js/echarts.js"></script>
</head>
<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
var postDataSet = {
"dimensions": [
"reportDate",
"销售商品收到的现金",
"收到其他与经营活动有关的现金"
],
"source": [
{
"reportDate": "2023-01-01",
"销售商品收到的现金": 123123.21,
"收到其他与经营活动有关的现金": 23554.43
},
{
"reportDate": "2023-01-02",
"销售商品收到的现金": 235553.23,
"收到其他与经营活动有关的现金": 234323.11
},
{
"reportDate": "2023-01-03",
"销售商品收到的现金": 347534.13,
"收到其他与经营活动有关的现金": 234234.11
},
{
"reportDate": "2023-01-04",
"销售商品收到的现金": 346532.21,
"收到其他与经营活动有关的现金": 234342.11
},
{
"reportDate": "2023-01-05",
"销售商品收到的现金": 345354.23,
"收到其他与经营活动有关的现金": 213123.11
},
{
"reportDate": "2023-01-06",
"销售商品收到的现金": 543266.23,
"收到其他与经营活动有关的现金": 34234.11
},
{
"reportDate": "2023-01-07",
"销售商品收到的现金": 564365.23,
"收到其他与经营活动有关的现金": 234342.11
}
]
};
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
var option = {
legend: {},
tooltip: {},
dataset: postDataSet,
xAxis: { type: 'category' },
yAxis: {},
// Declare several bar series, each will be mapped
// to a column of dataset.source by default.
series: [{ type: 'bar' }, { type: 'bar' }]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
</body>
</html>

163
base-ui/public/charts/thresholdRisk.html

@ -0,0 +1,163 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ECharts</title>
<!-- 引入刚刚下载的 ECharts 文件 -->
<script src="js/echarts.js"></script>
</head>
<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<div id="main" style="width: 800px;height:300px;"></div>
<script type="text/javascript">
var postData =
{
"legend": {
"data": [
"仓库货值",
"在途货值",
"门店货值",
"帐户余额",
"应收帐款",
"借款金额"
]
},
"xAxis": {
"type": "category",
"boundaryGap": false,
"data": [
"23-01-01",
"23-01-02",
"23-01-03",
"23-01-04",
"23-01-05",
"23-01-06",
"23-01-07"
]
},
"series": [
{
"name": "仓库货值",
"type": "line",
"stack": "Total",
"data": [
120,
132,
101,
134,
90,
230,
210
]
},
{
"name": "在途货值",
"type": "line",
"stack": "Total",
"data": [
120,
132,
101,
134,
90,
230,
210
]
},
{
"name": "门店货值",
"type": "line",
"stack": "Total",
"data": [
120,
132,
101,
134,
90,
230,
210
]
},
{
"name": "帐户余额",
"type": "line",
"stack": "Total",
"data": [
120,
132,
101,
134,
90,
230,
210
]
},
{
"name": "应收帐款",
"type": "line",
"stack": "Total",
"data": [
120,
132,
101,
134,
90,
230,
210
]
},
{
"name": "借款金额",
"type": "line",
"stack": "Total",
"data": [
120,
132,
101,
134,
90,
230,
210
]
}
]
}
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
var option = {
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
legend: {
data: postData.legend.data
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: postData.xAxis.data
},
yAxis: {
type: 'value'
},
series: postData.series
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
</body>
</html>

12
base-ui/src/api/kucun/ruku.js

@ -74,3 +74,15 @@ export function jmdRkmxListDownload(data) {
}
})
}
// 下采购订单、入库的数据
export function ztsjZhengli() {
return request({
url: '/v1/purchaserequisition/supplierAnalysis',
method: 'post'
})
}
export function buildExcelZaiTu() {
return request({ url: '/ruku/buildExcelZaiTu' })
}

20
base-ui/src/api/kucun/sales.js

@ -0,0 +1,20 @@
import request from '@/utils/request'
// 条件查询
export function buildExcel(logId) {
return request({
url: '/sales/buildExcel/' + logId
})
}
// 加盟店入库明细表按天查询
export function logsPagerList(data) {
return request({
url: '/sales/logsPagerList',
data,
method: 'post',
headers: {
'Content-Type': 'application/json'
}
})
}

51
base-ui/src/api/supervise/salesreport.js

@ -0,0 +1,51 @@
import request from '@/utils/request'
// 销售报表
// 品牌管理模糊查询
export default {
initData(data) {
return request({
url: '/reportCenter/getSalesReport',
method: 'get',
params: data
})
},
// 保存新增记录
saveOrUpdate: function(params) {
return request({
url: '/v1/purchaserequisition/save',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 通过sid删除一条或多条记录
delBySids: function(data) {
return request({
url: '/v1/purchaserequisition/delBySids',
method: 'delete',
data: data,
headers: {
'Content-Type': 'application/json'
}
})
},
// 通过sid查询一条记录
fetchBySid: function(sid) {
return request({
url: '/v1/purchaserequisition/fetchDetailsBySid/' + sid
})
},
// 提交
doSubmit: function(params) {
return request({
url: '/supervise/v1/kfpurchaserequisition/doSubmit',
method: 'post',
data: params
})
}
}

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

@ -9,48 +9,276 @@ Vue.use(Router)
/* 所有角色可以访问/没有权限要求的基页 */
export const constantRoutes = [{
export const constantRoutes = [
{
path: '/redirect',
component: Layout,
hidden: true,
children: [{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index.vue')
}]
}, {
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index.vue')
},
]
},
{
path: '/',
redirect: 'index'
}, {
},
{
path: '/login',
component: () => import('@/views/login/login.vue')
}, {
},
{
path: '/home',
component: () => import('@/views/Home/Home.vue'),
name: 'home'
}, {
},
{
path: '/index',
component: Layout,
redirect: '/index',
meta: {
title: '首页'
},
children: [{
path: '/index',
component: () => import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
title: '首页',
},
children: [
{
path: '/index',
component: () => import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true,
}
},
]
},
// 客户中心
{
path: '1',
component: Layout,
meta: { title: '客户中心' },
children: [
{
path: 'cgsq/PurchaseApplicationManagement',
component: () => import('@/views/supervise/purchaseapplicationmanagement/purchaseapplicationmanagement.vue'),
name: 'PurchaseApplicationManagement',
meta: {title: '采购申请管理',noCache: true,}
},
{
path: 'xzgys',
component: () => import('@/views/supervise/supplierbankinfo/supplierbankinfo.vue'),
name: 'supplierManagement',
meta: {title: '供应商管理',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '厂商扣点汇总表',noCache: true}
},
{
path: 'cgsq',
component: Layout,
meta: {title: '数据上报'},
children: [
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '综合数据上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '入库上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '出库上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '库存上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '销售上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '仓库调拨上报',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '配送批发上报',noCache: true}
}
],
},
{
path: 'cgsq',
component: Layout,
meta: {title: '信息查询'},
children: [
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '库存信息查询',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '订单查询',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '订单商品查询',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '出入库查询',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '供应商查询',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '仓库调拨查询',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'manufacturerPreference',
meta: {title: '配送批发查询',noCache: true}
}
]
}
]
},
// 审批中心
{
path: '',
component: Layout,
meta: { title: '审批中心' },
children: [
{
path: '/404',
component: () => import('@/views/404'),
name: 'readWork',
meta: {title: '已阅工作',noCache: true,}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'waitingWork',
meta: {title: '待阅工作',noCache: true}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'alreadyHandledWork',
meta: {title: '已办工作',noCache: true,}
},
{
path: '/404',
component: () => import('@/views/404'),
name: 'handledWork',
meta: {title: '待办工作',noCache: true}
}
]
},
{
path: '',
component: Layout,
meta: { title: '消息中心' },
children: [
{
path: 'cgsq/PurchaseApplicationManagement',
component: () => import('@/views/404'),
name: 'PurchaseApplicationManagement',
meta: {title: '未读消息',noCache: true,}
},
{
path: 'xzgys',
component: () => import('@/views/404'),
name: 'supplierManagement',
meta: {title: '已读消息',noCache: true}
}
]
},
{
path: '',
component: Layout,
meta: { title: '报表中心' },
children: [
{
path: 'reportCenter/salesReport',
component: () => import('@/views/reportCenter/salesReport.vue'),
name: 'salesReport',
meta: {title: '销售报表',noCache: true,}
},
{
path: 'reportCenter/goodsOnWay',
component: () => import('@/views/reportCenter/goodsOnWay.vue'),
name: 'goodsOnWay',
meta: {title: '在途商品管理表',noCache: true}
}
]
},
{
path: '',
component: Layout,
meta: { title: '风控管理' },
children: [
{
path: 'risk/thresholdAnalysis',
component: () => import('@/views/risk/thresholdAnalysis.vue'),
name: 'thresholdAnalysis',
meta: {title: '阀值分析',noCache: true,}
}
]
},
{
path: '',
component: Layout,
meta: { title: '系统管理' },
children: [
{
path: 'risk/thresholdAnalysis',
component: () => import('@/views/risk/thresholdAnalysis.vue'),
name: 'thresholdAnalysis',
meta: {title: '阀值分析',noCache: true,}
}
]
},
{
path: '/customer',
component: Layout,
meta: {
title: '客户中心'
title: '客户中心(以下为原菜单)'
},
children: [{
path: 'cgsq',

2
base-ui/src/views/kucun/pfsjgl/index.vue

@ -21,7 +21,7 @@
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">采购订单列表</div>
<div class="tit">上传记录列表</div>
<pageye
v-show="dataList.length > 0"
:total="queryParams.total"

20
base-ui/src/views/kucun/rkmx/index.vue

@ -114,6 +114,7 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>入库单上传</span>
<el-button style="float: right;" type="primary" size="mini" @click="downloadZtsj">下载在途数据</el-button>
<el-button style="float: right; padding: 3px 0" type="text" @click="recountRk">重新统计入库信息</el-button>
</div>
<div>
@ -146,7 +147,7 @@
</template>
<script>
import { recount, countinfo, in112PagerList, inallPagerList, logPagerList, jmdRkmxList, jmdRkmxListDownload } from '@/api/kucun/ruku'
import { recount, countinfo, in112PagerList, inallPagerList, logPagerList, jmdRkmxList, jmdRkmxListDownload, ztsjZhengli, buildExcelZaiTu } from '@/api/kucun/ruku'
import Pagination from '@/components/pagination'
import { parseTime } from '@/utils/index'
export default {
@ -341,6 +342,23 @@ export default {
} else {
this.uploadResultMesssage = resp.msg
}
},
downloadZtsj() {
ztsjZhengli()
.then(res => {
console.log('2222', res)
buildExcelZaiTu()
.then(resp => {
console.log('3333', resp)
window.open(resp.data, '_blank')
})
.catch(ee => {
console.log(ee)
})
})
.catch(e => {
console.log(e)
})
}
}
}

40
base-ui/src/views/kucun/xssjgl/index.vue

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="批发数据上传记录" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<button-bar ref="btnbar" view-title="销售数据上传记录" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
@ -21,7 +21,7 @@
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">采购订单列表</div>
<div class="tit">上传记录列表</div>
<pageye
v-show="dataList.length > 0"
:total="queryParams.total"
@ -38,7 +38,7 @@
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="180" label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="downExcel(scope.row)">下载批发数据Excel</el-button>
<el-button type="primary" size="mini" @click="downExcel(scope.row)">下载销售数据Excel</el-button>
</template>
</el-table-column>
<el-table-column prop="orderDate" label="单据日期" align="center" width="120" />
@ -56,10 +56,40 @@
</div>
</div>
</div>
<el-dialog title="上传<汇融银行_销售数据>" :visible.sync="dialogVisible" width="60%" :before-close="dialogClose">
<el-card class="box-card">
<div>
<el-upload
ref="upload"
class="upload-demo"
:action="updateAction"
:on-progress="handleProgress"
:on-success="handleSuccess"
:file-list="fileList"
:auto-upload="false"
:multiple="false"
:limit="1"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
<div slot="tip" class="el-upload__tip">上传 汇融银行_销售数据.xlsx文件</div>
</el-upload>
</div>
<div>
<h3>文件上传结果</h3>
<el-card class="box-card">
<div>共导入数据{{ currentLog.allNum }} 符合监管条件的数据{{ currentLog.validNum }} 用时{{ currentLog.durations }} 毫秒</div>
</el-card>
</div>
<div><el-button :disabled="filecandown" size="small" type="primary" @click="doDownloadHz">下载销售报表文件</el-button></div>
</el-card>
<span slot="footer" class="dialog-footer"><el-button @click="dialogClose"> </el-button></span>
</el-dialog>
</div>
</template>
<script>
import { buildExcel, logsPagerList } from '@/api/kucun/sales'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
@ -82,7 +112,7 @@ export default {
size: 'small',
icon: 'upload',
btnKey: 'toAdd',
btnLabel: '上传批发数据'
btnLabel: '上传销售数据'
},
{
type: 'info',
@ -104,7 +134,7 @@ export default {
}
},
dialogVisible: false,
updateAction: process.env.VUE_APP_BASE_API + '/wholesale/uploadPszxpfsj',
updateAction: process.env.VUE_APP_BASE_API + '/sales/uploadXssj',
fileList: [],
currentLog: {},
filecandown: true,

151
base-ui/src/views/reportCenter/goodsOnWay.vue

@ -0,0 +1,151 @@
<template>
<div class="app-container">
<div style="margin-left: 16px;">
<h3>{{ name }}</h3>
</div>
<div class = "current-data">
<div class = "left">
<div class="top">
<span>当前数据</span>
<span>{{currentDate}}</span>
</div>
</div>
<div ref="charta" class ="middle">
</div>
<div class ="right" /></div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: '在途商品管理表',
// components: { },
data() {
return {
currentDate:"2023-01-01",
name: '在途商品管理表',
myCharta: null
}
},
created() {
//
// this.init()
//
// this.getList()
},
beforeDestroy() {
if (this.myCharta) {
this.myCharta.dispose()
this.myCharta = null
}
},
mounted() {
this.$nextTick(() => {
this.initCharta()
})
},
methods: {
initCharta() {
// domecharts
this.myCharta = echarts.init(this.$refs.charta)
this.myCharta.setOption(
{
legend: {
top: 'bottom'
},
toolbox: {
show: true,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
restore: { show: true },
saveAsImage: { show: true }
}
},
series: [
{
name: 'Nightingale Chart',
type: 'pie',
radius: [50, 250],
center: ['50%', '50%'],
roseType: 'area',
itemStyle: {
borderRadius: 8
},
data:[
{
"value": 2313123,
"name": "订单总额"
},
{
"value": 4359354,
"name": "实际到货价值"
},
{
"value": 2313123,
"name": "在途货价值"
},
{
"value": 2313123,
"name": "超出价值"
}
]
}
]
}
)
},
getList() {},
//
handleReturn() {
this.$router.go(-1)
}
}
}
</script>
<style>
.current-data{
width:100%;
height:500px;
display: flex;
}
.current-data .top{
height:30px;
line-height:30px;
width:100%;
}
.current-data .left{
background-color: aqua;
width:250px;
height:600px;
margin-left: 16px;
}
.current-data .middle{
width:600px;
height:600px;
float: left;
margin-left: 10px;
}
.current-data .right{
background-color: red;
width:700px;
height:600px;
float: left;
margin-left: 10px;
}
.current-data .right .top{
text-align: center;
}
.current-data .right .charts{
height:480px;
width:100%;
}
</style>

163
base-ui/src/views/reportCenter/salesReport.vue

@ -0,0 +1,163 @@
<template>
<div class="app-container">
<div>
<h3>{{ name }}</h3>
</div>
<div class = "current-data">
<div class = "left">
<div class="top">
<span>当前数据</span>
<span>{{currentDate}}</span>
</div>
</div>
<div ref="charta" class ="right" /></div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: '销售报表',
// components: { },
data() {
return {
currentDate:"2023-01-01",
name: '销售报表',
myCharta: null
}
},
created() {
//
// this.init()
//
// this.getList()
},
beforeDestroy() {
if (this.myCharta) {
this.myCharta.dispose()
this.myCharta = null
}
},
mounted() {
this.$nextTick(() => {
this.initCharta()
})
},
methods: {
initCharta() {
// domecharts
this.myCharta = echarts.init(this.$refs.charta)
this.myCharta.setOption({
legend: {},
tooltip: {},
dataset: {
"dimensions": [
"报表日期",
"销售商品收到的现金",
"收到其他与经营活动有关的现金"
],
"source": [
{
"报表日期": "2023-01-01",
"销售商品收到的现金": 123123.21,
"收到其他与经营活动有关的现金": 23554.43
},
{
"报表日期": "2023-01-02",
"销售商品收到的现金": 235553.23,
"收到其他与经营活动有关的现金": 234423.11
},
{
"报表日期": "2023-01-03",
"销售商品收到的现金": 347534.13,
"收到其他与经营活动有关的现金": 234234.11
},
{
"报表日期": "2023-01-04",
"销售商品收到的现金": 346532.21,
"收到其他与经营活动有关的现金": 234342.11
},
{
"报表日期": "2023-01-05",
"销售商品收到的现金": 345354.23,
"收到其他与经营活动有关的现金": 213123.11
},
{
"报表日期": "2023-01-06",
"销售商品收到的现金": 543266.23,
"收到其他与经营活动有关的现金": 34234.11
},
{
"报表日期": "2023-01-07",
"销售商品收到的现金": 564365.23,
"收到其他与经营活动有关的现金": 234342.11
}
]
},
xAxis: { type: 'category' },
yAxis: {},
// Declare several bar series, each will be mapped
// to a column of dataset.source by default.
series: [{ type: 'bar' }, { type: 'bar' }]
})
},
getList() {},
//
handleReturn() {
this.$router.go(-1)
}
}
}
</script>
<style scoped>
.current-data{
width:100%;
height:500px;
display: flex;
}
.current-data .top{
height:30px;
line-height:30px;
width:100%;
}
.current-data .left{
background-color: aqua;
width:450px;
height:500px;
margin-left: 16px;
}
.current-data .right{
width:1200px;
height:500px;
float: left;
margin-left: 10px;
}
.current-data .right .top{
text-align: center;
}
.current-data .right .charts{
height:480px;
width:100%;
}
.wenjiantit {
font-size: 16px;
font-weight: bold;
margin: 25px 0 10px 0;
}
.forminfo {
margin: 0;
padding: 0;
}
.listcon {
height: calc(100vh - 250px);
overflow-y: auto;
overflow-x: hidden;
}
</style>

219
base-ui/src/views/risk/thresholdAnalysis.vue

@ -0,0 +1,219 @@
<template>
<div class="app-container">
<div style="margin-left:16px;">
<h3>{{ name }}</h3>
</div>
<div class = "current-data">
<div class = "upper">
</div>
<div ref="charta" class ="lower" /></div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: '阀值分析',
// components: { },
data() {
return {
currentDate:"2023-01-01",
name: '阀值分析',
myCharta: null,
}
},
created() {
//
// this.init()
//
// this.getList()
},
beforeDestroy() {
if (this.myCharta) {
this.myCharta.dispose()
this.myCharta = null
}
},
mounted() {
this.$nextTick(() => {
// this.initChartaThreshold()
this.initCharta()
})
},
methods: {
initCharta() {
// domecharts
// this.myChartaThreshold = echarts.init(this.$refs.myChartaThreshold)
this.myCharta = echarts.init(this.$refs.charta)
this.myCharta.setOption(
{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
dataView: { show: false, readOnly: false },
magicType: { show: false, type: ['line', 'bar'] },
restore: { show: false },
saveAsImage: { show: false }
}
},
legend: {
data: ['仓库货值', '在途货值', ' 门店货值', '帐户余额', '应收帐款', '借款金额', '阀值']
},
xAxis: [
{
type: 'category',
data: ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05', '2023-01-06', '2023-01-07'],
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '人民币',
min: 0,
max: 250,
interval: 50,
axisLabel: {
formatter: '{value} 元'
}
},
{
type: 'value',
name: '百分比',
min: 0,
max: 25,
interval: 5,
axisLabel: {
formatter: '{value} '
}
}
],
series: [
{
name: '仓库货值',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' 元';
}
},
data: [
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
]
},
{
name: '在途货值',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' 元';
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: ' 门店货值',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' 元';
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: '帐户余额',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' 元';
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: '应收帐款',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' 元';
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: '借款金额',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + '元';
}
},
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
},
{
name: '阀值',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + '%';
}
},
data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
},
]
}
)
},
getList() {},
//
handleReturn() {
this.$router.go(-1)
}
}
}
</script>
<style>
.current-data{
width:100%;
height:500px;
}
.current-data .upper{
width:100%;
height:100px;
}
.current-data .lower{
width:100%;
height:600px;
float: left;
margin-left: 10px;
}
</style>

58
base-ui/src/views/xiaoshou/xstj/tj.vue

@ -90,10 +90,12 @@
</div>
</div>
<div ref="charta" style="height:300px;width: 100%;" />
</div>
</template>
<script>
<<<<<<< HEAD
import req from '@/api/supervise/salesreport'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
@ -349,6 +351,62 @@
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
=======
import * as echarts from 'echarts'
export default {
name: 'XiaoshouXstjTj',
// components: { },
data() {
return {
name: 'Charts',
myCharta: null
}
},
created() {
//
// this.init()
//
// this.getList()
},
beforeDestroy() {
if (this.myCharta) {
this.myCharta.dispose()
this.myCharta = null
}
},
mounted() {
this.$nextTick(() => {
this.initCharta()
})
},
methods: {
initCharta() {
// domecharts
this.myCharta = echarts.init(this.$refs.charta)
//
this.myCharta.setOption({
title: {
text: 'ECharts 入门示例'
},
tooltip: {},
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
},
yAxis: {},
series: [
{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}
]
})
},
getList() {},
//
handleReturn() {
this.$router.go(-1)
>>>>>>> 2d3fdacd23cf6051bd3738196b47a4270c0c22bd
}
}
</script>

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

@ -29,6 +29,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* Project: yxt_supervise <br/>
@ -53,4 +57,30 @@ public interface GdInstorageCountMapper extends BaseMapper<GdInstorageCount> {
"select colh7,coli8,sum(colr17),sum(colq16),cole4,colex,supplierCodeUnified " +
"from gd_instorage group by colh7,coli8,cole4,colex,supplierCodeUnified ")
void insertFromInstorage();
/**
* 供应商到货汇总表
*
* @return
*/
@Select("select name,1 as ee,convert(ifnull(billtotalprice,0),decimal(12,2)) billtotalprice , " +
"CONVERT(IFNULL(prodvalue,0),DECIMAL(12,2)) prodvalue , " +
"CONVERT(IFNULL(wdhjz,0),DECIMAL(12,2)) wdhjz , " +
"CONVERT(IFNULL(cchjz,0),DECIMAL(12,2)) cchjz ,arrivaldate,sfyq from `hz_ztspglhzb`")
List<Map<String, Object>> gysdhhzb();
/**
* 商品到货明细表
*
* @return
*/
List<Map<String, Object>> spdhmxb();
/**
* 订单明细表
*
* @return
*/
@Select("SELECT name,code,CONVERT(billTotalPrice,DECIMAL(12,2)) billTotalPrice,billDate,arrivalDate FROM hz_gysddmxb")
List<Map<String, Object>> ddmxb();
}

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

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountMapper">
<select id="spdhmxb" resultType="java.util.Map">
SELECT sbi.name ,prp.`proCode`,prp.`proName`,prp.`number`, SUM(CONVERT(packageTotalPrice,DECIMAL(12,2))) as ptotalPrice,
(SELECT IFNULL(SUM(prodNum),0) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode ) prodNum,
(SELECT CONVERT(IFNULL(SUM(prodValue),0),DECIMAL(12,2)) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode ) prodValue,
IF(prp.`number`-(SELECT IFNULL(SUM(prodNum),0) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode ) > 0 , prp.`number`-(SELECT IFNULL(SUM(prodNum),0) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode ) , 0) ztnumber,
CONVERT(IF(SUM(packageTotalPrice)-(SELECT IFNULL(SUM(prodValue),0) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode ) > 0 ,SUM(packageTotalPrice)-(SELECT IFNULL(SUM(prodValue),0) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode ), 0),DECIMAL(12,2)) ztprodValue1,
CONVERT(IF((SELECT IFNULL(SUM(prodValue),0) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode )-SUM(packageTotalPrice) > 0 ,(SELECT SUM(prodValue) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode AND prp.`proCode`=gic.prodcode )-SUM(packageTotalPrice), 0),DECIMAL(12,2)) ztprodValue2
FROM `supplier_bank_info` sbi
LEFT JOIN `purchase_requisition` pr ON pr.supplierOnlyCode=sbi.codeUnified
LEFT JOIN `purchase_requisition_pro` prp ON pr.sid=prp.mainsid
WHERE pr.purchaseState=1 AND pr.bankState=1 AND sbi.`purchaseRequisition`=1 AND sbi.`bankState`=1
GROUP BY pr.supplierOnlyCode,prp.`proCode` ORDER BY sbi.name,prp.`proCode`;
</select>
</mapper>

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

@ -25,12 +25,22 @@
*********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.stereotype.Service;
import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Project: yxt_supervise <br/>
@ -48,6 +58,13 @@ import java.util.List;
@Service
public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper, GdInstorageCount> {
@Value("${image.upload.path:static/upload/}")
private String uploadPath;
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
private String urlPrefix;
@Value("${image.xlsxtmpl:static/upload/}")
private String xlsxtmplPath;
@Autowired
private GdInstorageCountLogService gdInstorageCountLogService;
@ -74,4 +91,131 @@ public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper,
return rb.success().setData(dto);
}
public ResultBean<String> buildExcelZaiTu() {
ResultBean rb = ResultBean.fireFail();
Date curDate = new Date();
String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS");
String dfmt1 = DateUtil.format(curDate, "yyyyMMdd");
String dfmt2 = DateUtil.format(curDate, "yyyy-MM-dd HH:mm");
String dfmt = DateUtil.format(curDate, "yyyy-MM-dd");
String xlsxpath = xlsxtmplPath + "在途商品汇总统计表.xlsx";
File srcFile = FileUtil.file(xlsxpath);
String tfile = "kchzb/在途商品汇总统计表" + dfmt + ".xlsx";
String url = urlPrefix + tfile;
String toFileName = uploadPath + tfile;
File file = FileUtil.file(toFileName);
FileUtil.copy(srcFile, file, true);
ExcelWriter writer = ExcelUtil.getWriter(file);
// 供应商到货汇总表
writer.setSheet(0);
writer.writeCellValue(0, 1, "编号:gysdhhzb" + dfmt1);
writer.writeCellValue(2, 1, "上报时间:" + dfmt2);
List<Map<String, Object>> list1 = baseMapper.gysdhhzb();
if (list1 == null || list1.isEmpty())
return rb.setMsg("供应商到货汇总表 数据为空!");
int size = list1.size();
int countRow = size + 3;
double cbilltotalprice = 0, cprodvalue = 0, cwdhjz = 0, ccchjz = 0;
for (int y = 3; y < countRow; y++) {
Map<String, Object> map = list1.get(y - 3);
writer.writeCellValue(0, y, map.get("name"));
writer.writeCellValue(1, y, "");
writer.writeCellValue(2, y, map.get("billtotalprice"));
cbilltotalprice = cbilltotalprice + ExcelTool.toDouble(map.get("billtotalprice"));
writer.writeCellValue(3, y, map.get("prodvalue"));
cprodvalue = cprodvalue + ExcelTool.toDouble(map.get("prodvalue"));
writer.writeCellValue(4, y, map.get("wdhjz"));
cwdhjz = cwdhjz + ExcelTool.toDouble(map.get("wdhjz"));
writer.writeCellValue(5, y, map.get("cchjz"));
ccchjz = ccchjz + ExcelTool.toDouble(map.get("cchjz"));
writer.writeCellValue(6, y, map.get("arrivaldate"));
writer.writeCellValue(7, y, map.get("sfyq"));
}
writer.writeCellValue(0, countRow, "合计");
writer.writeCellValue(2, countRow, NumberUtil.decimalFormat("0.00", cbilltotalprice));
writer.writeCellValue(3, countRow, NumberUtil.decimalFormat("0.00", cprodvalue));
writer.writeCellValue(4, countRow, NumberUtil.decimalFormat("0.00", cwdhjz));
writer.writeCellValue(5, countRow, NumberUtil.decimalFormat("0.00", ccchjz));
// 商品到货明细表
writer.setSheet(1);
writer.writeCellValue(0, 1, "编号:spdhmxb" + dfmt1);
writer.writeCellValue(2, 1, "上报时间:" + dfmt2);
List<Map<String, Object>> list2 = baseMapper.spdhmxb();
if (list2 == null || list2.isEmpty())
return rb.setMsg("商品到货明细表 数据为空!");
int size2 = list2.size();
int countRow2 = size2 + 3;
double cnumber = 0, cptotalPrice = 0, cprodNum = 0, cprodValue = 0, cztnumber = 0, cztprodValue1 = 0, cztprodValue2 = 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("proCode"));
writer.writeCellValue(2, y, map.get("proName"));
writer.writeCellValue(3, y, map.get("number"));
cnumber = cnumber + ExcelTool.toDouble(map.get("number"));
writer.writeCellValue(4, y, map.get("ptotalPrice"));
cptotalPrice = cptotalPrice + ExcelTool.toDouble(map.get("ptotalPrice"));
writer.writeCellValue(5, y, Math.round(ExcelTool.toDouble(map.get("prodNum"))));
cprodNum = cprodNum + ExcelTool.toDouble(map.get("prodNum"));
writer.writeCellValue(6, y, map.get("prodValue"));
cprodValue = cprodValue + ExcelTool.toDouble(map.get("prodValue"));
writer.writeCellValue(7, y, Math.round(ExcelTool.toDouble(map.get("ztnumber"))));
cztnumber = cztnumber + ExcelTool.toDouble(map.get("ztnumber"));
writer.writeCellValue(8, y, map.get("ztprodValue1"));
cztprodValue1 = cztprodValue1 + ExcelTool.toDouble(map.get("ztprodValue1"));
writer.writeCellValue(9, y, map.get("ztprodValue2"));
cztprodValue2 = cztprodValue2 + ExcelTool.toDouble(map.get("ztprodValue2"));
}
writer.writeCellValue(0, countRow2, "合计");
writer.writeCellValue(3, countRow2, Math.round(cnumber));
writer.writeCellValue(4, countRow2, NumberUtil.decimalFormat("0.00", cptotalPrice));
writer.writeCellValue(5, countRow2, Math.round(cprodNum));
writer.writeCellValue(6, countRow2, NumberUtil.decimalFormat("0.00", cprodValue));
writer.writeCellValue(7, countRow2, Math.round(cztnumber));
writer.writeCellValue(8, countRow2, NumberUtil.decimalFormat("0.00", cztprodValue1));
writer.writeCellValue(9, countRow2, NumberUtil.decimalFormat("0.00", cztprodValue2));
// 订单明细表
writer.setSheet(2);
writer.writeCellValue(0, 1, "编号:ddmxb" + dfmt1);
writer.writeCellValue(2, 1, "数据时间:" + dfmt);
List<Map<String, Object>> list3 = baseMapper.ddmxb();
if (list3 == null || list3.isEmpty())
return rb.setMsg("订单明细表 数据为空!");
int size3 = list3.size();
int countRow3 = size3 + 3;
int xh = 0;
double cbillTotalPrice = 0;
for (int y = 3; y < countRow3; y++) {
Map<String, Object> map = list3.get(y - 3);
xh++;
writer.writeCellValue(0, y, xh);
writer.writeCellValue(1, y, map.get("name"));
writer.writeCellValue(2, y, map.get("code"));
writer.writeCellValue(3, y, map.get("billTotalPrice"));
cbillTotalPrice = cbillTotalPrice + ExcelTool.toDouble(map.get("billTotalPrice"));
writer.writeCellValue(4, y, map.get("billDate"));
writer.writeCellValue(5, y, map.get("arrivalDate"));
}
writer.writeCellValue(1, countRow3, "合计金额");
writer.writeCellValue(3, countRow3, NumberUtil.decimalFormat("0.00", cbillTotalPrice));
// 烟草商品到货明细表
// writer.setSheet(3);
// 烟草订单明细表
// writer.setSheet(4);
writer.flush();
writer.close();
return rb.success().setData(url);
}
}

9
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java

@ -141,4 +141,13 @@ public class GdInstorageRest {
return rb.success().setData(downUrl);
}
/**
* 创建在途商品的Excel
* @return
*/
@GetMapping("/buildExcelZaiTu")
public ResultBean<String> buildExcelZaiTu() {
return gdInstorageCountService.buildExcelZaiTu();
}
}

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

@ -96,6 +96,6 @@ public interface GdInventoryOkMapper extends BaseMapper<GdInventoryOk> {
@Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='199'")
double countVal199();
@Select("select prodCode,IFNULL(sum(prodNum),0) 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();
}

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(prodCode) && storeInfoService.containsCodeOfYc(warehouseCode)) {
if (checkYcProd(typeCode) && storeInfoService.containsCodeOfYc(warehouseCode)) {
GdInventoryYc yc = new GdInventoryYc();
Map<String, Object> map = readMapFromRow(r);

68
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSales.java

@ -0,0 +1,68 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yxt.common.core.domain.EntityWithId;
import lombok.Data;
/**
* Project: yxt_supervise <br/>
* File: GdSales.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSales <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:08 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@TableName("gd_sales")
public class GdSales extends EntityWithId {
private String orgCode; // 企业组织机构代码证
private String orderType; // 订单类型
private String orderNo; // 销售订单号
private String prodCode; // 商品编码
private String prodBarCode; // 商品条码
private String prodName; // 商品名称
private String brandCode; // 品牌代码
private String brandName; // 品牌名称
private String categoryb; // 商品大类
private String categorym; // 商品中类
private String categorys; // 商品小类
private String customerCode; // 客户代码
private String customerName; // 客户名称
private String saleNum; // 销售数量
private String storeCode; // 销售渠道
private String salePrice; // 销售价格
private String saleCost; // 销售成本
private String profit; // 利润
private String dataDate; // 数据日期
}

68
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesGd.java

@ -0,0 +1,68 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yxt.common.core.domain.EntityWithId;
import lombok.Data;
/**
* Project: yxt_supervise <br/>
* File: GdSalesGd.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGd <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:09 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@TableName("gd_sales_gd")
public class GdSalesGd extends EntityWithId {
private String orgCode; // 企业组织机构代码证
private String orderType; // 订单类型
private String orderNo; // 销售订单号
private String prodCode; // 商品编码
private String prodBarCode; // 商品条码
private String prodName; // 商品名称
private String brandCode; // 品牌代码
private String brandName; // 品牌名称
private String categoryb; // 商品大类
private String categorym; // 商品中类
private String categorys; // 商品小类
private String customerCode; // 客户代码
private String customerName; // 客户名称
private String saleNum; // 销售数量
private String storeCode; // 销售渠道
private String salePrice; // 销售价格
private String saleCost; // 销售成本
private String profit; // 利润
private String dataDate; // 数据日期
}

51
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesGdMapper.java

@ -0,0 +1,51 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
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;
/**
* Project: yxt_supervise <br/>
* File: GdSalesGdMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGdMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:20 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesGdMapper extends BaseMapper<GdSalesGd> {
@Delete("delete from gd_sales_gd where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate);
}

50
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesGdService.java

@ -0,0 +1,50 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* Project: yxt_supervise <br/>
* File: GdSalesGdService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesGdService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:21 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesGdService extends ServiceImpl<GdSalesGdMapper,GdSalesGd> {
public void clearByDataDate(String dataDate) {
baseMapper.clearByDataDate(dataDate);
}
}

69
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLog.java

@ -0,0 +1,69 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
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;
/**
* Project: yxt_supervise <br/>
* File: GdSalesLog.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLog <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@TableName("gd_sales_log")
public class GdSalesLog extends EntityWithId {
public GdSalesLog() {
}
public GdSalesLog(String fileFullPath) {
this.fileFullPath = fileFullPath;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime = new Date(); // 记录创建时间/
private String remarks; // 备注说明',
private String fileFullPath; // 文件完整路径',
private String outFilePath; // 汇总文件路径',
private String fileUrl; // 文件下载地址',
private int allNum = 0; // 总记录数',
private int validNum = 0; // 有效记录数',
private long durations = 0; // 程序运行时长',
private int errRowNum = 0; // 出错的条数',
private String orderDate; // 单据日期',
}

62
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogErr.java

@ -0,0 +1,62 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
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;
/**
* Project: yxt_supervise <br/>
* File: GdSalesLogErr.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErr <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:11 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@TableName("gd_sales_log_err")
public class GdSalesLogErr extends EntityWithId {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime = new Date(); // 记录创建时间',
private String remarks; // 备注说明',
private String fileFullPath; // 文件完整路径',
private String errInfo; // 异常信息',
private String rowContent; // 原记录内容',
private int rowNum; // 出错行数',
private String orderDate; // 单据日期
private String orderNo; // 销售订单号
private String prodCode; //商品编码
private String prodName; //商品名称
}

46
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogErrMapper.java

@ -0,0 +1,46 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* Project: yxt_supervise <br/>
* File: GdSalesLogErrMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErrMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:13 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesLogErrMapper extends BaseMapper<GdSalesLogErr> {
}

46
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogErrService.java

@ -0,0 +1,46 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* Project: yxt_supervise <br/>
* File: GdSalesLogErrService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogErrService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:13 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesLogErrService extends ServiceImpl<GdSalesLogErrMapper,GdSalesLogErr> {
}

46
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogMapper.java

@ -0,0 +1,46 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* Project: yxt_supervise <br/>
* File: GdSalesLogMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:14 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesLogMapper extends BaseMapper<GdSalesLog> {
}

74
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesLogService.java

@ -0,0 +1,74 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.supervise.portal.biz.gdwholesale.GdWholesaleLog;
import com.yxt.supervise.portal.biz.gdwholesale.GdWholesaleQuery;
import org.springframework.stereotype.Service;
/**
* Project: yxt_supervise <br/>
* File: GdSalesLogService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesLogService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:14 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesLogService extends ServiceImpl<GdSalesLogMapper, GdSalesLog> {
public PagerVo<GdSalesLog> listPageVo(PagerQuery<GdSalesQuery> pq) {
GdSalesQuery query = pq.getParams();
QueryWrapper<GdSalesLog> qw = new QueryWrapper<>();
if (StrUtil.isNotBlank(query.getOrderDateStart())) {
qw.ge("orderDate", query.getOrderDateStart());
}
if (StrUtil.isNotBlank(query.getOrderDateEnd())) {
qw.lt("orderDate", query.getOrderDateEnd());
}
qw.orderByDesc("orderDate");
IPage<GdSalesLog> page = PagerUtil.queryToPage(pq);
IPage<GdSalesLog> pagging = baseMapper.selectPage(page, qw);
PagerVo<GdSalesLog> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public GdSalesLog fetchById(String logId) {
return baseMapper.selectById(logId);
}
}

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

@ -0,0 +1,51 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
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;
/**
* Project: yxt_supervise <br/>
* File: GdSalesMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:21 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesMapper extends BaseMapper<GdSales> {
@Delete("delete from gd_sales where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate);
}

48
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesQuery.java

@ -0,0 +1,48 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.yxt.common.core.query.Query;
import lombok.Data;
/**
* Project: yxt_supervise <br/>
* File: GdSalesQuery.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesQuery <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:25 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
public class GdSalesQuery implements Query {
private String orderDateStart;
private String orderDateEnd;
}

80
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesRest.java

@ -0,0 +1,80 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* Project: yxt_supervise <br/>
* File: GdSalesRest.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesRest <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:22 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@RestController("com.yxt.supervise.portal.biz.gdsales.GdSalesRest")
@RequestMapping("/sales")
public class GdSalesRest {
@Autowired
private GdSalesService gdSalesService;
@Autowired
private GdSalesLogService gdSalesLogService;
/**
* 上传配送中心批发数据
* @param file
* @return
*/
@PostMapping("/uploadXssj")
public ResultBean<GdSalesLog> uploadGdData(@RequestParam("file") MultipartFile file) {
return gdSalesService.uploadAndInsert(file);
}
@PostMapping("/logsPagerList")
public ResultBean<PagerVo<GdSalesLog>> logsPagerList(@RequestBody PagerQuery<GdSalesQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<GdSalesLog> pv = gdSalesLogService.listPageVo(pq);
return rb.success().setData(pv);
}
@GetMapping("/buildExcel/{logId}")
public ResultBean<GdSalesLog> buildExcel(@PathVariable("logId") String logId) {
return gdSalesService.buildExcel(logId);
}
}

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

@ -0,0 +1,263 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import cn.hutool.poi.excel.sax.handler.RowHandler;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.base.config.component.FileUploadComponent;
import com.yxt.common.core.result.FileUploadResult;
import com.yxt.common.core.result.ResultBean;
import com.yxt.supervise.portal.biz.gdinventory.GdRescategoryProdService;
import com.yxt.supervise.portal.biz.storeindex.StoreIndexService;
import com.yxt.supervise.portal.biz.storeinfo.StoreInfoService;
import com.yxt.supervise.portal.extexcel.ExcelTool;
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.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Project: yxt_supervise <br/>
* File: GdSalesService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:21 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
@Value("${image.upload.path:static/upload/}")
private String uploadPath;
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
private String urlPrefix;
@Value("${image.xlsxtmpl:static/upload/}")
private String xlsxtmplPath;
@Autowired
private GdSalesGdService gdSalesGdService;
@Autowired
private GdSalesYcService gdSalesYcService;
@Autowired
private GdSalesLogService gdSalesLogService;
@Autowired
private GdSalesLogErrService gdSalesLogErrService;
@Autowired
private FileUploadComponent fileUploadComponent;
@Autowired
private GdRescategoryProdService gdRescategoryProdService;
@Autowired
private StoreInfoService storeInfoService;
@Autowired
private StoreIndexService storeIndexService;
public ResultBean<GdSalesLog> uploadAndInsert(MultipartFile file) {
ResultBean rb = ResultBean.fireFail();
ResultBean<FileUploadResult> fub = fileUploadComponent.uploadFile(file, "xssj");
String filePath = fub.getData().getFilePath();
String fp = fileUploadComponent.getUploadPath() + filePath;
long millis = System.currentTimeMillis();
GdSalesLog gdlog = new GdSalesLog(fp);
ExcelUtil.read07BySax(fp, -1, createRowHandler(gdlog));
gdlog.setDurations(System.currentTimeMillis() - millis);
gdSalesLogService.save(gdlog);
return rb.success().setData(gdlog);
}
private RowHandler createRowHandler(GdSalesLog gdlog) {
return new RowHandler() {
private List<GdSalesGd> toInsertListGd = new ArrayList<>();
private List<GdSalesYc> toInsertListYc = new ArrayList<>();
private List<GdSales> toInsertList = new ArrayList<>();
private List<GdSalesLogErr> errList = new ArrayList<>();
private int x = 0, y = 0, errnum = 0;
private String odate = null;
private GdSalesGd rowToEntity(List<Object> r) {
GdSalesGd gd = new GdSalesGd();
gd.setOrgCode("" + r.get(0)); // 企业组织机构代码证
gd.setOrderType("" + r.get(1)); // 订单类型
gd.setOrderNo("" + r.get(2)); // 销售订单号
gd.setProdCode("" + r.get(3)); // 商品编码
gd.setProdBarCode("" + r.get(4)); // 商品条码
gd.setProdName("" + r.get(5)); // 商品名称
gd.setBrandCode("" + r.get(6)); // 品牌代码
gd.setBrandName("" + r.get(7)); // 品牌名称
gd.setCategoryb("" + r.get(8)); // 商品大类
gd.setCategorym("" + r.get(9)); // 商品中类
gd.setCategorys("" + r.get(10)); // 商品小类
gd.setCustomerCode("" + r.get(11)); // 客户代码
gd.setCustomerName("" + r.get(12)); // 客户名称
gd.setSaleNum("" + r.get(13)); // 销售数量
gd.setStoreCode("" + r.get(14)); // 销售渠道
gd.setSalePrice("" + r.get(15)); // 销售价格
gd.setSaleCost("" + r.get(16)); // 销售成本
gd.setProfit("" + r.get(17)); // 利润
gd.setDataDate("" + r.get(18)); // 数据日期
return gd;
}
private boolean checkYcProd(String typeCode) {
if (StrUtil.isBlank(typeCode))
return false;
if (typeCode.length() < 6)
return false;
String subCode = typeCode.substring(0, 6);
return "[0811]".equals(subCode) || "[0813]".equals(subCode) || "[0815]".equals(subCode);
}
@Override
public void handle(int sheetIndex, long rowIndex, List<Object> r) {
if (rowIndex > 0) { //跳过标题行
String dataDate = "" + r.get(18); //数据日期
String prodCode = "" + r.get(3); //商品编码
String typeTwo = "" + r.get(9); //中类
String storeCode = "" + r.get(14); //门店编码
if (StrUtil.isNotBlank(prodCode)) { //商品编码不为空才插入,过滤掉统计行
if (odate == null)
odate = dataDate;
GdSalesGd gd = rowToEntity(r);
toInsertListGd.add(gd);
if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(storeCode)) {
GdSales gw = new GdSales();
BeanUtil.copyProperties(gd, gw);
toInsertList.add(gw);
y++;
}
if (checkYcProd(typeTwo) && storeInfoService.containsCodeOfYc(storeCode)) {
GdSalesYc gyc = new GdSalesYc();
BeanUtil.copyProperties(gd, gyc);
toInsertListYc.add(gyc);
}
x++;
}
}
}
@Override
public void doAfterAllAnalysed() {
if (toInsertListGd != null && !toInsertListGd.isEmpty()) {
GdSalesGd gd = toInsertListGd.get(0);
gdSalesGdService.clearByDataDate(gd.getDataDate());
gdSalesGdService.saveBatch(toInsertListGd);
}
if (toInsertList != null && !toInsertList.isEmpty()) {
GdSales gd = toInsertList.get(0);
GdSalesService.this.clearByDataDate(gd.getDataDate());
GdSalesService.this.saveBatch(toInsertList);
}
if (toInsertListYc != null && !toInsertListYc.isEmpty()) {
GdSalesYc gd = toInsertListYc.get(0);
gdSalesYcService.clearByDataDate(gd.getDataDate());
gdSalesYcService.saveBatch(toInsertListYc);
}
gdlog.setAllNum(x);
gdlog.setValidNum(y);
gdlog.setErrRowNum(errnum);
gdlog.setOrderDate(odate);
RowHandler.super.doAfterAllAnalysed();
}
};
}
public void clearByDataDate(String dataDate) {
baseMapper.clearByDataDate(dataDate);
}
public ResultBean<GdSalesLog> buildExcel(String logId) {
ResultBean rb = ResultBean.fireFail();
GdSalesLog gdLog = gdSalesLogService.fetchById(logId);
if (gdLog == null)
return rb.setMsg("上传记录未找到");
String orderDate = gdLog.getOrderDate();
Date curDate = new Date();
String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS");
String dfmt1 = DateUtil.format(curDate, "yyyyMMdd");
String dfmt2 = DateUtil.format(curDate, "yyyy-MM-dd HH:mm");
String dfmt = DateUtil.format(curDate, "yyyy-MM-dd");
String xlsxpath = xlsxtmplPath + "销售汇总日报表.xlsx";
File srcFile = FileUtil.file(xlsxpath);
String tfile = "kchzb/销售汇总日报表" + dfmt + ".xlsx";
String url = urlPrefix + tfile;
String toFileName = uploadPath + tfile;
File file = FileUtil.file(toFileName);
FileUtil.copy(srcFile, file, true);
ExcelWriter writer = ExcelUtil.getWriter(file);
// 销售汇总日报表
writer.setSheet(0);
writer.writeCellValue(0, 1, "编号:xshzrbb" + dfmt1);
writer.writeCellValue(2, 1, "上报时间:" + dfmt2);
// 门店销售明细表
// writer.setSheet(1);
// 门店商品销售明细表
// writer.setSheet(2);
// 烟草门店销售明细表
// writer.setSheet(3);
// 烟草门店商品销售明细表
// writer.setSheet(4);
writer.flush();
writer.close();
gdLog.setFileUrl(url);
gdLog.setOutFilePath(toFileName);
gdSalesLogService.updateById(gdLog);
return rb.success().setData(gdLog);
}
}

68
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYc.java

@ -0,0 +1,68 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yxt.common.core.domain.EntityWithId;
import lombok.Data;
/**
* Project: yxt_supervise <br/>
* File: GdSalesYc.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesYc <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:09 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@TableName("gd_sales_yc")
public class GdSalesYc extends EntityWithId {
private String orgCode; // 企业组织机构代码证
private String orderType; // 订单类型
private String orderNo; // 销售订单号
private String prodCode; // 商品编码
private String prodBarCode; // 商品条码
private String prodName; // 商品名称
private String brandCode; // 品牌代码
private String brandName; // 品牌名称
private String categoryb; // 商品大类
private String categorym; // 商品中类
private String categorys; // 商品小类
private String customerCode; // 客户代码
private String customerName; // 客户名称
private String saleNum; // 销售数量
private String storeCode; // 销售渠道
private String salePrice; // 销售价格
private String saleCost; // 销售成本
private String profit; // 利润
private String dataDate; // 数据日期
}

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

@ -0,0 +1,50 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
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;
/**
* Project: yxt_supervise <br/>
* File: GdSalesYcMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesYcMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:12 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdSalesYcMapper extends BaseMapper<GdSalesYc> {
@Delete("delete from gd_sales_yc where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate);
}

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

@ -0,0 +1,50 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdsales;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* Project: yxt_supervise <br/>
* File: GdSalesYcService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdsales.GdSalesYcService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2023/1/7 16:13 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdSalesYcService extends ServiceImpl<GdSalesYcMapper, GdSalesYc> {
public void clearByDataDate(String dataDate) {
baseMapper.clearByDataDate(dataDate);
}
}

6
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisition/PurchaseRequisitionMapper.java

@ -31,15 +31,15 @@ public interface PurchaseRequisitionMapper extends BaseMapper<PurchaseRequisitio
PurchaseRequisition selectByCode(@Param("code") String pc);
@Select("select * from purchase_requisition ")
List<PurchaseRequisition> selectAll();
@Select(" SELECT sbi.codeUnified, sbi.name ,1,SUM(packageTotalPrice) billTotalPrice, " +
" (SELECT SUM(prodValue) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode and gic.prodCode in(select prodcode from gd_rescategory_prod) ) prodValue, " +
@Select(" SELECT MAX(sbi.codeUnified) codeUnified, MAX(sbi.name) name ,1,convert(SUM(packageTotalPrice),decimal(12,2)) billTotalPrice, " +
" (SELECT convert(SUM(prodValue),decimal(12,2)) FROM gd_instorage_count gic WHERE gic.supplierCodeUnified=pr.supplierOnlyCode and gic.prodCode in(select prodcode from gd_rescategory_prod) ) prodValue, " +
" MAX(pr.`arrivalDate`) arrivalDate FROM `supplier_bank_info` sbi " +
"LEFT JOIN `purchase_requisition` pr ON pr.supplierOnlyCode=sbi.codeUnified " +
"LEFT JOIN `purchase_requisition_pro` prp ON pr.sid=prp.mainsid " +
" WHERE pr.purchaseState=1 AND pr.bankState=1 AND sbi.`purchaseRequisition`=1 AND sbi.`bankState`=1 " +
" GROUP BY pr.supplierOnlyCode ORDER BY sbi.name;")
List<Map<String, Object>> ztspglhzb();
@Select("SELECT sbi.name,code,SUM(packageTotalPrice) billTotalPrice,purchaseDate billDate,arrivalDate FROM `purchase_requisition` pr " +
@Select("SELECT MAX(sbi.name) name,code,SUM(packageTotalPrice) billTotalPrice,MAX(purchaseDate) billDate,MAX(arrivalDate) arrivalDate FROM `purchase_requisition` pr " +
"LEFT JOIN `purchase_requisition_pro` prp ON pr.sid=prp.mainsid " +
"LEFT JOIN `supplier_bank_info` sbi ON sbi.codeUnified=pr.`supplierOnlyCode` " +
" WHERE pr.purchaseState=1 AND pr.bankState=1 " +

55
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisition/PurchaseRequisitionRest.java

@ -46,7 +46,7 @@ public class PurchaseRequisitionRest implements PurchaseRequisitionFeign {
@ApiOperation(" ")
@RequestMapping(value = "/importBrandSort", method = RequestMethod.POST)
public ResultBean importBrandSort(@RequestParam("filename") MultipartFile file,
HttpServletRequest request, HttpServletResponse response){
HttpServletRequest request, HttpServletResponse response) {
ResultBean rb = ResultBean.fireFail();
String temp = request.getSession().getServletContext()
.getRealPath(File.separator)
@ -65,35 +65,37 @@ public class PurchaseRequisitionRest implements PurchaseRequisitionFeign {
} catch (IOException e) {
e.printStackTrace();
}
ResultBean<String> r= purchaseRequisitionService.readBrandPeriodSorXls1(in);
if(!r.getSuccess()){
ResultBean<String> r = purchaseRequisitionService.readBrandPeriodSorXls1(in);
if (!r.getSuccess()) {
return r;
}
String code= r.getData();
String code = r.getData();
PurchaseRequisition purchaseRequisition = purchaseRequisitionService.selectByCode(code);
String sid = purchaseRequisition.getSid();
ResultBean<Object> objectResultBean = fetchDetailsBySid(sid);
return rb.success().setData(objectResultBean.getData());
return rb.success().setData(objectResultBean.getData());
}
@ApiOperation(" ")
@RequestMapping(value = "/supplierAnalysis", method = RequestMethod.POST)
public ResultBean supplierAnalysis(){
public ResultBean supplierAnalysis() {
ResultBean rb = ResultBean.fireFail();
try {
purchaseRequisitionService. supplierAnalysis();
purchaseRequisitionService.supplierAnalysis();
} catch (ParseException e) {
e.printStackTrace();
return rb.setMsg(e.getMessage());
}
return rb;
return rb.success();
}
@ApiOperation("")
@RequestMapping(value = "/resetCache", method = RequestMethod.POST)
public ResultBean resetCache(){
log.info("resetCache:{}","/resetCache");
public ResultBean resetCache() {
log.info("resetCache:{}", "/resetCache");
GdRescategoryProdService.resetCache();
ResultBean rb = ResultBean.fireFail();
return rb;
return rb;
}
@Override
@ -108,14 +110,14 @@ public class PurchaseRequisitionRest implements PurchaseRequisitionFeign {
ResultBean rb = ResultBean.fireFail();
String sid = dto.getSid();
PurchaseRequisition purchaseRequisition = purchaseRequisitionService.selectBySid(sid);
BeanUtil.copyProperties(dto,purchaseRequisition);
BeanUtil.copyProperties(dto, purchaseRequisition);
purchaseRequisitionService.updateById(purchaseRequisition);
List<PurchaseRequisitionProDto> pros = dto.getPros();
String [] sidArr={sid};
String[] sidArr = {sid};
purchaseRequisitionProService.delByMainSids(sidArr);
for(PurchaseRequisitionProDto p:pros){
for (PurchaseRequisitionProDto p : pros) {
PurchaseRequisitionPro purchaseRequisitionPro = new PurchaseRequisitionPro();
BeanUtil.copyProperties(p,purchaseRequisitionPro);
BeanUtil.copyProperties(p, purchaseRequisitionPro);
purchaseRequisitionPro.setMainSid(sid);
purchaseRequisitionPro.setSid(UUID.randomUUID().toString());
purchaseRequisitionProService.insert(purchaseRequisitionPro);
@ -125,7 +127,7 @@ public class PurchaseRequisitionRest implements PurchaseRequisitionFeign {
@Override
public ResultBean delBySids(@RequestBody String[] sids) {
ResultBean rb=ResultBean.fireFail();
ResultBean rb = ResultBean.fireFail();
int i = purchaseRequisitionService.delBySids(sids);
return rb.success().setData(i);
}
@ -133,19 +135,20 @@ public class PurchaseRequisitionRest implements PurchaseRequisitionFeign {
@Override
public ResultBean<Object> fetchDetailsBySid(String sid) {
ResultBean<Object> resultBean = ResultBean.fireFail();
PurchaseRequisitionDetailsVo vo=purchaseRequisitionService.fetchDetailsBySid(sid);
PurchaseRequisitionDetailsVo vo = purchaseRequisitionService.fetchDetailsBySid(sid);
List<PurchaseRequisitionProDto> purchaseRequisitionPros = purchaseRequisitionProService.selectByMainSid(sid);
vo.setPros(purchaseRequisitionPros);
return resultBean.success().setData(vo);
}
@ApiOperation(" ")
@RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
public ResultBean exportExcel(HttpServletRequest request, HttpServletResponse response){
String pc=request.getParameter("code");
public ResultBean exportExcel(HttpServletRequest request, HttpServletResponse response) {
String pc = request.getParameter("code");
ResultBean rb = ResultBean.fireFail(); //excel标题
//excel文件名
String fileName = pc+"采购订单商品明细表"+System.currentTimeMillis()+".xls";
HSSFWorkbook wb =null;// purchaseRequisitionService.products( pc);
String fileName = pc + "采购订单商品明细表" + System.currentTimeMillis() + ".xls";
HSSFWorkbook wb = null;// purchaseRequisitionService.products( pc);
//响应到客户端
try {
this.setResponseHeader(response, fileName);
@ -156,27 +159,29 @@ public class PurchaseRequisitionRest implements PurchaseRequisitionFeign {
} catch (Exception e) {
e.printStackTrace();
}
return rb;
return rb;
}
public void setResponseHeader(HttpServletResponse response, String fileName) {
try {
try {
fileName = new String(fileName.getBytes(),"ISO8859-1");
fileName = new String(fileName.getBytes(), "ISO8859-1");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.setContentType("application/octet-stream;charset=ISO8859-1");
response.setHeader("Content-Disposition", "attachment;filename="+ fileName);
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
response.addHeader("Pargam", "no-cache");
response.addHeader("Cache-Control", "no-cache");
} catch (Exception ex) {
ex.printStackTrace();
}
}
@ApiOperation(" ")
@RequestMapping(value = "/yb", method = RequestMethod.GET)
public void yb(HttpServletRequest request, HttpServletResponse response){
public void yb(HttpServletRequest request, HttpServletResponse response) {
try {
URL resource = ResourceUtil.getResource("cgdd-tmpl/cgdd.xls");
// path是指想要下载的文件的路径

3
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisition/PurchaseRequisitionService.java

@ -416,7 +416,7 @@ public class PurchaseRequisitionService extends MybatisBaseService<PurchaseRequi
}
log.info("productInformation:{}", JSONObject.toJSONString(pr));
ResultBean<String> objectResultBean=ResultBean.fireFail();
SupplierInfoVo supplierInfoVo = supplierInfoService.selectByCode(pr.getSupplierCode());
SupplierInfoVo supplierInfoVo = supplierInfoService.selectByCodeForIndex(pr.getSupplierCode());
if(supplierInfoVo==null){
return objectResultBean.setMsg("供应商不存在!");
}
@ -613,5 +613,4 @@ public class PurchaseRequisitionService extends MybatisBaseService<PurchaseRequi
cell.setCellStyle(style);
}
}
}

11
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProMapper.java

@ -44,4 +44,15 @@ public interface PurchaseRequisitionProMapper extends BaseMapper<PurchaseRequisi
int delByMainSids(@Param("list") String[] split);
@Select("select * from gd_rescategory_prod where prodCode=#{proCode}")
List<PurchaseRequisitionPro> selectValByCode(String proCode);
@Select("SELECT prp.procode \n" +
"FROM `purchase_requisition_pro` prp \n" +
"LEFT JOIN `purchase_requisition` pr ON prp.mainsid=pr.sid \n" +
"WHERE pr.purchaseState=1 AND bankstate=1 AND prp.categoryKey IN(SELECT categoryKey FROM `restricted_category`)\n" +
"AND prp.brandCode IN(SELECT CODE FROM `restricted_brand` )\n" +
"AND pr.supplierOnlyCode IN (SELECT codeUnified FROM `supplier_bank_info` WHERE purchaseRequisition=1 AND bankState=1)\n" +
"GROUP BY prp.procode")
List<String> selectProdCodeIndex();
@Select("delete from gd_rescategory_prod ")
void deleteProdIndex();
int batchInsertProdCodeIndex(List<String> list);
}

7
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProMapper.xml

@ -40,5 +40,10 @@
#{item}
</foreach>
</delete>
<insert id="batchInsertProdCodeIndex" parameterType="List">
insert into gd_rescategory_prod(prodCode) values
<foreach collection="list" item="item" index="index" separator=",">
(#{item,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>

17
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProRest.java

@ -1,11 +1,28 @@
package com.yxt.supervise.portal.biz.purchaserequisitionpro;
import com.yxt.common.core.result.ResultBean;
import com.yxt.supervise.portal.biz.gdinventory.GdRescategoryProdService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.text.ParseException;
@Api(tags = "采购订单商品信息")
@RestController("com.supervise.biz.purchaserequisitionpro.PurchaseRequisitionProRest")
@RequestMapping("v1/purchaserequisitionpro")
public class PurchaseRequisitionProRest {
@Resource
private PurchaseRequisitionProService purchaseRequisitionProService;
@ApiOperation("更新商品代码的索引表")
@RequestMapping(value = "/makeProdCodeIndex", method = RequestMethod.POST)
public ResultBean makeProdCodeIndex(){
ResultBean rb = ResultBean.fireFail();
int i= purchaseRequisitionProService.makeProdCodeIndex();
GdRescategoryProdService.resetCache();
return rb.success().setData(i);
}
}

7
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitionpro/PurchaseRequisitionProService.java

@ -69,4 +69,11 @@ public class PurchaseRequisitionProService extends MybatisBaseService<PurchaseRe
public List<PurchaseRequisitionPro> selectValByCode(String proCode) {
return baseMapper.selectValByCode(proCode);
}
public int makeProdCodeIndex() {
List<String> l=baseMapper.selectProdCodeIndex();
baseMapper.deleteProdIndex();
int r=baseMapper.batchInsertProdCodeIndex(l);
return r;
}
}

14
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitiontobacco/PurchaseRequisitionTobaccoMapper.java

@ -35,6 +35,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* Project: yxt-supervise(宇信通监管) <br/>
@ -58,6 +59,19 @@ public interface PurchaseRequisitionTobaccoMapper extends BaseMapper<PurchaseReq
@Select("select * from purchase_requisition_tobacco where code like CONCAT('%',#{date},'%') ")
List<PurchaseRequisitionTobacco> selectByDateForCode(@Param("date")String date);
@Select("SELECT '市烟草' supplierName,prtd.prodName prodName,SUM(prtd.ddl) ddl,prtd.price price\n" +
"FROM `purchase_requisition_tobacco_details` prtd \n" +
"LEFT JOIN `purchase_requisition_store` prs ON prtd.`mainSid`=prs.`sid` \n" +
"LEFT JOIN `purchase_requisition_tobacco` prt ON prs.`mainSid`=prt.`sid`\n" +
"WHERE prt.`purchaseDate`=#{date} " +
"GROUP BY prtd.prodName")
List<Map<String, String>> selectDdinfo(@Param("date")String date);
@Select("SELECT SUM(prtd.price) price\n" +
"FROM `purchase_requisition_tobacco_details` prtd\n" +
"LEFT JOIN `purchase_requisition_store` prs ON prtd.`mainSid`=prs.`sid` \n" +
"LEFT JOIN `purchase_requisition_tobacco` prt ON prs.`mainSid`=prt.`sid`\n" +
"WHERE prt.`purchaseDate`=#{date} ")
Map<String, String> selectDdzje(@Param("date")String date);
//@Update("update purchase_requisition_tobacco set name=#{msg} where id=#{id}")
//IPage<PurchaseRequisitionTobaccoVo> voPage(IPage<PurchaseRequisitionTobacco> page, @Param(Constants.WRAPPER) QueryWrapper<PurchaseRequisitionTobacco> qw);

15
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitiontobacco/PurchaseRequisitionTobaccoRest.java

@ -32,6 +32,7 @@ import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -51,6 +52,7 @@ import java.util.List;
* @version 1.0
* @since 1.0
*/
@Slf4j
@Api(tags = "采购订单表")
@RestController("com.yxt.supervise.portal.biz.purchaserequisitiontobacco.PurchaseRequisitionTobaccoRest")
@RequestMapping("/purchaserequisitiontobacco")
@ -67,6 +69,19 @@ public class PurchaseRequisitionTobaccoRest {
return rb.success().setData(pv);
}
/**
* 在途商品统计条件207家报烟店范围审核通过的烟草采购订单230105开始中商品明细有未入库的记录
* @return
*/
@ApiOperation("烟草在途")
@RequestMapping(value = "/yczt", method = RequestMethod.POST)
public ResultBean yczt(@RequestParam("date") String date){
log.info("yczt:{}","/yczt");
ResultBean rb = ResultBean.fireFail();
purchaseRequisitionTobaccoService.yczt(date);
return rb.success();
}
@ApiOperation("所有数据列表")
@GetMapping("/list")
public ResultBean<List<PurchaseRequisitionTobacco>> list() {

8
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/purchaserequisitiontobacco/PurchaseRequisitionTobaccoService.java

@ -187,6 +187,14 @@ public class PurchaseRequisitionTobaccoService extends MybatisBaseService<Purcha
}
return qw;
}
public void yczt(String date) {
// 在途商品统计条件:207家报烟店范围、审核通过的烟草采购订单(230105开始)中商品明细有未入库的记录。
List<Map<String,String>> list=baseMapper.selectDdinfo(date);
Map<String,String> zje=baseMapper.selectDdzje(date);
log.info("list:{}",JSONObject.toJSONString(list));
log.info("zje:{}",JSONObject.toJSONString(zje));
}
public void readBrandPeriodSorXls1(MultipartFile file) {
ResultBean<FileUploadResult> fub = fileUploadComponent.uploadFile(file, "PurchaseRequisitionTobacco");

2
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/salesdata/SalesDataRest.java

@ -112,7 +112,7 @@ public class SalesDataRest implements SalesDataFeign {
public ResultBean importBrandSort(@RequestParam("filename") MultipartFile file ){
ResultBean rb = ResultBean.fireFail();
salesDataService.readBrandPeriodSorXls1(file);
return rb;
return rb.success().setMsg("成功");
}
@ApiOperation(" ")
@RequestMapping(value = "/analysisSalesData", method = RequestMethod.GET)

156
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/salesdata/SalesDataService.java

@ -255,42 +255,7 @@ public class SalesDataService extends MybatisBaseService<SalesDataMapper, SalesD
brandInfo.setCode(sd.getBrandCode());
brandInfoService.insert(brandInfo);
}
String dalei=sd.getCategoryb();
String[] split_dalei = dalei.split("]");
String key_dalei = split_dalei[0].replace("[","");//key
String v_dalei=split_dalei[1];//类别value
DictCommonDetailsVo category_dalei = dictCommonService.fetchByKeyAndType(key_dalei, "category");
if(category_dalei==null){
DictCommon dc=new DictCommon();
dc.setDictType("category");
dc.setDictKey(key_dalei);
dc.setDictValue(v_dalei);
dictCommonService.insert(dc);
}
String zhonglei=sd.getCategorym();
String[] split_zhonglei = zhonglei.split("]");
String key_zhonglei = split_zhonglei[0].replace("[","");//key
String v_zhonglei=split_zhonglei[1];//类别value
DictCommonDetailsVo category_zhonglei = dictCommonService.fetchByKeyAndType(key_zhonglei, "category");
if(category_zhonglei==null){
DictCommon dc=new DictCommon();
dc.setDictType("category");
dc.setDictKey(key_zhonglei);
dc.setDictValue(v_zhonglei);
dictCommonService.insert(dc);
}
String xiaolei=sd.getCategorys();
String[] split_xiaolei = xiaolei.split("]");
String key_xiaolei = split_xiaolei[0].replace("[","");//key
String v_xiaolei=split_xiaolei[1];//类别value
DictCommonDetailsVo category = dictCommonService.fetchByKeyAndType(key_xiaolei, "category");
if(category==null){
DictCommon dc=new DictCommon();
dc.setDictType("category");
dc.setDictKey(key_xiaolei);
dc.setDictValue(v_xiaolei);
dictCommonService.insert(dc);
}
validDictcommon(sd);
}
baseMapper.updateStoreName(salesDatas.get(0).getDataDate());
baseMapper.deleteSalesDataByDate(salesDatas.get(0).getDataDate());
@ -299,6 +264,46 @@ public class SalesDataService extends MybatisBaseService<SalesDataMapper, SalesD
}
};
}
private void validDictcommon(SalesData sd) {
String xiaolei= sd.getCategorys();
String[] split_xiaolei = xiaolei.split("]");
String key_xiaolei = split_xiaolei[0].replace("[","");//key
String v_xiaolei=split_xiaolei[1];//类别value
DictCommonDetailsVo category = dictCommonService.fetchByKeyAndType(key_xiaolei, "category");
if(category==null){
DictCommon dc=new DictCommon();
dc.setDictType("category");
dc.setDictKey(key_xiaolei);
dc.setDictValue(v_xiaolei);
dictCommonService.insert(dc);
String dalei= sd.getCategoryb();
String[] split_dalei = dalei.split("]");
String key_dalei = split_dalei[0].replace("[","");//key
String v_dalei=split_dalei[1];//类别value
DictCommonDetailsVo category_dalei = dictCommonService.fetchByKeyAndType(key_dalei, "category");
if(category_dalei==null){
DictCommon dc_dalei=new DictCommon();
dc_dalei.setDictType("category");
dc_dalei.setDictKey(key_dalei);
dc_dalei.setDictValue(v_dalei);
dictCommonService.insert(dc_dalei);
String zhonglei= sd.getCategorym();
String[] split_zhonglei = zhonglei.split("]");
String key_zhonglei = split_zhonglei[0].replace("[","");//key
String v_zhonglei=split_zhonglei[1];//类别value
DictCommonDetailsVo category_zhonglei = dictCommonService.fetchByKeyAndType(key_zhonglei, "category");
if(category_zhonglei==null){
DictCommon dc_zhonglei=new DictCommon();
dc_zhonglei.setDictType("category");
dc_zhonglei.setDictKey(key_zhonglei);
dc_zhonglei.setDictValue(v_zhonglei);
dictCommonService.insert(dc_zhonglei);
}
}
}
}
public void readBrandPeriodSorXls1(MultipartFile file,String sid) {
/*ResultBean<FileUploadResult> fub = fileUploadComponent.uploadFile(file, "PurchaseRequisitionTobaccoDetails");
@ -359,7 +364,7 @@ public class SalesDataService extends MybatisBaseService<SalesDataMapper, SalesD
}catch(Exception e){
e.printStackTrace();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
baseMapper.insertIntoImportDataInfo(sdf.format(new Date()),"烟草数据明细导入第"+i+"出现异常"+e.getMessage());
baseMapper.insertIntoImportDataInfo(sdf.format(new Date()),"销售数据明细导入第"+i+"出现异常"+e.getMessage());
System.err.println("i="+i+",value=null");
}
}
@ -392,69 +397,11 @@ public class SalesDataService extends MybatisBaseService<SalesDataMapper, SalesD
return file;
}
public void readBrandPeriodSorXls1(MultipartFile file) {
ResultBean<FileUploadResult> fub = fileUploadComponent.uploadFile(file, "salesdata");
String filePath = fub.getData().getFilePath();
String fp = fileUploadComponent.getUploadPath() + filePath;
long millis = System.currentTimeMillis();
ExcelUtil.read07BySax(fp, -1, createRowHandler());
/*HSSFWorkbook hssfWorkbook = null;
try {
hssfWorkbook = new HSSFWorkbook(is);
} catch (IOException e) {
e.printStackTrace();
}
List<String> lisss=new ArrayList<>();
List<SalesData> salesDatas=new ArrayList<>();
HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0);
// 循环行Row
for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
SalesData sd=new SalesData();
HSSFRow hssfRow = hssfSheet.getRow(rowNum);
int i = 0;
try{
sd.setType(ExcelTool.readStringFromHSSFRow(hssfRow, 1));//类型
sd.setCode(ExcelTool.readStringFromHSSFRow(hssfRow, 2));//销售订单号
sd.setProCode(ExcelTool.readStringFromHSSFRow(hssfRow, 3));//商品代码
sd.setProBarCode(ExcelTool.readStringFromHSSFRow(hssfRow, 4));//商品条码
sd.setProName(ExcelTool.readStringFromHSSFRow(hssfRow, 5));//商品名称
sd.setBrandCode(ExcelTool.readStringFromHSSFRow(hssfRow, 6));//品牌代码
String brandName=ExcelTool.readStringFromHSSFRow(hssfRow, 7);
sd.setBrandName(brandName);//品牌名称
String dalei=ExcelTool.readStringFromHSSFRow(hssfRow, 8);//大类
sd.setCategoryb(dalei);
String zhonglei=ExcelTool.readStringFromHSSFRow(hssfRow, 9);//中类
sd.setCategorym(zhonglei);
String xiaolei=ExcelTool.readStringFromHSSFRow(hssfRow, 10);//小类
sd.setCategorys(xiaolei);
sd.setCustomerCode(ExcelTool.readStringFromHSSFRow(hssfRow, 11));//客户代码
sd.setCustomerName(ExcelTool.readStringFromHSSFRow(hssfRow, 12));//客户名称
sd.setSaleNum(ExcelTool.readStringFromHSSFRow(hssfRow, 13));//销售数量
sd.setStoreCode(ExcelTool.readStringFromHSSFRow(hssfRow, 14));//销售渠道
sd.setSalePrice(ExcelTool.readStringFromHSSFRow(hssfRow, 15));//销售价格
sd.setSaleCost(ExcelTool.readStringFromHSSFRow(hssfRow, 16));//销售成本
sd.setProfit(ExcelTool.readStringFromHSSFRow(hssfRow, 17));//利润
sd.setDataDate(ExcelTool.readStringFromHSSFRow(hssfRow, 18));//销售日期
salesDatas.add(sd);
}catch(Exception e){
e.printStackTrace();
System.err.println("i="+i+",value=null");
}
lisss.add(rowNum+"");
//inventoryInformationService.reduceStock(sd.getProCode(),sd.getProName(),sd.getStoreCode(),sd.getSaleNum());
log.info("productInformation:{}", JSONObject.toJSONString(sd));
log.info("rowNum:{}", rowNum);
}
String x = JSON.toJSONString(lisss);
System.out.println(x);*/
}
@Resource
private GdInstorageGdService gdInstorageGdService;
@ -479,7 +426,6 @@ public class SalesDataService extends MybatisBaseService<SalesDataMapper, SalesD
//创建HSSFWorkbook
//addProductNum(list);
List<Map<String,String>> listss=new ArrayList<>();
int i=0;
for(SalesData s:list){
String proCode = s.getProCode();
//List<StoreInfo> storeInfos=storeInfoService.selectLimitStores();
@ -503,14 +449,22 @@ public class SalesDataService extends MybatisBaseService<SalesDataMapper, SalesD
map.put("t9",multiply.toString());
map.put("t10",s.getDataDate());
listss.add(map);
log.info("i:{}",i++);
//} else {
log.info("SalesData:{}",JSONObject.toJSONString(s));
// }
}
}
log.info("SalesData:{}",listss.size());
List<List<Map<String,String>>> listArray = new ArrayList<List<Map<String,String>>>();
int listSize = listss.size();
int pageSize=2000;
for (int i = 0; i < listSize; i += pageSize) {
int toIndex = Math.min(i + pageSize, listSize);
listArray.add(listss.subList(i, toIndex));
}
log.info("开始新增salestest");
baseMapper.insertsalestest(listss);
for(List<Map<String,String>> l:listArray){
log.info("Map<String,String>-start:{}",l.size());
baseMapper.insertsalestest(l);
log.info("Map<String,String>-end:{}",l.size());
}
log.info("结束新增salestest");
log.info("开始新增jmdRkmxdOfDay");
List<GdInstorageGd> gdInstorageGds = gdInstorageGdService.jmdRkmxdOfDay(pc);

9
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierinfo/SupplierInfoMapper.java

@ -60,13 +60,14 @@ public interface SupplierInfoMapper extends BaseMapper<SupplierInfo> {
List<SupplierInfoVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<SupplierInfo> qw);
@Select("select * from supplier_info ")
@Select("select * from supplier_bank_info ")
List<SupplierInfoVo> selectListVo();
@Select("select * from supplier_info where purchaseRequisition=1 and bankState=1")
@Select("select * from supplier_bank_info where purchaseRequisition=1 and bankState=1")
List<SupplierInfoVo> selectAdoptedListVo();
@Select("select supplierName name from purchase_requisition group by supplierName")
List<SupplierInfoVo> selectPurSupplier();
@Select("select * from supplier_info where code=#{code}")
@Select("select * from supplier_bank_info where code=#{code}")
SupplierInfoVo selectByCode(String code);
@Select("select * from supplier_index where code=#{code}")
SupplierInfoVo selectByCodeForIndex(@Param("code") String supplierCode);
}

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierinfo/SupplierInfoMapper.xml

@ -4,10 +4,10 @@
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.supervise.portal.api.supplierinfo.SupplierInfoVo">
SELECT * FROM supplier_info <where> ${ew.sqlSegment} </where>
SELECT * FROM supplier_bank_info <where> ${ew.sqlSegment} </where>
</select>
<select id="selectListAllVo" resultType="com.yxt.supervise.portal.api.supplierinfo.SupplierInfoVo">
SELECT * FROM supplier_info <where> ${ew.sqlSegment} </where>
SELECT * FROM supplier_bank_info <where> ${ew.sqlSegment} </where>
</select>
</mapper>

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierinfo/SupplierInfoService.java

@ -114,4 +114,8 @@ public class SupplierInfoService extends MybatisBaseService<SupplierInfoMapper,
public List<SupplierInfoVo> selectAdoptedListVo() {
return baseMapper.selectAdoptedListVo();
}
public SupplierInfoVo selectByCodeForIndex(String supplierCode) {
return baseMapper.selectByCodeForIndex(supplierCode);
}
}

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