From c374d12935dd49f8e9535e7fa7ba81bb6de01ff1 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 18 Oct 2024 11:52:17 +0800 Subject: [PATCH] =?UTF-8?q?remove=20=E7=A7=BB=E9=99=A4=E6=B5=B7=E5=AE=81?= =?UTF-8?q?=E9=A4=90=E8=A1=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dlhis.Jinko.Face.sln | 7 - .../Dlhis.Canteen.Api.csproj | 14 -- .../IHainingMealSupplementApi.cs | 29 --- .../AddHainingMealSupplementRequest.cs | 40 ----- .../Response/HainingResponse.cs | 10 -- .../Dlhis.ScheduledTask.csproj | 1 - Src/Dlhis.ScheduledTask/Dockerfile | 1 - .../Jobs/MealChunengSupplementHandlerJob.cs | 164 ----------------- .../Jobs/MealHainingSupplementHandlerJob.cs | 165 ------------------ 9 files changed, 431 deletions(-) delete mode 100644 Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj delete mode 100644 Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs delete mode 100644 Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs delete mode 100644 Src/Dlhis.Canteen.Api/Response/HainingResponse.cs delete mode 100644 Src/Dlhis.ScheduledTask/Jobs/MealChunengSupplementHandlerJob.cs delete mode 100644 Src/Dlhis.ScheduledTask/Jobs/MealHainingSupplementHandlerJob.cs diff --git a/Dlhis.Jinko.Face.sln b/Dlhis.Jinko.Face.sln index 209e26e0..08568dbb 100644 --- a/Dlhis.Jinko.Face.sln +++ b/Dlhis.Jinko.Face.sln @@ -37,8 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Scheduled.Api", "Src\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Canteen", "Src\Dlhis.Canteen\Dlhis.Canteen.csproj", "{A54426E2-1CA0-48AB-BBA6-07CDE2807E35}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Canteen.Api", "Src\Dlhis.Canteen.Api\Dlhis.Canteen.Api.csproj", "{D4043506-7247-4DDC-9751-927403515669}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Message", "Message", "{65E76F97-E78A-4C95-B788-4091236B1A79}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Message", "Src\Dlhis.Message\Dlhis.Message.csproj", "{053BF7B2-B1A0-435F-9C77-2EF5622CC5C5}" @@ -105,10 +103,6 @@ Global {A54426E2-1CA0-48AB-BBA6-07CDE2807E35}.Debug|Any CPU.Build.0 = Debug|Any CPU {A54426E2-1CA0-48AB-BBA6-07CDE2807E35}.Release|Any CPU.ActiveCfg = Release|Any CPU {A54426E2-1CA0-48AB-BBA6-07CDE2807E35}.Release|Any CPU.Build.0 = Release|Any CPU - {D4043506-7247-4DDC-9751-927403515669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4043506-7247-4DDC-9751-927403515669}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4043506-7247-4DDC-9751-927403515669}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4043506-7247-4DDC-9751-927403515669}.Release|Any CPU.Build.0 = Release|Any CPU {053BF7B2-B1A0-435F-9C77-2EF5622CC5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {053BF7B2-B1A0-435F-9C77-2EF5622CC5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU {053BF7B2-B1A0-435F-9C77-2EF5622CC5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -144,7 +138,6 @@ Global {8472596E-0DE7-4A17-93D6-F0FC7D44FDF5} = {489252FB-A44B-46EE-B065-21CDCB724441} {9EA85FB2-F320-4F97-B278-00652CF35BD8} = {AA987BDF-EF63-467B-AD04-59F9B10D9000} {A54426E2-1CA0-48AB-BBA6-07CDE2807E35} = {3D8A98C1-83C9-4375-AEAB-4F72AFAF365B} - {D4043506-7247-4DDC-9751-927403515669} = {3D8A98C1-83C9-4375-AEAB-4F72AFAF365B} {053BF7B2-B1A0-435F-9C77-2EF5622CC5C5} = {65E76F97-E78A-4C95-B788-4091236B1A79} {4D656761-8CE7-4316-A3DF-8C1722D69CCE} = {4EBCE46B-CE3A-4A47-9432-82A1854CA58A} {A501D16E-638F-4156-989C-2BACCC2FAC2B} = {4EBCE46B-CE3A-4A47-9432-82A1854CA58A} diff --git a/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj b/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj deleted file mode 100644 index 7c16a4bd..00000000 --- a/Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - disable - True - - - - - - - diff --git a/Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs b/Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs deleted file mode 100644 index 294967fd..00000000 --- a/Src/Dlhis.Canteen.Api/IHainingMealSupplementApi.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Dlhis.Canteen.Api.Request; -using Dlhis.Canteen.Api.Response; -using Kurisu.RemoteCall.Attributes; - -namespace Dlhis.Canteen.Api; - -/// -/// 海宁餐补API -/// -[EnableRemoteClient(Name = "haining-service", BaseUrl = "https://pay.aizhuhotel.com")] -public interface IHainingMealSupplementApi -{ - /// - /// 餐补写入 - /// - /// - /// - [Post("/jingke/api/canteen/InputCredit")] - Task> AddMealSupplementAsync(AddHainingMealSupplementRequest request); - - - /// - /// 海宁储能 - /// - /// - /// - [Post("/jschuneng/api/canteen/InputCredit")] - Task> AddHsChuNengMealSupplementAsync(AddHainingMealSupplementRequest request); -} diff --git a/Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs b/Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs deleted file mode 100644 index e6a361bf..00000000 --- a/Src/Dlhis.Canteen.Api/Request/AddHainingMealSupplementRequest.cs +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index 87f3b5f1..00000000 --- a/Src/Dlhis.Canteen.Api/Response/HainingResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Dlhis.Canteen.Api.Response; - -public class HainingResponse -{ - public int Code { get; set; } - - public string Message { get; set; } - - public T Data { get; set; } -} diff --git a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj index 20f8028f..83bae8f0 100644 --- a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj +++ b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj @@ -24,7 +24,6 @@ - diff --git a/Src/Dlhis.ScheduledTask/Dockerfile b/Src/Dlhis.ScheduledTask/Dockerfile index 5c1cc9fa..babe2308 100644 --- a/Src/Dlhis.ScheduledTask/Dockerfile +++ b/Src/Dlhis.ScheduledTask/Dockerfile @@ -9,7 +9,6 @@ ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj", "Src/Dlhis.ScheduledTask/"] COPY ["Src/Dlhis.Basic.Api/Dlhis.Basic.Api.csproj", "Src/Dlhis.Basic.Api/"] -COPY ["Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj", "Src/Dlhis.Canteen.Api/"] COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"] COPY ["Src/Dlhis.Sys.Api/Dlhis.Sys.Api.csproj", "Src/Dlhis.Sys.Api/"] RUN dotnet restore "./Src/Dlhis.ScheduledTask/./Dlhis.ScheduledTask.csproj" diff --git a/Src/Dlhis.ScheduledTask/Jobs/MealChunengSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/Jobs/MealChunengSupplementHandlerJob.cs deleted file mode 100644 index c703e856..00000000 --- a/Src/Dlhis.ScheduledTask/Jobs/MealChunengSupplementHandlerJob.cs +++ /dev/null @@ -1,164 +0,0 @@ -// using Dlhis.Canteen.Api; -// using Dlhis.Canteen.Api.Request; -// using Dlhis.Entity.Basic.Entity; -// using Dlhis.Entity.Basic.Enums; -// using Dlhis.Entity.Canteen.Entities; -// using Dlhis.Entity.Canteen.Enums; -// using Dlhis.ScheduledTask.Attributes; -// using Dlhis.ScheduledTask.Common.Request; -// using Dlhis.ScheduledTask.Common.Services; -// using Hangfire; -// using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; -// using Kurisu.AspNetCore.Utils; -// using Kurisu.AspNetCore.Utils.Extensions; -// -// namespace Dlhis.ScheduledTask.Jobs; -// -// /// -// /// 餐补核算 -// /// -// [RecurringJob(nameof(MealChunengSupplementHandlerJob), "0 0/30 * * * ?", Name = "储能餐补核算")] -// public class MealChunengSupplementHandlerJob : BaseJob -// { -// private readonly IHainingMealSupplementApi _hainingMealSupplementApi; -// private readonly IJinkoJIPService _jinkoJIPService; -// -// public MealChunengSupplementHandlerJob(IServiceProvider serviceProvider, -// IHainingMealSupplementApi hainingMealSupplementApi, -// IJinkoJIPService jinkoJIPService) : base(serviceProvider) -// { -// _hainingMealSupplementApi = hainingMealSupplementApi; -// _jinkoJIPService = jinkoJIPService; -// } -// -// protected override async Task RunAsync(IServiceProvider serviceProvider) -// { -// //查询待处理餐补 -// var mealSupplements = await DbContext.Queryable() -// .Where(x => x.Status == MealSupplementStatusEnumtype.Wait || x.Status == MealSupplementStatusEnumtype.Error) -// .Where(x => x.Workplace == "5" && x.Factory == "501")//储能 -// .Where(x => !x.Sync) -// .ToListAsync(); -// -// foreach (var item in mealSupplements) -// { -// var gainfo = await DbContext.Queryable().Where(x => x.Code == item.Code).SingleAsync(); -// if (gainfo == null) -// { -// gainfo = await DbContext.Queryable().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync(); -// -// if (gainfo == null) -// { -// await DbContext.Updateable() -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error) -// .SetColumns(x => x.Result == "人员档案不存在") -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == item.UniqueId) -// .ExecuteCommandAsync(); -// -// //后台任务获取人员 -// BackgroundJob.Enqueue(x => x.TodoByCodeAsync(item.Code)); -// -// continue; -// } -// else if (gainfo.ResignationDate < item.Date) -// { -// try -// { -// var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List -// { -// new() -// { -// UniqueId = item.UniqueId, -// Status = "FAIL", -// Msg = "人员离职" -// } -// }); -// -// await DbContext.Updateable() -// .SetColumns(x => x.Result == r) -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) -// .SetColumns(x => x.Sync == true) -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == item.UniqueId) -// .ExecuteCommandAsync(); -// } -// catch -// { -// } -// -// continue; -// } -// } -// -// -// //创建余额数据 -// var mealUser = await DbContext.Queryable().Where(x => x.UserCode == gainfo.Code).SingleAsync(); -// if (mealUser == null) -// { -// mealUser = new GainfoMealEntity -// { -// Balance = 0, -// BalanceOfRecharge = 0, -// BalanceOfSubsidies = 0, -// UserCode = gainfo.Code, -// Version = 0, -// }; -// -// await DbContext.InsertAsync(mealUser); -// } -// -// await SetHainingMealSupplementAsync(item); -// } -// } -// -// private async Task SetHainingMealSupplementAsync(MealSupplementRecordEntity mealSupplement) -// { -// await DbContext.Client.Ado.BeginTranAsync(); -// try -// { -// var hnResponse = await _hainingMealSupplementApi.AddHsChuNengMealSupplementAsync(new AddHainingMealSupplementRequest -// { -// Code = mealSupplement.Code, -// Amount = mealSupplement.Amount, -// Date = mealSupplement.Date.Date, -// Remark = mealSupplement.Remark, -// UniqueId = mealSupplement.UniqueId -// }); -// -// (hnResponse == null || hnResponse.Code != 200).ThrowIfTrue("海宁餐补写入失败:" + hnResponse?.Message); -// -// var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List -// { -// new() -// { -// UniqueId = mealSupplement.UniqueId, -// Status = "SUCCESS", -// Msg = "操作成功" -// } -// }); -// -// //更新餐补信息为成功(同步成功) -// await DbContext.Updateable() -// .SetColumns(x => x.Result == r) -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) -// .SetColumns(x => x.Sync == true) -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == mealSupplement.UniqueId) -// .ExecuteCommandAsync(); -// -// await DbContext.Client.Ado.CommitTranAsync(); -// } -// catch (Exception ex) -// { -// await DbContext.Client.Ado.RollbackTranAsync(); -// -// await DbContext.Updateable() -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error) -// .SetColumns(x => x.Result == ex.Message + " " + ex.StackTrace) -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == mealSupplement.UniqueId) -// .ExecuteCommandAsync(); -// } -// } -// } \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/Jobs/MealHainingSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/Jobs/MealHainingSupplementHandlerJob.cs deleted file mode 100644 index 50b47133..00000000 --- a/Src/Dlhis.ScheduledTask/Jobs/MealHainingSupplementHandlerJob.cs +++ /dev/null @@ -1,165 +0,0 @@ -// using Dlhis.Canteen.Api; -// using Dlhis.Canteen.Api.Request; -// using Dlhis.Entity.Basic.Entity; -// using Dlhis.Entity.Basic.Enums; -// using Dlhis.Entity.Canteen.Entities; -// using Dlhis.Entity.Canteen.Enums; -// using Dlhis.ScheduledTask.Attributes; -// using Dlhis.ScheduledTask.Common.Request; -// using Dlhis.ScheduledTask.Common.Services; -// using Hangfire; -// using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; -// using Kurisu.AspNetCore.Utils; -// using Kurisu.AspNetCore.Utils.Extensions; -// -// namespace Dlhis.ScheduledTask.Jobs; -// -// /// -// /// 餐补核算 -// /// -// [RecurringJob(nameof(MealHainingSupplementHandlerJob), "0 0/30 * * * ?", Name = "海宁餐补核算")] -// public class MealHainingSupplementHandlerJob : BaseJob -// { -// private readonly IHainingMealSupplementApi _hainingMealSupplementApi; -// private readonly IJinkoJIPService _jinkoJIPService; -// -// public MealHainingSupplementHandlerJob(IServiceProvider serviceProvider, -// IHainingMealSupplementApi hainingMealSupplementApi, -// IJinkoJIPService jinkoJIPService) : base(serviceProvider) -// { -// _hainingMealSupplementApi = hainingMealSupplementApi; -// _jinkoJIPService = jinkoJIPService; -// } -// -// protected override async Task RunAsync(IServiceProvider serviceProvider) -// { -// //查询待处理餐补 -// var mealSupplements = await DbContext.Queryable() -// .Where(x => x.Status == MealSupplementStatusEnumtype.Wait || x.Status == MealSupplementStatusEnumtype.Error) -// .Where(x => x.Workplace == "5" && x.Factory != "501") //非储能 -// .Where(x => !x.Sync) -// .ToListAsync(); -// -// foreach (var item in mealSupplements) -// { -// var gainfo = await DbContext.Queryable().Where(x => x.Code == item.Code).SingleAsync(); -// if (gainfo == null) -// { -// gainfo = await DbContext.Queryable().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync(); -// -// if (gainfo == null) -// { -// await DbContext.Updateable() -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error) -// .SetColumns(x => x.Result == "人员档案不存在") -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == item.UniqueId) -// .ExecuteCommandAsync(); -// -// //后台任务获取人员 -// BackgroundJob.Enqueue(x => x.TodoByCodeAsync(item.Code)); -// -// continue; -// } -// -// if (gainfo.ResignationDate < item.Date) -// { -// try -// { -// var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List -// { -// new() -// { -// UniqueId = item.UniqueId, -// Status = "FAIL", -// Msg = "人员离职" -// } -// }); -// -// await DbContext.Updateable() -// .SetColumns(x => x.Result == r) -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) -// .SetColumns(x => x.Sync == true) -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == item.UniqueId) -// .ExecuteCommandAsync(); -// } -// catch -// { -// } -// -// continue; -// } -// } -// -// -// //创建余额数据 -// var mealUser = await DbContext.Queryable().Where(x => x.UserCode == gainfo.Code).SingleAsync(); -// if (mealUser == null) -// { -// mealUser = new GainfoMealEntity -// { -// Balance = 0, -// BalanceOfRecharge = 0, -// BalanceOfSubsidies = 0, -// UserCode = gainfo.Code, -// Version = 0, -// }; -// -// await DbContext.InsertAsync(mealUser); -// } -// -// await SetHainingMealSupplementAsync(item); -// } -// } -// -// private async Task SetHainingMealSupplementAsync(MealSupplementRecordEntity mealSupplement) -// { -// await DbContext.Client.Ado.BeginTranAsync(); -// try -// { -// var hnResponse = await _hainingMealSupplementApi.AddMealSupplementAsync(new AddHainingMealSupplementRequest -// { -// Code = mealSupplement.Code, -// Amount = mealSupplement.Amount, -// Date = mealSupplement.Date.Date, -// Remark = mealSupplement.Remark, -// UniqueId = mealSupplement.UniqueId -// }); -// -// (hnResponse == null || hnResponse.Code != 200).ThrowIfTrue("海宁餐补写入失败:" + hnResponse?.Message); -// -// var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List -// { -// new() -// { -// UniqueId = mealSupplement.UniqueId, -// Status = "SUCCESS", -// Msg = "操作成功" -// } -// }); -// -// //更新餐补信息为成功(同步成功) -// await DbContext.Updateable() -// .SetColumns(x => x.Result == r) -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) -// .SetColumns(x => x.Sync == true) -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == mealSupplement.UniqueId) -// .ExecuteCommandAsync(); -// -// await DbContext.Client.Ado.CommitTranAsync(); -// } -// catch (Exception ex) -// { -// await DbContext.Client.Ado.RollbackTranAsync(); -// -// await DbContext.Updateable() -// .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error) -// .SetColumns(x => x.Result == ex.Message + " " + ex.StackTrace) -// .SetColumns(x => x.ModifiedTime == DateTime.Now) -// .Where(x => x.UniqueId == mealSupplement.UniqueId) -// .ExecuteCommandAsync(); -// } -// } -// } \ No newline at end of file