| | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | private Short getWorkMode(Integer bay) { |
| | | if (bay == 2 || bay == 7) { |
| | | return (short) 3; |
| | | } else if (bay == 3) { |
| | | return (short) 1; |
| | | } else if (bay == 4) { |
| | | return (short) 2; |
| | | } else if (bay == 5) { |
| | | return (short) 1; |
| | | }else { |
| | | return (short) 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 组托 |
| | | * 入库站,根据条码扫描生成入库工作档,工作状态 2 |
| | |
| | | param.setIoType(1); |
| | | param.setSourceStaNo(inSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | if (inSta.getStaNo() == 102) { |
| | | param.setLocType2((short) 3); |
| | | } else if (inSta.getStaNo() == 211) { |
| | | param.setLocType1((short) 5); |
| | | param.setLocType2((short) 4); |
| | | } else if (inSta.getStaNo() == 201) { |
| | | param.setLocType2((short) 4); |
| | | } |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | |
| | | // if(crnThread.isBackHpFlag()){ |
| | | // continue; |
| | | // } |
| | | |
| | | // 只有当堆垛机空闲 并且 无任务时才继续执行 |
| | | if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO |
| | | && crnProtocol.getLoaded() == 0 && crnProtocol.getForkPos() == 0) { |
| | |
| | | + "能入信号(wms设置).equals(\"Y\")" + staDetl.getCanining()); |
| | | continue; |
| | | } |
| | | System.out.println("wrkMast:" + slave.getId() + "-" + staProtocol.getWorkNo().intValue() + "-" + crnStn.getStaNo()); |
| | | // 获取工作状态为2(设备上走)的入库工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep2(slave.getId(), staProtocol.getWorkNo().intValue(), crnStn.getStaNo()); |
| | | System.out.println("wrkMast:" + wrkMast); |
| | | if (null == wrkMast) { |
| | | News.infoNoLog("" + mark + " - 1" + " - 4" + " - 查询无待入库数据--wrk_sts=2, 工作号={}", staProtocol.getWorkNo()); |
| | | // log.error("查询无待入库数据--wrk_sts=2, 工作号={}", staProtocol.getWorkNo()); |
| | | continue; |
| | | } |
| | | System.out.println("566"); |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.getById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.error("" + mark + " - 1" + " - 5" + " - 查询库存无数据--库位号{}", wrkMast.getLocNo()); |
| | | continue; |
| | | } |
| | | System.out.println("334"); |
| | | if (!locMast.getLocSts().equals("S") && !locMast.getLocSts().equals("Q")) { |
| | | News.error("" + mark + " - 1" + " - 6" + " - 入库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), locMast.getLocSts()); |
| | | continue; |
| | |
| | | // News.infoNoLog(""+mark+" - 1"+" - 7"+" - 堆垛机控制过滤:堆垛机是否空闲={},任务号={}", crnProtocol.getStatusType(),crnProtocol.getTaskNo()); |
| | | continue; |
| | | } |
| | | |
| | | System.out.println("aas"); |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | continue; |
| | |
| | | } |
| | | } |
| | | } |
| | | System.out.println("434323"); |
| | | News.warnNoLog("" + mark + " - 1" + " - 15" + " - 命令下发 : 工作号={},源排={},源列={},源层={},目标排={},目标列={},目标层={}", wrkMast.getWrkNo().shortValue() |
| | | , crnStn.getRow().shortValue(), crnStn.getBay().shortValue(), crnStn.getLev().shortValue() |
| | | , locMast.getRow1().shortValue(), locMast.getBay1().shortValue(), locMast.getLev1().shortValue()); |
| | |
| | | // Thread.sleep(500); |
| | | // }catch(Exception ignore){} |
| | | // } |
| | | |
| | | System.out.println("ererdfd"); |
| | | // 修改工作档状态 2.设备上走 => 3.吊车入库中 |
| | | Date now = new Date(); |
| | | wrkMast.setWrkSts(3L); |
| | |
| | | News.warnNoLog("" + mark + " - 2" + " - 12" + " - 命令下发 : 工作号={},源排={},源列={},源层={},目标排={},目标列={},目标层={}", wrkMast.getWrkNo().shortValue() |
| | | , sourceSta.getRow1().shortValue(), sourceSta.getBay1().shortValue(), sourceSta.getLev1().shortValue() |
| | | , crnStn.getRow().shortValue(), crnStn.getBay().shortValue(), crnStn.getLev().shortValue()); |
| | | |
| | | String locNo = sourceSta.getLocNo(); |
| | | |
| | | // 1.堆垛机开始移动 |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | |
| | | if (!Cools.isEmpty(emptyInSta.getLed())) { |
| | | ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed()); |
| | | } |
| | | |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | |
| | | LocMast loc = null; |
| | | for (Integer row : rows) { |
| | | if (Utils.isDeepLoc(slaveProperties, row)) { |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1()); |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1(), shallowLoc.getLocType2()); |
| | | |
| | | if (loc != null) { |
| | | if (Utils.isDeepLoc(slaveProperties, loc.getLocNo())) { |
| | |
| | | if (null == loc) { |
| | | for (Integer row : rows) { |
| | | if (Utils.isShallowLoc(slaveProperties, row)) { |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1()); |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1(), shallowLoc.getLocType2()); |
| | | |
| | | if (null != loc) {//对应深库位非在库状态,不能移库 |
| | | String deepLoc = Utils.getDeepLoc(slaveProperties, loc.getLocNo()); |