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
ÿþ--[[
   x:
    Tðy: Rú^T
   \O€ÿLZH
   åegÿ2025-01-07
 
   ýQpeÿ AfterDataObjCreate
   ŸRý€:  Rú^\ON
 
   ôf9e°‹U_:
 
--]]
 
json  = require("json")
mobox = require("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
require("WMS-BASE")
 
function AfterDataObjCreate(strLuaDEID)
    local nRet, strRetInfo
    nRet, strRetInfo = mobox.getCurEditDataObjAttr(strLuaDEID, "S_START_WH", "S_START_AREA", "S_START_LOC", "S_END_WH",
        "S_END_AREA", "S_END_LOC", "N_TYPE", "S_CODE", "N_PRIORITY","S_CNTR_CODE")
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! " .. strRetInfo) end
    local obj_attrs = json.decode(strRetInfo)
    local start_wh_code = obj_attrs[1].value   --_ËYÓN“^
    local start_area_code = obj_attrs[2].value -- _ËY“^:S
    local start_loc_code = obj_attrs[3].value  -- _ËY'MO
    local end_wh_code = obj_attrs[4].value     -- È~¹pÓN“^
    local end_area_code = obj_attrs[5].value   -- È~¹p“^:S
    local end_loc_code = obj_attrs[6].value    -- È~¹p'MO
    local type = obj_attrs[7].value            -- ûN¡R{|‹W 1 ‰|™eŒèb,dЏ 2 Øpö€,dЏ
    local ly_code = obj_attrs[8].value         -- ûN¡R÷S
    local priority = obj_attrs[9].value        -- OHQ§~('Y„vOHQ)
    local cntr_code = obj_attrs[10].value        -- ¹[hV÷S
 
    --step5  Rú^\ON
    local operation = m3.AllocObject(strLuaDEID, "Operation")
    operation.start_wh_code = start_wh_code
    operation.start_area_code = start_area_code
    operation.start_loc_code = start_loc_code
    operation.op_type = wms_base.Get_nConst(strLuaDEID, "\ON{|‹W-eQ“^")
    operation.end_wh_code = end_wh_code
    operation.end_area_code = end_area_code
    operation.end_loc_code = end_loc_code
    operation.op_def_name = "ûy“^"
    local ext_table = {}
    ext_table.type = type -- ûN¡R{|‹W 1 ‰|™eŒèb,dЏ 2 Øpö€,dЏ
    operation.ext_data = lua.table2str(ext_table)
    operation.cntr_code = cntr_code
    operation.bs_no = ly_code     -- egnUS÷S:NsOûN¡R÷S
    operation.priority = priority -- ‰|™eŒèb'}%`„vOHQ§~gؚ,ck8^„vgNO
    nRet, operation = m3.CreateDataObj(strLuaDEID, operation)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), 'Rú^0\ON01Y%!' .. operation) end
    lua.Debug(strLuaDEID, debug.getinfo(1), "\ONRú^TáOo`", operation)
end