...
|
...
|
@@ -297,6 +297,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
|
return new ApiResponse(201, "uid数量大于当前券可用数量:"+ availableNum + "!" , null);
|
|
|
}
|
|
|
// 发券
|
|
|
Set<Integer> failUidSet = new HashSet<>();
|
|
|
for(Integer uid : uidSet){
|
|
|
try {
|
|
|
JSONObject sendCouponParam = new JSONObject();
|
...
|
...
|
@@ -306,9 +307,11 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
|
yhProducer.send("ufo.couponSendWithTradeMqNotify", sendCouponParam, null);
|
|
|
Thread.sleep(5);
|
|
|
}catch (Exception e){
|
|
|
LOGGER.info("sendCoupon by mq fail with uid is {}, token is {}", uid, couponToken);
|
|
|
failUidSet.add(uid);
|
|
|
LOGGER.warn("sendCoupon by mq fail with uid is {}, token is {}, e is {}", uid, couponToken,e);
|
|
|
}
|
|
|
}
|
|
|
LOGGER.info("sendCoupon end with success num is {}", uidSet.size() - failUidSet.size());
|
|
|
return new ApiResponse();
|
|
|
}
|
|
|
|
...
|
...
|
|