fy36
2025-05-14 a37aca60ff9914b0abb710f04118b22420f4f398
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-17-11
    名称: 计划盘点容器-刷新容器货位信息
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: ResetLocInfo
 
    功能:
       -- 触发 计划盘点 下面的计划盘点容器中的货位信息
 
    更改记录:
 
--]]
 
wms_base = require( "wms_base" )
 
function ResetLocInfo ( strLuaDEID ) 
    local nRet, strRetInfo
    local area_code
 
    -- 获取 主数据对象信息(计划盘点)
 
    local runtime_paramter
    nRet, runtime_paramter = m3.GetRuntimeParam(strLuaDEID)
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "GetRuntimeParam失败! "..runtime_paramter ) end
 
    -- 获取主数据对象【盘点计划】
    local master = runtime_paramter.master
 
    if  ( master == nil ) then lua.Error( strLuaDEID, debug.getinfo(1), "运行时参数缺少master属性! " ) end
    local b_state = lua.StrToNumber( master.objAttr["N_B_STATE"] )
    if ( b_state ~= 2 ) then lua.Error( strLuaDEID, debug.getinfo(1), "盘点计划的状态非执行状态,无法进行刷新计划盘点容器货位信息! " ) end
    if ( master.clsId == nil or master.objId == nil ) then
        lua.Error( strLuaDEID, debug.getinfo(1), "运行时参数master属性不完整! " ) 
    end
 
    -- 设置计划盘点容器表中的货位信息
    local add_wfp_paramter = {}
    add_wfp_paramter.wfp_type = 1                  -- 触发数据对象事件(指定数据对象标识)
    add_wfp_paramter.cls = master.clsId
    add_wfp_paramter.obj_id = master.objId
    add_wfp_paramter.trigger_event = "刷新计划盘点容器货位信息"
    nRet, strRetInfo = m3.AddSysWFP( strLuaDEID, add_wfp_paramter )
    if ( nRet ~= 0 ) then
        lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo )
    end    
  
end