|
|
@@ -355,11 +355,11 @@ public class StatisticsDataController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get/stock")
|
|
|
- public Result<List<StatisticsStockView>> getStock(HttpServletRequest request, @RequestParam(defaultValue = "0") Long startTime,@RequestParam(defaultValue = "0") Long endTime){
|
|
|
+ public Result<List<StatisticsStockView>> getStock(HttpServletRequest request, @RequestParam(defaultValue = "0") Long startTime, @RequestParam(defaultValue = "0") Long endTime) {
|
|
|
List<GoodsDonStock> goodsDonStocks = beanSearcher.searchAll(GoodsDonStock.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
List<StatisticsStockView> res = new ArrayList<>(goodsDonStocks.size() + 1);
|
|
|
|
|
|
- goodsDonStocks.forEach((stock)->{
|
|
|
+ goodsDonStocks.forEach((stock) -> {
|
|
|
List<GoodsDonStockRecord> goodsDonStockRecords = stockRecordMapper.selectList(Wrappers.lambdaQuery(GoodsDonStockRecord.class)
|
|
|
.eq(GoodsDonStockRecord::getStockId, stock.getId())
|
|
|
.eq(GoodsDonStockRecord::getIsUndo, false)
|
|
|
@@ -378,11 +378,11 @@ public class StatisticsDataController {
|
|
|
}
|
|
|
// statisticsStockView.setUnavailable(stock.getUnavailable());
|
|
|
statisticsStockView.setTitle(stock.getTitle());
|
|
|
- typeRecordsMap.forEach((type,records)->{
|
|
|
+ typeRecordsMap.forEach((type, records) -> {
|
|
|
int sum = records.stream().mapToInt(GoodsDonStockRecord::getNum).sum();
|
|
|
BigDecimal price = records.stream().map((record) -> record.getPrice().multiply(BigDecimal.valueOf(record.getNum())))
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- statisticsStockView.setTotalWithPrice(type,sum,price);
|
|
|
+ statisticsStockView.setTotalWithPrice(type, sum, price);
|
|
|
});
|
|
|
res.add(statisticsStockView);
|
|
|
});
|
|
|
@@ -391,11 +391,11 @@ public class StatisticsDataController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/export/stock")
|
|
|
- public void exportStock(HttpServletRequest request, HttpServletResponse response, @RequestParam(defaultValue = "0") Long startTime,@RequestParam(defaultValue = "0") Long endTime){
|
|
|
+ public void exportStock(HttpServletRequest request, HttpServletResponse response, @RequestParam(defaultValue = "0") Long startTime, @RequestParam(defaultValue = "0") Long endTime) {
|
|
|
List<GoodsDonStock> goodsDonStocks = beanSearcher.searchAll(GoodsDonStock.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
List<StatisticsStockView> res = new ArrayList<>(goodsDonStocks.size() + 1);
|
|
|
|
|
|
- goodsDonStocks.forEach((stock)->{
|
|
|
+ goodsDonStocks.forEach((stock) -> {
|
|
|
List<GoodsDonStockRecord> goodsDonStockRecords = stockRecordMapper.selectList(Wrappers.lambdaQuery(GoodsDonStockRecord.class)
|
|
|
.eq(GoodsDonStockRecord::getStockId, stock.getId())
|
|
|
.eq(GoodsDonStockRecord::getIsUndo, false)
|
|
|
@@ -408,17 +408,17 @@ public class StatisticsDataController {
|
|
|
if (put != null) {
|
|
|
int sum = put.stream().mapToInt(GoodsDonStockRecord::getAvailable).sum();
|
|
|
BigDecimal price = put.stream().map((record) -> record.getPrice().multiply(BigDecimal.valueOf(record.getAvailable())))
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add).divide(BigDecimal.valueOf(100),2, RoundingMode.HALF_EVEN);
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_EVEN);
|
|
|
statisticsStockView.setThenTotal(sum);
|
|
|
statisticsStockView.setThenPrice(price);
|
|
|
}
|
|
|
// statisticsStockView.setUnavailable(stock.getUnavailable());
|
|
|
statisticsStockView.setTitle(stock.getTitle());
|
|
|
- typeRecordsMap.forEach((type,records)->{
|
|
|
+ typeRecordsMap.forEach((type, records) -> {
|
|
|
int sum = records.stream().mapToInt(GoodsDonStockRecord::getNum).sum();
|
|
|
BigDecimal price = records.stream().map((record) -> record.getPrice().multiply(BigDecimal.valueOf(record.getNum())))
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add).divide(BigDecimal.valueOf(100),2, RoundingMode.HALF_EVEN);
|
|
|
- statisticsStockView.setTotalWithPrice(type,sum,price);
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_EVEN);
|
|
|
+ statisticsStockView.setTotalWithPrice(type, sum, price);
|
|
|
});
|
|
|
res.add(statisticsStockView);
|
|
|
});
|
|
|
@@ -496,6 +496,7 @@ public class StatisticsDataController {
|
|
|
|
|
|
/**
|
|
|
* 渠道后台数据统计折线图
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/get/channelStatistics/brokenLine")
|
|
|
@@ -602,4 +603,13 @@ public class StatisticsDataController {
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 虚拟商品订单客服数据统计
|
|
|
+ */
|
|
|
+ @GetMapping("/get/order/service/data")
|
|
|
+ public Result<SearchResult<OrderCustomerServiceDataView>> getOrderServiceData() {
|
|
|
+ SearchResult<OrderCustomerServiceDataView> search = beanSearcher.search(OrderCustomerServiceDataView.class, MapUtils.builder().build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
+ }
|
|
|
}
|