船期V.处理

optimize
wet 1 year ago
parent 1b3a43229a
commit e8be64b667

@ -850,7 +850,8 @@ namespace Myshipping.Application
entity.YgtETD = vess.YgtETD; entity.YgtETD = vess.YgtETD;
} }
else { else
{
entity.StartETA = null; entity.StartETA = null;
entity.ATD = null; entity.ATD = null;
entity.YgtETD = null; entity.YgtETD = null;

@ -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,7 +133,8 @@ 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();
} }
@ -147,14 +147,61 @@ namespace Myshipping.Application
[HttpGet("/BookingOrderSF/Save")] [HttpGet("/BookingOrderSF/Save")]
public async Task<dynamic> Save(BookingOrderSFDto input) 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
{

@ -422,6 +422,7 @@ namespace Myshipping.Application
{ {
throw Oops.Bah("BSNO未录入"); throw Oops.Bah("BSNO未录入");
} }
//根据东胜bsno获取当前数据查询不到则为新增
var m = mlist.Where(x => x.BSNO == item.BSNO).FirstOrDefault(); var m = mlist.Where(x => x.BSNO == item.BSNO).FirstOrDefault();
var entity = item.Adapt<DjyVesselInfo>(); var entity = item.Adapt<DjyVesselInfo>();
entity.Vessel = item.Vessel.ToUpper().Trim(); entity.Vessel = item.Vessel.ToUpper().Trim();
@ -454,13 +455,14 @@ namespace Myshipping.Application
if (m == null) if (m == null)
{ {
var e = mlist.Where(x => x.CARRIERID == entity.CARRIERID && x.Vessel == entity.Vessel && x.Voyno == entity.Voyno && x.VoynoInside == entity.VoynoInside).FirstOrDefault(); var e = mlist.Where(x => x.CARRIERID == entity.CARRIERID && x.Vessel == entity.Vessel && x.Voyno == entity.Voyno && x.VoynoInside == entity.VoynoInside).FirstOrDefault();
if (e == null)
{
//2023年7月27日王书岚航次为V.开头的不查询船期 //2023年7月27日王书岚航次为V.开头的不查询船期
if (!string.IsNullOrEmpty(entity.VoynoInside) && entity.VoynoInside.StartsWith("V.")) if (!string.IsNullOrEmpty(entity.VoynoInside) && entity.VoynoInside.StartsWith("V."))
{ {
entity.Sign = true; entity.Sign = true;
} }
if (e == null)
{
await _vesselinfo.InsertAsync(entity); await _vesselinfo.InsertAsync(entity);
} }

Loading…
Cancel
Save