diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MarkingLabelInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MarkingLabelInput.cs index 737e7d98..daec8aab 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MarkingLabelInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MarkingLabelInput.cs @@ -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; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 6251fdc3..40848678 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -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() .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; } + + /// + /// 获取喷码贴标信息 + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task GetLabelInfo(MarkingLabelInput input) + { + Log.Information($"获取喷码贴标信息参数:{JsonConvert.SerializeObject(input)}"); + + return "(01)16945155732691(11)240510(17)270510(10)24053026#TX-JB-12*24053026*202405*1020270510RJ-A1F3NC2"; + } + + /// + /// 觉设备判定 + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task VisionResult(MarkingLabelInput input) + { + Log.Information($"视觉设备判定参数:{JsonConvert.SerializeObject(input)}"); + return $"接收到参数:{JsonConvert.SerializeObject(input)}"; + } }