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
ÿþ--[[
    x: GT-03-13
     Tðy: Åˆ±{å]US-    c®”-¾‹n:NsQí•
    \O€ÿLZH
    åegÿ2023-05-10
 
    ýQpeÿ SetState
 
    ŸRý€:
       -- ¾‹n:N sQí• ¶r`
 
    ôf9e°‹U_:
    V2.0 LZH 2024-06-06 ¾‹n¶r`T7R°eu˜b—
    V2.1 LZH 2024-06-07 Åˆ±{å]US„v/}¡‹Åˆ±{peϑ”^    cž[E–peϑ €^—ň±{å]USRM‘peϑ ÿsQí•å]UST/}¡‹Åˆ±{peϑ‰ - ÿå]US¡‹Rpeϑ - å]US/}¡‹peϑ    ÿ
 
--]]
json  = require("json")
mobox = require("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
 
function SetState(strLuaDEID)
    local nRet, strRetInfo, objs
 
    -- ·ƒÖSS_MR    -N„vpencù[aŒ
    nRet, objs = m3.GetSysDataJson(strLuaDEID)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), objs) end
    local n
    local obj_attrs
    local strCondition, strSetAttr
 
    for n = 1, #objs do
        obj_attrs = m3.KeyValueAttrsToObjAttr(objs[n].attrs)
        if (obj_attrs ~= nil and obj_attrs ~= '') then
            if (obj_attrs.S_STATE ~= '°eú^') then
                strCondition = "S_PACK_NO = '" .. obj_attrs.S_PACK_NO .. "'"
                strSetAttr = "S_STATE = 'sQí•'"
                nRet, strRetInfo = mobox.updateDataAttrByCondition(strLuaDEID, "GT_Packing_Order", strCondition,
                    strSetAttr)
                if (nRet ~= 0) then
                    lua.Error(strLuaDEID, debug.getinfo(1), "¾‹n¶r`1Y%!" .. strRetInfo)
                end
            else
                lua.Error(strLuaDEID, debug.getinfo(1), obj_attrs.S_STATE .. "¶r`àeÕlsQí•!")
            end
        end
    end
    -- V2.0 ¾‹n¶r`T7R°eGridu˜b—
    local strAction = '[{"action_type":"refresh","value":""}]'
    nRet, strRetInfo = mobox.setAction(strLuaDEID, strAction)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "setAction•ï‹: " .. strRetInfo) end
end