liulb@mesnac.com 1 year ago
parent 0f11e687cc
commit 943090cddf

@ -21,6 +21,7 @@ namespace Admin.Core.Extensions
if (Appsettings.app("Middleware", "ScannerGun", "Enabled").ObjToBool()) if (Appsettings.app("Middleware", "ScannerGun", "Enabled").ObjToBool())
{ {
scannerGun.ScannerGunAsync(); scannerGun.ScannerGunAsync();
Console.WriteLine("扫码枪服务启动");
} }
} }
catch (Exception e) catch (Exception e)

@ -2,6 +2,7 @@ using Admin.Core.Common;
using Admin.Core.Extensions; using Admin.Core.Extensions;
using Admin.Core.IService.ISys; using Admin.Core.IService.ISys;
using Admin.Core.Tasks; using Admin.Core.Tasks;
using Aucma.Core.ScannerGun;
using Aucma.Core.Tasks; using Aucma.Core.Tasks;
using Autofac; using Autofac;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
@ -54,10 +55,10 @@ namespace Admin.Core.RealTimeService
services.AddAutoMapperSetup(); services.AddAutoMapperSetup();
//任务调度 //任务调度
services.AddJobSetup(); //services.AddJobSetup();
//任务 //任务
// services.AddAucmaTaskSetup(); // services.AddAucmaTaskSetup();
services.AddScannerGunSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030") //支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
} }
@ -78,13 +79,14 @@ namespace Admin.Core.RealTimeService
/// </summary> /// </summary>
/// <param name="app"></param> /// <param name="app"></param>
/// <param name="env"></param> /// <param name="env"></param>
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter) public void Configure(IApplicationBuilder app,IScannerGunService scannerGun)
{ {
// 使用静态文件 // 使用静态文件
app.UseStaticFiles(); app.UseStaticFiles();
//app.AucmaTaskMildds(aucamTaskService); //app.AucmaTaskMildds(aucamTaskService);
// 开启QuartzNetJob调度服务 // 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter); //app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
app.UseScannerGunMildd(scannerGun);
} }
#region 注册服务 #region 注册服务

@ -17,7 +17,7 @@ namespace Aucma.Core.ScannerGun
/// </summary> /// </summary>
public static void InitScanCode() public static void InitScanCode()
{ {
string COM1 = "com3"; string COM1 = "COM4";
InstanceSerialPort3(COM1); InstanceSerialPort3(COM1);
} }

Loading…
Cancel
Save