|
|
|
@ -461,12 +461,12 @@ namespace Myshipping.Application
|
|
|
|
|
[HttpPost("CancelBooking")]
|
|
|
|
|
public async Task<string> 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("消单失败,原因:已消单,无需再次消单");
|
|
|
|
|
}
|
|
|
|
|