From cdd852f8e8eff7eb2e8f7c3fceaa955b9fc3f9d3 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期一, 29 七月 2019 10:46:32 +0800 Subject: [PATCH] 订单商品类型处理 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java | 48 +++++++++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 19 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 6ad6d98..353236d 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 @@ -738,24 +738,34 @@ // 鍥炬枃璇︽儏 extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img_pdd.html?id="+ id); - Long inOrderCount30Days = pddGoods.getSoldQuantity(); - List<ShamUser> listShareUser = new ArrayList<ShamUser>(); - MoneyInfoVO moneyInfo = goodsDetail.getMoneyInfo(); - if (moneyInfo != null) { - String shareMoney = moneyInfo.getShareMoney().replaceAll("楼", ""); - if (Integer.parseInt(inOrderCount30Days.toString()) >= 50000) { - listShareUser = shamUserService.listRandShareUser(10, new BigDecimal(shareMoney), 1, 5); + String salesTip = pddGoods.getSalesTip(); + if (!StringUtil.isNullOrEmpty(salesTip)) { + int totalSales = 0; + if (salesTip.contains("涓�")) { + salesTip = salesTip.substring(0, salesTip.indexOf("涓�")); + totalSales= (int) (Float.parseFloat(salesTip) * 10000); + } else { + totalSales = Integer.parseInt(salesTip); } - } - extraVO.setListShareUser(listShareUser); + + List<ShamUser> listShareUser = new ArrayList<ShamUser>(); + MoneyInfoVO moneyInfo = goodsDetail.getMoneyInfo(); + if (moneyInfo != null) { + String shareMoney = moneyInfo.getShareMoney().replaceAll("楼", ""); + if (totalSales >= 50000) { + listShareUser = shamUserService.listRandShareUser(10, new BigDecimal(shareMoney), 1, 5); + } + } + extraVO.setListShareUser(listShareUser); - // 棰嗗埜浜哄垪琛� - List<ShamUser> listCouponUser = new ArrayList<ShamUser>(); - if (goodsDetail.isHasCoupon() && Integer.parseInt(inOrderCount30Days.toString()) >= 50000) { - listCouponUser = shamUserService.listRandCouponUser(5, 1, 300); + // 棰嗗埜浜哄垪琛� + List<ShamUser> listCouponUser = new ArrayList<ShamUser>(); + if (goodsDetail.isHasCoupon() && totalSales >= 50000) { + listCouponUser = shamUserService.listRandCouponUser(5, 1, 300); + } + extraVO.setListCouponUser(listCouponUser); } - extraVO.setListCouponUser(listCouponUser); - + if (uid != null) { // 鏄惁鍔犲叆鏀惰棌 CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, @@ -829,7 +839,7 @@ // 浜笢 if (goodsType == Constant.SOURCE_TYPE_JD) { JSONObject data = new JSONObject(); - data.put("listQuality", JsonUtil.getApiCommonGson().toJson(new ArrayList<GoodsDetailVO>())); + data.put("listGuess", JsonUtil.getApiCommonGson().toJson(new ArrayList<GoodsDetailVO>())); List<JDGoods> list = JDUtil.getRecommendGoodsById(id); if (list == null) { @@ -851,7 +861,7 @@ listDetailVO.remove(listDetailVO.size() - 1); } - data.put("listGuess", JsonUtil.getApiCommonGson().toJson(listDetailVO)); + data.put("listQuality", JsonUtil.getApiCommonGson().toJson(listDetailVO)); out.print(JsonUtil.loadTrueResult(data)); return; } @@ -859,7 +869,7 @@ // 鎷煎澶� if (goodsType == Constant.SOURCE_TYPE_PDD) { JSONObject data = new JSONObject(); - data.put("listQuality", JsonUtil.getApiCommonGson().toJson(new ArrayList<GoodsDetailVO>())); + data.put("listGuess", JsonUtil.getApiCommonGson().toJson(new ArrayList<GoodsDetailVO>())); List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>(); @@ -894,7 +904,7 @@ listDetailVO.remove(listDetailVO.size() - 1); } - data.put("listGuess", JsonUtil.getApiCommonGson().toJson(listDetailVO)); + data.put("listQuality", JsonUtil.getApiCommonGson().toJson(listDetailVO)); out.print(JsonUtil.loadTrueResult(data)); return; } -- Gitblit v1.8.0