完善 MCS 桌面代理与开炼机动作同步,修复原料相关菜单权限,桌面端新增上辅机 MES 菜单。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-27 15:56:05 +08:00
parent 7a9c19e4f3
commit 442a4c8ae2
113 changed files with 10169 additions and 91 deletions

View File

@@ -30,6 +30,7 @@ using YY.Admin.Services.Service.Print;
using YY.Admin.Services.Service.RubberQuickTest;
using YY.Admin.Services.Service.RubberQuickTestStd;
using YY.Admin.Services.Service.MixingProductionPlan;
using YY.Admin.Services.Service.EquipmentDb;
namespace YY.Admin.Module;
@@ -103,6 +104,11 @@ public class SyncModule : IModule
containerRegistry.RegisterSingleton<IMixingProductionPlanService, MixingProductionPlanService>();
containerRegistry.RegisterSingleton<MixingProductionPlanSyncCoordinator>();
// 设备库代理(厂区 SQL Server 直连 + EQ_* 命令执行)
containerRegistry.RegisterSingleton<IEquipmentDbConnectionFactory, EquipmentDbConnectionFactory>();
containerRegistry.RegisterSingleton<EquipmentDbCommandHandler>();
containerRegistry.RegisterSingleton<IMcsActMillService, McsActMillService>();
var serviceCollection = new ServiceCollection();
serviceCollection.AddTransient<DisconnectGuardHandler>();
serviceCollection.AddHttpClient("JeecgApi", (sp, client) =>
@@ -179,6 +185,21 @@ public class SyncModule : IModule
_ = containerProvider.Resolve<RubberQuickTestStdSyncCoordinator>();
// 密炼计划只读同步协调器
_ = containerProvider.Resolve<MixingProductionPlanSyncCoordinator>();
// 设备库命令处理器(订阅 EQ_*
var eqHandler = containerProvider.Resolve<EquipmentDbCommandHandler>();
_ = Task.Run(async () =>
{
try
{
var factory = containerProvider.Resolve<IEquipmentDbConnectionFactory>();
var (ok, msg) = await factory.TestAsync(CancellationToken.None).ConfigureAwait(false);
await eqHandler.ReportStatusAsync(ok, msg, CancellationToken.None).ConfigureAwait(false);
}
catch (Exception ex)
{
await eqHandler.ReportStatusAsync(false, ex.Message, CancellationToken.None).ConfigureAwait(false);
}
});
}
private static IAsyncPolicy<HttpResponseMessage> GetRetryPolicy()