diff --git a/Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs b/Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs index 0e46c6cc..6e60570a 100644 --- a/Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs +++ b/Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs @@ -4,7 +4,6 @@ using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Enums; using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.Core.DataAccess.Dto; -using Kurisu.SqlSugar.Attributes; using Kurisu.SqlSugar.Extensions; using Kurisu.SqlSugar.Services; using Mapster; diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs index 57bbb395..0aa10c72 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs @@ -175,4 +175,22 @@ public class GainfoEntity : SugarBaseEntity /// [SugarColumn(ColumnDescription = "卡号")] public string CarNo { get; set; } + + /// + /// 人事范围 + /// + [SugarColumn(ColumnDescription = "人事范围")] + public string Werks { get; set; } + + /// + /// 人员号 + /// + [SugarColumn(ColumnDescription = "人员号")] + public string Pernr { get; set; } + + /// + /// 邮箱 + /// + [SugarColumn(ColumnDescription = "邮箱")] + public string Email { get; set; } } diff --git a/Src/Dlhis.Entity/Basic/Entity/ZHRF_SYN_01Entity.cs b/Src/Dlhis.Entity/Basic/Entity/ZHRF_SYN_01Entity.cs new file mode 100644 index 00000000..f7db41cb --- /dev/null +++ b/Src/Dlhis.Entity/Basic/Entity/ZHRF_SYN_01Entity.cs @@ -0,0 +1,93 @@ +using Dlhis.Entity; +using SqlSugar; + +namespace Dlhis.ScheduledTask.Entities +{ + /// + /// 部门 + /// + [SugarTable(TableName = "T_ORG", TableDescription = "部门表")] + public class ZHRF_SYN_01Entity : SugarBaseEntity + { + /// + /// 开始日期 + /// + [SugarColumn(ColumnDescription = "开始日期")] + public string BEGDA { get; set; } + + /// + /// 结束日期 + /// + [SugarColumn(ColumnDescription = "结束日期")] + public string ENDDA { get; set; } + + /// + /// 语言代码 + /// + [SugarColumn(ColumnDescription = "语言代码")] + public int LANGU { get; set; } + + /// + /// 部门id + /// + [SugarColumn(ColumnDescription = "部门id")] + public int OBJID { get; set; } + + /// + /// 部门名称 + /// + [SugarColumn(ColumnDescription = "部门名称")] + public string STEXT { get; set; } + + /// + /// 上级部门 + /// + [SugarColumn(ColumnDescription = "上级部门")] + public string SOBID { get; set; } + + /// + /// 部门层级 + /// + [SugarColumn(ColumnDescription = "部门层级")] + public string ZZ_BMCJ { get; set; } + + /// + /// 公司 + /// + [SugarColumn(ColumnDescription = "公司")] + public string ORGID01 { get; set; } + + /// + /// 事业部 + /// + [SugarColumn(ColumnDescription = "事业部")] + public string ORGID02 { get; set; } + + /// + /// 一级部门 + /// + [SugarColumn(ColumnDescription = "一级部门")] + public string ORGID03 { get; set; } + + /// + /// 二级部门 + /// + [SugarColumn(ColumnDescription = "二级部门")] + public string ORGID04 { get; set; } + + /// + /// 三级部门 + /// + [SugarColumn(ColumnDescription = "三级部门")] + public string ORGID05 { get; set; } + + /// + /// 四级部门 + /// + [SugarColumn(ColumnDescription = "四级部门")] + + public string ORGID06 { get; set; } + } + + +} diff --git a/Src/Dlhis.Entity/Basic/Entity/ZHRF_SYN_02Entity.cs b/Src/Dlhis.Entity/Basic/Entity/ZHRF_SYN_02Entity.cs new file mode 100644 index 00000000..17841743 --- /dev/null +++ b/Src/Dlhis.Entity/Basic/Entity/ZHRF_SYN_02Entity.cs @@ -0,0 +1,54 @@ +using Dlhis.Entity; +using SqlSugar; + +namespace Dlhis.ScheduledTask.Entities +{ + /// + /// 职位表 + /// + [SugarTable(TableName = "T_POST", TableDescription = "职位表")] + public class ZHRF_SYN_02Entity : SugarBaseEntity + { + /// + /// 开始日期 + /// + [SugarColumn(ColumnDescription = "开始日期")] + public string BEGDA { get; set; } + + /// + /// 结束日期 + /// + [SugarColumn(ColumnDescription = "结束日期")] + public string ENDDA { get; set; } + + /// + /// 语言代码 + /// + [SugarColumn(ColumnDescription = "语言代码")] + public int LANGU { get; set; } + + /// + /// 岗位编码 + /// + [SugarColumn(ColumnDescription = "岗位编码")] + public string ZJOBID { get; set; } + + /// + /// 岗位名称 + /// + [SugarColumn(ColumnDescription = "岗位名称")] + public string ZJOBANME { get; set; } + + /// + /// 职等 + /// + [SugarColumn(ColumnDescription = "职等")] + public string ZJOBACTID { get; set; } + + /// + /// 所属部门ID + /// + [SugarColumn(ColumnDescription = "所属部门ID")] + public string ZDEPID { get; set; } + } +} diff --git a/Src/Dlhis.ScheduledTask/Comparers/ZHRS_ORGComparer.cs b/Src/Dlhis.ScheduledTask/Comparers/ZHRS_ORGComparer.cs index a65d70a6..6b13097c 100644 --- a/Src/Dlhis.ScheduledTask/Comparers/ZHRS_ORGComparer.cs +++ b/Src/Dlhis.ScheduledTask/Comparers/ZHRS_ORGComparer.cs @@ -1,5 +1,5 @@ -using Dlhis.ScheduledTask.Extensions; -using Dlhis.ScheduledTask.WsProxy; +using Dlhis.ScheduledTask.Entities; +using Dlhis.ScheduledTask.Extensions; namespace Dlhis.ScheduledTask.Comparers { @@ -8,15 +8,26 @@ namespace Dlhis.ScheduledTask.Comparers public bool Equals(ZHRS_ORG x, ZHRS_ORG y) { if (ReferenceEquals(x, y)) return true; - if (ReferenceEquals(x, null)) return false; - if (ReferenceEquals(y, null)) return false; + if (ReferenceEquals(x, null) || ReferenceEquals(y, null)) return false; if (x.GetType() != y.GetType()) return false; - return x.OBJID == y.OBJID && x.STEXT == y.STEXT && x.SOBID == y.SOBID; + + return x.BEGDA == y.BEGDA + && x.ENDDA == y.ENDDA + && x.LANGU == y.LANGU + && x.OBJID == y.OBJID + && x.STEXT == y.STEXT + && x.SOBID == y.SOBID + && x.ORGID01 == y.ORGID01 + && x.ORGID02 == y.ORGID02; } public int GetHashCode(ZHRS_ORG obj) { - return obj.OBJID.SafeGetHashCode() ^ obj.STEXT.SafeGetHashCode() ^ obj.SOBID.SafeGetHashCode(); + return obj.BEGDA.SafeGetHashCode() ^ obj.ENDDA.SafeGetHashCode() + ^ obj.LANGU.SafeGetHashCode() ^ obj.OBJID.SafeGetHashCode() + ^ obj.STEXT.SafeGetHashCode() ^ obj.SOBID.SafeGetHashCode() + ^ obj.ORGID01.SafeGetHashCode() ^ obj.ORGID02.SafeGetHashCode(); } } + } diff --git a/Src/Dlhis.ScheduledTask/Comparers/ZHRS_PERSONComparer.cs b/Src/Dlhis.ScheduledTask/Comparers/ZHRS_PERSONComparer.cs index 7fe514fb..3ac15c41 100644 --- a/Src/Dlhis.ScheduledTask/Comparers/ZHRS_PERSONComparer.cs +++ b/Src/Dlhis.ScheduledTask/Comparers/ZHRS_PERSONComparer.cs @@ -2,7 +2,7 @@ using Dlhis.ScheduledTask.Extensions; using System.Text; -namespace Dlhis.ScheduledTask +namespace Dlhis.ScheduledTask.Comparers { internal class ZHRS_PERSONComparer : IEqualityComparer { diff --git a/Src/Dlhis.ScheduledTask/Comparers/ZHRS_POSTComparer.cs b/Src/Dlhis.ScheduledTask/Comparers/ZHRS_POSTComparer.cs index d74e200e..a52890e3 100644 --- a/Src/Dlhis.ScheduledTask/Comparers/ZHRS_POSTComparer.cs +++ b/Src/Dlhis.ScheduledTask/Comparers/ZHRS_POSTComparer.cs @@ -1,4 +1,5 @@ -using Dlhis.ScheduledTask.WsProxy; +using Dlhis.ScheduledTask.Entities; +using Dlhis.ScheduledTask.Extensions; namespace Dlhis.ScheduledTask.Comparers { @@ -7,15 +8,25 @@ namespace Dlhis.ScheduledTask.Comparers public bool Equals(ZHRS_POST x, ZHRS_POST y) { if (ReferenceEquals(x, y)) return true; - if (ReferenceEquals(x, null)) return false; - if (ReferenceEquals(y, null)) return false; + if (ReferenceEquals(x, null) || ReferenceEquals(y, null)) return false; if (x.GetType() != y.GetType()) return false; - return x.ZJOBID == y.ZJOBID && x.ZJOBNAME == y.ZJOBNAME && x.ZJOBACTID == y.ZJOBACTID && x.ZDEPID == y.ZDEPID; + + return x.BEGDA == y.BEGDA + && x.ENDDA == y.ENDDA + && x.LANGU == y.LANGU + && x.ZJOBID == y.ZJOBID + && x.ZJOBANME == y.ZJOBANME + && x.ZZWID == y.ZZWID + && x.ZDEPID == y.ZDEPID; } public int GetHashCode(ZHRS_POST obj) { - return obj.ZJOBID.SafeGetHashCode() ^ obj.ZJOBNAME.SafeGetHashCode() ^ obj.ZJOBACTID.SafeGetHashCode() ^ obj.ZDEPID.SafeGetHashCode(); + return obj.BEGDA.SafeGetHashCode() ^ obj.ENDDA.SafeGetHashCode() + ^ obj.LANGU.SafeGetHashCode() ^ obj.ZJOBID.SafeGetHashCode() + ^ obj.ZJOBANME.SafeGetHashCode() ^ obj.ZZWID.SafeGetHashCode() + ^ obj.ZDEPID.SafeGetHashCode(); } } + } diff --git a/Src/Dlhis.ScheduledTask/Configurations/ServiceSettings.cs b/Src/Dlhis.ScheduledTask/Configurations/ServiceSettings.cs index cdb1fba0..1c381ff1 100644 --- a/Src/Dlhis.ScheduledTask/Configurations/ServiceSettings.cs +++ b/Src/Dlhis.ScheduledTask/Configurations/ServiceSettings.cs @@ -3,7 +3,7 @@ namespace Dlhis.ScheduledTask.Configurations { - [Configuration] + //[Configuration] public class ServiceSettings { public string ServerUrl { get; private set; } @@ -43,27 +43,7 @@ namespace Dlhis.ScheduledTask.Configurations /// REST密码 /// public string RestPassword { get; set; } - public ServiceSettings() - { - //ServerUrl = ConfigurationManager.AppSettings[nameof(ServerUrl)]; - //UserName = ConfigurationManager.AppSettings[nameof(UserName)]; - //Password = ConfigurationManager.AppSettings[nameof(Password)]; - //SyncTime = ConfigurationManager.AppSettings[nameof(SyncTime)]; - //DlhisDatabase = ConfigurationManager.AppSettings[nameof(DlhisDatabase)]; - //AttendanceUploadUrl = ConfigurationManager.AppSettings[nameof(AttendanceUploadUrl)]; - //AttendanceUploadInterval = SafeParseInt(ConfigurationManager.AppSettings[nameof(AttendanceUploadInterval)]); - //Werks = ConfigurationManager.AppSettings[nameof(Werks)]; - //BeginSyncDate = SafeParseDate(ConfigurationManager.AppSettings[nameof(BeginSyncDate)], DateTime.Today); - //ApiPort = SafeParseInt(ConfigurationManager.AppSettings[nameof(ApiPort)], 8099); - //EHRWebServiceUserName = ConfigurationManager.AppSettings[nameof(EHRWebServiceUserName)]; - //EHRWebServicePassword = ConfigurationManager.AppSettings[nameof(EHRWebServicePassword)]; - //EHRInsertRecordApiUrl = ConfigurationManager.AppSettings[nameof(EHRInsertRecordApiUrl)]; - //EHRDeleteRecordApiUrl = ConfigurationManager.AppSettings[nameof(EHRDeleteRecordApiUrl)]; - //EHRSavePhotoApiUrl = ConfigurationManager.AppSettings[nameof(EHRSavePhotoApiUrl)]; - //EHR_GET_WORK_CARD_INFOApiUrl = ConfigurationManager.AppSettings[nameof(EHR_GET_WORK_CARD_INFOApiUrl)]; - //RestUserName = ConfigurationManager.AppSettings[nameof(RestUserName)]; - //RestPassword = ConfigurationManager.AppSettings[nameof(RestPassword)]; - } + private static int SafeParseInt(string value, int defaultValue = 0) { diff --git a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj index 14b363be..024b57a4 100644 --- a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj +++ b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj @@ -2,7 +2,7 @@ net6.0 - disable + enable enable Linux ..\.. @@ -23,4 +23,8 @@ + + + + diff --git a/Src/Dlhis.ScheduledTask/Entities/ZHRS_ORG.cs b/Src/Dlhis.ScheduledTask/Entities/ZHRS_ORG.cs new file mode 100644 index 00000000..387783d9 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Entities/ZHRS_ORG.cs @@ -0,0 +1,76 @@ +using System.Security.Cryptography; + +namespace Dlhis.ScheduledTask.Entities +{ + public partial class ZHRS_ORG + { + /// + /// 开始日期 + /// + public string BEGDA { get; set; } + + /// + /// 结束日期 + /// + public string ENDDA { get; set; } + + /// + /// 语言 + /// + public int LANGU { get; set; } + + /// + /// 部门id + /// + public int OBJID { get; set; } + + /// + /// 部门名称 + /// + public string STEXT { get; set; } + + /// + /// 上级部门 + /// + public string SOBID { get; set; } + + /// + /// 公司 + /// + public string ORGID01 { get; set; } + + /// + /// 事业部 + /// + public string ORGID02 { get; set; } + } + public partial class ZHRS_ORG : IEquatable + { + public bool Equals(ZHRS_ORG other) + { + if (other is null) + return false; + + return this.BEGDA == other.BEGDA + && this.ENDDA == other.ENDDA + && this.LANGU == other.LANGU + && this.OBJID == other.OBJID + && this.STEXT == other.STEXT + && this.SOBID == other.SOBID + && this.ORGID01 == other.ORGID01 + && this.ORGID02 == other.ORGID02; + } + + public override bool Equals(object obj) => Equals(obj as ZHRS_ORG); + public override int GetHashCode() => (BEGDA, ENDDA, LANGU, OBJID, STEXT, SOBID, ORGID01, ORGID02).GetHashCode(); + } + public class T_ORG + { + public List item { get; set; } + } + + public class ZHRS_ORGResult + { + public T_ORG T_ORG { get; set; } + } +} diff --git a/Src/Dlhis.ScheduledTask/Entities/ZHRS_POST.cs b/Src/Dlhis.ScheduledTask/Entities/ZHRS_POST.cs new file mode 100644 index 00000000..5788b8fa --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Entities/ZHRS_POST.cs @@ -0,0 +1,69 @@ +namespace Dlhis.ScheduledTask.Entities +{ + public partial class ZHRS_POST + { + /// + /// 开始日期 + /// + public string BEGDA { get; set; } + + /// + /// 结束日期 + /// + public string ENDDA { get; set; } + + /// + /// 语言代码 + /// + public int LANGU { get; set; } + + /// + /// 岗位编码 + /// + public string ZJOBID { get; set; } + + /// + /// 岗位名称 + /// + public string ZJOBANME { get; set; } + + /// + /// + /// + public string ZZWID { get; set; } + + /// + /// 所属部门ID + /// + public string ZDEPID { get; set; } + } + + public partial class ZHRS_POST : IEquatable + { + public bool Equals(ZHRS_POST other) + { + if (other is null) + return false; + + return this.BEGDA == other.BEGDA + && this.ENDDA == other.ENDDA + && this.LANGU == other.LANGU + && this.ZJOBID == other.ZJOBID + && this.ZJOBANME == other.ZJOBANME + && this.ZZWID == other.ZZWID + && this.ZDEPID == other.ZDEPID; + } + + public override bool Equals(object obj) => Equals(obj as ZHRS_POST); + public override int GetHashCode() => (BEGDA, ENDDA, LANGU, ZJOBID, ZJOBANME, ZZWID, ZDEPID).GetHashCode(); + } + public class T_POST + { + public List item { get; set; } + } + + public class ZHRS_POSTResult + { + public T_POST T_POST { get; set; } + } +} diff --git a/Src/Dlhis.ScheduledTask/HangfirePack.cs b/Src/Dlhis.ScheduledTask/HangfirePack.cs index 4359a5c1..941cd109 100644 --- a/Src/Dlhis.ScheduledTask/HangfirePack.cs +++ b/Src/Dlhis.ScheduledTask/HangfirePack.cs @@ -1,16 +1,21 @@ -using Hangfire; +using Dlhis.ScheduledTask.Configurations; +using Dlhis.ScheduledTask.Job; +using Hangfire; using Hangfire.Dashboard.BasicAuthorization; using Hangfire.MySql; using Kurisu.AspNetCore.Startup; + namespace Dlhis.ScheduledTask { public class HangfirePack : BaseAppPack { - public override bool IsBeforeUseRouting => true; + public override bool IsBeforeUseRouting { get; } public override void ConfigureServices(IServiceCollection services) { + + services.Configure(Configuration.GetSection("ServiceSettings")); services.AddHangfire(configuration => { var options = new MySqlStorageOptions @@ -23,12 +28,13 @@ namespace Dlhis.ScheduledTask .UseStorage(new MySqlStorage(Configuration.GetConnectionString("HangfireConnection"), options)); }); - + services.UseHangfireto(); services.AddHangfireServer(); } - + public override void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + app.UseHangfireDashboard("/hangfire", new DashboardOptions { AppPath = null, @@ -52,8 +58,12 @@ namespace Dlhis.ScheduledTask }); app.UseHangfireDashboard(); BackgroundJob.Enqueue(() => Console.WriteLine("This is a background job.")); - + RecurringJob.AddOrUpdate("SyncOrgInfoJob_id", s => s.SyncOrgInfo(), "0 0 0 * * ?"); + RecurringJob.AddOrUpdate("SyncPositionJob_id", s =>s.SyncPositionInfo(), "0 0 1 * * ?"); + RecurringJob.AddOrUpdate("SyncPersonJob_id", s => s.SyncPersonInfo(), "0 0 2 * * ?"); } + + } } diff --git a/Src/Dlhis.ScheduledTask/Job/HangfireActivator.cs b/Src/Dlhis.ScheduledTask/Job/HangfireActivator.cs new file mode 100644 index 00000000..0ae96316 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Job/HangfireActivator.cs @@ -0,0 +1,19 @@ +using Hangfire; + +namespace Dlhis.ScheduledTask.Job +{ + public class HangfireActivator : JobActivator + { + private readonly IServiceProvider _serviceProvider; + + public HangfireActivator(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public override object? ActivateJob(Type jobType) + { + return _serviceProvider.GetService(jobType); + } + } +} diff --git a/Src/Dlhis.ScheduledTask/Job/JinkoHrJob.cs b/Src/Dlhis.ScheduledTask/Job/JinkoHrJob.cs deleted file mode 100644 index 4cbcdb01..00000000 --- a/Src/Dlhis.ScheduledTask/Job/JinkoHrJob.cs +++ /dev/null @@ -1,405 +0,0 @@ -using Dlhis.ScheduledTask.Configurations; -using Dlhis.ScheduledTask.Dto; -using Dlhis.ScheduledTask.Entities; -using Dlhis.ScheduledTask.Response; -using Hangfire.Logging; -using Newtonsoft.Json; -using Serilog; -using System.Net.Http.Headers; -using System.Text; -using Dlhis.ScheduledTask.WsProxy; -using Microsoft.Extensions.Options; - -namespace Dlhis.ScheduledTask.Job -{ - public class JinkoHrJob - { - private List lastUpdatedPersonList = new List(); - private List lastUpdatedOrgList = new List(); - private List lastUpdatedPositionList = new List(); - - public ServiceSettings Settings { get; } - private readonly ZHRS_WERKS[] werks; - private readonly ILogger _logger; - private readonly ServiceSettings _serviceSettings; - - public JinkoHrJob(ILogger logger, IOptions options) - { - _logger = logger; - _serviceSettings = options.Value; - } - - private PersonResult GetPersons() - { - HttpClient httpClient = new HttpClient(); - httpClient.Timeout = TimeSpan.FromMinutes(10); - var credentials = string.Format("{0}:{1}", "EHS_USER", "y3R1hd2h*RICAC"); - var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials)); - httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", headerValue); - - List persons = new List(); - - foreach (var item in werks) - { - try - { - var body = new - { - T_WERKS = new - { - item = new List - { - new - { - item.WERKS - } - } - }, - T_PERSON = Array.Empty(), - T_PNO = Array.Empty(), - }; - var content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json"); - - var response = httpClient.PostAsync("http://sappipap01.jinkosolar.cn:50100/RESTAdapter/Rest/EHR_PERSONNEL/", content).Result; - - var jsonResponse = response.Content.ReadAsStringAsync().Result; - if (response.IsSuccessStatusCode) - { - PersonResult personResp = JsonConvert.DeserializeObject(jsonResponse); - if (personResp?.T_PERSON?.item?.Any() == true) - { - persons.AddRange(personResp.T_PERSON.item); - //log.Info($"人事范围[{item.WERKS}]获取{personResp.T_PERSON.item.Count}条数据"); - } - } - else - { - throw new Exception($"请求异常:{response.StatusCode}:" + jsonResponse); - } - // this is webservice call - //var personResp = archivesClient.ZHRF_SYN_03(new ZHRF_SYN_03() - //{ - // //I_DATE = Settings.BeginSyncDate.ToString("yyy-MM-dd"), - // T_PERSON = Array.Empty(), - // T_PNO = Array.Empty(), - // T_WERKS = new ZHRS_WERKS[] { item }, - //}); - } - catch (Exception ex) - { - // log.Error($"人事范围[{item.WERKS}]获取失败:{ex.Message}", ex); - } - } - - return new PersonResult() - { - T_PERSON = new T_PERSON - { - item = persons - }, - }; - } - private List GetModifiedPerson(List sapList) - { - if (lastUpdatedPersonList.Count <= 0) - { - return sapList; - } - var needRemove = sapList.Intersect(lastUpdatedPersonList, new ZHRS_PERSONComparer()); - return sapList.Except(needRemove, new ZHRS_PERSONComparer()).ToList(); - } - private int SavePerson(List persons) - { - - var workCodes = persons.Select(x => x.ZWORKCODE).ToList(); - - var index = 1; - var count = 4000; - var failure = 0; - var total = persons.Count; - // log.Debug($"{i}/{persons.Count}\tName={person.NAME}\tIdNo={person.ZZ_SFZH}\tPERNR={person.PERNR}"); - - log.Debug($"一共{persons.Count}条差异数据"); - - var conn = OpenDlDbConnection(); - - var searchCodes = workCodes.Skip((index - 1) * count).Take(count).ToList(); - while (searchCodes.Count > 0) - { - //var existsWorkCodes = conn.Query($"select ename from gainfo_sap where ename in ( {string.Join(",", searchCodes.Select(x => $"'{x}'"))} )") - // .ToList(); - - var existsWorkCodes = conn.Queryable() - .Where(x => searchCodes.Contains(x.Ename)) - .Select(x => x.Ename) - .ToList(); - - var originUpdates = persons.Where(x => existsWorkCodes.Contains(x.ZWORKCODE)).ToList(); - var originInserts = persons.Where(x => searchCodes.Contains(x.ZWORKCODE)).Except(originUpdates, new ZHRS_PERSONComparer()).ToList(); - - int i = 0; - if (originUpdates.Count + originInserts.Count <= count) - { - var currentTotal = originUpdates.Count + originInserts.Count; - //log.Debug($"正在进行第{index}批次,需要处理{currentTotal}条数据"); - - var updates = ToGainfoSap(originUpdates); - var inserts = ToGainfoSap(originInserts); - - foreach (var item in inserts) - { - i++; - try - { - conn.Execute(SqlGeneration.InsertSql, item); - // 模拟触发器业务逻辑 - SimulateTriggerBusinessLogic(item); - // log.Debug($"执行新增{i}/{currentTotal} name:{item.gname},ename:{item.ename}"); - } - catch (Exception ex) - { - failure++; - //log.Error($"执行新增{i}/{currentTotal} name:{item.gname},ename:{item.ename}失败 \r\n{ex.Message}"); - } - - } - - - - - foreach (var item in updates) - { - i++; - try - { - conn.Execute(SqlGeneration.UpdateSql, item); - // 手动执行触发器的业务逻辑 - UpdateExecuteTriggerBusinessLogic(originUpdates); - //log.Debug($"执行更新{i}/{currentTotal} name:{item.gname},ename:{item.ename}"); - } - catch (Exception ex) - { - failure++; - //log.Error($"执行更新{i}/{currentTotal} name:{item.gname},ename:{item.ename}失败 \r\n{ex.Message}"); - } - } - - - - - } - - index++; - persons = persons.Except(originUpdates).Except(originUpdates).ToList(); - searchCodes = workCodes.Skip((index - 1) * count).Take(count).ToList(); - } - - return failure; - } - //插入 - #region - // 模拟触发器业务逻辑的方法 - private void SimulateTriggerBusinessLogic(GainfoSap item) - { - int ret; - string accnt = GetAccnt(); - - // 判断记录是否存在于 Gainfo 表中 - if (db.Queryable().Any(it => it.IdNO == item.idno)) - { - // 如果存在,执行更新逻辑 - UpdateGainfo(item); - } - else - { - // 如果不存在,执行插入逻辑 - InsertGainfo(item); - } - } - // 更新 Gainfo 表的方法 - private void UpdateGainfo(GainfoSap item) - { - // 此处需要编写更新 Gainfo 表的具体逻辑 - // 根据业务需求更新相应的字段 - // 这里仅为演示,需要替换为实际逻辑 - db.Updateable().UpdateColumns(it => new GainfoEntity - { - - Gname = item.gname, - Ename = item.ename, - Web = item.web, - Phone = item.phone, - Appellation = item.appellation, - Isowner = item.isowner, - Remark = item.remark, - Email = item.email, - - }) - .Where(it => it.IdNO == item.idno) - .ExecuteCommand(); - } - // 插入 Gainfo 表的方法 - private void InsertGainfo(GainfoSap item) - { - // 此处需要编写插入 Gainfo 表的具体逻辑 - // 根据业务需求插入相应的字段 - // 这里仅为演示,需要替换为实际逻辑 - var accnt = GetAccnt(); - db.Insertable(new GainfoEntity - { - Guestno = accnt, - Ano = item.ano, - Class = item.@class, - Gname = item.gname, - Ename = item.ename, - Country = item.country, - Idcls = item.idcls, - Idno = item.idno, - Native = item.native, - Sex = item.sex, - Birthday = item.birthday, - Address = item.address, - Appellation = item.appellation, - Nation = item.nation, - Web = item.web, - Phone = item.phone, - Log_id = item.log_id, - Log_shift = item.log_shift, - Log_date = item.log_date, - Log_ip = item.log_ip, - Isowner = item.isowner, - Remark = item.remark, - - }).ExecuteCommand(); - } - // 获取 accnt 的方法 - private string GetAccnt() - { - int ret; - string accnt = null; - db.Ado.UseStoredProcedure(() => - { - db.Ado.RegisterOutParam("ret", out ret); - db.Ado.RegisterOutParam("accnt", out accnt); - db.Ado.ExecuteCommand("p_xx_pub_getno", new SugarParameter("@ret", ParameterDirection.Output), new SugarParameter("@accnt", ParameterDirection.Output)); - }); - return accnt; - } - #endregion - - //修改 - #region - private void UpdateExecuteTriggerBusinessLogic(List updates) - { - foreach (var item in updates) - { - try - { - ExecuteUpdateLogic(item); - Console.WriteLine($"执行更新逻辑 name:{item.gname}, ename:{item.ename}"); - } - catch (Exception ex) - { - Console.WriteLine($"执行更新逻辑失败 name:{item.gname}, ename:{item.ename} \r\n{ex.Message}"); - } - } - } - private void ExecuteUpdateLogic(GainfoSap updatedItem) - { - //todo 下发任务 - // 获取 accnt - string accnt = GetAccnt(); - - // 检查是否存在相同 idno 的记录 - var existingRecord = db.Queryable().FirstOrDefault(a => a.idno == updatedItem.idno); - - if (existingRecord != null) - { - // 更新已存在的记录的字段 - db.Updateable() - .SetColumns(it => new { it.ano, it.gname, it.ename, it.web, it.phone, it.appellation, it.isowner, it.remark, it.email, it.createdate, it.werks }) - .Where(it => it.idno == updatedItem.idno && !db.Queryable().Any(b => b.idno == updatedItem.idno && b.pernr != updatedItem.pernr && b.isowner == "T") - && !db.Queryable().Any(c => c.idno == updatedItem.idno && c.pernr > updatedItem.pernr && c.isowner == updatedItem.isowner)) - .ExecuteCommand(); - } - else - { - // 不存在相同 idno 的记录,执行插入操作 - db.Ado.BeginTran(); - try - { - accnt = GetAccnt(); - db.Insertable(new GainfoEntity - { - Ano = updatedItem.PERNR, - Guestno = accnt, - Ano = updatedItem.ano, - Class = updatedItem.@class, - Gname = updatedItem.gname, - Ename = updatedItem.ename, - Country = updatedItem.country, - Idcls = updatedItem.idcls, - Idno = updatedItem.idno, - Native = updatedItem.native, - Sex = updatedItem.sex, - Birthday = updatedItem.birthday, - Address = updatedItem.address, - Appellation = updatedItem.appellation, - Nation = updatedItem.nation, - Web = updatedItem.web, - Phone = updatedItem.phone, - Log_id = updatedItem.log_id, - Log_shift = updatedItem.log_shift, - Log_date = updatedItem.log_date, - Log_ip = updatedItem.log_ip, - Isowner = updatedItem.isowner, - Remark = updatedItem.remark, - - }).ExecuteCommand(); - - db.Ado.CommitTran(); - } - catch (Exception) - { - db.Ado.RollbackTran(); - throw; - } - } - } - #endregion - - public void SyncPersonInfo() - { - try - { - //var personResp = JsonConvert.DeserializeObject(File.ReadAllText("C:\\Users\\79144\\Desktop\\request.json")); // GetPersons(); - var personResp = GetPersons();// JsonConvert.DeserializeObject(File.ReadAllText("Cache/request.json")); // GetPersons(); - var persons = personResp.T_PERSON.item; - log.LogInformation("获取人员信息成功,count:" + persons.Count); - File.WriteAllText("Cache/request.json", JsonConvert.SerializeObject(personResp)); - log.LogInformation("请求数据保存到Cache/request.json"); - - if (persons.Count > 0) - { - var modifiedPersons = GetModifiedPerson(persons.OrderByDescending(x => x.ZSTATUS).ThenBy(x => x.ZRZRQ).ToList()); - //WhyDiff(modifiedPersons.Last()); - log.LogInformation($"同步人员差异数据:{modifiedPersons.Count}"); - if (modifiedPersons.Count > 0) - { - var failedRecords = SavePerson(modifiedPersons); - log.Info($"同步人员数据完成,成功{modifiedPersons.Count - failedRecords}条, 失败:{failedRecords}"); - } - else - { - log.LogInformation($"同步人员数据完成,无数据变更"); - } - } - } - catch (Exception ex) - { - log.Error("同步人员信息失败", ex); - } - } - } - -} diff --git a/Src/Dlhis.ScheduledTask/Job/SyncOrgInfoJob.cs b/Src/Dlhis.ScheduledTask/Job/SyncOrgInfoJob.cs new file mode 100644 index 00000000..3381dae1 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Job/SyncOrgInfoJob.cs @@ -0,0 +1,96 @@ +using Dlhis.Entity.Basic.Entity; +using Dlhis.ScheduledTask.Comparers; +using Dlhis.ScheduledTask.Entities; +using Kurisu.SqlSugar.Services; +using Mapster; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; + +namespace Dlhis.ScheduledTask.Job +{ + /// + /// 部门同步定时任务 + /// + public class SyncOrgInfoJob + { + private List lastUpdatedOrgList = new List(); + private readonly IDbContext _dbContext; + + public SyncOrgInfoJob(IDbContext dbContext) + { + _dbContext = dbContext; + } + + + + public async Task SyncOrgInfo() + { + HttpClient httpClient = new HttpClient(); + httpClient.Timeout = TimeSpan.FromMinutes(10); + var credentials = string.Format("{0}:{1}", "EHS_USER", "y3R1hd2h*RICAC"); + var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials)); + httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", headerValue); + + string apiUrl = + "http://sappidap.jinkosolar.cn:51000/RESTAdapter/Rest/EHR_ORGANIZATION/"; + + + string requestBody = "{\"I_DATE\":\"2021-01-01\",\"I_DATE_TO\":\"2022-05-29\",\"I_LANGU\":\"1\",\"T_ID\":{\"item\":[{\"OBJID\":\"50007967\"},{\"OBJID\":\"50008308\"}]}}"; + + HttpResponseMessage response = await httpClient.PostAsync(apiUrl, new StringContent(requestBody, Encoding.UTF8, "application/json")); + + if (response.IsSuccessStatusCode) + { + string responseData = await response.Content.ReadAsStringAsync(); + ZHRS_ORGResult orgResult = JsonSerializer.Deserialize(responseData); + + if (orgResult.T_ORG != null && orgResult.T_ORG.item.Count > 0) + { + var modifiedOrgList = GetModifiedOrg(orgResult.T_ORG?.item); + + // 使用 SQLSugar 将新数据同步到数据库 + await SaveOrg(modifiedOrgList); + } + //} + //else + //{ + // Console.WriteLine($"HTTP请求失败,状态码:{response.StatusCode}"); + } + } + + private List GetModifiedOrg(List sapList) + { + if (lastUpdatedOrgList.Count <= 0) + { + return sapList; + } + + var needRemove = sapList.Intersect(lastUpdatedOrgList, new ZHRS_ORGComparer()); + return sapList.Except(needRemove, new ZHRS_ORGComparer()).ToList(); + } + + private async Task SaveOrg(List modifiedOrgList) + { + if (modifiedOrgList == null || modifiedOrgList.Count == 0) return; + + foreach (ZHRS_ORG item in modifiedOrgList) + { + + + var existingOrgs = await _dbContext.Queryable().Where(x => x.OBJID == item.OBJID).FirstAsync(); + + if (existingOrgs != null) + { + var org = item.Adapt(existingOrgs); + await _dbContext.UpdateAsync(org); + } + else + { + var org = item.Adapt(); + await _dbContext.InsertAsync(org); + } + } + } + } +} diff --git a/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs new file mode 100644 index 00000000..33c7793b --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs @@ -0,0 +1,447 @@ +using Dlhis.ScheduledTask.Comparers; +using Dlhis.ScheduledTask.Dto; +using Dlhis.ScheduledTask.Entities; +using Dlhis.ScheduledTask.Response; +using Newtonsoft.Json; +using System.Data.SqlClient; +using System.Data; +using System.Net.Http.Headers; +using System.Text; +using Dlhis.ScheduledTask.Configurations; +using Kurisu.SqlSugar.Services; +using Dlhis.Entity.Basic.Entity; +using Dlhis.ScheduledTask.Wsproxy.Dlhis.JinkoHr.WsProxy; + +namespace Dlhis.ScheduledTask.Job +{ + public class SyncPersonJob + { + + private List lastUpdatedPersonList = new List(); + private List lastUpdatedOrgList = new List(); + private List lastUpdatedPositionList = new List(); + private readonly ServiceSettings serviceSettings; + private readonly ZHRS_WERKS[] werks; + private readonly IDbContext _dbContext; + public SyncPersonJob(IDbContext dbContext) + { + _dbContext = dbContext; + } + + public void SyncPersonInfo() + { + try + { + //var personResp = JsonConvert.DeserializeObject(File.ReadAllText("C:\\Users\\79144\\Desktop\\request.json")); // GetPersons(); + var personResp = GetPersons();// JsonConvert.DeserializeObject(File.ReadAllText("Cache/request.json")); // GetPersons(); + var persons = personResp.T_PERSON.item; + //log.Info("获取人员信息成功,count:" + persons.Count); + File.WriteAllText("Cache/request.json", JsonConvert.SerializeObject(personResp)); + //log.Info("请求数据保存到Cache/request.json"); + + if (persons.Count > 0) + { + var modifiedPersons = GetModifiedPerson(persons.OrderByDescending(x => x.ZSTATUS).ThenBy(x => x.ZRZRQ).ToList()); + //WhyDiff(modifiedPersons.Last()); + //log.Info($"同步人员差异数据:{modifiedPersons.Count}"); + if (modifiedPersons.Count > 0) + { + var failedRecords = SavePerson(modifiedPersons); + //log.Info($"同步人员数据完成,成功{modifiedPersons.Count - failedRecords}条, 失败:{failedRecords}"); + } + else + { + //log.Info($"同步人员数据完成,无数据变更"); + } + } + } + catch (Exception ex) + { + //log.Error("同步人员信息失败", ex); + } + } + + private async Task SavePerson(List persons) + { + + var workCodes = persons.Select(x => x.ZWORKCODE).ToList(); + + var index = 1; + var count = 4000; + var failure = 0; + var total = persons.Count; + // log.Debug($"{i}/{persons.Count}\tName={person.NAME}\tIdNo={person.ZZ_SFZH}\tPERNR={person.PERNR}"); + + //log.Debug($"一共{persons.Count}条差异数据"); + + //var conn = OpenDlDbConnection(); + + var searchCodes = workCodes.Skip((index - 1) * count).Take(count).ToList(); + while (searchCodes.Count > 0) + { + //var existsWorkCodes = conn.Query($"select ename from gainfo_sap where ename in ( {string.Join(",", searchCodes.Select(x => $"'{x}'"))} )") + // .ToList(); + var existsWorkCodes = _dbContext.Queryable() + .Where(x => searchCodes.Contains(x.Ename)) + .Select(x => x.Ename) + .ToList(); + + var originUpdates = persons.Where(x => existsWorkCodes.Contains(x.ZWORKCODE)).ToList(); + var originInserts = persons.Where(x => searchCodes.Contains(x.ZWORKCODE)).Except(originUpdates, new ZHRS_PERSONComparer()).ToList(); + + int i = 0; + if (originUpdates.Count + originInserts.Count <= count) + { + var currentTotal = originUpdates.Count + originInserts.Count; + //log.Debug($"正在进行第{index}批次,需要处理{currentTotal}条数据"); + + var updates = ToGainfoSap(originUpdates); + var inserts = ToGainfoSap(originInserts); + + foreach (var item in inserts) + { + i++; + try + { + await SavePerson(item); + //conn.Execute(SqlGeneration.InsertSql, item); + //log.Debug($"执行新增{i}/{currentTotal} name:{item.gname},ename:{item.ename}"); + } + catch (Exception ex) + { + failure++; + //log.Error($"执行新增{i}/{currentTotal} name:{item.gname},ename:{item.ename}失败 \r\n{ex.Message}"); + } + + } + + foreach (var item in updates) + { + i++; + try + { + await UpdatePerson(item); + //conn.Execute(SqlGeneration.UpdateSql, item); + //log.Debug($"执行更新{i}/{currentTotal} name:{item.gname},ename:{item.ename}"); + } + catch (Exception ex) + { + failure++; + //log.Error($"执行更新{i}/{currentTotal} name:{item.gname},ename:{item.ename}失败 \r\n{ex.Message}"); + } + } + } + + index++; + persons = persons.Except(originUpdates).Except(originUpdates).ToList(); + searchCodes = workCodes.Skip((index - 1) * count).Take(count).ToList(); + } + + return failure; + } + + private async Task SavePerson(GainfoSap item) + { + var gainfo = await _dbContext.Queryable().Where(x => x.IdNO == item.idno).FirstAsync(); + if (gainfo != null) + { + gainfo.Pernr = item.PERNR; + gainfo.Gname = item.gname; + gainfo.Ename = item.ename; + gainfo.Web = item.web; + gainfo.Phone = item.phone; + gainfo.Appellation = item.appellation; + gainfo.Isowner = item.isowner; + gainfo.Remark = item.remark; + gainfo.Email = item.email; + gainfo.Createdate = (DateTime)item.createdate; + gainfo.Werks = item.WERKS; + await _dbContext.UpdateAsync(gainfo); + } + else + { + var info = new GainfoEntity() + { + Ano = item.ano, + Guestno = item.guestno, + Class = item.@class, + Gname = item.gname, + Ename = item.ename, + Country = item.country, + Idcls = item.idcls, + Native = item.native, + Sex = item.sex, + Birthday = (DateTime)item.birthday, + Address = item.address, + //Occupation = item.occupation, + Appellation = item.appellation, + Nation = item.nation, + Phone = item.phone, + Web = item.web, + Log_id = item.log_id, + Log_shift = item.log_shift, + Log_date = (DateTime)item.log_date, + Log_ip = item.log_ip, + Isowner = item.isowner, + Remark = item.remark, + Email = item.email, + Createdate = (DateTime)item.createdate, + Werks = item.WERKS, + }; + await _dbContext.InsertAsync(info); + } + } + private async Task UpdatePerson(GainfoSap item) + { + var gainfo = await _dbContext.Queryable().Where(x => x.IdNO == item.idno).FirstAsync(); + if (gainfo != null) + { + _dbContext.Updateable().SetColumns(g => new GainfoEntity + { + Pernr = item.PERNR, + Gname = item.gname, + Ename = item.ename, + Web = item.web, + Phone = item.phone, + Appellation = item.appellation, + Isowner = item.isowner, + Remark = item.remark, + Email = item.email, + Createdate = (DateTime)item.createdate, + Werks = item.WERKS + }) + .Where(g => g.IdNO == item.idno + && !_dbContext.Queryable().Any(g => g.IdNO == item.idno && g.Pernr != item.PERNR && g.Isowner == "T") + && !_dbContext.Queryable().Any(g => g.IdNO == item.idno && int.Parse(g.Pernr) > int.Parse(item.PERNR) && g.Isowner == item.isowner)); + } + else + { + _dbContext.Updateable().SetColumns(g => new GainfoEntity + { + Pernr = item.PERNR, + Gname = item.gname, + Ename = item.ename, + Web = item.web, + Phone = item.phone, + Appellation = item.appellation, + Isowner = item.isowner, + Remark = item.remark, + Email = item.email, + Createdate = (DateTime)item.createdate, + Werks = item.WERKS + }) + .Where(g => g.Ano == item.PERNR + && !_dbContext.Queryable().Any(g => g.Ename == item.ename && g.Isowner == "T") + && !_dbContext.Queryable().Any(g => g.IdNO == item.idno && int.Parse(g.Pernr) > int.Parse(item.PERNR) && g.Isowner == item.isowner)); + } + } + + private PersonResult GetPersons() + { + HttpClient httpClient = new HttpClient(); + httpClient.Timeout = TimeSpan.FromMinutes(10); + var credentials = string.Format("{0}:{1}", "EHS_USER", "y3R1hd2h*RICAC"); + var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials)); + httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", headerValue); + + List persons = new List(); + foreach (var item in werks) + { + try + { + var body = new + { + T_WERKS = new + { + item = new List + { + new + { + item.WERKS + } + } + }, + T_PERSON = Array.Empty(), + T_PNO = Array.Empty(), + }; + var content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json"); + + var response = httpClient.PostAsync("http://sappipap01.jinkosolar.cn:50100/RESTAdapter/Rest/EHR_PERSONNEL/", content).Result; + + var jsonResponse = response.Content.ReadAsStringAsync().Result; + if (response.IsSuccessStatusCode) + { + PersonResult personResp = JsonConvert.DeserializeObject(jsonResponse); + if (personResp?.T_PERSON?.item?.Any() == true) + { + persons.AddRange(personResp.T_PERSON.item); + //log.Info($"人事范围[{item.WERKS}]获取{personResp.T_PERSON.item.Count}条数据"); + } + } + else + { + throw new Exception($"请求异常:{response.StatusCode}:" + jsonResponse); + } + // this is webservice call + //var personResp = archivesClient.ZHRF_SYN_03(new ZHRF_SYN_03() + //{ + // //I_DATE = Settings.BeginSyncDate.ToString("yyy-MM-dd"), + // T_PERSON = Array.Empty(), + // T_PNO = Array.Empty(), + // T_WERKS = new ZHRS_WERKS[] { item }, + //}); + } + catch (Exception ex) + { + //log.Error($"人事范围[{item.WERKS}]获取失败:{ex.Message}", ex); + } + } + + return new PersonResult() + { + T_PERSON = new T_PERSON + { + item = persons + }, + }; + } + private List GetModifiedPerson(List sapList) + { + if (lastUpdatedPersonList.Count <= 0) + { + return sapList; + } + var needRemove = sapList.Intersect(lastUpdatedPersonList, new ZHRS_PERSONComparer()); + return sapList.Except(needRemove, new ZHRS_PERSONComparer()).ToList(); + } + private List ToGainfoSap(List data) + { + return data.Select(person => + { + GainfoSap o = null; + try + { + + var position = lastUpdatedPositionList.FirstOrDefault(x => x.ZJOBID == person.PLANS); + var rzrq = SafeParseDate(person.ZRZRQ); + var lzrq = SafeParseDate(person.ZLZRQ); + var rmk = ""; + if (rzrq != null) + rmk = $"入职时间:{rzrq.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)} "; + + if (lzrq != null) + rmk += $"离职时间:{lzrq.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)} "; + + if (!string.IsNullOrWhiteSpace(person.MGTXT)) + rmk += $"离职原因:{person.MGTXT}"; + + var native = GetNative(person.ZZ_SFZH); + var sex = person.GESCH == "2" ? "F" : "M"; + + person.ZZ_SFZH = person.ZZ_SFZH?.TrimStart(); + o = new GainfoSap + { + gname = person.NAME, + ename = person.ZWORKCODE, + idno = SubString(person.ZZ_SFZH, 18), + birthday = SafeParseDate(person.GBDAT).Value, + ZZ_KLX = person.ZZ_KLX, + email = person.ZXUELI, + appellation = person.ORGEH, + phone = person.ZMOBILE, + ZSTATUS = person.ZSTATUS, + createdate = Convert.ToDateTime(person.ZRZRQ), + PERNR = person.PERNR, + WERKS = person.WERKS, + KOSTL = person.KOSTL, + ZZ_ZD = person.ZZ_ZD, + Z_ZJ = person.Z_ZJ, + STELL = person.STELL, + STELL_NM = person.STELL_NM, + ZLZRQ = SafeParseDate(person.ZLZRQ).Value, + MASSN = person.MASSN, + MNTXT = person.MNTXT, + remark = rmk, + native = native, + sex = sex, + web = SubString(position?.ZJOBANME, 30), + logdate = DateTime.Now, + isowner = int.Parse(person.ZSTATUS) < 4 ? "T" : "F", + @class = "C", + country = "CN", + log_ip = "127.0.0.1", + log_shift = "1", + log_id = "XX", + address = "", + occupation = "99", + nation = "01" + }; + + return o; + } + catch (Exception ex) + { + + throw; + } + + }).ToList(); + } + private string GetNative(string idno) + { + if (string.IsNullOrWhiteSpace(idno) || idno.Length < 6) return null; + idno = idno.TrimStart(); + return idno.Substring(0, 6); + } + private DateTime? SafeParseDate(string str) + { + if (string.IsNullOrEmpty(str)) + { + str = "1900-01-01"; + } + + if ("0000-00-00".Equals(str)) + { + str = "1900-01-01"; + } + + if (DateTime.TryParse(str, out var d)) + { + return d; + } + return null; + } + private string SubString(string s, int len) + { + if (string.IsNullOrWhiteSpace(s)) + { + return s?.Trim() ?? ""; + } + s = s.Trim(); + var bs = Encoding.UTF8.GetBytes(s); + if (bs.Length <= len) + { + return s; + } + var bytes = new byte[len]; + Buffer.BlockCopy(bs, 0, bytes, 0, len); + return Encoding.UTF8.GetString(bytes); + } + private IDbConnection OpenDlDbConnection() + { + try + { + IDbConnection conn = new SqlConnection(serviceSettings.DlhisDatabase); + if (conn.State != ConnectionState.Open) + { + conn.Open(); + } + return conn; + } + catch (Exception ex) + { + throw new Exception($"打开迪联数据库错误:{ex.Message}", ex); + } + } + } +} diff --git a/Src/Dlhis.ScheduledTask/Job/SyncPositionJob.cs b/Src/Dlhis.ScheduledTask/Job/SyncPositionJob.cs new file mode 100644 index 00000000..2ef108bb --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Job/SyncPositionJob.cs @@ -0,0 +1,89 @@ +using Dlhis.ScheduledTask.Comparers; +using Dlhis.ScheduledTask.Entities; +using Kurisu.SqlSugar.Services; +using Mapster; +using Newtonsoft.Json; +using System.Net.Http.Headers; +using System.Text; + +namespace Dlhis.ScheduledTask.Job +{ + /// + /// 职位同步定时任务 + /// + public class SyncPositionJob + { + private List lastUpdatedPositionList = new List(); + private readonly IDbContext _dbContext; + + public SyncPositionJob(IDbContext dbContext) + { + _dbContext = dbContext; + } + public async Task SyncPositionInfo() + { + HttpClient httpClient = new HttpClient(); + httpClient.Timeout = TimeSpan.FromMinutes(10); + var credentials = string.Format("{0}:{1}", "EHS_USER", "y3R1hd2h*RICAC"); + var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials)); + httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", headerValue); + + string url = "http://sappidap.jinkosolar.cn:51000/RESTAdapter/Rest/EHR_POSITION/"; + + string requestBody = "{\"I_DATE\":\"2022-05-26\",\"I_DATE_TO\":\"2022-05-29\",\"I_LANGU\":\"1\",\"I_ALLINFO\":\"X\"}"; + + StringContent content = new StringContent(requestBody, Encoding.UTF8, "application/json"); + + HttpResponseMessage response = await httpClient.PostAsync(url, content); + + if (response.IsSuccessStatusCode) + { + string responseContent = await response.Content.ReadAsStringAsync(); + var postResult = JsonConvert.DeserializeObject(responseContent); + + if (postResult.T_POST != null && postResult.T_POST.item.Count > 0) + { + var modifiedOrgList = GetModifiedPosition(postResult.T_POST.item); + + // 步骤 4:使用 SQLSugar 将新数据同步到数据库 + SaveOrg(modifiedOrgList); + } + } + else + { + Console.WriteLine($"HTTP请求失败,状态码:{response.StatusCode}"); + } + } + + private List GetModifiedPosition(List spaList) + { + if (lastUpdatedPositionList.Count <= 0) + { + return spaList; + } + var needRemove = spaList.Intersect(lastUpdatedPositionList, new ZHRS_POSTComparer()); + return spaList.Except(needRemove, new ZHRS_POSTComparer()).ToList(); + } + private async void SaveOrg(List modifiedPostList) + { + if (modifiedPostList == null || modifiedPostList.Count == 0) return; + + foreach (var item in modifiedPostList) + { + var existingPosts = await _dbContext.Queryable().Where(x =>x.ZJOBID == item.ZJOBID).FirstAsync(); + if (existingPosts != null) + { + var entity = item.Adapt(existingPosts); + await _dbContext.UpdateAsync(entity); + } + else + { + var entity = item.Adapt(); + await _dbContext.InsertAsync(entity); + } + } + + + } + } +} diff --git a/Src/Dlhis.ScheduledTask/Job/UseHangfire.cs b/Src/Dlhis.ScheduledTask/Job/UseHangfire.cs new file mode 100644 index 00000000..82021bdf --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Job/UseHangfire.cs @@ -0,0 +1,12 @@ +using Hangfire; + +namespace Dlhis.ScheduledTask.Job +{ + public static class UseHangfire + { + public static void UseHangfireto(this IServiceCollection services) + { + GlobalConfiguration.Configuration.UseActivator(new HangfireActivator(services.BuildServiceProvider())); + } + } +} diff --git a/Src/Dlhis.ScheduledTask/SqlSugarPack.cs b/Src/Dlhis.ScheduledTask/SqlSugarPack.cs new file mode 100644 index 00000000..dec5a3de --- /dev/null +++ b/Src/Dlhis.ScheduledTask/SqlSugarPack.cs @@ -0,0 +1,29 @@ +using Kurisu.AspNetCore.Startup; +using Kurisu.AspNetCore; +using Kurisu.SqlSugar.Extensions; +using SqlSugar; + +namespace Dlhis.ScheduledTask +{ + public class SqlSugarPack : BaseAppPack + { + public override bool IsBeforeUseRouting { get; } + + public override void ConfigureServices(IServiceCollection services) + { + services.AddHttpContextAccessor(); + services.AddSqlSugar(); + } + + public override void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { +#if DEBUG + using var scope = app.ApplicationServices.CreateScope(); + var db = scope.ServiceProvider.GetService(); + var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray(); + db.DbMaintenance.CreateDatabase(); + db.CodeFirst.InitTables(tables); +#endif + } + } +} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_DeleteRecord_OutServiceClient.cs b/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_DeleteRecord_OutServiceClient.cs deleted file mode 100644 index 1c4a801d..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_DeleteRecord_OutServiceClient.cs +++ /dev/null @@ -1,281 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// -// This source code was auto-generated by wsdl, Version=4.7.2053.0. -// - -namespace Dlhis.ScheduledTask.WsProxy -{ - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "SI_DLDM2EHR_DeleteRecord_OutBinding", Namespace = "urn:jinkosolar.com:dldm:ehr_delete_record")] - public partial class SI_DLDM2EHR_DeleteRecord_OutServiceClient : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - private System.Threading.SendOrPostCallback SI_DLDM2EHR_DeleteRecord_OutOperationCompleted; - - /// - public SI_DLDM2EHR_DeleteRecord_OutServiceClient() - { - this.Url = "http://sappidap.jinkosolar.cn:50000/XISOAPAdapter/MessageServlet?senderParty=&sen" + - "derService=DLDM&receiverParty=&receiverService=&interface=SI_DLDM2EHR_DeleteReco" + - "rd_Out&interfaceNamespace=urn%3Ajinkosolar.com%3Adldm%3Aehr_delete_record"; - } - - /// - public event SI_DLDM2EHR_DeleteRecord_OutCompletedEventHandler SI_DLDM2EHR_DeleteRecord_OutCompleted; - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] - [return: System.Xml.Serialization.XmlArrayAttribute("MT_DeleteRecord_Response", Namespace = "urn:jinkosolar.com:ehr:dldm_delete_record")] - [return: System.Xml.Serialization.XmlArrayItemAttribute("T_DATA", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public DT_DeleteRecord_ResponseT_DATA[] SI_DLDM2EHR_DeleteRecord_Out([System.Xml.Serialization.XmlArrayAttribute(Namespace = "urn:jinkosolar.com:ehr:dldm_delete_record")][System.Xml.Serialization.XmlArrayItemAttribute("T_DATA", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] DT_DeleteRecord_RequestT_DATA[] MT_DeleteRecord_Request) - { - object[] results = this.Invoke("SI_DLDM2EHR_DeleteRecord_Out", new object[] { - MT_DeleteRecord_Request}); - return ((DT_DeleteRecord_ResponseT_DATA[])(results[0])); - } - - /// - public System.IAsyncResult BeginSI_DLDM2EHR_DeleteRecord_Out(DT_DeleteRecord_RequestT_DATA[] MT_DeleteRecord_Request, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("SI_DLDM2EHR_DeleteRecord_Out", new object[] { - MT_DeleteRecord_Request}, callback, asyncState); - } - - /// - public DT_DeleteRecord_ResponseT_DATA[] EndSI_DLDM2EHR_DeleteRecord_Out(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((DT_DeleteRecord_ResponseT_DATA[])(results[0])); - } - - /// - public void SI_DLDM2EHR_DeleteRecord_OutAsync(DT_DeleteRecord_RequestT_DATA[] MT_DeleteRecord_Request) - { - this.SI_DLDM2EHR_DeleteRecord_OutAsync(MT_DeleteRecord_Request, null); - } - - /// - public void SI_DLDM2EHR_DeleteRecord_OutAsync(DT_DeleteRecord_RequestT_DATA[] MT_DeleteRecord_Request, object userState) - { - if ((this.SI_DLDM2EHR_DeleteRecord_OutOperationCompleted == null)) - { - this.SI_DLDM2EHR_DeleteRecord_OutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSI_DLDM2EHR_DeleteRecord_OutOperationCompleted); - } - this.InvokeAsync("SI_DLDM2EHR_DeleteRecord_Out", new object[] { - MT_DeleteRecord_Request}, this.SI_DLDM2EHR_DeleteRecord_OutOperationCompleted, userState); - } - - private void OnSI_DLDM2EHR_DeleteRecord_OutOperationCompleted(object arg) - { - if ((this.SI_DLDM2EHR_DeleteRecord_OutCompleted != null)) - { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SI_DLDM2EHR_DeleteRecord_OutCompleted(this, new SI_DLDM2EHR_DeleteRecord_OutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - public new void CancelAsync(object userState) - { - base.CancelAsync(userState); - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:jinkosolar.com:ehr:dldm_delete_record")] - public partial class DT_DeleteRecord_RequestT_DATA - { - - private string zWORKCODEField; - - private string sUBTYField; - - private string bEGDAField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZWORKCODE - { - get - { - return this.zWORKCODEField; - } - set - { - this.zWORKCODEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string SUBTY - { - get - { - return this.sUBTYField; - } - set - { - this.sUBTYField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string BEGDA - { - get - { - return this.bEGDAField; - } - set - { - this.bEGDAField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:jinkosolar.com:ehr:dldm_delete_record")] - public partial class DT_DeleteRecord_ResponseT_DATA - { - - private string zWORKCODEField; - - private string sUBTYField; - - private string bEGDAField; - - private string mSGTYField; - - private string mSGTXField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZWORKCODE - { - get - { - return this.zWORKCODEField; - } - set - { - this.zWORKCODEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string SUBTY - { - get - { - return this.sUBTYField; - } - set - { - this.sUBTYField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string BEGDA - { - get - { - return this.bEGDAField; - } - set - { - this.bEGDAField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MSGTY - { - get - { - return this.mSGTYField; - } - set - { - this.mSGTYField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MSGTX - { - get - { - return this.mSGTXField; - } - set - { - this.mSGTXField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - public delegate void SI_DLDM2EHR_DeleteRecord_OutCompletedEventHandler(object sender, SI_DLDM2EHR_DeleteRecord_OutCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SI_DLDM2EHR_DeleteRecord_OutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - - private object[] results; - - internal SI_DLDM2EHR_DeleteRecord_OutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { - this.results = results; - } - - /// - public DT_DeleteRecord_ResponseT_DATA[] Result - { - get - { - this.RaiseExceptionIfNecessary(); - return ((DT_DeleteRecord_ResponseT_DATA[])(this.results[0])); - } - } - } -} - diff --git a/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_InsertRecord_OutServiceClient.cs b/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_InsertRecord_OutServiceClient.cs deleted file mode 100644 index 8ffca1f3..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_InsertRecord_OutServiceClient.cs +++ /dev/null @@ -1,313 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// -// This source code was auto-generated by wsdl, Version=4.7.2053.0. -namespace Dlhis.ScheduledTask.WsProxy -{ - - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "SI_DLDM2EHR_InsertRecord_OutBinding", Namespace = "urn:jinkosolar.com:dldm:ehr_insert_record")] - public partial class SI_DLDM2EHR_InsertRecord_OutServiceClient : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - private System.Threading.SendOrPostCallback SI_DLDM2EHR_InsertRecord_OutOperationCompleted; - - /// - public SI_DLDM2EHR_InsertRecord_OutServiceClient() - { - this.Url = "http://sappidap.jinkosolar.cn:50000/XISOAPAdapter/MessageServlet?senderParty=&sen" + - "derService=DLDM&receiverParty=&receiverService=&interface=SI_DLDM2EHR_InsertReco" + - "rd_Out&interfaceNamespace=urn%3Ajinkosolar.com%3Adldm%3Aehr_insert_record"; - } - - /// - public event SI_DLDM2EHR_InsertRecord_OutCompletedEventHandler SI_DLDM2EHR_InsertRecord_OutCompleted; - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] - [return: System.Xml.Serialization.XmlArrayAttribute("MT_InsertRecord_Response", Namespace = "urn:jinkosolar.com:ehr:dldm_insert_record")] - [return: System.Xml.Serialization.XmlArrayItemAttribute("T_DATA", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public DT_InsertRecord_ResponseT_DATA[] SI_DLDM2EHR_InsertRecord_Out([System.Xml.Serialization.XmlArrayAttribute(Namespace = "urn:jinkosolar.com:ehr:dldm_insert_record")][System.Xml.Serialization.XmlArrayItemAttribute("T_DATA", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] DT_InsertRecord_RequestT_DATA[] MT_InsertRecord_Request) - { - object[] results = this.Invoke("SI_DLDM2EHR_InsertRecord_Out", new object[] { - MT_InsertRecord_Request}); - return ((DT_InsertRecord_ResponseT_DATA[])(results[0])); - } - - /// - public System.IAsyncResult BeginSI_DLDM2EHR_InsertRecord_Out(DT_InsertRecord_RequestT_DATA[] MT_InsertRecord_Request, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("SI_DLDM2EHR_InsertRecord_Out", new object[] { - MT_InsertRecord_Request}, callback, asyncState); - } - - /// - public DT_InsertRecord_ResponseT_DATA[] EndSI_DLDM2EHR_InsertRecord_Out(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((DT_InsertRecord_ResponseT_DATA[])(results[0])); - } - - /// - public void SI_DLDM2EHR_InsertRecord_OutAsync(DT_InsertRecord_RequestT_DATA[] MT_InsertRecord_Request) - { - this.SI_DLDM2EHR_InsertRecord_OutAsync(MT_InsertRecord_Request, null); - } - - /// - public void SI_DLDM2EHR_InsertRecord_OutAsync(DT_InsertRecord_RequestT_DATA[] MT_InsertRecord_Request, object userState) - { - if ((this.SI_DLDM2EHR_InsertRecord_OutOperationCompleted == null)) - { - this.SI_DLDM2EHR_InsertRecord_OutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSI_DLDM2EHR_InsertRecord_OutOperationCompleted); - } - this.InvokeAsync("SI_DLDM2EHR_InsertRecord_Out", new object[] { - MT_InsertRecord_Request}, this.SI_DLDM2EHR_InsertRecord_OutOperationCompleted, userState); - } - - private void OnSI_DLDM2EHR_InsertRecord_OutOperationCompleted(object arg) - { - if ((this.SI_DLDM2EHR_InsertRecord_OutCompleted != null)) - { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SI_DLDM2EHR_InsertRecord_OutCompleted(this, new SI_DLDM2EHR_InsertRecord_OutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - public new void CancelAsync(object userState) - { - base.CancelAsync(userState); - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:jinkosolar.com:ehr:dldm_insert_record")] - public partial class DT_InsertRecord_RequestT_DATA - { - - private string zWORKCODEField; - - private string sUBTYField; - - private string bEGDAField; - - private string bETRGField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZWORKCODE - { - get - { - return this.zWORKCODEField; - } - set - { - this.zWORKCODEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string SUBTY - { - get - { - return this.sUBTYField; - } - set - { - this.sUBTYField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string BEGDA - { - get - { - return this.bEGDAField; - } - set - { - this.bEGDAField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string BETRG - { - get - { - return this.bETRGField; - } - set - { - this.bETRGField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:jinkosolar.com:ehr:dldm_insert_record")] - public partial class DT_InsertRecord_ResponseT_DATA - { - - private string zWORKCODEField; - - private string sUBTYField; - - private string bEGDAField; - - private string bETRGField; - - private string mSGTYField; - - private string mSGTXField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZWORKCODE - { - get - { - return this.zWORKCODEField; - } - set - { - this.zWORKCODEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string SUBTY - { - get - { - return this.sUBTYField; - } - set - { - this.sUBTYField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string BEGDA - { - get - { - return this.bEGDAField; - } - set - { - this.bEGDAField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string BETRG - { - get - { - return this.bETRGField; - } - set - { - this.bETRGField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MSGTY - { - get - { - return this.mSGTYField; - } - set - { - this.mSGTYField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MSGTX - { - get - { - return this.mSGTXField; - } - set - { - this.mSGTXField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - public delegate void SI_DLDM2EHR_InsertRecord_OutCompletedEventHandler(object sender, SI_DLDM2EHR_InsertRecord_OutCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SI_DLDM2EHR_InsertRecord_OutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - - private object[] results; - - internal SI_DLDM2EHR_InsertRecord_OutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { - this.results = results; - } - - /// - public DT_InsertRecord_ResponseT_DATA[] Result - { - get - { - this.RaiseExceptionIfNecessary(); - return ((DT_InsertRecord_ResponseT_DATA[])(this.results[0])); - } - } - } - } - diff --git a/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_SavePhoto_OutServiceClient.cs b/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_SavePhoto_OutServiceClient.cs deleted file mode 100644 index 378ab16a..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/SI_DLDM2EHR_SavePhoto_OutServiceClient.cs +++ /dev/null @@ -1,216 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// -// This source code was auto-generated by wsdl, Version=4.7.2053.0. -// - -namespace Dlhis.ScheduledTask.WsProxy -{ - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "SI_DLDM2EHR_SavePhoto_OutBinding", Namespace = "urn:jinkosolar.com:dldm:dldm_save_photo")] - public partial class SI_DLDM2EHR_SavePhoto_OutServiceClient : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - private System.Threading.SendOrPostCallback SI_DLDM2EHR_SavePhoto_OutOperationCompleted; - - /// - public SI_DLDM2EHR_SavePhoto_OutServiceClient() - { - this.Url = "http://sappidap.jinkosolar.cn:50000/XISOAPAdapter/MessageServlet?senderParty=&sen" + - "derService=DLDM&receiverParty=&receiverService=&interface=SI_DLDM2EHR_SavePhoto_" + - "Out&interfaceNamespace=urn%3Ajinkosolar.com%3Adldm%3Adldm_save_photo"; - } - - /// - public event SI_DLDM2EHR_SavePhoto_OutCompletedEventHandler SI_DLDM2EHR_SavePhoto_OutCompleted; - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] - [return: System.Xml.Serialization.XmlElementAttribute("MT_SavePhoto_Response", Namespace = "urn:jinkosolar.com:ehr:dldm_save_photo")] - public DT_SavePhoto_Response SI_DLDM2EHR_SavePhoto_Out([System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:jinkosolar.com:ehr:dldm_save_photo")] DT_SavePhoto_Request MT_SavePhoto_Request) - { - object[] results = this.Invoke("SI_DLDM2EHR_SavePhoto_Out", new object[] { - MT_SavePhoto_Request}); - return ((DT_SavePhoto_Response)(results[0])); - } - - /// - public System.IAsyncResult BeginSI_DLDM2EHR_SavePhoto_Out(DT_SavePhoto_Request MT_SavePhoto_Request, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("SI_DLDM2EHR_SavePhoto_Out", new object[] { - MT_SavePhoto_Request}, callback, asyncState); - } - - /// - public DT_SavePhoto_Response EndSI_DLDM2EHR_SavePhoto_Out(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((DT_SavePhoto_Response)(results[0])); - } - - /// - public void SI_DLDM2EHR_SavePhoto_OutAsync(DT_SavePhoto_Request MT_SavePhoto_Request) - { - this.SI_DLDM2EHR_SavePhoto_OutAsync(MT_SavePhoto_Request, null); - } - - /// - public void SI_DLDM2EHR_SavePhoto_OutAsync(DT_SavePhoto_Request MT_SavePhoto_Request, object userState) - { - if ((this.SI_DLDM2EHR_SavePhoto_OutOperationCompleted == null)) - { - this.SI_DLDM2EHR_SavePhoto_OutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSI_DLDM2EHR_SavePhoto_OutOperationCompleted); - } - this.InvokeAsync("SI_DLDM2EHR_SavePhoto_Out", new object[] { - MT_SavePhoto_Request}, this.SI_DLDM2EHR_SavePhoto_OutOperationCompleted, userState); - } - - private void OnSI_DLDM2EHR_SavePhoto_OutOperationCompleted(object arg) - { - if ((this.SI_DLDM2EHR_SavePhoto_OutCompleted != null)) - { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SI_DLDM2EHR_SavePhoto_OutCompleted(this, new SI_DLDM2EHR_SavePhoto_OutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - public new void CancelAsync(object userState) - { - base.CancelAsync(userState); - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:jinkosolar.com:ehr:dldm_save_photo")] - public partial class DT_SavePhoto_Request - { - - private string i_WORKCODEField; - - private string i_PHOTO_STRField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string I_WORKCODE - { - get - { - return this.i_WORKCODEField; - } - set - { - this.i_WORKCODEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string I_PHOTO_STR - { - get - { - return this.i_PHOTO_STRField; - } - set - { - this.i_PHOTO_STRField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:jinkosolar.com:ehr:dldm_save_photo")] - public partial class DT_SavePhoto_Response - { - - private string oLXField; - - private string oMSField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string OLX - { - get - { - return this.oLXField; - } - set - { - this.oLXField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string OMS - { - get - { - return this.oMSField; - } - set - { - this.oMSField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - public delegate void SI_DLDM2EHR_SavePhoto_OutCompletedEventHandler(object sender, SI_DLDM2EHR_SavePhoto_OutCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.2053.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SI_DLDM2EHR_SavePhoto_OutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - - private object[] results; - - internal SI_DLDM2EHR_SavePhoto_OutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { - this.results = results; - } - - /// - public DT_SavePhoto_Response Result - { - get - { - this.RaiseExceptionIfNecessary(); - return ((DT_SavePhoto_Response)(this.results[0])); - } - } - } - -} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SWIPE_DATA_SAVE_CLIENT.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SWIPE_DATA_SAVE_CLIENT.cs deleted file mode 100644 index 1879c084..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SWIPE_DATA_SAVE_CLIENT.cs +++ /dev/null @@ -1,291 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// -// This source code was auto-generated by wsdl, Version=4.6.1055.0. -// - - namespace Dlhis.ScheduledTask.WsProxy -{ - /// - // CODEGEN: The optional WSDL extension element 'Policy' from namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy' was not handled. - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "ZHRF_SWIPE_DATA_SAVE", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SWIPE_DATA_SAVE_CLIENT : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - private System.Threading.SendOrPostCallback CallZHRF_SWIPE_DATA_SAVEOperationCompleted; - - /// - public ZHRF_SWIPE_DATA_SAVE_CLIENT() - { - this.Url = "http://sapehdap.jinkosolar.cn:8121/sap/bc/srt/rfc/sap/zhrf_swipe_data_save/210/zh" + - "rf_swipe_data_save/zhrf_swipe_data_save"; - } - - /// - public event CallZHRF_SWIPE_DATA_SAVECompletedEventHandler CallZHRF_SWIPE_DATA_SAVECompleted; - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] - [return: System.Xml.Serialization.XmlElementAttribute("ZHRF_SWIPE_DATA_SAVEResponse", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public ZHRF_SWIPE_DATA_SAVEResponse CallZHRF_SWIPE_DATA_SAVE([System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] ZHRF_SWIPE_DATA_SAVE ZHRF_SWIPE_DATA_SAVE) - { - object[] results = this.Invoke("CallZHRF_SWIPE_DATA_SAVE", new object[] { - ZHRF_SWIPE_DATA_SAVE}); - return ((ZHRF_SWIPE_DATA_SAVEResponse)(results[0])); - } - - /// - public System.IAsyncResult BeginCallZHRF_SWIPE_DATA_SAVE(ZHRF_SWIPE_DATA_SAVE ZHRF_SWIPE_DATA_SAVE, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("CallZHRF_SWIPE_DATA_SAVE", new object[] { - ZHRF_SWIPE_DATA_SAVE}, callback, asyncState); - } - - /// - public ZHRF_SWIPE_DATA_SAVEResponse EndCallZHRF_SWIPE_DATA_SAVE(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((ZHRF_SWIPE_DATA_SAVEResponse)(results[0])); - } - - /// - public void CallZHRF_SWIPE_DATA_SAVEAsync(ZHRF_SWIPE_DATA_SAVE ZHRF_SWIPE_DATA_SAVE) - { - this.CallZHRF_SWIPE_DATA_SAVEAsync(ZHRF_SWIPE_DATA_SAVE, null); - } - - /// - public void CallZHRF_SWIPE_DATA_SAVEAsync(ZHRF_SWIPE_DATA_SAVE ZHRF_SWIPE_DATA_SAVE, object userState) - { - if ((this.CallZHRF_SWIPE_DATA_SAVEOperationCompleted == null)) - { - this.CallZHRF_SWIPE_DATA_SAVEOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCallZHRF_SWIPE_DATA_SAVEOperationCompleted); - } - this.InvokeAsync("CallZHRF_SWIPE_DATA_SAVE", new object[] { - ZHRF_SWIPE_DATA_SAVE}, this.CallZHRF_SWIPE_DATA_SAVEOperationCompleted, userState); - } - - private void OnCallZHRF_SWIPE_DATA_SAVEOperationCompleted(object arg) - { - if ((this.CallZHRF_SWIPE_DATA_SAVECompleted != null)) - { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CallZHRF_SWIPE_DATA_SAVECompleted(this, new CallZHRF_SWIPE_DATA_SAVECompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - public new void CancelAsync(object userState) - { - base.CancelAsync(userState); - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SWIPE_DATA_SAVE - { - - private ZHRS_SWIPE_DATA[] t_DATAField; - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_SWIPE_DATA[] T_DATA - { - get - { - return this.t_DATAField; - } - set - { - this.t_DATAField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRS_SWIPE_DATA - { - - private string zWORKCODEField; - - private string zDATEField; - - private System.String zTIMEField; - - private string zNOTEField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZWORKCODE - { - get - { - return this.zWORKCODEField; - } - set - { - this.zWORKCODEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZDATE - { - get - { - return this.zDATEField; - } - set - { - this.zDATEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public System.String ZTIME - { - get - { - return this.zTIMEField; - } - set - { - this.zTIMEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZNOTE - { - get - { - return this.zNOTEField; - } - set - { - this.zNOTEField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SWIPE_DATA_SAVEResponse - { - - private string oLXField; - - private string oMSField; - - private ZHRS_SWIPE_DATA[] t_DATAField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string OLX - { - get - { - return this.oLXField; - } - set - { - this.oLXField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string OMS - { - get - { - return this.oMSField; - } - set - { - this.oMSField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_SWIPE_DATA[] T_DATA - { - get - { - return this.t_DATAField; - } - set - { - this.t_DATAField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - public delegate void CallZHRF_SWIPE_DATA_SAVECompletedEventHandler(object sender, CallZHRF_SWIPE_DATA_SAVECompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CallZHRF_SWIPE_DATA_SAVECompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - - private object[] results; - - internal CallZHRF_SWIPE_DATA_SAVECompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { - this.results = results; - } - - /// - public ZHRF_SWIPE_DATA_SAVEResponse Result - { - get - { - this.RaiseExceptionIfNecessary(); - return ((ZHRF_SWIPE_DATA_SAVEResponse)(this.results[0])); - } - } - } -} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_01.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_01.cs deleted file mode 100644 index 80e0247f..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_01.cs +++ /dev/null @@ -1,259 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// -// This source code was auto-generated by wsdl, Version=4.6.1055.0. -// - -namespace Dlhis.ScheduledTask.WsProxy -{ - /// - // CODEGEN: The optional WSDL extension element 'Policy' from namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy' was not handled. - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "ZHRF_SYN_01", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_01 : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - private System.Threading.SendOrPostCallback CallZHRF_SYN_01OperationCompleted; - - /// - public ZHRF_SYN_01() - { - this.Url = "http://sapehpap01.jinkosolar.cn:8125/sap/bc/srt/rfc/sap/zhrf_syn_01/800/zhrf_syn_" + - "01/zhrf_syn_01"; - } - - /// - public event CallZHRF_SYN_01CompletedEventHandler CallZHRF_SYN_01Completed; - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:sap-com:document:sap:rfc:functions:ZHRF_SYN_01:ZHRF_SYN_01Request", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] - [return: System.Xml.Serialization.XmlElementAttribute("ZHRF_SYN_01Response", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public ZHRF_SYN_01Response CallZHRF_SYN_01([System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] ZHRF_SYN_011 ZHRF_SYN_01) - { - object[] results = this.Invoke("CallZHRF_SYN_01", new object[] { - ZHRF_SYN_01}); - return ((ZHRF_SYN_01Response)(results[0])); - } - - /// - public System.IAsyncResult BeginCallZHRF_SYN_01(ZHRF_SYN_011 ZHRF_SYN_01, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("CallZHRF_SYN_01", new object[] { - ZHRF_SYN_01}, callback, asyncState); - } - - /// - public ZHRF_SYN_01Response EndCallZHRF_SYN_01(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((ZHRF_SYN_01Response)(results[0])); - } - - /// - public void CallZHRF_SYN_01Async(ZHRF_SYN_011 ZHRF_SYN_01) - { - this.CallZHRF_SYN_01Async(ZHRF_SYN_01, null); - } - - /// - public void CallZHRF_SYN_01Async(ZHRF_SYN_011 ZHRF_SYN_01, object userState) - { - if ((this.CallZHRF_SYN_01OperationCompleted == null)) - { - this.CallZHRF_SYN_01OperationCompleted = new System.Threading.SendOrPostCallback(this.OnCallZHRF_SYN_01OperationCompleted); - } - this.InvokeAsync("CallZHRF_SYN_01", new object[] { - ZHRF_SYN_01}, this.CallZHRF_SYN_01OperationCompleted, userState); - } - - private void OnCallZHRF_SYN_01OperationCompleted(object arg) - { - if ((this.CallZHRF_SYN_01Completed != null)) - { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CallZHRF_SYN_01Completed(this, new CallZHRF_SYN_01CompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - public new void CancelAsync(object userState) - { - base.CancelAsync(userState); - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_011 - { - - private string i_DATEField; - - private ZHRS_ORG[] t_ORGField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string I_DATE - { - get - { - return this.i_DATEField; - } - set - { - this.i_DATEField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_ORG[] T_ORG - { - get - { - return this.t_ORGField; - } - set - { - this.t_ORGField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRS_ORG - { - - private string oBJIDField; - - private string sTEXTField; - - private string sOBIDField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string OBJID - { - get - { - return this.oBJIDField; - } - set - { - this.oBJIDField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string STEXT - { - get - { - return this.sTEXTField; - } - set - { - this.sTEXTField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string SOBID - { - get - { - return this.sOBIDField; - } - set - { - this.sOBIDField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_01Response - { - - private ZHRS_ORG[] t_ORGField; - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_ORG[] T_ORG - { - get - { - return this.t_ORGField; - } - set - { - this.t_ORGField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - public delegate void CallZHRF_SYN_01CompletedEventHandler(object sender, CallZHRF_SYN_01CompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CallZHRF_SYN_01CompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - - private object[] results; - - internal CallZHRF_SYN_01CompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { - this.results = results; - } - - /// - public ZHRF_SYN_01Response Result - { - get - { - this.RaiseExceptionIfNecessary(); - return ((ZHRF_SYN_01Response)(this.results[0])); - } - } - } -} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_02.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_02.cs deleted file mode 100644 index c276d3a6..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_02.cs +++ /dev/null @@ -1,275 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// -// This source code was auto-generated by wsdl, Version=4.6.1055.0. -// - -namespace Dlhis.ScheduledTask.WsProxy -{ - /// - // CODEGEN: The optional WSDL extension element 'Policy' from namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy' was not handled. - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "ZHRF_SYN_02", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_02 : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - private System.Threading.SendOrPostCallback CallZHRF_SYN_02OperationCompleted; - - /// - public ZHRF_SYN_02() - { - this.Url = "http://172.16.7.58:8125/sap/bc/srt/rfc/sap/zhrf_syn_02/800/zhrf_syn_" + - "02/zhrf_syn_02"; - } - - /// - public event CallZHRF_SYN_02CompletedEventHandler CallZHRF_SYN_02Completed; - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:sap-com:document:sap:rfc:functions:ZHRF_SYN_02:ZHRF_SYN_02Request", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] - [return: System.Xml.Serialization.XmlElementAttribute("ZHRF_SYN_02Response", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public ZHRF_SYN_02Response CallZHRF_SYN_02([System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] ZHRF_SYN_021 ZHRF_SYN_02) - { - object[] results = this.Invoke("CallZHRF_SYN_02", new object[] { - ZHRF_SYN_02}); - return ((ZHRF_SYN_02Response)(results[0])); - } - - /// - public System.IAsyncResult BeginCallZHRF_SYN_02(ZHRF_SYN_021 ZHRF_SYN_02, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("CallZHRF_SYN_02", new object[] { - ZHRF_SYN_02}, callback, asyncState); - } - - /// - public ZHRF_SYN_02Response EndCallZHRF_SYN_02(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((ZHRF_SYN_02Response)(results[0])); - } - - /// - public void CallZHRF_SYN_02Async(ZHRF_SYN_021 ZHRF_SYN_02) - { - this.CallZHRF_SYN_02Async(ZHRF_SYN_02, null); - } - - /// - public void CallZHRF_SYN_02Async(ZHRF_SYN_021 ZHRF_SYN_02, object userState) - { - if ((this.CallZHRF_SYN_02OperationCompleted == null)) - { - this.CallZHRF_SYN_02OperationCompleted = new System.Threading.SendOrPostCallback(this.OnCallZHRF_SYN_02OperationCompleted); - } - this.InvokeAsync("CallZHRF_SYN_02", new object[] { - ZHRF_SYN_02}, this.CallZHRF_SYN_02OperationCompleted, userState); - } - - private void OnCallZHRF_SYN_02OperationCompleted(object arg) - { - if ((this.CallZHRF_SYN_02Completed != null)) - { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CallZHRF_SYN_02Completed(this, new CallZHRF_SYN_02CompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - public new void CancelAsync(object userState) - { - base.CancelAsync(userState); - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_021 - { - - private string i_DATEField; - - private ZHRS_POST[] t_POSTField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string I_DATE - { - get - { - return this.i_DATEField; - } - set - { - this.i_DATEField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_POST[] T_POST - { - get - { - return this.t_POSTField; - } - set - { - this.t_POSTField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRS_POST - { - - private string zJOBIDField; - - private string zJOBNAMEField; - - private string zJOBACTIDField; - - private string zDEPIDField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZJOBID - { - get - { - return this.zJOBIDField; - } - set - { - this.zJOBIDField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZJOBNAME - { - get - { - return this.zJOBNAMEField; - } - set - { - this.zJOBNAMEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZJOBACTID - { - get - { - return this.zJOBACTIDField; - } - set - { - this.zJOBACTIDField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZDEPID - { - get - { - return this.zDEPIDField; - } - set - { - this.zDEPIDField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_02Response - { - - private ZHRS_POST[] t_POSTField; - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_POST[] T_POST - { - get - { - return this.t_POSTField; - } - set - { - this.t_POSTField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - public delegate void CallZHRF_SYN_02CompletedEventHandler(object sender, CallZHRF_SYN_02CompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CallZHRF_SYN_02CompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - - private object[] results; - - internal CallZHRF_SYN_02CompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { - this.results = results; - } - - /// - public ZHRF_SYN_02Response Result - { - get - { - this.RaiseExceptionIfNecessary(); - return ((ZHRF_SYN_02Response)(this.results[0])); - } - } - } -} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs index d85e7a28..26406eb2 100644 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs +++ b/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs @@ -1,855 +1,851 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// -// This source code was auto-generated by wsdl, Version=4.6.1055.0. -// -namespace Dlhis.ScheduledTask.WsProxy +namespace Dlhis.ScheduledTask.Wsproxy { + //------------------------------------------------------------------------------ + // + // This code was generated by a tool. + // Runtime Version:4.0.30319.42000 + // + // Changes to this file may cause incorrect behavior and will be lost if + // the code is regenerated. + // + //------------------------------------------------------------------------------ - /// - // CODEGEN: The optional WSDL extension element 'Policy' from namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy' was not handled. - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "ZHRF_SYN_03N", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_03N : System.Web.Services.Protocols.SoapHttpClientProtocol + // + // This source code was auto-generated by wsdl, Version=4.6.1055.0. + // + namespace Dlhis.JinkoHr.WsProxy { - private System.Threading.SendOrPostCallback ZHRF_SYN_03OperationCompleted; - /// - public ZHRF_SYN_03N() + // CODEGEN: The optional WSDL extension element 'Policy' from namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy' was not handled. + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + //[System.Web.Services.WebServiceBindingAttribute(Name = "ZHRF_SYN_03N", Namespace = "urn:sap-com:document:sap:rfc:functions")] + /*public partial class ZHRF_SYN_03N : System.Web.Services.Protocols.SoapHttpClientProtocol { - this.Url = "http://172.16.7.58:8125/sap/bc/srt/rfc/sap/zhrf_syn_03n/800/zhrf_syn" + - "_03n/zhrf_syn_03n"; - } - /// - public event ZHRF_SYN_03CompletedEventHandler ZHRF_SYN_03Completed; + private System.Threading.SendOrPostCallback ZHRF_SYN_03OperationCompleted; - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:sap-com:document:sap:rfc:functions:ZHRF_SYN_03N:ZHRF_SYN_03Request", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] - [return: System.Xml.Serialization.XmlElementAttribute("ZHRF_SYN_03Response", Namespace = "urn:sap-com:document:sap:rfc:functions")] - public ZHRF_SYN_03Response ZHRF_SYN_03([System.Xml.Serialization.XmlElementAttribute("ZHRF_SYN_03", Namespace = "urn:sap-com:document:sap:rfc:functions")] ZHRF_SYN_03 ZHRF_SYN_031) - { - object[] results = this.Invoke("ZHRF_SYN_03", new object[] { + /// + public ZHRF_SYN_03N() + { + this.Url = "http://172.16.7.58:8125/sap/bc/srt/rfc/sap/zhrf_syn_03n/800/zhrf_syn" + + "_03n/zhrf_syn_03n"; + } + + /// + public event ZHRF_SYN_03CompletedEventHandler ZHRF_SYN_03Completed; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:sap-com:document:sap:rfc:functions:ZHRF_SYN_03N:ZHRF_SYN_03Request", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("ZHRF_SYN_03Response", Namespace = "urn:sap-com:document:sap:rfc:functions")] + public ZHRF_SYN_03Response ZHRF_SYN_03([System.Xml.Serialization.XmlElementAttribute("ZHRF_SYN_03", Namespace = "urn:sap-com:document:sap:rfc:functions")] ZHRF_SYN_03 ZHRF_SYN_031) + { + object[] results = this.Invoke("ZHRF_SYN_03", new object[] { ZHRF_SYN_031}); - return ((ZHRF_SYN_03Response)(results[0])); - } + return ((ZHRF_SYN_03Response)(results[0])); + } - /// - public System.IAsyncResult BeginZHRF_SYN_03(ZHRF_SYN_03 ZHRF_SYN_031, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("ZHRF_SYN_03", new object[] { + /// + public System.IAsyncResult BeginZHRF_SYN_03(ZHRF_SYN_03 ZHRF_SYN_031, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ZHRF_SYN_03", new object[] { ZHRF_SYN_031}, callback, asyncState); - } - - /// - public ZHRF_SYN_03Response EndZHRF_SYN_03(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((ZHRF_SYN_03Response)(results[0])); - } - - /// - public void ZHRF_SYN_03Async(ZHRF_SYN_03 ZHRF_SYN_031) - { - this.ZHRF_SYN_03Async(ZHRF_SYN_031, null); - } - - /// - public void ZHRF_SYN_03Async(ZHRF_SYN_03 ZHRF_SYN_031, object userState) - { - if ((this.ZHRF_SYN_03OperationCompleted == null)) - { - this.ZHRF_SYN_03OperationCompleted = new System.Threading.SendOrPostCallback(this.OnZHRF_SYN_03OperationCompleted); } - this.InvokeAsync("ZHRF_SYN_03", new object[] { + + /// + public ZHRF_SYN_03Response EndZHRF_SYN_03(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ZHRF_SYN_03Response)(results[0])); + } + + /// + public void ZHRF_SYN_03Async(ZHRF_SYN_03 ZHRF_SYN_031) + { + this.ZHRF_SYN_03Async(ZHRF_SYN_031, null); + } + + /// + public void ZHRF_SYN_03Async(ZHRF_SYN_03 ZHRF_SYN_031, object userState) + { + if ((this.ZHRF_SYN_03OperationCompleted == null)) + { + this.ZHRF_SYN_03OperationCompleted = new System.Threading.SendOrPostCallback(this.OnZHRF_SYN_03OperationCompleted); + } + this.InvokeAsync("ZHRF_SYN_03", new object[] { ZHRF_SYN_031}, this.ZHRF_SYN_03OperationCompleted, userState); - } + } - private void OnZHRF_SYN_03OperationCompleted(object arg) - { - if ((this.ZHRF_SYN_03Completed != null)) + private void OnZHRF_SYN_03OperationCompleted(object arg) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.ZHRF_SYN_03Completed(this, new ZHRF_SYN_03CompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + if ((this.ZHRF_SYN_03Completed != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ZHRF_SYN_03Completed(this, new ZHRF_SYN_03CompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { + base.CancelAsync(userState); + } + }*/ + + /* /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")]*/ + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] + public partial class ZHRF_SYN_03 + { + + private string i_DATEField; + + private ZHRS_PERSON[] t_PERSONField; + + private ZHRS_PNO[] t_PNOField; + + private ZHRS_WERKS[] t_WERKSField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string I_DATE + { + get + { + return this.i_DATEField; + } + set + { + this.i_DATEField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] + public ZHRS_PERSON[] T_PERSON + { + get + { + return this.t_PERSONField; + } + set + { + this.t_PERSONField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] + public ZHRS_PNO[] T_PNO + { + get + { + return this.t_PNOField; + } + set + { + this.t_PNOField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] + public ZHRS_WERKS[] T_WERKS + { + get + { + return this.t_WERKSField; + } + set + { + this.t_WERKSField = value; + } } } /// - public new void CancelAsync(object userState) + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] + public partial class ZHRS_PERSON { - base.CancelAsync(userState); - } - } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_03 - { + private string pERNRField; - private string i_DATEField; + private string wERKSField; - private ZHRS_PERSON[] t_PERSONField; + private string oRGEHField; - private ZHRS_PNO[] t_PNOField; + private string pLANSField; - private ZHRS_WERKS[] t_WERKSField; + private string zZ_SJGHField; - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string I_DATE - { - get + private string zZ_AQJBField; + + private string nAMEField; + + private string gESCHField; + + private string gBDATField; + + private string zZ_SFZHField; + + private string zTELEField; + + private string zWORKCODEField; + + private string zMOBILEField; + + private string zEMAILField; + + private string zSTATUSField; + private string zZZ_XSQYField; + private string zKOSTLField; + private string zZZ_ZDField; + private string zZ_ZJField; + private string zZRZRQField; + private string zZLZRQField; + private string zMASSGField; + private string zMGTXTField; + + private string zBEGDAField; + + private string zENDDAField; + + private string zSTELLField; + + private string zSTELL_NMField; + + private string zZADZHField; + + private string zSTAT2Field; + + private string zZCJRQField; + + private string zZZZRQField; + + private string zMASSNField; + + private string zMNTXTField; + + private string zXUELIField; + + private string zZ_KLXField; + + + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string PERNR { - return this.i_DATEField; + get + { + return this.pERNRField; + } + set + { + this.pERNRField = value; + } } - set + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string WERKS { - this.i_DATEField = value; + get + { + return this.wERKSField; + } + set + { + this.wERKSField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ORGEH + { + get + { + return this.oRGEHField; + } + set + { + this.oRGEHField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string PLANS + { + get + { + return this.pLANSField; + } + set + { + this.pLANSField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZZ_SJGH + { + get + { + return this.zZ_SJGHField; + } + set + { + this.zZ_SJGHField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZZ_AQJB + { + get + { + return this.zZ_AQJBField; + } + set + { + this.zZ_AQJBField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string NAME + { + get + { + return this.nAMEField; + } + set + { + this.nAMEField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string GESCH + { + get + { + return this.gESCHField; + } + set + { + this.gESCHField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string GBDAT + { + get + { + return this.gBDATField; + } + set + { + this.gBDATField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZZ_SFZH + { + get + { + return this.zZ_SFZHField; + } + set + { + this.zZ_SFZHField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZTELE + { + get + { + return this.zTELEField; + } + set + { + this.zTELEField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZWORKCODE + { + get + { + return this.zWORKCODEField; + } + set + { + this.zWORKCODEField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZMOBILE + { + get + { + return this.zMOBILEField; + } + set + { + this.zMOBILEField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZEMAIL + { + get + { + return this.zEMAILField; + } + set + { + this.zEMAILField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZSTATUS + { + get + { + return this.zSTATUSField; + } + set + { + this.zSTATUSField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZZ_XSQY + { + get + { + return this.zZZ_XSQYField; + } + set + { + this.zZZ_XSQYField = value; + } + } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string KOSTL + { + get + { + return this.zKOSTLField; + } + set + { + this.zKOSTLField = value; + } + } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZZ_ZD + { + get + { + return this.zZZ_ZDField; + } + set + { + this.zZZ_ZDField = value; + } + } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + /// + public string Z_ZJ + { + get + { + return this.zZ_ZJField; + } + set + { + this.zZ_ZJField = value; + } + } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZRZRQ + { + get + { + return this.zZRZRQField; + } + set + { + this.zZRZRQField = value; + } + } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZLZRQ + { + get + { + return this.zZLZRQField; + } + set + { + this.zZLZRQField = value; + } + } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string MASSG + { + get + { + return this.zMASSGField; + } + set + { + this.zMASSGField = value; + } + } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string MGTXT + { + get + { + return this.zMGTXTField; + } + set + { + this.zMGTXTField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string BEGDA + { + get + { + return zBEGDAField; + } + set + { + zBEGDAField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ENDDA + { + get + { + return zENDDAField; + } + set + { + zENDDAField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string STELL + { + get + { + return zSTELLField; + } + set + { + zSTELLField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string STELL_NM + { + get + { + return zSTELL_NMField; + } + set + { + zSTELL_NMField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZADZH + { + get + { + return zZADZHField; + } + set + { + zZADZHField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string STAT2 + { + get + { + return zSTAT2Field; + } + set + { + zSTAT2Field = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZCJRQ + { + get + { + return zZCJRQField; + } + set + { + zZCJRQField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZZZRQ + { + get + { + return zZZZRQField; + } + set + { + zZZZRQField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string MASSN + { + get + { + return zMASSNField; + } + set + { + zMASSNField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string MNTXT + { + get + { + return zMNTXTField; + } + set + { + zMNTXTField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZXUELI + { + get + { + return zXUELIField; + } + set + { + zXUELIField = value; + } + } + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZZ_KLX + { + get + { + return zZ_KLXField; + } + set + { + zZ_KLXField = value; + } } } /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_PERSON[] T_PERSON + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] + public partial class ZHRS_WERKS { - get + + private string wERKSField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string WERKS { - return this.t_PERSONField; - } - set - { - this.t_PERSONField = value; + get + { + return this.wERKSField; + } + set + { + this.wERKSField = value; + } } } /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_PNO[] T_PNO + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] + public partial class ZHRS_PNO { - get + + private string zWORKCODEField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ZWORKCODE { - return this.t_PNOField; - } - set - { - this.t_PNOField = value; + get + { + return this.zWORKCODEField; + } + set + { + this.zWORKCODEField = value; + } } } /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_WERKS[] T_WERKS + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] + public partial class ZHRF_SYN_03Response { - get + + private ZHRS_PERSON[] t_PERSONField; + + private ZHRS_PNO[] t_PNOField; + + private ZHRS_WERKS[] t_WERKSField; + + /// + [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] + public ZHRS_PERSON[] T_PERSON { - return this.t_WERKSField; + get + { + return this.t_PERSONField; + } + set + { + this.t_PERSONField = value; + } } - set + + /// + [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] + public ZHRS_PNO[] T_PNO { - this.t_WERKSField = value; + get + { + return this.t_PNOField; + } + set + { + this.t_PNOField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] + public ZHRS_WERKS[] T_WERKS + { + get + { + return this.t_WERKSField; + } + set + { + this.t_WERKSField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + public delegate void ZHRF_SYN_03CompletedEventHandler(object sender, ZHRF_SYN_03CompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ZHRF_SYN_03CompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal ZHRF_SYN_03CompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ZHRF_SYN_03Response Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ZHRF_SYN_03Response)(this.results[0])); + } } } } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRS_PERSON - { - - private string pERNRField; - - private string wERKSField; - - private string oRGEHField; - - private string pLANSField; - - private string zZ_SJGHField; - - private string zZ_AQJBField; - - private string nAMEField; - - private string gESCHField; - - private string gBDATField; - - private string zZ_SFZHField; - - private string zTELEField; - - private string zWORKCODEField; - - private string zMOBILEField; - - private string zEMAILField; - - private string zSTATUSField; - private string zZZ_XSQYField; - private string zKOSTLField; - private string zZZ_ZDField; - private string zZ_ZJField; - private string zZRZRQField; - private string zZLZRQField; - private string zMASSGField; - private string zMGTXTField; - - private string zBEGDAField; - - private string zENDDAField; - - private string zSTELLField; - - private string zSTELL_NMField; - - private string zZADZHField; - - private string zSTAT2Field; - - private string zZCJRQField; - - private string zZZZRQField; - - private string zMASSNField; - - private string zMNTXTField; - - private string zXUELIField; - - private string zZ_KLXField; - - - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string PERNR - { - get - { - return this.pERNRField; - } - set - { - this.pERNRField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string WERKS - { - get - { - return this.wERKSField; - } - set - { - this.wERKSField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ORGEH - { - get - { - return this.oRGEHField; - } - set - { - this.oRGEHField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string PLANS - { - get - { - return this.pLANSField; - } - set - { - this.pLANSField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZZ_SJGH - { - get - { - return this.zZ_SJGHField; - } - set - { - this.zZ_SJGHField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZZ_AQJB - { - get - { - return this.zZ_AQJBField; - } - set - { - this.zZ_AQJBField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string NAME - { - get - { - return this.nAMEField; - } - set - { - this.nAMEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string GESCH - { - get - { - return this.gESCHField; - } - set - { - this.gESCHField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string GBDAT - { - get - { - return this.gBDATField; - } - set - { - this.gBDATField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZZ_SFZH - { - get - { - return this.zZ_SFZHField; - } - set - { - this.zZ_SFZHField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZTELE - { - get - { - return this.zTELEField; - } - set - { - this.zTELEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZWORKCODE - { - get - { - return this.zWORKCODEField; - } - set - { - this.zWORKCODEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZMOBILE - { - get - { - return this.zMOBILEField; - } - set - { - this.zMOBILEField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZEMAIL - { - get - { - return this.zEMAILField; - } - set - { - this.zEMAILField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZSTATUS - { - get - { - return this.zSTATUSField; - } - set - { - this.zSTATUSField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZZ_XSQY - { - get - { - return this.zZZ_XSQYField; - } - set - { - this.zZZ_XSQYField = value; - } - } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string KOSTL - { - get - { - return this.zKOSTLField; - } - set - { - this.zKOSTLField = value; - } - } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZZ_ZD - { - get - { - return this.zZZ_ZDField; - } - set - { - this.zZZ_ZDField = value; - } - } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - /// - public string Z_ZJ - { - get - { - return this.zZ_ZJField; - } - set - { - this.zZ_ZJField = value; - } - } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZRZRQ - { - get - { - return this.zZRZRQField; - } - set - { - this.zZRZRQField = value; - } - } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZLZRQ - { - get - { - return this.zZLZRQField; - } - set - { - this.zZLZRQField = value; - } - } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MASSG - { - get - { - return this.zMASSGField; - } - set - { - this.zMASSGField = value; - } - } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MGTXT - { - get - { - return this.zMGTXTField; - } - set - { - this.zMGTXTField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string BEGDA - { - get - { - return zBEGDAField; - } - set - { - zBEGDAField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ENDDA - { - get - { - return zENDDAField; - } - set - { - zENDDAField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string STELL - { - get - { - return zSTELLField; - } - set - { - zSTELLField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string STELL_NM - { - get - { - return zSTELL_NMField; - } - set - { - zSTELL_NMField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZADZH - { - get - { - return zZADZHField; - } - set - { - zZADZHField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string STAT2 - { - get - { - return zSTAT2Field; - } - set - { - zSTAT2Field = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZCJRQ - { - get - { - return zZCJRQField; - } - set - { - zZCJRQField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZZZRQ - { - get - { - return zZZZRQField; - } - set - { - zZZZRQField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MASSN - { - get - { - return zMASSNField; - } - set - { - zMASSNField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string MNTXT - { - get - { - return zMNTXTField; - } - set - { - zMNTXTField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZXUELI - { - get - { - return zXUELIField; - } - set - { - zXUELIField = value; - } - } - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZZ_KLX - { - get - { - return zZ_KLXField; - } - set - { - zZ_KLXField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRS_WERKS - { - - private string wERKSField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string WERKS - { - get - { - return this.wERKSField; - } - set - { - this.wERKSField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRS_PNO - { - - private string zWORKCODEField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ZWORKCODE - { - get - { - return this.zWORKCODEField; - } - set - { - this.zWORKCODEField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:sap-com:document:sap:rfc:functions")] - public partial class ZHRF_SYN_03Response - { - - private ZHRS_PERSON[] t_PERSONField; - - private ZHRS_PNO[] t_PNOField; - - private ZHRS_WERKS[] t_WERKSField; - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_PERSON[] T_PERSON - { - get - { - return this.t_PERSONField; - } - set - { - this.t_PERSONField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_PNO[] T_PNO - { - get - { - return this.t_PNOField; - } - set - { - this.t_PNOField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - [System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = false)] - public ZHRS_WERKS[] T_WERKS - { - get - { - return this.t_WERKSField; - } - set - { - this.t_WERKSField = value; - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - public delegate void ZHRF_SYN_03CompletedEventHandler(object sender, ZHRF_SYN_03CompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class ZHRF_SYN_03CompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - - private object[] results; - - internal ZHRF_SYN_03CompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { - this.results = results; - } - - /// - public ZHRF_SYN_03Response Result - { - get - { - this.RaiseExceptionIfNecessary(); - return ((ZHRF_SYN_03Response)(this.results[0])); - } - } - } -} \ No newline at end of file +} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_ORG.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_ORG.cs deleted file mode 100644 index 1eab7b6b..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_ORG.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; - -namespace Dlhis.ScheduledTask.WsProxy -{ - public partial class ZHRS_ORG : IEquatable - { - public bool Equals(ZHRS_ORG other) - { - if (other is null) - return false; - - return this.OBJID == other.OBJID - && this.SOBID == other.SOBID - && this.STEXT == other.STEXT; - } - - public override bool Equals(object obj) => Equals(obj as ZHRS_ORG); - public override int GetHashCode() => (OBJID, SOBID, STEXT).GetHashCode(); - } -} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_PERSON.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_PERSON.cs deleted file mode 100644 index a38345e1..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_PERSON.cs +++ /dev/null @@ -1,61 +0,0 @@ -//using System; - -//namespace Dlhis.ScheduledTask.WsProxy -//{ -// public partial class ZHRS_PERSON : IEquatable -// { -// public bool Equals(ZHRS_PERSON other) -// { -// if (other is null) -// return false; - -// return this.GBDAT == other.GBDAT -// && this.GESCH == other.GESCH -// && this.NAME == other.NAME -// && this.ORGEH == other.ORGEH -// && this.PERNR == other.PERNR -// && this.PLANS == other.PLANS -// && this.WERKS == other.WERKS -// && this.ZEMAIL == other.ZEMAIL -// && this.ZMOBILE == other.ZMOBILE -// && this.ZSTATUS == other.ZSTATUS -// && this.ZTELE == other.ZTELE -// && this.ZWORKCODE == other.ZWORKCODE -// && this.ZZ_AQJB == other.ZZ_AQJB -// && this.ZZ_SFZH == other.ZZ_SFZH -// && this.ZZ_SJGH == other.ZZ_SJGH -// && this.ZZ_XSQY == other.ZZ_XSQY -// && this.KOSTL == other.KOSTL -// && this.ZZ_ZD == other.ZZ_ZD -// && this.Z_ZJ == other.Z_ZJ -// && this.ZRZRQ == other.ZRZRQ -// && this.ZLZRQ == other.ZLZRQ -// && this.MASSG == other.MASSG -// && this.MGTXT == other.MGTXT -// && this.BEGDA == other.BEGDA -// && this.ENDDA == other.ENDDA -// && this.STELL == other.STELL -// && this.STELL_NM == other.STELL_NM -// && this.ZADZH == other.ZADZH -// && this.STAT2 == other.STAT2 -// && this.ZCJRQ == other.ZCJRQ -// && this.ZZZRQ == other.ZZZRQ -// && this.MASSN == other.MASSN -// && this.MNTXT == other.MNTXT -// && this.ZXUELI == other.ZXUELI -// && this.ZZ_KLX == other.ZZ_KLX; - -// } - -// public override bool Equals(object obj) => Equals(obj as ZHRS_PERSON); -// //public override int GetHashCode() => (GBDAT, GESCH, NAME, ORGEH, PERNR, PLANS, -// // WERKS, ZEMAIL, ZMOBILE, ZSTATUS, ZTELE, ZWORKCODE, ZZ_AQJB, ZZ_SFZH, ZZ_SJGH, -// // ZZ_XSQY, KOSTL, ZZ_ZD, Z_ZJ, ZRZRQ, ZLZRQ, MASSG, MGTXT, BEGDA, ENDDA, STELL, -// // STELL_NM, ZADZH, STAT2, ZCJRQ, ZZZRQ, MASSN, MNTXT).GetHashCode(); - -// public override int GetHashCode() => string.Join("", GBDAT ?? "", GESCH ?? "", NAME ?? "", ORGEH ?? "", PERNR ?? "", PLANS ?? "", -// WERKS ?? "", ZEMAIL ?? "", ZMOBILE ?? "", ZSTATUS ?? "", ZTELE ?? "", ZWORKCODE ?? "", ZZ_AQJB ?? "", ZZ_SFZH ?? "", ZZ_SJGH ?? "", -// ZZ_XSQY ?? "", KOSTL ?? "", ZZ_ZD ?? "", Z_ZJ ?? "", ZRZRQ ?? "", ZLZRQ ?? "", MASSG ?? "", MGTXT ?? "", BEGDA ?? "", ENDDA ?? "", STELL ?? "", -// STELL_NM ?? "", ZADZH ?? "", STAT2 ?? "", ZCJRQ ?? "", ZZZRQ ?? "", MASSN ?? "", MNTXT ?? "", ZXUELI ?? "", ZZ_KLX ?? "").GetHashCode(); -// } -//} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_POST.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_POST.cs deleted file mode 100644 index 790f5eda..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRS_POST.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Dlhis.ScheduledTask.WsProxy -{ - public partial class ZHRS_POST : IEquatable - { - public bool Equals(ZHRS_POST other) - { - if (other is null) - return false; - - return this.ZDEPID == other.ZDEPID - && this.ZJOBACTID == other.ZJOBACTID - && this.ZJOBID == other.ZJOBID - && this.ZJOBNAME == other.ZJOBNAME; - } - - public override bool Equals(object obj) => Equals(obj as ZHRS_POST); - public override int GetHashCode() => (ZDEPID, ZJOBACTID, ZJOBID, ZJOBNAME).GetHashCode(); - } -} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHR_OA_O_WORK_CARD_INFO.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHR_OA_O_WORK_CARD_INFO.cs deleted file mode 100644 index f18da156..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHR_OA_O_WORK_CARD_INFO.cs +++ /dev/null @@ -1,139 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using log4net; -using Newtonsoft.Json; -using System.Net; -using System.IO; -using Newtonsoft.Json.Linq; -using Hangfire.Logging; - - namespace Dlhis.ScheduledTask.WsProxy -{ - /// - /// 获取图片 - /// - public class ZHR_OA_O_WORK_CARD_INFO - { - private static readonly log4net.ILog log = LogManager.GetLogger(typeof(ZHR_OA_O_WORK_CARD_INFO)); - - /// - /// 获取员工卡片信息 - /// - public List Get_ZHR_OA_O_WORK_CARD_INFO(string url, string userName, string password, List workcode) - { - List list = new List(); - try - { - if (workcode == null || workcode.Count == 0) return list; - - - List> workcodes = new List>(); - foreach (var item in workcode) - { - var dictitem = new Dictionary - { - { "WORKCODE", item } - }; - workcodes.Add(dictitem); - } - Dictionary dictitems = new Dictionary - { - { "item", workcodes } - }; - Dictionary IT_PERSON = new Dictionary - { - { "IT_PERSON", dictitems } - }; - string postData = JsonConvert.SerializeObject(IT_PERSON); - - var auth = EncodeBase64($"{userName}:{password}"); - - string readTxt = ""; - HttpWebRequest request = HttpWebRequest.Create(url) as HttpWebRequest; - request.Headers.Add("Authorization", $"Basic {auth}"); - request.Timeout = 30 * 1000; - request.ContentType = "application/json"; - request.Method = "POST"; - byte[] data = Encoding.UTF8.GetBytes(postData); - request.ContentLength = data.Length; - Stream postStream = request.GetRequestStream(); - postStream.Write(data, 0, data.Length); - postStream.Close(); - - using (var res = request.GetResponse() as HttpWebResponse) - { - if (res.StatusCode == HttpStatusCode.OK) - { - StreamReader reader = new StreamReader(res.GetResponseStream(), Encoding.UTF8); - readTxt = reader.ReadToEnd(); - } - } - if (!string.IsNullOrEmpty(readTxt)) - { - var resutJson = JsonConvert.DeserializeObject(readTxt); - if (resutJson.HasValues) - { - - var resultItem = resutJson["ET_DATA"]?["item"]; - - if (resultItem.HasValues && resultItem.Count() > 0) - { - foreach (var _item in resultItem) - { - var _photo = _item["PHOTO_STR"]?.ToString(); - if (string.IsNullOrEmpty(_photo)) - { - list.Add(""); - } - else - { - list.Add(_photo); - } - } - } - } - } - return list; - } - catch (Exception ex) - { - log.Error(ex.ToString()); - throw new Exception($"请求{url}失败", ex); - } - } - - /// - /// Base64编码 - /// - /// - /// 默认UTF8 - /// - public static string EncodeBase64(string code, string code_type = "") - { - string encode = ""; - byte[] bytes = null; - if (string.IsNullOrEmpty(code_type)) - { - bytes = System.Text.Encoding.UTF8.GetBytes(code); - } - else - { - bytes = Encoding.GetEncoding(code_type).GetBytes(code); - } - try - { - encode = Convert.ToBase64String(bytes); - } - catch - { - encode = code; - } - return encode; - } - } -} - diff --git a/Src/Dlhis.ScheduledTask/appsettings.json b/Src/Dlhis.ScheduledTask/appsettings.json index 9c2dcc06..5bdf1af3 100644 --- a/Src/Dlhis.ScheduledTask/appsettings.json +++ b/Src/Dlhis.ScheduledTask/appsettings.json @@ -5,11 +5,26 @@ "Microsoft.AspNetCore": "Warning" } }, + "SqlSugarOptions": { + "DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;", + "SlaveConnectionString": [], + "Timeout": 30, + "SlowSqlTime": 1, + "EnableSqlLog": true + }, "ConnectionStrings": { "HangfireConnection": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=Hangfire;charset=utf8mb4;Allow User Variables=true;" }, "ServiceSettings": { - "ServerUrl": "" + "ServerUrl": "http://172.16.7.58:8125", + "UserName": "admin_ws", + "Password": "jinkohr@2017", + "SyncTime": "00:00", + "AttendanceUploadInterval": "30", + "AttendanceUploadUrl": "http://172.16.7.110:8121/sap/bc/srt/wsdl/flv_10002A111AD1/bndg_url/sap/bc/srt/rfc/sap/zhrf_swipe_data_saven/210/zhrf_swipe_data_save/zhrf_swipe_data_save?sap-client=210", + "DlhisDatabase": "server=192.168.199.124,32634;uid=sa;pwd=@Z!123456;database=test;", + "Werks": "aaa,bbb", + "BeginSyncDate": "2020-5-1" }, "AllowedHosts": "*", "Serilog": {