1
Jianw
2025-07-09 88e26a2a960dbbc148332772448b79b9877102d8
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
52
--[[
    编码: WMS-24-19
    名称: 出库单-自动配盘回调
    作者:HAN  
    日期:2025-1-29
 
    级别:项目
    
    函数: CallBack
 
    功能:
        系统在后台执行自动配盘后调用这个脚本,输入参数
        inputparamter = {
            err_code = 0~xxx, msg = "",
            result = {}
        }
    更改记录:
 
--]]
wms_base = require ("wms_base")
 
function CallBack ( strLuaDEID ) 
    local nRet, strRetInfo
    local oo_obj = {}
    
    lua.DebugEx( strLuaDEID, "自动配盘回调-->", "CallBack")
    
    nRet, oo_obj = m3.GetSysCurEditDataObj( strLuaDEID, "Outbound_Order" )
    if (nRet ~= 0) then 
        lua.Stop( strLuaDEID, "获取【出库单】对象属性失败!"..oo_obj ) 
        return
    end
    local paramter
    nRet, paramter = m3.GetSysInputParameter( strLuaDEID ) 
    if ( nRet ~= 0 )  then 
        lua.Stop( strLuaDEID, "获取输入采参数失败!"..paramter ) 
        return
    end 
    
    if paramter.err_code > 0 then
        local strSetAttr = "N_B_STATE = "..OUTBOUND_ORDER_STATE.Error..", N_PRE_B_STATE = "..oo_obj.b_state..
                           ", S_ERR_MSG = '"..lua.FormatSQLString(paramter.msg).."'"
        local strCondition = "S_NO = '"..oo_obj.no.."'"
        nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Outbound_Order", strCondition, strSetAttr )
        if ( nRet ~= 0 ) then  
            lua.Stop( strLuaDEID, "更新【出库单】状态息失败!"..strRetInfo ) 
            return
        end  
    end
        
 
end