wangfei
2025-10-30 cbf12607ca1179d98f76d9b3a475d6224e85d59a
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -515,13 +515,20 @@
                        .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT)
                        .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).last("limit 1"));
                log.info("中空大理片直通台玻璃信息{}", details);
                if (details != null && details.getGlassId().equals(unFinishHollowQueueList.get(0).getGlassId())) {
                    unFinishHollowQueueList.get(0).setSlot(THROUGH_SLOT);
                    log.info("将中空队列中的格子号替换为直通台{}", unFinishHollowQueueList);
                if (details != null) {
                    unFinishHollowQueueList.stream().forEach(e -> {
                        if (e.getGlassId().equals(details.getGlassId())) {
                            e.setSlot(THROUGH_SLOT);
                            e.setDeviceId(0);
                            log.info("将中空队列中的格子号替换为直通台{}", e);
                        }
                    });
                }
                List<HollowGlassQueueInfo> infoList = unFinishHollowQueueList.stream().filter(e -> !(e.getSlot() > 500 && e.getSlot() < 900 && e.getIsPair() != 1)).collect(Collectors.toList());
                log.info("有正在出片的中空任务");
                Integer isPair = unFinishHollowQueueList.get(0).getIsPair();
                hollowOutGlassByIsPair(unFinishHollowQueueList, hollowGlassOutRelationInfo.getCell(), isPair, hollowGlassOutRelationInfo.getTotalLayer(), hollowGlassOutRelationInfo.getIsForce());
                Integer isPair = infoList.get(0).getIsPair();
                hollowOutGlassByIsPair(infoList, hollowGlassOutRelationInfo.getCell(), isPair, hollowGlassOutRelationInfo.getTotalLayer(), hollowGlassOutRelationInfo.getIsForce());
                Date endDate = new Date();
                log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime());
                return;
@@ -909,18 +916,21 @@
        int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT));
        log.info("直通片台的任务数量为:{}", count);
        if (count > 0) {
            return;
        }
        List<HollowBigStorageCageDetails> list = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                .in(HollowBigStorageCageDetails::getDeviceId, 6)
//                .in(HollowBigStorageCageDetails::getDeviceId, 6)
                .in(HollowBigStorageCageDetails::getGlassId, glassIdList));
        log.info("获取调度任务列表:{}", list);
        if (CollectionUtil.isEmpty(list)) {
            return;
        }
        HollowBigStorageCageDetails details = list.get(0);
        //todo:生成进进片大车任务
        log.info("获取需要调度的单条任务:{}", details);
        //生成进进片大车任务
        hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
                .set(HollowBigStorageCageDetails::getState, Const.RAW_GLASS_STATE_OUT)
                .eq(HollowBigStorageCageDetails::getGlassId, details.getGlassId()));
@@ -1105,15 +1115,6 @@
        Integer glassGap = hollowGlassRelationInfoService.getGlassGapByThickness(list.get(0).getThickness());
        log.info("中空生成一车任务:{}", list);
        for (T e : list) {
            //格子为第五个笼子时不添加出片任务
            HollowBigStorageCage hollowBigStorageCage = hollowBigStorageCageService.getOne(
                    new LambdaQueryWrapper<HollowBigStorageCage>()
                            .eq(HollowBigStorageCage::getSlot, e.getSlot())
            );
            if (hollowBigStorageCage != null && hollowBigStorageCage.getDeviceId() == 6) {
                break;
            }
            if (templist.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) {
                break;
            }
@@ -1165,6 +1166,12 @@
        for (T t : baseInfoList) {
            bigStorageCageTaskList.add(new BigStorageCageTask(t.getGlassId(), t.getSlot(), targetSlot, 0));
        }
        List<BigStorageCageTask> tasks = bigStorageCageTaskList.stream().filter(e -> e.getStartSlot() >= 500 && e.getStartSlot() < 900).collect(Collectors.toList());
        if (CollectionUtil.isNotEmpty(tasks)) {
            log.info("当前出片队列存在新笼子的玻璃小片,结束本次任务:{}", tasks);
            return false;
        }
        //清空任务表数据
        resetOutTask();
        log.info("生成出片任务数据{}", bigStorageCageTaskList);