yujian
2020-01-03 c9cbdfa41d645d42eeaa7e06d550d4ef8ac328e7
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -15,6 +15,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.common.CommonContentNav;
import com.yeshi.fanli.dto.common.CommonContentResult;
import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
@@ -36,6 +37,7 @@
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
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;
@@ -161,15 +163,16 @@
      JSONArray array = new JSONArray();
      Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
      List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
         GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
         GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
         if (type == CommonContentTypeEnum.mianDan)// 免单商品
         {
            vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
            vo.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
            vo.getMoneyInfo().setMaxMoney(null);
         }
         array.add(gson.toJson(vo));
      }
@@ -208,12 +211,13 @@
         List<JDGoods> goodsList = result.getGoodsList();
         if (goodsList != null && goodsList.size() > 0) {
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                  .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                  acceptData.getVersion());
            for (JDGoods goods : goodsList) {
               array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate)));
               array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
            }
         }
      }
@@ -238,7 +242,7 @@
         // 2、顶部轮播图
         List<SwiperPicture> bannerList = null;
         if (Constant.IS_TEST) {
            bannerList = swiperPictureService.getByBannerCard("index_top");
            bannerList = swiperPictureService.getByBannerCardAndVersion("index_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         }
         if (bannerList == null) {
@@ -257,12 +261,13 @@
         List<PDDGoodsDetail> goodsList = result.getGoodsList();
         if (goodsList != null && goodsList.size() > 0) {
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                  .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            ConfigParamsDTO paramsDTO =  hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                  acceptData.getVersion());
            for (PDDGoodsDetail goods : goodsList) {
               array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate)));
               array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
            }
         }
      }