admin
2019-07-23 009e25b40c04d0a66d6d6554c19e542f0e6f9d18
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -58,6 +58,7 @@
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.factory.goods.ShopInfoVOFactory;
@@ -70,7 +71,7 @@
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.goods.MoneyInfoVO;
import com.yeshi.fanli.vo.goods.OtherInfo;
import com.yeshi.fanli.vo.goods.ShareInfoVO;
import com.yeshi.fanli.vo.goods.ShareVO;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.tlj.ReduceHongBao;
import com.yeshi.fanli.vo.tlj.SpreadHongBao;
@@ -147,42 +148,8 @@
   @Resource
   private TLJBuyGoodsService tljBuyGoodsService;
   
   /**
    * 获取商品详情
    *
    * @param acceptData
    * @param id
    * @param source
    * @param uid
    * @param from
    * @param out
    */
   @RequestMapping(value = "getDetail", method = RequestMethod.POST)
   public void getDetail(AcceptData acceptData, Long id, Integer goodsType, Long uid, String from, PrintWriter out) {
      if (id == null || goodsType == null) {
         out.print(JsonUtil.loadFalseResult(1, "商品id和商品平台不能为空"));
         return;
      }
      // 淘宝商品
      if (Constant.SOURCE_TYPE_TAOBAO == goodsType) {
         getTaoBaoGoodsDetial(acceptData, id, uid, from, out);
         return;
      }
      // 京东商品
      if (Constant.SOURCE_TYPE_JD == goodsType) {
         getJDGoodsDetial(acceptData, id, uid, from, out);
         return;
      }
      // 拼多多商品
      if (Constant.SOURCE_TYPE_PDD == goodsType) {
         getPDDGoodsDetial(acceptData, id, uid, from, out);
         return;
      }
   }
   @Resource
   private JDGoodsCacheUtil jdGoodsCacheUtil;
   
   
   /**
@@ -193,12 +160,13 @@
    * @param from
    * @param out
    */
   public void getTaoBaoGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
   @RequestMapping(value = "getDetailTB", method = RequestMethod.POST)
   public void getDetialTB(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
      if (id == null) {
         out.print(JsonUtil.loadFalseResult(1, "请上传id"));
         out.print(JsonUtil.loadFalseResult(1, "商品id不能为空"));
         return;
      }
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
@@ -347,10 +315,10 @@
      
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(tb, null, fanLiRate, shareRate);
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
      
      // 店铺信息
      TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getAuctionId(), goods.getSellerId());
      TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(id, goods.getSellerId());
      if (shop != null) {
         String shopLink = shop.getShopLink();
         if (StringUtil.isNullOrEmpty(shopLink)) {
@@ -451,11 +419,11 @@
         SpreadHongBao spreadHongBao = new SpreadHongBao();
         if (isNewUser) {
            spreadHongBao.setMoney("¥1");
            spreadHongBao.setMoney("1");
         } else {
            moneyType = 2;
            fanliValid = false;
            spreadHongBao.setMoney("¥" + spreadMoney.toString());
            spreadHongBao.setMoney(spreadMoney.toString());
            
            ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO();
            textStyleVO1.setContent("分享");
@@ -512,7 +480,7 @@
         ReduceHongBao reduceHongBao = new ReduceHongBao();
         reduceHongBao.setLeft(buyGoods.getLeftHongBaoCount());
         reduceHongBao.setMoney(tljHongBao);
         reduceHongBao.setName("付款立减 ¥" + tljHongBao);
         reduceHongBao.setName("付款立减 ");
         reduceHongBao.setTip("当日领取,当日内使用,过期失效");
         reduceHongBao.setTotal(buyGoods.getTotalHongBaoCount());
         
@@ -537,10 +505,10 @@
      
      // 分享路径
      String shareUrl = String.format("%s?id=" + id, Constant.systemCommonConfig.getAppShareInfoUrl());
      ShareInfoVO shareInfoVO = new ShareInfoVO();
      ShareVO shareInfoVO = new ShareVO();
      shareInfoVO.setUrl(shareUrl);
      shareInfoVO.setHelpLink(helpLink);
      extraVO.setShareInfo(shareInfoVO);
      extraVO.setShare(shareInfoVO);
      JSONObject object = new JSONObject();
      object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
@@ -570,7 +538,8 @@
    * @param from
    * @param out
    */
   public void getJDGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
   @RequestMapping(value = "getDetailJD", method = RequestMethod.POST)
   public void getDetialJD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
      // 系统验证
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
@@ -588,6 +557,10 @@
         out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
         return;
      }
      // 保存缓存
      jdGoodsCacheUtil.saveGoodsInfo(jdGoods);
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
@@ -665,10 +638,10 @@
      // 分享路径
      String shareUrl = String.format("%s?id=" + jdGoods.getSkuId(),
            Constant.systemCommonConfig.getAppShareInfoUrl());
      ShareInfoVO shareInfoVO = new ShareInfoVO();
      ShareVO shareInfoVO = new ShareVO();
      shareInfoVO.setUrl(shareUrl);
      shareInfoVO.setHelpLink(helpLink);
      extraVO.setShareInfo(shareInfoVO);
      extraVO.setShare(shareInfoVO);
      JSONObject object = new JSONObject();
      object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
@@ -689,7 +662,7 @@
   }
   /**
    * 京东商品详情
    * 拼多多商品详情
    * 
    * @param acceptData
    * @param id
@@ -697,7 +670,8 @@
    * @param from
    * @param out
    */
   public void getPDDGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
   @RequestMapping(value = "getDetailPDD", method = RequestMethod.POST)
   public void getDetialPDD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
      // 系统验证
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
@@ -723,7 +697,9 @@
         String version = acceptData.getVersion();
         extraVO.setIosOnling(configService.iosOnLining(Integer.parseInt(version)));
      }
      // 图文详情
      extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img_pdd.html?id="+ id);
      
      Long inOrderCount30Days = pddGoods.getSoldQuantity();
      List<ShamUser> listShareUser = new ArrayList<ShamUser>();
@@ -777,10 +753,10 @@
      }
      // 分享路径
      String shareUrl = String.format("%s?id=" + id, Constant.systemCommonConfig.getAppShareInfoUrl());
      ShareInfoVO shareInfoVO = new ShareInfoVO();
      ShareVO shareInfoVO = new ShareVO();
      shareInfoVO.setUrl(shareUrl);
      shareInfoVO.setHelpLink(helpLink);
      extraVO.setShareInfo(shareInfoVO);
      extraVO.setShare(shareInfoVO);
      JSONObject object = new JSONObject();
      object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));