fix 修复已知问题
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Dlhis.Basic.Device.Services;
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Sys.Entities;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
@@ -32,15 +33,15 @@ public class GainfoOutsourceSettingService : IGainfoOutsourceSettingService
|
||||
{
|
||||
var currentTenantId = _currentUser.GetStringTenantId();
|
||||
|
||||
(!request.Id.HasValue && await _dbContext.Queryable<OutsourceSettingEntity>()
|
||||
(!request.Id.HasValue && await _dbContext.Queryable<FactorySettingEntity>()
|
||||
.Where(x => x.TenantId == currentTenantId)
|
||||
.AnyAsync()).ThrowIfTrue("保存失败,请检查参数");
|
||||
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = new OutsourceSettingEntity
|
||||
var entity = new FactorySettingEntity
|
||||
{
|
||||
EnableFactory = request.EnableFactory,
|
||||
EnableOutsourceDown = request.EnableFactory,
|
||||
TenantId = currentTenantId
|
||||
};
|
||||
|
||||
@@ -48,10 +49,10 @@ public class GainfoOutsourceSettingService : IGainfoOutsourceSettingService
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _dbContext.Queryable<OutsourceSettingEntity>().Where(x => x.Id == request.Id).SingleAsync();
|
||||
var entity = await _dbContext.Queryable<FactorySettingEntity>().Where(x => x.Id == request.Id).SingleAsync();
|
||||
entity.ThrowIfNull("数据不存在,保存失败");
|
||||
|
||||
entity.EnableFactory = request.EnableFactory;
|
||||
entity.EnableOutsourceDown = request.EnableFactory;
|
||||
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
@@ -62,10 +63,9 @@ public class GainfoOutsourceSettingService : IGainfoOutsourceSettingService
|
||||
public async Task<object> GetSettingAsync()
|
||||
{
|
||||
var currentTenantId = _currentUser.GetStringTenantId();
|
||||
return await _dbContext.Queryable<OutsourceSettingEntity>().Where(x => x.TenantId == currentTenantId).Select(x => new
|
||||
return await _dbContext.Queryable<FactorySettingEntity>().Where(x => x.TenantId == currentTenantId).Select(x => new
|
||||
{
|
||||
x.Id,
|
||||
x.EnableFactory
|
||||
x.Id, EnableFactory = x.EnableOutsourceDown
|
||||
}).SingleAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user