1.增加盟讯公司业务逻辑相关适配 前后端增加配置参数“ISMX”进行控制

2.前端websocket取消心跳机制(原有心跳和断线重连当服务端网线断开后需要等tcp保活期到期后才能发现重连),自己实现心跳和重连
3.前端关闭后任占用后台线程问题修复
This commit is contained in:
hehaibing-1996
2024-05-25 17:25:27 +08:00
parent 472862a978
commit 00621bcd55
82 changed files with 3404 additions and 240 deletions

View File

@ -1,9 +1,13 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.BLL.Config;
using WCS.BLL.DbModels;
using WCS.BLL.HardWare;
using WCS.DAL;
using WCS.DAL.Db;
using WCS.DAL.Db.AuthDb;
using WCS.DAL.DbModels;
@ -15,7 +19,49 @@ namespace WCS.BLL.Manager
public static void InitDb()
{
Logs.Write("【初始化数据库】开始", LogsType.StartBoot);
//初始化数据库对象
if (LocalFile.Config.IsMx)
{
DbHelp.db = new SqlSugarScope(new ConnectionConfig()
{
ConnectionString = LocalFile.Config.DataDbPath,
DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite];
IsAutoCloseConnection = true
}, db =>
{
db.Aop.OnError = ex =>
{
};
});
DbHelp.dbLog = new SqlSugarScope(new ConnectionConfig()
{
ConnectionString = LocalFile.Config.LogDbPath,
DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite];
IsAutoCloseConnection = true
}, db =>
{
db.Aop.OnError = ex =>
{
};
});
AuthDbHelp.db = new SqlSugarScope(new ConnectionConfig()
{
ConnectionString = LocalFile.Config.AuthDbPath,
DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite];
IsAutoCloseConnection = true
}, db =>
{
db.Aop.OnError = ex =>
{
};
});
}
DbHelp.db.DbMaintenance.CreateDatabase();
DbHelp.dbLog.DbMaintenance.CreateDatabase();
DbHelp.db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo)
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
@ -46,8 +92,25 @@ namespace WCS.BLL.Manager
DbHelp.db.Insertable(outDocumentSerialNumber).ExecuteCommand();
DbHelp.db.Insertable(stockTakingDocumentSerialNumber).ExecuteCommand();
}
//初始化货架类型
if (!DbHelp.db.Queryable<ShelfTypeInfo>().Any())
{
var smartShelf = new ShelfTypeInfo()
{
ShelfTypeName = "智能货架"
};
var singleLight = new ShelfTypeInfo()
{
ShelfTypeName = "信息化货架"
};
DbHelp.db.Insertable(smartShelf).ExecuteCommand();
DbHelp.db.Insertable(singleLight).ExecuteCommand();
}
Logs.Write("【初始化数据库】结束", LogsType.StartBoot);
//初始化权限数据库
AuthDbHelp.InitDb();
}
}
}