1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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
33
34
35
36
37
38
39
40
41
--[[
    编码: WMS-19-11
    名称: 调度系统-国自-是否可以进行任务推送
    作者:HAN    
    日期: 2025-1-29
    入口函数: Push
 
    功能说明:
              判断一下输送线是否可以进行任务推送
    变更记录:
 
--]]
 
wms_task = require( "wms_task" )
 
function CanPush ( strLuaDEID ) 
    local strCondition
    local nRet, strRetInfo, nCount
 
lua.DebugEx( strLuaDEID, "In Can Push", "" )
 
    -- 获取调度系统的类型 = 国自的任务数量
    nRet, nCount = wms_task.GetPushedCount( strLuaDEID, "调度类型-国自" )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "wms_task.GetPushedCount 失败!"..nCount) end
 
    local strResult = 'yes'
    
    nRet, nMaxCount = wms_base.Get_nConst2( "最大任务数-国自")
    if nRet ~= 0 then
        lua.Stop( strLuaDEID, nMaxCount )
        return
    end
 
    if ( nCount >= nMaxCount ) then
        strResult = "no"
    end
lua.DebugEx( strLuaDEID, "In Can Push", "OK" )    
    -- 把检测结果返回给 服务器端
    -- 0 说明返回的是字符串 1 是JSON
    mobox.returnValue( strLuaDEID, RETSTR_TYPE.String, strResult )
end