ZengTao
2023-12-07 d1758c1be9863a10d03928bf93a42ca1bf31d07b
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -1,9 +1,7 @@
package com.example.springboot.component;
import cn.hutool.json.JSONObject;
import cn.hutool.poi.excel.sax.handler.MapRowHandler;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +14,7 @@
import com.example.springboot.mapper.SpianMapper;
import com.example.springboot.service.JdbcConnections;
import com.example.springboot.service.North_Glass_Buffer1Service;
import com.example.springboot.service.OutSliceServive;
import com.example.springboot.service.SpianService;
@@ -23,6 +22,7 @@
    @Autowired
    private HomeMapper homeMapper;
    private OutSliceServive outSliceServive;
    private SpianMapper spianMapper;
    private SpianService spianService;
    private North_Glass_Buffer1Service north_Glass_Buffer1Service;
@@ -32,7 +32,7 @@
    //铝框id
    public static String FrameNo;
    //是否需要手动确认玻璃
    public static Boolean isConfirm=true;
    public static Boolean isConfirm=false;
    // public static Map b=new HashMap<>();
    // b.put()
    @Override
@@ -49,6 +49,7 @@
            homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
            spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
            spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
            outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
            north_Glass_Buffer1Service = WebSocketServer.applicationContext.getBean(North_Glass_Buffer1Service.class);
            // 笼子使用情况
            List<StorageCage> tableData = homeMapper.selectAll();
@@ -71,28 +72,29 @@
            List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo();
            jsonObject.append("alarmmg", alarmmg);
            // 读去Plc进片车与出片车位置W
            // List<String> addressList = new ArrayList<String>();
            // addressList.add("DB106.12");
            // addressList.add("DB106.0");
            // List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
            // if (paramlist != null) {
            // jsonObject.append("params", paramlist);
            // }
            // // 获取进片车状态
            // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
            // 1);// 获取进片车状态
            // boolean exist1 = datas1ListState.contains((short) 0);
            // jsonObject.append("zhuangtai", exist1);
            // //获取进片玻璃信息
            // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
            // if (inglassInfo != null) {
            // if (inglassInfo.size() > 0)
            // jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
            // }
             List<String> addressList = new ArrayList<String>();
             addressList.add("DB106.12");
             addressList.add("DB106.0");
             List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
             if (paramlist != null) {
             jsonObject.append("params", paramlist);
             }
             // 获取进片车状态
             List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
             1);// 获取进片车状态
             boolean exist1 = datas1ListState.contains((short) 0);
             jsonObject.append("zhuangtai", exist1);
             //获取进片玻璃信息
             List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
             if (inglassInfo != null) {
             if (inglassInfo.size() > 0)
             jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
             }
            // 伍 获取进是否有待确认的玻璃id
            String queid = spianMapper.Selectqueueid();
            int state = spianMapper.Selectqueuestate();
            jsonObject.append("state", queid);
            jsonObject.append("queid", queid);
            jsonObject.append("state", state);
            // 获取扫码位与上片位玻璃信息
            Queue form2 = homeMapper.GetQueueInfo(2);
@@ -104,10 +106,11 @@
                jsonObject.append("form3", form3);
            }
            // 获取出片队列信息
            List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
            for (Out_slice out_slice : listoutslice) {
                out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
            }
            List<Out_slice> listoutslice=outSliceServive.SelectProductionqueue();
            // List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
            // for (Out_slice out_slice : listoutslice) {
            //     out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
            // }
            jsonObject.append("listoutslice", listoutslice);
            //获取当前出片队列状态
            jsonObject.append("isAllowQueue",Plchome.isAllowQueue);