优化金蝶同步代码

This commit is contained in:
tongfei
2024-03-04 15:45:16 +08:00
parent 7aa23230d1
commit 4570b2080a
6 changed files with 27 additions and 4 deletions

View File

@@ -450,10 +450,14 @@ namespace WMS.Web.Repositories
List<int> ids_Receiver = new List<int>();
List<int> ids_Operator = new List<int>();
if (!string.IsNullOrEmpty(dto.Receiver) || !string.IsNullOrEmpty(dto.Operator))
var staffList = await _basicsRepositories.GetStaffListAsync(_loginRepositories.CompanyId);
if (!string.IsNullOrEmpty(dto.Receiver))
{
var staffList = await _basicsRepositories.GetStaffListAsync(_loginRepositories.CompanyId);
ids_Receiver = staffList.Where(w => w.Name.Contains(dto.Receiver)).Select(s => s.Id).ToList();
}
if (!string.IsNullOrEmpty(dto.Operator))
{
ids_Operator = staffList.Where(w => w.Name.Contains(dto.Operator)).Select(s => s.Id).ToList();
}
@@ -489,8 +493,13 @@ namespace WMS.Web.Repositories
if (ids_Receiver.Count() > 0)
query = query.Where(w => ids_Receiver.Contains(w.order.ReceiverId ?? 0));
else if (!string.IsNullOrEmpty(dto.Receiver))
query = query.Where(w => w.order.ReceiverId == 0);
if (ids_Operator.Count() > 0)
query = query.Where(w => ids_Operator.Contains(w.order.ShelferId ?? 0));
else if (!string.IsNullOrEmpty(dto.Operator))
query = query.Where(w => w.order.ShelferId == 0);
if (dto.SupplierId.HasValue)
query = query.Where(w => w.detail.SupplierId == dto.SupplierId.Value);