zhoushihao
15 小时以前 97789ba474555471e0347928e148f5971ad4285a
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -262,23 +262,6 @@
            }
        }
//        }
        //超大尺寸
//        Integer slotMaxHeight = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_MAX_HEIGHT);
//        Integer slotMaxthickness = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_MAX_THICKNESS);
//        if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() >= slotMaxthickness) {
//            int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
//                    .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT)
//                    .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
//            if (count > 0) {
//                log.info("直通片台存在玻璃,结束本次进片");
//                //向plc发送报警:直通片台存在玻璃,无法继续直通
//                s7DataZKDLPOne = new S7DataZKDLPOne();
//                s7DataZKDLPOne.setAlramSignal(64);
//                s7SerializerZKDLPOne.write(s7DataZKDLPOne);
//                return;
//            }
//        }
        log.info("将钢化小片表内的状态改为钢化结束,玻璃id有:{}", glassIdList);
        //修改钢化任务表中的状态
        temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>()
@@ -509,20 +492,20 @@
                break;
            }
        }
        for (Integer i : resultList) {
            if (null == hollowGlassOutRelationInfo) {
                cell = i;
                hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
                        .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                                .eq(HollowGlassOutRelationInfo::getCell, cell)
                                .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                                .orderByAsc(HollowGlassOutRelationInfo::getId)
                                .last("limit 1")
                        );
            } else {
                break;
            }
        }
//        for (Integer i : resultList) {
//            if (null == hollowGlassOutRelationInfo) {
//                cell = i;
//                hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
//                        .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
//                                .eq(HollowGlassOutRelationInfo::getCell, cell)
//                                .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
//                                .orderByAsc(HollowGlassOutRelationInfo::getId)
//                                .last("limit 1")
//                        );
//            } else {
//                break;
//            }
//        }
        if (null != hollowGlassOutRelationInfo) {
            //是否允许中空
@@ -993,7 +976,7 @@
            damage.setWorkingProcedure("磨边");
            damage.setRemark("进笼前卧转立");
            damage.setStatus(1);
            damage.setType(item.getTaskState());
            damage.setType(Const.GLASS_STATE_DAMAGE);
            damageService.insertDamage(damage);
            slotList.add(item.getTargetSlot());
        }
@@ -1018,7 +1001,7 @@
            damage.setWorkingProcedure("中空前");
            damage.setRemark("进笼后卧转立");
            damage.setStatus(1);
            damage.setType(item.getTaskState());
            damage.setType(Const.GLASS_STATE_DAMAGE);
            damageService.insertDamage(damage);
            slotList.add(item.getTargetSlot());
            slotList.add(item.getStartSlot());
@@ -1079,7 +1062,7 @@
    }
    private List<HollowGlassQueueInfo> computeOutHollowQueue(List<HollowGlassQueueInfo> queueInfoList, HollowGlassOutRelationInfo hollowGlassOutRelationInfo) {
        if (CollectionUtil.isNotEmpty(queueInfoList)) {
        if (CollectionUtil.isEmpty(queueInfoList)) {
            return new ArrayList<>();
        }
        //任务为强制,只直接返回原有的队列
@@ -1093,11 +1076,6 @@
        List<HollowGlassQueueInfo> resultQueue = new ArrayList<>();
        for (List<HollowGlassQueueInfo> items : gridGroups.values()) {
            // 情况1:格子内只有一个数据且未配对 - 过滤掉
            if (items.size() == 1 && 0 == items.get(0).getSlot()) {
                continue;
            }
            // 情况2:格子内全部为未配对的数据 - 过滤掉
            boolean allUnpaired = items.stream().noneMatch(e -> e.getIsPair() == 1);
            if (allUnpaired) {
@@ -1106,6 +1084,7 @@
            // 否则保留这个格子内的所有数据
            resultQueue.addAll(items);
        }
        Collections.sort(resultQueue, Comparator.comparing(HollowGlassQueueInfo::getId));
        return resultQueue;
    }