|
|
@ -115,7 +115,6 @@ namespace Myshipping.Application
|
|
|
|
[HttpGet("/BookingOrderSF/Page")]
|
|
|
|
[HttpGet("/BookingOrderSF/Page")]
|
|
|
|
public async Task<dynamic> Page([FromQuery] BookingOrderSFInput input)
|
|
|
|
public async Task<dynamic> Page([FromQuery] BookingOrderSFInput input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
var entities = await _rep.AsQueryable().Filter(null, true)
|
|
|
|
var entities = await _rep.AsQueryable().Filter(null, true)
|
|
|
|
.Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false)
|
|
|
|
.Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false)
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.KDNO), u => u.KDNO.Contains(input.KDNO))
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.KDNO), u => u.KDNO.Contains(input.KDNO))
|
|
|
@ -134,9 +133,10 @@ namespace Myshipping.Application
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
|
|
|
|
|
|
|
var list = entities.Adapt<SqlSugarPagedList<BookingOrderSFDto>>();
|
|
|
|
var list = entities.Adapt<SqlSugarPagedList<BookingOrderSFDto>>();
|
|
|
|
foreach (var item in list.Items) {
|
|
|
|
foreach (var item in list.Items)
|
|
|
|
|
|
|
|
{
|
|
|
|
item.Business = await _business.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync();
|
|
|
|
item.Business = await _business.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync();
|
|
|
|
item.detail= await _detail.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync();
|
|
|
|
item.detail = await _detail.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -147,19 +147,66 @@ namespace Myshipping.Application
|
|
|
|
[HttpGet("/BookingOrderSF/Save")]
|
|
|
|
[HttpGet("/BookingOrderSF/Save")]
|
|
|
|
public async Task<dynamic> Save(BookingOrderSFDto input)
|
|
|
|
public async Task<dynamic> Save(BookingOrderSFDto input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.KDNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("快递单号不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.SJPeople))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("收件人不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.SJTel))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("收件人电话不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.SJAddress))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("收件人地址不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.FJPeople))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("发件人不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.FJTel))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("发件人电话不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.FJAddress))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("发件人地址不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (input.Id == 0)
|
|
|
|
if (input.Id == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var entity = input.Adapt<BookingOrderSFExpressDelivery>();
|
|
|
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|