fix 优化null字段问题
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
|
using Dlhis.Middle.Entities;
|
||||||
using Dlhis.Middle.Services;
|
using Dlhis.Middle.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
|
|
||||||
namespace Dlhis.Middle.BackgroundServices;
|
namespace Dlhis.Middle.BackgroundServices;
|
||||||
|
|
||||||
@@ -23,6 +25,14 @@ public class HealthCheckBackgroundService : BackgroundService
|
|||||||
if (!_init)
|
if (!_init)
|
||||||
{
|
{
|
||||||
using var scope = _serviceProvider.CreateScope();
|
using var scope = _serviceProvider.CreateScope();
|
||||||
|
|
||||||
|
var db = scope.ServiceProvider.GetService<IDbContext>();
|
||||||
|
|
||||||
|
db.Client.DbMaintenance.CreateDatabase();
|
||||||
|
db.Client.CodeFirst.InitTables<LocalBalanceRecordEntity, LocalGainfoEntity, LocalGainfoMealEntity, LocalBusinessPlaceEntity>();
|
||||||
|
db.Client.CodeFirst.InitTables<LocalBusinessShiftEntity, LocalDeviceRegistryEntity, LocalDeviceEntity, LocalBusinessPlaceShiftRelationshipEntity, LocalBusinessShiftMealRelationshipEntity>();
|
||||||
|
db.Client.CodeFirst.InitTables<LocalCanteenSettingEntity, LocalDepartmentEntity>();
|
||||||
|
|
||||||
var factories = scope.ServiceProvider.GetService<ISettingService>().GetFactories();
|
var factories = scope.ServiceProvider.GetService<ISettingService>().GetFactories();
|
||||||
var ds = scope.ServiceProvider.GetService<IDataDownloadService>();
|
var ds = scope.ServiceProvider.GetService<IDataDownloadService>();
|
||||||
await ds.InitAsync(factories);
|
await ds.InitAsync(factories);
|
||||||
|
|||||||
@@ -33,5 +33,9 @@ namespace Dlhis.Middle.Entities
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "版本号")]
|
[SugarColumn(ColumnDescription = "版本号")]
|
||||||
public int Version { get; set; }
|
public int Version { get; set; }
|
||||||
|
|
||||||
|
public decimal BalanceOfRecharge { get; set; }
|
||||||
|
|
||||||
|
public decimal BalanceOfSubsidies { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,15 +133,4 @@ public class SqlSugarPack : BaseAppPack
|
|||||||
return db;
|
return db;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
||||||
{
|
|
||||||
using var scope = app.ApplicationServices.CreateScope();
|
|
||||||
var db = scope.ServiceProvider.GetService<IDbContext>();
|
|
||||||
|
|
||||||
db.Client.DbMaintenance.CreateDatabase();
|
|
||||||
db.Client.CodeFirst.InitTables<LocalBalanceRecordEntity, LocalGainfoEntity, LocalGainfoMealEntity, LocalBusinessPlaceEntity>();
|
|
||||||
db.Client.CodeFirst.InitTables<LocalBusinessShiftEntity, LocalDeviceRegistryEntity, LocalDeviceEntity, LocalBusinessPlaceShiftRelationshipEntity, LocalBusinessShiftMealRelationshipEntity>();
|
|
||||||
db.Client.CodeFirst.InitTables<LocalCanteenSettingEntity, LocalDepartmentEntity>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user