From 7c242370fc1aa5aeb4776e917b6831ae7a2845f3 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Wed, 10 Jan 2024 16:13:24 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=B3=A8=E9=87=8A,=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Device/Request/DevicePageRequest.cs | 2 - .../Response/DeviceUnderGroupResponse.cs | 4 +- .../Device/Entities/DeviceTask.cs | 17 +- .../Device/Enums/DeviceTaskEnumType.cs | 30 + .../Device/Enums/DeviceTaskStatusEnumType.cs | 34 + Src/Dlhis.ScheduledTask/App.config | 75 -- .../Dlhis.ScheduledTask.csproj | 2 +- Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs | 105 ++- .../DeviceTaskAssignmentsController.cs | 35 + .../Request/DeviceTaskAssignmentRequest.cs | 7 + .../Response/DeviceTaskAssignmentResponse.cs | 62 ++ .../Services/IDeviceTaskAssignmentService.cs | 10 + .../Implements/DeviceTaskAssignmentService.cs | 38 + .../WsProxy/ZHRF_SYN_03N.cs | 851 ------------------ .../appsettings.Development.json | 23 + Src/Dlhis.ScheduledTask/appsettings.json | 23 + 16 files changed, 333 insertions(+), 985 deletions(-) create mode 100644 Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs create mode 100644 Src/Dlhis.Entity/Device/Enums/DeviceTaskStatusEnumType.cs delete mode 100644 Src/Dlhis.ScheduledTask/App.config create mode 100644 Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs create mode 100644 Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs create mode 100644 Src/Dlhis.ScheduledTask/TaskAssignment/Response/DeviceTaskAssignmentResponse.cs create mode 100644 Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs create mode 100644 Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs delete mode 100644 Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs diff --git a/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs index 6811b1bf..ff56245f 100644 --- a/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs +++ b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs @@ -8,6 +8,4 @@ public class DevicePageRequest : PageDto /// 平台 /// public string Brand { get; set; } - - public string MyProperty { get; set; } } diff --git a/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs b/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs index 8313672e..806a7d9b 100644 --- a/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs +++ b/Src/Dlhis.Basic/Device/Response/DeviceUnderGroupResponse.cs @@ -14,6 +14,8 @@ public class DeviceUnderGroupResponse /// public string Brand { get; set; } - + /// + /// 是否启用 + /// public bool Enable { get; set; } } diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs b/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs index 0ed03883..94df132e 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceTask.cs @@ -1,5 +1,7 @@ -using Kurisu.SqlSugar; +using Dlhis.Entity.Device.Enums; +using Kurisu.SqlSugar; using SqlSugar; +using SqlSugar.DbConvert; namespace Dlhis.Entity.Device.Entities; @@ -9,10 +11,16 @@ namespace Dlhis.Entity.Device.Entities; [SugarTable(TableName = "DeviceTask")] public class DeviceTaskEntity : SugarBaseEntity { + /// + /// 任务类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + public DeviceTaskEnumType Type { get; set; } + /// /// 用户档案号 /// - public string UserId { get; set; } + public string UserNo { get; set; } /// /// 用户学工号 @@ -34,6 +42,11 @@ public class DeviceTaskEntity : SugarBaseEntity /// public int RetryCount { get; set; } + /// + /// 任务下发状态 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + public DeviceTaskStatusEnumType Status { get; set; } /// /// 处理结果 diff --git a/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs b/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs new file mode 100644 index 00000000..780ff55d --- /dev/null +++ b/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs @@ -0,0 +1,30 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Device.Enums; + +/// +/// 设备任务类型 +/// +[Description("设备任务类型")] +public enum DeviceTaskEnumType +{ + // 状态:ADD-准备下发;ADDOK-下发成功;DEL-准备删除;DELOK-删除成功;AERR-下发错误;DERR-删除错误;UUU-先删除后下发; + + /// + /// 添加 + /// + [Description("添加")] + Add = 1, + + /// + /// 删除 + /// + [Description("删除")] + Delete = 2, + + /// + /// 删除后添加 + /// + [Description("删除后添加")] + AddAfterDelete = 3, +} diff --git a/Src/Dlhis.Entity/Device/Enums/DeviceTaskStatusEnumType.cs b/Src/Dlhis.Entity/Device/Enums/DeviceTaskStatusEnumType.cs new file mode 100644 index 00000000..3c2009af --- /dev/null +++ b/Src/Dlhis.Entity/Device/Enums/DeviceTaskStatusEnumType.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Device.Enums; + +/// +/// 设备任务下发状态 +/// +[Description("设备任务下发状态")] +public enum DeviceTaskStatusEnumType +{ + /// + /// 待下发 + /// + [Description("待下发")] + Wait = 0, + + /// + /// 处理中 + /// + [Description("处理中")] + Process = 5, + + /// + /// 下发完成 + /// + [Description("下发完成")] + Success = 10, + + /// + /// 异常 + /// + [Description("异常")] + Error = 99, +} diff --git a/Src/Dlhis.ScheduledTask/App.config b/Src/Dlhis.ScheduledTask/App.config deleted file mode 100644 index fb37bfe6..00000000 --- a/Src/Dlhis.ScheduledTask/App.config +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj index 7a7f1fcc..1ea33e79 100644 --- a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj +++ b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj @@ -2,7 +2,7 @@ net6.0 - enable + disable enable Linux ..\.. diff --git a/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs index e5c0a746..c7e27c9b 100644 --- a/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs +++ b/Src/Dlhis.ScheduledTask/Job/SyncPersonJob.cs @@ -10,19 +10,18 @@ using System.Text; using Dlhis.ScheduledTask.Configurations; using Kurisu.SqlSugar.Services; using Dlhis.Entity.Basic.Entity; -using Dlhis.ScheduledTask.Wsproxy.Dlhis.JinkoHr.WsProxy; using Dlhis.Entity.Basic.Enums; namespace Dlhis.ScheduledTask.Job { - public class SyncPersonJob + 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) { @@ -242,58 +241,58 @@ namespace Dlhis.ScheduledTask.Job 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"); + List persons = new(); + //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 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); - } - } + // 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() { diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs new file mode 100644 index 00000000..6b72836c --- /dev/null +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/DeviceTaskAssignmentsController.cs @@ -0,0 +1,35 @@ +using Dlhis.ScheduledTask.TaskAssignment.Request; +using Dlhis.ScheduledTask.TaskAssignment.Response; +using Dlhis.ScheduledTask.TaskAssignment.Services; +using Kurisu.Core.DataAccess.Dto; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.ScheduledTask.TaskAssignment.Controllers; + +/// +/// 设备任务下发 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class DeviceTaskAssignmentsController : ControllerBase +{ + private readonly IDeviceTaskAssignmentService _deviceTaskAssignmentService; + + public DeviceTaskAssignmentsController(IDeviceTaskAssignmentService deviceTaskAssignmentService) + { + _deviceTaskAssignmentService = deviceTaskAssignmentService; + } + + /// + /// 设备任务下发分页 + /// + /// + /// + [HttpGet("page")] + public async Task> GetPageAsync([FromQuery] DeviceTaskAssignmentRequest request) + { + return await _deviceTaskAssignmentService.GetPageAsync(request); + } +} diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs new file mode 100644 index 00000000..a7c196f0 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Request/DeviceTaskAssignmentRequest.cs @@ -0,0 +1,7 @@ +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.ScheduledTask.TaskAssignment.Request; + +public class DeviceTaskAssignmentRequest : PageDto +{ +} diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Response/DeviceTaskAssignmentResponse.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/DeviceTaskAssignmentResponse.cs new file mode 100644 index 00000000..e525d6d3 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Response/DeviceTaskAssignmentResponse.cs @@ -0,0 +1,62 @@ +using Dlhis.Entity.Device.Enums; +using Kurisu.AspNetCore.Utils.Extensions; + +namespace Dlhis.ScheduledTask.TaskAssignment.Response; + +public class DeviceTaskAssignmentResponse +{ + /// + /// 任务类型 + /// + public DeviceTaskEnumType Type { get; set; } + + /// + /// 任务类型描述 + /// + public string TypeDesc => Type.GetDescription(); + + /// + /// 用户档案号 + /// + public string UserNo { get; set; } + + /// + /// 用户学工号 + /// + public string UserCode { get; set; } + + /// + /// 用户名 + /// + public string UserName { get; set; } + + /// + /// 设备唯一号 + /// + public string DeviceUniqueNo { get; set; } + + /// + /// 重试次数 + /// + public int RetryCount { get; set; } + + /// + /// 任务下发状态 + /// + public DeviceTaskStatusEnumType Status { get; set; } + + /// + /// 任务下发状态描述 + /// + public string StatusDesc => Status.GetDescription(); + + /// + /// 处理结果 + /// + public string ResultMessage { get; set; } + + /// + /// 数据状态最新修改时间 + /// + public DateTime LastUpdateTime { get; set; } +} diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs new file mode 100644 index 00000000..578d3570 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IDeviceTaskAssignmentService.cs @@ -0,0 +1,10 @@ +using Dlhis.ScheduledTask.TaskAssignment.Request; +using Dlhis.ScheduledTask.TaskAssignment.Response; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.ScheduledTask.TaskAssignment.Services; + +public interface IDeviceTaskAssignmentService : IScopeDependency +{ + Task> GetPageAsync(DeviceTaskAssignmentRequest request); +} diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs new file mode 100644 index 00000000..7aed6893 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs @@ -0,0 +1,38 @@ +using Dlhis.Entity.Device.Entities; +using Dlhis.ScheduledTask.TaskAssignment.Request; +using Dlhis.ScheduledTask.TaskAssignment.Response; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; + +namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements; + +public class DeviceTaskAssignmentService : IDeviceTaskAssignmentService +{ + private readonly IDbContext _dbContext; + + public DeviceTaskAssignmentService(IDbContext dbContext) + { + _dbContext = dbContext; + } + + public async Task> GetPageAsync(DeviceTaskAssignmentRequest request) + { + var page = await _dbContext.Queryable() + .Select((deviceTask) => new DeviceTaskAssignmentResponse + { + DeviceUniqueNo = deviceTask.DeviceUniqueNo, + ResultMessage = deviceTask.ResultMessage, + RetryCount = deviceTask.RetryCount, + Status = deviceTask.Status, + UserNo = deviceTask.UserNo, + UserName = deviceTask.UserName, + UserCode = deviceTask.UserCode, + Type = deviceTask.Type, + LastUpdateTime = deviceTask.ModifiedTime + }) + .ToPageListAsync(request); + + return page; + } +} diff --git a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs b/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs deleted file mode 100644 index 26406eb2..00000000 --- a/Src/Dlhis.ScheduledTask/WsProxy/ZHRF_SYN_03N.cs +++ /dev/null @@ -1,851 +0,0 @@ -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. - // - //------------------------------------------------------------------------------ - - // - // This source code was auto-generated by wsdl, Version=4.6.1055.0. - // - namespace Dlhis.JinkoHr.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_03N", Namespace = "urn:sap-com:document:sap:rfc:functions")] - /*public partial class ZHRF_SYN_03N : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - private System.Threading.SendOrPostCallback ZHRF_SYN_03OperationCompleted; - - /// - 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])); - } - - /// - 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[] { - ZHRF_SYN_031}, this.ZHRF_SYN_03OperationCompleted, userState); - } - - private void OnZHRF_SYN_03OperationCompleted(object arg) - { - 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; - } - } - } - - /// - [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])); - } - } - } - } -} diff --git a/Src/Dlhis.ScheduledTask/appsettings.Development.json b/Src/Dlhis.ScheduledTask/appsettings.Development.json index 0c208ae9..17b935d5 100644 --- a/Src/Dlhis.ScheduledTask/appsettings.Development.json +++ b/Src/Dlhis.ScheduledTask/appsettings.Development.json @@ -4,5 +4,28 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "SwaggerOptions": { + "Enable": true, + "Authority": "https://yikatong.isawesome.cn/oauth2", + "ClientId": "4fb184324eac4180", + "ClientSecret": "8ac8f235152f1524", + "Scopes": { + "openid": "openid", + "profile": "profile", + "yikatong": "yikatong" + } + }, + "IdentityServerOptions": { + "Authority": "https://yikatong.isawesome.cn/oauth2", + "RequireHttpsMetadata": true, + "Issuer": "identity.isawesome.cn", + "Audience": "", + "Pat": { + "Enable": false, + "Scheme": "token", + "ClientId": "reference", + "ClientSecret": "123456" + } } } diff --git a/Src/Dlhis.ScheduledTask/appsettings.json b/Src/Dlhis.ScheduledTask/appsettings.json index bd03a226..c6eceea5 100644 --- a/Src/Dlhis.ScheduledTask/appsettings.json +++ b/Src/Dlhis.ScheduledTask/appsettings.json @@ -15,6 +15,29 @@ "ConnectionStrings": { "HangfireConnection": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=HangFire;charset=utf8mb4;Allow User Variables=true;" }, + "SwaggerOptions": { + "Enable": true, + "Authority": "http://identity.oauth.svc.cluster.local", + "ClientId": "4fb184324eac4180", + "ClientSecret": "8ac8f235152f1524", + "Scopes": { + "openid": "openid", + "profile": "profile", + "yikatong": "yikatong" + } + }, + "IdentityServerOptions": { + "Authority": "http://identity.oauth.svc.cluster.local", + "RequireHttpsMetadata": false, + "Issuer": "identity.isawesome.cn", + "Audience": "", + "Pat": { + "Enable": false, + "Scheme": "token", + "ClientId": "reference", + "ClientSecret": "123456" + } + }, "ServiceSettings": { "ServerUrl": "http://172.16.7.58:8125", "UserName": "admin_ws",