|  | @@ -1,13 +1,9 @@
 | 
	
		
			
				|  |  |  package thyyxxk.wxservice_server.service;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | -import com.wechat.pay.java.core.Config;
 | 
	
		
			
				|  |  |  import com.wechat.pay.java.core.util.GsonUtil;
 | 
	
		
			
				|  |  | -import com.wechat.pay.java.service.payments.jsapi.JsapiService;
 | 
	
		
			
				|  |  | -import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
 | 
	
		
			
				|  |  |  import com.wechat.pay.java.service.payments.jsapi.model.*;
 | 
	
		
			
				|  |  |  import com.wechat.pay.java.service.payments.model.Transaction;
 | 
	
		
			
				|  |  | -import com.wechat.pay.java.service.payments.nativepay.NativePayService;
 | 
	
		
			
				|  |  |  import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
	
		
			
				|  | @@ -16,13 +12,14 @@ import thyyxxk.wxservice_server.constant.OrderType;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.dao.WxApiDao;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.entity.ResultVo;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.entity.appointment.DoctorInfo;
 | 
	
		
			
				|  |  | -import thyyxxk.wxservice_server.entity.appointment.WeChatPayParam;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.entity.wxapi.JsApiSHA1;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.entity.wxapi.GenMzPayQrcodeParam;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.entity.wxapi.WxPayOrder;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.entity.wxapi.WxPyQrcdPrm;
 | 
	
		
			
				|  |  | +import thyyxxk.wxservice_server.factory.wechatpay.WeChatPayService;
 | 
	
		
			
				|  |  | +import thyyxxk.wxservice_server.factory.wechatpay.model.NativePayResponse;
 | 
	
		
			
				|  |  | +import thyyxxk.wxservice_server.factory.wechatpay.model.WechatPayGlobalRequest;
 | 
	
		
			
				|  |  |  import thyyxxk.wxservice_server.utils.*;
 | 
	
		
			
				|  |  | -import thyyxxk.wxservice_server.utils.wxpay.WxPayConfigUtil;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.util.*;
 | 
	
		
			
				|  |  |  import java.util.concurrent.TimeUnit;
 | 
	
	
		
			
				|  | @@ -54,13 +51,13 @@ public class WxApiService {
 | 
	
		
			
				|  |  |          return ResultVoUtil.success(data);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    public ResultVo<WxPayOrder> createPayOrder(WeChatPayParam param) {
 | 
	
		
			
				|  |  | +    public ResultVo<WxPayOrder> createPayOrder(WxPayOrder order) {
 | 
	
		
			
				|  |  |          WxPayOrder existOrder = null;
 | 
	
		
			
				|  |  | -        if (param.getOrderType() == OrderType.CLINIC_REGISTER.getCode() ||
 | 
	
		
			
				|  |  | -                param.getOrderType() == OrderType.REGISTRATION.getCode()) {
 | 
	
		
			
				|  |  | -            existOrder = dao.selectSameGhOrder(param.getPatientId(), param.getMzyRequestId());
 | 
	
		
			
				|  |  | -        } else if (param.getOrderType() == OrderType.OUTPATIENT.getCode()) {
 | 
	
		
			
				|  |  | -            existOrder = dao.selectSameMzPayOrder(param.getHisOrdNum(), param.getTotalFee().doubleValue());
 | 
	
		
			
				|  |  | +        if (order.getOrderType() == OrderType.CLINIC_REGISTER.getCode() ||
 | 
	
		
			
				|  |  | +                order.getOrderType() == OrderType.REGISTRATION.getCode()) {
 | 
	
		
			
				|  |  | +            existOrder = dao.selectSameGhOrder(order.getPatientId(), order.getMzyRequestId());
 | 
	
		
			
				|  |  | +        } else if (order.getOrderType() == OrderType.OUTPATIENT.getCode()) {
 | 
	
		
			
				|  |  | +            existOrder = dao.selectSameMzPayOrder(order.getHisOrdNum(), order.getTotalFee().doubleValue());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (null != existOrder) {
 | 
	
		
			
				|  |  |              if (existOrder.getTradeState() == Transaction.TradeStateEnum.SUCCESS) {
 | 
	
	
		
			
				|  | @@ -73,79 +70,41 @@ public class WxApiService {
 | 
	
		
			
				|  |  |                          return ResultVoUtil.success(existOrder);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                if (null == param.getYjReqNo()) {
 | 
	
		
			
				|  |  | -                    param.setYjReqNo(existOrder.getYjReqNo());
 | 
	
		
			
				|  |  | +                if (null == order.getYjReqNo()) {
 | 
	
		
			
				|  |  | +                    order.setYjReqNo(existOrder.getYjReqNo());
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        String appId = PropertiesUtil.getLocalProperty("appId");
 | 
	
		
			
				|  |  | -        String merchantId = PropertiesUtil.getLocalProperty("mchId");
 | 
	
		
			
				|  |  | -        String tradeNo = SnowFlakeId.instance().nextId();
 | 
	
		
			
				|  |  | -        int totalFee = DecimalTool.moneyYuanToFen(param.getTotalFee()).intValue();
 | 
	
		
			
				|  |  | -        String notifyUrl = "http://staticweb.hnthyy.cn/wxserver/wxPayNotify/jsapi";
 | 
	
		
			
				|  |  | -        Config config = WxPayConfigUtil.getInstance().getConfig();
 | 
	
		
			
				|  |  | -        JsapiServiceExtension service = new JsapiServiceExtension .Builder().config(config).build();
 | 
	
		
			
				|  |  | -        PrepayRequest request = new PrepayRequest();
 | 
	
		
			
				|  |  | -        Amount amount = new Amount();
 | 
	
		
			
				|  |  | -        amount.setTotal(totalFee);
 | 
	
		
			
				|  |  | -        request.setAmount(amount);
 | 
	
		
			
				|  |  | -        request.setDescription(param.getBody());
 | 
	
		
			
				|  |  | -        request.setAppid(appId);
 | 
	
		
			
				|  |  | -        request.setMchid(merchantId);
 | 
	
		
			
				|  |  | -        request.setNotifyUrl(notifyUrl);
 | 
	
		
			
				|  |  | -        request.setOutTradeNo(tradeNo);
 | 
	
		
			
				|  |  | -        Payer payer = new Payer();
 | 
	
		
			
				|  |  | -        payer.setOpenid(param.getOpenId());
 | 
	
		
			
				|  |  | -        request.setPayer(payer);
 | 
	
		
			
				|  |  | -        PrepayWithRequestPaymentResponse response = service.prepayWithRequestPayment(request);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        WxPayOrder order = new WxPayOrder();
 | 
	
		
			
				|  |  | -        order.setBody(param.getBody());
 | 
	
		
			
				|  |  | -        order.setOrderType(param.getOrderType());
 | 
	
		
			
				|  |  | -        order.setOpenId(param.getOpenId());
 | 
	
		
			
				|  |  | -        order.setTotalFee(param.getTotalFee());
 | 
	
		
			
				|  |  | -        order.setPatientId(param.getPatientId());
 | 
	
		
			
				|  |  | -        order.setPatientName(dao.selectPatientName(param.getPatientId()));
 | 
	
		
			
				|  |  | -        order.setAppId(appId);
 | 
	
		
			
				|  |  | -        order.setMchId(merchantId);
 | 
	
		
			
				|  |  | +        int totalAmt = DecimalTool.moneyYuanToFen(order.getTotalFee()).intValue();
 | 
	
		
			
				|  |  | +        order.setTradeNo(SnowFlakeId.instance().nextId());
 | 
	
		
			
				|  |  | +        order.setMchId(PropertiesUtil.getLocalProperty("mchId"));
 | 
	
		
			
				|  |  | +        WechatPayGlobalRequest request = new WechatPayGlobalRequest.Builder()
 | 
	
		
			
				|  |  | +                .appletType(null).outTradeNo(order.getTradeNo())
 | 
	
		
			
				|  |  | +                .openId(order.getOpenId()).description(order.getBody())
 | 
	
		
			
				|  |  | +                .totalAmount(totalAmt).build();
 | 
	
		
			
				|  |  | +        PrepayWithRequestPaymentResponse response = new WeChatPayService().jsApiPrepay(request);
 | 
	
		
			
				|  |  | +        order.setPatientName(dao.selectPatientName(order.getPatientId()));
 | 
	
		
			
				|  |  | +        order.setAppId(response.getAppId());
 | 
	
		
			
				|  |  |          order.setPrepayId(response.getPackageVal());
 | 
	
		
			
				|  |  |          order.setTimeStamp(response.getTimeStamp());
 | 
	
		
			
				|  |  |          order.setSerialNo(response.getNonceStr());
 | 
	
		
			
				|  |  |          order.setSignType(response.getSignType());
 | 
	
		
			
				|  |  |          order.setPaySign(response.getPaySign());
 | 
	
		
			
				|  |  | -        order.setTradeNo(tradeNo);
 | 
	
		
			
				|  |  | -        order.setSpbillCreateIp(param.getClientIp());
 | 
	
		
			
				|  |  |          order.setCreateDatetime(new Date());
 | 
	
		
			
				|  |  |          order.setTradeState(Transaction.TradeStateEnum.NOTPAY);
 | 
	
		
			
				|  |  | -        order.setHisOrdNum(param.getHisOrdNum());
 | 
	
		
			
				|  |  | -        order.setMzyRequestId(param.getMzyRequestId());
 | 
	
		
			
				|  |  | -        order.setYjReqNo(param.getYjReqNo());
 | 
	
		
			
				|  |  | -        order.setInpatientNo(param.getInpatientNo());
 | 
	
		
			
				|  |  | -        order.setAdmissTimes(param.getAdmissTimes());
 | 
	
		
			
				|  |  | -        order.setApTime(param.getApTime());
 | 
	
		
			
				|  |  |          dao.insertNewOrder(order);
 | 
	
		
			
				|  |  | -        log.info("统一下单成功:{}", order);
 | 
	
		
			
				|  |  |          return ResultVoUtil.success(order);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public ResultVo<JSONObject> queryOrderStateOnly(String tradeNo) {
 | 
	
		
			
				|  |  | -        Transaction transaction = queryOrderTradeState(tradeNo);
 | 
	
		
			
				|  |  | +        WechatPayGlobalRequest request = new WechatPayGlobalRequest.Builder()
 | 
	
		
			
				|  |  | +                .outTradeNo(tradeNo).build();
 | 
	
		
			
				|  |  | +        Transaction transaction = new WeChatPayService().queryOrderState(request);
 | 
	
		
			
				|  |  |          JSONObject response = JSONObject.parseObject(GsonUtil.toJson(transaction));
 | 
	
		
			
				|  |  |          return ResultVoUtil.success(response);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    private Transaction queryOrderTradeState(String tradeNo) {
 | 
	
		
			
				|  |  | -        Config config = WxPayConfigUtil.getInstance().getConfig();
 | 
	
		
			
				|  |  | -        JsapiService service = new JsapiService.Builder().config(config).build();
 | 
	
		
			
				|  |  | -        QueryOrderByOutTradeNoRequest request = new QueryOrderByOutTradeNoRequest();
 | 
	
		
			
				|  |  | -        request.setOutTradeNo(tradeNo);
 | 
	
		
			
				|  |  | -        request.setMchid(PropertiesUtil.getLocalProperty("mchId"));
 | 
	
		
			
				|  |  | -        Transaction transaction = service.queryOrderByOutTradeNo(request);
 | 
	
		
			
				|  |  | -        log.info("查询状态:{}", transaction);
 | 
	
		
			
				|  |  | -        return transaction;
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      public ResultVo<Object> queryOrderState(String tradeNo) {
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  |              while (TradeVectorUtil.tradeNoBeingQuery(tradeNo) || TradeVectorUtil.tradeNoBeingRefund(tradeNo)) {
 | 
	
	
		
			
				|  | @@ -170,7 +129,11 @@ public class WxApiService {
 | 
	
		
			
				|  |  |                  log.info("订单号:{} 的门诊缴费信息已保存,无需再次查询订单状态。", order.getTradeNo());
 | 
	
		
			
				|  |  |                  return ResultVoUtil.success("保存门诊缴费信息成功。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            Transaction transaction = queryOrderTradeState(tradeNo);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            WechatPayGlobalRequest request = new WechatPayGlobalRequest.Builder()
 | 
	
		
			
				|  |  | +                    .outTradeNo(tradeNo).build();
 | 
	
		
			
				|  |  | +            Transaction transaction = new WeChatPayService().queryOrderState(request);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              Transaction.TradeStateEnum tradeState = transaction.getTradeState();
 | 
	
		
			
				|  |  |              if (tradeState == Transaction.TradeStateEnum.SUCCESS) {
 | 
	
		
			
				|  |  |                  String successTime = transaction.getSuccessTime()
 | 
	
	
		
			
				|  | @@ -203,7 +166,9 @@ public class WxApiService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public ResultVo<String> generateMzGuideBillPayQrcode(GenMzPayQrcodeParam param) {
 | 
	
		
			
				|  |  | -        String[] nativePays = getWxNativePayUrl(param.getTotalAmt(), "湖南泰和医院-门诊缴费");
 | 
	
		
			
				|  |  | +        WechatPayGlobalRequest request = new WechatPayGlobalRequest.Builder()
 | 
	
		
			
				|  |  | +                .totalAmount(param.getTotalAmt()).description("湖南泰和医院-门诊缴费").build();
 | 
	
		
			
				|  |  | +        NativePayResponse response = new WeChatPayService().nativePrepay(request);
 | 
	
		
			
				|  |  |          long timesStamp = System.currentTimeMillis() / 1000;
 | 
	
		
			
				|  |  |          WxPayOrder order = new WxPayOrder();
 | 
	
		
			
				|  |  |          order.setAppId(PropertiesUtil.getLocalProperty("appId"));
 | 
	
	
		
			
				|  | @@ -214,14 +179,14 @@ public class WxApiService {
 | 
	
		
			
				|  |  |          order.setPatientName(dao.selectPatientName(param.getPatientId()));
 | 
	
		
			
				|  |  |          order.setMchId(PropertiesUtil.getLocalProperty("mchId"));
 | 
	
		
			
				|  |  |          order.setTimeStamp(String.valueOf(timesStamp));
 | 
	
		
			
				|  |  | -        order.setTradeNo(nativePays[1]);
 | 
	
		
			
				|  |  | +        order.setTradeNo(response.getTradeNo());
 | 
	
		
			
				|  |  |          order.setCreateDatetime(new Date());
 | 
	
		
			
				|  |  |          order.setTradeState(Transaction.TradeStateEnum.NOTPAY);
 | 
	
		
			
				|  |  |          order.setSerialNo(SnowFlakeId.instance().nextId());
 | 
	
		
			
				|  |  |          order.setOrderType(OrderType.OUTPATIENT.getCode());
 | 
	
		
			
				|  |  |          order.setHisOrdNum(param.getHisOrdNum());
 | 
	
		
			
				|  |  |          dao.insertNewOrder(order);
 | 
	
		
			
				|  |  | -        return ResultVoUtil.success(nativePays[0]);
 | 
	
		
			
				|  |  | +        return ResultVoUtil.success(response.getCodeUrl());
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public ResultVo<Map<String, String>> getWxPayQrcode(WxPyQrcdPrm param) {
 | 
	
	
		
			
				|  | @@ -240,7 +205,11 @@ public class WxApiService {
 | 
	
		
			
				|  |  |              order.setInpatientNo(param.getInpatientNo());
 | 
	
		
			
				|  |  |              order.setAdmissTimes(param.getAdmissTimes());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        String[] nativePays = getWxNativePayUrl(param.getTotalAmt(), param.getDescription());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        WechatPayGlobalRequest request = new WechatPayGlobalRequest.Builder()
 | 
	
		
			
				|  |  | +                .totalAmount(param.getTotalAmt()).description(param.getDescription()).build();
 | 
	
		
			
				|  |  | +        NativePayResponse response = new WeChatPayService().nativePrepay(request);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          long timesStamp = System.currentTimeMillis() / 1000;
 | 
	
		
			
				|  |  |          String orderTypeName = OrderType.get(param.getOrderType()).getLabel();
 | 
	
		
			
				|  |  |          order.setAppId(PropertiesUtil.getLocalProperty("appId"));
 | 
	
	
		
			
				|  | @@ -251,15 +220,15 @@ public class WxApiService {
 | 
	
		
			
				|  |  |          order.setPatientName(patName);
 | 
	
		
			
				|  |  |          order.setMchId(PropertiesUtil.getLocalProperty("mchId"));
 | 
	
		
			
				|  |  |          order.setTimeStamp(String.valueOf(timesStamp));
 | 
	
		
			
				|  |  | -        order.setTradeNo(nativePays[1]);
 | 
	
		
			
				|  |  | +        order.setTradeNo(response.getTradeNo());
 | 
	
		
			
				|  |  |          order.setCreateDatetime(new Date());
 | 
	
		
			
				|  |  |          order.setTradeState(Transaction.TradeStateEnum.NOTPAY);
 | 
	
		
			
				|  |  |          order.setSerialNo(SnowFlakeId.instance().nextId());
 | 
	
		
			
				|  |  |          order.setOrderType(param.getOrderType());
 | 
	
		
			
				|  |  |          dao.insertNewOrder(order);
 | 
	
		
			
				|  |  |          Map<String, String> map = new HashMap<>();
 | 
	
		
			
				|  |  | -        map.put("qrcodeUrl", nativePays[0]);
 | 
	
		
			
				|  |  | -        map.put("tradeNo", nativePays[1]);
 | 
	
		
			
				|  |  | +        map.put("qrcodeUrl", response.getCodeUrl());
 | 
	
		
			
				|  |  | +        map.put("tradeNo", response.getTradeNo());
 | 
	
		
			
				|  |  |          map.put("serialNo", order.getSerialNo());
 | 
	
		
			
				|  |  |          return ResultVoUtil.success(map);
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -275,21 +244,15 @@ public class WxApiService {
 | 
	
		
			
				|  |  |          if (tradeState == Transaction.TradeStateEnum.SUCCESS) {
 | 
	
		
			
				|  |  |              return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,"订单已支付,无法关闭。");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        executeCloseOrder(order.getTradeNo());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        WechatPayGlobalRequest request = new WechatPayGlobalRequest.Builder()
 | 
	
		
			
				|  |  | +                .outTradeNo(order.getTradeNo()).build();
 | 
	
		
			
				|  |  | +        new WeChatPayService().closeOrder(request);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          dao.updatePayStatusOnly(order.getTradeNo(), Transaction.TradeStateEnum.CLOSED);
 | 
	
		
			
				|  |  |          return ResultVoUtil.success("关闭订单成功。");
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    public void executeCloseOrder(String tradeNo) {
 | 
	
		
			
				|  |  | -        Config config = WxPayConfigUtil.getInstance().getConfig();
 | 
	
		
			
				|  |  | -        JsapiService service = new JsapiService.Builder().config(config).build();
 | 
	
		
			
				|  |  | -        CloseOrderRequest request = new CloseOrderRequest();
 | 
	
		
			
				|  |  | -        request.setOutTradeNo(tradeNo);
 | 
	
		
			
				|  |  | -        request.setMchid(PropertiesUtil.getLocalProperty("mchId"));
 | 
	
		
			
				|  |  | -        service.closeOrder(request);
 | 
	
		
			
				|  |  | -        log.info("关闭微信订单:{}", tradeNo);
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      public ResultVo<DoctorInfo> getDoctorInfo(String doctorCode) {
 | 
	
		
			
				|  |  |          DoctorInfo doctorInfo = dao.selectDoctorInfo(doctorCode);
 | 
	
		
			
				|  |  |          if (null == doctorInfo) {
 | 
	
	
		
			
				|  | @@ -309,21 +272,4 @@ public class WxApiService {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return savePayResultService.saveZyYjjInfo(order);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    private String[] getWxNativePayUrl(int payAmt, String description) {
 | 
	
		
			
				|  |  | -        Config config = WxPayConfigUtil.getInstance().getConfig();
 | 
	
		
			
				|  |  | -        NativePayService service = new NativePayService.Builder().config(config).build();
 | 
	
		
			
				|  |  | -        com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest request = new com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest();
 | 
	
		
			
				|  |  | -        com.wechat.pay.java.service.payments.nativepay.model.Amount amount = new com.wechat.pay.java.service.payments.nativepay.model.Amount();
 | 
	
		
			
				|  |  | -        amount.setTotal(payAmt);
 | 
	
		
			
				|  |  | -        request.setAmount(amount);
 | 
	
		
			
				|  |  | -        request.setDescription(description);
 | 
	
		
			
				|  |  | -        request.setAppid(PropertiesUtil.getLocalProperty("appId"));
 | 
	
		
			
				|  |  | -        request.setMchid(PropertiesUtil.getLocalProperty("mchId"));
 | 
	
		
			
				|  |  | -        request.setNotifyUrl(PropertiesUtil.getLocalProperty("nativeNotifyUrl"));
 | 
	
		
			
				|  |  | -        request.setOutTradeNo(SnowFlakeId.instance().nextNativePayTradeNo());
 | 
	
		
			
				|  |  | -        com.wechat.pay.java.service.payments.nativepay.model.PrepayResponse response = service.prepay(request);
 | 
	
		
			
				|  |  | -        log.info("获取微信支付二维码:\n参数:{}\n结果:{}", JSONObject.toJSON(request), response.getCodeUrl());
 | 
	
		
			
				|  |  | -        return new String[] {response.getCodeUrl(), request.getOutTradeNo()};
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  |  }
 |