--[[
|
版本: 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
|