diff --git a/supervise-report-ui/src/api/supervise/thresholdanalysis.js b/supervise-report-ui/src/api/supervise/thresholdanalysis.js index f4d3e174..50e0903b 100644 --- a/supervise-report-ui/src/api/supervise/thresholdanalysis.js +++ b/supervise-report-ui/src/api/supervise/thresholdanalysis.js @@ -5,12 +5,14 @@ export default { // 查询分页列表 listPage: function(params) { return request({ - url: '/risk/getThresholdAnalysis', + url: '/reportCenter/getThresholdAnalysis', method: 'post', data: params, - headers: { 'Content-Type': 'application/json' } + headers: { + 'Content-Type': 'application/json' + } }) } - - + + } 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 index 3bb1ae0c..b3499878 100644 --- 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 @@ -7,6 +7,7 @@ import cn.hutool.core.map.MapUtil; 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.common.base.utils.JsonUtilJackson; import com.yxt.common.core.result.ResultBean; import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountService; import com.yxt.supervise.portal.biz.gdinstorage.GdInstorageJmdService; @@ -56,8 +57,7 @@ public class GdSalesReportdayService extends ServiceImpl qw = new QueryWrapper<>(); qw.eq("orderDate", orderDate); List list = list(qw); - if (list == null || list.isEmpty()) - return null; + if (list == null || list.isEmpty()) return null; return list.get(0); } private String dayAgo(String orderDate, int offset) { - if (offset == 0) - return orderDate; + if (offset == 0) return orderDate; DateTime nowDate = DateUtil.parse(orderDate, "yyyy-MM-dd"); DateTime preDate = DateUtil.offsetDay(nowDate, offset); return DateUtil.format(preDate, "yyyy-MM-dd"); @@ -213,45 +211,17 @@ public class GdSalesReportdayService extends ServiceImpl> financialDataList = new ArrayList<>(); // 现金流量 - financialDataList.add(MapUtil.builder(new HashMap()) - .put("name", "销售商品收到的现金(元)") - .put("totalPrice", "" + all).build()); - financialDataList.add(MapUtil.builder(new HashMap()) - .put("name", "收到其他与经营活动有关的现金(元)") - .put("totalPrice", "0").build()); + financialDataList.add(MapUtil.builder(new HashMap()).put("name", "销售商品收到的现金(元)").put("totalPrice", "" + all).build()); + financialDataList.add(MapUtil.builder(new HashMap()).put("name", "收到其他与经营活动有关的现金(元)").put("totalPrice", "0").build()); map.put("financialData", financialDataList); List> listSalesChannelData = new ArrayList<>(); - listSalesChannelData.add(MapUtil.builder(new HashMap()) - .put("salesChannelCategory", "连网连锁店") - .put("totalAmount", "" + xsLwlsd) - .put("accountsReceivable", "0") - .put("deductionAccountsReceivable", "" + xsLwlsd).build()); - listSalesChannelData.add(MapUtil.builder(new HashMap()) - .put("salesChannelCategory", "连锁内加盟") - .put("totalAmount", "" + xsLsnjm) - .put("accountsReceivable", "0") - .put("deductionAccountsReceivable", "" + xsLsnjm).build()); - listSalesChannelData.add(MapUtil.builder(new HashMap()) - .put("salesChannelCategory", "配送中心") - .put("totalAmount", "" + xsPszx) - .put("accountsReceivable", "0") - .put("deductionAccountsReceivable", "" + xsPszx).build()); - listSalesChannelData.add(MapUtil.builder(new HashMap()) - .put("salesChannelCategory", "连锁外加盟") - .put("totalAmount", "" + xsLswjm) - .put("accountsReceivable", "0") - .put("deductionAccountsReceivable", "" + xsLswjm).build()); - listSalesChannelData.add(MapUtil.builder(new HashMap()) - .put("salesChannelCategory", "36524集团报烟门店仓") - .put("totalAmount", "" + xsYc) - .put("accountsReceivable", "0") - .put("deductionAccountsReceivable", "" + xsYc).build()); - listSalesChannelData.add(MapUtil.builder(new HashMap()) - .put("salesChannelCategory", "烟草连锁外加盟") - .put("totalAmount", "" + xsYcJmd) - .put("accountsReceivable", "0") - .put("deductionAccountsReceivable", "" + xsYcJmd).build()); + listSalesChannelData.add(MapUtil.builder(new HashMap()).put("salesChannelCategory", "连网连锁店").put("totalAmount", "" + xsLwlsd).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsLwlsd).build()); + listSalesChannelData.add(MapUtil.builder(new HashMap()).put("salesChannelCategory", "连锁内加盟").put("totalAmount", "" + xsLsnjm).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsLsnjm).build()); + listSalesChannelData.add(MapUtil.builder(new HashMap()).put("salesChannelCategory", "配送中心").put("totalAmount", "" + xsPszx).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsPszx).build()); + listSalesChannelData.add(MapUtil.builder(new HashMap()).put("salesChannelCategory", "连锁外加盟").put("totalAmount", "" + xsLswjm).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsLswjm).build()); + listSalesChannelData.add(MapUtil.builder(new HashMap()).put("salesChannelCategory", "36524集团报烟门店仓").put("totalAmount", "" + xsYc).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsYc).build()); + listSalesChannelData.add(MapUtil.builder(new HashMap()).put("salesChannelCategory", "烟草连锁外加盟").put("totalAmount", "" + xsYcJmd).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsYcJmd).build()); map.put("listSalesChannelData", listSalesChannelData); List> financialAnalysisChartData = new ArrayList<>(); @@ -267,4 +237,112 @@ public class GdSalesReportdayService extends ServiceImpl> getGoodsOnWay(String date) { + ResultBean rb = ResultBean.fireFail(); + Map map = JsonUtilJackson.str2map(testData_getGoodsOnWay()); + return rb.success().setData(map); + } + + private String testData_getGoodsOnWay() { + return "{ " + " \"listGoodsOnWays\": { " + " \"orderAmount\": \"2213122元\", " + " \"arrivedGoodsValue\": \"2863112元\", " + " \"onWayGoodsValue\": \"1314530元\", " + " \"exceedGoodsValue\": \"2789323元\" " + " }, " + " \"analysisChartData\": [{ " + " \"value\": \"2313123\", " + " \"name\": \"订单总额\" " + " }, " + " { " + " \"value\": \"4359354\", " + " \"name\": \"实际到货价值\" " + " }, " + " { " + " \"value\": \"2313123\", " + " \"name\": \"在途货价值\" " + " }, " + " { " + " \"value\": \"56516849\", " + " \"name\": \"超出价值\" " + " } " + " ], " + " \"listArrivedEarlyWarning\": [{ " + " \"isDelay\": \"是\", " + " \"supplierName\": \"中粮可口可乐饮料(河北)有限公司\", " + " \"num\": 1, " + " \"supplierSid\": \"28\", " + " \"allArrivedDate\": \"1993-10-16\" " + " }, " + " { " + " \"isDelay\": \"否\", " + " \"supplierName\": \"中顺洁柔纸业股份有限公司\", " + " \"num\": 2, " + " \"supplierSid\": \"18\", " + " \"allArrivedDate\": \"1993-08-12\" " + " }, " + " { " + " \"isDelay\": \"是\", " + " \"supplierName\": \"今麦郎食品股份有限公司石家庄分公司\", " + " \"num\": 3, " + " \"supplierSid\": \"08\", " + " \"allArrivedDate\": \"2003-12-16\" " + " }, " + " { " + " \"isDelay\": \"是\", " + " \"supplierName\": \"农夫山泉股份有限公司\", " + " \"num\": 4, " + " \"supplierSid\": \"48\", " + " \"allArrivedDate\": \"2013-10-16\" " + " }, " + " { " + " \"isDelay\": \"否\", " + " \"supplierName\": \"北京百事可乐饮料有限公司\", " + " \"num\": 5, " + " \"supplierSid\": \"12\", " + " \"allArrivedDate\": \"2008-03-11\" " + " }, " + " { " + " \"isDelay\": \"是\", " + " \"supplierName\": \"今麦郎食品股份有限公司石家庄分公司\", " + " \"num\": 6, " + " \"supplierSid\": \"03\", " + " \"allArrivedDate\": \"1996-11-20\" " + " }, " + " { " + " \"isDelay\": \"是\", " + " \"supplierName\": \"农夫山泉股份有限公司\", " + " \"num\": 7, " + " \"supplierSid\": \"68\", " + " \"allArrivedDate\": \"2022-10-23\" " + " }, " + " { " + " \"isDelay\": \"否\", " + " \"supplierName\": \"北京百事可乐饮料有限公司\", " + " \"num\": 8, " + " \"supplierSid\": \"88\", " + " \"allArrivedDate\": \"2014-06-02\" " + " } " + " ] " + "} "; + } + + public ResultBean> getThresholdAnalysis(Map date) { + ResultBean rb = ResultBean.fireFail(); + Map map = JsonUtilJackson.str2map(testData_getThresholdAnalysis()); + return rb.success().setData(map); + } + + private String testData_getThresholdAnalysis() { + return "{ " + + " \"date\": [ " + + " \"2023-01-01\", " + + " \"2023-01-02\", " + + " \"2023-01-03\", " + + " \"2023-01-04\", " + + " \"2023-01-05\", " + + " \"2023-01-06\", " + + " \"2023-01-07\" " + + " ], " + + " \"series\": [{ " + + " \"仓库货值\": [ " + + " 1234, " + + " 1234, " + + " 8675, " + + " 1324, " + + " 5342, " + + " 2343, " + + " 4356 " + + " ] " + + " }, " + + " { " + + " \"在途货值\": [ " + + " 1563, " + + " 1645, " + + " 5463, " + + " 2423, " + + " 5654, " + + " 7564, " + + " 2435 " + + " ] " + + " }, " + + " { " + + " \"门店货值\": [ " + + " 1332, " + + " 2823, " + + " 5116, " + + " 5648, " + + " 6548, " + + " 5484, " + + " 5498 " + + " ] " + + " }, " + + " { " + + " \"账户余额\": [ " + + " 5698, " + + " 6866, " + + " 6565, " + + " 5616, " + + " 5489, " + + " 4451, " + + " 8644 " + + " ] " + + " }, " + + " { " + + " \"应收账款\": [ " + + " 5988, " + + " 9988, " + + " 4648, " + + " 9984, " + + " 7961, " + + " 5684, " + + " 9884 " + + " ] " + + " }, " + + " { " + + " \"借款金额\": [ " + + " 5985, " + + " 7897, " + + " 8898, " + + " 8654, " + + " 4968, " + + " 9879, " + + " 9797 " + + " ] " + + " }, " + + " { " + + " \"阀值\": [ " + + " 30.3, " + + " 25.5, " + + " 23.6, " + + " 53.6, " + + " 56.1, " + + " 63.9, " + + " 34.6 " + + " ] " + + " } " + + " ] " + + "}"; + } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/ReportCenterRest.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/ReportCenterRest.java index c7e2c904..037b26c0 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/ReportCenterRest.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/ReportCenterRest.java @@ -28,10 +28,7 @@ package com.yxt.supervise.portal.biz.gdsales; import com.yxt.common.core.result.ResultBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.repository.query.Param; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.Map; @@ -62,4 +59,16 @@ public class ReportCenterRest { // System.out.println("@@@@@: " + date); return gdSalesReportdayService.getSalesReport(customerSid, date, type); } + + @GetMapping("/getGoodsOnWay") + public ResultBean> getSalesReport(@Param("date") String date) { + // System.out.println("@@@@@: " + date); + return gdSalesReportdayService.getGoodsOnWay( date); + } + + @PostMapping("/getThresholdAnalysis") + public ResultBean> getThresholdAnalysis(@RequestBody Map date) { + // System.out.println("@@@@@: " + date); + return gdSalesReportdayService.getThresholdAnalysis( date); + } }