|
|
@@ -61,7 +61,7 @@ public class WxPayController {
|
|
|
|
|
|
@ApiOperation(value = "微信JSAPI支付公用方法")
|
|
|
@GetMapping("/wxJsapiPay")
|
|
|
- public MessageResult wxJsapiPay(String orderId) {
|
|
|
+ public MessageResult wxJsapiPay(String orderId,String openId) {
|
|
|
MessageResult msgResult = new MessageResult<>();
|
|
|
try {
|
|
|
OrderInfo orderInfo = orderInfoService.get(orderId);
|
|
|
@@ -69,11 +69,15 @@ public class WxPayController {
|
|
|
if (orderInfo == null) {
|
|
|
throw new Exception("订单不存在");
|
|
|
}
|
|
|
+ if (StringUtils.isBlank(openId)){
|
|
|
+ throw new Exception("openId为空");
|
|
|
+ }
|
|
|
|
|
|
+ orderInfo.setOpenId(openId);
|
|
|
|
|
|
String subMchId = wxJpsoftConfig.getSubMchId();
|
|
|
|
|
|
- PersonInfo personInfo = personInfoService.findByOpenId(orderInfo.getOpenId());
|
|
|
+ PersonInfo personInfo = personInfoService.findByOpenId(openId);
|
|
|
|
|
|
if (personInfo == null) {
|
|
|
throw new Exception("订单支付人不存在");
|
|
|
@@ -92,9 +96,8 @@ public class WxPayController {
|
|
|
if (StringUtils.isNotBlank(wxJpsoftConfig.getUrlKey()) && !outOrderNo.contains(wxJpsoftConfig.getUrlKey())) {
|
|
|
outOrderNo = wxJpsoftConfig.getUrlKey() + outOrderNo;
|
|
|
orderInfo.setOutOrderNo(outOrderNo);
|
|
|
- orderInfoService.update(orderInfo);
|
|
|
}
|
|
|
-
|
|
|
+ orderInfoService.update(orderInfo);
|
|
|
//金额处理
|
|
|
int wxTotalTee = orderInfo.getTotalFee().multiply(new BigDecimal(100)).intValue();
|
|
|
Map<String, String> params = UnifiedOrderModel
|