|
|
|
|
@ -14,6 +14,7 @@ import org.springblade.core.tool.utils.SpringUtil; |
|
|
|
|
import org.springblade.modules.auth.endpoint.BladeTokenEndPoint; |
|
|
|
|
import org.springblade.modules.desk.entity.Order; |
|
|
|
|
import org.springblade.modules.desk.service.IOrderService; |
|
|
|
|
import org.springblade.modules.weixin.dto.PayDTO; |
|
|
|
|
import org.springblade.modules.weixin.entity.WeChatPhone; |
|
|
|
|
import org.springblade.modules.weixin.entity.WeChatPhoneInfo; |
|
|
|
|
import org.springblade.modules.weixin.entity.WeChatUser; |
|
|
|
|
@ -96,13 +97,11 @@ public class AppEbLoginController { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 微信下单 |
|
|
|
|
* |
|
|
|
|
* @param openId |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/createOrder") |
|
|
|
|
public R createOrder(@RequestParam String openId, @RequestParam String outTradeNo) { |
|
|
|
|
public R createOrder(@RequestBody PayDTO payDTO) { |
|
|
|
|
// 根据订单号查询订单
|
|
|
|
|
Order order = orderService.getOne(Wrappers.<Order>lambdaQuery().eq(Order::getOrderNo, outTradeNo)); |
|
|
|
|
Order order = orderService.getOne(Wrappers.<Order>lambdaQuery().eq(Order::getOrderNo, payDTO.getOutTradeNo())); |
|
|
|
|
if (order == null) { |
|
|
|
|
throw new ServiceException("该订单不存在"); |
|
|
|
|
} |
|
|
|
|
@ -110,12 +109,12 @@ public class AppEbLoginController { |
|
|
|
|
Double totalPrice = order.getTotalPrice() * 100; |
|
|
|
|
int total = totalPrice.intValue(); |
|
|
|
|
// int total = 1;
|
|
|
|
|
return R.data(WxPayUtils.getPayParam(openId, outTradeNo, total)); |
|
|
|
|
return R.data(WxPayUtils.getPayParam(payDTO.getOpenId(), payDTO.getOutTradeNo(), total)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/cloceOrder") |
|
|
|
|
public R cloceOrder(@RequestParam String outTradeNo) { |
|
|
|
|
return R.data(WxPayUtils.cloceOrderJSApiV3(outTradeNo)); |
|
|
|
|
public R cloceOrder(@RequestBody PayDTO payDTO) { |
|
|
|
|
return R.data(WxPayUtils.cloceOrderJSApiV3(payDTO.getOutTradeNo())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/getOrder") |
|
|
|
|
|