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
ÿþ--[[
    x: WMS-10-03
     Tðy: 'MO¹[hVÑ~š[- Rd–T
    \O€ÿHAN  
    åegÿ2022-12-05
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ AfterDataObjDelete
 
    ŸRý€:
         1.   Rú^N*N0'MO¹[hVÑ~š[°‹U_0
         2.   ¹[hVŒT'MOÑ~š[T 0“^X[ϑØSShˆ0 O    gØSS ÿŒ(umobox„vhÆQ¥cãSۏLˆYt
         3.   ôf9e0'MO0-N„v N_CURRENT_NUM
    ôf9e°‹U_:
        V2.0
            ã‰Ñ~¹e_·ƒÖS¹eÕl9eۏ
        V3.0 HAN 2023-6-16
        V4.1 HAN 2023-8-9  wmsøvsQ¥cãSŒte 
        V6.0 HAN 2023/9/6  -- lua.Error/lua.Debug ýQpeØSS   
--]]
 
require ("WMS-BASE")
wms_op = require("wms_operation")
wms_wh = require("wms_wh")
wms_task = require("wms_task")
function AfterDataObjDelete ( strLuaDEID ) 
    local   nRet, strRetInfo
    -- step1  ·ƒÖSS_MR‰ Rd–„v 'MOÑ~š[hˆ„váOo` ÿ·ƒÖS 'MO÷S ÿ¹[hV÷S
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_LOC_CODE","S_CNTR_CODE","N_BINDING_METHOD","S_ACTION_SRC" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "0'MO¹[hVÑ~š[0#Rú^T#: ·ƒÖSS_MR‘^\'`1Y%! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local loc_code = obj_attrs[1].value             -- 'MOx
    local cntr_code = obj_attrs[2].value            -- ¹[hVx
    local nCount = #obj_attrs 
 
    -- ·ƒÖSã‰Ñ~„v¹e_ŒTegn ÿÎNhQ@\ØSϑ̑·ƒÖS
    local unbindingMethod = wms_base.Get_nConst(strLuaDEID, "Ñ~š[ã‰Ñ~¹eÕl-û|ß~")
    local source = 'unknow'
    local global_attrs
    nRet, global_attrs = mobox.getGlobalAttr2( strLuaDEID )
    if ( nRet == 0 and global_attrs ~= nil) then
        if ( global_attrs.N_BINDING_METHOD ~= nil ) then unbindingMethod = global_attrs.N_BINDING_METHOD end
        if ( global_attrs.S_ACTION_SRC ~= nil ) then source = global_attrs.S_ACTION_SRC end
    end
 
    -- step1  ub0'MO¹[hVÑ~š[°‹U_0¨R\O{|‹W = ã‰Ñ~
    obj_attrs[nCount+1] = lua.KeyValueObj( "N_ACTION_TYPE", wms_base.Get_nConst(strLuaDEID, "'MO¹[hV¨R\O-ã‰Ñ~") )
    obj_attrs[nCount+2] = lua.KeyValueObj( "N_BINDING_METHOD", unbindingMethod )
    obj_attrs[nCount+3] = lua.KeyValueObj( "S_ACTION_SRC", source )
    nRet, strRetInfo = mobox.createDataObj( strLuaDEID, "'MO¹[hVÑ~š[°‹U_", lua.table2str(obj_attrs) )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), '0'MO¹[hVÑ~š[0#Rú^T#: mobox Rú^0'MO¹[hVÑ~š[°‹U_0ù[aŒ1Y%!'..strRetInfo ) end
 
    -- step2 0“^X[ϑØSShˆ0
    nRet, strRetInfo = wms.wms_ContainerLocAction( strLuaDEID, cntr_code, loc_code, wms_base.Get_nConst(strLuaDEID, "'MO¹[hV¨R\O-ã‰Ñ~") )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), '0'MO¹[hVÑ~š[0# Rd–T#: mobox (WYt0“^X[ϑØSShˆ0öeÑSu•ï‹!'..strRetInfo ) end    
end