lzh
2025-06-24 13c4a636539584ab977fddacfae884b3ec250aee
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
ÿþ--[[
    x: WMS-04-04
     Tðy: 'MO-'MOáOo`!hck
    \O€ÿHAN  
    åegÿ2024-3-2
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ CheckLocAttr
 
    ŸRý€:
        -- ŠbS_MR¹[ϑ>=1 v^Nå‹'MO¡l    gÑ~š[¹[hV„v'MOhˆ^\'` N_CURRENT_NUM ¾‹n:N 0
    
    ôf9e°‹U_:
  
--]]
require ("WMS-BASE")
 
function CheckLocAttr ( strLuaDEID ) 
    local   nRet, strRetInfo
 
    local strCondition = "N_CURRENT_NUM >= 1 and S_CODE NOT IN ( select S_LOC_CODE FROM TN_Loc_Container )"
 
    -- ·ƒÖS'MOáOo`X[(W˜„v'MO
    local strOrder = "S_CODE"
    nRet, strRetInfo = mobox.queryDataObjAttr(strLuaDEID, "Location", strCondition, strOrder,"S_CODE" )
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖS0'MO0áOo`1Y%! " .. strRetInfo) end
    if ( strRetInfo == '' ) then return end
    local location = {}
    local n, nCount
    local success
    local attrs
 
    success, location = pcall( json.decode, strRetInfo)
    if ( success == false ) then lua.Error( strLuaDEID, debug.getinfo(1), "^—Õl„vJSON<h_!"..warehouse ) end
 
    nCount = #location
    if ( nCount == 0 ) then return end
    -- Ä~Ç~prompt áOo`
    local dirty_loc_code_set = ''
    for n = 1, nCount do
        attrs = location[n].attrs
        dirty_loc_code_set = dirty_loc_code_set..'"'..attrs[1].value..'",'
    end
    if ( dirty_loc_code_set ~= "") then
        mobox.setInfo( strLuaDEID, dirty_loc_code_set )
    end
 
    local strUpdateSql = "N_CURRENT_NUM = 0"
    nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Location", strCondition, strUpdateSql )
    if ( nRet ~= 0 ) then  lua.Error( strLuaDEID, debug.getinfo(1), "ôf°e0'MO0áOo`1Y%!"..strRetInfo ) end 
end