| | |
| | | @Autowired |
| | | private LiftAction liftAction; |
| | | |
| | | //入库站点 |
| | | public static final ArrayList<Integer> inSta = new ArrayList<Integer>() {{ |
| | | add(1012); |
| | | add(1014); |
| | | add(1022); |
| | | add(1025); |
| | | add(1032); |
| | | }}; |
| | | |
| | | //出库站点 |
| | | public static final ArrayList<Integer> outSta = new ArrayList<Integer>() {{ |
| | | add(1012); |
| | | add(1014); |
| | | add(1022); |
| | | add(1025); |
| | | add(1032); |
| | | }}; |
| | | |
| | | |
| | | private boolean isInEnable(DevpThread devpThread, Integer staNo) { |
| | | if (staNo == null) { |
| | |
| | | */ |
| | | public synchronized void generateInboundWrk() { |
| | | try { |
| | | DevpSlave devpSlave = slaveProperties.getDevpSlave().get(0); |
| | | DevpSlave devpSlave = slaveProperties.getDevp().get(0); |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devpSlave.getInSta()) { |
| | | // 获取入库站信息 |
| | |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && isInEnable(devpThread, inSta.getStaNo()) |
| | |
| | | if (!Cools.isEmpty(barcode)) { |
| | | News.info("条码扫描器检测条码信息:{}", barcode); |
| | | } |
| | | |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("source_sta_no", inSta.getStaNo()) |
| | |
| | | |
| | | |
| | | /** |
| | | * 出库到出库口 |
| | | */ |
| | | public synchronized void stnToOutStn() { |
| | | DevpSlave devpSlave = slaveProperties.getDevp().get(0); |
| | | // 遍历堆垛机出库站 |
| | | for (DevpSlave.Sta outSta : devpSlave.getOutSta()) { |
| | | // 获取堆垛机出库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devpSlave.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(outSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) { |
| | | // 查询工作档 |
| | | // WrkMast wrkMast = wrkMastMapper.selectPakOutStep2(staProtocol.getSiteId()); |
| | | // if (wrkMast == null) { |
| | | // continue; |
| | | // } |
| | | // // 判断工作档条件 |
| | | // if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) { |
| | | // |
| | | // } |
| | | |
| | | // 判断输送线和小车状态状态等待确认 |
| | | // if (crnProtocol.modeType == CrnModeType.AUTO && crnProtocol.getTaskNo().equals(wrkMast.getWrkNo().shortValue()) |
| | | // && crnProtocol.statusType == CrnStatusType.WAITING |
| | | // && crnProtocol.forkPosType == CrnForkPosType.HOME) { |
| | | // log.info("堆垛机出库完成 - 开始执行"); |
| | | // |
| | | // // 命令下发区 -------------------------------------------------------------------------- |
| | | // |
| | | // // 下发站点信息 |
| | | // staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | // staProtocol.setStaNo(RouteUtils.CrnStaEnd(wrkMast.getStaNo(), wrkMast.getSourceStaNo())); |
| | | // if (!MessageQueue.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(2, staProtocol))) { |
| | | // log.info(staProtocol.getWorkNo() + "," + staProtocol.getStaNo() + "输送线出库命令下发失败"); |
| | | // continue; |
| | | // } else { |
| | | // log.info(staProtocol.getWorkNo() + "," + staProtocol.getStaNo() + "输送线出库命令下发成功"); |
| | | // } |
| | | // |
| | | // // 更新工作档状态为14失败 |
| | | // wrkMast.setWrkSts(14L); |
| | | // wrkMast.setCrnEndTime(new Date()); |
| | | // if (wrkMastMapper.updateById(wrkMast) != 0) { |
| | | // // 复位堆垛机 |
| | | // log.error("出库任务完成下发堆垛机复位,{}", wrkMast.getWrkNo()); |
| | | // crnThread.setResetFlag(true); |
| | | // } else { |
| | | // News.error("" + mark + " - 1" + " - 更新工作档的工作状态为14失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | // } |
| | | // |
| | | // } else { |
| | | // News.errorNoLog("" + mark + " - 6" + " - 堆垛机信息不符合入库条件!!!" |
| | | // + " 堆垛机状态:" + crnProtocol.modeType + "==自动AUTO:" + CrnModeType.AUTO |
| | | // + "、堆垛机任务号:" + crnProtocol.getTaskNo() + "==工作档任务号:" + wrkMast.getWrkNo().shortValue() |
| | | // + "、状态枚举:" + crnProtocol.statusType + "==WAITING:90 //任务完成等待WCS确认):" + CrnStatusType.WAITING |
| | | // + "、货叉位置:" + crnProtocol.forkPosType + "==HOME:0 // 货叉原位:" + CrnForkPosType.HOME); |
| | | // } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 初始化实时地图 |
| | | */ |
| | | public synchronized void initRealtimeBasMap() { |