admin
2020-04-15 ee5c8055b1c0dd7c67a9025a76b10bd287c93d9a
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -30,6 +30,7 @@
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.order.CommonOrderGoods;
import com.yeshi.fanli.entity.order.HongBaoOrder;
@@ -205,54 +206,21 @@
                  userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
                        commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
                        commonOrder.getThirdCreateTime());
                  break;
               case HongBaoV2.TYPE_ERJI:
                  userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,    commonOrder.getPayment(), money,
                        goodsCount,  commonOrder.getState(), commonOrder.getThirdCreateTime());
                  break;
               case HongBaoV2.TYPE_SHARE_YIJI:
                  userOrderMsgNotificationService.orderShareFirstLevelStatistic(uid, orderId, orderType,
                        commonOrder.getPayment(), money, goodsCount, state, notify.getBeizhu());
                  userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
                        commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
                        commonOrder.getThirdCreateTime());
               case HongBaoV2.TYPE_SHARE_ERJI:
                  userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,    commonOrder.getPayment(), money,
                        goodsCount,  commonOrder.getState(), commonOrder.getThirdCreateTime());
                  break;
               }
            }
         }
         // 添加新版本通知
         if (!hasAdd) {
            Iterator<Integer> its = notificationMap.keySet().iterator();
            while (its.hasNext()) {
               Integer t = its.next();
               HongBaoV2 notify = notificationMap.get(t).getHongBaoV2();
               CommonOrder commonOrder = notificationMap.get(t).getCommonOrder();
               String orderId = commonOrderList.get(0).getOrderNo();
               Long uid = notify.getUserInfo().getId();
               BigDecimal money = notify.getMoney();
               switch (t) {
               case HongBaoV2.TYPE_ZIGOU:
                  userOrderMsgNotificationService.orderFanLiStateChanged(uid, orderId, orderType,
                        commonOrder.getPayment(), money, state);
                  break;
               case HongBaoV2.TYPE_SHARE_GOODS:
                  userOrderMsgNotificationService.orderShareStateChanged(uid, orderId, orderType,
                        commonOrder.getPayment(), money, state);
                  break;
               case HongBaoV2.TYPE_YIJI:
                  userOrderMsgNotificationService.orderInviteStateChanged(uid, orderId, orderType,
                        commonOrder.getPayment(), money, state);
                  break;
               case HongBaoV2.TYPE_ERJI:
                  userOrderMsgNotificationService.orderInviteStateChanged(uid, orderId, orderType,
                        commonOrder.getPayment(), money, state);
                  break;
               case HongBaoV2.TYPE_SHARE_YIJI:
                  userOrderMsgNotificationService.orderShareFirstLevelStateChanged(uid, orderId, orderType,
                        commonOrder.getPayment(), money, state);
               }
            }
         }
@@ -296,7 +264,7 @@
         return false;
      if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
         BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
         BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
         // 免单处理
         boolean mianDan = false;
         List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(Constant.SOURCE_TYPE_TAOBAO,
@@ -550,7 +518,7 @@
               && commonOrder.getSourcePosition().equalsIgnoreCase(TaoBaoConstant.TAOBAO_TLJ_RELATION_PID_DEFAULT))
            fanliRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime());
         else
            fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
            fanliRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
         List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
               .listByOrderIdAndUid(commonOrder.getUserInfo().getId(), commonOrder.getOrderNo());
@@ -674,7 +642,7 @@
   private void saveHongBao(CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap)
         throws HongBaoException, UserAccountException {
      if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
         BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
         BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
         // 查询是否有免单计划
         BigDecimal mianDanMoney = null;
         if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_FK) {
@@ -889,7 +857,7 @@
               && commonOrder.getSourcePosition().equalsIgnoreCase(TaoBaoConstant.TAOBAO_TLJ_RELATION_PID_DEFAULT))// 来自于淘礼金的分享
            shareRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime());
         else
            shareRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
            shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
         // 判断订单分享活动是否开启
         if ("1".equalsIgnoreCase(configService.get(ConfigKeyEnum.shareGoodsActivityOpen.getKey()))) {