Commit 864ac06c by 吕明尚

修改数据统计

parent be948abd
......@@ -26,9 +26,9 @@ public class OrderStatisticsResponse {
private BigDecimal platformFee = BigDecimal.ZERO;
//平台退款
private BigDecimal platformRefundFee = BigDecimal.ZERO;
//用户充值
//赠送余额消费
private BigDecimal rechargeFee = BigDecimal.ZERO;
//用户充值退款
//赠送余额退款
private BigDecimal rechargeRefundFee = BigDecimal.ZERO;
//充值余额支付
private BigDecimal rechargeBalance = BigDecimal.ZERO;
......
......@@ -3315,15 +3315,15 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if (CollectionUtil.isEmpty(orderList)) {
return new OrderStatisticsResponse();
}
List<Recharge> rechargeList = rechargeService.list(new LambdaQueryWrapper<Recharge>()
.ge(Recharge::getCreateTime, request.getStartTime())
.le(Recharge::getCreateTime, request.getEndTime())
.eq(Recharge::getStatus, YesNoEnum.yes.getIndex())
);
// List<Recharge> rechargeList = rechargeService.list(new LambdaQueryWrapper<Recharge>()
// .ge(Recharge::getCreateTime, request.getStartTime())
// .le(Recharge::getCreateTime, request.getEndTime())
// .eq(Recharge::getStatus, YesNoEnum.yes.getIndex())
// );
Map<Long, SCoupon> sCouponMap = sCouponService.list().stream().collect(Collectors.toMap(SCoupon::getId, Function.identity()));
Map<Long, SStore> sStoreMap = storeService.list().stream().collect(Collectors.toMap(SStore::getId, Function.identity()));
Map<Long, SRoom> sRoomMap = roomService.list().stream().collect(Collectors.toMap(SRoom::getId, Function.identity()));
BigDecimal rechargeAmount = rechargeList.stream().map(Recharge::getRechargeAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
// BigDecimal rechargeAmount = rechargeList.stream().map(Recharge::getRechargeAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
OrderStatisticsResponse statisticsResponse = new OrderStatisticsResponse();
Map<Long, SConsumerCoupon> map = new HashMap<>();
......@@ -3392,10 +3392,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
statisticsResponse.setPlatformRefundFee(statisticsResponse.getPlatformRefundFee().add(order.getPayPrice()));
statisticsResponse.setRechargeBalanceRefundFee(statisticsResponse.getRechargeBalanceRefundFee().add(order.getBalance()));
statisticsResponse.setRechargeBalanceRefundFee(statisticsResponse.getRechargeBalanceRefundFee().add(order.getRechargeAmount()));
if (order.getBalance().compareTo(BigDecimal.ZERO) != 0 && order.getRechargeAmount().compareTo(BigDecimal.ZERO) == 0 && order.getGiftAmount().compareTo(BigDecimal.ZERO) == 0) {
statisticsResponse.setRechargeBalanceRefundFee(statisticsResponse.getRechargeBalanceRefundFee().add(order.getBalance()));
}
statisticsResponse.setRechargeRefundFee(statisticsResponse.getRechargeRefundFee().add(order.getGiftAmount()));
}
statisticsResponse.setPlatformFee(statisticsResponse.getPlatformFee().add(order.getPayPrice()));
statisticsResponse.setRechargeBalance(statisticsResponse.getRechargeBalance().add(order.getRechargeAmount()));
if (order.getBalance().compareTo(BigDecimal.ZERO) != 0 && order.getRechargeAmount().compareTo(BigDecimal.ZERO) == 0 && order.getGiftAmount().compareTo(BigDecimal.ZERO) == 0) {
statisticsResponse.setRechargeBalance(statisticsResponse.getRechargeBalance().add(order.getBalance()));
}
statisticsResponse.setRechargeFee(statisticsResponse.getRechargeFee().add(order.getGiftAmount()));
if (!map.isEmpty()) {
if (ObjectUtil.isNotEmpty(order.getCouponId())) {
SConsumerCoupon sConsumerCoupon = map.get(order.getCouponId());
......@@ -3439,15 +3447,15 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
finalOrderVoList.add(orderVo);
});
//用户充值
statisticsResponse.setRechargeFee(rechargeAmount);
// statisticsResponse.setRechargeFee(rechargeAmount);
//美团团购金额+抖音团购金额
statisticsResponse.setGroupFee(statisticsResponse.getMeituanFee().add(statisticsResponse.getDouyinFee()));
//美团团购退款+抖音团购退款
statisticsResponse.setGroupRefundFee(statisticsResponse.getMeituanRefundFee().add(statisticsResponse.getDouyinRefundFee()));
//团购金额+平台支付
statisticsResponse.setStoreFee(statisticsResponse.getGroupFee().add(statisticsResponse.getPlatformFee()));
//团购退款+平台退款
statisticsResponse.setStoreRefundFee(statisticsResponse.getGroupRefundFee().add(statisticsResponse.getPlatformRefundFee()));
//团购金额+平台支付+充值金额
statisticsResponse.setStoreFee(statisticsResponse.getGroupFee().add(statisticsResponse.getPlatformFee()).add(statisticsResponse.getRechargeBalance()));
//团购退款+平台退款+充值金额退款
statisticsResponse.setStoreRefundFee(statisticsResponse.getGroupRefundFee().add(statisticsResponse.getPlatformRefundFee()).add(statisticsResponse.getRechargeBalanceRefundFee()));
//团购金额+平台支付
statisticsResponse.setTotalFee(statisticsResponse.getGroupFee().add(statisticsResponse.getPlatformFee()));
//门店交易-门店交易退款
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment