hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -3,7 +3,6 @@
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
@@ -257,13 +256,13 @@
                    .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
            if (count > 0) {
                log.info("直通片台存在玻璃,结束本次进片");
                ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
                alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
                alarmInfo.setAlarmModule(ALARM_MODULE);
                alarmInfo.setAlarmType(ALARM_TYPE);
                alarmInfo.setAlarmCode(ALARM_CODE_OVER);
                alarmInfo.setAlarmMessage("");
                productAlarmInfoService.save(alarmInfo);
//                ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
//                alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
//                alarmInfo.setAlarmModule(ALARM_MODULE);
//                alarmInfo.setAlarmType(ALARM_TYPE);
//                alarmInfo.setAlarmCode(ALARM_CODE_OVER);
//                alarmInfo.setAlarmMessage("");
//                productAlarmInfoService.save(alarmInfo);
                //向plc发送报警:直通片台存在玻璃,无法继续直通
//                miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 64));
                s7DataDLPOne = new S7DataDLPOne();
@@ -415,6 +414,8 @@
                LambdaQueryWrapper<BigStorageCage> queryWrapper = new LambdaQueryWrapper<BigStorageCage>()
                        .eq(BigStorageCage::getRemainWidth, slotWidth)
                        .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                        .le(BigStorageCage::getMinThickness, info.getThickness())
                        .ge(BigStorageCage::getMaxThickness, info.getThickness())
                        .orderByAsc(BigStorageCage::getDeviceId).orderByAsc(BigStorageCage::getSlot)
                        .last("limit 1");
@@ -593,6 +594,7 @@
                    .eq(BigStorageCage::getEnableState, Const.SLOT_ON));
            //定义10个格子为阈值
            if (count <= 10) {
                log.info("笼子超过阈值,执行4号笼子调度逻辑");
                //获取序号为1的格子 将格子内的所有玻璃送到对应的笼子
                BigStorageCage bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
                        .eq(BigStorageCage::getRemainWidth, slotWidth)
@@ -600,15 +602,18 @@
                        .in(BigStorageCage::getDeviceId, Arrays.asList(5, 6))
                        .orderByAsc(BigStorageCage::getDeviceId).orderByAsc(BigStorageCage::getSlot)
                        .last("limit 1"));
                list = bigStorageCageDetailsService.queryNeedDispatch();
                computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task",
                        bigStorageCage.getSlot(), Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
                List<Integer> slotList = new ArrayList<>();
                slotList.add(bigStorageCage.getSlot());
                slotList.add(list.get(0).getSlot());
                updateSlotRemainBySlots(slotList);
                return;
                if (null != bigStorageCage) {
                    list = bigStorageCageDetailsService.queryNeedDispatch();
                    if (CollectionUtil.isNotEmpty(list)) {
                        computeOutGlassInfoByVirtualSlot(list, "big_storage_cage_out_one_task",
                                bigStorageCage.getSlot(), Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH);
                        List<Integer> slotList = new ArrayList<>();
                        slotList.add(bigStorageCage.getSlot());
                        slotList.add(list.get(0).getSlot());
                        updateSlotRemainBySlots(slotList);
                        return;
                    }
                }
            }
            //生成调度任务按照组号组序由1开始依次往5号笼子送小片
            BigStorageSlotDTO slotDTO = bigStorageCageDetailsService.queryNeedDispatchSlotBySequence();
@@ -1006,7 +1011,7 @@
//        if (!THROUGH_SLOT.equals(list.get(0).getSlot())) {
//            临时解决方案:出片时考虑玻璃碰撞,改为一片一出
        // 界面关闭调度开关 !Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType)
        if (list.get(0).getSlot() >= 500 && list.get(0).getThickness() > 8) {
        if (list.get(0).getSlot() >= 500 && list.get(0).getThickness() > 7) {
            outGlassList = list.subList(0, 1);
        } else {
            List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId(