|
@@ -46,7 +46,8 @@ public class OrderService {
|
|
// 验证appKey合法性
|
|
// 验证appKey合法性
|
|
App app = appService.get(appKey);
|
|
App app = appService.get(appKey);
|
|
if (Objects.isNull(app)) {
|
|
if (Objects.isNull(app)) {
|
|
- throw new Exception("appKey不存在: " + appKey);
|
|
|
|
|
|
+ logger.error("appKey不存在: {}", appKey);
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
// 生成订单号, 当前时间+5位随机数
|
|
// 生成订单号, 当前时间+5位随机数
|
|
String orderNum = CodeUtil.time();
|
|
String orderNum = CodeUtil.time();
|
|
@@ -75,7 +76,8 @@ public class OrderService {
|
|
public String pay(String orderNum, byte payType, boolean isMobile) throws Exception{
|
|
public String pay(String orderNum, byte payType, boolean isMobile) throws Exception{
|
|
Order order = orderDao.selectByOrderNum(orderNum);
|
|
Order order = orderDao.selectByOrderNum(orderNum);
|
|
if(order.getOrderStatus() == STATUS_PAYED){
|
|
if(order.getOrderStatus() == STATUS_PAYED){
|
|
- throw new Exception("订单已经支付过: " + orderNum);
|
|
|
|
|
|
+ logger.error("订单已经支付过: {}", orderNum);
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
// 添加支付记录
|
|
// 添加支付记录
|
|
String payNum = payService.add(order.getOrderId(), payType);
|
|
String payNum = payService.add(order.getOrderId(), payType);
|