yujian
2019-08-21 7f2f5ef5637a6871f4329e464eeba97eb59e94a3
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -35,6 +35,8 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -63,7 +65,6 @@
   @Resource
   private PDDCommonTemplateContentService pddCommonTemplateContentService;
   
   /**
    * 通用模板导航
@@ -105,7 +106,8 @@
    * @param out
    */
   @RequestMapping(value = "getNavGoodsList", method = RequestMethod.POST)
   public void getNavContent(AcceptData acceptData, String key, Integer type, Integer page, String cid, PrintWriter out) {
   public void getNavContent(AcceptData acceptData, String key, Integer type, Integer page, String cid,
         PrintWriter out) {
      if (StringUtil.isNullOrEmpty(key)) {
         out.print(JsonUtil.loadFalseResult(1, "请传入Key"));
         return;
@@ -133,7 +135,6 @@
      out.print(JsonUtil.loadFalseResult("goodsType参数不正确"));
   }
   private void getListTB(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) {
      CommonContentResult result = commonTemplateContentService.getContentList(CommonContentTypeEnum.valueOf(key),
            cid, page, Constant.PAGE_SIZE);
@@ -150,8 +151,15 @@
      List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
         array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate)));
         GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
         if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品
         {
            vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
            vo.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
         }
         array.add(gson.toJson(vo));
      }
      
      root.put("list", array);
@@ -159,9 +167,9 @@
      out.print(JsonUtil.loadTrueResult(root));
   }
   
   /**
    * 京东通用专题模板
    *
    * @param acceptData
    * @param key
    * @param page
@@ -175,7 +183,8 @@
         data.put("bannerList", new Gson().toJson(bannerList));
      }
      JDSearchResult result = jdCommonTemplateContentService.getContentList(JDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE);
      JDSearchResult result = jdCommonTemplateContentService.getContentList(JDCommonContentTypeEnum.valueOf(key), cid,
            page, Constant.PAGE_SIZE);
      JSONArray array = new JSONArray();
      
      long count = 0;
@@ -202,9 +211,9 @@
      out.print(JsonUtil.loadTrueResult(data));
   }
   
   /**
    *   拼多多通用专题模板
    *
    * @param acceptData
    * @param key
    * @param page
@@ -227,7 +236,8 @@
         data.put("bannerList", new Gson().toJson(bannerList));
      }
      
      PDDGoodsResult result = pddCommonTemplateContentService.getContentList(PDDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE);
      PDDGoodsResult result = pddCommonTemplateContentService.getContentList(PDDCommonContentTypeEnum.valueOf(key),
            cid, page, Constant.PAGE_SIZE);
      JSONArray array = new JSONArray();
      long count = 0;
      if (result != null) {