fix 人员更新获取code

This commit is contained in:
2024-03-09 19:37:31 +08:00
parent 33327718d9
commit 7ef1434cff
2 changed files with 7 additions and 8 deletions

View File

@@ -1,5 +1,4 @@
using Dlhis.Basic.Api;
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
using Dlhis.ScheduledTask.DeviceUploadLog.Response;
using Dlhis.ScheduledTask.DeviceUploadLog.Services;
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
@@ -18,12 +17,10 @@ namespace Dlhis.ScheduledTask.DeviceUploadLog.Controllers;
public class DeviceUploadLogsController : ControllerBase
{
private readonly IDeviceUploadLogService _deviceUploadLogService;
private readonly IDevicePermissionApi _devicePermissionApi;
public DeviceUploadLogsController(IDeviceUploadLogService deviceUploadLogService, IDevicePermissionApi devicePermissionApi)
public DeviceUploadLogsController(IDeviceUploadLogService deviceUploadLogService)
{
_deviceUploadLogService = deviceUploadLogService;
_devicePermissionApi = devicePermissionApi;
}
/// <summary>

View File

@@ -174,7 +174,7 @@ public class SyncPersonJob
}
}
private static void UpdatePerson(IDbContext db, GainfoSapEntity item)
private void UpdatePerson(IDbContext db, GainfoSapEntity item)
{
var gainfoSap = db.Queryable<GainfoSapEntity>().Where(x => x.ename == item.ename).First();
db.Updateable<GainfoSapEntity>().SetColumns(g => new GainfoSapEntity
@@ -197,6 +197,8 @@ public class SyncPersonJob
var gainfo = db.Queryable<GainfoEntity>().Where(x => x.Code == item.ename).First();
if (item.isowner == "T")
{
var workplace = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM;
var factory = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM;
db.Updateable<GainfoEntity>().SetColumns(g => new GainfoEntity
{
SapNo = item.PERNR,
@@ -207,8 +209,8 @@ public class SyncPersonJob
Remark = item.remark,
Degree = item.email,
Werks = item.WERKS,
Workplace = item.ZZ_GZDJDNM,
Factory = item.ZZ_GZDCQNM
Workplace = workplace,
Factory = factory
})
.Where(x => x.Code == item.ename)
.ExecuteCommand();