admin
2019-06-25 cdeafab666da32825c9943933edc63dff6c17d02
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java
@@ -34,6 +34,7 @@
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;
@@ -78,6 +79,8 @@
   @Resource
   private UserOtherMsgNotificationService userOtherMsgNotificationService;
   
   @Resource
   private UserInfoExtraService userInfoExtraService;
   
   
   @Override
@@ -108,7 +111,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 +142,21 @@
         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 {
         perface = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
      }
      
      return createUserTaoLiJin(2, uid, goods.getAuctionId(), perface, totalNum, name, sendStartTime,
               sendEndTime, null, useEndTime);