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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ÿþ--[[
    x: WMS-05-04
     Tðy: ;‘“^:S-æ‰ÑSX[¨Pϑ͑n
    \O€ÿHAN  
    åegÿ2023-06-27
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ TrigResetZoneStorage
 
    ôf9e°‹U_:
        V6.0 HAN 2023/9/6  -- lua.Error/lua.Debug ýQpeØSS    
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
 
function TrigResetZoneStorage ( strLuaDEID ) 
    local   nRet, strRetInfo
    
    -- ·ƒÖSS_MRÍd\O    -N„vZoneù[aŒ
    -- step1  ·ƒÖS“eQÂSpeÿ:WofÂSpe    ÿ
    nRet, strRetInfo = mobox.getInputParameter2( strLuaDEID ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖS WMS-05-04 :WofÂSpe1Y%! "..strRetInfo ) end
    local strDataJson = ''
 
    lua.Debug( strLuaDEID, debug.getinfo(1), "getInputParameter2", strRetInfo )
 
    if ( strRetInfo ~= '' ) then
        local selected_row, success
        success, selected_row = pcall( json.decode, strRetInfo)
        if ( success == false ) then lua.Error( strLuaDEID, debug.getinfo(1), "WMS-05-04 :WofÂSpe/f^—Õl„vJSON<h_!"..selected_row ) end
        -- ÎN    -N„vpencLˆáOo`-N·ƒÖS;‘“^:Sx
        local nRow, nRowCount
        local n, nCount
        local attrs
        local strZoneCode
 
        nRowCount = #selected_row
        for nRow = 1, nRowCount do 
            attrs = selected_row[nRow].attrs
            strZoneCode = ''
            nCount = #attrs
            for n = 1, nCount do
                if (attrs[n].attr == 'S_CODE') then
                    strZoneCode =  attrs[n].value
                    break
                end
            end
            if (strZoneCode == '') then lua.Error( strLuaDEID, debug.getinfo(1), "Grid-N¡l>f:y;‘“^:SxW[µk!" ) end
            strDataJson = strDataJson..'"'..strZoneCode..'",'
        end
        strDataJson = lua.trim_laster_char( strDataJson )
    end
    strDataJson = '['..strDataJson..']'
 
    lua.Debug( strLuaDEID, debug.getinfo(1), "addSysWFP", strDataJson )
 
    --  RN*NTðSYt,g ÿstrDataJson /fُ*N,g„v“eQÂSpe
    nRet, strRetInfo = mobox.addSysWFP( strLuaDEID, 1, strDataJson, "Zone","","", 0, "","X[¨Pϑ͑n","X[¨Pϑ͑n3u÷‹","",0 )
 
    lua.Debug( strLuaDEID, debug.getinfo(1), "addSysWFP.nRet", nRet )
 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
 
end