fix ndc线程

This commit is contained in:
USER-20220102CG\noblelift
2023-05-15 17:06:04 +08:00
parent 35161c5c2c
commit 7364df4a2d
3 changed files with 12 additions and 11 deletions

View File

@@ -197,7 +197,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} else {
//上报异常信息
//不需要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]));
} else {
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));

View File

@@ -72,16 +72,17 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
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 {
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();
port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT2).getValue());
byte[] b = new byte[1024];
@@ -242,7 +243,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} else {
//上报异常信息
//不需要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]));
} else {
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
@@ -267,11 +268,12 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
System.out.println("TwoAgv链接异常");
log.info("TwoAgv链接异常");
log.error("agv连接出现异常:{}", e);
logServer.deviceExecuteLog("NDC2", "", "", "agv异常" + e.getMessage());
logServer.deviceExecuteLog("NDC2", "", "", "agv异常" + e);
if (ObjectUtil.isNotEmpty(s)) {
s.close();
}
System.out.println(e.getMessage());
e.printStackTrace();
} finally {

View File

@@ -1023,7 +1023,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
message = "申请空盘出库成功";
requireSucess = true;
} else {
requireSucess = true;
message = "申请空盘出库失败," + jo.get("message").toString();
}
}