zhoushihao
2024-11-07 3debb9073e9fde7ae118a8844ad54a86ee69cd44
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
@@ -5,7 +5,6 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mes.common.config.Const;
import com.mes.common.utils.RedisUtil;
import com.mes.downglassinfo.entity.DownGlassInfo;
import com.mes.downglassinfo.entity.DownGlassTask;
import com.mes.downglassinfo.entity.request.DownGlassInfoRequest;
@@ -18,23 +17,20 @@
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.tools.DateUtil;
import com.mes.tools.WebSocketServer;
import com.mes.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.*;
import java.util.stream.Collectors;
@Slf4j
@@ -158,7 +154,7 @@
        jsonObject4.append("downGlassInfos", downGlassInfos);
        jsonObject4.append("engineerIdList", engineerIdList);
        //钢化开关
        //打印开关
        boolean autoPrint = false;
        if (redisUtil.getCacheObject("autoPrint") == null) {
            redisUtil.setCacheObject("autoPrint", false);
@@ -210,9 +206,9 @@
    @Scheduled(fixedDelay = Long.MAX_VALUE)
    public void scanCodeTask() {
        JSONObject jsonObject = new JSONObject();
        log.info("扫描任务已启动");
        while (true) {
            JSONObject jsonObject = new JSONObject();
            try (Socket socket = new Socket(scanIp, scanPort);
                 BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
                // 接收服务器响应