From 6d17fb69b25cd74c4598784a6cf6fe7a9b651e34 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 31 十二月 2019 12:01:34 +0800 Subject: [PATCH] 小程序接口相关修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java | 70 +++++++++++++++-------------------- 1 files changed, 30 insertions(+), 40 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java index b92e409..b265eec 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java @@ -340,11 +340,11 @@ for (String img : tb.getImgList()) { finalImgList.add(TbImgUtil.getTBSizeImg(img, 600)); } - + if (finalImgList.size() == 0) { finalImgList.add(tb.getPictUrl()); } - + if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite())) finalImgList.add(0, tb.getPictUrlWhite()); @@ -367,10 +367,9 @@ LogHelper.errorDetailInfo(e); } - 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()); + GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) { goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney()); @@ -533,13 +532,12 @@ RewardCouponVO rewardCoupon = new RewardCouponVO(); rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web")); JSONObject params1 = new JSONObject(); - if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) + if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) params1.put("url", configService.get("special_guide_reward_coupon_link")); else params1.put("url", configService.get("vip_link")); - rewardCoupon - .setMaxMoney("楼" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPFanLiRate())); - if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney()); + if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) { rewardCoupon.setDesc("杩�"); params1.put("url", configService.get("vip_link")); rewardCoupon.getJumpDetail().setNeedLogin(true); @@ -624,10 +622,8 @@ // 淇濆瓨缂撳瓨 jdGoodsCacheUtil.saveGoodsInfo(jdGoods); - 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()); GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) { goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney()); @@ -651,12 +647,14 @@ if (commissionShare != null && commissionShare.compareTo(threeClass.getSelfComm()) > 0) { jdGoods.setCommissionPlus(threeClass.getSelfComm()); // plus杩斿埄 - BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, fanLiRate); + BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, + hongBaoManageService.getFanLiRate()); otherInfo.setFanliMoneyPlus("浜笢plus杩斅�" + fanliMoneyPlus); // 浣跨敤濂栧姳鍒告渶楂樿繑 - if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) { maxMoneyPlus = "锛堜含涓減lus杩斅�" - + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE)) + + JDUtil.getGoodsFanLiMoneyPlus(jdGoods, + hongBaoManageService.getVIPFanLiRate()) + "锛�"; } else maxMoneyPlus = "锛堜含涓減lus鏈�楂樿繑楼" @@ -671,13 +669,13 @@ rewardCoupon.setMaxMoneyPlus(maxMoneyPlus); rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web")); JSONObject params1 = new JSONObject(); - if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) + if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) params1.put("url", configService.get("special_guide_reward_coupon_link")); else params1.put("url", configService.get("vip_link")); - rewardCoupon.setMaxMoney("楼" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPFanLiRate())); - if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney()); + if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) { rewardCoupon.setDesc("杩�"); params1.put("url", configService.get("vip_link")); rewardCoupon.getJumpDetail().setNeedLogin(true); @@ -820,10 +818,8 @@ return; } - 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()); GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) { goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney()); @@ -836,14 +832,13 @@ RewardCouponVO rewardCoupon = new RewardCouponVO(); rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web")); JSONObject params1 = new JSONObject(); - if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) + if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) params1.put("url", configService.get("special_guide_reward_coupon_link")); else params1.put("url", configService.get("vip_link")); - rewardCoupon - .setMaxMoney("楼" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPFanLiRate())); - if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney()); + if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) { rewardCoupon.setDesc("杩�"); params1.put("url", configService.get("vip_link")); rewardCoupon.getJumpDetail().setNeedLogin(true); @@ -994,10 +989,8 @@ list = list.subList(0, 10); } - 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()); List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>(); for (JDGoods goods : list) { @@ -1038,10 +1031,8 @@ goodsList = goodsList.subList(0, 10); } - 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()); for (PDDGoodsDetail goods : goodsList) { listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)); } @@ -1084,10 +1075,8 @@ if (goodsList != null && goodsList.size() > 0) { - 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()); goodsList.parallelStream().forEach(goods -> { if (goods != null) { @@ -1365,6 +1354,7 @@ ConfigParamsDTO params = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(), hongBaoManageService.getShareRate(), new BigDecimal(80), hongBaoManageService.getVIPFanLiRate()); + hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()); if (tbGoodsList.size() > 0) { List<TaoBaoGoodsBrief> goodsList = null; -- Gitblit v1.8.0