admin
2019-12-24 f111025b1c2c8bb95e64f4f9e23c09813b7938d2
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java
@@ -45,6 +45,7 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -110,7 +111,7 @@
      if (page == null || page < 1) {
         page = 1;
      }
      JSONObject data = brandClassShopService.listEffectiveCacheV2(page, cid);
      JSONObject data = brandClassShopService.listEffectiveCacheV2(page, cid,acceptData.getPlatform(),acceptData.getVersion());
      out.print(JsonUtil.loadTrueResult(data));
   }
@@ -307,9 +308,8 @@
         Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
               .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
         BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
         BigDecimal shareRate = hongBaoManageService.getShareRate();
         ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
         ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
               acceptData.getVersion());
         // 商品信息过滤
         listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
@@ -351,11 +351,17 @@
    */
   @RequestMapping(value = "getList", method = RequestMethod.POST)
   public void getList(AcceptData acceptData, Integer page, Long cid, Long uid, PrintWriter out) {
      if (Constant.IS_TEST) {
         getListV3(acceptData, page, cid, uid, out);
         return;
      if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            getListV3(acceptData, page, cid, uid, out);
            return;
         }
      } else {
         if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
            getListV3(acceptData, page, cid, uid, out);
            return;
         }
      }
      
      if (page == null || page < 1) {
         out.print(JsonUtil.loadFalseResult("页码不正确"));
@@ -377,7 +383,7 @@
      
      long count = brandInfoService.countBrandInfo(cid);
      
      List<BrandInfoVO> list = brandInfoService.listBrandInfoCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid);
      List<BrandInfoVO> list = brandInfoService.listBrandInfoCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion());
      if (list == null)
         list = new ArrayList<BrandInfoVO>();
      
@@ -400,9 +406,16 @@
   @RequestMapping(value = "getShopInfoV2", method = RequestMethod.POST)
   public void getShopInfoV2(AcceptData acceptData, Integer page, Long id, Long uid, PrintWriter out) {
      
      if (Constant.IS_TEST) {
         getShopInfoV3(acceptData, page, id, uid, out);
         return;
      if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            getShopInfoV3(acceptData, page, id, uid, out);
            return;
         }
      } else {
         if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
            getShopInfoV3(acceptData, page, id, uid, out);
            return;
         }
      }
      
      if (id == null) {
@@ -416,7 +429,7 @@
      JSONObject data = new JSONObject();
      if (page == 1) {
         // 2、顶部轮播图
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("brand_picture");
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         if (oldtopPicList != null && oldtopPicList.size() > 0)
            topPicList.addAll(oldtopPicList);
         TaoBaoShop taoBaoShop = taoBaoShopService.selectByPrimaryKey(id);
@@ -519,9 +532,8 @@
         Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
               .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
         BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
         BigDecimal shareRate = hongBaoManageService.getShareRate();
         ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
         ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
               acceptData.getVersion());
         // 商品信息过滤
         listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
@@ -563,9 +575,16 @@
    */
   @RequestMapping(value = "getHistoryV2", method = RequestMethod.POST)
   public void getHistoryV2(AcceptData acceptData, Integer page, Long uid, Integer type, PrintWriter out) {
      if (Constant.IS_TEST) {
         getHistoryV3(acceptData, page, uid, type, out);
         return;
      if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            getHistoryV3(acceptData, page, uid, type, out);
            return;
         }
      } else {
         if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
            getHistoryV3(acceptData, page, uid, type, out);
            return;
         }
      }
      
      if (type == null) {
@@ -660,7 +679,7 @@
      
      long count = brandInfoService.countValidByCidToApp(cid);
      
      List<BrandInfoVO> list = brandInfoService.listValidToApp((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid);
      List<BrandInfoVO> list = brandInfoService.listValidToApp((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion());
      if (list == null)
         list = new ArrayList<BrandInfoVO>();
      
@@ -693,12 +712,12 @@
         brandInfoRecordService.addRecord(id, uid, acceptData.getDevice());
      }
      
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
      
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
      ConfigParamsDTO paramsDTO =  hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      JSONArray array = new JSONArray();
      
      List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId((page - 1) * 50, 50,id);
@@ -726,7 +745,7 @@
      if (page == 1 && array.size() > 0) {
         // 2、顶部轮播图
         List<SwiperPicture> topPicList = new ArrayList<>();
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("brand_picture");
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         if (oldtopPicList != null && oldtopPicList.size() > 0)
            topPicList.addAll(oldtopPicList);
         
@@ -741,7 +760,7 @@
         data.put("shopList", JsonUtil.getApiCommonGson().toJson(shopList));
      }
      
      data.put("count", 50);
      data.put("count", array.size());
      data.put("list", array);
      out.print(JsonUtil.loadTrueResult(data));
   }