diff --git a/base-ui/package.json b/base-ui/package.json index 63dc08a2..37fbcb8c 100644 --- a/base-ui/package.json +++ b/base-ui/package.json @@ -18,6 +18,7 @@ "core-js": "^3.26.1", "echarts": "^5.4.1", "element-ui": "2.13.2", + "ezuikit-js": "^0.7.0", "js-cookie": "2.2.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", diff --git a/base-ui/src/router/codemenu.js b/base-ui/src/router/codemenu.js index c55a84b6..87ab01a7 100644 --- a/base-ui/src/router/codemenu.js +++ b/base-ui/src/router/codemenu.js @@ -99,6 +99,20 @@ const codemenu = [ meta: { title: '入库明细表(原始导入)' } }] }, +/* { + path: '/monitoringCenter', + component: Layout, + redirect: '/monitoringCenter/index', + meta: { + title: '监控中心' + }, + children: [{ + path: '/monitoringCenter/index', + component: () => import('@/views/supervise/monitoringCenter/index.vue'), + name: 'monitoringCenterIndex', + meta: { title: '视频监控' } + }] + },*/ { path: '/gdinstoragelog', component: Layout, diff --git a/base-ui/src/router/index.js b/base-ui/src/router/index.js index 5edeb159..8b88f880 100644 --- a/base-ui/src/router/index.js +++ b/base-ui/src/router/index.js @@ -54,76 +54,57 @@ export const constantRoutes = [ }, ] }, - // 客户中心 { - path: '1', + path: 'customer', component: Layout, meta: { title: '客户中心' }, children: [ { - path: 'cgsq/PurchaseApplicationManagement', + path: '/supervise/purchaseapplicationmanagement/purchaseapplicationmanagement', component: () => import('@/views/supervise/purchaseapplicationmanagement/purchaseapplicationmanagement.vue'), - name: 'PurchaseApplicationManagement', + name: 'purchaseapplicationmanagement', meta: {title: '采购申请管理',noCache: true,} }, { - path: 'xzgys', + path: '/supervise/supplierbankinfo/supplierbankinfo', 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', + path: 'dataReporting', component: Layout, meta: {title: '数据上报'}, children: [ { - path: '/404', - component: () => import('@/views/404'), - name: 'manufacturerPreference', - meta: {title: '综合数据上报',noCache: true} + path: '/kucun/rkmx/index', + component: () => import('@/views/kucun/rkmx/index.vue'), + name: 'receiptDetailsReporting', + 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: '/kucun/kcxxcx/index', + component: () => import('@/views/kucun/kcxxcx/index.vue'), + name: 'inventoryDetailsReporting', + meta: {title: '库存明细上报',noCache: true} }, { - path: '/404', - component: () => import('@/views/404'), - name: 'manufacturerPreference', - meta: {title: '库存上报',noCache: true} + path: '/kucun/pfsjgl/index', + component: () => import('@/views/kucun/pfsjgl/index.vue'), + name: 'wholesaleDataReporting', + meta: {title: '批发数据上报',noCache: true} }, { - path: '/404', - component: () => import('@/views/404'), - name: 'manufacturerPreference', - meta: {title: '销售上报',noCache: true} + path: '/kucun/xssjgl/index.vue', + component: () => import('@/views/kucun/xssjgl/index.vue'), + name: 'salesDetailsReporting', + 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} } ], }, @@ -180,7 +161,7 @@ export const constantRoutes = [ }, // 审批中心 { - path: '', + path: 'approvalCenter', component: Layout, meta: { title: '审批中心' }, children: [ @@ -211,7 +192,7 @@ export const constantRoutes = [ ] }, { - path: '', + path: 'messageCenter', component: Layout, meta: { title: '消息中心' }, children: [ @@ -230,12 +211,12 @@ export const constantRoutes = [ ] }, { - path: '', + path: 'reportCenter', component: Layout, meta: { title: '报表中心' }, children: [ { - path: 'reportCenter/salesReport', + path: '/reportCenter/salesReport', component: () => import('@/views/reportCenter/salesReport.vue'), name: 'salesReport', meta: {title: '销售报表',noCache: true,} @@ -249,7 +230,7 @@ export const constantRoutes = [ ] }, { - path: '', + path: 'riskControlManagement', component: Layout, meta: { title: '风控管理' }, children: [ @@ -262,15 +243,29 @@ export const constantRoutes = [ ] }, { - path: '', + path: '/monitoringCenter', + component: Layout, + redirect: '/monitoringCenter/index', + meta: { + title: '监控中心' + }, + children: [{ + path: '/monitoringCenter/index', + component: () => import('@/views/supervise/monitoringCenter/index.vue'), + name: 'monitoringCenterIndex', + meta: { title: '视频监控' } + }] + }, + { + path: 'systemManagement', component: Layout, meta: { title: '系统管理' }, children: [ { - path: 'risk/thresholdAnalysis', - component: () => import('@/views/risk/thresholdAnalysis.vue'), + path: '/404', + component: () => import('@/views/404'), name: 'thresholdAnalysis', - meta: {title: '阀值分析',noCache: true,} + meta: {title: '用户管理',noCache: true,} } ] }, diff --git a/base-ui/src/views/kucun/kcxxcx/index.vue b/base-ui/src/views/kucun/kcxxcx/index.vue index 2400ee7a..5159dde1 100644 --- a/base-ui/src/views/kucun/kcxxcx/index.vue +++ b/base-ui/src/views/kucun/kcxxcx/index.vue @@ -36,8 +36,8 @@
{{ hzResultMesssage }}
- 下载汇总文件 - 下载烟草汇总文件 + 下载库存汇总文件 +
@@ -46,7 +46,7 @@ + + diff --git a/base-ui/vue.config.js b/base-ui/vue.config.js index d5aab882..2f93c92e 100644 --- a/base-ui/vue.config.js +++ b/base-ui/vue.config.js @@ -41,9 +41,9 @@ module.exports = { proxy: { '/api': { // 匹配所有以 '/api'开头的请求路径 // target: 'http://26077a35f5.wicp.vip', - // target: process.env.VUE_APP_URL, // 代理目标的基础路径 + target: process.env.VUE_APP_URL, // 代理目标的基础路径 // target: "http://192.168.1.102:4523/mock/613533", // 代理目标的基础路径 - target: "http://127.0.0.1:4523/m1/1913288-0-default", + // target: "http://127.0.0.1:4523/m1/1913288-0-default", changeOrigin: true, // 支持跨域 pathRewrite: { // 重写路径: 去掉路径中开头的'/api' '^/api': '' diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java index 6cd22cfe..37155186 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java @@ -83,4 +83,27 @@ public interface GdInstorageCountMapper extends BaseMapper { */ @Select("SELECT name,code,CONVERT(billTotalPrice,DECIMAL(12,2)) billTotalPrice,billDate,arrivalDate FROM hz_gysddmxb") List> ddmxb(); + + /** + * 烟草订单明细表 + * + * @return + */ + @Select("SELECT prs.storeName storeName ,prt.code code ,CONVERT(SUM(prs.price),DECIMAL(12,2)) price,prt.purchaseDate purchaseDate, " + + "prt.arrivalDate arrivalDate " + + " FROM purchase_requisition_store prs " + + "LEFT JOIN `purchase_requisition_tobacco` prt ON prt.sid=prs.mainsid " + + "GROUP BY prs.storeCode ORDER BY prs.storeName ") + List> ycddmxb(); + + @Select("SELECT CONCAT('[',prs.storeCode,']',prs.storeName) storeName , " + + "CONVERT(SUM(prs.price),DECIMAL(12,2)) ddspjz, " + + "CONVERT(IFNULL(SUM(giy.colq16),0),DECIMAL(12,2)) colq16, " + + "CONVERT(IF(SUM(prs.price)-IFNULL(SUM(giy.colq16),0)>0,SUM(prs.price)-IFNULL(SUM(giy.colq16),0),0),DECIMAL(12,2)) ztprodValue1, " + + "CONVERT(IF(IFNULL(SUM(giy.colq16),0)-SUM(prs.price)>0,IFNULL(SUM(giy.colq16),0)-SUM(prs.price),0),DECIMAL(12,2)) ztprodValue2 " + + " FROM `purchase_requisition_store` prs " + + "LEFT JOIN `purchase_requisition_tobacco_details` prtd ON prs.sid=prtd.mainsid " + + "LEFT JOIN `gd_instorage_yc` giy ON giy.colb1=prs.storeCode " + + "GROUP BY prs.storeCode ") + List> ycspdhmxb(); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java index bd94dfe6..10d0a319 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java @@ -136,10 +136,10 @@ public class GdInstorageCountService extends ServiceImpl> list4 = baseMapper.ycspdhmxb(); + if (list4 != null && !list4.isEmpty()) { + int size4 = list4.size(); + int countRow4 = size4 + 3; + double ccddspjz = 0, cccolq16 = 0, ccztprodValue1 = 0, ccztprodValue2 = 0; + for (int y = 3; y < countRow2; y++) { + Map map = list4.get(y - 3); + + writer.writeCellValue(0, y, "市烟草"); + writer.writeCellValue(1, y, map.get("storeName")); + writer.writeCellValue(2, y, map.get("ddspjz")); + ccddspjz = ccddspjz + ExcelTool.toDouble(map.get("ddspjz")); + writer.writeCellValue(3, y, map.get("colq16")); + cccolq16 = cccolq16 + ExcelTool.toDouble(map.get("colq16")); + writer.writeCellValue(4, y, map.get("ztprodValue1")); + ccztprodValue1 = ccztprodValue1 + ExcelTool.toDouble(map.get("ztprodValue1")); + writer.writeCellValue(5, y, map.get("ztprodValue2")); + ccztprodValue2 = ccztprodValue2 + ExcelTool.toDouble(map.get("ztprodValue2")); + } + writer.writeCellValue(1, countRow4, "合计"); + writer.writeCellValue(2, countRow4, ccddspjz); + writer.writeCellValue(3, countRow4, cccolq16); + writer.writeCellValue(4, countRow4, ccztprodValue1); + writer.writeCellValue(5, countRow4, ccztprodValue2); + } // 烟草订单明细表 - // writer.setSheet(4); + writer.setSheet(4); + writer.writeCellValue(0, 1, "编号:ycddmxb" + dfmt1); + writer.writeCellValue(4, 1, "数据时间:" + dfmt); + List> list5 = baseMapper.ycddmxb(); + if (list5 != null && !list5.isEmpty()) { + int size5 = list5.size(); + int countRow5 = size5 + 3; + xh = 0; + double cPrice = 0; + for (int y = 3; y < countRow5; y++) { + Map map = list5.get(y - 3); + xh++; + writer.writeCellValue(0, y, xh); + writer.writeCellValue(1, y, map.get("storeName")); + writer.writeCellValue(2, y, map.get("code")); + writer.writeCellValue(3, y, map.get("price")); + cPrice = cPrice + ExcelTool.toDouble(map.get("price")); + writer.writeCellValue(4, y, map.get("purchaseDate")); + writer.writeCellValue(5, y, map.get("arrivalDate")); + } + writer.writeCellValue(1, countRow5, "合计金额"); + writer.writeCellValue(3, countRow5, cPrice); + } writer.flush(); writer.close(); @@ -218,4 +267,13 @@ public class GdInstorageCountService extends ServiceImpl> list = baseMapper.gysdhhzb(); + for (Map map : list) { + wdhjz = wdhjz + ExcelTool.toDouble(map.get("wdhjz")); + } + return wdhjz; + } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdMapper.java index 5570a523..08d9d956 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdMapper.java @@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * Project: yxt_supervise
@@ -47,4 +48,7 @@ import org.apache.ibatis.annotations.Param; public interface GdInstorageJmdMapper extends BaseMapper { @Delete("delete from gd_instorage_jmd where orderDate=#{orderDate} ") void clearByOrderDate(@Param("orderDate") String orderDate); + + @Select("SELECT IFNULL(sum(colq16),0) as amount FROM gd_instorage_jmd where orderDate=#{orderDate} ") + double amountOfDay(@Param("orderDate") String orderDate); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdService.java index 1a97ef4b..1d3064d6 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageJmdService.java @@ -47,4 +47,8 @@ public class GdInstorageJmdService extends ServiceImpl @@ -47,4 +48,9 @@ import org.apache.ibatis.annotations.Param; public interface GdInstorageYcMapper extends BaseMapper { @Delete("delete from gd_instorage_yc where orderDate=#{orderDate} ") void clearByOrderDate(@Param("orderDate") String orderDate); + + @Select("select IFNULL(sum(t.colq16),0) as amount from ( " + + " select gig.* from gd_instorage_yc gig left join store_index si on gig.colb1=si.code " + + " where gig.orderDate=#{orderDate} and si.`type` ='连锁外加盟(销配结算)' ) t ") + double amountOfDayJmd(@Param("orderDate") String orderDate); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcService.java index f0f56699..198e6161 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageYcService.java @@ -46,4 +46,8 @@ public class GdInstorageYcService extends ServiceImpl { @Select("select prodCode,CONVERT(IFNULL(sum(prodNum),0),CHAR) pnum from gd_inventory_ok group by prodCode") List> numberOfProduct(); + + @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok") + double amountCurrent(); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java index e76da84f..3646de66 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java @@ -32,6 +32,8 @@ import cn.hutool.poi.excel.ExcelWriter; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.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; @@ -63,10 +65,23 @@ public class GdInventoryOkService extends ServiceImpl> listOfWarehouse() { + return baseMapper.listOfWarehouse(); + } + + // 仓库商品明细表 + public List> listOfProd(){ + return baseMapper.listOfProd(); + } + /** * 库存汇总 * @@ -88,6 +103,12 @@ public class GdInventoryOkService extends ServiceImpl> list = baseMapper.listOfWarehouse(); // writer = ExcelUtil.getWriter(file); writer.setSheet(1); @@ -142,17 +170,21 @@ public class GdInventoryOkService extends ServiceImpl map = list.get(y - 3); writer.writeCellValue(0, y, map.get("warehouseName")); writer.writeCellValue(1, y, map.get("warehouseType")); writer.writeCellValue(2, y, map.get("coun")); writer.writeCellValue(3, y, map.get("su")); + hz1 = hz1 + ExcelTool.toDouble(map.get("su")); } writer.writeCellValue(0, countRow, "合计"); + writer.writeCellValue(3, countRow, hz1); // writer.flush(); // writer.close(); + // 仓库商品明细表 List> listp = baseMapper.listOfProd(); // writer = ExcelUtil.getWriter(file); writer.setSheet(2); @@ -160,6 +192,7 @@ public class GdInventoryOkService extends ServiceImpl map = listp.get(y - 3); writer.writeCellValue(0, y, map.get("warehouseCode")); @@ -170,7 +203,53 @@ public class GdInventoryOkService extends ServiceImpl> listyc = gdInventoryYcService.listOfWarehouse(); + writer.setSheet(3); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(3, 1, datefmt1); + int sizeyc = listyc.size(); + int countRowyc = sizeyc + 3; + double hj3 = 0; + for (int y = 3; y < countRowyc; y++) { + Map map = listyc.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseName")); + writer.writeCellValue(1, y, map.get("warehouseType")); + writer.writeCellValue(2, y, map.get("coun")); + writer.writeCellValue(3, y, map.get("su")); + hj3 = hj3 + ExcelTool.toDouble(map.get("su")); } + writer.writeCellValue(0, countRowyc, "合计"); + writer.writeCellValue(3, countRowyc, hj3); + +// 烟草仓库商品明细表 + List> listpyc = gdInventoryYcService.listOfProd(); + writer.setSheet(4); + writer.writeCellValue(0, 1, "编号:" + timestr); + writer.writeCellValue(6, 1, datefmt2); + int sizepyc = listpyc.size(); + int countRowpyc = sizepyc + 3; + double hz4 = 0; + for (int y = 3; y < countRowpyc; y++) { + Map map = listpyc.get(y - 3); + writer.writeCellValue(0, y, map.get("warehouseCode")); + writer.writeCellValue(1, y, map.get("warehouseName")); + writer.writeCellValue(2, y, map.get("warehouseType")); + writer.writeCellValue(3, y, map.get("prodCode")); + writer.writeCellValue(4, y, map.get("prodBarCode")); + writer.writeCellValue(5, y, map.get("prodName")); + writer.writeCellValue(6, y, map.get("prodNum")); + writer.writeCellValue(7, y, map.get("prodValue")); + hz4 = hz4 + ExcelTool.toDouble(map.get("prodValue")); + } + writer.writeCellValue(0, countRowpyc, "合计"); + writer.writeCellValue(7, countRowpyc, hz4); + writer.flush(); writer.close(); @@ -189,4 +268,8 @@ public class GdInventoryOkService extends ServiceImpl map.put(m.get("prodCode"), m.get("pnum"))); return map; } + + public double amountCurrent() { + return baseMapper.amountCurrent(); + } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java index 7d8a1e0c..862caf10 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java +++ b/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 map = readMapFromRow(r); diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryYcService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryYcService.java index 0596ca99..eea91bc8 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryYcService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryYcService.java @@ -60,10 +60,31 @@ public class GdInventoryYcService extends ServiceImpl> listOfWarehouse() { + return baseMapper.listOfWarehouse(); + } + + public List> listOfProd() { + return baseMapper.listOfProd(); + } + public ResultBean kchzyc() { ResultBean rb = ResultBean.fireFail(); diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesMapper.java index 7b24659d..7f8c5377 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesMapper.java @@ -29,6 +29,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; /** * Project: yxt_supervise
@@ -48,4 +52,32 @@ public interface GdSalesMapper extends BaseMapper { @Delete("delete from gd_sales where dataDate=#{dataDate} ") void clearByDataDate(@Param("dataDate") String dataDate); + + @Select("select t2.storeCode,si.name,t2.amount from( " + + " select storeCode,sum(t1.price) as amount from( " + + " select storeCode,saleNum*salePrice as price from gd_sales where dataDate=#{dataDate} " + + " ) t1 group by t1.storeCode " + + ") t2 left join store_index si on t2.storecode=si.code ") + List> listOfStoreOnDay(@Param("dataDate") String orderDate); + + @Select("select count(1) from (select storeCode from gd_sales where dataDate=#{dataDate} group by storeCode) t") + int countStoreOnDay(@Param("dataDate") String orderDate); + + @Select("select count(1) from (select prodCode from gd_sales where dataDate=#{dataDate} group by prodCode) t") + int countProductOnDay(@Param("dataDate") String orderDate); + + @Select("select si.name,t1.* from ( " + + " select storeCode,orderType,orderNo,prodCode,prodName,saleNum,salePrice,saleNum*salePrice as amount from gd_sales where dataDate=#{dataDate} " + + ") t1 left join store_index si on t1.storecode=si.code ") + List> listOfProductOnDay(@Param("dataDate") String orderDate); + + @Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " + + " select gs.saleNum,gs.salePrice from gd_sales gs left join store_index si on gs.storeCode=si.code " + + " where gs.dataDate=#{dataDate} and si.`type` ='连网连锁店' ) t ") + double amountOfLsdOnDay(@Param("dataDate") String orderDate); + + @Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " + + " select gs.saleNum,gs.salePrice from gd_sales gs left join store_index si on gs.storeCode=si.code " + + " where gs.dataDate=#{dataDate} and si.`type` ='连锁内加盟' ) t ") + double amountOfLsnjmOnDay(String orderDate); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportday.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportday.java new file mode 100644 index 00000000..7849133d --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportday.java @@ -0,0 +1,85 @@ +package com.yxt.supervise.portal.biz.gdsales; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("gd_sales_reportday") +public class GdSalesReportday extends EntityWithId { + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime = new Date(); // 记录创建时间/ + private String remarks; // 备注说明 + private String orderDate; // 单据日期 + private String serialNumber; // 编号 + private String reportTime; // 上报时间 + private String kmdatea; // 科目/日,大前天 + private String kmdateb; // 科目/日,前天 + private String kmdatec; // 科目/日,昨天 + private double xjlla = 0; // 现金流量-经营活动产生的现金流量(元),大前天 + private double xjllb = 0; // 现金流量-经营活动产生的现金流量(元),前天 + private double xjllc = 0; // 现金流量-经营活动产生的现金流量(元),昨天 + private double xsxja = 0; // 销售商品收到的现金(元),大前天 + private double xsxjb = 0; // 销售商品收到的现金(元),前天 + private double xsxjc = 0; // 销售商品收到的现金(元),昨天 + private double qtxja = 0; // 收到其他与经营活动有关的现金(元),大前天 + private double qtxjb = 0; // 收到其他与经营活动有关的现金(元),前天 + private double qtxjc = 0; // 收到其他与经营活动有关的现金(元),昨天 + private double cwfxhja = 0; // 财务分析本项合计,大前天 + private double cwfxhjb = 0; // 财务分析本项合计,前天 + private double cwfxhjc = 0; // 财务分析本项合计,昨天 + private double zcfza = 0; // 资产负债-流动资产(元),大前天 + private double zcfzb = 0; // 资产负债-流动资产(元),前天 + private double zcfzc = 0; // 资产负债-流动资产(元),昨天 + private double yszka = 0; // 应收账款(元),大前天 + private double yszkb = 0; // 应收账款(元),前天 + private double yszkc = 0; // 应收账款(元),昨天 + private double ldfza = 0; // 流动负债(元),大前天 + private double ldfzb = 0; // 流动负债(元),前天 + private double ldfzc = 0; // 流动负债(元),昨天 + private double yskxa = 0; // 预收款项(元),大前天 + private double yskxb = 0; // 预收款项(元),前天 + private double yskxc = 0; // 预收款项(元),昨天 + private String qczhz; // 期初总货值 + private String ycqchz; // 烟草期初货值 + private String xmdatea; // 项目/日,前天 + private String xmdateb; // 项目/日,昨天 + private String xmdatec; // 项目/日,今天 + private double zthza = 0; // 在途货值(元),前天 + private double zthzb = 0; // 在途货值(元),昨天 + private double zthzc = 0; // 在途货值(元),今天 + private double kchza = 0; // 库存货值(元),前天 + private double kchzb = 0; // 库存货值(元),昨天 + private double kchzc = 0; // 库存货值(元),今天 + private double zhyea = 0; // 帐户余额(元)账户余额为前一天余额,前天 + private double zhyeb = 0; // 帐户余额(元)账户余额为前一天余额,昨天 + private double zhyec = 0; // 帐户余额(元)账户余额为前一天余额,今天 + private double yjyszka = 0; // 预警应收帐款(元),前天 + private double yjyszkb = 0; // 预警应收帐款(元),昨天 + private double yjyszkc = 0; // 预警应收帐款(元),今天 + private double yjhja = 0; // 主要预警指标本项合计,前天 + private double yjhjb = 0; // 主要预警指标本项合计,昨天 + private double yjhjc = 0; // 主要预警指标本项合计,今天 + private double lwlsdze = 0; // 连网连锁店,总额(元) + private double lwlsdyszk = 0; // 连网连锁店,应收帐款(元) + private double lwlsdkcje = 0; // 连网连锁店,扣除应收金额(元) + private double lsnjmze = 0; // 连锁内加盟,总额(元) + private double lsnjmyszk = 0; // 连锁内加盟,应收帐款(元) + private double lsnjmkcje = 0; // 连锁内加盟,扣除应收金额(元) + private double pszxze = 0; // 配送中心,总额(元) + private double pszxyszk = 0; // 配送中心,应收帐款(元) + private double pszxkcje = 0; // 配送中心,扣除应收金额(元) + private double lswjmze = 0; // 连锁外加盟(销配结算),总额(元) + private double lswjmyszk = 0; // 连锁外加盟(销配结算),应收帐款(元) + private double lswjmkcje = 0; // 连锁外加盟(销配结算),扣除应收金额(元) + private double ycmdze = 0; // 36524集团报烟门店仓,总额(元) + private double ycmdyszk = 0; // 36524集团报烟门店仓,应收帐款(元) + private double ycmdkcje = 0; // 36524集团报烟门店仓,扣除应收金额(元) + private double ycjmdze = 0; // 烟草连锁外加盟(销配结算),总额(元) + private double ycjmdyszk = 0; // 烟草连锁外加盟(销配结算),应收帐款(元) + private double ycjmdkcje = 0; // 烟草连锁外加盟(销配结算),扣除应收金额(元) +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayMapper.java new file mode 100644 index 00000000..690633c6 --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayMapper.java @@ -0,0 +1,14 @@ +package com.yxt.supervise.portal.biz.gdsales; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface GdSalesReportdayMapper extends BaseMapper { + + + @Delete("delete from gd_sales_reportday where orderDate=#{orderDate} ") + void clearByOrderDate(@Param("orderDate") String orderDate); +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayService.java new file mode 100644 index 00000000..44ccc87f --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayService.java @@ -0,0 +1,172 @@ +package com.yxt.supervise.portal.biz.gdsales; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountService; +import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmdService; +import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageYcService; +import com.yxt.supervise.portal.biz.gdinventory.GdInventoryOkService; +import com.yxt.supervise.portal.biz.gdwholesale.GdWholesaleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +public class GdSalesReportdayService extends ServiceImpl { + + @Autowired + private GdSalesService gdSalesService; + @Autowired + private GdSalesYcService gdSalesYcService; + @Autowired + private GdWholesaleService gdWholesaleService; + @Autowired + private GdInstorageJmdService gdInstorageJmdService; + @Autowired + private GdInstorageYcService gdInstorageYcService; + @Autowired + private GdInventoryOkService gdInventoryOkService; + @Autowired + private GdInstorageCountService gdInstorageCountService; + + public GdSalesReportday clearAndInitByOrderDate(String orderDate) { + this.clearByOrderDate(orderDate); // 清除数据日的数据 + + Date curDate = new Date(); + String dfmt = DateUtil.format(curDate, "yyyy-MM-dd"); + String dfmt2 = DateUtil.format(curDate, "yyyy-MM-dd HH:mm"); + + String preOrderDate = dayAgo(orderDate, -1); // 前一天 + String befOrderDate = dayAgo(orderDate, -2); // 前两天 + String thrOrderDate = dayAgo(orderDate, -3); // 前三天 + + GdSalesReportday preRp = fetchByOrderDate(preOrderDate); + if (preRp == null) + preRp = new GdSalesReportday(); + + GdSalesReportday rp = new GdSalesReportday(); + rp.setOrderDate(orderDate); // 单据日期 + rp.setSerialNumber("xsjyrbb" + orderDate.replace("-", "")); // 编号 + rp.setReportTime(dfmt2); // 上报时间 + rp.setKmdatea(befOrderDate); // 科目/日,大前天 + rp.setKmdateb(preOrderDate); // 科目/日,前天 + rp.setKmdatec(orderDate); // 科目/日,昨天 + // rp.setXjlla(""); // 现金流量-经营活动产生的现金流量(元),大前天 + // rp.setXjllb(""); // 现金流量-经营活动产生的现金流量(元),前天 + // rp.setXjllc(""); // 现金流量-经营活动产生的现金流量(元),昨天 + rp.setXsxja(preRp.getXsxjb()); // 销售商品收到的现金(元),大前天 + rp.setXsxjb(preRp.getXsxjc()); // 销售商品收到的现金(元),前天 + rp.setXsxjc(0); // 销售商品收到的现金(元),昨天 //后面计算 + // rp.setQtxja(""); // 收到其他与经营活动有关的现金(元),大前天 + // rp.setQtxjb(""); // 收到其他与经营活动有关的现金(元),前天 + // rp.setQtxjc(""); // 收到其他与经营活动有关的现金(元),昨天 + rp.setCwfxhja(preRp.getCwfxhjb()); // 财务分析本项合计,大前天 + rp.setCwfxhjb(preRp.getCwfxhjc()); // 财务分析本项合计,前天 + rp.setCwfxhjc(0); // 财务分析本项合计,昨天 //后面计算 + // rp.setZcfza(""); // 资产负债-流动资产(元),大前天 + // rp.setZcfzb(""); // 资产负债-流动资产(元),前天 + // rp.setZcfzc(""); // 资产负债-流动资产(元),昨天 + // rp.setYszka(""); // 应收账款(元),大前天 + // rp.setYszkb(""); // 应收账款(元),前天 + // rp.setYszkc(""); // 应收账款(元),昨天 + // rp.setLdfza(""); // 流动负债(元),大前天 + // rp.setLdfzb(""); // 流动负债(元),前天 + // rp.setLdfzc(""); // 流动负债(元),昨天 + // rp.setYskxa(""); // 预收款项(元),大前天 + // rp.setYskxb(""); // 预收款项(元),前天 + // rp.setYskxc(""); // 预收款项(元),昨天 + rp.setQczhz(""); // 期初总货值 + rp.setYcqchz(""); // 烟草期初货值 + rp.setXmdatea(StrUtil.isBlank(preRp.getXmdateb()) ? preOrderDate : preRp.getXmdateb()); // 项目/日,前天 + rp.setXmdateb(StrUtil.isBlank(preRp.getXmdatec()) ? orderDate : preRp.getXmdatec()); // 项目/日,昨天 + rp.setXmdatec(dfmt); // 项目/日,今天 + rp.setZthza(preRp.getZthzb()); // 在途货值(元),前天 + rp.setZthzb(preRp.getZthzc()); // 在途货值(元),昨天 + rp.setZthzc(0); // 在途货值(元),今天 // 计算 + rp.setKchza(preRp.getKchzb()); // 库存货值(元),前天 + rp.setKchzb(preRp.getKchzc()); // 库存货值(元),昨天 + rp.setKchzc(0); // 库存货值(元),今天 // 计算 + // rp.setZhyea(""); // 帐户余额(元)账户余额为前一天余额,前天 + // rp.setZhyeb(""); // 帐户余额(元)账户余额为前一天余额,昨天 + // rp.setZhyec(""); // 帐户余额(元)账户余额为前一天余额,今天 + // rp.setYjyszka(""); // 预警应收帐款(元),前天 + // rp.setYjyszkb(""); // 预警应收帐款(元),昨天 + // rp.setYjyszkc(""); // 预警应收帐款(元),今天 + // rp.setYjhja(""); // 主要预警指标本项合计,前天 + // rp.setYjhjb(""); // 主要预警指标本项合计,昨天 + // rp.setYjhjc(""); // 主要预警指标本项合计,今天 + double xsLwlsd = gdSalesService.amountOfLwlsdDay(orderDate); + rp.setLwlsdze(xsLwlsd); // 连网连锁店,总额(元) + // rp.setLwlsdyszk(""); // 连网连锁店,应收帐款(元) + rp.setLwlsdkcje(xsLwlsd); // 连网连锁店,扣除应收金额(元) + + double xsLsnjm = gdSalesService.amountOfLsnjmDay(orderDate); + rp.setLsnjmze(xsLsnjm); // 连锁内加盟,总额(元) + // rp.setLsnjmyszk(""); // 连锁内加盟,应收帐款(元) + rp.setLsnjmkcje(xsLsnjm); // 连锁内加盟,扣除应收金额(元) + + double xsPszx = gdWholesaleService.amountOfDay(orderDate); + rp.setPszxze(xsPszx); // 配送中心,总额(元) + // rp.setPszxyszk(""); // 配送中心,应收帐款(元) + rp.setPszxkcje(xsPszx); // 配送中心,扣除应收金额(元) + + double xsLswjm = gdInstorageJmdService.amountOfDay(orderDate); + rp.setLswjmze(xsLswjm); // 连锁外加盟(销配结算),总额(元) + // rp.setLswjmyszk(""); // 连锁外加盟(销配结算),应收帐款(元) + rp.setLswjmkcje(xsLswjm); // 连锁外加盟(销配结算),扣除应收金额(元) + + double xsYc = gdSalesYcService.amountOfDay(orderDate); + rp.setYcmdze(xsYc); // 36524集团报烟门店仓,总额(元) + // rp.setYcmdyszk(""); // 36524集团报烟门店仓,应收帐款(元) + rp.setYcmdkcje(xsYc); // 36524集团报烟门店仓,扣除应收金额(元) + + double xsYcJmd = gdInstorageYcService.amountOfDayJmd(orderDate); + rp.setYcjmdze(xsYcJmd); // 烟草连锁外加盟(销配结算),总额(元) + // rp.setYcjmdyszk(""); // 烟草连锁外加盟(销配结算),应收帐款(元) + rp.setYcjmdkcje(xsYcJmd); // 烟草连锁外加盟(销配结算),扣除应收金额(元) + + double xshz1 = Math.round((xsLwlsd + xsLsnjm + xsPszx + xsLswjm + xsYc + xsYcJmd) * 100) / 100; + rp.setXsxjc(xshz1); // 销售商品收到的现金(元),昨天 //后面计算 + rp.setCwfxhjc(xshz1); // 财务分析本项合计,昨天 //后面计算 + + //在途货值 + double zthz = gdInstorageCountService.amountZaitu(); + rp.setZthzc(0); // 在途货值(元),今天 // 计算 + + //库存货值 + double kzhz = gdInventoryOkService.amountCurrent(); + rp.setKchzc(0); // 库存货值(元),今天 // 计算 + + baseMapper.insert(rp); + return rp; + } + + public GdSalesReportday fetchByOrderDate(String orderDate) { + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("orderDate", orderDate); + List list = list(qw); + if (list == null || list.isEmpty()) + return null; + return list.get(0); + } + + private String dayAgo(String orderDate, int offset) { + DateTime nowDate = DateUtil.parse(orderDate, "yyyy-MM-dd"); + DateTime preDate = DateUtil.offsetDay(nowDate, offset); + return DateUtil.format(preDate, "yyyy-MM-dd"); + } + + /** + * 清理数据日期的数据 + * + * @param orderDate + */ + public void clearByOrderDate(String orderDate) { + baseMapper.clearByOrderDate(orderDate); + } +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java index d533afb5..b4412972 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java @@ -28,7 +28,6 @@ package com.yxt.supervise.portal.biz.gdsales; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.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; @@ -90,6 +89,8 @@ public class GdSalesService extends ServiceImpl { private StoreInfoService storeInfoService; @Autowired private StoreIndexService storeIndexService; + @Autowired + private GdSalesReportdayService gdSalesReportdayService; public ResultBean uploadAndInsert(MultipartFile file) { ResultBean rb = ResultBean.fireFail(); @@ -162,6 +163,7 @@ public class GdSalesService extends ServiceImpl { odate = dataDate; GdSalesGd gd = rowToEntity(r); toInsertListGd.add(gd); + // 监管商品销售数据 if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(storeCode)) { GdSales gw = new GdSales(); BeanUtil.copyProperties(gd, gw); @@ -169,6 +171,7 @@ public class GdSalesService extends ServiceImpl { y++; } + // 烟草销售数据 if (checkYcProd(typeTwo) && storeInfoService.containsCodeOfYc(storeCode)) { GdSalesYc gyc = new GdSalesYc(); BeanUtil.copyProperties(gd, gyc); @@ -218,6 +221,8 @@ public class GdSalesService extends ServiceImpl { if (gdLog == null) return rb.setMsg("上传记录未找到"); String orderDate = gdLog.getOrderDate(); + GdSalesReportday reportday = gdSalesReportdayService.clearAndInitByOrderDate(orderDate); + Date curDate = new Date(); String timestr = DateUtil.format(curDate, "yyyyMMddHHmmssSSS"); @@ -236,20 +241,110 @@ public class GdSalesService extends ServiceImpl { // 销售汇总日报表 writer.setSheet(0); - writer.writeCellValue(0, 1, "编号:xshzrbb" + dfmt1); - writer.writeCellValue(2, 1, "上报时间:" + dfmt2); + xshzrbb(writer, reportday); // 门店销售明细表 - // writer.setSheet(1); + writer.setSheet(1); + int storeCount = baseMapper.countStoreOnDay(orderDate); + List> list1 = baseMapper.listOfStoreOnDay(orderDate); + // writer.writeCellValue(0, 1, "编号:mdxsmxb" + dfmt1); + writer.merge(1, 1, 0, 2, "编号:mdxsmxb" + dfmt1, false); + writer.writeCellValue(3, 1, "渠道数量: " + storeCount); + writer.writeCellValue(4, 1, " 上报时间:" + dfmt2); + int size1 = list1.size(); + int countRow1 = size1 + 3; + double hj1 = 0; + int xh = 0; + for (int y = 3; y < countRow1; y++) { + Map map = list1.get(y - 3); + xh++; + writer.writeCellValue(0, y, xh); + // writer.writeCellValue(1, y, map.get("name")); + writer.merge(y, y, 1, 3, map.get("name"), false); + writer.writeCellValue(4, y, map.get("amount")); + hj1 = hj1 + ExcelTool.toDouble(map.get("amount")); + } + // writer.writeCellValue(1, countRow1, "合计"); + writer.merge(countRow1, countRow1, 0, 3, "合计", false); + writer.writeCellValue(4, countRow1, hj1); // 门店商品销售明细表 - // writer.setSheet(2); + writer.setSheet(2); + int productCount = baseMapper.countProductOnDay(orderDate); + List> list2 = baseMapper.listOfProductOnDay(orderDate); + // writer.writeCellValue(0, 1, "编号:mdspxsmxb" + dfmt1); + writer.merge(1, 1, 0, 2, "编号:mdspxsmxb" + dfmt1, false); + // writer.writeCellValue(3, 1, "商品数量: " + productCount); + writer.merge(1, 1, 3, 4, "商品数量: " + productCount, false); + // writer.writeCellValue(4, 1, " 上报时间:" + dfmt2); + writer.merge(1, 1, 5, 7, "上报时间:" + dfmt2, false); + int size2 = list2.size(); + int countRow2 = size2 + 3; + double hj2 = 0; + for (int y = 3; y < countRow2; y++) { + Map map = list2.get(y - 3); + writer.writeCellValue(0, y, map.get("name")); + writer.writeCellValue(1, y, map.get("orderType")); + writer.writeCellValue(2, y, map.get("orderNo")); + writer.writeCellValue(3, y, map.get("prodCode")); + writer.writeCellValue(4, y, map.get("prodName")); + writer.writeCellValue(5, y, Math.round(ExcelTool.toDouble( map.get("saleNum")))); + writer.writeCellValue(6, y, map.get("salePrice")); + writer.writeCellValue(7, y, map.get("amount")); + hj2 = hj2 + ExcelTool.toDouble(map.get("amount")); + } + writer.merge(countRow2, countRow2, 0, 6, "合计", false); + writer.writeCellValue(7, countRow2, hj2); // 烟草门店销售明细表 - // writer.setSheet(3); + writer.setSheet(3); + int storeCountyc = gdSalesYcService.countStoreOnDay(orderDate); + List> list1yc = gdSalesYcService.listOfStoreOnDay(orderDate); + // writer.writeCellValue(0, 1, "编号:ycmdxsmxb" + dfmt1); + writer.merge(1, 1, 0, 2, "编号:ycmdxsmxb" + dfmt1, false); + writer.writeCellValue(3, 1, "渠道数量: " + storeCountyc); + writer.writeCellValue(4, 1, " 上报时间:" + dfmt2); + int size1yc = list1yc.size(); + int countRow1yc = size1yc + 3; + double hj1yc = 0; + xh = 0; + for (int y = 3; y < countRow1yc; y++) { + Map map = list1yc.get(y - 3); + xh++; + writer.writeCellValue(0, y, xh); + // writer.writeCellValue(1, y, map.get("name")); + writer.merge(y, y, 1, 3, map.get("name"), false); + writer.writeCellValue(4, y, map.get("amount")); + hj1yc = hj1yc + ExcelTool.toDouble(map.get("amount")); + } + // writer.writeCellValue(1, countRow1yc, "合计"); + writer.merge(countRow1yc, countRow1yc, 0, 3, "合计", false); + writer.writeCellValue(4, countRow1yc, hj1yc); // 烟草门店商品销售明细表 - // writer.setSheet(4); + writer.setSheet(4); + int productCountyc = gdSalesYcService.countProductOnDay(orderDate); + List> list2yc = gdSalesYcService.listOfProductOnDay(orderDate); + writer.merge(1, 1, 0, 2, "编号:ycmdspxsmxb" + dfmt1, false); + writer.merge(1, 1, 3, 4, "商品数量: " + productCountyc, false); + writer.merge(1, 1, 5, 7, "上报时间:" + dfmt2, false); + int size2yc = list2yc.size(); + int countRow2yc = size2yc + 3; + double hj2yc = 0; + for (int y = 3; y < countRow2yc; y++) { + Map map = list2yc.get(y - 3); + writer.writeCellValue(0, y, map.get("name")); + writer.writeCellValue(1, y, map.get("orderType")); + writer.writeCellValue(2, y, map.get("orderNo")); + writer.writeCellValue(3, y, map.get("prodCode")); + writer.writeCellValue(4, y, map.get("prodName")); + writer.writeCellValue(5, y, Math.round(ExcelTool.toDouble( map.get("saleNum")))); + writer.writeCellValue(6, y, map.get("salePrice")); + writer.writeCellValue(7, y, map.get("amount")); + hj2yc = hj2yc + ExcelTool.toDouble(map.get("amount")); + } + writer.merge(countRow2yc, countRow2yc, 0, 6, "合计", false); + writer.writeCellValue(7, countRow2yc, hj2yc); writer.flush(); writer.close(); @@ -260,4 +355,82 @@ public class GdSalesService extends ServiceImpl { return rb.success().setData(gdLog); } + + private void xshzrbb(ExcelWriter writer, GdSalesReportday reportday) { + writer.writeCellValue(0, 1, "编号:" + reportday.getSerialNumber()); + writer.writeCellValue(2, 1, "上报时间:" + reportday.getReportTime()); + writer.writeCellValue(1, 3, reportday.getKmdatea()); // 科目/日,大前天 + writer.writeCellValue(2, 3, reportday.getKmdateb()); // 科目/日,前天 + writer.writeCellValue(3, 3, reportday.getKmdatec()); // 科目/日,昨天 + writer.writeCellValue(1, 4, reportday.getXjlla()); // 现金流量-经营活动产生的现金流量(元),大前天 + writer.writeCellValue(2, 4, reportday.getXjllb()); // 现金流量-经营活动产生的现金流量(元),前天 + writer.writeCellValue(3, 4, reportday.getXjllc()); // 现金流量-经营活动产生的现金流量(元),昨天 + writer.writeCellValue(1, 5, reportday.getXsxja()); // 销售商品收到的现金(元),大前天 + writer.writeCellValue(2, 5, reportday.getXsxjb()); // 销售商品收到的现金(元),前天 + writer.writeCellValue(3, 5, reportday.getXsxjc()); // 销售商品收到的现金(元),昨天 + writer.writeCellValue(1, 6, reportday.getQtxja()); // 收到其他与经营活动有关的现金(元),大前天 + writer.writeCellValue(2, 6, reportday.getQtxjb()); // 收到其他与经营活动有关的现金(元),前天 + writer.writeCellValue(3, 6, reportday.getQtxjc()); // 收到其他与经营活动有关的现金(元),昨天 + writer.writeCellValue(1, 7, reportday.getCwfxhja()); // 财务分析本项合计,大前天 + writer.writeCellValue(2, 7, reportday.getCwfxhjb()); // 财务分析本项合计,前天 + writer.writeCellValue(3, 7, reportday.getCwfxhjc()); // 财务分析本项合计,昨天 + writer.writeCellValue(1, 8, reportday.getZcfza()); // 资产负债-流动资产(元),大前天 + writer.writeCellValue(2, 8, reportday.getZcfzb()); // 资产负债-流动资产(元),前天 + writer.writeCellValue(3, 8, reportday.getZcfzc()); // 资产负债-流动资产(元),昨天 + writer.writeCellValue(1, 9, reportday.getYszka()); // 应收账款(元),大前天 + writer.writeCellValue(2, 9, reportday.getYszkb()); // 应收账款(元),前天 + writer.writeCellValue(3, 9, reportday.getYszkc()); // 应收账款(元),昨天 + writer.writeCellValue(1, 10, reportday.getLdfza()); // 流动负债(元),大前天 + writer.writeCellValue(2, 10, reportday.getLdfzb()); // 流动负债(元),前天 + writer.writeCellValue(3, 10, reportday.getLdfzc()); // 流动负债(元),昨天 + writer.writeCellValue(1, 11, reportday.getYskxa()); // 预收款项(元),大前天 + writer.writeCellValue(2, 11, reportday.getYskxb()); // 预收款项(元),前天 + writer.writeCellValue(3, 11, reportday.getYskxc()); // 预收款项(元),昨天 + writer.writeCellValue(1, 12, "期初总货值:" + reportday.getQczhz()); // 期初总货值 + writer.writeCellValue(3, 12, "烟草期初货值:" + reportday.getYcqchz()); // 烟草期初货值 + writer.writeCellValue(1, 13, reportday.getXmdatea()); // 项目/日,前天 + writer.writeCellValue(2, 13, reportday.getXmdateb()); // 项目/日,昨天 + writer.writeCellValue(3, 13, reportday.getXmdatec()); // 项目/日,今天 + writer.writeCellValue(1, 14, reportday.getZthza()); // 在途货值(元),前天 + writer.writeCellValue(2, 14, reportday.getZthzb()); // 在途货值(元),昨天 + writer.writeCellValue(3, 14, reportday.getZthzc()); // 在途货值(元),今天 + writer.writeCellValue(1, 15, reportday.getKchza()); // 库存货值(元),前天 + writer.writeCellValue(2, 15, reportday.getKchzb()); // 库存货值(元),昨天 + writer.writeCellValue(3, 15, reportday.getKchzc()); // 库存货值(元),今天 + writer.writeCellValue(1, 16, reportday.getZhyea()); // 帐户余额(元)账户余额为前一天余额,前天 + writer.writeCellValue(2, 16, reportday.getZhyeb()); // 帐户余额(元)账户余额为前一天余额,昨天 + writer.writeCellValue(3, 16, reportday.getZhyec()); // 帐户余额(元)账户余额为前一天余额,今天 + writer.writeCellValue(1, 17, reportday.getYjyszka()); // 预警应收帐款(元),前天 + writer.writeCellValue(2, 17, reportday.getYjyszkb()); // 预警应收帐款(元),昨天 + writer.writeCellValue(3, 17, reportday.getYjyszkc()); // 预警应收帐款(元),今天 + writer.writeCellValue(1, 18, reportday.getYjhja()); // 主要预警指标本项合计,前天 + writer.writeCellValue(2, 18, reportday.getYjhjb()); // 主要预警指标本项合计,昨天 + writer.writeCellValue(3, 18, reportday.getYjhjc()); // 主要预警指标本项合计,今天 + writer.writeCellValue(1, 21, reportday.getLwlsdze()); // 连网连锁店,总额(元) + writer.writeCellValue(2, 21, reportday.getLwlsdyszk()); // 连网连锁店,应收帐款(元) + writer.writeCellValue(3, 21, reportday.getLwlsdkcje()); // 连网连锁店,扣除应收金额(元) + writer.writeCellValue(1, 22, reportday.getLsnjmze()); // 连锁内加盟,总额(元) + writer.writeCellValue(2, 22, reportday.getLsnjmyszk()); // 连锁内加盟,应收帐款(元) + writer.writeCellValue(3, 22, reportday.getLsnjmkcje()); // 连锁内加盟,扣除应收金额(元) + writer.writeCellValue(1, 23, reportday.getPszxze()); // 配送中心,总额(元) + writer.writeCellValue(2, 23, reportday.getPszxyszk()); // 配送中心,应收帐款(元) + writer.writeCellValue(3, 23, reportday.getPszxkcje()); // 配送中心,扣除应收金额(元) + writer.writeCellValue(1, 24, reportday.getLswjmze()); // 连锁外加盟(销配结算),总额(元) + writer.writeCellValue(2, 24, reportday.getLswjmyszk()); // 连锁外加盟(销配结算),应收帐款(元) + writer.writeCellValue(3, 24, reportday.getLswjmkcje()); // 连锁外加盟(销配结算),扣除应收金额(元) + writer.writeCellValue(1, 25, reportday.getYcmdze()); // 36524集团报烟门店仓,总额(元) + writer.writeCellValue(2, 25, reportday.getYcmdyszk()); // 36524集团报烟门店仓,应收帐款(元) + writer.writeCellValue(3, 25, reportday.getYcmdkcje()); // 36524集团报烟门店仓,扣除应收金额(元) + writer.writeCellValue(1, 26, reportday.getYcjmdze()); // 烟草连锁外加盟(销配结算),总额(元) + writer.writeCellValue(2, 26, reportday.getYcjmdyszk()); // 烟草连锁外加盟(销配结算),应收帐款(元) + writer.writeCellValue(3, 26, reportday.getYcjmdkcje()); // 烟草连锁外加盟(销配结算),扣除应收金额(元) + } + + public double amountOfLwlsdDay(String orderDate) { + return baseMapper.amountOfLsdOnDay(orderDate); + } + + public double amountOfLsnjmDay(String orderDate) { + return baseMapper.amountOfLsnjmOnDay(orderDate); + } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java index bc5d172c..8b6ca606 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java @@ -29,6 +29,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; /** * Project: yxt_supervise
@@ -47,4 +51,25 @@ import org.apache.ibatis.annotations.Param; public interface GdSalesYcMapper extends BaseMapper { @Delete("delete from gd_sales_yc where dataDate=#{dataDate} ") void clearByDataDate(@Param("dataDate") String dataDate); + + @Select("select count(1) from (select storeCode from gd_sales_yc where dataDate=#{dataDate} group by storeCode) t") + int countStoreOnDay(@Param("dataDate") String orderDate); + + @Select("select t2.storeCode,si.name,t2.amount from( " + + " select storeCode,sum(t1.price) as amount from( " + + " select storeCode,saleNum*salePrice as price from gd_sales_yc where dataDate=#{dataDate} " + + " ) t1 group by t1.storeCode " + + ") t2 left join store_index si on t2.storecode=si.code ") + List> listOfStoreOnDay(@Param("dataDate") String orderDate); + + @Select("select count(1) from (select prodCode from gd_sales_yc where dataDate=#{dataDate} group by prodCode) t") + int countProductOnDay(@Param("dataDate") String orderDate); + + @Select("select si.name,t1.* from ( " + + " select storeCode,orderType,orderNo,prodCode,prodName,saleNum,salePrice,saleNum*salePrice as amount from gd_sales_yc where dataDate=#{dataDate} " + + ") t1 left join store_index si on t1.storecode=si.code ") + List> listOfProductOnDay(@Param("dataDate") String orderDate); + + @Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where dataDate=#{dataDate}") + double amountOfDay(String orderDate); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java index 79c11e29..d40015e2 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java @@ -28,6 +28,9 @@ package com.yxt.supervise.portal.biz.gdsales; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + /** * Project: yxt_supervise
* File: GdSalesYcService.java
@@ -47,4 +50,24 @@ public class GdSalesYcService extends ServiceImpl { public void clearByDataDate(String dataDate) { baseMapper.clearByDataDate(dataDate); } + + public int countStoreOnDay(String orderDate) { + return baseMapper.countStoreOnDay(orderDate); + } + + public List> listOfStoreOnDay(String orderDate) { + return baseMapper.listOfStoreOnDay(orderDate); + } + + public int countProductOnDay(String orderDate) { + return baseMapper.countProductOnDay(orderDate); + } + + public List> listOfProductOnDay(String orderDate) { + return baseMapper.listOfProductOnDay(orderDate); + } + + public double amountOfDay(String orderDate) { + return baseMapper.amountOfDay(orderDate); + } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleMapper.java index 37112eb0..a34f7c98 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleMapper.java @@ -36,4 +36,7 @@ public interface GdWholesaleMapper extends BaseMapper { // " FROM gd_wholesale where dataDate=#{dataDate} ") @Select("SELECT * FROM gd_wholesale where dataDate=#{dataDate} ") List excelListByOrderDate(@Param("dataDate") String orderDate); + + @Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_wholesale where dataDate=#{dataDate} ") + double amountOfDay(String orderDate); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleService.java index 3d8c5898..d18ca350 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdwholesale/GdWholesaleService.java @@ -180,4 +180,8 @@ public class GdWholesaleService extends ServiceImpl cacheCodeListOfYc = null; //烟草门店的门店编号列表 + private static List cacheCodeListOfYcNoJmd = null; //烟草门店的门店编号列表(不含加盟店) public static void clearCacheCodeListOfYc() { cacheCodeListOfYc = null; + cacheCodeListOfYcNoJmd = null; } public boolean containsCodeOfYc(String code) { @@ -289,6 +291,15 @@ public class StoreInfoService extends MybatisBaseService res.add(entity.getCode().trim())); return res; } + + /** + * 烟草门店列表(不含加盟店) + * + * @return + */ + public List listOfYcNoJmd() { + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("isycjyfw", "1"); + qw.ne("type", "连锁外加盟(销配结算)"); + qw.ne("type", "连锁外加盟(销配结算)"); + // qw.and(wrapper -> wrapper.ne("type", "连锁外加盟(销配结算)").or().like("remark", query.getName())); + List list = super.list(qw); + return list; + } + + private List listCodeOfYcNoJmd() { + List res = new ArrayList<>(); + List list = listOfYcNoJmd(); + list.forEach(entity -> res.add(entity.getCode().trim())); + return res; + } } \ No newline at end of file diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/extexcel/ExcelTool.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/extexcel/ExcelTool.java index ef7731e9..f3fd781c 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/extexcel/ExcelTool.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/extexcel/ExcelTool.java @@ -66,7 +66,7 @@ public class ExcelTool { public static int toInt(Object obj) { if (obj == null) return 0; - String s = ""+ obj; + String s = "" + obj; if (StringUtils.isBlank(s)) return 0; int rs = 0; @@ -81,6 +81,8 @@ public class ExcelTool { public static double toDouble(Object obj) { if (obj == null) return 0; + if (obj instanceof Double) + return (Double) obj; String s = obj.toString(); if (StringUtils.isBlank(s)) return 0; diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/在途商品汇总统计表.xlsx b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/在途商品汇总统计表.xlsx index c0d0a386..2c8bdd6f 100644 Binary files a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/在途商品汇总统计表.xlsx and b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/在途商品汇总统计表.xlsx differ diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表-20230109.xlsx b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表-20230109.xlsx new file mode 100644 index 00000000..2ee0c6fc Binary files /dev/null and b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表-20230109.xlsx differ diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx index 2ee0c6fc..359134c8 100644 Binary files a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx and b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx differ diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/销售汇总日报表.xlsx b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/销售汇总日报表.xlsx index d21a4e1f..98dab2c3 100644 Binary files a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/销售汇总日报表.xlsx and b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/销售汇总日报表.xlsx differ