积分兑换,结算页面积分支付展示问题处理。

店铺商品变更店铺商品数量展示同步。
This commit is contained in:
Chopper 2021-08-20 16:12:29 +08:00
parent e141d22504
commit 1424eaa90f
4 changed files with 41 additions and 13 deletions

View File

@ -107,10 +107,12 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
break; break;
//审核商品 //审核商品
case GOODS_AUDIT: case GOODS_AUDIT:
updateGoodsNum(messageExt);
break; break;
//删除商品 //删除商品
case GOODS_DELETE: case GOODS_DELETE:
deleteGoods(messageExt); deleteGoods(messageExt);
updateGoodsNum(messageExt);
break; break;
//规格删除 //规格删除
case SKU_DELETE: case SKU_DELETE:
@ -156,8 +158,6 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
*/ */
private void deleteGoods(MessageExt messageExt) { private void deleteGoods(MessageExt messageExt) {
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class); Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
//更新店铺商品数量
storeService.updateStoreGoodsNum(goods.getStoreId());
//删除获取分销商品 //删除获取分销商品
DistributionGoods distributionGoods = distributionGoodsService.getOne(new LambdaQueryWrapper<DistributionGoods>() DistributionGoods distributionGoods = distributionGoodsService.getOne(new LambdaQueryWrapper<DistributionGoods>()
@ -171,6 +171,18 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
distributionGoodsService.removeById(distributionGoods.getId()); distributionGoodsService.removeById(distributionGoods.getId());
} }
/**
* 修改商品数量
*
* @param messageExt
*/
private void updateGoodsNum(MessageExt messageExt) {
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
//更新店铺商品数量
storeService.updateStoreGoodsNum(goods.getStoreId());
}
/** /**
* 商品购买完成 * 商品购买完成
* 1.更新商品购买数量 * 1.更新商品购买数量

View File

@ -27,7 +27,7 @@ public class PriceDetailVO implements Serializable {
private Double discountPrice; private Double discountPrice;
@ApiModelProperty(value = "支付积分") @ApiModelProperty(value = "支付积分")
private Integer payPoint; private Long payPoint;
@ApiModelProperty(value = "最终成交金额") @ApiModelProperty(value = "最终成交金额")
private Double finalePrice; private Double finalePrice;

View File

@ -67,16 +67,32 @@ public class SkuPromotionRender implements CartRenderStep {
*/ */
private void renderSkuPromotion(TradeDTO tradeDTO) { private void renderSkuPromotion(TradeDTO tradeDTO) {
//非积分商品拼团砍价商品可渲染满优惠活动
//这里普通购物车也只渲染满优惠其他优惠都是商品级别的都写在商品属性里 switch (tradeDTO.getCartTypeEnum()) {
if (!tradeDTO.getCartTypeEnum().equals(CartTypeEnum.POINTS) case POINTS:
&& !tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN) for (CartVO cartVO : tradeDTO.getCartList()) {
&& !tradeDTO.getCartTypeEnum().equals(CartTypeEnum.KANJIA)) { for (CartSkuVO cartSkuVO : cartVO.getSkuList()) {
cartSkuVO.getPriceDetailDTO().setPayPoint(cartSkuVO.getPoint());
}
}
case CART:
case BUY_NOW:
case VIRTUAL:
for (CartVO cartVO : tradeDTO.getCartList()) { for (CartVO cartVO : tradeDTO.getCartList()) {
for (CartSkuVO cartSkuVO : cartVO.getSkuList()) { for (CartSkuVO cartSkuVO : cartVO.getSkuList()) {
promotionGoodsService.updatePromotion(cartSkuVO); promotionGoodsService.updatePromotion(cartSkuVO);
} }
} }
return;
default:
}
//非积分商品拼团砍价商品可渲染满优惠活动
//这里普通购物车也只渲染满优惠其他优惠都是商品级别的都写在商品属性里
if (!tradeDTO.getCartTypeEnum().equals(CartTypeEnum.POINTS)
&& !tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN)
&& !tradeDTO.getCartTypeEnum().equals(CartTypeEnum.KANJIA)) {
} }
} }

View File

@ -37,7 +37,7 @@ public class PriceDetailDTO implements Serializable {
//============discount price============ //============discount price============
@ApiModelProperty(value = "支付积分") @ApiModelProperty(value = "支付积分")
private Integer payPoint; private Long payPoint;
@ApiModelProperty(value = "优惠金额") @ApiModelProperty(value = "优惠金额")
private Double discountPrice; private Double discountPrice;
@ -113,7 +113,7 @@ public class PriceDetailDTO implements Serializable {
goodsPrice = 0d; goodsPrice = 0d;
freightPrice = 0d; freightPrice = 0d;
payPoint = 0; payPoint = 0L;
discountPrice = 0d; discountPrice = 0d;
couponPrice = 0d; couponPrice = 0d;
@ -230,9 +230,9 @@ public class PriceDetailDTO implements Serializable {
return freightPrice; return freightPrice;
} }
public Integer getPayPoint() { public Long getPayPoint() {
if (payPoint == null || payPoint <= 0) { if (payPoint == null || payPoint <= 0) {
return 0; return 0L;
} }
return payPoint; return payPoint;
} }
@ -343,7 +343,7 @@ public class PriceDetailDTO implements Serializable {
this.recount(); this.recount();
} }
public void setPayPoint(Integer payPoint) { public void setPayPoint(Long payPoint) {
this.payPoint = payPoint; this.payPoint = payPoint;
} }