1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--[[
    编码: JX-110-03
    名称: 调度系统-堆垛机-是否可以进行任务推送
    作者:HAN 
    日期: 2025-1-29   
    入口函数: Push
 
    功能说明:
              判断一下输送线是否可以进行任务推送
    变更记录:
 
--]]
 
wms_task = require( "wms_task" )
 
function CanPush ( strLuaDEID ) 
    local strCondition
    local nRet, strRetInfo, nCount
 
    -- 获取调度系统的类型 = NDC 的任务数量
    nRet, nCount = wms_task.GetPushedCount( strLuaDEID, "调度类型-堆垛机" )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "wms_task.GetPushedCount 失败!"..nCount) end
 
    local strResult = 'yes'
    local nMaxCount = wms_base.Get_nConst(strLuaDEID, "最大任务数-堆垛机")
    if ( nCount >= nMaxCount ) then
        strResult = "no"
    end
    -- 把检测结果返回给 服务器端
    -- 0 说明返回的是字符串 1 是JSON
    mobox.returnValue( strLuaDEID, 0, strResult )
end