From 636eec68dd5b988ea1b753a9b7ebc39f23eb501a Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 13 十月 2025 07:55:56 +0800
Subject: [PATCH] 1、修改932线出片类型判断 2、钢化,仓储修改websocket推送方式
---
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java | 19 +++------
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java | 2
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml | 37 +++++++++++++++---
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java | 47 +++--------------------
4 files changed, 44 insertions(+), 61 deletions(-)
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
index 6d0a7cb..dd01336 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -57,7 +57,7 @@
*/
public static final Integer TEMPERING_OUT_TARGET_POSITION = 930;
public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 931;
- public static final List<Integer> OUT_TARGET_POSITION_ALL = Arrays.asList(930, 931);
+ public static final List<Integer> OUT_TARGET_POSITION_ALL = Arrays.asList(930, 931, 932);
/**
* 鍗у紡鐞嗙墖绗艰鎯呰〃鐜荤拑鐘舵��
diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
index b7e9966..9d23890 100644
--- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
+++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
@@ -16,6 +16,7 @@
import com.mes.rawglasstask.entity.RawGlassStorageTask;
import com.mes.rawglasstask.service.RawGlassStorageTaskService;
import com.mes.tools.WebSocketServer;
+import com.mes.tools.WebSocketUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -42,6 +43,9 @@
@Resource
private OrdersService ordersService;
+ @Resource
+ private WebSocketUtils webSocketUtils;
+
@Scheduled(fixedDelay = 2000)
public void sendRawGlassMessage() {
log.info("鍙戦�佷换鍔′俊鎭拰鏋跺瓙淇℃伅");
@@ -51,12 +55,7 @@
List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.listRawGlassTask();
jsonObject.append("rawStationDetailsList", rawStationDetailsList);
jsonObject.append("tasks", tasks);
- List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("rawGlass");
- if (CollectionUtil.isNotEmpty(sendwServer)) {
- sendwServer.stream().forEach(e -> {
- e.sendMessage(String.valueOf(jsonObject));
- });
- }
+ webSocketUtils.sendToWeb("rawGlass", jsonObject);
}
@Scheduled(fixedDelay = 1000)
@@ -74,12 +73,6 @@
List<OrderDTO> orderDTOS = ordersService.selectOrderPercent();
jsonObject.append("orderDTOS", orderDTOS);
-
- List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen");
- if (CollectionUtil.isNotEmpty(sendwServer)) {
- sendwServer.stream().forEach(e -> {
- e.sendMessage(String.valueOf(jsonObject));
- });
- }
+ webSocketUtils.sendToWeb("largenScreen", jsonObject);
}
}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
index ae81d1a..9e4c69a 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
@@ -11,13 +11,14 @@
import com.mes.s7.entity.S7DataGHTwo;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
-import com.mes.tools.WebSocketServer;
+import com.mes.tools.WebSocketUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
+import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
@@ -40,6 +41,8 @@
@Autowired
@Qualifier("s7SerializerGHTwo")
private S7Serializer s7SerializerGHTwo;
+ @Resource
+ private WebSocketUtils webSocketUtils;
@Scheduled(fixedDelay = 1000)
@@ -81,18 +84,8 @@
} catch (Exception e) {
log.info("閽㈠寲鍓嶈幏鍙栧紓甯革細{}", e.getMessage());
}
+ webSocketUtils.sendToWeb("temperingGlass", jsonObject);
-
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- } else {
- log.info("Home is closed");
- }
- }
- }
}
@Scheduled(fixedDelay = 1000)
@@ -101,19 +94,7 @@
//姝e湪杩涜鐨勪换鍔�
List<TemperingGlassInfo> temperingTaskType = temperingGlassInfoService.selectTaskType();
jsonObject.append("temperingTaskType", temperingTaskType);
-
-
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingIsRun");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- } else {
- log.info("Home is closed");
- }
- }
- }
-
+ webSocketUtils.sendToWeb("temperingIsRun", jsonObject);
}
@Scheduled(fixedDelay = 1000)
@@ -148,21 +129,7 @@
//閽㈠寲楗煎浘鏁版嵁
List<PieChartVO> pieChartVOS = temperingGlassInfoService.queryPieChart();
jsonObject.append("pieChartVOS", pieChartVOS);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("largenScreen is closed");
- }
- }
- }
+ webSocketUtils.sendToWeb("largenScreen", jsonObject);
}
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
index 22cfa0d..0a9cf77 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -324,14 +324,37 @@
),
glass_info_temp AS (
SELECT
- gi.id,
- gi.glass_id,
+ flow_card_id,
+ engineer_id
+ FROM
+ (
+ SELECT
gi.flow_card_id,
- gi.layer,
- gi.thickness,
- gi.filmsId
- FROM hollow_flow_temp hft
+ gi.engineer_id,
+ ROW_NUMBER() OVER ( PARTITION BY gi.flow_card_id ,gi.layer ORDER BY COUNT( gi.glass_id ) DESC ) AS rn
+ FROM
+ hollow_flow_temp hft
INNER JOIN glass_info gi ON hft.flow_card_id = gi.flow_card_id
+ GROUP BY
+ gi.flow_card_id,
+ gi.engineer_id ,
+ gi.layer
+ ) t
+ WHERE
+ rn = 1
+ ),
+ glass_result AS (
+ SELECT
+ t1.id,
+ t1.glass_id,
+ t1.flow_card_id,
+ t1.layer,
+ t1.thickness,
+ t1.filmsId
+ FROM
+ glass_info_temp t
+ INNER JOIN glass_info t1 ON t.engineer_id = t1.engineer_id
+ AND t.flow_card_id = t1.flow_card_id
),
damage_ranked AS (
SELECT
@@ -360,7 +383,7 @@
COUNT(DISTINCT t1.glass_id) as real_count,
COUNT(DISTINCT t.id) - COUNT(DISTINCT t1.glass_id) as lack_count,
COUNT(DISTINCT CASE WHEN t2.type IN (8,9) AND t2.status = 1 THEN t.glass_id END) as damage_count
- FROM glass_info_temp t
+ FROM glass_result t
LEFT JOIN hollow_details_temp t1 ON t.glass_id = t1.glass_id
LEFT JOIN damage_latest t2 ON t.glass_id = t2.glass_id
GROUP BY t.flow_card_id, t.layer, t.thickness, t.filmsId
--
Gitblit v1.8.0