Commit 5c27aca8 by 吕明尚

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

parent 2f52bd75
...@@ -124,6 +124,9 @@ public class RedisTask { ...@@ -124,6 +124,9 @@ public class RedisTask {
JSONObject object = tiktokService.certificateGet(coupon.getCouponCode()); JSONObject object = tiktokService.certificateGet(coupon.getCouponCode());
JSONObject certificate = object.getJSONObject("certificate"); JSONObject certificate = object.getJSONObject("certificate");
Integer status = certificate.getInt("status"); Integer status = certificate.getInt("status");
if (status.equals(TiktokCouponStatusEnum.AVAILABLE.getCode())) {
expiredCoupons.add(coupon.getId());
}
if (status.equals(TiktokCouponStatusEnum.REFUND_SUCCESS.getCode()) | status.equals(TiktokCouponStatusEnum.REFUNDING.getCode())) { if (status.equals(TiktokCouponStatusEnum.REFUND_SUCCESS.getCode()) | status.equals(TiktokCouponStatusEnum.REFUNDING.getCode())) {
expiredCoupons.add(coupon.getId()); expiredCoupons.add(coupon.getId());
} }
......
...@@ -536,6 +536,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -536,6 +536,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
JSONObject object = tiktokService.certificateGet(byId.getCouponCode()); JSONObject object = tiktokService.certificateGet(byId.getCouponCode());
JSONObject certificate = object.getJSONObject("certificate"); JSONObject certificate = object.getJSONObject("certificate");
Integer status = certificate.getInt("status"); Integer status = certificate.getInt("status");
if (status.equals(TiktokCouponStatusEnum.AVAILABLE.getCode())) {
consumerCouponService.deleteSConsumerCouponById(byId.getId());
throw new RuntimeException("优惠券异常,请重新验劵");
}
if (status.equals(TiktokCouponStatusEnum.REFUND_SUCCESS.getCode()) | status.equals(TiktokCouponStatusEnum.REFUNDING.getCode())) { if (status.equals(TiktokCouponStatusEnum.REFUND_SUCCESS.getCode()) | status.equals(TiktokCouponStatusEnum.REFUNDING.getCode())) {
throw new RuntimeException("优惠券异常,请稍后再试"); 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