| | |
| | | && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo >= 9990 && workNo <= 9999)) |
| | | && staProtocol.isPakMk()) { |
| | | |
| | | //20230201. 2号堆垛机有出库任务时,禁止新板入库 |
| | | if (staProtocol.getWorkNo() == 9995) { |
| | | if ( inSta.getStaNo()==103 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)100); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)200); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | if ( inSta.getStaNo()==113 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)114); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | if ( inSta.getStaNo()==213 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)214); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | } |
| | | // //20230201. 2号堆垛机有出库任务时,禁止新板入库 |
| | | // if (staProtocol.getWorkNo() == 9995) { |
| | | // if ( inSta.getStaNo()==103 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)100); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)200); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // if ( inSta.getStaNo()==113 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)114); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // if ( inSta.getStaNo()==213 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)214); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // } |
| | | |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else if (code == 500){ |
| | | if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // } else if (code == 500){ |
| | | // if (ledThread != null) { |
| | | // String errorMsg = jsonObject.getString("msg"); |
| | | // if (!Cools.isEmpty(errorMsg)) { |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | // } |
| | | // } |
| | | // News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } else if (code == 700) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | |
| | | String errorMsg = barcode + "托盘识别异常,请先进行组托!"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if (code == 1000){ |
| | | } else if (code == 500 || code == 1000){ |
| | | if (inSta.getStaNo().equals(103)){ |
| | | staProtocol.setWorkNo((short)9996); |
| | | staProtocol.setStaNo((short)203); |
| | | }else { |
| | | } |
| | | if (inSta.getStaNo().equals(203)){ |
| | | staProtocol.setWorkNo((short)9996); |
| | | staProtocol.setStaNo((short)103); |
| | | }if (inSta.getStaNo().equals(113)){ |
| | | staProtocol.setWorkNo((short)9995); |
| | | staProtocol.setStaNo((short)114); |
| | | }else if (inSta.getStaNo().equals(213)){ |
| | | staProtocol.setWorkNo((short)9995); |
| | | staProtocol.setStaNo((short)214); |
| | | }else { |
| | | staProtocol.setWorkNo((short)9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | } |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = barcode + "需要换入库站。目标站:"+staProtocol.getStaNo(); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | String data = jsonObject.getString("data"); |
| | | String msg = jsonObject.getString("msg"); |
| | | if (code == 500){ |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg ="入库站:" + staProtocol.getStaNo() + "---" + barcode + "检索库位失败,请检查库存剩余。===>>" + data + "--" + msg; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if (code == 1000){ |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg ="入库站:" + staProtocol.getStaNo() + "---" + barcode + "需要换入库站。"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | if(flag){ |
| | | return false; |
| | | continue; |
| | | // return false; |
| | | } |
| | | |
| | | // 判断是否已存在小车绑定任务 |
| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (Cools.isEmpty(steProtocol.loca)) continue; |
| | | if (steProtocol.loca==0) continue; |
| | | if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) { |
| | | return steProtocol.getSteNo().intValue(); |
| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (Cools.isEmpty(steProtocol.loca)) continue; |
| | | if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | | if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) { |
| | |
| | | */ |
| | | public synchronized void ledExecute() { |
| | | for (LedSlave led : slaveProperties.getLed()) { |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | // 工作档集合 |
| | | List<WrkMast> wrkMasts = new ArrayList<>(); |
| | | for (Integer staNo : led.getStaArr()) { |
| | | // 获取叉车站点 |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (null == staProtocol || null == staProtocol.getWorkNo() || 0 == staProtocol.getWorkNo() || !staProtocol.isLoading()) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | // 获取工作档数据 |
| | | WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo()); |
| | | if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; } |
| | | wrkMasts.add(wrkMast); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(wrkMast.getWrkNo()); |
| | | ledCommand.setIoType(wrkMast.getIoType()); |
| | | // 出库模式 |
| | | switch (wrkMast.getIoType()) { |
| | | case 101: |
| | | ledCommand.setTitle("全板出库"); |
| | | break; |
| | | case 103: |
| | | ledCommand.setTitle("拣料出库"); |
| | | break; |
| | | case 104: |
| | | ledCommand.setTitle("并板出库"); |
| | | break; |
| | | case 107: |
| | | ledCommand.setTitle("盘点出库"); |
| | | break; |
| | | case 110: |
| | | ledCommand.setTitle("空板出库"); |
| | | ledCommand.setEmptyMk(true); |
| | | break; |
| | | default: |
| | | News.error("任务入出库类型错误!!![工作号:{}] [入出库类型:{}]", wrkMast.getWrkNo(), wrkMast.getIoType()); |
| | | break; |
| | | } |
| | | ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | ledCommand.setStaNo(wrkMast.getStaNo()); |
| | | ledCommand.setBarcode(wrkMast.getBarcode()); |
| | | if (wrkMast.getIoType() != 110) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); |
| | | try{ |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | // 工作档集合 |
| | | List<WrkMast> wrkMasts = new ArrayList<>(); |
| | | for (Integer staNo : led.getStaArr()) { |
| | | // 获取叉车站点 |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (null == staProtocol || null == staProtocol.getWorkNo() || 0 == staProtocol.getWorkNo() || !staProtocol.isLoading()) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | // 获取工作档数据 |
| | | WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo()); |
| | | if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; } |
| | | wrkMasts.add(wrkMast); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(wrkMast.getWrkNo()); |
| | | ledCommand.setIoType(wrkMast.getIoType()); |
| | | // 出库模式 |
| | | switch (wrkMast.getIoType()) { |
| | | case 101: |
| | | ledCommand.setTitle("全板出库"); |
| | | break; |
| | | case 103: |
| | | ledCommand.setTitle("拣料出库"); |
| | | break; |
| | | case 104: |
| | | ledCommand.setTitle("并板出库"); |
| | | break; |
| | | case 107: |
| | | ledCommand.setTitle("盘点出库"); |
| | | break; |
| | | case 110: |
| | | ledCommand.setTitle("空板出库"); |
| | | ledCommand.setEmptyMk(true); |
| | | break; |
| | | default: |
| | | News.error("任务入出库类型错误!!![工作号:{}] [入出库类型:{}]", wrkMast.getWrkNo(), wrkMast.getIoType()); |
| | | break; |
| | | } |
| | | ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | ledCommand.setStaNo(wrkMast.getStaNo()); |
| | | ledCommand.setBarcode(wrkMast.getBarcode()); |
| | | if (wrkMast.getIoType() != 110) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); |
| | | |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | Double total = 0.0; |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | LocDetl locDetl = locDetlService.selectOne(wrapper.eq("zpallet", wrkDetl.getZpallet()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (Cools.isEmpty(locDetl)) { |
| | | total = wrkDetl.getAnfme(); |
| | | } else { |
| | | total = locDetl.getAnfme(); |
| | | } |
| | | if (wrkMast.getIoType() == 101) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | } |
| | | if (wrkMast.getIoType() == 103 && (null == wrkDetl.getInspect() || 0 == wrkDetl.getInspect())) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | } |
| | | if (wrkMast.getIoType() == 107) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | } |
| | | }); |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | Double total = 0.0; |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | LocDetl locDetl = locDetlService.selectOne(wrapper.eq("zpallet", wrkDetl.getZpallet()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (Cools.isEmpty(locDetl)) { |
| | | total = wrkDetl.getAnfme(); |
| | | } else { |
| | | total = locDetl.getAnfme(); |
| | | } |
| | | if (wrkMast.getIoType() == 101) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | } |
| | | if (wrkMast.getIoType() == 103 && (null == wrkDetl.getInspect() || 0 == wrkDetl.getInspect())) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | } |
| | | if (wrkMast.getIoType() == 107) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | } |
| | | }); |
| | | } |
| | | commands.add(ledCommand); |
| | | } |
| | | commands.add(ledCommand); |
| | | } |
| | | Set<Integer> workNos = wrkMasts.stream().map(WrkMast::getWrkNo).collect(Collectors.toSet()); |
| | | // 获取LED线程 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId()); |
| | | // 相同工作号集合则过滤 |
| | | if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) { |
| | | continue; |
| | | } |
| | | // 命令下发 ------------------------------------------------------------------------------- |
| | | if (!commands.isEmpty()) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | News.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | Set<Integer> workNos = wrkMasts.stream().map(WrkMast::getWrkNo).collect(Collectors.toSet()); |
| | | // 获取LED线程 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId()); |
| | | // 相同工作号集合则过滤 |
| | | if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | try { |
| | | // 修改主档led标记 |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | wrkMast.setOveMk("Y"); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | throw new CoolException("更新工作档失败"); |
| | | // 命令下发 ------------------------------------------------------------------------------- |
| | | if (!commands.isEmpty()) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | News.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |
| | | } else { |
| | | News.info("{}号LED命令下发成功!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | News.info("{}号LED命令下发成功!!![commands:{}]", led.getId(), commands); |
| | | } |
| | | } |
| | | |
| | | // 更新线程当前工作号集合 |
| | | ledThread.setWorkNos(workNos); |
| | | try { |
| | | // 修改主档led标记 |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | wrkMast.setOveMk("Y"); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | throw new CoolException("更新工作档失败"); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | // 更新线程当前工作号集合 |
| | | ledThread.setWorkNos(workNos); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } catch (Exception e){ |
| | | News.error(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public synchronized void ledReset() { |
| | | for (LedSlave led : slaveProperties.getLed()) { |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | | boolean reset = true; |
| | | for (Integer staNo : led.getStaArr()) { |
| | | // 获取叉车站点 |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { continue; } |
| | | if (staProtocol.getWorkNo() != 0) { |
| | | reset = false; |
| | | break; |
| | | try{ |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | | boolean reset = true; |
| | | for (Integer staNo : led.getStaArr()) { |
| | | // 获取叉车站点 |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { continue; } |
| | | if (staProtocol.getWorkNo() != 0) { |
| | | reset = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | // 获取led线程 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getDevpPlcId()); |
| | | // led显示默认内容 |
| | | if (reset) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) { |
| | | News.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | // 获取led线程 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getDevpPlcId()); |
| | | // led显示默认内容 |
| | | if (reset) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) { |
| | | News.error("{}号LED复位命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | } else { |
| | | // News.info("{}号LED复位命令下发成功!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | News.error("LED异常"+led.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (!MessageQueue.offer(SlaveType.Ste, ste.getId(), new Task(2, steCommand))) { |
| | | News.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", ste.getId(), JSON.toJSON(steCommand)); |
| | | } |
| | | try{ |
| | | Thread.sleep(500); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |