yujian
2019-11-07 53ea50a0c82d776fce71369bd986396537a8d0e5
Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
2个文件已修改
30 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
@@ -97,10 +98,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());
                            } catch (BanLiShopOrderException e) {
                                e.printStackTrace();
                            }
                        }
                    } catch (WXOrderException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        List<BanLiShopOrderVO> voList = new ArrayList<>();
        for (BanLiShopOrder order : orderList) {
            voList.add(BanLiShopOrderGoodsVOFactory.create(order));
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java
@@ -48,7 +48,7 @@
        try {
            Map<String, String> map = WXPayUtil.produceOrder(params);
            return map.get("mweb_url") + "&redirect_url=" + URLEncoder
                    .encode("http://test.banliapp.com/flqFront/AppInside/shop/wx_pay_success.html", "UTF-8");
                    .encode("http://shop.banliapp.com/order.html?from=pay", "UTF-8");
        } catch (WXPlaceOrderParamsException e) {
            e.printStackTrace();
        } catch (Exception e) {