yujian
2019-03-14 e3732fa01883aa7a93f7398e39b01b0009155b06
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.push;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -229,7 +230,13 @@
      if (goodsList == null || goodsList.size() == 0) {
         throw new PushException(1, "推送无商品,请完善数据");
      }
      List<String> listVersion = null;
      String versions = pushGoods.getVersions();
      if (versions != null && versions.trim().length() > 0) {
         listVersion  = Arrays.asList(versions.split(","));
      }
      if (goodsList.size() == 1) {
         /* 单个商品推送: 直接处理为商品信息  */
         PushGoodsGroup pushGoodsGroup = goodsList.get(0);
@@ -240,9 +247,9 @@
         Long goodsId = commonGoods.getGoodsId();
         String url = "https://item.taobao.com/item.htm?id=" + goodsId;
         pushService.pushGoods(pushGoods.getUid(), url, alertTitle, alertContent, listVersion);
         
         pushService.pushGoods(pushGoods.getUid(), url, alertTitle, alertContent);
      } else {
         /*   多个商品推送    */
         String url = configService.get("push_goods_details");
@@ -252,7 +259,7 @@
         // 生成链接
         url = url + "?id=" + id;
         pushService.pushUrl(pushGoods.getUid(), url, alertTitle, alertContent);
         pushService.pushUrl(pushGoods.getUid(), url, alertTitle, alertContent, listVersion);
      }
      
      // 已推送