喷码贴标测试接口

This commit is contained in:
2024-05-15 09:43:01 +08:00
parent eadaa50ef7
commit fd6f2db9f2
2 changed files with 33 additions and 0 deletions

View File

@@ -5,5 +5,7 @@ namespace Tnb.ProductionMgr.Entities.Dto
public string station_id { get; set; }
public string mark_code { get; set; }
public string label_code { get; set; }
public string result { get; set; }
}
}

View File

@@ -7,6 +7,7 @@ using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.FriendlyException;
using JNPF.Logging;
using JNPF.Systems.Entitys.Permission;
using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System;
@@ -14,6 +15,7 @@ using JNPF.VisualDev;
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
using JNPF.VisualDev.Interfaces;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
@@ -674,6 +676,10 @@ namespace Tnb.ProductionMgr
{
OrganizeRelationEntity organizeRelationEntity = await db.Queryable<OrganizeRelationEntity>()
.Where(x => x.ObjectId == input.eqp_id && x.ObjectType == "Eqp").FirstAsync();
if (organizeRelationEntity == null || organizeRelationEntity.OrganizeId == "")
{
throw Oops.Bah("该设备没绑定工位");
}
moTask.workstation_id = organizeRelationEntity?.OrganizeId ?? "";
}
@@ -2883,6 +2889,31 @@ namespace Tnb.ProductionMgr
return code;
}
/// <summary>
/// 获取喷码贴标信息
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public async Task<dynamic> GetLabelInfo(MarkingLabelInput input)
{
Log.Information($"获取喷码贴标信息参数:{JsonConvert.SerializeObject(input)}");
return "(01)16945155732691(11)240510(17)270510(10)24053026#TX-JB-12*24053026*202405*1020270510RJ-A1F3NC2";
}
/// <summary>
/// 觉设备判定
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public async Task<dynamic> VisionResult(MarkingLabelInput input)
{
Log.Information($"视觉设备判定参数:{JsonConvert.SerializeObject(input)}");
return $"接收到参数:{JsonConvert.SerializeObject(input)}";
}
}