wangfei
2025-10-21 d184c245bfbe1847c56c5b88d67ee7bb51634860
Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
11个文件已修改
1个文件已添加
335 ■■■■ 已修改文件
hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageCageDetailsMapper.xml 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowqueue/mapper/HollowGlassQueueInfoMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java 197 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPOne.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/application-yw.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassQueueInfoMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
@@ -191,8 +191,8 @@
        List<LoadGlassInfo> glassInfos = null;
        glassInfos = glassInfoMapper.selectJoinList(LoadGlassInfo.class, new MPJQueryWrapper<GlassInfo>()
                .select("IFNULL(b.state, 0) AS state,engineer_id,tempering_layout_id,width,height,tempering_feed_sequence,x_coordinate,y_coordinate,angle,t.glass_id,t.flow_card_id")
                .leftJoin("(SELECT glass_id, MAX(type) AS state FROM damage GROUP BY glass_id) b\n" +
                        "ON t.glass_id = b.glass_id")
                .leftJoin("(SELECT glass_id, type as state FROM damage where type in (8, 9) and status = 1) b\n" +
                        "ON t.glass_id = b.glass_id ")
                .eq("engineer_id", glassInfo.getEngineerId())
                .eq("tempering_layout_id", glassInfo.getTemperingLayoutId()));
        return glassInfos;
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageCageDetailsMapper.xml
@@ -69,7 +69,7 @@
        else 0 end as state
        from glass_temp t
        left join edg_storage_cage_details t1 on t.glass_id = t1.glass_id
        left join damage t2 on t.glass_id = t2.glass_id and t2.type in (8,9)
        left join damage t2 on t.glass_id = t2.glass_id and t2.type in (8,9) AND t2.STATUS = 1
        )select * from cut_drawing_temp where 1=1
        <if test="isAll == 1">
            and state = 0
@@ -78,10 +78,10 @@
    </select>
    <select id="querySlotRemainWidth" resultType="com.mes.edgstoragecage.entity.vo.EdgSlotRemainVO">
        select device_id,
               slot,
               if(#{cellLength} - sum(GREATEST(width, height) + #{glassGap}) &lt; 0, 0, #{cellLength} -
                                                                                        sum(GREATEST(width, height) + #{glassGap})) as
                   remain_width
        slot,
        if(#{cellLength} - sum(GREATEST(width, height) + #{glassGap}) &lt; 0, 0, #{cellLength} -
        sum(GREATEST(width, height) + #{glassGap})) as
        remain_width
        from edg_storage_cage_details
        where state = 100
        group by device_id, slot
@@ -115,26 +115,27 @@
        limit 1
    </select>
    <select id="queryPieChart" resultType="com.mes.largenscreen.entity.PieChartVO">
        SELECT round(sum(CASE WHEN e.station_cell = 5 THEN 1 ELSE 0 END), 2)                                                   as oneCompletedQuantity,
               round(sum(CASE WHEN e.station_cell = 5 THEN escd.width * escd.height / 1000000 ELSE 0 END),
                     2)                                                                                                        as oneCompletedArea,
               round(sum(CASE WHEN e.station_cell = 6 THEN 1 ELSE 0 END), 2)                                                   as twoCompletedQuantity,
               round(sum(CASE WHEN e.station_cell = 6 THEN escd.width * escd.height / 1000000 ELSE 0 END),
                     2)                                                                                                        as twoCompletedArea,
               round(sum(CASE WHEN e.station_cell = 5 and escd.device_id is null THEN 1 ELSE 0 END),
                     2)                                                                                                        as oneUncompletedQuantity,
               round(sum(CASE
                             WHEN e.station_cell = 5 and escd.device_id is null THEN gi.width * gi.height / 1000000
                             ELSE 0 END),
                     2)                                                                                                        as oneUncompletedArea,
               round(sum(CASE WHEN e.station_cell = 6 and escd.device_id is null THEN 1 ELSE 0 END),
                     2)                                                                                                        as twoUncompletedQuantity,
            round(sum( CASE WHEN e.station_cell = 6 and escd.device_id is null THEN gi.width*gi.height/1000000 ELSE 0 END ),2) as twoUncompletedArea
        SELECT round(sum(CASE WHEN e.station_cell = 5 THEN 1 ELSE 0 END), 2) as oneCompletedQuantity,
        round(sum(CASE WHEN e.station_cell = 5 THEN escd.width * escd.height / 1000000 ELSE 0 END),
        2) as oneCompletedArea,
        round(sum(CASE WHEN e.station_cell = 6 THEN 1 ELSE 0 END), 2) as twoCompletedQuantity,
        round(sum(CASE WHEN e.station_cell = 6 THEN escd.width * escd.height / 1000000 ELSE 0 END),
        2) as twoCompletedArea,
        round(sum(CASE WHEN e.station_cell = 5 and escd.device_id is null THEN 1 ELSE 0 END),
        2) as oneUncompletedQuantity,
        round(sum(CASE
        WHEN e.station_cell = 5 and escd.device_id is null THEN gi.width * gi.height / 1000000
        ELSE 0 END),
        2) as oneUncompletedArea,
        round(sum(CASE WHEN e.station_cell = 6 and escd.device_id is null THEN 1 ELSE 0 END),
        2) as twoUncompletedQuantity,
        round(sum( CASE WHEN e.station_cell = 6 and escd.device_id is null THEN gi.width*gi.height/1000000 ELSE 0 END
        ),2) as twoUncompletedArea
        FROM
            glass_info gi
                left join edg_storage_cage_details escd ON gi.glass_id = escd.glass_id
                left join engineering e on gi.engineer_id=e.engineer_id
        glass_info gi
        left join edg_storage_cage_details escd ON gi.glass_id = escd.glass_id
        left join engineering e on gi.engineer_id=e.engineer_id
        WHERE
            date(e.create_time) = date(now())
        date(e.create_time) = date(now())
    </select>
</mapper>
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -15,7 +15,9 @@
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.HollowGlassRelationInfo;
import com.mes.hollow.entity.dto.*;
import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
import com.mes.hollow.entity.dto.HollowBigStorageDTO;
import com.mes.hollow.entity.dto.LackDetailsDTO;
import com.mes.hollow.entity.vo.HollowAllFlowCardVO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import com.mes.hollow.mapper.HollowGlassRelationInfoMapper;
@@ -112,11 +114,24 @@
        if (null == relationInfoOne) {
            throw new RuntimeException("相关流程卡未找到对应的组号信息,玻璃流程卡:" + flowCardId + ",序号:" + glassType + ",总层数:" + totalLayer + ",层数:" + layer);
        }
        Integer slotMaxHeight = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_MAX_HEIGHT);
        Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_WIDTH);
        HollowBigStorageCage storageCage = null;
        if (Math.min(width, height) > slotMaxHeight) {
            storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
                    .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
                    .eq(HollowBigStorageCage::getDeviceId, 6)
                    .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1"));
            HollowBigStorageDTO storageDTO = new HollowBigStorageDTO();
            BeanUtils.copyProperties(storageCage, storageDTO);
            BeanUtils.copyProperties(relationInfoOne, storageDTO);
            return storageDTO;
        }
        //详情表内获取本组是否已经有玻璃在笼子内(0表示提前占用)
        int taskCount = hollowGlassOutRelationInfoService.count(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId));
        HollowBigStorageCage storageCage = null;
        //如果不存在则选择笼内未用的新格子
        if (taskCount > 0) {
            storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowqueue/mapper/HollowGlassQueueInfoMapper.java
@@ -3,6 +3,8 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import java.util.List;
/**
 * (HollowGlassQueueInfo)表数据库访问层
 *
@@ -11,5 +13,11 @@
 */
public interface HollowGlassQueueInfoMapper extends BaseMapper<HollowGlassQueueInfo> {
    /**
     * 查询需要仅卧转立的玻璃小片
     *
     * @return
     */
    List<String> queryNeedInCarGlass();
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowqueue/service/HollowGlassQueueInfoService.java
@@ -18,5 +18,7 @@
    List<HollowGlassQueueInfo> queryHollowGlassQueueInfoByLine(int cell);
    void confirmBorder(HollowGlassQueueInfo hollowGlassQueueInfo);
    List<String> queryNeedInCarGlass();
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowqueue/service/impl/HollowGlassQueueInfoServiceImpl.java
@@ -4,10 +4,8 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.common.config.Const;
import com.mes.damage.entity.Damage;
import com.mes.damage.service.DamageService;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.service.HollowGlassOutRelationInfoService;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import com.mes.hollowqueue.mapper.HollowGlassQueueInfoMapper;
@@ -19,7 +17,6 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
/**
 * (HollowGlassQueueInfo)表服务实现类
@@ -63,7 +60,7 @@
                        .eq("cell", cell)
                        .eq("is_pair", 1)
                        .ge("create_time", twoDaysAgo)
                        .select("width","height","flow_card_id","relation_id", "hollow_sequence", "cell", "MAX(state) as state", "MAX(layer) as layer")
                        .select("width", "height", "flow_card_id", "relation_id", "hollow_sequence", "cell", "MAX(state) as state", "MAX(layer) as layer")
                        .groupBy("relation_id", "hollow_sequence")
                        .orderByAsc("relation_id", "hollow_sequence")
        );
@@ -108,5 +105,10 @@
        }
    }
    @Override
    public List<String> queryNeedInCarGlass() {
        return baseMapper.queryNeedInCarGlass();
    }
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -157,14 +157,17 @@
        List<BigStorageCageTask> inTaskList = new ArrayList();
        Integer from = s7DataZKDLPOne.getFrom1();
        List<Integer> states = s7DataZKDLPOne.getStates();
        List<String> glassIdList = new ArrayList<>();
        List<String> requestWords = s7DataZKDLPOne.getIds();
        for (int i = 1; i <= 6; i++) {
            String requestWord = requestWords.get(i - 1);
            Integer state = states.get(i - 1);
            if (null != requestWord && !requestWord.isEmpty()) {
                BigStorageCageTask task = new BigStorageCageTask();
                task.setGlassId(requestWord);
                task.setStartSlot(from);
                task.setTaskState(state);
                inTaskList.add(task);
                glassIdList.add(requestWord);
                continue;
@@ -172,6 +175,12 @@
        }
        if (CollectionUtil.isEmpty(inTaskList)) {
            log.info("当前大车无进片玻璃,结束进片任务");
            return;
        }
        //玻璃状态存在卧转立上结束
        List<BigStorageCageTask> unTaskList = inTaskList.stream().filter(e -> e.getTaskState() < 1).collect(Collectors.toList());
        if (CollectionUtil.isNotEmpty(unTaskList)) {
            log.info("存在未上车的玻璃信息,玻璃:{}", unTaskList);
            return;
        }
        log.info("获取任务的玻璃id:{}", glassIdList);
@@ -228,38 +237,38 @@
        Integer slotMaxThickness = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_MAX_THICKNESS);
        //按照玻璃厚度分组,判断剩余格子是否可以存放
        Map<Double, Long> thickCountMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getThickness, Collectors.counting()));
        if (glassInfoList.get(0).getThickness() < slotMaxThickness) {
            for (Map.Entry<Double, Long> entry : thickCountMap.entrySet()) {
                int count = hollowBigStorageCageService.count(new LambdaQueryWrapper<HollowBigStorageCage>()
                        .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
                        .le(HollowBigStorageCage::getMinThickness, entry.getKey())
                        .ge(HollowBigStorageCage::getMaxThickness, entry.getKey()));
                if (count < entry.getValue()) {
                    log.info("笼内格子剩余数量不足,结束本次进片");
                    //向plc发送报警:笼内格子剩余数量不足
                    s7DataZKDLPOne = new S7DataZKDLPOne();
                    s7DataZKDLPOne.setAlramSignal(16);
                    s7SerializerZKDLPOne.write(s7DataZKDLPOne);
                    return;
                }
            }
        }
        //超大尺寸
        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发送报警:直通片台存在玻璃,无法继续直通
//        if (glassInfoList.get(0).getThickness() < slotMaxThickness) {
        for (Map.Entry<Double, Long> entry : thickCountMap.entrySet()) {
            int count = hollowBigStorageCageService.count(new LambdaQueryWrapper<HollowBigStorageCage>()
                    .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
                    .le(HollowBigStorageCage::getMinThickness, entry.getKey())
                    .ge(HollowBigStorageCage::getMaxThickness, entry.getKey()));
            if (count < entry.getValue()) {
                log.info("笼内格子剩余数量不足,结束本次进片");
                //向plc发送报警:笼内格子剩余数量不足
                s7DataZKDLPOne = new S7DataZKDLPOne();
                s7DataZKDLPOne.setAlramSignal(64);
                s7DataZKDLPOne.setAlramSignal(16);
                s7SerializerZKDLPOne.write(s7DataZKDLPOne);
                return;
            }
        }
//        }
        //超大尺寸
//        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);
        //修改钢化任务表中的状态
@@ -278,8 +287,9 @@
        Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_GLASS_GAP);
        log.info("开始计算目标格子,玻璃id有:{}", inTaskList);
        if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxthickness) {
            for (BigStorageCageTask task : inTaskList) {
//        if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxthickness) {
        for (BigStorageCageTask task : inTaskList) {
            if (from == 910) {
                GlassInfo info = glassListMap.get(task.getGlassId()).get(0);
                HollowBigStorageDTO bigStorageDTO = null;
                try {
@@ -347,29 +357,29 @@
                        .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence())
                        .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence())
                );
            } else {
                task.setTargetSlot(THROUGH_SLOT);
                //存放历史任务
                HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask();
                BeanUtils.copyProperties(task, historyTask);
                historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN);
                historyTask.setGlassCount(glassInfoList.size());
                historyTask.setTaskState(Const.ENGINEERING_NEW);
                historyTasks.add(historyTask);
                GlassInfo info = glassInfoList.get(0);
                HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails();
                BeanUtils.copyProperties(info, cageDetails);
                cageDetails.setSlot(THROUGH_SLOT);
                cageDetails.setState(Const.GLASS_STATE_NEW);
                cageDetails.setDeviceId(0);
                cageDetails.setSequence(0);
                cageDetails.setHollowSequence(0);
                cageDetails.setGap(glassGap);
                cageDetails.setFilmsId(info.getFilmsid());
                cageDetails.setId(null);
                hollowBigStorageCageDetailsService.save(cageDetails);
            }
        } else {
            BigStorageCageTask task = inTaskList.get(0);
            task.setTargetSlot(THROUGH_SLOT);
            //存放历史任务
            HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask();
            BeanUtils.copyProperties(task, historyTask);
            historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN);
            historyTask.setGlassCount(glassInfoList.size());
            historyTask.setTaskState(Const.ENGINEERING_NEW);
            historyTasks.add(historyTask);
            GlassInfo info = glassInfoList.get(0);
            HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails();
            BeanUtils.copyProperties(info, cageDetails);
            cageDetails.setSlot(THROUGH_SLOT);
            cageDetails.setState(Const.GLASS_STATE_NEW);
            cageDetails.setDeviceId(0);
            cageDetails.setSequence(0);
            cageDetails.setHollowSequence(0);
            cageDetails.setGap(glassGap);
            cageDetails.setFilmsId(info.getFilmsid());
            cageDetails.setId(null);
            hollowBigStorageCageDetailsService.save(cageDetails);
        }
        //历史数据入库
@@ -449,6 +459,7 @@
            //nothing
            log.info("二/三线线空闲状态获取异常");
        }
        List<Integer> resultList = new ArrayList<>();
        if (redisUtil.getCacheObject("priorityHollowSwitch")) {
            resultList = TWO_LINE_FIRST;
@@ -495,11 +506,19 @@
            //是否有正在中空的玻璃:中空小片表筛选未出笼的玻璃信息
//            获取当前中空任务未完成出片的玻璃信息
            List<HollowGlassQueueInfo> unFinishHollowQueueList = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>()
                    .eq(HollowGlassQueueInfo::getFlowCardId, hollowGlassOutRelationInfo.getFlowCardId())
                    .eq(HollowGlassQueueInfo::getCell, hollowGlassOutRelationInfo.getCell())
                    .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW)
                    .eq(HollowGlassQueueInfo::getRelationId, hollowGlassOutRelationInfo.getId())
                    .orderByAsc(HollowGlassQueueInfo::getHollowSequence));
            if (CollectionUtil.isNotEmpty(unFinishHollowQueueList)) {
                //直通台有玻璃时将中空出片队列中对应玻璃id的格子号替换未直通台
                HollowBigStorageCageDetails details = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                        .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);
                }
                log.info("有正在出片的中空任务");
                Integer isPair = unFinishHollowQueueList.get(0).getIsPair();
                hollowOutGlassByIsPair(unFinishHollowQueueList, hollowGlassOutRelationInfo.getCell(), isPair, hollowGlassOutRelationInfo.getTotalLayer(), hollowGlassOutRelationInfo.getIsForce());
@@ -852,6 +871,68 @@
    }
    @Scheduled(fixedDelay = 1000)
    public void inCarTask() {
        //读取协议数据
        S7DataZKDLPOne s7DataZKDLPOne = s7SerializerZKDLPOne.read(S7DataZKDLPOne.class);
        log.info("进片任务读取s7DataZKDLPOne:{}", s7DataZKDLPOne);
        Boolean inkageEntity = s7DataZKDLPOne.getMesControl();
        if (!inkageEntity) {
            log.info("当前为非联机状态,结束进片任务");
            return;
        }
        Integer requestEntity = s7DataZKDLPOne.getRequestMes();
        if (StringUtils.isNotBlank(s7DataZKDLPOne.getId7()) && requestEntity == 0) {
            //汇报字为1 启动字为1是  清除所有任务信息
            if (s7DataZKDLPOne.getId7().equals(s7DataZKDLPOne.getId1())) {
                //todo:清空任务
                S7DataZKDLPOne sendTask = new S7DataZKDLPOne();
                sendTask.setFrom7(0);
                sendTask.setId7("");
                s7SerializerZKDLPOne.write(sendTask);
                log.info("清除所有任务信息{}", sendTask);
                s7DataZKDLPOne = s7SerializerZKDLPOne.read(S7DataZKDLPOne.class);
                log.info("清空任务后再读取{}", s7DataZKDLPOne);
            }
            log.info("存在任务,结束");
            return;
        }
        if (1 != requestEntity) {
            log.info("当前未收到进片请求,结束进片任务");
            return;
        }
        //有请求信号
        List<String> glassIdList = hollowGlassQueueInfoService.queryNeedInCarGlass();
        if (CollectionUtil.isEmpty(glassIdList)) {
            return;
        }
        int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT));
        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::getGlassId, glassIdList));
        if (CollectionUtil.isEmpty(list)) {
            return;
        }
        HollowBigStorageCageDetails details = list.get(0);
        //todo:生成进进片大车任务
        hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
                .set(HollowBigStorageCageDetails::getState, Const.RAW_GLASS_STATE_OUT)
                .eq(HollowBigStorageCageDetails::getGlassId, details.getGlassId()));
        S7DataZKDLPOne sendTask = new S7DataZKDLPOne();
        sendTask.setFrom7(details.getSlot());
        sendTask.setId7(details.getGlassId());
        s7SerializerZKDLPOne.write(sendTask);
        log.info("新笼子写入id与from{}", sendTask);
        updateSlotRemainBySlots(Arrays.asList(details.getSlot()));
    }
    private void dealDamageInTask(List<BigStorageCageTask> damageTaskList) {
//        获取进片任务表中状态为破损的数据
        log.info("破损的玻璃信息有:{}", damageTaskList);
@@ -1022,7 +1103,17 @@
        Integer outCarMaxSize = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_OUT_CAR_SIZE);
//        Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_GLASS_GAP);
        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;
            }
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -230,17 +230,17 @@
            Boolean inkageEntity = s7DataZKDLPOne.getMesControl();
            jsonObject.append("inkageEntity", inkageEntity);
            //进片请求
            String requestEntity = s7DataZKDLPOne.getRequestMes().toString();
            Integer requestEntity = s7DataZKDLPOne.getRequestMes();
            jsonObject.append("requestEntity", requestEntity);
            //启动命令
            String mesReplyEntity = s7DataZKDLPOne.getMesReply().toString();
            Integer mesReplyEntity = s7DataZKDLPOne.getMesReply();
            jsonObject.append("mesReplyEntity", mesReplyEntity);
            //出片联机
            String outInkageEntity = s7DataZKDLPTwo.getMesControl().toString();
            Boolean outInkageEntity = s7DataZKDLPTwo.getMesControl();
            jsonObject.append("outInkageEntity", outInkageEntity);
            //出片请求
            String outRequestEntity = s7DataZKDLPTwo.getRequestMes().toString();
            jsonObject.append("outInkageEntity", outInkageEntity);
            Integer outRequestEntity = s7DataZKDLPTwo.getRequestMes();
            jsonObject.append("outRequestEntity", outRequestEntity);
            //930空闲信号
            jsonObject.append("freeOneRequestEntity", CMJ1ModbusTcp.readUInt16(42027 - offset));
            //931空闲信号
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/s7/entity/S7DataZKDLPOne.java
@@ -97,6 +97,12 @@
    @S7Variable(address = "DB7.118", type = EDataType.STRING, count = 14)
    private String id6;
    @S7Variable(address = "DB7.1248", type = EDataType.STRING, count = 14)
    private String id7;
    @S7Variable(address = "DB7.1380", type = EDataType.UINT16)
    private Integer from7;
    @S7Variable(address = "MW1002", type = EDataType.UINT16)
    private Integer alramSignal;
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/application-yw.yml
@@ -19,6 +19,11 @@
          username: sa
          password: beibo.123/
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
        sd:
          url: jdbc:mysql://192.168.2.100:3309/sd?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
  cloud:
    nacos:
      discovery:
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -340,7 +340,7 @@
        ),
        glass_engineer_temp AS (
        SELECT
        flow_card_id,
        distinct flow_card_id,
        engineer_id
        FROM
        (
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassQueueInfoMapper.xml
New file
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mes.hollowqueue.mapper.HollowGlassQueueInfoMapper">
    <select id="queryNeedInCarGlass" resultType="java.lang.String">
        WITH queue_temp AS (
            SELECT slot,
                   glass_id,
                   LEAST(width, height)                                             AS height,
                   relation_id,
                   ROW_NUMBER() OVER ( PARTITION BY cell ORDER BY hollow_sequence ) AS rn
            FROM hollow_glass_queue_info
            WHERE state = - 1
        ),
             glass_id_temp AS (SELECT * FROM queue_temp WHERE rn = 1),
             task_temp AS (SELECT *
                           FROM glass_id_temp t
                                    INNER JOIN hollow_glass_out_relation_info t1 ON t.relation_id = t1.id
                           WHERE t1.state = 1)
        SELECT glass_id
        FROM task_temp
    </select>
</mapper>