|
|
|
@ -115,7 +115,6 @@ namespace Myshipping.Application
|
|
|
|
|
[HttpGet("/BookingOrderSF/Page")]
|
|
|
|
|
public async Task<dynamic> Page([FromQuery] BookingOrderSFInput input)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var entities = await _rep.AsQueryable().Filter(null, true)
|
|
|
|
|
.Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.KDNO), u => u.KDNO.Contains(input.KDNO))
|
|
|
|
@ -134,7 +133,8 @@ namespace Myshipping.Application
|
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
|
|
|
|
|
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.detail = await _detail.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync();
|
|
|
|
|
}
|
|
|
|
@ -147,14 +147,61 @@ namespace Myshipping.Application
|
|
|
|
|
[HttpGet("/BookingOrderSF/Save")]
|
|
|
|
|
public async Task<dynamic> Save(BookingOrderSFDto input)
|
|
|
|
|
{
|
|
|
|
|
if (input.Id == 0)
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|