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
ÿþ--[[
 x: GT-40-39
  Tðy: ûN¡RŒ[b
 \O€:
 eQãSýQpeÿTaskFinish
 ŸRý€ô‹f:
 ØSôf†SòS:
 --]]
wms_op = require("wms_operation")
wms_cntr = require("wms_container")
function TaskFinish(strLuaDEID)
    local nRet, strRetInfo
 
    local operation
    nRet, operation = m3.GetSysCurEditDataObj(strLuaDEID, "Operation")
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), operation) end
 
    nRet, strRetInfo = wms_op.SetFinish(strLuaDEID, operation.code)
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "¾‹n\ON÷S='" .. operation.code .. "' „v\ONŒ[b1Y%!" .. strRetInfo)
    end
    
    -- ·ƒÖSûN¡Rù[aŒ
    local task
    nRet, task = m3.SysInputParamToDataObj(strLuaDEID, "Task")
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), task) end
    
    nRet = wms.wms_ResetInventory( "Area", task.end_area_code )
 
    -- eQ“^Ó~œgÞV O
    local data
    local source = "GTWMSeQ“^ÞV O"
    nRet, data = StorageResult(strLuaDEID, operation.code, source)
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "eQ“^Ó~œgÞV O1Y%!" .. data)
    end
    data.loc = "LK001"
    lua.Debug(strLuaDEID, debug.getinfo(1), 'data', data)
 
    -- Œ(uGT-WMS„vÞV O¥cãS
    local strurl = wms_base.Get_sConst(strLuaDEID, "GTWMS-url")
    local strHeader = ""
    local strBody = {
        application = "GITI",
        code = "WCS_ASN_WMS",
        data = data
    }
    nRet, strRetInfo = CreateInterfaceExc(strLuaDEID, strurl, strHeader, strBody, "GTWMS", source)
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "Œ(uWCS¥cãS1Y%!" .. strRetInfo)
    end
end