diff --git a/Myshipping.Application/Service/ExpressDelivery/ExpressDeliveryService.cs b/Myshipping.Application/Service/ExpressDelivery/ExpressDeliveryService.cs index a543f51d..aa91b448 100644 --- a/Myshipping.Application/Service/ExpressDelivery/ExpressDeliveryService.cs +++ b/Myshipping.Application/Service/ExpressDelivery/ExpressDeliveryService.cs @@ -461,12 +461,12 @@ namespace Myshipping.Application [HttpPost("CancelBooking")] public async Task CancelBooking(long Id) { - var order = _orderRep.FirstOrDefault(x => x.Id == Id) ?? throw Oops.Bah("请选择正确数据!"); - if (order.CurrentStateCode is "DJY01" or "DJY02") + var oldOrder = _orderRep.FirstOrDefault(x => x.Id == Id) ?? throw Oops.Bah("请选择正确数据!"); + if (oldOrder.CurrentStateCode is "DJY01" or "DJY02") { throw Oops.Bah("消单失败,原因:尚未下单,无需消单"); } - if (order.CurrentStateCode is "DJY04") + if (oldOrder.CurrentStateCode is "DJY04") { throw Oops.Bah("消单失败,原因:已消单,无需再次消单"); }