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
ÿþ--[[
 x: GT-100-18
  Tðy: zzö€FhÞV“^
 \O€: LZH
 eQãSýQpeÿMESEmptyCntrReturn
 ŸRý€ô‹f: mes NÑS¿~¹“^w¹p ÿAGV,dЏ0RŒN|iÞV“^ãS
    “eQpencÿ                                                                                        
    {
    "startLocCode": "w¹pMOnx"
    "cntrCode":"¹[hV÷S"
    }
 
    Yt;‘
    -- step1 ã‰g¥cãS O„v datajson ÂSpe
    -- step2 !hŒšÅ_ OW[µk/f&T:Nzz ÿ:NzzR¥b•
    -- step3 Í‘°e¡‹—{È~¹p'MO
 ØSôf†SòS:
 --]]
require("WMS-Equipment")
wms_cntr = require("wms_container")
wms_wh = require("wms_wh")
require("GT-Base")
function MESEmptyCntrReturn(strLuaDEID)
    local nRet, in_date
    -- step1 ·ƒÖS¥cãSpenc
    nRet, in_date = m3.GetSysDataJson(strLuaDEID)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "WCStoreCallback àeÕl·ƒÖSpencS!" .. in_date) end
    lua.Debug(strLuaDEID, debug.getinfo(1), 'zzå]ňԏÞVÂSpe:', in_date)
 
    -- step2 $R­e Å_kXy˜ /f&Tý    g<Pÿ¡l<P¥b•ԏÞV
    local locationCode = in_date.startLocCode -- w¹pMOn
    local CntrCode = in_date.cntrCode         -- ¹[hV÷S
    if (locationCode == nil or locationCode == '') then lua.Error(strLuaDEID, debug.getinfo(1), "w¹p Ný€:Nzz!") end
    if (CntrCode == nil or CntrCode == '') then lua.Error(strLuaDEID, debug.getinfo(1), "¹[hV÷S Ný€:Nzz!") end
 
    -- Ñ~š[zzXbir™e
    local cg_detail = m3.AllocObject(strLuaDEID, "CG_Detail")
    cg_detail.cntr_code = CntrCode
    cg_detail.item_code = "KGZ"
    cg_detail.item_name = "zzå]ň"
    cg_detail.qty = 1
    cg_detail.uom = '*N'
    nRet, cg_detail = m3.CreateDataObj(strLuaDEID, cg_detail)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), 'Rú^0¹[hV'ÁTfÆ~0ù[aŒ1Y%!' .. cg_detail) end
 
    -- ·ƒÖSw¹páOo`
    local loc_start
    nRet, loc_start = wms_wh.Location_GetInfo(strLuaDEID, locationCode)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "WMS_Location_GetInfo1Y%! " .. loc_start) end
 
    -- Rú^zzXbØvÄ~ÞV“^ûN¡R NµkûN¡Ragv,dЏ ÿŒNµkûN¡RýVê,dЏ
    local operation           = m3.AllocObject(strLuaDEID, "Operation")
    -- w¹páOo`
    operation.start_wh_code   = loc_start.wh_code
    operation.start_area_code = loc_start.area_code
    operation.start_loc_code  = loc_start.code
 
    operation.cntr_code       = CntrCode
 
    operation.op_type         = wms_base.Get_nConst(strLuaDEID, "\ON{|‹W-eQ“^")
    operation.op_def_name     = "AGVzzXbÞV“^"
 
    nRet, operation           = m3.CreateDataObj(strLuaDEID, operation)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), 'Rú^0\ON01Y%!' .. operation) end
end