|
@@ -2,6 +2,8 @@ package com.example.xiaoshiweixinback.service.weixinpay;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.example.xiaoshiweixinback.business.config.XDns;
|
|
import com.example.xiaoshiweixinback.business.config.XDns;
|
|
|
|
+import com.example.xiaoshiweixinback.business.exception.BusinessException;
|
|
|
|
+import com.example.xiaoshiweixinback.business.exception.ExceptionEnum;
|
|
import com.example.xiaoshiweixinback.business.utils.BatchNoUtil;
|
|
import com.example.xiaoshiweixinback.business.utils.BatchNoUtil;
|
|
import com.example.xiaoshiweixinback.business.utils.CacheUtil;
|
|
import com.example.xiaoshiweixinback.business.utils.CacheUtil;
|
|
import com.example.xiaoshiweixinback.business.utils.FormatUtil;
|
|
import com.example.xiaoshiweixinback.business.utils.FormatUtil;
|
|
@@ -56,6 +58,11 @@ public class WeixinPayService {
|
|
String tradeNo = BatchNoUtil.getOrderNo();
|
|
String tradeNo = BatchNoUtil.getOrderNo();
|
|
PersonnelVO personnelVO = cacheUtil.getLoginUser(LoginUtils.getToken());
|
|
PersonnelVO personnelVO = cacheUtil.getLoginUser(LoginUtils.getToken());
|
|
Order order = orderService.addOrder(weiXinPayDTO, tradeNo, personnelVO);
|
|
Order order = orderService.addOrder(weiXinPayDTO, tradeNo, personnelVO);
|
|
|
|
+ if(order.getTruePrice()<=0){
|
|
|
|
+ String orderTradeNo =order.getTradeNo();
|
|
|
|
+ orderService.payBack(orderTradeNo);
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
JsApiDTO jsApiDTO = this.loadJsApiDTO(order, tradeNo);
|
|
JsApiDTO jsApiDTO = this.loadJsApiDTO(order, tradeNo);
|
|
|
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|