From 7ef1434cff818056d82a9b9ee00f686a18e5ae1a Mon Sep 17 00:00:00 2001 From: liguoyang Date: Sat, 9 Mar 2024 19:37:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BA=BA=E5=91=98=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DeviceUploadLogsController.cs | 7 ++----- Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs | 8 +++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs index 09095e3f..c28823c4 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs @@ -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; } /// diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs index ff44ff33..c73899f0 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs @@ -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().Where(x => x.ename == item.ename).First(); db.Updateable().SetColumns(g => new GainfoSapEntity @@ -197,6 +197,8 @@ public class SyncPersonJob var gainfo = db.Queryable().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().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();