Jianw
2025-05-14 29f8b36ebb718d2051bf0e7e701973ec4419ee80
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
--[[
    编码: WMS-16-02
    名称: 盘点计划-删除后
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: AfterDataObjDelete
 
    功能:
        -- 删除 【盘点单】【计划盘点货品】【计划盘点容器】
 
    更改记录:
    
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function AfterDataObjDelete ( strLuaDEID )
    local   nRet, strRetInfo, plan_count_no
 
    -- 获取 盘点计划编号
    nRet, plan_count_no = m3.GetSysCurEditDataOneAttr( strLuaDEID, "S_CP_NO" ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "GetSysCurEditDataOneAttr失败! "..wh_code ) end
 
    if ( plan_count_no ~= "" ) then
        local strCondition = "S_CP_NO = '"..plan_count_no.."'"
        nRet, strRetInfo = mobox.deleteDataObject( strLuaDEID, "Count_Order", strCondition )
        if ( nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除盘点计划相关的【盘点单】失败!  "..strRetInfo ) end  
 
        nRet, strRetInfo = mobox.deleteDataObject( strLuaDEID, "CP_Location_List", strCondition )
        if ( nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除盘点计划相关的【计划盘点容器】失败!  "..strRetInfo ) end  
        
        nRet, strRetInfo = mobox.deleteDataObject( strLuaDEID, "CP_Good_List", strCondition )
        if ( nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除盘点计划相关的【计划盘点货品】失败!  "..strRetInfo ) end       
        
        nRet, strRetInfo = mobox.deleteDataObject( strLuaDEID, "CP_Count_Container", strCondition )
        if ( nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除盘点计划相关的【计划盘点容器】失败!  "..strRetInfo ) end             
    end
end