From a6673284d4ec0b7c11079c65d940c9443d86d11e Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期三, 06 三月 2019 15:21:48 +0800 Subject: [PATCH] 冲突 --- fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java b/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java index a64a1f6..a75cd85 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java @@ -23,6 +23,7 @@ import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; import com.yeshi.fanli.exception.TaoBaoWeiQuanException; import com.yeshi.fanli.log.LogHelper; +import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce; import com.yeshi.fanli.service.inter.lable.BoutiqueAutoRuleService; import com.yeshi.fanli.service.inter.lable.LabelService; import com.yeshi.fanli.service.inter.lable.QualityFactoryService; @@ -30,6 +31,7 @@ import com.yeshi.fanli.service.inter.push.IOSPushService; import com.yeshi.fanli.service.inter.user.ExtractService; import com.yeshi.fanli.service.inter.user.UserInfoService; +import com.yeshi.fanli.service.inter.user.UserSystemCouponService; /** * 绯荤粺鍒濆鍖� @@ -64,6 +66,12 @@ @Resource private QualityFactoryService qualityFactoryService; + @Resource + private UserSystemCouponService userSystemCouponService; + + @Resource + private ThreeSaleSerivce threeSaleSerivce; + private static boolean isInited = false; public void onApplicationEvent(ContextRefreshedEvent arg0) { @@ -90,6 +98,7 @@ doOrderTiChengFanLi();// 澶勭悊璁㈠崟鎻愭垚杩斿埄 doWeiQuanOrder();// 澶勭悊缁存潈璁㈠崟 doPushIOS();// 澶勭悊鍙戦�両OS娑堟伅 + doThreeSaleUserCouponJob();// 澶勭悊閭�璇烽槦鍒� } else if (!Constant.IS_TEST) { initScheduler();// 鍚姩瀹氭椂浠诲姟 // doUpdateGoodsJob(); @@ -204,7 +213,7 @@ } } catch (Exception e) { try { - LogHelper.errorDetailInfo(e); + LogHelper.errorDetailInfo(e, "HongBaoV2-ID:" + map.get(handler).getId(), ""); } catch (Exception e1) { e1.printStackTrace(); } @@ -402,10 +411,8 @@ while (true) { try { - Map<String, ThreeSale> map = ThreeSaleCMQManager.getInstance() .consumeQueueMsg(ThreeSaleCMQManager.QUEUE_USER_COUPON, 16); - if (map != null) { Iterator<String> its = map.keySet().iterator(); @@ -413,13 +420,21 @@ String key = its.next(); try { ThreeSale threeSale = map.get(key); + if (threeSale != null) + threeSale = threeSaleSerivce.selectByPrimaryKey(threeSale.getId()); if (threeSale != null) { if (threeSale.getState() != null && threeSale.getState() == true) { - // 閭�璇锋垚鍔� + // 閭�璇锋垚鍔� - 鍒告縺娲荤敓鏁� + LogHelper.test("doThreeSaleUserCouponJob-" + threeSale.getId()); - // TODO 鍒告縺娲荤敓鏁� - // threeSale.getBoss().getId(); + Long bossId = threeSale.getBoss().getId(); + // 涓嬬骇鏄电О + String workerNickName = userInfoService + .selectByPKey(threeSale.getWorker().getId()).getNickName(); + + userSystemCouponService.activatedWelfareFreeCoupon(bossId, + workerNickName); } } ThreeSaleCMQManager.getInstance() -- Gitblit v1.8.0