admin
2020-04-13 dd5b15229cb15459fa7c31ccea77dac28cbfafbd
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -147,7 +147,7 @@
      return hongBaoV2Mapper.selectByPrimaryKey(id);
   }
   @Transactional(rollbackFor=Exception.class)
   @Transactional(rollbackFor = Exception.class)
   @Override
   public int addHongBao(List<CommonOrder> commonOrderList, int type) throws HongBaoException, UserAccountException {
      Set<Integer> stateSet = new HashSet<>();// 订单状态Set
@@ -190,63 +190,36 @@
               switch (t) {
               case HongBaoV2.TYPE_ZIGOU:
                  userOrderMsgNotificationService.orderFanLiStatistic(uid, orderId, orderType,
                        commonOrder.getPayment(), money, goodsCount, state);
                        commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
                        commonOrder.getThirdCreateTime());
                  break;
               case HongBaoV2.TYPE_SHARE_GOODS:
                  userOrderMsgNotificationService.orderShareStatistic(uid, orderId, orderType,
                        commonOrder.getPayment(), money, goodsCount, state);
                        commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
                        commonOrder.getThirdCreateTime());
                  break;
               case HongBaoV2.TYPE_YIJI:
                  userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
                        commonOrder.getPayment(), money, goodsCount, state);
                        commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
                        commonOrder.getThirdCreateTime());
                  break;
               case HongBaoV2.TYPE_ERJI:
                  userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
                        commonOrder.getPayment(), money, goodsCount, state);
                  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);
               }
            }
         }
@@ -277,7 +250,7 @@
      return CommonOrder.STATE_SX;
   }
   @Transactional(rollbackFor=Exception.class)
   @Transactional(rollbackFor = Exception.class)
   private boolean updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type,
         Map<Integer, HongBaoOrder> notificationMap) throws HongBaoException, UserAccountException {
      System.out.println(commonOrder.getOrderNo());
@@ -664,7 +637,7 @@
      return true;
   }
   @Transactional(rollbackFor=Exception.class)
   @Transactional(rollbackFor = Exception.class)
   private void saveHongBao(CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap)
         throws HongBaoException, UserAccountException {
      if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
@@ -1177,8 +1150,7 @@
   public List<HongBaoV2> listByIds(List<Long> idList) {
      return hongBaoV2Mapper.listByIds(idList);
   }
   @Override
   public List<HongBaoDTO> listByOrderTradeId(String tradeId) {
      return hongBaoV2Mapper.listByOrderTradeId(tradeId);