fix ndc线程
This commit is contained in:
@@ -197,7 +197,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
} else {
|
} else {
|
||||||
//上报异常信息
|
//上报异常信息
|
||||||
//(不需要WCS反馈)
|
//(不需要WCS反馈)
|
||||||
if (phase == 0x67 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 || phase == 0x75) {
|
if (phase == 0x67 || phase == 0x70 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 ) {
|
||||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[18] * 256 + arr[19]));
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[18] * 256 + arr[19]));
|
||||||
} else {
|
} else {
|
||||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||||
|
|||||||
@@ -72,16 +72,17 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void autoRun() throws IOException {
|
public void autoRun() throws IOException {
|
||||||
|
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
|
||||||
|
InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class);
|
||||||
|
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||||
|
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
|
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class);
|
||||||
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
||||||
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
System.out.println("2楼1区域AGV系统链接开始");
|
System.out.println("2楼1区域AGV系统链接开始");
|
||||||
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
|
|
||||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class);
|
|
||||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
|
||||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
|
||||||
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class);
|
|
||||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
|
||||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
|
||||||
ip = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
ip = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
||||||
port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT2).getValue());
|
port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT2).getValue());
|
||||||
byte[] b = new byte[1024];
|
byte[] b = new byte[1024];
|
||||||
@@ -242,7 +243,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
} else {
|
} else {
|
||||||
//上报异常信息
|
//上报异常信息
|
||||||
//(不需要WCS反馈)
|
//(不需要WCS反馈)
|
||||||
if (phase == 0x67 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 || phase == 0x75) {
|
if (phase == 0x67 || phase == 0x70 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74) {
|
||||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[18] * 256 + arr[19]));
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[18] * 256 + arr[19]));
|
||||||
} else {
|
} else {
|
||||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||||
@@ -267,11 +268,12 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
System.out.println("TwoAgv链接异常");
|
System.out.println("TwoAgv链接异常");
|
||||||
log.info("TwoAgv链接异常");
|
log.info("TwoAgv链接异常");
|
||||||
log.error("agv连接出现异常:{}", e);
|
log.error("agv连接出现异常:{}", e);
|
||||||
|
logServer.deviceExecuteLog("NDC2", "", "", "agv异常" + e.getMessage());
|
||||||
|
logServer.deviceExecuteLog("NDC2", "", "", "agv异常" + e);
|
||||||
if (ObjectUtil.isNotEmpty(s)) {
|
if (ObjectUtil.isNotEmpty(s)) {
|
||||||
s.close();
|
s.close();
|
||||||
}
|
}
|
||||||
System.out.println(e.getMessage());
|
System.out.println(e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
|
|||||||
@@ -1023,7 +1023,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
message = "申请空盘出库成功";
|
message = "申请空盘出库成功";
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
requireSucess = true;
|
|
||||||
message = "申请空盘出库失败," + jo.get("message").toString();
|
message = "申请空盘出库失败," + jo.get("message").toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user