From 8989cfb0e55798e60bf3f02a574cc4a4e3a56dfc Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 29 Mar 2024 10:42:12 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=8E=A5=E5=85=A5=E6=B5=B7=E5=AE=81?= =?UTF-8?q?=E9=A4=90=E8=A1=A5api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dlhis.Jinko.Face.sln | 7 ++++ .../Dlhis.Canteen.Api.csproj | 13 ++++++ .../IHainingMealSupplementApi.cs | 20 ++++++++++ .../AddHainingMealSupplementRequest.cs | 40 +++++++++++++++++++ .../Response/HainingResponse.cs | 10 +++++ 5 files changed, 90 insertions(+) create mode 100644 Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj create mode 100644 Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs create mode 100644 Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs create mode 100644 Src/Dlhis.Canteen.Api/Response/HainingResponse.cs diff --git a/Dlhis.Jinko.Face.sln b/Dlhis.Jinko.Face.sln index 5425d10b..8c3027a2 100644 --- a/Dlhis.Jinko.Face.sln +++ b/Dlhis.Jinko.Face.sln @@ -37,6 +37,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{48 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.External", "Src\Dlhis.External\Dlhis.External.csproj", "{8472596E-0DE7-4A17-93D6-F0FC7D44FDF5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dlhis.Canteen.Api", "Src\Dlhis.Canteen.Api\Dlhis.Canteen.Api.csproj", "{961523DE-51BF-42A0-A294-708752C5718D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -91,6 +93,10 @@ Global {8472596E-0DE7-4A17-93D6-F0FC7D44FDF5}.Debug|Any CPU.Build.0 = Debug|Any CPU {8472596E-0DE7-4A17-93D6-F0FC7D44FDF5}.Release|Any CPU.ActiveCfg = Release|Any CPU {8472596E-0DE7-4A17-93D6-F0FC7D44FDF5}.Release|Any CPU.Build.0 = Release|Any CPU + {961523DE-51BF-42A0-A294-708752C5718D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {961523DE-51BF-42A0-A294-708752C5718D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {961523DE-51BF-42A0-A294-708752C5718D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {961523DE-51BF-42A0-A294-708752C5718D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -106,6 +112,7 @@ Global {85A345C7-913E-4C1B-BE1C-600DE408A02F} = {57074FD8-1A2F-40C7-8476-001778A3F65D} {1F337648-8A22-4601-A842-0F634FBA2825} = {4EBCE46B-CE3A-4A47-9432-82A1854CA58A} {8472596E-0DE7-4A17-93D6-F0FC7D44FDF5} = {489252FB-A44B-46EE-B065-21CDCB724441} + {961523DE-51BF-42A0-A294-708752C5718D} = {3D8A98C1-83C9-4375-AEAB-4F72AFAF365B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7439494A-E2FD-4FEA-8ABF-74AE57A4A5A0} diff --git a/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj b/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj new file mode 100644 index 00000000..6451ff50 --- /dev/null +++ b/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs b/Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs new file mode 100644 index 00000000..c50e4368 --- /dev/null +++ b/Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs @@ -0,0 +1,20 @@ +using Dlhis.Canteen.Api.Request; +using Dlhis.Canteen.Api.Response; +using Kurisu.RemoteCall.Attributes; + +namespace Dlhis.Canteen.Api; + +/// +/// 海宁餐补API +/// +[EnableRemoteClient(Name = "haining-service", BaseUrl = "http://172.19.0.10:8090")] +public interface IHainingMealSupplementApi +{ + /// + /// 餐补写入 + /// + /// + /// + [Post("/api/canteen/InputCredit")] + Task> AddMealSupplementAsync(AddHainingMealSupplementRequest request); +} diff --git a/Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs b/Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs new file mode 100644 index 00000000..e6a361bf --- /dev/null +++ b/Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +namespace Dlhis.Canteen.Api.Request; + +public class AddHainingMealSupplementRequest +{ + /// + /// 流水号 + /// + [Required] + [JsonProperty("orderNo")] + public string UniqueId { get; set; } + + /// + /// 工号 + /// + [Required] + [JsonProperty("ename")] + public string Code { get; set; } + + /// + /// 餐补金额 + /// + [JsonProperty("credit")] + public decimal Amount { get; set; } + + /// + /// 考勤日期 + /// + [Required] + [JsonProperty("sysdate")] + public DateTime Date { get; set; } + + /// + /// 备注 + /// + [JsonProperty("payRef")] + public string Remark { get; set; } +} diff --git a/Src/Dlhis.Canteen.Api/Response/HainingResponse.cs b/Src/Dlhis.Canteen.Api/Response/HainingResponse.cs new file mode 100644 index 00000000..87f3b5f1 --- /dev/null +++ b/Src/Dlhis.Canteen.Api/Response/HainingResponse.cs @@ -0,0 +1,10 @@ +namespace Dlhis.Canteen.Api.Response; + +public class HainingResponse +{ + public int Code { get; set; } + + public string Message { get; set; } + + public T Data { get; set; } +}