Commit 8d57a696 by 吕明尚

订单管理显示

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