|
|
@ -107,6 +107,7 @@ namespace Myshipping.Application
|
|
|
|
this._business = business;
|
|
|
|
this._business = business;
|
|
|
|
this._detail = detail;
|
|
|
|
this._detail = detail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 分页查询快递主表
|
|
|
|
/// 分页查询快递主表
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -175,11 +176,11 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw Oops.Bah("发件人地址不能为空!");
|
|
|
|
throw Oops.Bah("发件人地址不能为空!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var entity = input.Adapt<BookingOrderSFExpressDelivery>();
|
|
|
|
|
|
|
|
|
|
|
|
if (input.Id == 0)
|
|
|
|
if (input.Id == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = input.Adapt<BookingOrderSFExpressDelivery>();
|
|
|
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
if (input.Business != null && input.Business.Count > 0)
|
|
|
|
if (input.Business != null && input.Business.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -202,14 +203,100 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(it => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
it.TenantId,
|
|
|
|
|
|
|
|
it.CreatedTime,
|
|
|
|
|
|
|
|
it.CreatedUserId,
|
|
|
|
|
|
|
|
it.CreatedUserName
|
|
|
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
await _business.DeleteAsync(x => x.PId == input.Id);
|
|
|
|
|
|
|
|
await _detail.DeleteAsync(x => x.PId == input.Id);
|
|
|
|
|
|
|
|
if (input.Business != null && input.Business.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in input.Business)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var buentity = item.Adapt<BookingOrderSFExpressdeliveryBusiness>();
|
|
|
|
|
|
|
|
buentity.PId = entity.Id;
|
|
|
|
|
|
|
|
await _business.InsertAsync(buentity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (input.detail != null && input.detail.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in input.detail)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var dentity = item.Adapt<BookingOrderSFExpressdeliveryDetail>();
|
|
|
|
|
|
|
|
dentity.PId = entity.Id;
|
|
|
|
|
|
|
|
await _detail.InsertAsync(dentity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Get(entity.Id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 删除单据
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="Ids"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[SqlSugarUnitOfWork]
|
|
|
|
|
|
|
|
[HttpPost("/BookingOrderSF/Delete")]
|
|
|
|
|
|
|
|
public async Task Delete(string Ids)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var arr = Ids.Split(",");
|
|
|
|
|
|
|
|
if (arr.Count() > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var ar in arr)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
long Id = Convert.ToInt64(ar);
|
|
|
|
|
|
|
|
await _rep.UpdateAsync(x => x.Id == Id, x => new BookingOrderSFExpressDelivery { IsDeleted = true });
|
|
|
|
|
|
|
|
await _detail.DeleteAsync(x => x.PId == Id);
|
|
|
|
|
|
|
|
await _business.DeleteAsync(x => x.PId == Id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw Oops.Bah("请上传正确参数");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取详情
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpPost("/BookingOrderSF/Get")]
|
|
|
|
|
|
|
|
public async Task<dynamic> Get(long Id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BookingOrderSFDto ordOut = new BookingOrderSFDto();
|
|
|
|
|
|
|
|
var main = await _rep.FirstOrDefaultAsync(u => u.Id == Id);
|
|
|
|
|
|
|
|
if (main != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ordOut = main.Adapt<BookingOrderSFDto>();
|
|
|
|
|
|
|
|
var detail = await _detail.AsQueryable().Where(x => x.PId == Id).ToListAsync();
|
|
|
|
|
|
|
|
ordOut.detail = detail;
|
|
|
|
|
|
|
|
var business = await _business.AsQueryable().Where(x => x.PId == Id).ToListAsync();
|
|
|
|
|
|
|
|
ordOut.Business = business;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
|
|
return ordOut;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|