视觉设备判定记录

This commit is contained in:
2024-06-21 15:38:47 +08:00
parent b522a27ee9
commit 4de491e331
3 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
using JNPF.Common.Contracts;
namespace Tnb.ProductionMgr.Entities
{
/// <summary>
/// 视觉设备判定结果记录表
/// </summary>
public class PrdVisionResultRecord : BaseEntity<string>
{
public string info { get; set; }
public string result { get; set; }
public int num { get; set; }
public DateTime create_time { get; set; }
}
}

View File

@@ -3356,6 +3356,13 @@ namespace Tnb.ProductionMgr
public async Task<dynamic> VisionResult(MarkingLabelInput input)
{
Log.Information($"视觉设备判定参数:{JsonConvert.SerializeObject(input)}");
PrdVisionResultRecord reocrd = new PrdVisionResultRecord();
reocrd.id = SnowflakeIdHelper.NextId();
reocrd.info = input.mark_code;
reocrd.result = input.result;
reocrd.create_time = DateTime.Now;
reocrd.num = int.Parse(input.station_id);
await _db.Insertable(reocrd).ExecuteCommandAsync();
return $"接收到参数:{JsonConvert.SerializeObject(input)}";
}

View File

@@ -64,7 +64,7 @@ public class Startup : AppStartup
services.AddSingleton<BackgroundService, TimedTaskBackgroundService>(sp => new TimedTaskBackgroundService());
//var bgSvc = App.GetRequiredService<BackgroundService>();
//bgSvc.StartAsync(CancellationToken.None);
services.AddHostedService<RedisBackGround>();
// services.AddHostedService<RedisBackGround>();
}