fix .
This commit is contained in:
@@ -4,6 +4,7 @@ using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Order.Services;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Kurisu.AspNetCore;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
@@ -23,13 +24,11 @@ public class BalancesController : ControllerBase
|
||||
{
|
||||
private readonly IBalanceService _balanceService;
|
||||
private readonly IHainingBalanceService _hainingBalanceService;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
public BalancesController(IBalanceService balanceService, IHainingBalanceService hainingBalanceService, IServiceProvider serviceProvider)
|
||||
public BalancesController(IBalanceService balanceService, IHainingBalanceService hainingBalanceService)
|
||||
{
|
||||
_balanceService = balanceService;
|
||||
_hainingBalanceService = hainingBalanceService;
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -210,22 +209,20 @@ public class BalancesController : ControllerBase
|
||||
}
|
||||
|
||||
[HttpPost("recalc1")]
|
||||
[IgnoreTenant]
|
||||
[Transactional(IsolationLevel.ReadCommitted)]
|
||||
[IgnoreTenant]
|
||||
public async Task ReC5()
|
||||
{
|
||||
using (var scope = _serviceProvider.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetService<IDbContext>();
|
||||
var middleService = scope.ServiceProvider.GetService<IMiddleService>();
|
||||
var others = await db.Queryable<BalanceRecordEntity>().AS("LocalBalanceRecordEntity")
|
||||
.Where(x => SqlFunc.Subqueryable<BalanceRecordEntity>().Where(p => p.No == x.No).NotAny())
|
||||
.ToListAsync();
|
||||
var sp = App.GetServiceProvider();
|
||||
var db = sp.GetService<IDbContext>();
|
||||
var middleService = sp.GetService<IMiddleService>();
|
||||
var others = await db.Queryable<BalanceRecordEntity>().AS("LocalBalanceRecordEntity")
|
||||
.Where(x => SqlFunc.Subqueryable<BalanceRecordEntity>().Where(p => p.No == x.No).NotAny())
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var item in others)
|
||||
{
|
||||
await middleService.MiddleUploadAsync(item);
|
||||
}
|
||||
foreach (var item in others)
|
||||
{
|
||||
await middleService.MiddleUploadAsync(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user