fy36
2025-07-01 350eb5ec9163d3ea21416b1525bb80191e958071
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
--[[
    版本:     Version 1.0
    创建日期: 2025-4-10
    创建人:   HAN
 
    功能:
        WMS 和上下游系统进行数据同步时用到的标准函数
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
wms   = require ("OILua_WMS")
lua   = require ("oi_base_func")
m3    = require ("oi_base_mobox")
 
local wms_sync = {_version = "0.1.1"}
 
--[[
    功能: 新增同步网关 WMS_Sync_Gateway,如果已经存在不创建
]]
 
function wms_sync.CreateSyncGateway( strLuaDEID, sync_cls, sync_obj_id, sync_bn, note )
    local nRet, strValue
 
    if ( lua.StrIsEmpty( sync_cls ) ) then 
        return 2, "wms_sync.CreateSyncGateway 函数中 sync_cls 必须有值" 
    end
    if ( lua.StrIsEmpty( sync_obj_id ) ) then 
        return 2, "wms_sync.CreateSyncGateway 函数中 sync_obj_id 必须有值" 
    end
    if ( lua.StrIsEmpty( sync_bn ) ) then 
        return 2, "wms_sync.CreateSyncGateway 函数中 sync_bn 必须有值" 
    end
    if ( note == nil ) then note = '' end
 
    local sync_gateway = m3.AllocObject(strLuaDEID,"WMS_Sync_Gateway")
    sync_gateway.sync_cls = sync_cls
 
    nRet, count_order = m3.CreateDataObj( strLuaDEID, count_order )   
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "创建【盘点单】失败!"..count_order ) end  
    
end
return wms_sync