改了查询

This commit is contained in:
2025-07-24 11:52:36 +08:00
parent 66f2a9b86f
commit 506f653f44
10 changed files with 295 additions and 20 deletions

View File

@@ -203,6 +203,11 @@ namespace BarCode.Web.Repositories
|| w.Specifications.Contains(dto.MaterialNumber)
).Select(s => s.MaterialNumber).ToList();
}
List<int> cr_ids = new List<int>();
if (!string.IsNullOrEmpty(dto.CreateUser))
{
cr_ids = await _basicsRepositories.GetUserIdsAsync(dto.CreateUser, loginInfo.UserInfo.CompanyId);
}
List<int> sIds = new List<int>();
if (dto.SecurityNumbers != null && dto.SecurityNumbers.Count() > 0)
{
@@ -210,6 +215,7 @@ namespace BarCode.Web.Repositories
.GroupBy(g => g.GenerateRecordId).Select(s => s.Key).ToListAsync();
}
////供应商
//var supplier_result = await _erpService.BillQueryForSupplier();
//List<ErpSupplierDto> suppliers = new List<ErpSupplierDto>();
@@ -252,6 +258,8 @@ namespace BarCode.Web.Repositories
if (dto.SecurityNumbers != null && dto.SecurityNumbers.Count() > 0)
query = query.Where(w => sIds.Contains(w.Id));
if (!string.IsNullOrEmpty(dto.CreateUser))
query = query.Where(w => cr_ids.Contains(w.CreatorId));
int total = await query.CountAsync();
var list = await query.Select(s => new SecurityGenerateRecordInfoResponse()