| | |
| | | wrkMastMapper.updateById(wrkMast); |
| | | |
| | | // 判断是否为穿梭库 |
| | | if (!locMastService.isShuttle(wrkMast.getLocNo())) { |
| | | if (!locMastService.isShuttle(wrkMast.getSourceLocNo())) { |
| | | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { |
| | |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (!steProtocol.isIdle()) { continue; } |
| | | if (steProtocol.getRow() == 1) { continue; } |
| | | String locNo = wrkMast.getWrkSts() < 10 ? wrkMast.getLocNo() : wrkMast.getSourceLocNo(); |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | int lev = locMast.getLev1(); |
| | |
| | | Date now = new Date(); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | Integer outCrnNo = locMastService.getOutCrnNo(locMast); |
| | | wrkMast.setCrnNo(outCrnNo); |
| | | // 修改成功后复位堆垛机 |
| | | if (wrkMastMapper.updateById(wrkMast) > 0) { |
| | | // 堆垛机复位 |
| | |
| | | SteChargeType first = SteChargeType.FIRST; |
| | | locNo = first.locNo; |
| | | if (basSteService.hasCarOfLocNo(locNo) == null |
| | | && wrkChargeService.selectWorkingOfCharge(first.ssbm) != null) { |
| | | && wrkChargeService.selectWorkingOfCharge(first.ssbm) == null) { |
| | | steCharge = first; |
| | | break; |
| | | } |
| | |
| | | SteChargeType second = SteChargeType.SECOND; |
| | | locNo = second.locNo; |
| | | if (basSteService.hasCarOfLocNo(locNo) == null |
| | | && wrkChargeService.selectWorkingOfCharge(second.ssbm) != null) { |
| | | && wrkChargeService.selectWorkingOfCharge(second.ssbm) == null) { |
| | | steCharge = second; |
| | | break; |
| | | } |
| | |
| | | SteChargeType third = SteChargeType.THIRD; |
| | | locNo = third.locNo; |
| | | if (basSteService.hasCarOfLocNo(locNo) == null |
| | | && wrkChargeService.selectWorkingOfCharge(third.ssbm) != null) { |
| | | && wrkChargeService.selectWorkingOfCharge(third.ssbm) == null) { |
| | | steCharge = third; |
| | | break; |
| | | } |
| | |
| | | if (Cools.isEmpty(steProtocol, basSte)) { |
| | | continue; |
| | | } |
| | | // 1号充电桩 |
| | | if (value.equals(SteChargeType.FIRST) && devpThread.charge0) { |
| | | if (steProtocol.getCharge() < 99) { |
| | | continue; |
| | | } |
| | | // 2号充电桩 |
| | | if (value.equals(SteChargeType.SECOND) && devpThread.charge1) { |
| | | if (steProtocol.getMode() == 0) { |
| | | continue; |
| | | } |
| | | // 3号充电桩 |
| | | if (value.equals(SteChargeType.THIRD) && devpThread.charge2) { |
| | | if (!steProtocol.getStatusType().equals(SteStatusType.IDLE)) { |
| | | continue; |
| | | } |
| | | // 小车是否处于充电状态 |
| | | if (steProtocol.getChargeStatus() == 1) { |
| | | continue; |
| | | } |
| | | // // 1号充电桩 |
| | | // if (value.equals(SteChargeType.FIRST) && devpThread.charge0) { |
| | | // continue; |
| | | // } |
| | | // // 2号充电桩 |
| | | // if (value.equals(SteChargeType.SECOND) && devpThread.charge1) { |
| | | // continue; |
| | | // } |
| | | // // 3号充电桩 |
| | | // if (value.equals(SteChargeType.THIRD) && devpThread.charge2) { |
| | | // continue; |
| | | // } |
| | | // // 小车是否处于充电状态 |
| | | // if (steProtocol.getChargeStatus() == 1) { |
| | | // continue; |
| | | // } |
| | | // case 1 : 自动充电开 馈电 × |
| | | // case 2 : 自动充电开 满电 ✔ |
| | | // case 3 : 自动充电关 馈电 ✔ |
| | |
| | | crnCommand.setTaskNo(wrkCharge.getWrkNo().shortValue()); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.STE_MOVE); // 任务模式: 库位移转 |
| | | crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue(), true).shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosX(steProtocol.getRow()); // 源库位排 |
| | | crnCommand.setSourcePosY(steProtocol.getBay()); // 源库位列 |
| | | crnCommand.setSourcePosZ(steProtocol.getLev()); // 源库位层 |
| | | crnCommand.setDestinationPosX(Utils.getGroupRow(channelLoc.getLocNo(), false).shortValue()); // 目标库位排 |