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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
ÿþjson     = require("json")
mobox    = require("OILua_JavelinExt")
m3       = require("oi_base_mobox")
wms_task = require("wms_task")
function test(strLuaDEID)
--       -- ·ƒÖS\ONáOo`
--   local condition = "S_CODE = 'OP250519-00003'"
--   nRet, operation = m3.GetDataObjByCondition(strLuaDEID, "Operation", condition)
--   if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), operation) end
--   -- ·ƒÖSibU\pencÂSpe
--   local ext_data    = json.decode(operation.ext_data)
--   local delivery_no = ext_data.delivery_no -- N¡RUS÷S:N úQ“^US÷S
--   --·ƒÖSúQ“^USáOo`
--   local stock_out
--   condition         = "S_DO_NO = '" .. delivery_no .. "'"
--   nRet, stock_out   = m3.GetDataObjByCondition(strLuaDEID, "GT_Stock_Out", condition)
--   if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), stock_out) end
--   -- ·ƒÖS¹[hV'ÁTfÆ~
--   local cg_detail
--   condition       = "S_CNTR_CODE = '" .. operation.cntr_code .. "'"
--   nRet, cg_detail = m3.GetDataObjByCondition(strLuaDEID, "CG_Detail", condition)
--   if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), cg_detail) end
--   -- ·ƒÖSeQ“^USncLˆáOo`
--   local label_crad
--   local strCondition = "S_SERIAL_NO = '" .. cg_detail.serial_no .. "'"
--   if (tonumber(cg_detail.is_tl) == 1) then
--     nRet, label_crad = m3.GetDataObjByCondition(strLuaDEID, "GT_ROM", strCondition, "T_CREATE DESC")
--     if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSAm4l÷SáOo`1Y%!" .. label_crad) end
--   else
--     nRet, label_crad = m3.GetDataObjByCondition(strLuaDEID, "GT_Label_Crad", strCondition, "T_CREATE DESC")
--     if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSAm4l÷SáOo`1Y%!" .. label_crad) end
--   end
--   -- ·ƒÖSeQ“^USnc4YáOo`
--   local incoming_Info
--   condition = "S_DELIVERY_NO = '" ..
--       label_crad.delivery_no .. "' AND N_DELIVERY_ROW_NO = '" .. label_crad.delivery_row_no .. "'"
--   nRet, incoming_Info = m3.GetDataObjByCondition(strLuaDEID, "GT_Incoming_Info", condition, "T_CREATE DESC")
--   if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSeQ“^USnc4YáOo`1Y%!" .. incoming_Info) end
 
--   -- úQ“^Ó~œgÞV O
--   local data
--   local source = "GTWMSúQ“^ÞV O"
--   nRet, data   = StorageResult(strLuaDEID, operation.code, source)
--   if (nRet ~= 0) then
--     lua.Error(strLuaDEID, debug.getinfo(1), "úQ“^Ó~œgÞV O1Y%!" .. data)
--   end
--   lua.Debug(strLuaDEID, debug.getinfo(1), 'data', data)
 
--   -- Œ(uGT-WMS„vÞV O¥cãS
--   local url = wms_base.Get_sConst(strLuaDEID, "GTWMS-url")
--   local strurl = url
--   local strHeader = ""
--   local strBody = {
--     application = "GITI",
--     code = "WCS_SO_WMS",
--     data = data
--   }
--   nRet, strRetInfo = CreateInterfaceExc(strLuaDEID, strurl, strHeader, strBody, "GTWMS", source)
--   if (nRet ~= 0) then
--     lua.Error(strLuaDEID, debug.getinfo(1), "Œ(u¥cãS1Y%!" .. strRetInfo)
--   end
    
            -- ã‰•'MO
        -- nRet, strRetInfo = wms.wms_UnlockByTask(strLuaDEID,"106EGRCA0217")
        -- if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "wms_UnlockLocation 1Y%! " .. strRetInfo) end
    
        -- Œ(uWCS¥cãS·ƒÖS÷]S„v¶r`
        -- local data = {
        --     req_no = lua.guid(),
        --     roadway = 7
        -- }
        -- local url = wms_base.Get_sConst(strLuaDEID, "WCS-url")
        -- local strurl = url .. "/StackerState"
        -- local roadway_state
        -- nRet, roadway_state = CreateInterfaceExc(strLuaDEID, strurl, "", data, "WCS", "·ƒÖSX›W:g¶r`")
        -- if (nRet ~= 0) then
        --     return 2, "Œ(uWCS¥cãS1Y%!" .. roadway_state
        -- end
        -- local nRet, strRetInfo = mobox.sendHttpRequest(strurl, "", lua.table2str(data))
        -- if (nRet ~= 0) then
        --     return 2, "Œ(u¥cãS1Y%!" .. strRetInfo
        -- end
        -- lua.Debug(strLuaDEID, debug.getinfo(1), 'strRetInfo', strRetInfo)
        -- local success, resJson = pcall(json.decode, strRetInfo)
        -- lua.Debug(strLuaDEID, debug.getinfo(1), 'resJson', resJson.data[1].roadway_state)
        
    -- strCond = " S_ITEM_CODE = '311512BD5'"
    -- nRet, strRetInfo = mobox.getDataObjGroupCount( strLuaDEID, "CG_Detail", "F_QTY", strCond )
    -- lua.Debug(strLuaDEID, debug.getinfo(1), 'strRetInfo', strRetInfo)
    
    --     nRet, test = wms.wms_ResetInventory("Warehouse", "AHYLK")
    --     lua.Debug(strLuaDEID, debug.getinfo(1), "nRet", nRet)
    --     lua.Debug(strLuaDEID, debug.getinfo(1), "test", test)
    -- if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "͑nÓN“^ϑhˆ1Y%ÿ") end
    
    -- local nRet, item_type, material = GT_Get_ItemType(strLuaDEID, '321226AKT')
    -- if (nRet ~= 0) then return 1, item_type end
    -- lua.Debug(strLuaDEID, debug.getinfo(1), 'ir™eáOo`', material)
    -- lua.Debug(strLuaDEID, debug.getinfo(1), 'item_type', item_type)
    
    local condition = "S_CNTR_CODE = '106EGRCA0173' AND S_B_STATE IN ('Œ[b','gbLˆ','I{…_','•ï‹')"
        nRet, op_info = m3.GetDataObjByCondition(strLuaDEID, "Operation", condition,"T_CREATE DESC")
        lua.Debug(strLuaDEID, debug.getinfo(1), 'nRet', nRet)
        lua.Debug(strLuaDEID, debug.getinfo(1), 'op_info', op_info)
end