admin
2019-03-15 c9f28b430799cc8d40c7a7d99fd0f0eeecff6a5c
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java
@@ -46,14 +46,13 @@
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.common.ImageInfo;
import com.yeshi.fanli.entity.common.JumpDetail;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.goods.ScanHistoryV2;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.entity.taobao.PidUser;
@@ -72,11 +71,11 @@
import com.yeshi.fanli.exception.user.UserCustomSettingsException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.JumpDetailService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.RecommendBannerService;
@@ -99,7 +98,6 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.ShareManageService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
@@ -129,7 +127,7 @@
   private RecommendBannerService recommendService;
   @Resource
   private SystemService systemService;
   private BusinessSystemService businessSystemService;
   @Resource
   private SuperRecommendBannerService superRecommendBannerService;
@@ -148,9 +146,6 @@
   @Resource
   private ScanHistoryV2Service scanHistoryV2Service;
   @Resource
   private ShareManageService shareManageService;
   @Resource
   private ConfigService configService;
@@ -246,7 +241,7 @@
         index = 0;
      }
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
         return;
@@ -324,7 +319,7 @@
   @RequestMapping(value = "getHonestList")
   public void getHonestList(AcceptData acceptData, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      List<Honest> honestList = null;
      List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
      if ((Integer.parseInt(acceptData.getVersion()) >= 20 && "android".equalsIgnoreCase(acceptData.getPlatform()))
@@ -491,7 +486,7 @@
   @RequestMapping(value = "getrecommendspecial")
   public void getRecommendSpecial(AcceptData acceptData, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
@@ -533,7 +528,7 @@
   @RequestMapping(value = "guessLike", method = RequestMethod.POST)
   public void guessLike(AcceptData acceptData, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
@@ -571,7 +566,7 @@
   @RequestMapping(value = "getrecommendbanner")
   public void getRecommendBanner(AcceptData acceptData, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      JSONObject json = new JSONObject();
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
@@ -638,7 +633,7 @@
         out.print(JsonUtil.loadFalseResult(1, "请上传id"));
         return;
      }
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
@@ -674,7 +669,7 @@
            clientTBPid = tbPidService.getIOSDefault();
         }
      }
      TaoBaoGoodsBrief tb = null;
      try {
         TaoKeAppInfo app = new TaoKeAppInfo();
@@ -796,7 +791,7 @@
         out.print(JsonUtil.loadFalseResult(1, "请上传id"));
         return;
      }
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
@@ -1163,7 +1158,7 @@
   // 根据商品获取推荐
   @RequestMapping(value = "getgoodsrecommend", method = RequestMethod.POST)
   public void getGoodsRecommend(final AcceptData acceptData, long id, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
         return;
@@ -1299,7 +1294,7 @@
         return;
      }
      page = page + 1;
      System sys = systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem sys = businessSystemService.getBusinessSystem(acceptData.getPlatform(), acceptData.getPackages());
      if (sys == null) {
         out.print(JsonUtil.loadFalseResult(1, "不存在该系统"));
         return;
@@ -1344,7 +1339,7 @@
   @RequestMapping(value = "deletescanhistory", method = RequestMethod.POST)
   public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids, PrintWriter out) {
      System sys = systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem sys = businessSystemService.getBusinessSystem(acceptData.getPlatform(), acceptData.getPackages());
      if (sys == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
@@ -1509,7 +1504,7 @@
   @RequestMapping(value = "getRecommendInfo")
   public void getRecommendHomeInfo(AcceptData acceptData, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
         return;
@@ -1616,7 +1611,7 @@
   public void getNewRecommendInfo(AcceptData acceptData, Long uid, String specialCard, String swiperCard,
         PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
         return;
@@ -1754,7 +1749,7 @@
         return;
      }
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
         return;
@@ -1783,7 +1778,6 @@
         }
      } else {
         // 用户已经登录
         TBPid tbPid = null;
         if (acceptData.getPlatform().equalsIgnoreCase("android")) {
@@ -1895,6 +1889,7 @@
      TaoBaoGoodsBrief tb = null;
      if (goodsList.size() > 0) {
         tb = goodsList.get(0);
      }
      if (tb == null) {
@@ -1974,6 +1969,12 @@
            hongBao = "¥" + quanPrice.toString();
         }
         String token = "";
         if (!StringUtil.isNullOrEmpty(tb.getCouponLink())) {
            token = TaoKeApiUtil.getTKToken(tb.getPictUrl(), tb.getTitle(), tb.getCouponLink());
            tb.setCouponLinkTaoToken(token);
         }
         // 服务端转链
         if (convertInServer && !StringUtil.isNullOrEmpty(tb.getCouponLink())) {
            couponInfo.put("couponUrl", tb.getCouponLink());
@@ -1985,6 +1986,8 @@
         couponInfo.put("couponAmount", NumberUtil.subZeroAndDot(tb.getCouponAmount().toString()));
         couponInfo.put("couponTime", "使用期限:" + tb.getCouponEffectiveStartTime().replace("-", ".") + "-"
               + tb.getCouponEffectiveEndTime().replace("-", "."));
         // 券的口令
         couponInfo.put("couponToken", token);
         goods.put("couponInfo", couponInfo);
         if (tb.getBiz30day() >= 1000) {
@@ -2041,10 +2044,14 @@
      data.put("storageState", storageState);
      data.put("shareUrl", shareUrl);
      data.put("goods", goods);
      data.put("shareUsers", listShareUser);
      data.put("couponUsers", listCouponUser);
      data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
      //商品链接
      data.put("h5Url", String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePath(), tb.getAuctionId() + ""));
      // 取消分享活动
      // if (!StringUtil.isNullOrEmpty(uid)
@@ -2140,7 +2147,7 @@
   @RequestMapping(value = "getgoodsderivation", method = RequestMethod.POST)
   public void getRecommendGoods(AcceptData acceptData, long id, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
         return;
@@ -2231,7 +2238,7 @@
   @RequestMapping(value = "getSpecialActivities")
   public void getSpecialActivities(AcceptData acceptData, Long uid, PrintWriter out) {
      System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
         return;