From 2022682967ad0b0d1cd6e2e86f8fb628478d4e9c Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期六, 11 十月 2025 12:00:03 +0800
Subject: [PATCH] 1、 上片界面/钢化前大理片笼数据推送接口,供第一次进入界面调用

---
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
index ec636fd..91c11e4 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -4,6 +4,8 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
 import com.kangaroohy.milo.service.MiloService;
+import com.mes.alarm.entity.ProductAlarmInfo;
+import com.mes.alarm.service.ProductAlarmInfoService;
 import com.mes.bigstorage.entity.BigStorageCageDetails;
 import com.mes.bigstorage.entity.dto.BigStorageSummaryDTO;
 import com.mes.bigstorage.service.BigStorageCageDetailsService;
@@ -72,11 +74,22 @@
     @Resource
     private WebSocketUtils webSocketUtils;
 
-    private JSONObject jsonObject = new JSONObject();
+    @Resource
+    private ProductAlarmInfoService productAlarmInfoService;
 
-    public void queryDataSource1() throws Exception {
-        S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class);
-        S7DataDLPTwo s7DataWLTwo = s7SerializerDLPTwo.read(S7DataDLPTwo.class);
+
+    private static final String ALARM_MODULE = "閽㈠寲";
+    private static final String ALARM_TYPE = "閽㈠寲澶х悊鐗�";
+    private static final String ALARM_CODE_SIZE = "sizeSame";
+    private static final String ALARM_CODE_ID = "idSame";
+
+
+    public JSONObject queryDataSource1() throws Exception {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>()
+                .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW)
+                .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE)
+                .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE)));
         List<Double> carPostion = new ArrayList<>();
         carPostion.add(0.25);
         carPostion.add(0.5);
@@ -84,6 +97,8 @@
         //鐣岄潰灞曠ず绗煎瓙淇℃伅
         jsonObject.append("bigStorageCageInfos", bigStorageCageDetailsService.querybigStorageCageDetail());
 
+        S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class);
+        S7DataDLPTwo s7DataWLTwo = s7SerializerDLPTwo.read(S7DataDLPTwo.class);
         try {
             //杩涚墖浠诲姟鏁版嵁
             List<BigStorageTaskVO> inTaskList = new ArrayList();
@@ -233,10 +248,11 @@
         //褰撳墠鎸囧畾宸ョ▼
         jsonObject.append("temperingEngineerId", redisUtil.getCacheObject("temperingEngineerId"));
 
-
+        return jsonObject;
     }
 
     public void queryDataSource2() throws InterruptedException {
+        JSONObject jsonObject = new JSONObject();
         //鍑虹墖闃熷垪
         List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(
                 new LambdaQueryWrapper<TemperingGlassInfo>()
@@ -252,9 +268,8 @@
      */
     @Scheduled(fixedDelay = 3000)
     public void plcStorageCageTask() throws Exception {
-        jsonObject = new JSONObject();
         //鏌ヨ浣跨敤鏁版嵁婧�1鏌ヨ鏁版嵁
-        queryDataSource1();
+        JSONObject jsonObject = queryDataSource1();
         //鏌ヨ浣跨敤鏁版嵁婧�2鏌ヨ鏁版嵁
 //            queryDataSource2();
         webSocketUtils.sendToWeb("slicecage", jsonObject);

--
Gitblit v1.8.0