diff --git a/Src/Dlhis.Middle/appsettings.Development.json b/Src/Dlhis.Middle/appsettings.Development.json index e9c3b230..efb527ae 100644 --- a/Src/Dlhis.Middle/appsettings.Development.json +++ b/Src/Dlhis.Middle/appsettings.Development.json @@ -5,7 +5,8 @@ "Microsoft.AspNetCore": "Warning" } }, - "Authority": "https://yikatong.isawesome.cn", - "Factory": "1234", - "HostName": "yikatong.isawesome.cn" + "Authority": "https://face.jinkosolar.com", + "Factory": "1201", + "HostName": "face.jinkosolar.com", + "Download":1 } diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs index a8e12ff3..f2f57ee1 100644 --- a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs @@ -266,7 +266,7 @@ public class GainfoUpdateService : IGainfoUpdateService CostId = item.KOSTL, EntryDate = item.createdate, ResignationDate = item.ZLZRQ, - CardType = Convert.ToInt32(item.ZZ_KLX), + CardType = SafeParseCardType(item.ZZ_KLX), Workplace = _tenants.LastOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM, Factory = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM, }; @@ -326,7 +326,7 @@ public class GainfoUpdateService : IGainfoUpdateService ResignationDate = item.ZLZRQ, Workplace = workplace, Factory = factory, - CardType = Convert.ToInt32(item.ZZ_KLX) + CardType = SafeParseCardType(item.ZZ_KLX) }).Where(x => x.Code == item.ename).ExecuteCommandAsync(); await _identityUserSyncService.SyncAccountAsync(gainfo.Code, gainfo.Name, gainfo.IdNo, factory); } @@ -375,6 +375,30 @@ public class GainfoUpdateService : IGainfoUpdateService { await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync(); } + else + { + var workplace = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM; + var factory = _tenants.LastOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM; + await _dbContext.Updateable().SetColumns(g => new GainfoLeaveEntity + { + InternalNo = item.PERNR, + Name = item.gname, + PositionNo = item.STELL, + Grade = item.ZZ_ZD, + Title = item.Z_ZJ, + Phone = item.phone, + DepartmentNo = item.appellation, + Remark = item.remark, + Degree = item.email, + Werks = item.WERKS, + CostId = item.KOSTL, + EntryDate = item.createdate, + ResignationDate = item.ZLZRQ, + Workplace = workplace, + Factory = factory, + CardType = SafeParseCardType(item.ZZ_KLX) + }).Where(x => x.Code == item.ename).ExecuteCommandAsync(); + } } } @@ -500,4 +524,14 @@ public class GainfoUpdateService : IGainfoUpdateService idNo = idNo.TrimStart(); return idNo[..6]; } + + private static int? SafeParseCardType(string ZZ_KLX) + { + if (int.TryParse(ZZ_KLX, out var cardType)) + { + return cardType; + } + + return null; + } } \ No newline at end of file