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