|
|
@@ -604,6 +604,9 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ items.setPrimaryGoodsTotalMoney(items.getPrimaryGoodsTotalNum().multiply(items.getPrice()));
|
|
|
+ items.setSurplusNum(items.getGoodsNum().subtract(items.getOutGoodsTotalShipNum()));
|
|
|
+ items.setSurplusAmount(items.getSubTotalMoney().subtract(items.getOutGoodsTotalShipAmount()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -618,6 +621,11 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
List<SaleDetailDto> saleDetailDtoList = orderItemsService.saleDetailList(saleDetailDto);
|
|
|
if (!saleDetailDtoList.isEmpty()) {
|
|
|
+ for (SaleDetailDto items : saleDetailDtoList) {
|
|
|
+ items.setPrimaryGoodsTotalMoney(items.getPrimaryGoodsTotalNum().multiply(items.getPrice()));
|
|
|
+ items.setSurplusNum(items.getGoodsNum().subtract(items.getOutGoodsTotalShipNum()));
|
|
|
+ items.setSurplusAmount(items.getSubTotalMoney().subtract(items.getOutGoodsTotalShipAmount()));
|
|
|
+ }
|
|
|
BigDecimal goodsNumCancel = saleDetailDtoList.stream().filter(e -> "已取消".equals(e.getStatus()))
|
|
|
.map(SaleDetailDto::getGoodsNum).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
.setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
@@ -633,6 +641,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
BigDecimal freightCancel = saleDetailDtoList.stream().filter(e -> "已取消".equals(e.getStatus()))
|
|
|
.map(SaleDetailDto::getFreight).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
.setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+
|
|
|
BigDecimal goodsNumActual = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
.map(SaleDetailDto::getGoodsNum).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
.setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
@@ -648,6 +657,25 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
BigDecimal freight = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
.map(SaleDetailDto::getFreight).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
.setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+ BigDecimal outGoodsTotalShipNum = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
+ .map(SaleDetailDto::getOutGoodsTotalShipNum).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+ BigDecimal outGoodsTotalShipAmount = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
+ .map(SaleDetailDto::getOutGoodsTotalShipAmount).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+ BigDecimal primaryGoodsTotalNum = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
+ .map(SaleDetailDto::getPrimaryGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+ BigDecimal primaryGoodsTotalMoney = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
+ .map(SaleDetailDto::getPrimaryGoodsTotalMoney).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+ BigDecimal surplusNum = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
+ .map(SaleDetailDto::getSurplusNum).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+ BigDecimal surplusAmount = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
|
|
|
+ .map(SaleDetailDto::getSurplusAmount).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+
|
|
|
BigDecimal freightReturns = saleDetailDtoList.stream().filter(e -> "已完成".equals(e.getStatus()))
|
|
|
.map(SaleDetailDto::getFreight).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
.setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
@@ -663,6 +691,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
BigDecimal profitReturns = saleDetailDtoList.stream().filter(e -> "已完成".equals(e.getStatus()))
|
|
|
.map(SaleDetailDto::getProfit).reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
.setScale(0, RoundingMode.HALF_UP).abs();
|
|
|
+
|
|
|
if ("TKXS".equals(saleDetailDto.getBsType()) || "TKCG".equals(saleDetailDto.getBsType())) {
|
|
|
map.put("goodsSum", new BigDecimal("0"));
|
|
|
map.put("amount", new BigDecimal("0"));
|
|
|
@@ -673,6 +702,12 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
map.put("amountCancellation", subTotalMoneyCancel.add(subTotalMoneyReturns));
|
|
|
map.put("costprieCancellation", costprieCancel.add(costprieReturns));
|
|
|
map.put("profitCancellation", profitCancel.add(profitReturns));
|
|
|
+ map.put("outGoodsTotalShipNum", new BigDecimal("0"));
|
|
|
+ map.put("outGoodsTotalShipAmount", new BigDecimal("0"));
|
|
|
+ map.put("primaryGoodsTotalNum", new BigDecimal("0"));
|
|
|
+ map.put("primaryGoodsTotalMoney", new BigDecimal("0"));
|
|
|
+ map.put("surplusNum", new BigDecimal("0"));
|
|
|
+ map.put("surplusAmount", new BigDecimal("0"));
|
|
|
} else if ("XS".equals(saleDetailDto.getBsType()) || "CG".equals(saleDetailDto.getBsType())
|
|
|
|| "RZCG".equals(saleDetailDto.getBsType())) {
|
|
|
map.put("goodsSum", goodsNumActual);
|
|
|
@@ -684,6 +719,12 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
map.put("amountCancellation", "0.00");
|
|
|
map.put("costprieCancellation", "0.00");
|
|
|
map.put("profitCancellation", "0.00");
|
|
|
+ map.put("outGoodsTotalShipNum", outGoodsTotalShipNum);
|
|
|
+ map.put("outGoodsTotalShipAmount", outGoodsTotalShipAmount);
|
|
|
+ map.put("primaryGoodsTotalNum", primaryGoodsTotalNum);
|
|
|
+ map.put("primaryGoodsTotalMoney", primaryGoodsTotalMoney);
|
|
|
+ map.put("surplusNum", surplusNum);
|
|
|
+ map.put("surplusAmount", surplusAmount);
|
|
|
} else {
|
|
|
map.put("goodsSum", goodsNumActual.add(goodsNumCancel));
|
|
|
map.put("amount", subTotalMoneyActual.add(subTotalMoneyCancel));
|
|
|
@@ -694,6 +735,12 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
map.put("amountCancellation", subTotalMoneyCancel.add(subTotalMoneyReturns));
|
|
|
map.put("costprieCancellation", costprieCancel.add(costprieReturns));
|
|
|
map.put("profitCancellation", profitCancel.add(profitReturns));
|
|
|
+ map.put("outGoodsTotalShipNum", outGoodsTotalShipNum);
|
|
|
+ map.put("outGoodsTotalShipAmount", outGoodsTotalShipAmount);
|
|
|
+ map.put("primaryGoodsTotalNum", primaryGoodsTotalNum);
|
|
|
+ map.put("primaryGoodsTotalMoney", primaryGoodsTotalMoney);
|
|
|
+ map.put("surplusNum", surplusNum);
|
|
|
+ map.put("surplusAmount", surplusAmount);
|
|
|
}
|
|
|
} else {
|
|
|
map.put("goodsSum", "0");
|
|
|
@@ -705,6 +752,13 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
map.put("costprieCancellation", "0.00");
|
|
|
map.put("profitCancellation", "0.00");
|
|
|
map.put("freight", "0.00");
|
|
|
+ map.put("outGoodsTotalShipNum", "0.00");
|
|
|
+ map.put("outGoodsTotalShipAmount", "0.00");
|
|
|
+ map.put("primaryGoodsTotalNum", "0.00");
|
|
|
+ map.put("primaryGoodsTotalMoney", "0.00");
|
|
|
+ map.put("surplusNum", "0.00");
|
|
|
+ map.put("surplusAmount", "0.00");
|
|
|
+
|
|
|
}
|
|
|
return R.data(map);
|
|
|
}
|
|
|
@@ -765,6 +819,9 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ items.setPrimaryGoodsTotalMoney(items.getPrimaryGoodsTotalNum().multiply(items.getPrice()));
|
|
|
+ items.setSurplusNum(items.getGoodsNum().subtract(items.getOutGoodsTotalShipNum()));
|
|
|
+ items.setSurplusAmount(items.getSubTotalMoney().subtract(items.getOutGoodsTotalShipAmount()));
|
|
|
}
|
|
|
}
|
|
|
}
|