Browse Source

报表数据调整1

master
lzh 2 years ago
parent
commit
b20a7460eb
  1. 10
      supervise-report-ui/src/api/supervise/thresholdanalysis.js
  2. 162
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesReportdayService.java
  3. 17
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/ReportCenterRest.java

10
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'
}
})
}
}

162
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<GdSalesReportdayMapper,
String thrOrderDate = dayAgo(orderDate, -3); // 前三天
GdSalesReportday preRp = fetchByOrderDate(preOrderDate);
if (preRp == null)
preRp = new GdSalesReportday();
if (preRp == null) preRp = new GdSalesReportday();
GdSalesReportday rp = new GdSalesReportday();
rp.setOrderDate(orderDate); // 单据日期
@ -166,14 +166,12 @@ public class GdSalesReportdayService extends ServiceImpl<GdSalesReportdayMapper,
QueryWrapper<GdSalesReportday> qw = new QueryWrapper<>();
qw.eq("orderDate", orderDate);
List<GdSalesReportday> 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<GdSalesReportdayMapper,
double all = cgsp + yc; //全部
List<Map<String, String>> financialDataList = new ArrayList<>(); // 现金流量
financialDataList.add(MapUtil.builder(new HashMap<String, String>())
.put("name", "销售商品收到的现金(元)")
.put("totalPrice", "" + all).build());
financialDataList.add(MapUtil.builder(new HashMap<String, String>())
.put("name", "收到其他与经营活动有关的现金(元)")
.put("totalPrice", "0").build());
financialDataList.add(MapUtil.builder(new HashMap<String, String>()).put("name", "销售商品收到的现金(元)").put("totalPrice", "" + all).build());
financialDataList.add(MapUtil.builder(new HashMap<String, String>()).put("name", "收到其他与经营活动有关的现金(元)").put("totalPrice", "0").build());
map.put("financialData", financialDataList);
List<Map<String, String>> listSalesChannelData = new ArrayList<>();
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>())
.put("salesChannelCategory", "连网连锁店")
.put("totalAmount", "" + xsLwlsd)
.put("accountsReceivable", "0")
.put("deductionAccountsReceivable", "" + xsLwlsd).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>())
.put("salesChannelCategory", "连锁内加盟")
.put("totalAmount", "" + xsLsnjm)
.put("accountsReceivable", "0")
.put("deductionAccountsReceivable", "" + xsLsnjm).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>())
.put("salesChannelCategory", "配送中心")
.put("totalAmount", "" + xsPszx)
.put("accountsReceivable", "0")
.put("deductionAccountsReceivable", "" + xsPszx).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>())
.put("salesChannelCategory", "连锁外加盟")
.put("totalAmount", "" + xsLswjm)
.put("accountsReceivable", "0")
.put("deductionAccountsReceivable", "" + xsLswjm).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>())
.put("salesChannelCategory", "36524集团报烟门店仓")
.put("totalAmount", "" + xsYc)
.put("accountsReceivable", "0")
.put("deductionAccountsReceivable", "" + xsYc).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>())
.put("salesChannelCategory", "烟草连锁外加盟")
.put("totalAmount", "" + xsYcJmd)
.put("accountsReceivable", "0")
.put("deductionAccountsReceivable", "" + xsYcJmd).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>()).put("salesChannelCategory", "连网连锁店").put("totalAmount", "" + xsLwlsd).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsLwlsd).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>()).put("salesChannelCategory", "连锁内加盟").put("totalAmount", "" + xsLsnjm).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsLsnjm).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>()).put("salesChannelCategory", "配送中心").put("totalAmount", "" + xsPszx).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsPszx).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>()).put("salesChannelCategory", "连锁外加盟").put("totalAmount", "" + xsLswjm).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsLswjm).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>()).put("salesChannelCategory", "36524集团报烟门店仓").put("totalAmount", "" + xsYc).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsYc).build());
listSalesChannelData.add(MapUtil.builder(new HashMap<String, String>()).put("salesChannelCategory", "烟草连锁外加盟").put("totalAmount", "" + xsYcJmd).put("accountsReceivable", "0").put("deductionAccountsReceivable", "" + xsYcJmd).build());
map.put("listSalesChannelData", listSalesChannelData);
List<List<String>> financialAnalysisChartData = new ArrayList<>();
@ -267,4 +237,112 @@ public class GdSalesReportdayService extends ServiceImpl<GdSalesReportdayMapper,
return rb.success().setData(map);
}
public ResultBean<Map<String, Object>> getGoodsOnWay(String date) {
ResultBean rb = ResultBean.fireFail();
Map<String, Object> 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<Map<String, Object>> getThresholdAnalysis(Map<String, Object> date) {
ResultBean rb = ResultBean.fireFail();
Map<String, Object> 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 " +
" ] " +
" } " +
" ] " +
"}";
}
}

17
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<Map<String, Object>> getSalesReport(@Param("date") String date) {
// System.out.println("@@@@@: " + date);
return gdSalesReportdayService.getGoodsOnWay( date);
}
@PostMapping("/getThresholdAnalysis")
public ResultBean<Map<String, Object>> getThresholdAnalysis(@RequestBody Map<String,Object> date) {
// System.out.println("@@@@@: " + date);
return gdSalesReportdayService.getThresholdAnalysis( date);
}
}

Loading…
Cancel
Save