admin
2020-09-24 ca1ad791b7b7b04e57db6bd4fb93f0c1066a9f99
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java
@@ -21,14 +21,12 @@
import com.yeshi.fanli.entity.brand.BrandInfoRecord;
import com.yeshi.fanli.entity.brand.BrandShopCahe;
import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoShop;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.common.entity.taobao.TaoBaoShop;
import com.yeshi.goods.facade.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.service.inter.brand.BrandClassService;
import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
import com.yeshi.fanli.service.inter.brand.BrandGoodsCaheService;
import com.yeshi.fanli.service.inter.brand.BrandInfoRecordService;
@@ -40,7 +38,7 @@
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
@@ -51,6 +49,7 @@
import com.yeshi.fanli.vo.brand.BrandInfoVO;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.goods.ShopInfoVO;
import com.yeshi.fanli.vo.homemodule.BannerVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -58,10 +57,6 @@
@Controller
@RequestMapping("api/v2/brand")
public class BrandControllerV2 {
   @Resource
   private BrandClassService brandClassService;
   @Resource
   private BrandClassShopService brandClassShopService;
@@ -110,7 +105,7 @@
      if (page == null || page < 1) {
         page = 1;
      }
      JSONObject data = brandClassShopService.listEffectiveCacheV2(page, cid,acceptData.getPlatform(),acceptData.getVersion());
      JSONObject data = brandClassShopService.listEffectiveCacheV2(page, cid,acceptData.getPlatform(),acceptData.getVersion(),acceptData.getSystem());
      out.print(JsonUtil.loadTrueResult(data));
   }
@@ -308,7 +303,7 @@
               .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
         ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
               acceptData.getVersion());
               acceptData.getVersion(),acceptData.getSystem());
         // 商品信息过滤
         listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
@@ -373,7 +368,7 @@
      
      JSONObject data = new JSONObject();
      if (page == 1 && cid != null) {
         List<BrandInfo> brandlist = brandInfoService.listValidBrandInfoCache(cid);
         List<BrandInfo> brandlist = brandInfoService.listValidBrandInfoCache(cid,acceptData.getSystem());
         if(brandlist == null)
            brandlist = new ArrayList<BrandInfo>();
         data.put("brandlist", JsonUtil.getApiCommonGson().toJson(brandlist));
@@ -382,7 +377,7 @@
      
      long count = brandInfoService.countBrandInfo(cid);
      
      List<BrandInfoVO> list = brandInfoService.listBrandInfoCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion());
      List<BrandInfoVO> list = brandInfoService.listBrandInfoCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion(),acceptData.getSystem());
      if (list == null)
         list = new ArrayList<BrandInfoVO>();
      
@@ -423,12 +418,12 @@
      }
      
      List<TaoBaoShop> shopList = new ArrayList<TaoBaoShop>();
      List<SwiperPicture> topPicList = new ArrayList<>();
      List<BannerVO> topPicList = new ArrayList<>();
      
      JSONObject data = new JSONObject();
      if (page == 1) {
         // 2、顶部轮播图
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
         if (oldtopPicList != null && oldtopPicList.size() > 0)
            topPicList.addAll(oldtopPicList);
         TaoBaoShop taoBaoShop = taoBaoShopService.selectByPrimaryKey(id);
@@ -532,7 +527,7 @@
               .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
         ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
               acceptData.getVersion());
               acceptData.getVersion(),acceptData.getSystem());
         // 商品信息过滤
         listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
@@ -669,22 +664,22 @@
      
      JSONObject data = new JSONObject();
      if (page == 1  && cid == null) { // 精选页banner
         List<SwiperPicture> banners = swiperPictureService.getByBannerCardAndVersion("brand_banners",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         List<BannerVO> banners = swiperPictureService.getByBannerCardAndVersion("brand_banners",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
         if (banners == null)
            banners = new ArrayList<>();
         data.put("banners", JsonUtil.getApiCommonGson().toJson(banners));
      }
      
      if (page == 1 && cid != null) {
         List<BrandInfo> brandlist = brandInfoService.listValidByCidToApp(cid);
         List<BrandInfo> brandlist = brandInfoService.listValidByCidToApp(cid,acceptData.getSystem());
         if(brandlist == null)
            brandlist = new ArrayList<BrandInfo>();
         data.put("brandlist", JsonUtil.getApiCommonGson().toJson(brandlist));
      }
      
      long count = brandInfoService.countValidByCidToApp(cid);
      long count = brandInfoService.countValidByCidToApp(cid,acceptData.getSystem());
      
      List<BrandInfoVO> list = brandInfoService.listValidToApp((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion());
      List<BrandInfoVO> list = brandInfoService.listValidToApp((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid,acceptData.getPlatform(),acceptData.getVersion(), acceptData.getSystem());
      if (list == null)
         list = new ArrayList<BrandInfoVO>();
      
@@ -722,7 +717,7 @@
            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
      
      ConfigParamsDTO paramsDTO =  orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
            acceptData.getVersion(),acceptData.getSystem());
      JSONArray array = new JSONArray();
      
      List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId((page - 1) * 50, 50,id);
@@ -749,8 +744,8 @@
      JSONObject data = new JSONObject();
      if (page == 1 && array.size() > 0) {
         // 2、顶部轮播图
         List<SwiperPicture> topPicList = new ArrayList<>();
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         List<BannerVO> topPicList = new ArrayList<>();
         List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("brand_picture",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
         if (oldtopPicList != null && oldtopPicList.size() > 0)
            topPicList.addAll(oldtopPicList);