| | |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address); |
| | | } |
| | | log.info("结束扫码任务"); |
| | | // if (flag01 && flag04) { |
| | | // //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | // Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else if (flag01 || flag04) { |
| | | // Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else { |
| | | // log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | // } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesToPLCAddress = plcMesObject.getPlcParameter("MESToPLC").getAddress(); |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | | Assert.isTrue(CollectionUtils.isEmpty(outingList), "有正在执行出片的任务,结束当前出片线程"); |
| | | |
| | |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE, mesToPLCAddress); |
| | | return; |
| | | } |
| | | //是否有人工下片任务 有直接出 |
| | | List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL).orderByDesc(BigStorageCageDetails::getWidth)); |
| | | if (CollectionUtils.isNotEmpty(artificialList)) { |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.FALSE); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.FALSE, mesToPLCAddress); |
| | | return; |
| | | } |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutDTO.getTemperingLayoutId()) |
| | | .eq(GlassInfo::getEngineerId, temperingLayoutDTO.getEngineerId())); |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE, mesToPLCAddress); |
| | | return; |
| | | } |
| | | //未到齐 执行内部调度任务 |
| | |
| | | List<BigStorageCageOutTask> outTasks = list.stream().map(e -> new BigStorageCageOutTask(e.getGlassId(), first.getSlot(), second.getSlot(), |
| | | slotWidth, 0, 0, 1)).collect(Collectors.toList()); |
| | | bigStorageCageOutTaskService.saveBatch(outTasks); |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | return; |
| | | } |
| | | } |
| | |
| | | log.info("送片任务已发送完成,任务线路为:{},启动地址为{}", line, outLine); |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering) { |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | //更新笼子内格子的剩余尺寸 |
| | | updateSlotRemain(list, glassIds); |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | return Boolean.TRUE; |
| | | } |
| | | |