From 3ac30b4c17cf071ce9c66a59c069ab83efae6d2d Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期一, 14 十月 2019 17:44:13 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java | 128 ++++++++++++++++++++++-------------------- 1 files changed, 66 insertions(+), 62 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 7e9c422..29292f9 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java @@ -172,9 +172,9 @@ doJDOrderJob();// 浜笢璁㈠崟澶勭悊 doPDDOrderJob();// 鎷煎澶氳鍗曞鐞� doImportantTaoBaoGoodsUpdateJob();// 娣樺疂閲嶈鍟嗗搧鐨勪俊鎭洿鏂� - doHongBaoRecieveIntegralGetJob();// 杩斿埄鍒拌处锛岄噾甯佸鍔� + // doHongBaoRecieveIntegralGetJob();// 杩斿埄鍒拌处锛岄噾甯佸鍔� // doPlaceOrderIntegralJob();// 涓嬪崟璧犻�侀噾甯佷换鍔� - doDouYinDeviceActiveJob();// 鎶栭煶璁惧婵�娲诲箍鍛婄洃娴� + // doDouYinDeviceActiveJob();// 鎶栭煶璁惧婵�娲诲箍鍛婄洃娴� } } @@ -791,77 +791,81 @@ Map<String, Order> map = PlaceOrderCMQManager.getInstance() .consumeQueueMsg(PlaceOrderCMQManager.QUEUE_INTEGRAL, 16); if (map != null) { - // 鏄惁鏄鍗� + for (Iterator<String> its = map.keySet().iterator(); its.hasNext();) { try { String key = its.next(); Order order = map.get(key); - // 缁熻璁㈠崟涓嬬殑鐢ㄦ埛鎵�鑾峰緱鐨勮繑鍒╅噾棰� - List<CommonOrder> list = commonOrderService - .listBySourceTypeAndOrderId(order.getOrderType(), order.getOrderId()); - Map<Long, BigDecimal> hongBaoMoney = new HashMap<>(); - if (list != null) - for (CommonOrder commonOrder : list) { - HongBaoOrder hongBaoOrder = hongBaoOrderService - .selectDetailByCommonOrderId(commonOrder.getId()); - if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null) { - Long mainUid = hongBaoOrder.getHongBaoV2().getUserInfo().getId(); - if (hongBaoMoney.get(mainUid) == null) - hongBaoMoney.put(mainUid, new BigDecimal(0)); - hongBaoMoney.put(mainUid, hongBaoMoney.get(mainUid) - .add(hongBaoOrder.getHongBaoV2().getMoney())); - // 鏌ヨ涓婄骇 - List<HongBaoV2> children = hongBaoV2Service - .listChildrenById(hongBaoOrder.getHongBaoV2().getId()); - if (children != null) { - for (HongBaoV2 hongBao : children) { - Long uid = hongBao.getUserInfo().getId(); - if (hongBaoMoney.get(uid) == null) - hongBaoMoney.put(uid, new BigDecimal(0)); - hongBaoMoney.put(uid, - hongBaoMoney.get(uid).add(hongBao.getMoney())); + // 鏄惁鏄鍗� + if (isFirstValidOrder(order.getOrderId(), order.getOrderType(), + order.getUserInfo().getId())) { + // 缁熻璁㈠崟涓嬬殑鐢ㄦ埛鎵�鑾峰緱鐨勮繑鍒╅噾棰� + List<CommonOrder> list = commonOrderService + .listBySourceTypeAndOrderId(order.getOrderType(), order.getOrderId()); + Map<Long, BigDecimal> hongBaoMoney = new HashMap<>(); + if (list != null) + for (CommonOrder commonOrder : list) { + HongBaoOrder hongBaoOrder = hongBaoOrderService + .selectDetailByCommonOrderId(commonOrder.getId()); + if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null) { + Long mainUid = hongBaoOrder.getHongBaoV2().getUserInfo().getId(); + if (hongBaoMoney.get(mainUid) == null) + hongBaoMoney.put(mainUid, new BigDecimal(0)); + hongBaoMoney.put(mainUid, hongBaoMoney.get(mainUid) + .add(hongBaoOrder.getHongBaoV2().getMoney())); + // 鏌ヨ涓婄骇 + List<HongBaoV2> children = hongBaoV2Service + .listChildrenById(hongBaoOrder.getHongBaoV2().getId()); + if (children != null) { + for (HongBaoV2 hongBao : children) { + Long uid = hongBao.getUserInfo().getId(); + if (hongBaoMoney.get(uid) == null) + hongBaoMoney.put(uid, new BigDecimal(0)); + hongBaoMoney.put(uid, + hongBaoMoney.get(uid).add(hongBao.getMoney())); + } } } } - } - if (isFirstValidOrder(order.getOrderId(), order.getOrderType(), - order.getUserInfo().getId())) {// 鏈夋晥鐨勯鍗� - if (hongBaoMoney.get(order.getUserInfo().getId()) == null || hongBaoMoney - .get(order.getUserInfo().getId()).compareTo(new BigDecimal("0")) <= 0) { - // 鍒嗕韩濂栭噾鏄�0 - integralTaskRecordService.firstShareOrderReward(order.getUserInfo().getId(), - null); - } - - // 鑾峰彇涓婁袱绾ф暟鎹� - UserInfo boss = threeSaleSerivce.getBoss(order.getUserInfo().getId()); - if (boss != null) {// 鍒ゆ柇涓婄骇鐨勭孩鍖� - if (hongBaoMoney.get(boss.getId()) == null - || hongBaoMoney.get(boss.getId()).compareTo(new BigDecimal("0")) <= 0) { - // 琛ュ伩閲戝竵 - integralTaskRecordService.firstSharerOrderRewardBoss(boss.getId(), - order.getUserInfo().getId(), null); - } - } - - } else {// 鑷喘璁㈠崟 - UserInfo boss = threeSaleSerivce.getBoss(order.getUserInfo().getId()); - if (boss != null) {// 鍒ゆ柇涓婄骇鐨勭孩鍖� - if (hongBaoMoney.get(boss.getId()) == null - || hongBaoMoney.get(boss.getId()).compareTo(new BigDecimal("0")) <= 0) { - // 琛ュ伩閲戝竵1绾� - integralTaskRecordService.firstRebateOrderRewardBoss(boss.getId(), - order.getUserInfo().getId(), null); + if (isFirstValidOrder(order.getOrderId(), order.getOrderType(), + order.getUserInfo().getId())) {// 鏈夋晥鐨勯鍗� + if (hongBaoMoney.get(order.getUserInfo().getId()) == null || hongBaoMoney + .get(order.getUserInfo().getId()).compareTo(new BigDecimal("0")) <= 0) { + // 鍒嗕韩濂栭噾鏄�0 + integralTaskRecordService.firstShareOrderReward(order.getUserInfo().getId(), + null); } - boss = threeSaleSerivce.getBoss(boss.getId()); + // 鑾峰彇涓婁袱绾ф暟鎹� + UserInfo boss = threeSaleSerivce.getBoss(order.getUserInfo().getId()); if (boss != null) {// 鍒ゆ柇涓婄骇鐨勭孩鍖� if (hongBaoMoney.get(boss.getId()) == null || hongBaoMoney.get(boss.getId()) .compareTo(new BigDecimal("0")) <= 0) { - // 琛ュ伩閲戝竵2绾� - integralTaskRecordService.firstRebateOrderRewardBossSuper(boss.getId(), + // 琛ュ伩閲戝竵 + integralTaskRecordService.firstSharerOrderRewardBoss(boss.getId(), order.getUserInfo().getId(), null); + } + } + + } else {// 鑷喘璁㈠崟 + UserInfo boss = threeSaleSerivce.getBoss(order.getUserInfo().getId()); + if (boss != null) {// 鍒ゆ柇涓婄骇鐨勭孩鍖� + if (hongBaoMoney.get(boss.getId()) == null || hongBaoMoney.get(boss.getId()) + .compareTo(new BigDecimal("0")) <= 0) { + // 琛ュ伩閲戝竵1绾� + integralTaskRecordService.firstRebateOrderRewardBoss(boss.getId(), + order.getUserInfo().getId(), null); + } + + boss = threeSaleSerivce.getBoss(boss.getId()); + if (boss != null) {// 鍒ゆ柇涓婄骇鐨勭孩鍖� + if (hongBaoMoney.get(boss.getId()) == null || hongBaoMoney + .get(boss.getId()).compareTo(new BigDecimal("0")) <= 0) { + // 琛ュ伩閲戝竵2绾� + integralTaskRecordService.firstRebateOrderRewardBossSuper( + boss.getId(), order.getUserInfo().getId(), null); + } } } } @@ -922,9 +926,9 @@ String key = its.next(); DouYinDeviceActiveQueueDTO active = map.get(key); if (active.getType() == DouYinDeviceActiveQueueDTO.TYPE_AD) {// 鎶栭煶 - DouYinClickEvent event = douYinClickEventService.selectByAid(active.getAid()); + DouYinClickEvent event = douYinClickEventService.selectByCallback(active.getCallback()); if (event != null) { - if (event.getOs() == 0) { + if (event.getOs() == 0 && !StringUtil.isNullOrEmpty(event.getUuid())) { DeviceActive deviceActive = deviceActiveService .getFirstActiveInfoByImei(event.getUuid()); if (deviceActive != null) { @@ -947,7 +951,7 @@ if (active.getPlatform() == 1) { DeviceActive deviceActive = deviceActiveService .getFirstActiveInfo(active.getDevice()); - if (deviceActive != null && deviceActive.getImei() != null) { + if (deviceActive != null && !StringUtil.isNullOrEmpty(deviceActive.getImei())) { DouYinClickEvent event = douYinClickEventService .selectByUuid(deviceActive.getImei()); if (event != null) {// 鍥炶皟 -- Gitblit v1.8.0