zhoushihao
2024-07-29 6facef85e36e9596a36bd85f3c822ceb3ed2ffe2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java
@@ -5,6 +5,7 @@
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.common.S7object;
import com.mes.common.utils.RedisUtil;
import com.mes.device.PlcParameterObject;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
@@ -31,9 +32,11 @@
    private BigStorageCageDetailsService bigStorageCageDetailsService;
    @Resource
    private TemperingGlassInfoService temperingGlassInfoService;
    @Resource
    private RedisUtil redisUtil;
    private JSONObject jsonObject = new JSONObject();
    public void dataBase1() throws InterruptedException {
    public void queryDataSource1() throws InterruptedException {
        List<Double> carPostion=new ArrayList<>();
        carPostion.add(0.25);
        carPostion.add(0.5);
@@ -56,9 +59,16 @@
        //理片笼表格信息
        jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll());
        //钢化开关
        boolean temperingSwitch=false;
        if(redisUtil.getCacheObject("temperingSwitch")==null){
            temperingSwitch=redisUtil.getCacheObject("temperingSwitch");
        }
        jsonObject.append("temperingSwitch", temperingSwitch);
    }
    public void dataBase2() throws InterruptedException {
    public void queryDataSource2() throws InterruptedException {
        //出片队列
        List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list();
        jsonObject.append("temperingGlassInfoList", temperingGlassInfoList);
@@ -72,8 +82,11 @@
    public void plcStorageCageTask() throws InterruptedException {
        jsonObject = new JSONObject();
        try {
            dataBase1();
            dataBase2();
            //查询使用数据源1查询数据
            queryDataSource1();
            //查询使用数据源2查询数据
            queryDataSource2();
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage");
            if (sendwServer != null) {
                for (WebSocketServer webserver : sendwServer) {