JAVA全系列 教程
3762个小节阅读:7092.4k
目录
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
参数名称 | 参数类型 | 是否必须 |
---|---|---|
orderId | String | 是 |
返回Json数据
名称 | 类型 | 是否必须 |
---|---|---|
msg | string | 非必须 |
code | number | 非必须 |
data | object | 非必须 |
├─ allAmount | number | 非必须 |
├─ orderId | string | 非必须 |
├─ payUrl | string | 非必须 |
在OrderChargeController里增加现金支付方法
xxxxxxxxxx
/**
* 订单列表现金支付订单
*/
@GetMapping("payWithCash/{orderId}")
public AjaxResult payWithCash(@PathVariable String orderId){
OrderCharge orderCharge=this.orderChargeService.queryOrderChargeByOrderId(orderId);
if(null==orderCharge){
return AjaxResult.fail("【"+orderId+"】订单号所在的订单不存在,请核对后再输入");
}
if(orderCharge.getOrderStatus().equals(Constants.ORDER_STATUS_1)){
return AjaxResult.fail("【"+orderId+"】订单号不是未支付状态,请核对后再输入");
}
this.orderChargeService.paySuccess(orderId,null,Constants.PAY_TYPE_0);
return AjaxResult.success();
}
订单列表现金支付 /doctor/charge/payWithCash/{orderId},图片
参数名称 | 参数类型 | 是否必须 |
---|---|---|
orderId | String | 是 |
返回JSON数据
名称 | 类型 | 是否必须 |
---|---|---|
msg | string | 非必须 |
code | number | 非必须 |
data | object | 非必须 |
├─ allAmount | number | 非必须 |
├─ orderId | string | 非必须 |
├─ payUrl | string | 非必须 |
修改OrderChargeController,增加toPayOrderWithZfb方法
xxxxxxxxxx
/**
* 订单列表里再次支付宝支付
*/
@GetMapping("toPayOrderWithZfb/{orderId}")
public AjaxResult toPayOrderWithZfb(@PathVariable String orderId){
OrderCharge orderCharge=this.orderChargeService.queryOrderChargeByOrderId(orderId);
if(null==orderCharge){
return AjaxResult.fail("【"+orderId+"】订单号所在的订单不存在,请核对后再输入");
}
if(orderCharge.getOrderStatus().equals(Constants.ORDER_STATUS_1)){
return AjaxResult.fail("【"+orderId+"】订单号不是未支付状态,请核对后再输入");
}
//现转支付宝 支付宝转现金的问题
String outTradeNo=orderId;
String subject="SXT-医疗管理系统支付平台";
String totalAmount=orderCharge.getOrderAmount().toString();
String undiscountableAmount=null;
String body="";
String notifyUrl= AlipayConfig.notifyUrl+outTradeNo;
Map<String, Object> pay = PayService.pay(outTradeNo, subject, totalAmount, undiscountableAmount, body, notifyUrl);
String qrCode = pay.get("qrCode").toString();
if(StringUtils.isNotBlank(qrCode)){
//创建支付成功
Map<String,Object> map=new HashMap<>();
map.put("orderId",orderId);
map.put("allAmount",totalAmount);
map.put("payUrl",qrCode);
return AjaxResult.success(map);
}else{
return AjaxResult.fail(pay.get("msg").toString());
}
}
接口地址/doctor/charge/toPayOrderWithZfb/{orderId},图片