fix framework
This commit is contained in:
@@ -7,6 +7,7 @@ using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
@@ -74,7 +74,7 @@ public class DeviceTemplateService : IDeviceTemplateService
|
||||
duplicate.ThrowIfTrue("品牌和型号重复");
|
||||
}
|
||||
|
||||
private void CheckJsonFormat(string template)
|
||||
private static void CheckJsonFormat(string template)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -164,7 +164,7 @@ public class DishesMenuService : IDishesMenuService
|
||||
var keys = entities.DistinctBy(x => new { x.CustomCode, x.StartDate, x.EndDate, x.ShiftType })
|
||||
.Select(x => new { x.CustomCode, x.StartDate, x.EndDate, x.ShiftType })
|
||||
.ToList();
|
||||
var deleteWhere = LinqExpressionExtension.False<DishesMenuEntity>();
|
||||
var deleteWhere = LinqExpressionExtensions.False<DishesMenuEntity>();
|
||||
keys.ForEach(x =>
|
||||
{
|
||||
deleteWhere = deleteWhere.Or(item => item.BusinessPlaceCode == request.BusinessPlaceCode
|
||||
@@ -178,7 +178,7 @@ public class DishesMenuService : IDishesMenuService
|
||||
|
||||
if (request.Items.Any())
|
||||
{
|
||||
Expression<Func<DishesMenuEntity, bool>> whereCheck = LinqExpressionExtension.False<DishesMenuEntity>();
|
||||
Expression<Func<DishesMenuEntity, bool>> whereCheck = LinqExpressionExtensions.False<DishesMenuEntity>();
|
||||
request.Items.ForEach(p =>
|
||||
{
|
||||
whereCheck = whereCheck.Or(x => x.BusinessPlaceCode == request.BusinessPlaceCode
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.7.2" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GainfoService : IGainfoService
|
||||
var currentTenantId = _currentUser.GetStringTenantId();
|
||||
|
||||
//根据组织架构搜索档案
|
||||
Expression<Func<GainfoEntity, bool>> where = LinqExpressionExtension.False<GainfoEntity>();
|
||||
Expression<Func<GainfoEntity, bool>> where = LinqExpressionExtensions.False<GainfoEntity>();
|
||||
foreach (var item in request.DepartmentSelections)
|
||||
{
|
||||
var depts = await GetRecursionDepartmentNosAsync(item.DepartmentNos);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.7.0" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.3" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.Sys.Api;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
@@ -561,8 +561,7 @@ public class BalanceService : IBalanceService
|
||||
balanceRecord.Status = BalanceRecordStatusEnumType.Obsolute;
|
||||
balanceRecord.Remark = request.Reason;
|
||||
|
||||
|
||||
await ContinueUpdateAsync(async () =>
|
||||
await CommonHelper.RetryAsync(async () =>
|
||||
{
|
||||
//重算金额
|
||||
var canteenUser = await _dbContext.Queryable<GainfoMealEntity>().Where(x => x.UserNo == balanceRecord.UserNo).SingleAsync();
|
||||
@@ -899,29 +898,4 @@ public class BalanceService : IBalanceService
|
||||
|
||||
return days;
|
||||
}
|
||||
|
||||
|
||||
//************************************************************** help methods ******************************************************************
|
||||
|
||||
private async Task ContinueUpdateAsync(Func<Task> func, int retry)
|
||||
{
|
||||
for (int i = 0; i < retry; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
await func();
|
||||
return;
|
||||
}
|
||||
catch (Exception ex) when (ex is VersionExceptions)
|
||||
{
|
||||
_logger.LogWarning(ex, "{message}", ex.Message);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
throw new UserFriendlyException("操作失败,请重试");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
using Dlhis.Canteen.Setting.Services;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services.Implements;
|
||||
|
||||
@@ -52,38 +50,6 @@ public abstract class BaseOrderService
|
||||
uniqueNos.Contains(deviceUniqueNo).ThrowIfFalse("无消费权限");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设备并发更新 需要抛出VersionExceptions
|
||||
/// </summary>
|
||||
/// <param name="func"></param>
|
||||
/// <param name="retry"></param>
|
||||
/// <param name="errorMessage"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="UserFriendlyException"></exception>
|
||||
protected async Task ContinueUpdateAsync(Func<Task> func, int retry, string errorMessage = null)
|
||||
{
|
||||
for (int i = 0; i < retry; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
await func();
|
||||
return;
|
||||
}
|
||||
catch (Exception ex) when (ex is VersionExceptions)
|
||||
{
|
||||
_logger.LogWarning(ex, "{message}", ex.Message);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
throw new UserFriendlyException(errorMessage ?? "操作失败,请重试");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取参数配置
|
||||
/// </summary>
|
||||
|
||||
@@ -87,7 +87,7 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService
|
||||
};
|
||||
|
||||
var orderId = await DbContext.InsertReturnIdentityAsync(order);
|
||||
await ContinueUpdateAsync(async () =>
|
||||
await CommonHelper.RetryAsync(async () =>
|
||||
{
|
||||
await _disheMenuApi.GetBookingDishesDetailAsync(request.BookingDate, request.BusinessPlaceCode, (int)request.ShiftType, request.DishesCode);
|
||||
var menuDetail = menuDetailResult.Data;
|
||||
|
||||
@@ -5,7 +5,6 @@ using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.CustomClass;
|
||||
@@ -425,7 +424,7 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
{
|
||||
var order = await DbContext.Queryable<CanteenOrderEntity>().Where(x => x.Id == orderId).FirstAsync();
|
||||
|
||||
await ContinueUpdateAsync(async () =>
|
||||
await CommonHelper.RetryAsync(async () =>
|
||||
{
|
||||
var canteenUser = await DbContext.Queryable<GainfoMealEntity>().Where(x => x.UserNo == order.UserNo).FirstAsync();
|
||||
//金额+-
|
||||
@@ -463,7 +462,7 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
|
||||
var allowNoBalance = await GetSettingAsync<bool>(CanteenSettingItemEnumType.AllowNoBalance);
|
||||
|
||||
await ContinueUpdateAsync(async () =>
|
||||
await CommonHelper.RetryAsync(async () =>
|
||||
{
|
||||
if (!allowNoBalance)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,6 @@ public class Startup : DefaultStartup
|
||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
base.Configure(app, env);
|
||||
app.UseSnowFlakeInit();
|
||||
app.UseSnowFlakeDistributedInitialize();
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.6.0" />
|
||||
<PackageReference Include="Minio" Version="6.0.1" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.3" />
|
||||
<PackageReference Include="Minio" Version="6.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.SqlSugar" Version="0.1.2" />
|
||||
<PackageReference Include="Kurisu.SqlSugar" Version="0.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.7.1" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.3" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
public async Task UploadLogsAsync(List<DeviceUploadLogUploadRequest> requests)
|
||||
{
|
||||
//判断存在的记录
|
||||
Expression<Func<DeviceUploadLogEntity, bool>> where = LinqExpressionExtension.False<DeviceUploadLogEntity>();
|
||||
Expression<Func<DeviceUploadLogEntity, bool>> where = LinqExpressionExtensions.False<DeviceUploadLogEntity>();
|
||||
requests.ForEach(p =>
|
||||
{
|
||||
where = where.Or(x => x.DeviceUniqueNo == p.DeviceUniqueNo && x.SerialNo == p.SerialNo && x.RaiseDateTime == p.RaiseDateTime);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.7" />
|
||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.9.3" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.7.0" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.3" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace Dlhis.ScheduledTask
|
||||
{
|
||||
public class IPPortDto
|
||||
{
|
||||
public string IP { get; set; }
|
||||
public int Port { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class CancelDuplicationTaskJob : BaseJob
|
||||
{
|
||||
try
|
||||
{
|
||||
Expression<Func<DeviceTaskEntity, bool>> where = LinqExpressionExtension.False<DeviceTaskEntity>();
|
||||
Expression<Func<DeviceTaskEntity, bool>> where = LinqExpressionExtensions.False<DeviceTaskEntity>();
|
||||
var ignoreData = new List<IdVersion>();
|
||||
//最新一条更新人员信息
|
||||
if (item.Type == DeviceTaskEnumType.Update && item.Status == DeviceTaskStatusEnumType.Wait)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Net.Sockets;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Scheduled;
|
||||
using Kurisu.Scheduled.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -6,7 +6,6 @@ using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.ScheduledTask.SyncSapInfo;
|
||||
using Dlhis.ScheduledTask.SyncSapInfo.Services;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Scheduled;
|
||||
@@ -92,7 +91,7 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
await DbContext.Client.Ado.BeginTranAsync();
|
||||
try
|
||||
{
|
||||
await ContinueUpdateAsync(async () =>
|
||||
await CommonHelper.RetryAsync(async () =>
|
||||
{
|
||||
var mealUser = await DbContext.Queryable<GainfoMealEntity>().Where(x => x.UserCode == mealSupplement.Code).FirstAsync();
|
||||
var b = mealUser.Balance += mealSupplement.Amount;
|
||||
@@ -107,7 +106,6 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
{
|
||||
throw new VersionExceptions("餐补写入错误");
|
||||
}
|
||||
|
||||
}, 5);
|
||||
|
||||
var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>
|
||||
@@ -227,26 +225,4 @@ public class MealSupplementHandlerJob : BaseJob
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ContinueUpdateAsync(Func<Task> func, int retry, string errorMessage = null)
|
||||
{
|
||||
for (int i = 0; i < retry; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
await func();
|
||||
return;
|
||||
}
|
||||
catch (Exception ex) when (ex is VersionExceptions)
|
||||
{
|
||||
Logger.LogWarning(ex, ex.Message);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
throw new UserFriendlyException(errorMessage ?? "操作失败,请重试");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,5 +25,6 @@ public class Startup : DefaultStartup
|
||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
base.Configure(app, env);
|
||||
app.UseSnowFlakeDistributedInitialize();
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ using System.Linq.Expressions;
|
||||
using Dlhis.ScheduledTask.TaskAssignment.Request;
|
||||
using Dlhis.ScheduledTask.TaskAssignment.Response;
|
||||
using Kurisu.AspNetCore.Scope;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
@@ -69,7 +68,7 @@ public class AssignmentService : IAssignmentService
|
||||
}
|
||||
|
||||
var taskIdVs = page.Data.Select(x => new { x.TaskId, x.Version }).ToList();
|
||||
Expression<Func<DeviceTaskEntity, bool>> where = LinqExpressionExtension.False<DeviceTaskEntity>();
|
||||
Expression<Func<DeviceTaskEntity, bool>> where = LinqExpressionExtensions.False<DeviceTaskEntity>();
|
||||
taskIdVs.ForEach(p =>
|
||||
{
|
||||
where = where.Or(x => x.Id == p.TaskId && x.Version == p.Version && x.Status != DeviceTaskStatusEnumType.Success);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.6.0" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -5,6 +5,7 @@ using Dlhis.User.Identity.Services;
|
||||
using Kurisu.AspNetCore.Scope;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.6.0" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.3" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user