| | |
| | | |
| | | // 入出库模式判断 |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( inSta.getStaNo()==402 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (inSta.getStaNo() == 402 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | |
| | | } |
| | | } else { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo((short)(inSta.getStaNo()-1)); |
| | | staProtocol.setStaNo((short) (inSta.getStaNo() + 1)); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | |
| | | } |
| | | |
| | | // // 入出库模式判断 |
| | | if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { |
| | | continue; |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | |
| | | && staProtocol.isPakMk()) { |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep11(inSta.getStaNo()); |
| | | if (wrkMast == null) { continue; } |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { continue; } |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | BasCrnp basCrnp = basCrnpService.selectById(crn.getId()); |
| | | if (basCrnp == null) { |
| | | log.error("{}号堆垛机尚未在数据库进行维护!", crn.getId()); |
| | |
| | | |
| | | // 入出库模式判断 |
| | | //if (devpThread.ioMode != IoModeType.PAKOUT_MODE) { continue; } |
| | | if (wrkMast.getStaNo() == 204 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {continue;} |
| | | if (wrkMast.getStaNo() == 402 && devpThread.ioModeOf4F != IoModeType.PAKOUT_MODE) {continue;} |
| | | if (wrkMast.getStaNo() == 204 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getStaNo() == 402 && devpThread.ioModeOf4F != IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | |
| | | // 查询站点详细信息 |
| | | BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); |
| | |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { continue; } |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | // 状态:等待确认 并且 任务完成位 = 1 |
| | | if (crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.getTaskNo() != 0) { |
| | | if(crnProtocol.getTaskNo()==9999){ |
| | |
| | | |
| | | // // 入出库模式判断 |
| | | // if ( emptyInSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; } |
| | | if ( emptyInSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if ( emptyInSta.getStaNo()==402 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; } |
| | | if (emptyInSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | if (emptyInSta.getStaNo() == 402 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { |
| | | continue; |
| | | } |
| | | |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // // 检索库位 |
| | |
| | | // 获取工作档数据 |
| | | WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo()); |
| | | // if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; } |
| | | if (null == wrkMast) { continue; } |
| | | if (null == wrkMast) { |
| | | continue; |
| | | } |
| | | wrkMasts.add(wrkMast); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | |
| | | if (crnProtocol.getStatusType() != CrnStatusType.IDLE && crnProtocol.getTaskNo() != 0 && crnProtocol.getModeType() == CrnModeType.AUTO) { |
| | | // 获取工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectById(crnProtocol.getTaskNo()); |
| | | if (wrkMast == null) { continue; } |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | // 入库 |
| | | if (wrkMast.getWrkSts() == 1 || wrkMast.getWrkSts() == 2) { |
| | | log.warn("堆垛机非空闲情况下,开始修改工作档状态。[id:{},时间:{}] >>>>> 堆垛机当前状态为:{}。任务号:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); |