Commit 8d57a696 by 吕明尚

订单管理显示

parent f3b16631
......@@ -18,17 +18,13 @@ public class TableDataInfoVo extends TableDataInfo {
/**
* 优惠卷售卖总金额
*/
private BigDecimal couponAmount;
private BigDecimal totalSalesAmount;
/**
* 申请退款总金额
*/
private BigDecimal refundAmount;
//申请退款总金额
private BigDecimal totalRefundAmount;
/**
* 实际退款总金额
*/
private BigDecimal realRefundAmount;
//实际退款总金额
private BigDecimal totalRealRefundAmount;
public BigDecimal getTotalAmount() {
return totalAmount;
......@@ -46,27 +42,28 @@ public class TableDataInfoVo extends TableDataInfo {
this.amount = amount;
}
public BigDecimal getCouponAmount() {
return couponAmount;
public BigDecimal getTotalSalesAmount() {
return totalSalesAmount;
}
public void setCouponAmount(BigDecimal couponAmount) {
this.couponAmount = couponAmount;
public void setTotalSalesAmount(BigDecimal totalSalesAmount) {
this.totalSalesAmount = totalSalesAmount;
}
public BigDecimal getRefundAmount() {
return refundAmount;
public BigDecimal getTotalRefundAmount() {
return totalRefundAmount;
}
public void setRefundAmount(BigDecimal refundAmount) {
this.refundAmount = refundAmount;
public void setTotalRefundAmount(BigDecimal totalRefundAmount) {
this.totalRefundAmount = totalRefundAmount;
}
public BigDecimal getRealRefundAmount() {
return realRefundAmount;
public BigDecimal getTotalRealRefundAmount() {
return totalRealRefundAmount;
}
public void setRealRefundAmount(BigDecimal realRefundAmount) {
this.realRefundAmount = realRefundAmount;
public void setTotalRealRefundAmount(BigDecimal totalRealRefundAmount) {
this.totalRealRefundAmount = totalRealRefundAmount;
}
}
......@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import share.common.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
......@@ -214,4 +213,16 @@ public class SOrderVo
@ApiModelProperty(name = "套餐名称")
private String packName;
@ApiModelProperty(name = "优惠券id")
private String couponSkuId;
@ApiModelProperty(name = "优惠卷购买金额")
private BigDecimal couponPayPrice;
@ApiModelProperty(name = "第三方平台类型(1:自营,2:美团,3: 抖音)")
private Integer platformType;
}
......@@ -121,6 +121,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Autowired
private RedisUtil redisUtils;
@Autowired
private ISCouponService sCouponService;
private final static Long FIVE = 5l;
......@@ -308,30 +311,35 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Override
public TableDataInfoVo pageList(SOrder sOrder) {
List<SOrder> sOrders = selectSOrderList(sOrder);
List<SOrderVo> sOrderVos = convertDosToVos(sOrders);
BigDecimal totalAmount = new BigDecimal("0.00");
BigDecimal amount = new BigDecimal("0.00");
//优惠卷售卖总金额
BigDecimal couponAmount = new BigDecimal("0.00");
final BigDecimal[] totalSalesAmount = {new BigDecimal("0.00")};
//申请退款总金额
BigDecimal refundAmount = new BigDecimal("0.00");
BigDecimal totalRefundAmount = new BigDecimal("0.00");
//实际退款总金额
BigDecimal realRefundAmount = new BigDecimal("0.00");
BigDecimal totalRealRefundAmount = new BigDecimal("0.00");
List<SConsumerCoupon> sConsumerCoupons = consumerCouponService.queryList();
if (CollectionUtils.isNotEmpty(sOrderVos)) {
for (SOrderVo item : sOrderVos) {
totalAmount = totalAmount.add(item.getTotalPrice());
amount = amount.add(item.getPayPrice());
sConsumerCoupons.stream().filter(sConsumerCoupon -> sConsumerCoupon.getId().equals(item.getCouponId())).findFirst().ifPresent(sConsumerCoupon -> {
couponAmount.add(ObjectUtil.isEmpty(sConsumerCoupon.getCouponPayPrice()) ? new BigDecimal("0.00") : sConsumerCoupon.getCouponPayPrice());
item.setCouponPayPrice(sConsumerCoupon.getCouponPayPrice());
item.setPlatformType(sConsumerCoupon.getPlatformType());
if (sConsumerCoupon.getPlatformType().equals(PlatformTypeEnum.MEITUAN.getCode())) {
item.setCouponSkuId(String.valueOf(sConsumerCoupon.getDealgroupId()));
} else if (sConsumerCoupon.getPlatformType().equals(PlatformTypeEnum.TIKTOK.getCode())) {
item.setCouponSkuId(String.valueOf(sConsumerCoupon.getTiktokSkuId()));
}
totalSalesAmount[0] = totalSalesAmount[0].add(ObjectUtil.isEmpty(sConsumerCoupon.getCouponPayPrice()) ? new BigDecimal("0.00") : sConsumerCoupon.getCouponPayPrice());
});
if (item.getPayStatus().equals(YesNoEnum.yes.getIndex()) && item.getRefundStatus().equals(RefundStatusEnum.REFUNDED.getCode())) {
refundAmount.add(ObjectUtil.isEmpty(item.getPayPrice()) ? new BigDecimal("0.00") : item.getPayPrice());
realRefundAmount.add(ObjectUtil.isEmpty(item.getRefundPrice()) ? new BigDecimal("0.00") : item.getRefundPrice());
totalRefundAmount = totalRefundAmount.add(ObjectUtil.isEmpty(item.getPayPrice()) ? new BigDecimal("0.00") : item.getPayPrice());
totalRealRefundAmount = totalRealRefundAmount.add(ObjectUtil.isEmpty(item.getRefundPrice()) ? new BigDecimal("0.00") : item.getRefundPrice());
}
}
}
sOrderVos.sort(Comparator.comparing(SOrderVo::getCreateTime).reversed());
......@@ -348,9 +356,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
tableDataInfo.setMsg("查询成功");
tableDataInfo.setTotalAmount(totalAmount);
tableDataInfo.setAmount(amount);
tableDataInfo.setCouponAmount(couponAmount);
tableDataInfo.setRefundAmount(refundAmount);
tableDataInfo.setRealRefundAmount(realRefundAmount);
tableDataInfo.setTotalSalesAmount(totalSalesAmount[0]);
tableDataInfo.setTotalRefundAmount(totalRefundAmount);
tableDataInfo.setTotalRealRefundAmount(totalRealRefundAmount);
return tableDataInfo;
}
......
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