Commit cbb2cf93 by 吕明尚

修改数据统计

parent eefddff0
......@@ -2909,7 +2909,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
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()));
//获取rechargeList中的所有rechargeAmount的和
BigDecimal rechargeAmount = rechargeList.stream().map(Recharge::getRechargeAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
OrderStatisticsResponse statisticsResponse = new OrderStatisticsResponse();
......@@ -2932,28 +2934,58 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if (!map.isEmpty()) {
if (ObjectUtil.isNotEmpty(order.getCouponId())) {
SConsumerCoupon sConsumerCoupon = map.get(order.getCouponId());
if (ObjectUtil.isEmpty(sConsumerCoupon)) {
return;
}
if (sConsumerCoupon.getCouponType().equals(CouponTypeEnum.CASH.getCode())) {
if (sConsumerCoupon.getPlatformType().equals(PlatformTypeEnum.MEITUAN.getCode())) {
statisticsResponse.setMeituanFee(statisticsResponse.getMeituanFee().add(sConsumerCoupon.getCouponPayPrice()));
if (ObjectUtil.isNotEmpty(sConsumerCoupon.getCouponPayPrice())) {
statisticsResponse.setMeituanRefundFee(statisticsResponse.getMeituanRefundFee().add(sConsumerCoupon.getCouponPayPrice()));
} else {
SCoupon sCoupon = sCouponMap.get(sConsumerCoupon.getCouponId());
statisticsResponse.setMeituanRefundFee(statisticsResponse.getMeituanRefundFee().add(sCoupon.getCouponPayPrice()));
}
} else if (sConsumerCoupon.getPlatformType().equals(PlatformTypeEnum.TIKTOK.getCode())) {
statisticsResponse.setDouyinFee(statisticsResponse.getDouyinFee().add(sConsumerCoupon.getCouponPayPrice()));
if (ObjectUtil.isNotEmpty(sConsumerCoupon.getCouponPayPrice())) {
statisticsResponse.setDouyinRefundFee(statisticsResponse.getDouyinRefundFee().add(sConsumerCoupon.getCouponPayPrice()));
} else {
SCoupon sCoupon = sCouponMap.get(sConsumerCoupon.getCouponId());
statisticsResponse.setDouyinRefundFee(statisticsResponse.getDouyinRefundFee().add(sCoupon.getCouponPayPrice()));
}
// statisticsResponse.setDouyinRefundFee(statisticsResponse.getDouyinRefundFee().add(sConsumerCoupon.getCouponPayPrice()));
}
}
}
}
statisticsResponse.setPlatformFee(statisticsResponse.getPlatformFee().add(order.getPayPrice()));
statisticsResponse.setPlatformRefundFee(statisticsResponse.getPlatformRefundFee().add(order.getPayPrice()));
statisticsResponse.setRechargeBalanceRefundFee(statisticsResponse.getRechargeBalanceRefundFee().add(order.getBalance()));
} else {
statisticsResponse.setPlatformRefundFee(statisticsResponse.getPlatformRefundFee().add(order.getPayPrice()));
statisticsResponse.setPlatformFee(statisticsResponse.getPlatformFee().add(order.getPayPrice()));
statisticsResponse.setRechargeBalance(statisticsResponse.getRechargeBalance().add(order.getBalance()));
if (!map.isEmpty()) {
if (ObjectUtil.isNotEmpty(order.getCouponId())) {
SConsumerCoupon sConsumerCoupon = map.get(order.getCouponId());
if (sConsumerCoupon.getCouponType().equals(CouponTypeEnum.CASH.getCode())) {
if (sConsumerCoupon.getPlatformType().equals(PlatformTypeEnum.MEITUAN.getCode())) {
statisticsResponse.setMeituanRefundFee(statisticsResponse.getMeituanRefundFee().add(sConsumerCoupon.getCouponPayPrice()));
if (ObjectUtil.isNotEmpty(sConsumerCoupon.getCouponPayPrice())) {
statisticsResponse.setMeituanFee(statisticsResponse.getMeituanFee().add(sConsumerCoupon.getCouponPayPrice()));
} else {
SCoupon sCoupon = sCouponMap.get(sConsumerCoupon.getCouponId());
statisticsResponse.setMeituanFee(statisticsResponse.getMeituanFee().add(sCoupon.getCouponPayPrice()));
// statisticsResponse.setMeituanRefundFee(statisticsResponse.getMeituanRefundFee().add(sCoupon.getCouponPayPrice()));
}
// statisticsResponse.setMeituanFee(statisticsResponse.getMeituanFee().add(sConsumerCoupon.getCouponPayPrice()));
} else if (sConsumerCoupon.getPlatformType().equals(PlatformTypeEnum.TIKTOK.getCode())) {
statisticsResponse.setDouyinRefundFee(statisticsResponse.getDouyinRefundFee().add(sConsumerCoupon.getCouponPayPrice()));
if (ObjectUtil.isNotEmpty(sConsumerCoupon.getCouponPayPrice())) {
statisticsResponse.setDouyinFee(statisticsResponse.getDouyinFee().add(sConsumerCoupon.getCouponPayPrice()));
} else {
SCoupon sCoupon = sCouponMap.get(sConsumerCoupon.getCouponId());
statisticsResponse.setDouyinFee(statisticsResponse.getDouyinFee().add(sCoupon.getCouponPayPrice()));
}
// statisticsResponse.setDouyinFee(statisticsResponse.getDouyinFee().add(sConsumerCoupon.getCouponPayPrice()));
}
}
}
......
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