admin
2019-02-15 c12b6ec43f6c79426d6f2337f903d3c0a225e9a5
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java
@@ -574,34 +574,31 @@
               hongBaoV2Mapper.updateByPrimaryKeySelective(childUpdate);
               // 加入通知
               if (notificationMap.get(type) == null) {
               if (notificationMap.get(child.getType()) == null) {
                  HongBaoV2 tempHongBao = new HongBaoV2(child.getId());
                  tempHongBao.setUserInfo(child.getUserInfo());
                  tempHongBao.setMoney(child.getMoney());
                  CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
                  tempCommonOrder.setPayment(commonOrder.getPayment());
                  notificationMap.put(type, new HongBaoOrder(tempCommonOrder, tempHongBao));
                  notificationMap.put(child.getType(), new HongBaoOrder(tempCommonOrder, tempHongBao));
               } else {
                  // 增加付款金额与资金
                  HongBaoOrder tempHongBaoOrder = notificationMap.get(type);
                  HongBaoOrder tempHongBaoOrder = notificationMap.get(child.getType());
                  tempHongBaoOrder.getCommonOrder().setPayment(
                        tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
                  tempHongBaoOrder.getHongBaoV2()
                        .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(child.getMoney()));
                  notificationMap.put(type, tempHongBaoOrder);
                  notificationMap.put(child.getType(), tempHongBaoOrder);
               }
            }
      } else if (type == HongBaoV2.TYPE_SHARE_GOODS) {
         BigDecimal fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
         Order order = orderMapper.selectOrderByOrderId(commonOrder.getOrderNo());
         if (order != null) {
            List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
                  .listByOrderIdAndUid(commonOrder.getUserInfo().getId(), order.getId());
            if (list != null && list.size() > 0) {
               fanliRate = list.get(0).getShareRate();
            }
         List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
               .listByOrderIdAndUid(commonOrder.getUserInfo().getId(), commonOrder.getOrderNo());
         if (list != null && list.size() > 0) {
            fanliRate = list.get(0).getShareRate();
         }
         HongBaoV2 hongBao = new HongBaoV2(hongBaoOrder.getHongBaoV2().getId());
@@ -855,18 +852,15 @@
               if (taoBaoOrderList != null && taoBaoOrderList.size() > 0
                     && !StringUtil.isNullOrEmpty(taoBaoOrderList.get(0).getRelationId())) {
                  if (shareGoodsActivityOrderService.listByUid(commonOrder.getUserInfo().getId()).size() < 1) {
                     Order order = orderMapper.selectOrderByOrderId(commonOrder.getOrderNo());
                     if (order != null) {
                        shareRate = new BigDecimal(hongBaoManageService.get("share_activity_proportion"));
                     shareRate = new BigDecimal(hongBaoManageService.get("share_activity_proportion"));
                     try {
                        shareGoodsActivityOrderService.addShareGoodsActivityOrder(
                              commonOrder.getUserInfo().getId(), shareRate, commonOrder.getOrderNo());
                     } catch (ShareGoodsActivityOrderException e) {
                        try {
                           shareGoodsActivityOrderService.addShareGoodsActivityOrder(
                                 commonOrder.getUserInfo().getId(), shareRate, order);
                        } catch (ShareGoodsActivityOrderException e) {
                           try {
                              LogHelper.errorDetailInfo(e);
                           } catch (Exception e1) {
                              e1.printStackTrace();
                           }
                           LogHelper.errorDetailInfo(e);
                        } catch (Exception e1) {
                           e1.printStackTrace();
                        }
                     }
                  }