1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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
--[[
   编码: WMS-999-01
   名称: 
   作者:
   日期:2025-05-07
 
   函数: Test
   功能:
 
   更改记录:
 
--]]
 
wms_base   = require ("wms_base")
 
function Test( strLuaDEID )
    local strUserLogin, strUserName, nRet
    nRet, strUserLogin, strUserName = mobox.getCurUserInfo( strLuaDEID )
    
    lua.DebugEx( strLuaDEID, "strUserLogin", strUserLogin )
    
    if ( nRet ~= 0 ) then 
        return 2, "获取当前操作人员信息失败! "..strUserLogin 
    end
    -- 获取当前操作人员的单位编码,作为工厂标识
    nRet, strRetInfo = mobox.getUserSectionUnit( strUserLogin )
    if ( nRet ~= 0 ) then 
        return 2, "获取当前操作人员所属单位失败! "..strRetInfo 
    end
    
    lua.DebugEx( strLuaDEID, "strRetInfo", strRetInfo )
    
    local factory = ''
    if ( strRetInfo ~= '' ) then
       local orgInfo = json.decode( strRetInfo ) 
       factory = orgInfo.company_code
    end
    
        lua.DebugEx( strLuaDEID, "factory1", factory )
        
    if factort == '' then
        nRet, factory = wms_base.Get_sConst2( "WMS_Default_Factory")
        
        lua.DebugEx( strLuaDEID, "factory2", factory )
        
        if ( nRet ~= 0 ) then
            return 2, "系统无法获取常量'WMS_Default_Factory'"
        end  
    end
 
end