lzh
2025-06-24 13c4a636539584ab977fddacfae884b3ec250aee
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
42
43
44
45
46
47
48
49
50
51
52
53
ÿþ--[[
    x:
     Tðy: Í‘n•¶r`
    \O€ÿLZH
    åegÿ2025-2-24
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
 
    ýQpeÿ ResetLock
 
    ŸRý€:
        åN0'MO0hˆ„v•¶r`:NÆQ,͑n0lock0hˆ„v•
 
    ôf9e°‹U_:
 
--]]
json  = require("json")
mobox = require("OILua_JavelinExt")
-- require("oi_basestrfunc")
m3 = require( "oi_base_mobox" )
function ResetLock(strLuaDEID)
    local nRet, strRetInfo, objs
 
    -- ·ƒÖSS_MR    -N„vpencù[aŒ
    nRet, objs = m3.GetSysDataJson(strLuaDEID)
    if (nRet ~= 0) then Error(strLuaDEID, debug.getinfo(1), objs) end
    lua.Debug(strLuaDEID, debug.getinfo(1), 'LockhˆÂSpe:', objs)
 
    local obj_attrs, condition
 
    for n = 1, #objs do
        -- ·ƒÖSLockhˆ„vpenc
        obj_attrs = m3.KeyValueAttrsToObjAttr(objs[n].attrs)
 
        -- ÇLockhˆ·ƒÖS'MOhˆpenc
        condition = "S_CODE = '" .. obj_attrs.S_OBJ_CODE .. "'"
        nRet, strRetInfo = m3.GetDataObjByCondition(strLuaDEID, "Location", condition)
        if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1),
                "Falla en la adquisición de espacio de carga" .. strRetInfo) end
        local lock_state = strRetInfo.lock_state -- •¶r`
 
        -- Ç•š[ù[aŒxegåg~b„v'MO‚Yœg'MO„v•¶r`=0RãNhˆ'MO¶r`_8^
        if (tonumber(lock_state) == 0) then
            -- ã‰•
            nRet, strRetInfo = wms.wms_UnlockByTask(strLuaDEID,obj_attrs.S_TASK_CODE )
            if (nRet ~= 0) then Error(strLuaDEID, debug.getinfo(1), "wms_UnlockByTask 1Y%! " .. strRetInfo) end
        end
    end
    local strAction = '[{"action_type":"refresh","value":""}]'
    nRet, strRetInfo = mobox.setAction(strLuaDEID, strAction)
    if (nRet ~= 0) then Error(strLuaDEID, debug.getinfo(1), "setAction•ï‹: " .. strRetInfo) end
end