@@ -61,6 +61,8 @@ public interface StripeService {
|
||||
|
||||
CheckCouponsVO checkProductCoupon(String promotionCode, Long price);
|
||||
|
||||
ProductCoupons updateCouponsInfo(Long id, Long paidCommission, String cooperator, String remark);
|
||||
|
||||
ProductCoupons getProductCoupon(String promotionCode, String promotionCodeId);
|
||||
|
||||
String retrieveCoupon(String couponId);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1396,7 +1396,8 @@ public class StripeServiceImpl implements StripeService {
|
||||
PromotionCode promotionCode = createPromotionCode(coupon.getId(), createCouponDTO.getMaxRedemptions());
|
||||
// 3、落库
|
||||
ProductCoupons productCoupons = new ProductCoupons(coupon.getId(), createCouponDTO.getTimestamp(), promotionCode.getId(),
|
||||
promotionCode.getCode(), createCouponDTO.getMaxRedemptions(), createCouponDTO.getPercentOff(), createCouponDTO.getCommissionRate());
|
||||
promotionCode.getCode(), createCouponDTO.getMaxRedemptions(), createCouponDTO.getPercentOff(),
|
||||
createCouponDTO.getCommissionRate(), createCouponDTO.getCooperator(), createCouponDTO.getRemark());
|
||||
productCoupons.setCreateTime(LocalDateTime.now());
|
||||
productCouponsMapper.insert(productCoupons);
|
||||
|
||||
@@ -1422,6 +1423,31 @@ public class StripeServiceImpl implements StripeService {
|
||||
}
|
||||
}
|
||||
|
||||
public ProductCoupons updateCouponsInfo(Long id, Long paidCommission, String cooperator, String remark){
|
||||
ProductCoupons productCoupons = productCouponsMapper.selectById(id);
|
||||
if (Objects.isNull(productCoupons)){
|
||||
throw new BusinessException("Unknown Promotion Code");
|
||||
}
|
||||
boolean flag = false;
|
||||
if (!StringUtil.isNullOrEmpty(cooperator)){
|
||||
productCoupons.setCooperator(cooperator);
|
||||
flag = true;
|
||||
}
|
||||
if (!StringUtil.isNullOrEmpty(remark)){
|
||||
productCoupons.setRemark(remark);
|
||||
flag = true;
|
||||
}
|
||||
if (Objects.nonNull(paidCommission)){
|
||||
productCoupons.setPaidCommission(paidCommission);
|
||||
flag = true;
|
||||
}
|
||||
if (flag){
|
||||
productCoupons.setUpdateTime(LocalDateTime.now());
|
||||
productCouponsMapper.updateById(productCoupons);
|
||||
}
|
||||
return productCoupons;
|
||||
}
|
||||
|
||||
public ProductCoupons checkProductCoupon(String promotionCode){
|
||||
Stripe.apiKey = privateKey;
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
|
||||
Reference in New Issue
Block a user