| | |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | // 此标记避免多次执行移库任务 |
| | | if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | // 生成工作档、改变浅库位的源库/目标库 库位状态、下发堆垛机命令(立马执行) |
| | | // moveLocForDeepLocPakin(slave, shallowLoc, wrkMast); |
| | | } |
| | |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | // 此标记避免多次执行移库任务 |
| | | if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | // 生成工作档、改变浅库位的源库/目标库 库位状态、下发堆垛机命令(立马执行) |
| | | // moveLocForDeepLocPakin(slave, shallowLoc, wrkMast); |
| | | } |
| | |
| | | // 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); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | } |
| | | log.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | |
| | | // if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk()) |
| | | // || Cools.isEmpty(waitWrkMast)) { |
| | | if (Cools.isEmpty(waitWrkMast)) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | try{ |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | } catch (Exception e){ |
| | | log.error("{}任务出库失败,浅库位堵塞!异常", wrkMast.getWrkNo(), e); |
| | | log.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), 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); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | } |
| | | log.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(shallowLoc.getLocNo()); // 源库位 |
| | | wrkMast.setLocNo(loc.getLocNo()); // 目标库位 |
| | | wrkMast.setFullPlt(shallowLoc.getFullPlt()); // 满板 |
| | | wrkMast.setFullPlt(shallowLoc.getLocSts().equals("D") ? "N" : "Y"); // 满板 |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | |
| | | if (!basJarMastList1.isEmpty()){ |
| | | return false; |
| | | } |
| | | BasJar basJarOther11 = basJarMapper.selectById(jarSlave.getJarOtherId()); |
| | | if (!Cools.isEmpty(basJarOther11)){ |
| | | List<BasJarMast> basJarMastList2 = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getJarOtherId(), new ArrayList<Integer>() {{ |
| | | add(8);add(9);add(10);add(11);add(12); |
| | | }}); |
| | | if (!basJarMastList2.isEmpty() && basJarMastList2.size()!=basJarOther11.getJarCount()){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(8); |
| | | }}); |
| | |
| | | } |
| | | break; |
| | | } |
| | | } else if (staProtocol.isAutoing() |
| | | && !staProtocol.isLoading() |
| | | && staProtocol.getWorkNo() == 0 |
| | | && staProtocol.isPakMk()) { |
| | | for (DevpSlave.Jar jar : inSta.getJarList()) { |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, jar.getJarNo()<3? 1:2); |
| | | if (steThread == null) { |
| | | continue; |
| | | } |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (!Cools.isEmpty(steProtocol.getLocaType()) && !steProtocol.getLocaType().equals(SteLocaType.NONE) && steProtocol.getStatusType().equals(SteStatusType.IDLE)) { |
| | | // 判断重复工作档 |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusListB(jar.getBurial(), new ArrayList<Integer>() {{ |
| | | add(9); |
| | | add(11); |
| | | }}); |
| | | if (basJarMastList.isEmpty()){ |
| | | continue; |
| | | } |
| | | BasJarMast jarMastByWrkNo = basJarMastList.get(0); |
| | | WrkMastExecute wrkMastExecute = wrkMastExecuteService.selectOne(new EntityWrapper<WrkMastExecute>().eq("wrk_no", jarMastByWrkNo.getWrkNo())); |
| | | if (Cools.isEmpty(wrkMastExecute)){ |
| | | jarMastByWrkNo.setStatus(jarMastByWrkNo.getStatusComplete(6)); |
| | | if (!basJarMastService.updateById(jarMastByWrkNo)){ |
| | | log.error("硫化区域分段任务完成异常,BasJarMast={},异常信息={}",JSON.toJSONString(jarMastByWrkNo),"更新basJarMast失败"); |
| | | // throw new CoolException("更新basJarMast失败"); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |