fix: 没有gainfo也属于差异数据

This commit is contained in:
2026-06-04 15:18:10 +08:00
parent c81dd84d76
commit be90d98ee1
4 changed files with 13 additions and 5 deletions

View File

@@ -30,9 +30,9 @@ public class GainfoGroupsController : ControllerBase
[HttpGet("tree")]
[IgnoreTenant]
[DataPermission]
public async Task<List<GainfoGroupTreeResponse>> GetTreeAsync()
public async Task<List<GainfoGroupTreeResponse>> GetTreeAsync(string search)
{
return await _gainfoGroupService.GetTreeAsync();
return await _gainfoGroupService.GetTreeAsync(search);
}
/// <summary>

View File

@@ -6,7 +6,7 @@ namespace Dlhis.Basic.Organization.Services;
public interface IGainfoGroupService : IScopeDependency
{
Task<List<GainfoGroupTreeResponse>> GetTreeAsync();
Task<List<GainfoGroupTreeResponse>> GetTreeAsync(string search);
Task SaveAsync(GainfoGroupSaveRequest request);

View File

@@ -34,7 +34,7 @@ public class GainfoGroupService : IGainfoGroupService
_devicePermissionAnalyzeService = devicePermissionAnalyzeService;
}
public async Task<List<GainfoGroupTreeResponse>> GetTreeAsync()
public async Task<List<GainfoGroupTreeResponse>> GetTreeAsync(string search)
{
var gainfoGroups = await _dbContext.Queryable<GainfoGroupEntity>()
.Select<GainfoGroupTreeResponse>()

View File

@@ -475,9 +475,17 @@ public class GainfoUpdateService : IGainfoUpdateService
.GroupBy(x => x.ZWORKCODE)
.ToDictionary(x => x.Key, x => x.First());
var existingCodes = await _dbContext.Queryable<GainfoEntity>().Where(x => workCodes.Contains(x.Code)).Select(x => x.Code).ToListAsync();
var modifiedPersons = new List<SapPersonItem>();
foreach (var person in sapList)
{
if (!existingCodes.Contains(person.ZWORKCODE))
{
modifiedPersons.Add(person);
continue;
}
if (string.IsNullOrWhiteSpace(person.ZWORKCODE))
{
modifiedPersons.Add(person);