wsz
2025-06-20 19898bd66dec87b500b200d5d50961d0fb538ce5
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
--[[
   编码: JX-28-14
   名称: 盘点单-差异回报
   作者: HAN
   日期: 2025-03-06
 
   函数: DiffReturn
   功能: 调用巨沃接口反馈盘点差异给JW-WMS
 
   更改记录:
 
--]]
 
wms_cntr= require( "wms_container" )
jx_api = require ( "jx_external_api")
 
function DiffReturn( strLuaDEID )
    local nRet, strRetInfo
    local count_order
    nRet, count_order = m3.GetSysCurEditDataObj( strLuaDEID, "Count_Order" )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "获取盘点单对象属性失败!"..count_order ) end
    
    nRet, strRetInfo = jx_api.JW_WMS_API_newOffShelfs( strLuaDEID, count_order.count_no )
 
    -- 更新盘点单的差异回报属性
    local curTime = os.date("%Y-%m-%d %H:%M:%S")
    strCondition = "S_COUNT_NO = '"..count_order.count_no.."'"
    local strSetAttr
    if ( nRet == 0 ) then
        strSetAttr = "N_DR_STATE = 1, S_DR_ERR = '', T_CR = '"..curTime.."'"
    else
        lua.Debug( strLuaDEID, debug.getinfo(1), "JW-WMS SetPLCJobStatus 接口错误", strRetInfo )
        strSetAttr = "N_DR_STATE = 2, S_DR_ERR = 'JW-WMS SetPLCJobStatus 接口错误, 详细信息看日志!', T_CR = '"..curTime.."'"
    end
    nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Count_Order", strCondition, strSetAttr )
    if ( nRet ~= 0 ) then  lua.Error( strLuaDEID, debug.getinfo(1), "更新盘点单差异回报失败!"..strRetInfo ) end          
end