--[[
|
编码: WMS-56-29
|
名称: 预分配容器明细-超重处理-呼出空料箱
|
作者: HAN
|
日期: 2025-3-9
|
|
级别: 项目
|
|
函数: Overweight_CallEmptyBox
|
功能:
|
-- 获取当前站台信息,根据站台从数据【】中获取 S_FROM_OP=""的站台货品明细
|
-- 根据
|
|
更改记录:
|
--]]
|
jx_base= require( "jx_base" )
|
|
function Overweight_CallEmptyBox ( strLuaDEID )
|
local nRet, strRetInfo
|
local station_no
|
|
-- 获取当前选中的站台号
|
nRet, station_no = m3.GetSysCurEditDataOneAttr( strLuaDEID, "S_STATION_NO" )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "GetSysCurEditDataOneAttr失败! "..station_no ) end
|
if ( staion_no == '' ) then
|
mobox.setInfo( strLuaDEID, "站台号不能为空!")
|
return
|
end
|
|
-- 查找站台货品明细表中存在哪结果出库波次需要补空料箱
|
local strCondition = "N_B_STATE = 0 AND S_STATION_NO = '"..station_no.."'"
|
nRet, strRetInfo = mobox.groupDataObjAttrs( strLuaDEID, "Station_Goods_Detail", strCondition, "", "S_BS_TYPE", "S_BS_NO" )
|
if ( nRet ~= 0 ) then
|
lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo )
|
end
|
if ( strRetInfo == '' ) then
|
mobox.setInfo( strLuaDEID, "站台"..station_no.."没有超重检查货品!")
|
return
|
end
|
|
local strUserLogin, strUserName
|
nRet, strUserLogin, strUserName = mobox.getCurUserInfo( strLuaDEID )
|
if ( nRet ~= 0 ) then
|
mobox.stopProgram( strLuaDEID, "获取当前操作人员信息失败! "..strUserLogin )
|
return
|
end
|
|
|
local area_group = json.decode( strRetInfo )
|
local bs_type = area_group[1][1].value
|
local bs_no = area_group[1][2].value
|
|
-- 组织后台脚本执行的输入参数
|
local paramter = {
|
station = station_no,
|
login = strUserLogin,
|
user_name = strUserName,
|
bs_type = bs_type,
|
bs_no = bs_no
|
}
|
|
lua.Debug( strLuaDEID, debug.getinfo(1), "paramter", paramter )
|
|
nRet, strRetInfo = mobox.addBackendScriptProc( "Station_Goods_Detail","呼出空料箱", lua.table2str( paramter ) )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
|
|
-- proc_id 是后台处理进程标识,可以通过这个值获取进程是否处理完成
|
local data_json = {
|
proc_id = strRetInfo, -- 后台处理进程标识
|
from = "Overweight_call",
|
station = station_no,
|
bs_type = bs_type,
|
bs_no = bs_no
|
}
|
local action =
|
{
|
{
|
action_type = "wait",
|
value = {
|
time = 1, -- 1 秒中刷新一次
|
event = {
|
cls_name = "Pre_Alloc_CNTR_Detail",
|
event_name = "获取入库空料箱计算结果",
|
data_json = data_json
|
}
|
}
|
},
|
}
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) )
|
if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end
|
|
end
|