H5订单提交后跳转

This commit is contained in:
gaowdong 2025-05-08 09:20:41 +08:00
parent 3ae2dd7544
commit 63a5e4ee66
3 changed files with 16 additions and 2 deletions

View File

@ -128,6 +128,9 @@ public class OrderBusiness {
for(OrderInfo orderInfo : orderInfoList) { for(OrderInfo orderInfo : orderInfoList) {
deductFromWallets(orderInfo, subsidyWalletBal); deductFromWallets(orderInfo, subsidyWalletBal);
} }
} catch (ServiceException ex) {
log.error("订单支付异常", ex);
throw new ServiceException(ex.getMessage());
} catch (Exception ex) { } catch (Exception ex) {
log.error("订单支付异常", ex); log.error("订单支付异常", ex);
throw new ServiceException("支付失败"); throw new ServiceException("支付失败");

View File

@ -132,7 +132,18 @@ public class OrderInfoController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult addSave(@RequestBody @Valid OrderAddParam orderAddParam) public AjaxResult addSave(@RequestBody @Valid OrderAddParam orderAddParam)
{ {
return toAjax(orderInfoService.insertCanteenOrderInfo(orderAddParam)); try {
orderInfoService.insertCanteenOrderInfo(orderAddParam);
}catch (ServiceException ex) {
if(Integer.valueOf(500001).equals(ex.getCode())) {
return AjaxResult.success(ex.getMessage());
}else {
return AjaxResult.error(ex.getMessage());
}
}catch (Exception ex) {
return AjaxResult.error("下单失败");
}
return AjaxResult.success();
} }
@SysLog(title = "下单", module = "订单", businessType = OperaType.INSERT) @SysLog(title = "下单", module = "订单", businessType = OperaType.INSERT)

View File

@ -150,7 +150,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService
orderBusiness.orderPay(orderInfoList); orderBusiness.orderPay(orderInfoList);
}catch (Exception ex) { }catch (Exception ex) {
orderBusiness.updateOrderPayFailed(orderInfoList); orderBusiness.updateOrderPayFailed(orderInfoList);
throw new ServiceException(ex.getMessage()); throw new ServiceException(ex.getMessage(), 500001);
}finally { }finally {
AccRedisUtils.unlockUpdateAccWalletBalance(orderAddParam.getUserId()); AccRedisUtils.unlockUpdateAccWalletBalance(orderAddParam.getUserId());
} }