获取船代列表信息接口优化

master
zhangxiaofeng 5 months ago
parent 6d77d7f713
commit 3881ca1098

@ -359,8 +359,16 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
// 如果装货港代码不为空,则根据装货港代码查询装货港与船代的映射关系
if (!string.IsNullOrEmpty(input.PortLoadCode))
{
List<string> forwarderCodeList = await _relaPortLoadForwarderRep.AsQueryable().Where(x => x.PortLoadCode == input.PortLoadCode).Select(x => x.ForwarderCode).ToListAsync();
queryList = queryList.Where(x => forwarderCodeList.Contains(x.Code)).ToList();
List<string> forwarderCodeList = await _relaPortLoadForwarderRep.AsQueryable()
.Where(x => x.PortLoadCode == input.PortLoadCode)
.Select(x => x.ForwarderCode)
.ToListAsync();
// 如果确实存在映射关系,再进行过滤;否则
if (forwarderCodeList.Count > 0)
{
queryList = queryList.Where(x => forwarderCodeList.Contains(x.Code)).ToList();
}
}
if (queryList.Count() > 20)

Loading…
Cancel
Save