From c3f10da9aa6f4d8fecccc1c9574567ee0766ab48 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 28 十二月 2019 10:09:00 +0800 Subject: [PATCH] 学院 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java index cc86dea..29abdfa 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java @@ -1,7 +1,6 @@ package com.yeshi.fanli.controller.client.v2; import java.io.PrintWriter; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -111,7 +110,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)); } @@ -308,9 +307,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, hongBaoManageService.getVIPFanLiRate()); + ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), + acceptData.getVersion()); // 鍟嗗搧淇℃伅杩囨护 listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief); @@ -384,7 +382,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>(); @@ -430,7 +428,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); @@ -533,9 +531,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, hongBaoManageService.getVIPFanLiRate()); + ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), + acceptData.getVersion()); // 鍟嗗搧淇℃伅杩囨护 listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief); @@ -665,12 +662,19 @@ out.print(JsonUtil.loadFalseResult("椤电爜涓嶆纭�")); return; } - if (cid != null && cid == 0) { cid = null; } + JSONObject data = new JSONObject(); + if (page == 1 && cid == null) { // 绮鹃�夐〉banner + List<SwiperPicture> banners = swiperPictureService.getByBannerCardAndVersion("brand_banners",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())); + if (banners == null) + banners = new ArrayList<>(); + data.put("banners", JsonUtil.getApiCommonGson().toJson(banners)); + } + if (page == 1 && cid != null) { List<BrandInfo> brandlist = brandInfoService.listValidByCidToApp(cid); if(brandlist == null) @@ -678,10 +682,9 @@ data.put("brandlist", JsonUtil.getApiCommonGson().toJson(brandlist)); } - 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>(); @@ -714,12 +717,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, hongBaoManageService.getVIPFanLiRate()); + ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), + acceptData.getVersion()); JSONArray array = new JSONArray(); List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId((page - 1) * 50, 50,id); @@ -747,7 +750,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); -- Gitblit v1.8.0