| | |
| | | // log.error("rgv连接失败!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("dev", slave.getId(), "rgv连接失败"+e.getMessage()); |
| | | deviceErrorService.addDeviceError("devErr", slave.getId(), "rgv连接失败"+e.getMessage()); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | |
| | | if (System.currentTimeMillis()-currentTimeMilliConnectDev>1000*60*10){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devp", slave.getId(), "输送线plc连接失败"); |
| | | deviceErrorService.addDeviceError("devErr", slave.getId(), "输送线plc连接失败"); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | |
| | | |
| | | } catch (Exception e) { |
| | | connectDev = false; |
| | | log.error("RGV数据读取线程异常!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | log.error("dev数据读取线程异常!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("rgv", slave.getId(), "RGV数据读取线程异常"+e.getMessage()); |
| | | deviceErrorService.addDeviceError("devErr", slave.getId(), "dev数据读取线程异常"+e.getMessage()); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | |
| | | log.error("更新数据库数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | } |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.deleteDeviceError("devp", slave.getId()); |
| | | } catch (Exception e){ |
| | | // log.error("e:"+e.getMessage()); |
| | | } |
| | | // try{ |
| | | // DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | // deviceErrorService.deleteDeviceError("devp", slave.getId()); |
| | | // } catch (Exception e){ |
| | | //// log.error("e:"+e.getMessage()); |
| | | // } |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】读取输送线plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | // log.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devp", slave.getId(), "读取输送线plc状态信息失败"); |
| | | deviceErrorService.addDeviceError("devErr", slave.getId(), "读取输送线plc状态信息失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | ArrayList<Integer> staNos = getStaNo(); |
| | | |
| | | int index = staNos.indexOf(staProtocol.getSiteId()); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devWrite", staProtocol.getSiteId(), "单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | |
| | | // //更新命令日志 |
| | | // CommandInfoLogService commandInfoLogService = SpringUtils.getBean(CommandInfoLogService.class); |
| | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol),writeCount)); |
| | | log.error("写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={},{},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入后读取任务值不一致:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | } |
| | | } else { |
| | | writeCount++; |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后读取失败。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol), writeCount)); |
| | | log.error("写入输送线命令后读取失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入输送线命令后读取失败:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | } |
| | | } else { |
| | | writeCount++; |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令失败。输送线plc编号={1},站点数据={2},写入次数={3}", |
| | | slave.getId(), JSON.toJSON(staProtocol),writeCount)); |
| | | log.error("写入输送线命令失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入输送线命令失败:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | //更新指令日志 |
| | | // commandInfoLog.setDeviceLog("指令下发失败"); |
| | | // commandInfoLogService.insert(commandInfoLog); |
| | |
| | | } |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令尝试5次失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.error("写入输送线命令尝试5次失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("devErr", staProtocol.getSiteId(), "写入次数"+writeCount+"写入输送线命令尝试5次失败:"+"单站点写入:任务号:"+staProtocol.getWorkNo()+";目标站:"+staProtocol.getStaNo()); |
| | | } catch (Exception e2){ |
| | | } |
| | | //重新添加数据到任务队列 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, slave.getId(), new Task(2, staProtocol)); |
| | | read();//读取1次设备状态 |