显式抛出

This commit is contained in:
2025-11-14 16:44:32 +08:00
parent 54ef1906ef
commit 1142caaa68
2 changed files with 3 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package com.czg.order.service;
import cn.hutool.core.exceptions.ValidateException; import cn.hutool.core.exceptions.ValidateException;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.czg.exception.CzgException;
import com.czg.exception.OrderCancelException; import com.czg.exception.OrderCancelException;
import com.czg.exception.OrderValidateException; import com.czg.exception.OrderValidateException;
import com.czg.order.dto.*; import com.czg.order.dto.*;
@@ -35,7 +36,7 @@ public interface OrderInfoService extends IService<OrderInfo> {
CzgResult<HistoryOrderPrintVo> getOrderByIdPrint(Long orderId); CzgResult<HistoryOrderPrintVo> getOrderByIdPrint(Long orderId);
HistoryOrderVo historyOrder(Long orderId, String tableCode); HistoryOrderVo historyOrder(Long orderId, String tableCode) throws CzgException;
OrderInfo createOrder(OrderInfoAddDTO param) throws ValidateException; OrderInfo createOrder(OrderInfoAddDTO param) throws ValidateException;

View File

@@ -219,7 +219,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
} }
@Override @Override
public HistoryOrderVo historyOrder(Long orderId, String tableCode) { public HistoryOrderVo historyOrder(Long orderId, String tableCode) throws CzgException {
if (orderId == null && StrUtil.isBlank(tableCode)) { if (orderId == null && StrUtil.isBlank(tableCode)) {
throw new CzgException("订单id或台桌码不可为空"); throw new CzgException("订单id或台桌码不可为空");
} }