feat: 增加LG-AGV接口并完善物料校验与报工逻辑

This commit is contained in:
XingCheng3
2026-07-16 16:46:06 +08:00
parent 7303ddde9a
commit dcec36611d
36 changed files with 1274 additions and 36 deletions

View File

@@ -0,0 +1,63 @@
ALTER PROCEDURE [dbo].[_IOT接口_报工记录_是否报工判断]
@ nvarchar(50) = 'OP10',
@ nvarchar(50) = 'SA10025',
@ nvarchar(50) = '开工',
@ nvarchar(100) = null
AS
SET NOCOUNT ON
-- 已成功报工的工序不重复报工
declare @ int
select @ = count(1)
from _IOT接口_报工记录
where = @
and = @
and = @
and = 1
if(@ > 0)
begin
select 2 as result,@ + '订单号:'+@+'产品工序已'+@+',无需二次报工' as msg
return
end
-- 断路器主工位:静端进站开工,拐臂箱出站完工;副工位如 AC0603-1 不参与此判断
if(@ like 'AC06%' and charindex('-', @) = 0)
begin
declare @ nvarchar(100) = null
declare @ int = null
set @ = nullif(@, '')
if(@ is null)
begin
select top 1 @ =
from MOBY
where = @
order by ID desc
end
select top 1 @ = try_convert(int, )
from _派工订单_执行计划
where = @
if(@ is null)
begin
select 2 as result,@ + '订单号:'+@+'产品工序'+@+',未查询到工件编号['+isnull(@,'')+']对应的小机型' as msg
return
end
if(@ = '开工' and @ <> 1)
begin
select 2 as result,@ + '订单号:'+@+'产品工序开工,非静端不进行报工' as msg
return
end
if(@ = '完工' and @ <> 3)
begin
select 2 as result,@ + '订单号:'+@+'产品工序完工,非拐臂箱不进行报工' as msg
return
end
end
select 1 as result,'' as msg