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
ÿþ--[[
    x: GT-18-15
     Tðy: úQ“^US-    c®”-¾‹n:N¡[8h
    \O€ÿLZH
    åegÿ2024/8/14
 
    ýQpeÿ SetState
 
    ŸRý€:
       -- ¾‹núQ“^US:N ¡[8h ¶r`
 
    ôf9e°‹U_:
 
--]]
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
    lua.Debug( strLuaDEID, debug.getinfo(1), 'úQ“^USÂSpe:', objs )
 
    local obj_attrs = {}
    local strCondition, strSetAttr
 
    for n = 1, #objs do
        obj_attrs = m3.KeyValueAttrsToObjAttr(objs[n].attrs)
        if (obj_attrs.S_STATE == 'NG') then
            strCondition = "S_DO_NO = '" .. obj_attrs.S_DO_NO .. "'"
            strSetAttr = "S_STATE = '¡[8h'"
            nRet, strRetInfo = mobox.updateDataAttrByCondition(strLuaDEID, "GT_Stock_Out", strCondition, strSetAttr)
            if (nRet ~= 0) then
                lua.Error(strLuaDEID, debug.getinfo(1), "¾‹n¶r`1Y%!" .. strRetInfo)
            end
        end
    end
    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