From 972d3bc71115ec977dccf835fbcd148da3bcc86c Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 03 九月 2019 16:41:49 +0800 Subject: [PATCH] 统计可用的免单券数量-countUsableFreeCouponForBuy --- fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 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 e0b5fca..1879829 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java @@ -27,10 +27,11 @@ import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.entity.taobao.TaoBaoOrder; import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; -import com.yeshi.fanli.exception.TaoBaoWeiQuanException; +import com.yeshi.fanli.exception.order.TaoBaoWeiQuanException; import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service; import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce; +import com.yeshi.fanli.service.inter.integral.IntegralGetService; import com.yeshi.fanli.service.inter.jd.JDOrderService; import com.yeshi.fanli.service.inter.lable.BoutiqueAutoRuleService; import com.yeshi.fanli.service.inter.lable.LabelService; @@ -107,6 +108,9 @@ @Resource private HongBaoV2Service hongBaoV2Service; + @Resource + private IntegralGetService integralGetService; + private static boolean isInited = false; public void onApplicationEvent(ContextRefreshedEvent arg0) { @@ -141,6 +145,7 @@ doJDOrderJob();// 浜笢璁㈠崟澶勭悊 doPDDOrderJob();// 鎷煎澶氳鍗曞鐞� doImportantTaoBaoGoodsUpdateJob();// 娣樺疂閲嶈鍟嗗搧鐨勪俊鎭洿鏂� + doHongBaoRecieveIntegralGetJob();// 杩斿埄鍒拌处锛岄噾甯佸鍔� } } @@ -708,16 +713,19 @@ Long hongBaoId = map.get(key); try { HongBaoV2 hongBaoV2 = hongBaoV2Service.selectByPrimaryKey(hongBaoId); - if (hongBaoV2.getType() == HongBaoV2.TYPE_ZIGOU) {// 鑷喘 - // TODO 娣诲姞鍔犻噾甯佷簨浠� - } else if (hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_GOODS) {// 鍒嗕韩璧� - // TODO 娣诲姞鍔犻噾甯佷簨浠� - } else if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI - || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) {// 涓�绾ч個璇疯禋 - // TODO 娣诲姞鍔犻噾甯佷簨浠� - } else if (hongBaoV2.getType() == HongBaoV2.TYPE_ERJI - || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_ERJI) {// 浜岀骇閭�璇疯禋 - // TODO 娣诲姞鍔犻噾甯佷簨浠� + if (hongBaoV2 != null && hongBaoV2.getState() == HongBaoV2.STATE_YILINGQU + && hongBaoV2.getMoney().compareTo(new BigDecimal(0)) > 0) { + if (hongBaoV2.getType() == HongBaoV2.TYPE_ZIGOU) {// 鑷喘 + integralGetService.addRebateOrder(hongBaoV2.getUserInfo().getId()); + } else if (hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_GOODS) {// 鍒嗕韩璧� + integralGetService.addShareOrder(hongBaoV2.getUserInfo().getId()); + } else if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI + || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) {// 涓�绾ч個璇疯禋 + integralGetService.addInviteOrderLevelOne(hongBaoV2.getUserInfo().getId()); + } else if (hongBaoV2.getType() == HongBaoV2.TYPE_ERJI + || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_ERJI) {// 浜岀骇閭�璇疯禋 + integralGetService.addInviteOrderLevelOne(hongBaoV2.getUserInfo().getId()); + } } HongBaoRecieveCMQManager.getInstance() .deleteQueueMsg(HongBaoRecieveCMQManager.QUEUE_INTEGRAL, key); -- Gitblit v1.8.0