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
--[[
    编码: WMS-20-24
    名称: 入库单-清空和入库相关的数据
    作者:HAN  
    日期:2025-1-29
 
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: ResetInbound
 
    功能:
        清除所有和入库业务相关的数据,包括
        -- 入库单
        -- 入库单明细
        -- 入库波次
        -- 波次组成
        -- 入库波次明细
        -- 预分配容器
        -- 预分配容器明细
 
    更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function ResetInbound( strLuaDEID )
    local nRet, strRetInfo
 
    local strCondition = ""
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Inbound_Order")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Inbound_Order】失败!"..strRetInfo) end
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Inbound_Detail")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Inbound_Detail】失败!"..strRetInfo) end    
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Inbound_Wave")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Inbound_Wave】失败!"..strRetInfo) end    
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "IW_Compose")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【IW_Compose】失败!"..strRetInfo) end    
 
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "IW_Detail")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【IW_Detail】失败!"..strRetInfo) end    
   
    -- 和组盘相关
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Pre_Alloc_Container")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Pre_Alloc_Container】失败!"..strRetInfo) end    
    nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Pre_Alloc_CNTR_Detail")
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Pre_Alloc_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