1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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
53
54
55
56
57
58
59
60
61
62
--[[
    编码: JX-24-21
    名称: 出库单-清空和出库相关的数据
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: ResetOutbound
 
    功能:
        清除所有和入库业务相关的数据,包括
        -- 出库单
        -- 出库单明细
        -- 出库波次
        -- 出库波次组成
        -- 出库波次明细
        -- 配盘
        -- 配盘明细
 
    更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function ResetOutbound( strLuaDEID )
    local nRet, strRetInfo
 
    local strCondition = ""
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Outbound_Order")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Outbound_Order】失败!"..strRetInfo) end
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Outbound_Detail")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Outbound_Detail】失败!"..strRetInfo) end    
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Outbound_Wave")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Outbound_Wave】失败!"..strRetInfo) end    
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "OW_Compose")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【OW_Compose】失败!"..strRetInfo) end    
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "OW_Detail")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【OW_Detail】失败!"..strRetInfo) end    
 
    -- 和配盘相关
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Distribution_CNTR")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Distribution_CNTR】失败!"..strRetInfo) end    
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Distribution_CNTR_Detail")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Distribution_CNTR_Detail】失败!"..strRetInfo) end   
 
    local action = {
        {
            action_type = "refresh",
            value = ""
        }
    }
    nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str( action ))
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction错误: "..strRetInfo) end  
end