|
@@ -82,7 +82,7 @@ public class PayController extends HttpServlet {
|
|
@PostMapping("/getPayUrl")
|
|
@PostMapping("/getPayUrl")
|
|
public Object getListByScan(@RequestBody @Validated PayTypeUrl payTypeUrl) throws UnknownHostException, WxPayException {
|
|
public Object getListByScan(@RequestBody @Validated PayTypeUrl payTypeUrl) throws UnknownHostException, WxPayException {
|
|
CompanyErp company = companyManager.getById(payTypeUrl.getId());
|
|
CompanyErp company = companyManager.getById(payTypeUrl.getId());
|
|
- AdminUser user = adminUserMapper.selectById(payTypeUrl.getId());
|
|
|
|
|
|
+ AdminUser user = adminUserMapper.selectById(payTypeUrl.getUserId());
|
|
if (ObjectUtil.isNull(company)) {
|
|
if (ObjectUtil.isNull(company)) {
|
|
throw new ServiceException("未查询到公司信息");
|
|
throw new ServiceException("未查询到公司信息");
|
|
}
|
|
}
|
|
@@ -97,7 +97,7 @@ public class PayController extends HttpServlet {
|
|
case "ali":
|
|
case "ali":
|
|
return aliPayService.pay(payOrder);
|
|
return aliPayService.pay(payOrder);
|
|
case "wx":
|
|
case "wx":
|
|
- if (StrUtil.isBlank(user.getOpenid())) {
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(user) && StrUtil.isBlank(user.getOpenid())) {
|
|
throw new WxPayException("当前用户未绑定微信,请前往我的个人信息里面绑定微信后再支付");
|
|
throw new WxPayException("当前用户未绑定微信,请前往我的个人信息里面绑定微信后再支付");
|
|
}
|
|
}
|
|
payOrder.setOpenId(user.getOpenid());
|
|
payOrder.setOpenId(user.getOpenid());
|