|  |  | 
 |  |  |                         Integer code = jsonObject.getInteger("code"); | 
 |  |  |                         if (code.equals(200)) { | 
 |  |  |                             StartupDto dto = jsonObject.getObject("data", StartupDto.class); | 
 |  |  |  | 
 |  |  |                             News.info("再入库获取新库位成功,返回数据===>>", JSON.toJSON(dto)); | 
 |  |  | //                            // 获取目标站 | 
 |  |  | //                            Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() | 
 |  |  | //                                    .eq("type_no", wrkMast.getIoType() - 50) | 
 |  |  | 
 |  |  |                             // 更新工作档数据状态 | 
 |  |  |                             wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57 | 
 |  |  |                             wrkMast.setWrkSts(2L); // 工作状态: 2.设备上走 | 
 |  |  |                             wrkMast.setIoPri(13D); | 
 |  |  |                             wrkMast.setSourceStaNo(pickSta.getStaNo()); // 源站 | 
 |  |  |                             wrkMast.setStaNo(dto.getStaNo()); // 目标站 | 
 |  |  |                             wrkMast.setCrnNo(dto.getCrnNo()); | 
 |  |  | 
 |  |  |  | 
 |  |  |                             ledThread.errorReset(); | 
 |  |  |  | 
 |  |  |                             if(wrkMast.getIoType()>100){ | 
 |  |  |                                 throw new CoolException("再入库更新工作档失败,不能给PLC下发任务===>>" + wrkMast.getWrkNo()); | 
 |  |  |                             } | 
 |  |  |                             // 更新站点信息 且 下发plc命令 | 
 |  |  |                             staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue()); | 
 |  |  |                             staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); | 
 |  |  | 
 |  |  |                         // 更新工作档状态为 17.出库完成 | 
 |  |  |                         wrkMast.setWrkSts(17L); | 
 |  |  |                         wrkMast.setSteNo(0); | 
 |  |  |                         wrkMast.setIoPri(15D); | 
 |  |  |                         wrkMast.setCrnEndTime(new Date()); | 
 |  |  |                         if (wrkMastMapper.updateById(wrkMast) != 0) { | 
 |  |  |                             // 复位堆垛机 | 
 |  |  | 
 |  |  |                                         .last(" and wrk_sts in (12,13,14,15,16)")); | 
 |  |  |                                 if(one2==null) { | 
 |  |  |                                     moveLocForDeepLoc(slave, shallowLoc); | 
 |  |  |                                 } else { | 
 |  |  |                                     News.error("浅库位阻塞时,且浅库位存在作业中出库任务!工作号={}", one2.getWrkNo()); | 
 |  |  |                                 } | 
 |  |  |                                 flag = true; | 
 |  |  |                                 break; | 
 |  |  | 
 |  |  |                             break; | 
 |  |  |                         } | 
 |  |  |  | 
 |  |  |                         //20230307 ADD,再加一次判断,当浅库位状态不为O时,不执行当前出库任务 | 
 |  |  |                         if(shallowLoc!=null && !shallowLoc.getLocSts().equals("O")){ | 
 |  |  |                             News.error("做了浅库位阻塞处理后反复判断,浅库位状态不为O ===>> 浅库位库位状态为入库预约!出库库位={},浅库位号={}", wrkMast.getSourceLocNo(), shallowLoc.getLocNo()); | 
 |  |  |                             flag = true; | 
 |  |  |                             break; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |                             && !deepLoc.getLocSts().equals("O") | 
 |  |  |                             && (waitWrkMast!=null && waitWrkMast.getWrkSts()<18)){ | 
 |  |  |                         News.error("移库再回库时,深库位组深库位状态为作业中 ===>> deepLoc={},loc_sts={}", deepLoc.getLocNo(), deepLoc.getLocSts()); | 
 |  |  |                         if(waitWrkMast.getIoPri()<9999) {//调高优先级 | 
 |  |  |                             waitWrkMast.setIoPri(waitWrkMast.getIoPri() + 1); | 
 |  |  |                             wrkMastService.updateById(waitWrkMast); | 
 |  |  |                         } | 
 |  |  |                         flag = true; | 
 |  |  |                         break; | 
 |  |  |                     } | 
 |  |  | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                         LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); | 
 |  |  |                         if(sourceLoc.getLocSts().equals("F") || sourceLoc.getLocSts().equals("D")){ | 
 |  |  |                         if(sourceLoc.getLocSts().equals("R") || sourceLoc.getLocSts().equals("D")){ | 
 |  |  |                             sourceLoc.setLocSts("R"); // R.出库预约 | 
 |  |  |                             sourceLoc.setModiTime(new Date()); | 
 |  |  |                             if (!locMastService.updateById(sourceLoc)) { | 
 |  |  | 
 |  |  |         SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); | 
 |  |  |         SteProtocol steProtocol = steThread.getSteProtocol(); | 
 |  |  |         if (steProtocol == null) { return; } | 
 |  |  |         if(steProtocol.getLoad() == 1){ | 
 |  |  |             News.error("小车上方有货,无法下发任务===>>{}", steNo); | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         if (steProtocol.isIdle() && steProtocol.getLoad() == 0) { | 
 |  |  |             // 堆垛机空闲 | 
 |  |  |             if (crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() == 0) { | 
 |  |  | 
 |  |  |                             SteCommand steCommand = new SteCommand(); | 
 |  |  |                             steCommand.setSteNo(wrkMast.getSteNo()); // 穿梭车编号 | 
 |  |  |                             steCommand.setTaskNo(9999); // 工作号 | 
 |  |  |                             steCommand.setTaskMode(SteTaskModeType.findWaiting(basSte.getRow())); // 任务模式:  去近点 等待堆垛机叉取 | 
 |  |  |                             steCommand.setTaskMode(SteTaskModeType.findWaiting(basSte.getRow())); // 任务模式:  去待机位避让 | 
 |  |  | //                        steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue()); | 
 |  |  | //                        steCommand.setBay(steProtocol.getBay()); | 
 |  |  | //                        steCommand.setLev(steProtocol.getLev()); | 
 |  |  | 
 |  |  |                             String locSts = ""; | 
 |  |  |                             // 库位移转判断是否为空板移转 | 
 |  |  |                             if (wrkMast.getEmptyMk().equals("N")) { | 
 |  |  |                                 locSts = "F"; | 
 |  |  |                                 locSts = "R"; | 
 |  |  |                                 // 转移库存明细数据: 库存号 由工作档源库位变为目标库位 | 
 |  |  |                                 if (!locDetlService.updateLocNo(wrkMast.getLocNo(), wrkMast.getSourceLocNo())) { | 
 |  |  |                                     News.error("库位移转 ===>> 转移库存明细数据失败;[源库位={}],[目标库位={}]", wrkMast.getSourceLocNo(), wrkMast.getLocNo()); | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); | 
 |  |  |                 ledCommand.setStaNo(wrkMast.getStaNo()); | 
 |  |  |                 ledCommand.setBarcode(wrkMast.getBarcode()); | 
 |  |  |                 if (wrkMast.getIoType() != 110) { | 
 |  |  |                     List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); | 
 |  |  |                     wrkDetls.forEach(wrkDetl -> { | 
 |  |  | 
 |  |  |                     boolean success = true; | 
 |  |  |                     List<String> insideLoc = Utils.getGroupInsideLoc(one.getLocNo()); | 
 |  |  |                     for (String inside : insideLoc) { | 
 |  |  |                         if (locMastService.selectById(inside).getLocSts().equals("P") | 
 |  |  |                         LocMast locMast = locMastService.selectById(inside); | 
 |  |  |                         if(Cools.isEmpty(locMast)){ | 
 |  |  |                             continue; | 
 |  |  |                         } | 
 |  |  |                         if (locMast.getLocSts().equals("P") | 
 |  |  |                                 || locMastService.selectById(inside).getLocSts().equals("R") | 
 |  |  |                                 || locMastService.selectById(inside).getLocSts().equals("S") | 
 |  |  |                                 || locMastService.selectById(inside).getLocSts().equals("Q")) { |