!41 修复满优惠券活动赠优惠券/积分/商品不生效问题
Merge pull request !41 from OceansDeep/feature/pg
This commit is contained in:
commit
15c6b74829
@ -79,9 +79,9 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
||||
tradeDTO.getCartList().forEach(
|
||||
cartVO -> {
|
||||
//有满减优惠,则记录信息
|
||||
if (cartVO.getGiftList() != null && cartVO.getGiftList().size() > 0
|
||||
&& cartVO.getGiftPoint() != null && cartVO.getGiftPoint() > 0
|
||||
&& cartVO.getGiftCouponList() != null && cartVO.getGiftCouponList().size() > 0) {
|
||||
if ((cartVO.getGiftList() != null && !cartVO.getGiftList().isEmpty())
|
||||
|| (cartVO.getGiftPoint() != null && cartVO.getGiftPoint() > 0)
|
||||
|| (cartVO.getGiftCouponList() != null && !cartVO.getGiftCouponList().isEmpty())) {
|
||||
cache.put(CachePrefix.ORDER.getPrefix() + cartVO.getSn(), cartVO);
|
||||
}
|
||||
}
|
||||
@ -90,8 +90,8 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
||||
|
||||
@Override
|
||||
public void orderChange(OrderMessage orderMessage) {
|
||||
System.out.println(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
|
||||
if (orderMessage.getNewStatus().equals(OrderStatusEnum.PAID)) {
|
||||
log.debug("满减活动,订单状态操作 {}", CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
|
||||
renderGift((CartVO) cache.get(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn()), orderMessage);
|
||||
}
|
||||
}
|
||||
@ -118,10 +118,8 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
||||
|
||||
try {
|
||||
//优惠券判定
|
||||
if (cartVO.getGiftCouponList() != null && cartVO.getGiftCouponList().size() > 0) {
|
||||
cartVO.getGiftCouponList().forEach(couponId -> {
|
||||
memberCouponService.receiveCoupon(couponId, order.getMemberId(), order.getMemberName());
|
||||
});
|
||||
if (cartVO.getGiftCouponList() != null && !cartVO.getGiftCouponList().isEmpty()) {
|
||||
cartVO.getGiftCouponList().forEach(couponId -> memberCouponService.receiveCoupon(couponId, order.getMemberId(), order.getMemberName()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("订单赠送优惠券异常", e);
|
||||
@ -129,7 +127,7 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
||||
|
||||
try {
|
||||
//赠品潘迪ing
|
||||
if (cartVO.getGiftList() != null && cartVO.getGiftList().size() > 0) {
|
||||
if (cartVO.getGiftList() != null && !cartVO.getGiftList().isEmpty()) {
|
||||
generatorGiftOrder(cartVO.getGiftList(), order);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -4,6 +4,7 @@ import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.promotion.entity.dos.FullDiscount;
|
||||
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,6 +14,7 @@ import java.util.List;
|
||||
* @author Chopper
|
||||
* @since 2020-04-01 10:42 上午
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class FullDiscountVO extends FullDiscount {
|
||||
|
||||
@ -47,6 +49,9 @@ public class FullDiscountVO extends FullDiscount {
|
||||
if (Boolean.TRUE.equals(this.getIsPoint())) {
|
||||
stringBuffer.append(" 赠").append(this.getPoint()).append("积分 ");
|
||||
}
|
||||
if (Boolean.TRUE.equals(this.getIsCoupon())) {
|
||||
stringBuffer.append(" 赠").append("优惠券 ");
|
||||
}
|
||||
if (Boolean.TRUE.equals(this.getIsGift() && giftSku != null)) {
|
||||
stringBuffer.append(" 赠品[").append(giftSku.getGoodsName()).append("]");
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.DecimalMax;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@ -16,6 +17,7 @@ import javax.validation.constraints.NotNull;
|
||||
* @author Chopper
|
||||
* @since 2020-03-19 10:44 上午
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("li_full_discount")
|
||||
@ApiModel(value = "满优惠活动")
|
||||
|
Loading…
x
Reference in New Issue
Block a user