From 6dfb4599cee5c19f4d1c5cc344a4f84de1c1633c Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期一, 16 十二月 2019 15:26:57 +0800 Subject: [PATCH] 冲突信息 --- fanli/src/main/java/com/yeshi/fanli/service/manger/HongBaoV2AddManager.java | 34 ++++------------------------------ 1 files changed, 4 insertions(+), 30 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/manger/HongBaoV2AddManager.java b/fanli/src/main/java/com/yeshi/fanli/service/manger/HongBaoV2AddManager.java index 135549c..dcc02a3 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/manger/HongBaoV2AddManager.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/manger/HongBaoV2AddManager.java @@ -28,7 +28,6 @@ import com.yeshi.fanli.entity.order.HongBaoOrder; import com.yeshi.fanli.exception.order.HongBaoException; import com.yeshi.fanli.exception.user.UserAccountException; -import com.yeshi.fanli.exception.user.UserInfoException; import com.yeshi.fanli.service.inter.order.CommonOrderService; import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService; @@ -78,32 +77,6 @@ @Resource private UserVIPInfoService userVIPInfoService; - // 淇濆瓨绾㈠寘 - public void saveHongBao1(CommonOrder commonOrder, int commonOrderType) throws HongBaoException, UserInfoException { - // 鏌ヨ涓�2绾х殑淇℃伅 - long uid = commonOrder.getUserInfo().getId(); - UserInfo user = userInfoService.selectAvailableByPrimaryKey(uid); - if (user == null) - throw new UserInfoException(1, "鐢ㄦ埛涓嶅瓨鍦�"); - - UserInfo lastUser = threeSaleSerivce.getBoss(uid); - UserInfo superLastUser = null; - if (lastUser != null) { - lastUser = userInfoService.selectAvailableByPrimaryKey(lastUser.getId()); - if (lastUser != null) - superLastUser = threeSaleSerivce.getBoss(lastUser.getId()); - if (superLastUser != null) - superLastUser = userInfoService.selectAvailableByPrimaryKey(superLastUser.getId()); - } - - if (commonOrderType == CommonOrder.ORDER_TYPE_ZIGOU) { - // 淇濆瓨绾㈠寘淇℃伅 - - } else if (commonOrderType == CommonOrder.ORDER_TYPE_SHARE) { - - } - } - /** * 娣诲姞绾㈠寘淇℃伅 * @@ -123,7 +96,6 @@ boolean hasAdd = false; boolean hasUpdate = false; Set<Integer> stateSet = new HashSet<>();// 璁㈠崟鐘舵�丼et - boolean isVIP = userVIPInfoService.isVIP(commonOrderList.get(0).getUserInfo().getId()); for (CommonOrder commonOrder : commonOrderList) { stateSet.add(commonOrder.getState()); goodsCount += commonOrder.getCount(); @@ -131,7 +103,7 @@ throw new HongBaoException(1, "璁㈠崟淇℃伅涓嶅畬鏁�"); HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(commonOrder.getId()); if (hongBaoOrder == null) { - saveHongBao(commonOrder, type, isVIP, notificationMap); + saveHongBao(commonOrder, type, notificationMap); hasAdd = true; } else { boolean update = updateHongBao(hongBaoOrder, commonOrder, type, notificationMap); @@ -458,8 +430,10 @@ } @Transactional(rollbackFor = Exception.class) - private void saveHongBao(CommonOrder commonOrder, int type, boolean vip, Map<Integer, HongBaoOrder> notificationMap) + private void saveHongBao(CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException { + + boolean vip = commonOrder.getUrank() != null && commonOrder.getUrank() == 100; if (type == HongBaoV2.TYPE_ZIGOU) {// 鑾峰彇鑷喘鐨勮繑鍒╂瘮渚� BigDecimal fanliRate = hongBaoManageService .getRate(new OrderHongBaoRateParams(0, type, false, vip, commonOrder.getThirdCreateTime())); -- Gitblit v1.8.0