From c8f11c229b87d1652b6da0b15576c166cd51eb8b Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 01 一月 2020 14:25:22 +0800 Subject: [PATCH] 首页悬浮图mapperbug修改,增加商品详情中的比例展示 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java | 42 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 38 insertions(+), 4 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 ca35c54..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 @@ -11,6 +11,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.yeshi.utils.JsonUtil; +import org.yeshi.utils.exception.WXOrderException; import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; @@ -22,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; @@ -66,6 +68,9 @@ @Resource private BanLiShopGoodsSetService banLiShopGoodsSetService; + @Resource + private RedPackForbidService redPackForbidService; + /** * 鍟嗗搧鍒楄〃 * @@ -75,14 +80,15 @@ * @param out */ @RequestMapping(value = "goodsList") - public void goodsList(AcceptData acceptData, int page, 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) { @@ -90,6 +96,8 @@ } data.put("data", goodsList); data.put("count", count); + data.put("redPackLock", redPackForbidService.verifyForbid(uid)); + if (!StringUtil.isNullOrEmpty(callback)) out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data))); else @@ -97,10 +105,35 @@ } @RequestMapping(value = "orderList") - public void orderList(AcceptData acceptData, Long uid, int page, String callback, PrintWriter out) { + public void orderList(AcceptData acceptData, Long uid, int page, String callback, String from, PrintWriter out) { if (page <= 0) page = 1; List<BanLiShopOrder> orderList = banLiShopOrderService.listByUid(uid, page, Constant.PAGE_SIZE); + if (!StringUtil.isNullOrEmpty("from") && from.equalsIgnoreCase("pay")) {// 浠庢敮浠樼晫闈㈣繃鏉� + // 鍒ゆ柇绗竴涓鍗曟槸鍚︽敮浠樻垚鍔� + if (orderList.size() > 0) { + BanLiShopOrder latestOrder = orderList.get(0); + if (latestOrder.getMoneyPayment() != null + && latestOrder.getMoneyPayment().compareTo(new BigDecimal(0)) > 0) { + // 鍒ゆ柇寰俊鏀粯鏄惁鎴愬姛 + try { + boolean isPaySuccess = BanLiShopWXPayUtil.isPaySuccess(latestOrder.getOrderNo()); + if (isPaySuccess) { + try { + banLiShopOrderPayService.payOrderByMoney(latestOrder.getId(), + latestOrder.getMoneyPayment()); + orderList = banLiShopOrderService.listByUid(uid, page, Constant.PAGE_SIZE); + } catch (BanLiShopOrderException e) { + e.printStackTrace(); + } + } + } catch (WXOrderException e) { + e.printStackTrace(); + } + } + } + } + List<BanLiShopOrderVO> voList = new ArrayList<>(); for (BanLiShopOrder order : orderList) { voList.add(BanLiShopOrderGoodsVOFactory.create(order)); @@ -149,6 +182,7 @@ } } BigDecimal money = redPackBalanceService.getBalance(uid); + JSONObject data = new JSONObject(); data.put("goods", goods); data.put("hongBaoBalance", money); @@ -192,7 +226,7 @@ if (order.getMoneyPayment() != null && order.getMoneyPayment().compareTo(new BigDecimal(0)) > 0) { // 璧板井淇℃敮浠� String payUrl = BanLiShopWXPayUtil.getWXH5PayUrl(order.getOrderNo(), request.getRemoteAddr(), - order.getOrderGoods().getGoodsName(), order.getMoneyPayment()); + order.getOrderGoods().getGoodsName(), order.getMoneyPayment(), acceptData.getPlatform()); if (StringUtil.isNullOrEmpty(payUrl)) { if (!StringUtil.isNullOrEmpty(callback)) out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(102, "寰俊鏀粯鍒涘缓澶辫触"))); -- Gitblit v1.8.0