Administrator
2020-02-24 09417e97672be66c5e312b10f23a9e30da3acb97
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java
@@ -30,6 +30,7 @@
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
@@ -90,6 +91,10 @@
   @Resource
   private IntegralGetService integralGetService;
   @Resource
   private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
   private void doTaoLiJinBuy(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
      JSONObject data = new JSONObject();
@@ -127,6 +132,7 @@
      integralGetService.addTaoLiJinBuy(uid, auctionId);
   }
   /**
    * 获取淘宝的分享链接
@@ -183,7 +189,7 @@
         doTaoLiJinBuy(acceptData, uid, auctionId, out);
         return;
      }
      ClientTBPid clientTBPid = null;
      String dpid = null;
@@ -239,16 +245,8 @@
         // 是返利商品库的商品
         if (specialConvert) {
            if (!StringUtil.isNullOrEmpty(specialId)) {
               if (source != null && "taolijin".equals(source)) {
                  boolean isNewUser = userInfoExtraService.isNewUser(uid);
                  if (isNewUser) {
                     // 判定为老用户:
                     // 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
                     long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
                     if (countRecord == 0) {
                        taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId, null);
                     }
                  }
               if (source != null && "taolijin_free_buy".equals(source)) {
                  taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId, null);
               }
               if (taoBaoLink == null) {
@@ -276,17 +274,9 @@
               LogHelper.errorDetailInfo(e, "uid:" + uid, null);
            }
            if (!StringUtil.isNullOrEmpty(relationId)) {//
               if (source != null && "taolijin".equals(source)) {
                  boolean isNewUser = userInfoExtraService.isNewUser(uid);
                  if (isNewUser) {
                     // 判定为老用户:
                     // 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
                     long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
                     if (countRecord == 0) {
                        taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId,
               if (source != null && "taolijin_free_buy".equals(source)) {
                  taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId,
                              TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID);
                     }
                  }
               } else {
                  taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId,
                        TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID);
@@ -316,6 +306,12 @@
         // 获得金币
         integralGetService.addCouponRebate(uid);
      } catch (ShareGoodsException e) {
         if (e.getCode() == 1001 || e.getCode() == 1002) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
         } else {
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
         }
      } catch (Exception e) {
         LogHelper.errorDetailInfo(e);