Commit f3f93af5 by 吕明尚

抖音优惠卷退款后删除原来的优惠卷

parent 5c27aca8
......@@ -119,7 +119,7 @@ public class RedisTask {
expiredCoupons.add(coupon.getId());
}
logger.info("券码:{}->查询结束:{}", coupon.getCouponCode(), getconsumed);
} else if (StringUtils.isNoneEmpty(coupon.getTiktokSkuId()) && coupon.getPlatformType().equals(PlatformTypeEnum.MEITUAN.getCode())) {
} else if (StringUtils.isNoneEmpty(coupon.getTiktokSkuId()) && coupon.getPlatformType().equals(PlatformTypeEnum.TIKTOK.getCode())) {
//抖音复验券
JSONObject object = tiktokService.certificateGet(coupon.getCouponCode());
JSONObject certificate = object.getJSONObject("certificate");
......
......@@ -536,9 +536,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
JSONObject object = tiktokService.certificateGet(byId.getCouponCode());
JSONObject certificate = object.getJSONObject("certificate");
Integer status = certificate.getInt("status");
Boolean isDelete = false;
if (status.equals(TiktokCouponStatusEnum.AVAILABLE.getCode())) {
consumerCouponService.deleteSConsumerCouponById(byId.getId());
throw new RuntimeException("优惠券异常,请重新验劵");
isDelete = true;
}
if (isDelete) {
throw new RuntimeException("优惠券异常,请稍后再试");
}
if (status.equals(TiktokCouponStatusEnum.REFUND_SUCCESS.getCode()) | status.equals(TiktokCouponStatusEnum.REFUNDING.getCode())) {
throw new RuntimeException("优惠券异常,请稍后再试");
......
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