| | |
| | | } |
| | | |
| | | } |
| | | |
| | | this.locToLoc(crnSlave, crnProtocol); |
| | | } |
| | | } |
| | | public void Crn5InTaskSta(CrnSlave slave, CrnProtocol crnProtocol){ |
| | |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(crnStn.getBay().shortValue()); // 源库位列 |
| | | crnCommand.setSourcePosZ(crnStn.getLev().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(locMast.getRow1().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(locMast.getBay1().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(locMast.getLev1().shortValue()); // 目标库位层 |
| | | crnCommand.setLocType1(locMast.getLocType1().shortValue()); // 货物类型 |
| | | crnCommand.setDestinationPosX((short) (locMast.getRow1()+slave.getOffset())); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) (locMast.getBay1()+slave.getOffset())); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short) (locMast.getLev1()+slave.getOffset())); // 目标库位层 |
| | | crnCommand.setLocType1(locMast.getLocType1()); // 货物类型 |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | |
| | | break; |
| | | } |
| | | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { |
| | | log.warn(" - 2"+" - 6"+" - 双深库位且浅库位有货,则需先对浅库位进行库位移转 : 开始执行 任务号={}",wrkMast.getWrkNo()); |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); |
| | | LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬! |
| | | if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { |
| | | log.warn(" - 2"+" - 7"+" - // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!库位状态={}",shallowLoc.getLocSts()); |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | if (null == waitWrkMast) { |
| | | News.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | } else { |
| | | if (waitWrkMast.getWrkSts() == 11) { |
| | | waitWrkMast.setIoPri(15D); |
| | | waitWrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | News.error(" - 2"+" - 8"+" - 调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | } |
| | | continue; |
| | | } else { |
| | | |
| | | } |
| | | } |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | log.warn(" - 2"+" - 9"+" - // F、D 库位状态={}",shallowLoc.getLocSts()); |
| | | // WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | //2022-08-16 modify,不根据updmk标记移库任务(容易被取消导致堵塞),查询工作档是否存在任务 |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); |
| | | // 此标记避免多次执行移库任务 |
| | | // if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk()) |
| | | // || Cools.isEmpty(waitWrkMast)) { |
| | | if (Cools.isEmpty(waitWrkMast)) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | } |
| | | News.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | | } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")) { |
| | | log.warn(" - 2"+" - 10"+" - // Q、S 库位状态={}",shallowLoc.getLocSts()); |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); |
| | | if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) { |
| | | log.warn(" - 2"+" - 11"+" - // F、D 工作状态(判断条件为==4)={}",waitWrkMast.getWrkSts()); |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | |
| | | crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式: 库位移转 |
| | | crnCommand.setSourcePosX(locMast.getRow1().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(locMast.getBay1().shortValue()); // 源库位列 |
| | | crnCommand.setSourcePosZ(locMast.getLev1().shortValue()); // 源库位层 |
| | | crnCommand.setSourcePosX((short) (locMast.getRow1()+slave.getOffset())); // 源库位排 |
| | | crnCommand.setSourcePosY((short) (locMast.getBay1()+slave.getOffset())); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) (locMast.getLev1()+slave.getOffset())); // 源库位层 |
| | | crnCommand.setDestinationPosX(crnStn.getRow().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(crnStn.getBay().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 目标库位层 |
| | | crnCommand.setLocType1(locMast.getLocType1().shortValue()); // 货物类型 |
| | | crnCommand.setLocType1(locMast.getLocType1()); // 货物类型 |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |