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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
ÿþ--[[
    x: JX-300-05
     Tðy: WCS->WMS Í‘Ï‘ Tek
    \O€ÿHAN
    åegÿ2025-1-29
 
    §~+Rÿy˜îv
    
    ýQpeÿ weightReturn
 
    WCS Ù¹„v“eQÂSpe
    
{
    "requestPk": "pk2022120614242376",--÷‹Bl÷S
    "MaterialCode": "P60001",--XbØv÷S
    "curPos": "2F_OUT_ST21"--S_MRMOn
    "Weight":"45.23"--͑ϑ
}
    
 
    ŸRý€:
        
 
    ôf9e°‹U_:
       
--]]
 
wms_base = require( "wms_base" )
wms_task = require( "wms_task" )
wms_op = require( "wms_operation" )
 
function weightReturn ( strLuaDEID ) 
    local nRet, strRetInfo
    local body,strCondition,id,strUpdateSql
 
    -- ·ƒÖS¥cãS OeQ„vpenc
    nRet, body = m3.GetSysDataJson(strLuaDEID)  
    if ( nRet ~= 0 ) then
        mobox.stopProgram( strLuaDEID, "“eQÂSpe„v<h_    g˜!" ) 
    end   
 
    lua.Debug( strLuaDEID, debug.getinfo(1), "¥cãS“eQÂSpe", body )
 
    local requestPk = lua.Get_StrAttrValue( body.requestPk )
    local cntr_code = lua.Get_StrAttrValue( body.MaterialCode )
    local curPos = lua.Get_StrAttrValue( body.curPos )
    local Weight = lua.Get_NumAttrValue( body.Weight )--nm¹ppe
 
 
    if ( requestPk == '') then
        mobox.stopProgram( strLuaDEID, "requestPk Å_{˜    g<P!" ) 
    end
    if ( cntr_code == '') then
        mobox.stopProgram( strLuaDEID, "containerCode Å_{˜    g<P!" ) 
    end 
    if ( curPos == '') then
        mobox.stopProgram( strLuaDEID, "curPos Å_{˜    g<P!" ) 
    end 
    if ( Weight == '') then
        mobox.stopProgram( strLuaDEID, "Weight Å_{˜    g<P!" ) 
    end 
 
    -- Àhåg™e±{/f&TX[(W
    strCondition = "S_CODE = '" .. cntr_code .. "' "
    strUpdateSql = "F_ACT_WEIGHT = '".. Weight.. "' "                   --ž[E–͑ϑ
    
    nRet, strRetInfo = mobox.existThisData(strLuaDEID, "Container", strCondition)
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "åg⋹[hVhˆöeÑSu•ï‹: " .. strRetInfo)
    end
    if (strRetInfo == "yes") then
        nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Container", strCondition, strUpdateSql )
        if ( nRet ~= 0 ) then  
            lua.Error( strLuaDEID, debug.getinfo(1), "ôf°e͑ϑáOo`1Y%!"..strRetInfo ) 
        end 
    end
 
    ----------------------------------------------------------------------------------------------------------------------------------------------
    -- ¾‹nԏÞVÓ~œg
    local result = {
        code = 0,
        msg = "success",
        requestPk = body.requestPk
    }    
    m3.EPI_Return( strLuaDEID, result )   
    
    lua.Debug( strLuaDEID, debug.getinfo(1), "ԏÞVÓ~œg", result )
end