Merge remote-tracking branch 'origin/master-v2' into master-v2
| | |
| | | @ApiModelProperty(value = "领取后有效类型名称") |
| | | private String usageTimeTypeName; |
| | | |
| | | /** |
| | | * 有效开始时间 |
| | | */ |
| | | @ApiModelProperty(value = "有效开始时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss" ,timezone="GMT+8") |
| | | @DateTimeFormat |
| | | private LocalDateTime effectiveStart; |
| | | |
| | | /** |
| | | * 有效结束时间 |
| | | */ |
| | | @ApiModelProperty(value = "有效结束时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss" ,timezone="GMT+8") |
| | | @DateTimeFormat |
| | | private LocalDateTime effectiveEnd; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | BigDecimal totalAmount = order.getFlowerAmount().add(p.getPacking()).add(transportFee);//使用优惠券之前的总价 |
| | | CouponRecordDO coupon = useCouponRecord(order.getId(), totalAmount, dto.getCouponRecordId()); |
| | | log.info("用户优惠券: " + coupon); |
| | | if(coupon != null){ |
| | | order.setMemberCouponId(coupon.getId()); |
| | | order.setMemberCouponCode(coupon.getCouponCode()); |
| | |
| | | } |
| | | |
| | | private CouponRecordDO useCouponRecord(String orderId, BigDecimal amount, String couponRecordId){ |
| | | log.info("使用用户优惠券id: " + couponRecordId + "; 订单id: " + orderId); |
| | | if(StringUtils.isNotEmpty(couponRecordId)){ |
| | | //优惠券使用和验证,如果不符合使用条件需要抛出异常。需调用优惠券使用方法 |
| | | couponRecordService.useCoupon(couponRecordId, orderId, amount); |