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
ÿþ--[[
    x: WMS-80-01
     Tðy: ¾‹Y-Rú^MR
    \O€ÿHAN  
    åegÿ2023-9-15
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ BeforeDataObjCreate
 
    ŸRý€:
        1    ÿ9hnc N_TYPE  ¾‹n S_TYPE
        2    ÿ·ƒÖSÍd\OºNXT„v å]‚ShƋ
 
    ôf9e°‹U_:
    
--]]
wms_base = require( "wms_base" )
 
function BeforeDataObjCreate ( strLuaDEID ) 
    local   nRet, strRetInfo
    -- step1  ·ƒÖS¾‹Y{|‹W
    nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "N_TYPE" ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! "..strRetInfo ) end 
    local obj_attrs = json.decode( strRetInfo ) 
    local type = lua.StrToNumber(obj_attrs[1].value)            -- ¾‹Y{|‹W
 
    -- 9hncW[xQ·ƒÖS N_TYPE „v>f:y Tðy
    local str_type = wms_base.GetDictItemName( strLuaDEID, "WMS_EquipmentType", type )
    
    local factory
    nRet, factory = m3.GetMyFactory( strLuaDEID )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "GetMyFactory1Y%! "..factory ) end
 
    -- ¾‹n0¾‹Y0áOo`
    local   attr_value = {}
    attr_value[1] = lua.KeyValueObj( "S_TYPE", str_type )
    attr_value[2] = lua.KeyValueObj( "S_FACTORY", factory )
    nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "¾‹n0¾‹Y0áOo`1Y%!  "..strRetInfo ) end   
end