--[[ 编码: 名称: WMS-LUA-FUNC-EPI 作者:HAN 日期:2025-1-18 级别:BASIS 函数:main 输入的body体 {func = "函数名称", ...} 功能: 更改记录: --]] json = require ("json") wms = require("OILua_WMS") mobox = require("OILua_JavelinExt") m3 = require("oi_base_mobox") function main( strLuaDEID ) local nRet, body, err_code, strValue err_code = 0 -- 获取接口传入的数据 nRet, body = m3.GetSysDataJson(strLuaDEID) if ( nRet ~= 0 ) then err_code = 200 strValue = "WebAPI输入参数的格式有问题!"..body goto api_call_return end if ( body.func == nil ) then err_code = 200 strValue = "WebAPI输入参数的格式有问题! func 必须有值" goto api_call_return end if ( body.func == "wms_GetConst" ) then nRet, strValue = wms.wms_GetConst( body.strName ) elseif ( body.func == "wms_GetDevCommExt" ) then nRet, strValue = wms.wms_GetDevCommExt( body.strDevCode, body.strCommCode ) elseif ( body.func == "wms_GetDictTypeName" ) then nRet, strValue = wms.wms_GetDictTypeName( body.strDictName, body.nTye ) elseif ( body.func == "wms_TaskFinish" ) then nRet, strValue = wms.wms_TaskFinish( body.strLuaDEID, body.strTaskCode ) elseif ( body.func == "wms_CreateNdcOrder" ) then nRet, strValue = wms.wms_TaskFinish( body.strFactory, body.nScheduleType, body.strOrderXML ) elseif ( body.func == "wms_ChangeNdcOrderParameter" ) then nRet, strValue = wms.wms_ChangeNdcOrderParameter( body.strFactory, body.nScheduleType, body.strOrderXML ) elseif ( body.func == "wms_ChangeNdcOrderPriority" ) then nRet, strValue = wms.wms_ChangeNdcOrderPriority( body.strFactory, body.nScheduleType, body.strOrderXML ) elseif ( body.func == "wms_GetAreaMostEmptyLoc" ) then nRet, strValue = wms.wms_GetAreaMostEmptyLoc( body.strLuaDEID, body.strAreaType, body.strAreaCode ) elseif ( body.func == "wms_GetZoneAvaliableLoc" ) then nRet, strValue = wms.wms_GetZoneAvaliableLoc( body.strLuaDEID, body.strZoneCode, body.strExtParam ) elseif ( body.func == "wms_GetAreaCGLoc" ) then nRet, strValue = wms.wms_GetAreaCGLoc( body.strLuaDEID, body.strAreaCode, body.strExtInfo, body.bIsEmptyCntr ) elseif ( body.func == "wms_GetZoneCGLoc" ) then nRet, strValue = wms.wms_GetZoneCGLoc( body.strLuaDEID, body.strZoneCode, body.strExtInfo, body.bIsEmptyCntr ) elseif ( body.func == "wms_QueryAreaCGLoc" ) then nRet, strValue = wms.wms_QueryAreaCGLoc( body.strLuaDEID, body.strAreaCode, body.strCGDetailWhere. body.strCntrWhere, body.strLocWhere, body.nRetCount ) elseif ( body.func == "wms_QueryZoneCGLoc" ) then nRet, strValue = wms.wms_QueryZoneCGLoc( body.strLuaDEID, body.strZoneCode, body.strCGDetailWhere. body.strCntrWhere, body.strLocWhere, body.nRetCount ) elseif ( body.func == "wms_QueryAreaECLoc" ) then nRet, strValue = wms.wms_QueryAreaECLoc( body.strLuaDEID, body.strAreaCode, body.strCntrWhere, body.strLocWhere, body.nRetCount ) elseif ( body.func == "wms_QueryZoneECLoc" ) then nRet, strValue = wms.wms_QueryZoneECLoc( body.strLuaDEID, body.strZoneCode, body.strCntrWhere, body.strLocWhere, body.nRetCount ) elseif ( body.func == "wms_ContainerLocAction" ) then nRet, strValue = wms.wms_ContainerLocAction( body.strLuaDEID, body.strCntrCode, body.strLocCode, body.strAction ) elseif ( body.func == "wms_ResetZoneStoreNum" ) then nRet, strValue = wms.wms_ResetZoneStoreNum( body.strLuaDEID, body.strZoneCode, body.bResetLoc ) elseif ( body.func == "wms_GetZoneNumInfo" ) then nRet, strValue = wms.wms_GetZoneNumInfo( body.strZoneCodeList ) elseif ( body.func == "wms_IsZoneLoc" ) then nRet, strValue = wms.wms_IsZoneLoc( body.strLocCode, body.strZoneCode ) elseif ( body.func == "wms_GetLocActionEQ" ) then nRet, strValue = wms.wms_GetLocActionEQ( body.strLocCode, body.strAction ) elseif ( body.func == "wms_GetLocBaseInfo" ) then nRet, strValue = wms.wms_GetLocBaseInfo( body.strLocCode ) elseif ( body.func == "wms_GetLocInfo" ) then nRet, strValue = wms.wms_GetLocInfo( body.strLocCode) elseif ( body.func == "wms_GetLocZoneList" ) then nRet, strValue = wms.wms_GetLocZoneList( body.strLocCode, body.strZoneGroup ) elseif ( body.func == "wms_GetAreaInfo" ) then nRet, strValue = wms.wms_GetAreaInfo( body.strAreaCode ) elseif ( body.func == "wms_GetAreaInfo2" ) then nRet, strValue = wms.wms_GetAreaInfo2( body.strAreaCode ) elseif ( body.func == "wms_GetAreaZoneList" ) then nRet, strValue = wms.wms_GetAreaZoneList( body.strAreaCode, body.strZoneGroup ) elseif ( body.func == "wms_GetAreaZoneList2" ) then nRet, strValue = wms.wms_GetAreaZoneList2( body.strAreaCode, body.strRuleType ) elseif ( body.func == "wms_GetZoneInfo" ) then nRet, strValue = wms.wms_GetZoneInfo( body.strZoneCode ) elseif ( body.func == "wms_GetZoneInfo2" ) then nRet, strValue = wms.wms_GetZoneInfo2( body.strZoneCode ) elseif ( body.func == "wms_GetRoadwayInfo" ) then nRet, strValue = wms.wms_GetZoneInfo2( body.strWHCode, body.strAreaCode, body.nRoadway ) elseif ( body.func == "wms_QueryCGDetail" ) then nRet, strValue = wms.wms_QueryCGDetail( body.strLuaDEID, body.strWHCode, body.strAreaCode, body.strCGDetailWhere, body.strCntrWhere ) elseif ( body.func == "wms_GetFuncArea" ) then nRet, strValue = wms.wms_GetFuncArea( body.strMasterCls, body.strMasterCode, body.nAreaType ) elseif ( body.func == "wms_GetAreaLocInfo" ) then nRet, strValue = wms.wms_GetAreaLocInfo( body.strLuaDEID, body.strAreaCode ) elseif ( body.func == "wms_GetZoneLocInfo" ) then nRet, strValue = wms.wms_GetZoneLocInfo( body.strLuaDEID, body.strZoneCode ) elseif ( body.func == "wms_LockLocation" ) then nRet, strValue = wms.wms_LockLocation( body.strLuaDEID, body.strLocCode, body.nLockType, body.strTaskCode, body.strOpCode, body.strOpName ) elseif ( body.func == "wms_UnlockLocation" ) then nRet, strValue = wms.wms_UnlockLocation( body.strLuaDEID, body.strLocCode, body.strTaskCode ) elseif ( body.func == "wms_LockZone" ) then nRet, strValue = wms.wms_LockZone( body.strLuaDEID, body.strZoneCode, body.nLockType, body.strTaskCode, body.strOpCode, body.strOpName ) elseif ( body.func == "wms_UnlockZone" ) then nRet, strValue = wms.wms_UnlockZone( body.strLuaDEID, body.strZoneCode, body.strTaskCode ) elseif ( body.func == "wms_LockLinkZone" ) then nRet, strValue = wms.wms_LockLinkZone( body.strLuaDEID, body.strZoneCode, body.nLockType, body.strTaskCode, body.strOpCode, body.strOpName ) elseif ( body.func == "wms_UnlockLinkZone" ) then nRet, strValue = wms.wms_UnlockLinkZone( body.strLuaDEID, body.strZoneCode, body.strTaskCode ) elseif ( body.func == "wms_UnlockByTask" ) then nRet, strValue = wms.wms_UnlockByTask( body.strLuaDEID, body.strTaskCode ) elseif ( body.func == "wms_UnlockByOperation" ) then nRet, strValue = wms.wms_UnlockByOperation( body.strLuaDEID, body.strOpCode ) elseif ( body.func == "wms_CleanInvalidLocLock" ) then nRet, strValue = wms.wms_CleanInvalidLocLock( body.strWHCode, body.strAreaCode ) elseif ( body.func == "wms_IsLockedCntr" ) then nRet, strValue = wms.wms_IsLockedCntr( body.strCntrCode ) elseif ( body.func == "wms_LockCntr" ) then nRet, strValue = wms.wms_LockCntr( body.strContainerCode, body.nLockType, body.strTransCode, body.nTransTime ) elseif ( body.func == "wms_UnlockCntr" ) then nRet, strValue = wms.wms_UnlockCntr( body.strLuaDEID, body.strContainerCode ) elseif ( body.func == "wms_UnlockCntrByTrans" ) then nRet, strValue = wms.wms_UnlockCntrByTrans( body.strLuaDEID, body.strTransCode ) elseif ( body.func == "wms_CommitCntrLockTrans" ) then nRet, strValue = wms.wms_CommitCntrLockTrans( body.strTransCode ) elseif ( body.func == "wms_AbortCntrLockTrans" ) then nRet, strValue = wms.wms_AbortCntrLockTrans( body.strTransCode ) elseif ( body.func == "wms_GetWHInventory" ) then nRet, strValue = wms.wms_GetWHInventory( body.strItemInfo ) elseif ( body.func == "wms_GetAreaInventory" ) then nRet, strValue = wms.wms_GetAreaInventory( body.strItemInfo ) elseif ( body.func == "wms_GetZoneInventory" ) then nRet, strValue = wms.wms_GetZoneInventory( body.strItemInfo ) elseif ( body.func == "wms_AddWHInventoryChange" ) then nRet, strValue = wms.wms_AddWHInventoryChange( body.strLuaDEID, body.nOpType, body.strItemInfo ) elseif ( body.func == "wms_ResetInventory" ) then nRet, strValue = wms.wms_ResetInventory( body.strObjType, body.strObjCode ) elseif ( body.func == "wms_StatInventory" ) then if ( body.parameter_num == 4 ) then nRet, strValue = wms.wms_StatInventory( body.strLuaDEID, body.strObjType, body.strObjCode, body.nPageSize ) else nRet, strValue = wms.wms_StatInventory( body.strLuaDEID, body.nPage ) end elseif ( body.func == "wms_IPA_Start" ) then nRet, strValue = wms.wms_IPA_Start( body.strWHCode, body.strAreaCode, body.strItemInfo, body.strAddKey, body.bForceSorting, body.nTransTime ) elseif ( body.func == "wms_IPA_Commit" ) then nRet, strValue = wms.wms_IPA_Commit( body.strTransID, body.bIsArray ) elseif ( body.func == "wms_IPA_Abort" ) then nRet, strValue = wms.wms_IPA_Abort( body.strTransID, body.bIsArray ) elseif ( body.func == "wms_AddAccumQtyChg" ) then nRet, strValue = wms.wms_AddAccumQtyChg( body.strLuaDEID, body.strClassID, body.nProcType, body.strNo, body.nRowNo, body.strAddKey ) elseif ( body.func == "wms_AddCloseQtyChg" ) then nRet, strValue = wms.wms_AddCloseQtyChg( body.strLuaDEID, body.strClassID, body.nProcType, body.strNo, body.nRowNo ) elseif ( body.func == "wms_GetOrderInfo" ) then nRet, strValue = wms.wms_GetOrderInfo( body.strClassID, body.strNo ) elseif ( body.func == "wms_CheckAccumQty" ) then nRet, strValue = wms.wms_CheckAccumQty( body.strLuaDEID, body.strClassID, body.nProcType, body.strNo, body.nRowNo ) else err_code = 200 strValue = "WebAPI输入参数的格式有问题! 没有定义名为'"..body.func.."'的wms内部函数!" goto api_call_return end if (nRet ~= 0 ) then err_code = 201 end ::api_call_return:: -- 设置返回结果 local result = { code = err_code, value = strValue } m3.EPI_Return( strLuaDEID, result ) end