Showing
1 changed file
with
5 additions
and
2 deletions
@@ -281,10 +281,12 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | @@ -281,10 +281,12 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | ||
281 | } | 281 | } |
282 | 282 | ||
283 | private ApiResponse sendCouponByMQ(String couponToken, List<Integer> uidList){ | 283 | private ApiResponse sendCouponByMQ(String couponToken, List<Integer> uidList){ |
284 | + UserHelper operator = new UserHelper(); | ||
285 | + LOGGER.info("sendCoupon with couponToken is {}, uidList is {}, operateUserId is {}, operateUserName is {}", couponToken, uidList, operator.getUserId(), operator.getUserName()); | ||
284 | // ufo券校验 1.是否有效 2.可用数量是否大于所需发送人数 | 286 | // ufo券校验 1.是否有效 2.可用数量是否大于所需发送人数 |
285 | Coupon coupon = couponMapper.selectValidByToken(couponToken); | 287 | Coupon coupon = couponMapper.selectValidByToken(couponToken); |
286 | if(coupon == null){ | 288 | if(coupon == null){ |
287 | - LOGGER.info("sendCoupon failed with coupon isn't exist or isn't valid, token is {}", couponToken); | 289 | + LOGGER.info("sendCoupon failed with coupon isn't exist or isn't valid, couponToken is {}", couponToken); |
288 | return new ApiResponse(201, "优惠券未在使用中!", null); | 290 | return new ApiResponse(201, "优惠券未在使用中!", null); |
289 | } | 291 | } |
290 | if(coupon.getEndTime() < DateUtil.getCurrentTimeSecond()){ | 292 | if(coupon.getEndTime() < DateUtil.getCurrentTimeSecond()){ |
@@ -293,7 +295,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | @@ -293,7 +295,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | ||
293 | } | 295 | } |
294 | int availableNum = coupon.getCouponNum() - coupon.getSendNum(); | 296 | int availableNum = coupon.getCouponNum() - coupon.getSendNum(); |
295 | if(uidList.size() > availableNum){ | 297 | if(uidList.size() > availableNum){ |
296 | - LOGGER.info("sendCoupon failed with couponNum isn't enough, uidSize is {}, availableCouponNum is {}", uidList.size(), availableNum); | 298 | + LOGGER.info("sendCoupon failed with couponNum isn't enough,token is{}, uidSize is {}, availableCouponNum is {}",couponToken, uidList.size(), availableNum); |
297 | return new ApiResponse(201, "uid数量大于当前券可用数量:"+ availableNum + "!" , null); | 299 | return new ApiResponse(201, "uid数量大于当前券可用数量:"+ availableNum + "!" , null); |
298 | } | 300 | } |
299 | // 发券 | 301 | // 发券 |
@@ -305,6 +307,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | @@ -305,6 +307,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | ||
305 | sendCouponParam.put("couponTokens", Collections.singletonList(coupon.getCouponToken())); | 307 | sendCouponParam.put("couponTokens", Collections.singletonList(coupon.getCouponToken())); |
306 | sendCouponParam.put("sendType", "1");//sendType 为1时, 若这张券已经领过,则仍然可以领 | 308 | sendCouponParam.put("sendType", "1");//sendType 为1时, 若这张券已经领过,则仍然可以领 |
307 | yhProducer.send("ufo.couponSendWithTradeMqNotify", sendCouponParam, null); | 309 | yhProducer.send("ufo.couponSendWithTradeMqNotify", sendCouponParam, null); |
310 | + LOGGER.info("sendCoupon by mq, token is {}, uid is {}, operateUserId is {}, operateUserName is {}", couponToken, uid, operator.getUserId(), operator.getUserName()); | ||
308 | Thread.sleep(5); | 311 | Thread.sleep(5); |
309 | }catch (Exception e){ | 312 | }catch (Exception e){ |
310 | failUidList.add(uid); | 313 | failUidList.add(uid); |
-
Please register or login to post a comment