1
Jianw
2025-07-09 f6f5e6b632d6649386a380558d84003f3de7ec6c
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
json = require("json")
mobox = require("OILua_JavelinExt")
m3 = require("oi_base_mobox")
 
function rePushTask(strLuaDEID)
 
    local nRet, strRetInfo
    -- 获取选中的数据信息
    nRet, strRetInfo = m3.GetSysDataJson(strLuaDEID)
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "获取当前选择信息失败!" .. strRetInfo)
    end
 
    if (strRetInfo == '') then
        lua.Error(strLuaDEID, debug.getinfo(1), "请至少选择一条数据!" .. strRetInfo)
    end
 
    -- Debug(strLuaDEID, debug.getinfo(1), "strRetInfo:", strRetInfo)
    -- 循环获取选中数据的有效时间
    for n = 1, #strRetInfo do
        lua.Debug(strLuaDEID, debug.getinfo(1), "strRetInfo", strRetInfo)
        lua.Debug(strLuaDEID, debug.getinfo(1), "开始循环", n)
 
        local deliv_order = m3.KeyValueAttrsToObjAttr(strRetInfo[n].attrs)
        lua.Debug(strLuaDEID, debug.getinfo(1), "deliv_order:", deliv_order)
 
        local task_code = deliv_order.S_CODE
 
        local updcondition = "S_CODE = '" .. task_code .. "'"
 
        local updSql = "N_B_STATE = 0,S_B_STATE = '等待'"
        nRet, strRetInfo = mobox.updateDataAttrByCondition(strLuaDEID, "Task", updcondition, updSql)
        if (nRet ~= 0) then
            lua.Error(strLuaDEID, debug.getinfo(1), "更新【货位】当前数量失败!" .. strRetInfo)
        end
 
    end
    
    mobox.setInfo(strLuaDEID,"修改状态成功")
 
end