@ -14,6 +14,7 @@ import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver;
import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver ;
import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver ;
import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver ;
import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver ;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver ;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver ;
import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver ;
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver ;
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver ;
import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver ;
import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver ;
import org.nl.acs.ext.wms.service.AcsToWmsService ;
import org.nl.acs.ext.wms.service.AcsToWmsService ;
@ -156,6 +157,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
StandardStorageDeviceDriver standardStorageDeviceDriver ;
StandardStorageDeviceDriver standardStorageDeviceDriver ;
StandardAutodoorDeviceDriver standardAutodoorDeviceDriver ;
StandardAutodoorDeviceDriver standardAutodoorDeviceDriver ;
StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver ;
StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver ;
StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver ;
int type = Integer . parseInt ( acsConfigService . findConfigFromCache ( ) . get ( AcsConfig . BUSINESSTYPE ) ) ;
int type = Integer . parseInt ( acsConfigService . findConfigFromCache ( ) . get ( AcsConfig . BUSINESSTYPE ) ) ;
try {
try {
@ -180,7 +182,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
// 到达取货点请求取货
// 到达取货点请求取货
else if ( phase = = 0x03 ) {
else if ( phase = = 0x03 ) {
if ( ObjectUtil . isEmpty ( inst ) ) {
if ( ObjectUtil . isEmpty ( inst ) ) {
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
break ;
break ;
}
}
//检测站点
//检测站点
@ -194,7 +196,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
flag = true ;
flag = true ;
} else {
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}无货,无法反馈" ) ;
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}无货,无法反馈" ) ;
}
}
}
}
//普通站点
//普通站点
@ -212,49 +214,80 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
flag = true ;
flag = true ;
} else {
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}无货,无法反馈" ) ;
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}无货,无法反馈" ) ;
}
}
}
}
}
}
// 检验取放货条件
//检测站点smart200
JSONObject agv_check = device_extra_table
if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteSmartDeviceDriver ) {
. query ( "is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device . getDevice_code ( ) + "'" )
standardInspectSiteSmartDeviceDriver = ( StandardInspectSiteSmartDeviceDriver ) device . getDeviceDriver ( ) ;
. uniqueResult ( 0 ) ;
if ( StrUtil . equals ( acsConfigService . findConfigFromCache ( ) . get ( AcsConfig . IGNOREHASGOODS ) , "1" ) ) {
if ( ObjectUtil . isNotEmpty ( agv_check ) & & "true" . equals ( agv_check . getString ( "extra_value" ) ) ) {
JSONObject agv_check_status = device_extra_table
. query ( "is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device . getDevice_code ( ) + "'" )
. uniqueResult ( 0 ) ;
if ( ObjectUtil . isNotEmpty ( agv_check_status ) & & "2" . equals ( agv_check_status . getString ( "extra_value" ) ) ) {
inst . setExecute_status ( "1" ) ;
inst . setExecute_status ( "1" ) ;
instructionService . update ( inst ) ;
instructionService . update ( inst ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
flag = true ;
flag = true ;
agv_check_status . put ( "extra_value" , "0" ) ;
device_extra_table . update ( agv_check_status ) ;
} else {
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}未放盖确认,无法反馈" ) ;
if ( device . getHas_goods ( ) ! = 0 ) {
inst . setExecute_status ( "1" ) ;
instructionService . update ( inst ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
flag = true ;
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}无货,无法反馈" ) ;
}
}
}
//如果是混料区则上送LMS当前点位的字段,同步到st_ivt_structivt仓位库存表
JSONObject jsonObject = new JSONObject ( ) ;
jsonObject . put ( "device_code" , device_code ) ;
jsonObject . put ( "weight" , standardInspectSiteSmartDeviceDriver . getWeight ( ) ) ;
jsonObject . put ( "product_code" , standardInspectSiteSmartDeviceDriver . getProduct_code ( ) ) ;
jsonObject . put ( "batch_code" , standardInspectSiteSmartDeviceDriver . getBatch_code ( ) ) ;
jsonObject . put ( "product_specifications" , standardInspectSiteSmartDeviceDriver . getProduct_specifications ( ) ) ;
jsonObject . put ( "time" , standardInspectSiteSmartDeviceDriver . getTime ( ) ) ;
jsonObject . put ( "type" , "9" ) ;
acsToWmsService . lnshApplyTaskToWms ( jsonObject ) ;
}
// 检验取放货条件
JSONObject agv_check = device_extra_table
. query ( "is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device . getDevice_code ( ) + "'" )
. uniqueResult ( 0 ) ;
if ( ObjectUtil . isNotEmpty ( agv_check ) & & "true" . equals ( agv_check . getString ( "extra_value" ) ) ) {
JSONObject agv_check_status = device_extra_table
. query ( "is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device . getDevice_code ( ) + "'" )
. uniqueResult ( 0 ) ;
if ( ObjectUtil . isNotEmpty ( agv_check_status ) & & "2" . equals ( agv_check_status . getString ( "extra_value" ) ) ) {
inst . setExecute_status ( "1" ) ;
instructionService . update ( inst ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
flag = true ;
agv_check_status . put ( "extra_value" , "0" ) ;
device_extra_table . update ( agv_check_status ) ;
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}未放盖确认,无法反馈" ) ;
}
}
}
}
// 取货完成请求离开
}
// 取货完成请求离开
else if ( phase = = 0x05 ) {
else if ( phase = = 0x05 ) {
if ( ObjectUtil . isEmpty ( inst ) ) {
if ( ObjectUtil . isEmpty ( inst ) ) {
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
break ;
break ;
}
}
if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteDeviceDriver ) {
if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteDeviceDriver ) {
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
standardInspectSiteDeviceDriver . writing ( 3 ) ;
standardInspectSiteDeviceDriver . writing ( 3 ) ;
if ( standardInspectSiteDeviceDriver . getMode ( ) ! = 0
if ( standardInspectSiteDeviceDriver . getMode ( ) ! = 0
& & standardInspectSiteDeviceDriver . getMove ( ) = = 0 ) {
& & standardInspectSiteDeviceDriver . getMove ( ) = = 0 ) {
inst . setExecute_status ( "5" ) ;
inst . setExecute_status ( "5" ) ;
instructionService . update ( inst ) ;
instructionService . update ( inst ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
flag = true ;
flag = true ;
} else {
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV取货完成请求离开设备{}有货,无法反馈" ) ;
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV取货完成请求离开设备{}有货,无法反馈" ) ;
}
}
}
}
// if(!inst.getTask_code().startsWith("-")) {
// if(!inst.getTask_code().startsWith("-")) {
// //反馈wms系统动作完成
// //反馈wms系统动作完成
@ -269,64 +302,65 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
// acsToWmsService.feedbackActionStatusToWms(feedja);
// acsToWmsService.feedbackActionStatusToWms(feedja);
// }
// }
}
//请求放货
else if ( phase = = 0x07 ) {
if ( ObjectUtil . isEmpty ( inst ) ) {
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
break ;
}
}
//请求放货
if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteDeviceDriver ) {
else if ( phase = = 0x07 ) {
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
if ( ObjectUtil . isEmpty ( inst ) ) {
standardInspectSiteDeviceDriver . writing ( 4 ) ;
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
if ( standardInspectSiteDeviceDriver . getMode ( ) ! = 0
break ;
& & standardInspectSiteDeviceDriver . getMove ( ) = = 0 ) {
}
inst . setExecute_status ( "3" ) ;
if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteDeviceDriver ) {
instructionService . update ( inst ) ;
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
standardInspectSiteDeviceDriver . writing ( 4 ) ;
flag = true ;
if ( standardInspectSiteDeviceDriver . getMode ( ) ! = 0
} else {
& & standardInspectSiteDeviceDriver . getMove ( ) = = 0 ) { inst . setExecute_status ( "3" ) ;
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求放货设备{}有货,无法反馈" ) ;
instructionService . update ( inst ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
flag = true ;
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求放货设备{}有货,无法反馈" ) ;
}
}
}
// 检验取放货条件
}
JSONObject agv_check = device_extra_table
// 检验取放货条件
. query ( "is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device . getDevice_code ( ) + "'" )
JSONObject agv_check = device_extra_table
. query ( "is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device . getDevice_code ( ) + "'" )
. uniqueResult ( 0 ) ;
if ( ObjectUtil . isNotEmpty ( agv_check ) & & "true" . equals ( agv_check . getString ( "extra_value" ) ) ) {
JSONObject agv_check_status = device_extra_table
. query ( "is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device . getDevice_code ( ) + "'" )
. uniqueResult ( 0 ) ;
. uniqueResult ( 0 ) ;
if ( ObjectUtil . isNotEmpty ( agv_check ) & & "true" . equals ( agv_check . getString ( "extra_value" ) ) ) {
if ( ObjectUtil . isNotEmpty ( agv_check_status ) & & "1" . equals ( agv_check_status . getString ( "extra_value" ) ) ) {
JSONObject agv_check_status = device_extra_table
inst . setExecute_status ( "1" ) ;
. query ( "is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device . getDevice_code ( ) + "'" )
instructionService . update ( inst ) ;
. uniqueResult ( 0 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
if ( ObjectUtil . isNotEmpty ( agv_check_status ) & & "1" . equals ( agv_check_status . getString ( "extra_value" ) ) ) {
flag = true ;
inst . setExecute_status ( "1" ) ;
agv_check_status . put ( "extra_value" , "0" ) ;
instructionService . update ( inst ) ;
device_extra_table . update ( agv_check_status ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
} else {
flag = true ;
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}未取盖确认,无法反馈" ) ;
agv_check_status . put ( "extra_value" , "0" ) ;
device_extra_table . update ( agv_check_status ) ;
} else {
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV请求取货设备{}未取盖确认,无法反馈" ) ;
}
}
}
}
}
// 放货完成请求离开
}
else if ( phase = = 0x09 ) {
// 放货完成请求离开
if ( ObjectUtil . isEmpty ( inst ) ) {
else if ( phase = = 0x09 ) {
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
if ( ObjectUtil . isEmpty ( inst ) ) {
break ;
logServer . deviceExecuteLog ( "未找到指令号对应的指令:" , "" , "" , String . valueOf ( ikey ) ) ;
}
break ;
if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteDeviceDriver ) {
}
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteDeviceDriver ) {
standardInspectSiteDeviceDriver . writing ( 5 ) ;
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
if ( standardInspectSiteDeviceDriver . getMode ( ) ! = 0
standardInspectSiteDeviceDriver . writing ( 5 ) ;
& & standardInspectSiteDeviceDriver . getMov e ( ) ! = 0 ) {
if ( standardInspectSiteDeviceDriver . getMod e ( ) ! = 0
inst . setExecute_status ( "6" ) ;
& & standardInspectSiteDeviceDriver . getMove ( ) ! = 0 ) {
instructionService . update ( inst ) ;
inst . setExecute_status ( "6" ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
instructionService . update ( inst ) ;
flag = true ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
} else {
flag = true ;
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV放货完成请求离开设备{}无货,无法反馈" ) ;
} else {
}
logServer . deviceExecuteLog ( device_code , "" , "" , "AGV放货完成请求离开设备{ }无货,无法反馈" ) ;
}
}
}
// if(!inst.getTask_code().startsWith("-")){
// if(!inst.getTask_code().startsWith("-")){
// //反馈wms系统动作完成
// //反馈wms系统动作完成
@ -342,162 +376,167 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
// acsToWmsService.feedbackActionStatusToWms(feedja);
// acsToWmsService.feedbackActionStatusToWms(feedja);
// }
// }
}
//任务完毕
//(无车id及状态)
else if ( phase = = 0x0A ) {
if ( ! ObjectUtil . isEmpty ( inst ) ) {
inst . setInstruction_status ( "2" ) ;
instructionService . finish ( inst ) ;
}
}
//任务完毕
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
//(无车id及状态)
}
else if ( phase = = 0x0A ) {
//请求删除任务
if ( ! ObjectUtil . isEmpty ( inst ) ) {
else if ( phase = = 0x30 ) {
inst . setInstruction_status ( "2" ) ;
flag = true ;
instructionService . finish ( inst ) ;
if ( ! ObjectUtil . isEmpty ( inst ) ) {
}
data = AgvService . sendAgvOneModeInst ( 0x8F , index , 0 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
} else {
}
log . info ( "未找到对应的指令无法删除" ) ;
//请求删除任务
break ;
else if ( phase = = 0x30 ) {
flag = true ;
if ( ! ObjectUtil . isEmpty ( inst ) ) {
data = AgvService . sendAgvOneModeInst ( 0x8F , index , 0 ) ;
} else {
log . info ( "未找到对应的指令无法删除" ) ;
break ;
}
}
}
//任务删除确认
}
//(需要WCS反馈)
//任务删除确认
else if ( phase = = 0xFF ) {
//(需要WCS反馈)
flag = true ;
else if ( phase = = 0xFF ) {
if ( ! ObjectUtil . isEmpty ( inst ) ) {
flag = true ;
instructionService . cancel ( inst . getInstruction_id ( ) ) ;
if ( ! ObjectUtil . isEmpty ( inst ) ) {
}
instructionService . cancel ( inst . getInstruction_id ( ) ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
}
}
//进入区域
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
else if ( phase = = 0x50 ) {
}
//开门
//进入区域
if ( device . getDeviceDriver ( ) instanceof StandardAutodoorDeviceDriver ) {
else if ( phase = = 0x50 ) {
standardAutodoorDeviceDriver = ( StandardAutodoorDeviceDriver ) device . getDeviceDriver ( ) ;
//开门
if ( device . getDeviceDriver ( ) instanceof StandardAutodoorDeviceDriver ) {
standardAutodoorDeviceDriver = ( StandardAutodoorDeviceDriver ) device . getDeviceDriver ( ) ;
standardAutodoorDeviceDriver . OpenOrClose ( "1" ) ;
standardAutodoorDeviceDriver . writeing ( 1 ) ;
if ( standardAutodoorDeviceDriver . getAction ( ) = = 1 ) {
standardAutodoorDeviceDriver . OpenOrClose ( "1" ) ;
standardAutodoorDeviceDriver . OpenOrClose ( "1" ) ;
standardAutodoorDeviceDriver . writeing ( 1 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
if ( standardAutodoorDeviceDriver . getAction ( ) = = 1 ) {
standardAutodoorDeviceDriver . OpenOrClose ( "1" ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
}
}
}
}
}
//离开区域
}
else if ( phase = = 0x51 ) {
//离开区域
//关门
else if ( phase = = 0x51 ) {
if ( device . getDeviceDriver ( ) instanceof StandardAutodoorDeviceDriver ) {
//关门
standardAutodoorDeviceDriver = ( StandardAutodoorDeviceDriver ) device . getDeviceDriver ( ) ;
if ( device . getDeviceDriver ( ) instanceof StandardAutodoorDeviceDriver ) {
standardAutodoorDeviceDriver . OpenOrClose ( "2" ) ;
standardAutodoorDeviceDriver = ( StandardAutodoorDeviceDriver ) device . getDeviceDriver ( ) ;
standardAutodoorDeviceDriver . writeing ( 2 ) ;
standardAutodoorDeviceDriver . OpenOrClose ( "2" ) ;
if ( standardAutodoorDeviceDriver . getAction ( ) = = 2 ) {
standardAutodoorDeviceDriver . writeing ( 2 ) ;
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
if ( standardAutodoorDeviceDriver . getAction ( ) = = 2 ) {
}
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
}
}
} else if ( phase = = 0x64 ) {
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
}
}
//上报异常
} else if ( phase = = 0x64 ) {
else if ( phase = = 0x67 ) {
data = AgvService . sendAgvOneModeInst ( phase , index , 0 ) ;
AgvDto dto = null ;
}
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
//上报异常
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
else if ( phase = = 0x67 ) {
dto = map . get ( String . valueOf ( carno ) ) ;
AgvDto dto = null ;
} else {
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
dto = new AgvDto ( ) ;
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
}
dto = map . get ( String . valueOf ( carno ) ) ;
dto . setName ( String . valueOf ( carno ) ) ;
} else {
if ( arr [ 18 ] * 256 + arr [ 19 ] = = 0 ) {
dto = new AgvDto ( ) ;
dto . setState ( "IDLE" ) ;
acsToWmsService . feedbackAgvStatus ( String . valueOf ( carno ) , "0" , "" ) ;
} else {
StringBuffer errbs = new StringBuffer ( ) ;
for ( int i = 0 ; i < ERROR . length ; i + + ) {
if ( ( ( arr [ 18 ] * 256 + arr [ 19 ] ) & ( 1 < < i ) ) > 0 )
errbs . append ( "," + ERROR [ i ] ) ;
//反馈故障
}
dto . setState ( "ERROR" ) ;
acsToWmsService . feedbackAgvStatus ( String . valueOf ( carno ) , "1" , "error" ) ;
}
}
}
//X坐标
dto . setName ( String . valueOf ( carno ) ) ;
else if ( phase = = 0x70 ) {
if ( arr [ 18 ] * 256 + arr [ 19 ] = = 0 ) {
AgvDto dto = null ;
dto . setState ( "IDLE" ) ;
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
acsToWmsService . feedbackAgvStatus ( String . valueOf ( carno ) , "0" , "" ) ;
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
} else {
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
StringBuffer errbs = new StringBuffer ( ) ;
dto = map . get ( String . valueOf ( carno ) ) ;
for ( int i = 0 ; i < ERROR . length ; i + + ) {
} else {
if ( ( ( arr [ 18 ] * 256 + arr [ 19 ] ) & ( 1 < < i ) ) > 0 )
dto = new AgvDto ( ) ;
errbs . append ( "," + ERROR [ i ] ) ;
//反馈故障
}
}
dto . setName ( String . valueOf ( carno ) ) ;
dto . setState ( "ERROR" ) ;
dto . setPositionX ( String . valueOf ( ikey ) ) ;
acsToWmsService . feedbackAgvStatus ( String . valueOf ( carno ) , "1" , "error" ) ;
}
}
//Y坐标
}
else if ( phase = = 0x71 ) {
//X坐标
AgvDto dto = null ;
else if ( phase = = 0x70 ) {
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
AgvDto dto = null ;
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
dto = map . get ( String . valueOf ( carno ) ) ;
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
} else {
dto = map . get ( String . valueOf ( carno ) ) ;
dto = new AgvDto ( ) ;
} else {
}
dto = new AgvDto ( ) ;
dto . setName ( String . valueOf ( carno ) ) ;
dto . setPositionY ( String . valueOf ( ikey ) ) ;
}
}
//角度
dto . setName ( String . valueOf ( carno ) ) ;
else if ( phase = = 0x72 ) {
dto . setPositionX ( String . valueOf ( ikey ) ) ;
AgvDto dto = null ;
}
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
//Y坐标
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
else if ( phase = = 0x71 ) {
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
AgvDto dto = null ;
dto = map . get ( String . valueOf ( carno ) ) ;
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
} else {
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
dto = new AgvDto ( ) ;
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
}
dto = map . get ( String . valueOf ( carno ) ) ;
dto . setName ( String . valueOf ( carno ) ) ;
} else {
dto . setPositionAngle ( String . valueOf ( ikey ) ) ;
dto = new AgvDto ( ) ;
}
}
//电量
dto . setName ( String . valueOf ( carno ) ) ;
else if ( phase = = 0x73 ) {
dto . setPositionY ( String . valueOf ( ikey ) ) ;
AgvDto dto = null ;
}
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
//角度
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
else if ( phase = = 0x72 ) {
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
AgvDto dto = null ;
dto = map . get ( String . valueOf ( carno ) ) ;
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
} else {
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
dto = new AgvDto ( ) ;
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
}
dto = map . get ( String . valueOf ( carno ) ) ;
dto . setName ( String . valueOf ( carno ) ) ;
} else {
dto . setEnergyLevel ( String . valueOf ( ikey ) ) ;
dto = new AgvDto ( ) ;
}
}
if ( ! ObjectUtil . isEmpty ( data ) ) {
dto . setName ( String . valueOf ( carno ) ) ;
write ( data ) ;
dto . setPositionAngle ( String . valueOf ( ikey ) ) ;
}
//电量
else if ( phase = = 0x73 ) {
AgvDto dto = null ;
Map < String , AgvDto > map = AgvService . findAllAgvFromCache ( ) ;
carno = arr [ 18 ] * 256 + arr [ 19 ] ;
if ( map . containsKey ( String . valueOf ( carno ) ) ) {
dto = map . get ( String . valueOf ( carno ) ) ;
} else {
dto = new AgvDto ( ) ;
}
}
} catch ( Exception e ) {
dto . setName ( String . valueOf ( carno ) ) ;
System . out . println ( e ) ;
dto . setEnergyLevel ( String . valueOf ( ikey ) ) ;
log . info ( e . toString ( ) ) ;
}
log . info ( e . getMessage ( ) ) ;
if ( ! ObjectUtil . isEmpty ( data ) ) {
e . printStackTrace ( ) ;
write ( data ) ;
}
}
} else {
} catch ( Exception e ) {
System . out . println ( "agv上报不是0073类型动作,不处理" ) ;
System . out . println ( e ) ;
log . info ( e . toString ( ) ) ;
log . info ( e . getMessage ( ) ) ;
e . printStackTrace ( ) ;
}
}
} else {
System . out . println ( "agv上报不是0073类型动作,不处理" ) ;
}
}
}
} catch ( Exception e ) {
} catch (
Exception e )
{
} finally {
} finally
{
}
}
}
}
@Override
@Override
public void stop ( ) {
public void stop ( ) {