From ebf53a624416777600fdc9a880552bf3665d51a0 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 01 一月 2020 17:10:47 +0800 Subject: [PATCH] 拼多多商品详情请求失败bug修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java | 28 +++++++++++----------------- 1 files changed, 11 insertions(+), 17 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java index fecef80..58f555d 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java @@ -15,7 +15,6 @@ import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; -import com.yeshi.fanli.entity.redpack.RedPackBalance; import com.yeshi.fanli.entity.shop.BanLiShopGoods; import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets; import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay; @@ -24,6 +23,7 @@ import com.yeshi.fanli.exception.shop.BanLiShopOrderException; import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService; +import com.yeshi.fanli.service.inter.redpack.RedPackForbidService; import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService; import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService; import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService; @@ -68,6 +68,9 @@ @Resource private BanLiShopGoodsSetService banLiShopGoodsSetService; + @Resource + private RedPackForbidService redPackForbidService; + /** * 鍟嗗搧鍒楄〃 * @@ -77,14 +80,15 @@ * @param out */ @RequestMapping(value = "goodsList") - public void goodsList(AcceptData acceptData, int page,Long uid, String callback, PrintWriter out) { + public void goodsList(AcceptData acceptData, int page, Long uid, String callback, PrintWriter out) { if (page <= 0) page = 1; List<BanLiShopGoods> goodsList = banLiShopGoodsService.listGoods(null, BanLiShopGoods.STATE_ONLINE, page, Constant.PAGE_SIZE); long count = banLiShopGoodsService.countGoods(null, BanLiShopGoods.STATE_ONLINE); // 鑾峰彇banner - List<SwiperPicture> pictureList = swiperPictureService.getByBannerCard("hongbao_exchange_goods_list"); + List<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("hongbao_exchange_goods_list", + acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())); JSONObject data = new JSONObject(); if (pictureList != null && pictureList.size() > 0) { @@ -92,14 +96,8 @@ } data.put("data", goodsList); data.put("count", count); - - RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid); - if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) { - data.put("redPackLock", true); - } else { - data.put("redPackLock", false); - } - + data.put("redPackLock", redPackForbidService.verifyForbid(uid)); + if (!StringUtil.isNullOrEmpty(callback)) out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data))); else @@ -183,12 +181,8 @@ pay.setName(getPayName(pay.getPayType())); } } - BigDecimal money = new BigDecimal(0); - try { - money = redPackBalanceService.getBalance(uid); - } catch (RedPackBalanceException e) { - e.printStackTrace(); - } + BigDecimal money = redPackBalanceService.getBalance(uid); + JSONObject data = new JSONObject(); data.put("goods", goods); data.put("hongBaoBalance", money); -- Gitblit v1.8.0