From a489609934155d3a9417ebfd315afbadd1d9b95f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 19 三月 2019 12:21:32 +0800
Subject: [PATCH] 删除ExtractRecordDao
---
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java | 116 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 71 insertions(+), 45 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 f574aa2..a75cd85 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
@@ -16,13 +16,14 @@
import org.yeshi.utils.tencentcloud.entity.COSInitParams;
import com.yeshi.fanli.entity.bus.user.AlipayTransferResultInfo;
-import com.yeshi.fanli.entity.bus.user.HongBao;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
+import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.push.PushQueueRecord;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
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) {
@@ -86,11 +94,11 @@
if (Constant.IS_TASK) {
doExtractResult();// 澶勭悊鎻愮幇缁撴灉
doTaoBaoOrders();// 澶勭悊娣樺疂璁㈠崟
- doOrderFanLi();// 澶勭悊璁㈠崟杩斿埄
- doOrderFanLiNew();//鏂扮増杩斿埄
+ doOrderFanLiNew();// 鏂扮増杩斿埄
doOrderTiChengFanLi();// 澶勭悊璁㈠崟鎻愭垚杩斿埄
doWeiQuanOrder();// 澶勭悊缁存潈璁㈠崟
doPushIOS();// 澶勭悊鍙戦�両OS娑堟伅
+ doThreeSaleUserCouponJob();// 澶勭悊閭�璇烽槦鍒�
} else if (!Constant.IS_TEST) {
initScheduler();// 鍚姩瀹氭椂浠诲姟
// doUpdateGoodsJob();
@@ -181,47 +189,6 @@
}
/**
- * 澶勭悊娣樺疂璁㈠崟杩斿埄
- */
- public void doOrderFanLi() {
- executor.execute(new Runnable() {
- @Override
- public void run() {
- while (true) {
- try {
- Map<String, HongBao> map = CMQManager.getInstance().consumeFanLiMsg(16);
- if (map != null) {
- Iterator<String> its = map.keySet().iterator();
- while (its.hasNext()) {
- String handler = its.next();
- try {
- orderProcessService.fanli(map.get(handler));
- CMQManager.getInstance().deleteFanLiMsg(handler);
- } catch (TaoBaoWeiQuanException e) {
- try {
- LogHelper.errorDetailInfo(e);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- } catch (Exception e) {
- try {
- LogHelper.errorDetailInfo(e);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
- }
- }
-
- } catch (Exception e) {
-
- }
- }
- }
- });
- }
-
- /**
* 澶勭悊鏂扮増娣樺疂璁㈠崟杩斿埄
*/
public void doOrderFanLiNew() {
@@ -246,7 +213,7 @@
}
} catch (Exception e) {
try {
- LogHelper.errorDetailInfo(e);
+ LogHelper.errorDetailInfo(e, "HongBaoV2-ID:" + map.get(handler).getId(), "");
} catch (Exception e1) {
e1.printStackTrace();
}
@@ -429,6 +396,65 @@
}
}
});
+ }
+
+ /**
+ * 閭�璇峰叧绯诲彉鍖栧悗鍒哥殑鏇存柊
+ */
+ public void doThreeSaleUserCouponJob() {
+
+ // 閲囩敤2涓嚎绋嬪仛鏇存柊
+ for (int i = 0; i < 2; i++)
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+
+ while (true) {
+ try {
+ Map<String, ThreeSale> map = ThreeSaleCMQManager.getInstance()
+ .consumeQueueMsg(ThreeSaleCMQManager.QUEUE_USER_COUPON, 16);
+ if (map != null) {
+
+ Iterator<String> its = map.keySet().iterator();
+ while (its.hasNext()) {
+ 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());
+
+ Long bossId = threeSale.getBoss().getId();
+ // 涓嬬骇鏄电О
+
+ String workerNickName = userInfoService
+ .selectByPKey(threeSale.getWorker().getId()).getNickName();
+
+ userSystemCouponService.activatedWelfareFreeCoupon(bossId,
+ workerNickName);
+ }
+ }
+ ThreeSaleCMQManager.getInstance()
+ .deleteQueueMsg(ThreeSaleCMQManager.QUEUE_USER_COUPON, key);
+ } catch (Exception e) {
+ try {
+ LogHelper.errorDetailInfo(e);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ LogHelper.error("鏇存柊鍟嗗搧鍑洪敊:" + e.getMessage());
+
+ }
+ }
+ }
+ });
}
}
--
Gitblit v1.8.0