|
|
|
@ -1,8 +1,10 @@
|
|
|
|
using System.Reflection;
|
|
|
|
using System.Reflection;
|
|
|
|
using Com.Ctrip.Framework.Apollo;
|
|
|
|
using Com.Ctrip.Framework.Apollo;
|
|
|
|
using Flurl.Http;
|
|
|
|
using Flurl.Http;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using NeoSmart.Caching.Sqlite;
|
|
|
|
using NeoSmart.Caching.Sqlite;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
@ -10,22 +12,25 @@ using Sln.Wcs.HikRoBotAdapter.Domain.Dto.GbTaskSubmit;
|
|
|
|
using Sln.Wcs.HikRoBotAdapter.Domain.Dto.GenAgvSchedulingTask;
|
|
|
|
using Sln.Wcs.HikRoBotAdapter.Domain.Dto.GenAgvSchedulingTask;
|
|
|
|
using Sln.Wcs.HikRoBotAdapter.Service;
|
|
|
|
using Sln.Wcs.HikRoBotAdapter.Service;
|
|
|
|
using Sln.Wcs.HikRoBotAdapter.Service.Impl;
|
|
|
|
using Sln.Wcs.HikRoBotAdapter.Service.Impl;
|
|
|
|
|
|
|
|
using Sln.Wcs.HoistAdapter.Service;
|
|
|
|
using Sln.Wcs.HoistSdk;
|
|
|
|
using Sln.Wcs.HoistSdk;
|
|
|
|
using Sln.Wcs.HoistSdk.Dto.GetHoistStatus;
|
|
|
|
using Sln.Wcs.HoistSdk.Dto.GetHoistStatus;
|
|
|
|
using Sln.Wcs.Model.Domain;
|
|
|
|
using Sln.Wcs.Model.Domain;
|
|
|
|
using Sln.Wcs.Repository;
|
|
|
|
using Sln.Wcs.Repository;
|
|
|
|
|
|
|
|
using Sln.Wcs.Repository.service;
|
|
|
|
using Sln.Wcs.Serilog;
|
|
|
|
using Sln.Wcs.Serilog;
|
|
|
|
using Sln.Wcs.Plc;
|
|
|
|
using Sln.Wcs.Plc;
|
|
|
|
using Sln.Wcs.Repository.service;
|
|
|
|
|
|
|
|
using Sln.Wcs.Strategy;
|
|
|
|
using Sln.Wcs.Strategy;
|
|
|
|
using ZiggyCreatures.Caching.Fusion;
|
|
|
|
using ZiggyCreatures.Caching.Fusion;
|
|
|
|
using ZiggyCreatures.Caching.Fusion.Serialization.NewtonsoftJson;
|
|
|
|
using ZiggyCreatures.Caching.Fusion.Serialization.NewtonsoftJson;
|
|
|
|
|
|
|
|
using GetHoistStatusDto = Sln.Wcs.HoistAdapter.Domain.Dto.GetHoistStatus.GetHoistStatusDto;
|
|
|
|
using TargetRoute = Sln.Wcs.HikRoBotAdapter.Domain.Dto.GbTaskSubmit.TargetRoute;
|
|
|
|
using TargetRoute = Sln.Wcs.HikRoBotAdapter.Domain.Dto.GbTaskSubmit.TargetRoute;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Sln.Wcs
|
|
|
|
namespace Sln.Wcs
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class Program
|
|
|
|
public class Program
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
private static UpdateableConfigProvider _configProvider;
|
|
|
|
|
|
|
|
|
|
|
|
static async Task Main(string[] args)
|
|
|
|
static async Task Main(string[] args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -41,7 +46,13 @@ namespace Sln.Wcs
|
|
|
|
|
|
|
|
|
|
|
|
log.Info($"系统启动成功,日志存放位置:{config["logPath"]}");
|
|
|
|
log.Info($"系统启动成功,日志存放位置:{config["logPath"]}");
|
|
|
|
|
|
|
|
|
|
|
|
//禁用 SSL
|
|
|
|
var deviceInfoService = serviceProvider.GetService<IBaseDeviceInfoService>();
|
|
|
|
|
|
|
|
List<BaseDeviceInfo> baseDeviceInfos = deviceInfoService.GetDeviceInfos(x => x.isFlag == 1).ToList();
|
|
|
|
|
|
|
|
string serializeObject = JsonConvert.SerializeObject(baseDeviceInfos);
|
|
|
|
|
|
|
|
_configProvider.Set("PLC参数", serializeObject);
|
|
|
|
|
|
|
|
log.Info($"PLC参数已从数据库加载,共{baseDeviceInfos.Count}台设备");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//禁用 SSL
|
|
|
|
FlurlHttp.ConfigureClientForUrl("https://172.16.12.11")
|
|
|
|
FlurlHttp.ConfigureClientForUrl("https://172.16.12.11")
|
|
|
|
.ConfigureInnerHandler(handler =>
|
|
|
|
.ConfigureInnerHandler(handler =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -59,8 +70,8 @@ namespace Sln.Wcs
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
var service = serviceProvider.GetService<IHoistSdk>();
|
|
|
|
var service = serviceProvider.GetService<HoistDispatcher.HoistDispatcher>();
|
|
|
|
service.GetHoistStatus(new GetHoistStatusDto());
|
|
|
|
service.Run(string.Empty,"tagCode",1,2);
|
|
|
|
|
|
|
|
|
|
|
|
Task.Delay(-1).Wait();
|
|
|
|
Task.Delay(-1).Wait();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -82,6 +93,7 @@ namespace Sln.Wcs
|
|
|
|
Assembly.LoadFrom(Path.Combine(basePath, "Sln.Wcs.Plc.dll")),
|
|
|
|
Assembly.LoadFrom(Path.Combine(basePath, "Sln.Wcs.Plc.dll")),
|
|
|
|
Assembly.LoadFrom(Path.Combine(basePath, "Sln.Wcs.Business.dll")),
|
|
|
|
Assembly.LoadFrom(Path.Combine(basePath, "Sln.Wcs.Business.dll")),
|
|
|
|
Assembly.LoadFrom(Path.Combine(basePath, "Sln.Wcs.Strategy.dll")),
|
|
|
|
Assembly.LoadFrom(Path.Combine(basePath, "Sln.Wcs.Strategy.dll")),
|
|
|
|
|
|
|
|
Assembly.LoadFrom(Path.Combine(basePath, "Sln.Wcs.HoistDispatcher.dll")),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
services.Scan(scan => scan.FromAssemblies(assemblies)
|
|
|
|
services.Scan(scan => scan.FromAssemblies(assemblies)
|
|
|
|
@ -126,11 +138,15 @@ namespace Sln.Wcs
|
|
|
|
|
|
|
|
|
|
|
|
services.AddSingleton<IConfiguration>(localConfiguration);
|
|
|
|
services.AddSingleton<IConfiguration>(localConfiguration);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_configProvider = new UpdateableConfigProvider();
|
|
|
|
|
|
|
|
_configProvider.Set("PLC参数", "");
|
|
|
|
|
|
|
|
|
|
|
|
var configurationBuilder = new ConfigurationBuilder()
|
|
|
|
var configurationBuilder = new ConfigurationBuilder()
|
|
|
|
.SetBasePath(basePath)
|
|
|
|
.SetBasePath(basePath)
|
|
|
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
|
|
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
|
|
|
.AddApollo(apolloConfigSection)
|
|
|
|
.AddApollo(apolloConfigSection)
|
|
|
|
.AddDefault();
|
|
|
|
.AddDefault()
|
|
|
|
|
|
|
|
.Add(_configProvider);
|
|
|
|
|
|
|
|
|
|
|
|
apolloConfiguration = configurationBuilder.Build();
|
|
|
|
apolloConfiguration = configurationBuilder.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|