|
|
|
@@ -185,7 +185,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
//直接调用不会触发事务,spring事务基于AOP代理 |
|
|
|
WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); |
|
|
|
proxy.handleSuccessOrder(oldRecord,order,retMap); |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_PAYING.getCode(),"该订单已经支付,请勿重复支付!"); |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_EXIST.getCode(),"该订单已经支付,请勿重复支付!"); |
|
|
|
}else if (EnumPayStatus.PAY_STATUS_REFUND.getCode()==wxpaystatus) { |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_REFUND.getCode(),"该订单已经退款,无法支付!"); |
|
|
|
}else if (EnumPayStatus.PAY_STATUS_CLOSE.getCode()==wxpaystatus) { |
|
|
|
@@ -322,7 +322,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
// } |
|
|
|
|
|
|
|
Date currentDate = new Date(); |
|
|
|
String payOrderNo = ""; |
|
|
|
//一个订单只有一条支付记录。 |
|
|
|
WxPayOrder orderq = new WxPayOrder(); |
|
|
|
orderq.setOrderId(record.getOrderId()); |
|
|
|
@@ -370,7 +369,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_PAYING.getCode(),"订单支付流水号生成失败!new payorder:"+record.getOrderId()+",id:"+id); |
|
|
|
} |
|
|
|
|
|
|
|
payOrderNo = String.valueOf(id); |
|
|
|
record.setId(id); |
|
|
|
record.updateTenantInfo(order); |
|
|
|
record.setCUserId(user.getId()); |
|
|
|
@@ -379,7 +377,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
record.setPayTimeStart(currentDate); |
|
|
|
record.setPayTimeEnd(currentDate); |
|
|
|
// 支付单号 |
|
|
|
record.setPayOrderNo(payOrderNo); |
|
|
|
record.setPayOrderNo(String.valueOf(id)); |
|
|
|
record.setPayAmount(order.getPayment()); |
|
|
|
record.setPayFrom(payWay.getCode()); |
|
|
|
record.setPayVendor(payWay.getCode()); |
|
|
|
@@ -431,7 +429,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderP)); |
|
|
|
logger.info("pay order, wechat pushOrder, " + wxPayOrderP.toString() + ", response: " + response.toString()); |
|
|
|
Map<String, String> returnMap = WxPayment.xmlToMap(response); |
|
|
|
returnMap.put("payOrderId", payOrderNo); |
|
|
|
returnMap.put("payOrderId", String.valueOf(record.getId())); |
|
|
|
String result_code = returnMap.get("result_code"); |
|
|
|
if ("SUCCESS".equals(result_code)) { |
|
|
|
String prepay_id = returnMap.get("prepay_id"); |
|
|
|
@@ -511,7 +509,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderSP)); |
|
|
|
logger.info("pay order, wechat pushOrder, " + wxPayOrderSP.toString() + ", response: " + response.toString()); |
|
|
|
Map<String, String> returnMap = WxPayment.xmlToMap(response); |
|
|
|
returnMap.put("payOrderId", payOrderNo); |
|
|
|
returnMap.put("payOrderId", String.valueOf(record.getId())); |
|
|
|
String result_code = returnMap.get("result_code"); |
|
|
|
if ("SUCCESS".equals(result_code)) { |
|
|
|
String prepay_id = returnMap.get("prepay_id"); |
|
|
|
|