fix: 没有gainfo也属于差异数据
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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>()
|
||||
@@ -129,7 +129,7 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
.Any())
|
||||
.Select(x => x.No)
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
presentUserNos.AddRange(businessUserNos);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user