修改
This commit is contained in:
@ -80,6 +80,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CARD_NOT_BIND_USER = new ErrorCode(1_004_099_006, "该卡未绑定用户");
|
ErrorCode CARD_NOT_BIND_USER = new ErrorCode(1_004_099_006, "该卡未绑定用户");
|
||||||
ErrorCode INSUFFICIENT_BALANCE = new ErrorCode(1_004_099_007, "余额不足30元,请充值");
|
ErrorCode INSUFFICIENT_BALANCE = new ErrorCode(1_004_099_007, "余额不足30元,请充值");
|
||||||
ErrorCode CARD_ALREADY_BIND = new ErrorCode(1_004_099_008, "卡号已绑定");
|
ErrorCode CARD_ALREADY_BIND = new ErrorCode(1_004_099_008, "卡号已绑定");
|
||||||
|
ErrorCode ORDER_NOT_COMPLETE = new ErrorCode(1_004_099_009, "订单未完成");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ import java.util.Map;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.ORDER_NOT_COMPLETE;
|
||||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.ORDER_NOT_EXISTS;
|
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.ORDER_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,9 +104,13 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void validateOrderExists(Long id) {
|
private void validateOrderExists(Long id) {
|
||||||
if (dishOrderMapper.selectById(id) == null) {
|
DishOrderDO dishOrderDO = dishOrderMapper.selectById(id);
|
||||||
|
if ( dishOrderDO== null) {
|
||||||
throw exception(ORDER_NOT_EXISTS);
|
throw exception(ORDER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
if("0".equals(dishOrderDO.getOrderStatus())){
|
||||||
|
throw exception(ORDER_NOT_COMPLETE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user