提交代码
This commit is contained in:
@ -61,10 +61,12 @@ namespace WCS.BLL.Manager
|
||||
Logs.Write("【初始化数据库】MX", LogsType.StartBoot);
|
||||
}
|
||||
//手动修改后台配置后再进行CodeFirst 数据库的生成、表的生成
|
||||
//如果不配置此参数 每次启动都会持续几十秒才能成功启动后端
|
||||
if (LocalFile.Config.IsResetDBOrTable)
|
||||
{
|
||||
#region 建库建表 只在表有变动时运行
|
||||
DbHelp.db.DbMaintenance.CreateDatabase();
|
||||
//新部署时 日志需要建表 不然没得接口记录
|
||||
DbHelp.dbLog.DbMaintenance.CreateDatabase();
|
||||
Logs.Write("【初始化数据库】创建数据库", LogsType.StartBoot);
|
||||
|
||||
@ -72,12 +74,13 @@ namespace WCS.BLL.Manager
|
||||
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
|
||||
, typeof(ShelfTypeInfo), typeof(MatBaseInfo), typeof(MatInfo)
|
||||
, typeof(StockTakingOrder), typeof(StockTakingOrderMatDetail), typeof(InOutRecord)
|
||||
, typeof(DocumentSerialNumber),typeof(OrderLight),typeof(MatInfoLog)
|
||||
, typeof(DocumentSerialNumber), typeof(OrderLight), typeof(MatInfoLog)
|
||||
, typeof(AppVersion)
|
||||
);
|
||||
Logs.Write("【初始化数据库】db建表", LogsType.StartBoot);
|
||||
|
||||
Logs.Write("【初始化数据库】db(业务数据库)建表", LogsType.StartBoot);
|
||||
DbHelp.dbLog.CodeFirst.InitTables(typeof(SystemApiLogRecord));
|
||||
Logs.Write("【初始化数据库】logdb建表", LogsType.StartBoot);
|
||||
Logs.Write("【初始化数据库】dblog(日志数据库)建表", LogsType.StartBoot);
|
||||
|
||||
//初始化单据序列号数据
|
||||
if (!DbHelp.db.Queryable<DocumentSerialNumber>().Any())
|
||||
@ -88,14 +91,12 @@ namespace WCS.BLL.Manager
|
||||
UpdateDate = DateTime.Now,
|
||||
CurrentSerialNumber = 0
|
||||
};
|
||||
|
||||
var stockTakingDocumentSerialNumber = new DocumentSerialNumber()
|
||||
{
|
||||
DocumentType = DocumentTypeEnum.盘点单据,
|
||||
UpdateDate = DateTime.Now,
|
||||
CurrentSerialNumber = 0
|
||||
};
|
||||
|
||||
DbHelp.db.Insertable(outDocumentSerialNumber).ExecuteCommand();
|
||||
DbHelp.db.Insertable(stockTakingDocumentSerialNumber).ExecuteCommand();
|
||||
}
|
||||
|
Reference in New Issue
Block a user