yujian
2019-11-04 01407e36f8a1d46e065cdcfe14629540dbd6b921
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java
@@ -422,7 +422,7 @@
   @Transactional
   @Override
   public void ziGouSettle(String orderId, int sourceType,String taskKey) throws OrderMoneySettleException {
   public void ziGouSettle(String orderId, int sourceType, String taskKey) throws OrderMoneySettleException {
      // 查询同一订单号的红包
      List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(sourceType, orderId);
      List<HongBaoV2> hongBaoList = new ArrayList<>();
@@ -466,6 +466,10 @@
         }
      }
      // if (userMoney.isEmpty()) {
      // throw new OrderMoneySettleException(1, "没有需要结算的订单");
      // }
      Iterator<Long> its = userMoney.keySet().iterator();
      while (its.hasNext()) {
@@ -486,8 +490,8 @@
         }
         userMoneyService.addUserMoney(uid, money, userMoneyDetail);
         List<Long> hbIdList=new ArrayList<>();
         List<Long> hbIdList = new ArrayList<>();
         // 添加资金明细与红包的映射关系
         for (HongBaoV2 v2 : userHongBao.get(uid)) {
            hbIdList.add(v2.getId());
@@ -498,7 +502,7 @@
               LogHelper.errorDetailInfo(e);
            }
         }
         //添加结算映射
         // 添加结算映射
         hongBaoV2SettleTempService.addTemp(hbIdList, taskKey);
         // 站内信+推送
@@ -539,10 +543,9 @@
         } else
            throw new OrderMoneySettleException(e.getCode(), "维权处理出错:" + e.getMsg());
      }
      //添加结算映射
      // 添加结算映射
   }
   private HongBaoV2 filterWeiQuanINGHongBao(HongBaoV2 hongBao) {
@@ -961,7 +964,7 @@
         for (HongBaoV2SettleTemp temp : list) {
            Long hongBaoId = temp.getHongBaoId();
            HongBaoV2 hongBao = hongBaoV2Mapper.selectByPrimaryKey(hongBaoId);
            if (sourceType != null)
            if (hongBao != null)
               sourceType = hongBao.getOrderType();
            if (hongBao.getParent() != null)
               hongBao = hongBao.getParent();
@@ -1018,7 +1021,9 @@
            }
            // 添加资金
            userMoneyService.addUserMoney(uid, totalMoney, userMoneyDetail);
            // TODO 添加消息
            // 添加消息
            userMoneyMsgNotificationService.inviteOrderSubSidy(uid, new Date(), "系统自动下发", totalMoney,
                  userInfoMapper.selectAvailableByPrimaryKey(uid).getMyHongBao());
         }
      }
   }