feat: 处理触发
This commit is contained in:
@@ -36,6 +36,13 @@ public class SyncController : ControllerBase
|
||||
await _gainfoUpdateService.TodoByWerkAsync(request.Code);
|
||||
}
|
||||
|
||||
[HttpPost("/api/sync/gainfo/updateToLeave")]
|
||||
[IgnoreTenant]
|
||||
public async Task UpdatePersonAsync(CodeRequest request)
|
||||
{
|
||||
await _gainfoUpdateService.UpdatePersonAsync(request.Code);
|
||||
}
|
||||
|
||||
[HttpPost("/api/sync/gainfo/user")]
|
||||
[IgnoreTenant]
|
||||
public async Task TodoByCodeAsync(CodeRequest request)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
namespace Dlhis.Basic.Organization.Services;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services;
|
||||
|
||||
public interface IGainfoUpdateService : IScopeDependency
|
||||
{
|
||||
Task TodoByWerkAsync(string werk);
|
||||
|
||||
Task TodoByCodeAsync(string code);
|
||||
|
||||
Task UpdatePersonAsync(string userCode);
|
||||
}
|
||||
@@ -111,6 +111,16 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdatePersonAsync(string userCode)
|
||||
{
|
||||
var gainfoSap = await _dbContext.Queryable<GainfoSapEntity>()
|
||||
.Where(x => x.ename == userCode)
|
||||
.Where(x => x.isowner == "F")
|
||||
.OrderByDescending(x => x.logdate)
|
||||
.FirstAsync();
|
||||
await UpdatePersonAsync(gainfoSap);
|
||||
}
|
||||
|
||||
|
||||
private async Task SavePersonAsync(List<SapPersonItem> persons)
|
||||
{
|
||||
@@ -254,7 +264,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
return info;
|
||||
}
|
||||
|
||||
private async Task UpdatePersonAsync(GainfoSapEntity item)
|
||||
public async Task UpdatePersonAsync(GainfoSapEntity item)
|
||||
{
|
||||
await _dbContext.Client.Ado.BeginTranAsync();
|
||||
try
|
||||
@@ -596,7 +606,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
KOSTL = person.KOSTL_XJ,
|
||||
ZZ_ZD = person.ZZ_ZD,
|
||||
Z_ZJ = person.Z_ZJ,
|
||||
STELL = person.PLANS,//person.STELL, 20251129变更
|
||||
STELL = person.PLANS, //person.STELL, 20251129变更
|
||||
STELL_NM = person.STELL_NM ?? string.Empty,
|
||||
ZLZRQ = person.ZLZRQ,
|
||||
MASSN = person.MASSN ?? string.Empty,
|
||||
|
||||
Reference in New Issue
Block a user