remove 移除海宁餐补处理

This commit is contained in:
2024-10-18 11:52:17 +08:00
parent 323b7c3f5d
commit c374d12935
9 changed files with 0 additions and 431 deletions

View File

@@ -24,7 +24,6 @@
<ItemGroup>
<ProjectReference Include="..\Dlhis.Basic.Api\Dlhis.Basic.Api.csproj" />
<ProjectReference Include="..\Dlhis.Canteen.Api\Dlhis.Canteen.Api.csproj" />
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
<ProjectReference Include="..\Dlhis.Sys.Api\Dlhis.Sys.Api.csproj" />
</ItemGroup>

View File

@@ -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"

View File

@@ -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;
//
// /// <summary>
// /// 餐补核算
// /// </summary>
// [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<MealSupplementRecordEntity>()
// .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<GainfoEntity>().Where(x => x.Code == item.Code).SingleAsync();
// if (gainfo == null)
// {
// gainfo = await DbContext.Queryable<GainfoEntity>().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync();
//
// if (gainfo == null)
// {
// await DbContext.Updateable<MealSupplementRecordEntity>()
// .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<IGainfoUpdateService>(x => x.TodoByCodeAsync(item.Code));
//
// continue;
// }
// else if (gainfo.ResignationDate < item.Date)
// {
// try
// {
// var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>
// {
// new()
// {
// UniqueId = item.UniqueId,
// Status = "FAIL",
// Msg = "人员离职"
// }
// });
//
// await DbContext.Updateable<MealSupplementRecordEntity>()
// .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<GainfoMealEntity>().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<SyncMealSupplementRecordRequest>
// {
// new()
// {
// UniqueId = mealSupplement.UniqueId,
// Status = "SUCCESS",
// Msg = "操作成功"
// }
// });
//
// //更新餐补信息为成功(同步成功)
// await DbContext.Updateable<MealSupplementRecordEntity>()
// .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<MealSupplementRecordEntity>()
// .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();
// }
// }
// }

View File

@@ -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;
//
// /// <summary>
// /// 餐补核算
// /// </summary>
// [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<MealSupplementRecordEntity>()
// .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<GainfoEntity>().Where(x => x.Code == item.Code).SingleAsync();
// if (gainfo == null)
// {
// gainfo = await DbContext.Queryable<GainfoEntity>().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync();
//
// if (gainfo == null)
// {
// await DbContext.Updateable<MealSupplementRecordEntity>()
// .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<IGainfoUpdateService>(x => x.TodoByCodeAsync(item.Code));
//
// continue;
// }
//
// if (gainfo.ResignationDate < item.Date)
// {
// try
// {
// var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>
// {
// new()
// {
// UniqueId = item.UniqueId,
// Status = "FAIL",
// Msg = "人员离职"
// }
// });
//
// await DbContext.Updateable<MealSupplementRecordEntity>()
// .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<GainfoMealEntity>().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<SyncMealSupplementRecordRequest>
// {
// new()
// {
// UniqueId = mealSupplement.UniqueId,
// Status = "SUCCESS",
// Msg = "操作成功"
// }
// });
//
// //更新餐补信息为成功(同步成功)
// await DbContext.Updateable<MealSupplementRecordEntity>()
// .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<MealSupplementRecordEntity>()
// .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();
// }
// }
// }