yujian
2019-06-26 020d940ae4e16f55f69cef3dd4c8dc0b9764af07
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java
@@ -29,16 +29,18 @@
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.factory.CommonGoodsFactory;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
@@ -73,11 +75,13 @@
   private UserTaoLiJinOriginService userTaoLiJinOriginService;
   
   @Resource
   private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
   private ConfigTaoLiJinService configTaoLiJinService;
   
   @Resource
   private UserOtherMsgNotificationService userOtherMsgNotificationService;
   
   @Resource
   private UserInfoExtraService userInfoExtraService;
   
   
   @Override
@@ -108,7 +112,8 @@
      } catch (ParseException e2) {
         e2.printStackTrace();
      }
      BigDecimal perface = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
      // 新人红包 自购一元
      BigDecimal perface = new BigDecimal(1);
      
      return createUserTaoLiJin(1, uid, goods.getAuctionId(), perface, 1, name, sendStartTime,
               sendEndTime, null, useEndTime);
@@ -138,7 +143,23 @@
         e2.printStackTrace();
      }
      
      BigDecimal perface = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
      boolean isNewUser = userInfoExtraService.isNewUser(uid);
      if (isNewUser) {
         // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
         long countRecord = userTaoLiJinRecordMapper.countRecordByUid(uid);
         if (countRecord > 0) {
            isNewUser = false;
         }
      }
      BigDecimal perface = null;
      if (isNewUser) {
         perface = new BigDecimal(1);
      } else {
         // 计算推广红包
         String warningRate = configTaoLiJinService.getValueByKey("warning_value");
         perface = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
    }
      
      return createUserTaoLiJin(2, uid, goods.getAuctionId(), perface, totalNum, name, sendStartTime,
               sendEndTime, null, useEndTime);
@@ -332,8 +353,6 @@
               } else {
                  userTaoLiJinRecordVO.setUserType(1);
               }
               listGoods.remove(i);
               break;
            }
         }