| | |
| | | @Value("${loc-move.enable}") |
| | | private boolean enable; |
| | | |
| | | @Value("${config.outloading}") |
| | | private boolean outloading; |
| | | |
| | | |
| | | public synchronized void generateStoreWrkFile() { |
| | | try { |
| | |
| | | } |
| | | storageEscalationParam.setBarcode(BoxNo); |
| | | storageEscalationParam.setMatIdList(staProtocol.getMatIdList()); |
| | | storageEscalationParam.setFullPlt(staProtocol.isFullPlt() ? 1 : 0); |
| | | log.info("组托入库={}", storageEscalationParam); |
| | | TaskWrk taskWrk = toWmsService.getLocNoFromWms(storageEscalationParam); |
| | | if (taskWrk == null) { |
| | | log.error("入库请求wms创建任务工作档为空:{}", storageEscalationParam); |
| | | continue; |
| | | } else { |
| | | if (-1 == taskWrk.getWrkNo()) { |
| | | back = true; |
| | | } |
| | | } |
| | | if (back) { |
| | | staProtocol.setWorkNo((short) 9991); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.info("组托入库托盘退回命令推送输送线队列成功==>{},{}", BoxNo, errMsg); |
| | | log.info("组托入库托盘退回命令推送输送线队列成功==>{},{},{}", BoxNo, errMsg, taskWrk.getWrkNo()); |
| | | } else { |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", taskWrk.getCrnNo()).eq("type_no", 1).eq("stn_no", staProtocol.getSiteId())); |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == 0)) { |
| | | // 查询工作档 |
| | | TaskWrk taskWrk = taskWrkMapper.selectCrnStaWorking(crnSlave.getId(), String.valueOf(crnStn.getStaNo() - 1)); |
| | | if (taskWrk == null) { |
| | | continue; |
| | | } |
| | | log.info("下发输送线任务:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint())); |
| | | if (!Cools.isEmpty(taskWrk.getType())) { |
| | | staProtocol.setHeight(taskWrk.getType()); |
| | | } |
| | | boolean offer = false; |
| | | try { |
| | | offer = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); |
| | | } catch (Exception e) { |
| | | log.error("下发输送线任务失败:异常:" + e); |
| | | log.error("下发输送线任务失败:异常:offer:" + offer); |
| | | } |
| | | if (offer) { |
| | | log.info("下发输送线任务成功:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | taskWrk.setStatus(5); |
| | | taskWrk.setWrkSts(14); |
| | | taskWrk.setCompleteTime(new Date()); |
| | | taskWrkService.updateById(taskWrk); |
| | | if (crnStn.getStaNo() >= 200) { |
| | | // 查询工作档 |
| | | TaskWrk taskWrk = taskWrkMapper.selectCrnStaWorking(crnSlave.getId(), String.valueOf(crnStn.getStaNo() + 2)); |
| | | if (taskWrk == null) { |
| | | continue; |
| | | } |
| | | log.info("下发输送线任务:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint())); |
| | | if (!Cools.isEmpty(taskWrk.getType())) { |
| | | staProtocol.setHeight(taskWrk.getType()); |
| | | } |
| | | boolean offer = false; |
| | | try { |
| | | offer = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); |
| | | } catch (Exception e) { |
| | | log.error("下发输送线任务失败:异常:" + e); |
| | | log.error("下发输送线任务失败:异常:offer:" + offer); |
| | | } |
| | | if (offer) { |
| | | log.info("下发输送线任务成功:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | taskWrk.setStatus(5); |
| | | taskWrk.setWrkSts(14); |
| | | taskWrk.setCompleteTime(new Date()); |
| | | taskWrkService.updateById(taskWrk); |
| | | |
| | | } else { |
| | | log.error("下发输送线任务失败:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | } |
| | | } else { |
| | | log.error("下发输送线任务失败:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | // 查询工作档 |
| | | TaskWrk taskWrk = taskWrkMapper.selectCrnStaWorking(crnSlave.getId(), String.valueOf(crnStn.getStaNo() - 1)); |
| | | if (taskWrk == null) { |
| | | continue; |
| | | } |
| | | log.info("下发输送线任务:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint())); |
| | | if (!Cools.isEmpty(taskWrk.getType())) { |
| | | staProtocol.setHeight(taskWrk.getType()); |
| | | } |
| | | boolean offer = false; |
| | | try { |
| | | offer = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); |
| | | } catch (Exception e) { |
| | | log.error("下发输送线任务失败:异常:" + e); |
| | | log.error("下发输送线任务失败:异常:offer:" + offer); |
| | | } |
| | | if (offer) { |
| | | log.info("下发输送线任务成功:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | taskWrk.setStatus(5); |
| | | taskWrk.setWrkSts(14); |
| | | taskWrk.setCompleteTime(new Date()); |
| | | taskWrkService.updateById(taskWrk); |
| | | |
| | | } else { |
| | | log.error("下发输送线任务失败:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | } |
| | | } |
| | | |
| | | // } |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | |
| | | LocMast locMast = locMastService.selectByLocNo(taskWrk.getTargetPoint()); |
| | | if (!locMast.getLocSts().equals("O") && taskWrk.getWrkSts() == 2) { |
| | | log.error("入库WMS分配库位{}有误,库位状态为{}", locMast.getLocNo(), locMast.getLocSts()); |
| | | taskWrk.setWrkSts(5); |
| | | taskWrk.setMemo("WMS分配库位有误"); |
| | | taskWrkService.updateById(taskWrk); |
| | | if (!locMast.getLocSts().equals("O")) { |
| | | if (taskWrk.getWrkSts() == 2) { |
| | | log.error("入库WMS分配库位{}有误,库位状态为{}", locMast.getLocNo(), locMast.getLocSts()); |
| | | taskWrk.setWrkSts(5); |
| | | taskWrk.setMemo("WMS分配库位有误"); |
| | | taskWrkService.updateById(taskWrk); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 判断堆垛机出库站状态 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | if (staProtocol.isAutoing() && (outloading || !staProtocol.isLoading()) && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |