ZengTao
2025-09-22 0fe4f45202452d5038efddffe0a5be4fb3745f8b
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -1,6 +1,5 @@
package com.mes.job;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
@@ -11,8 +10,8 @@
import com.mes.bigstoragecagetask.service.BigStorageCageTaskService;
import com.mes.common.config.Const;
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
import com.mes.hollow.entity.dto.LackDetailsDTO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import com.mes.hollow.service.HollowBigStorageCageDetailsService;
import com.mes.hollow.service.HollowBigStorageCageService;
@@ -26,7 +25,6 @@
import com.mes.s7.entity.S7DataZKDLPOne;
import com.mes.s7.entity.S7DataZKDLPTwo;
import com.mes.s7.entity.S7DataZKExtra;
import com.mes.tools.WebSocketServer;
import com.mes.tools.WebSocketUtils;
import com.mes.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
@@ -42,7 +40,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @Author : zhoush
@@ -117,15 +114,16 @@
    }
    public void hollowGlassTaskChild(int cell, String isFreeTag, String websocketName) {
        List<HollowGlassOutRelationInfo> taskList = hollowGlassOutRelationInfoService.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START).eq(HollowGlassOutRelationInfo::getCell, cell));
        JSONObject jsonObject = new JSONObject();
        if (CollectionUtil.isNotEmpty(taskList)) {
            List<Long> taskIdList = taskList.stream().map(HollowGlassOutRelationInfo::getId).collect(Collectors.toList());
            List<HollowGlassQueueInfo> list = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>().in(HollowGlassQueueInfo::getRelationId, taskIdList));
            jsonObject.append("queueInfo", list);
        }
//        List<HollowGlassOutRelationInfo> taskList = hollowGlassOutRelationInfoService.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
//                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START).eq(HollowGlassOutRelationInfo::getCell, cell));
        JSONObject jsonObject = new JSONObject(true);
//        if (CollectionUtil.isNotEmpty(taskList)) {
//            List<Long> taskIdList = taskList.stream().map(HollowGlassOutRelationInfo::getId).collect(Collectors.toList());
//            List<HollowGlassQueueInfo> list = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>().in(HollowGlassQueueInfo::getRelationId, taskIdList));
//            jsonObject.append("queueInfo", list);
//        }
        Map<String, List<HollowGlassQueueInfo>> queueInfo = hollowGlassOutRelationInfoService.appointHollowTaskDetails(cell);
        jsonObject.append("queueInfo", queueInfo);
        try {
            jsonObject.append("freeRequest", isFreeTag);
        } catch (Exception e) {
@@ -328,6 +326,10 @@
        HollowBigStorageDetailsQueryVO hollowBigStorageDetailsQueryVO = new HollowBigStorageDetailsQueryVO();
        List<FlowCardGlassInfoDTO> bigStorageCageUsageSummary = hollowGlassRelationInfoService.queryHollowAllFlowCardSummary(hollowBigStorageDetailsQueryVO);
        jsonObject.append("bigStorageCageUsageSummary", bigStorageCageUsageSummary);
        //缺片详情
        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard();
        jsonObject.append("lackDetailsList", lackDetailsList);
    }
    @Scheduled(fixedDelay = 1000)