|
|
|
@ -238,13 +238,21 @@ namespace Myshipping.Application
|
|
|
|
|
List<string> cancelMblnoList = oldMblnoList.Except(newMblnoList).ToList();
|
|
|
|
|
await InsertNewBookingStatusWithMblnoList(cancelMblnoList, STATUS_DISASSOCIATION);
|
|
|
|
|
|
|
|
|
|
// 先删除,再新增业务信息
|
|
|
|
|
await _businessRep.DeleteAsync(x => x.PId == entity.Id);
|
|
|
|
|
input.Business.ForEach(b => b.PId = entity.Id);
|
|
|
|
|
await _businessRep.InsertAsync(input.Business);
|
|
|
|
|
if (addMblnoList.Count != 0 || cancelMblnoList.Count != 0)
|
|
|
|
|
{
|
|
|
|
|
// 先删除,再新增业务信息
|
|
|
|
|
await _businessRep.DeleteAsync(x => x.PId == entity.Id);
|
|
|
|
|
input.Business.ForEach(b => b.PId = entity.Id);
|
|
|
|
|
await _businessRep.InsertAsync(input.Business);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
if (input.IsSending)
|
|
|
|
|
{
|
|
|
|
|
await SendBooking(entity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return await Get(entity.Id);
|
|
|
|
|
}
|
|
|
|
@ -304,12 +312,10 @@ namespace Myshipping.Application
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 发送快递
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("SendBooking")]
|
|
|
|
|
public async Task<dynamic> SendBooking(long Id)
|
|
|
|
|
/// [HttpPost("SendBooking")]
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<dynamic> SendBooking(ExpressDeliveryOrder order)
|
|
|
|
|
{
|
|
|
|
|
var order = _orderRep.FirstOrDefault(x => x.Id == Id);
|
|
|
|
|
if (order == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("请选择正确数据!");
|
|
|
|
@ -322,6 +328,7 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("下单失败,原因:重复下单");
|
|
|
|
|
}
|
|
|
|
|
var Id = order.Id;
|
|
|
|
|
|
|
|
|
|
IDeliverySend deliverySend = GetDeliverySend(order.KDCompany);
|
|
|
|
|
string waybillNo = await deliverySend.CreateOrder(order);
|
|
|
|
|