yujian
2020-07-01 ca0e816fe57482b8f43f22f7a0b6fe7c57a53f42
fanli/src/main/java/com/yeshi/fanli/job/goods/PullNewJob.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.yeshi.utils.DateUtil;
@@ -18,6 +19,7 @@
import com.yeshi.fanli.entity.goods.PullNewGoods;
import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
import com.yeshi.fanli.service.inter.goods.PullNewGoodsService;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
import com.yeshi.fanli.service.inter.user.UserRankingsService;
import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
@@ -27,6 +29,8 @@
   @Resource
   private UserRankingsService userRankingsService;
   @Resource
   private RedPackConfigService redPackConfigService;
   
   @Resource
   private PullNewGoodsService pullNewGoodsService;
@@ -45,10 +49,21 @@
      return ReturnT.SUCCESS;
   }
   @Scheduled(cron = "0 0/2 * * * ? ")
   private void addPullNewGoods2() {
      addPullNewGoods();
   }
   /**
    * 拉新商品
    */
   private void addPullNewGoods() {
      // 商品比例限制
       double limitRate =  Double.valueOf(redPackConfigService.getValueByKey("goods_reate_limit"));
       double  limitPrice =  Double.valueOf(redPackConfigService.getValueByKey("goods_pay_ment_limit"));
      Integer array[] = {3,4,5,6,7,8,9,10,11,12,15};
      for (Integer catId: array) {
         Integer minId = 1;
@@ -66,13 +81,13 @@
            for (HDKGoodsDetail goods : goodsList) {
               // 佣金比例大于50%
               if (goods.getTkrates() == null || goods.getTkrates() < 50)
               if (goods.getTkrates() == null || goods.getTkrates() < limitRate)
                  continue;
               // 是否存在券
               if (goods.getCouponmoney() == null || goods.getCouponmoney() <= 0)
                  continue;
               // 商品券后价大于9.9元
               if (goods.getItemendprice() == null || goods.getItemendprice() <= 9.9)
               if (goods.getItemendprice() == null || goods.getItemendprice() <= limitPrice)
                  continue;
               PullNewGoods pullNewGoods = new PullNewGoods();