ZengTao
2025-05-20 ae07cd92f46b88bf034c7d9d0b96b3a5e83fdc98
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
@@ -11,7 +11,6 @@
import com.mes.pp.service.OptimizeProjectService;
import com.mes.rawglassdetails.entity.RawGlassStorageDetails;
import com.mes.rawglassstation.service.RawGlassStorageStationService;
import com.mes.tools.DateUtil;
import com.mes.tools.WebSocketServer;
import com.mes.uppattenusage.entity.UpPattenUsage;
import com.mes.uppattenusage.service.UpPattenUsageService;
@@ -24,7 +23,6 @@
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -139,7 +137,7 @@
        loadGlassChild("loadGlassRequestOne", 5, LOAD_GLASS_DEVICE_ONE_TASK, "loadGlassOne");
    }
    @Scheduled(fixedDelay = 10)
    @Scheduled(fixedDelay = 10000)
    public void loadTwoGlass() {
        loadGlassChild("loadGlassRequestTwo", 6, LOAD_GLASS_DEVICE_TWO_TASK, "loadGlassTwo");
    }
@@ -186,24 +184,7 @@
        }
    }
    @Scheduled(fixedDelay = 216000000)
    public void send() {
        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("mainMes");
        if (sendwServer != null) {
            //推送服务器当前时间
            JSONObject jsonObject = new JSONObject();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            jsonObject.append("globalDate", sdf.format(DateUtil.getEndDate()));
            for (WebSocketServer webserver : sendwServer) {
                if (webserver != null) {
                    webserver.sendMessage(jsonObject.toString());
                } else {
                    log.info("mainMes is closed");
                }
            }
        }
    }
    //    @Scheduled(fixedDelay = 5000)
    public void loadGlassStatus() {
        JSONObject jsonObject = new JSONObject();