From 2c2d4783a9a78c862b6b1a5f57aa59494be5ef0c Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期一, 27 五月 2024 14:12:26 +0800
Subject: [PATCH] websocket统一移到公共模块

---
 /dev/null                                                                                                                      |  176 --------------------------------------------
 hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java                                     |   15 +++
 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java |    7 +
 hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java                                          |    6 
 hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml                                             |    4 
 hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/WebSocketConfig.java                                  |   18 ++++
 6 files changed, 40 insertions(+), 186 deletions(-)

diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/WebSocketConfig.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/WebSocketConfig.java
new file mode 100644
index 0000000..387f053
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/WebSocketConfig.java
@@ -0,0 +1,18 @@
+package com.mes.common.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.socket.server.standard.ServerEndpointExporter;
+
+@Configuration
+public class WebSocketConfig {
+    /**
+     * bean娉ㄥ唽锛氫細鑷姩鎵弿甯︽湁@ServerEndpoint娉ㄨВ澹版槑鐨刉ebsocket Endpoint(绔偣)锛屾敞鍐屾垚涓篧ebsocket bean銆�
+     * 瑕佹敞鎰忥紝濡傛灉椤圭洰浣跨敤澶栫疆鐨剆ervlet瀹瑰櫒锛岃�屼笉鏄洿鎺ヤ娇鐢╯pringboot鍐呯疆瀹瑰櫒鐨勮瘽锛屽氨涓嶈娉ㄥ叆ServerEndpointExporter锛屽洜涓哄畠灏嗙敱瀹瑰櫒鑷繁鎻愪緵鍜岀鐞嗐��
+     */
+    @Bean
+    public ServerEndpointExporter serverEndpointExporter() {
+        return new ServerEndpointExporter();
+    }
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
index f1fa50d..f69a142 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
@@ -2,13 +2,14 @@
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
-import java.io.Serializable;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.io.Serializable;
+
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author wu
@@ -57,6 +58,16 @@
     private String filmsid;
 
     /**
+     * 灞傛暟
+     */
+    private int layer;
+
+    /**
+     * 鎬诲眰鏁�
+     */
+    private int totalLayer;
+
+    /**
      * 纾ㄥ墠瀹�
      */
     private Double edgWidth;
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/WebSocketServer.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java
similarity index 98%
rename from hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/WebSocketServer.java
rename to hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java
index 5fabafa..75f66fe 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/WebSocketServer.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java
@@ -1,4 +1,4 @@
-package com.mes.common;
+package com.mes.tools;
 
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
@@ -35,8 +35,8 @@
      */
     public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>();
 
-    String username;
-    Session session;
+    public String username;
+    public Session session;
 
     public WebSocketServer() {
         this.messages = new ArrayList<>();
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
deleted file mode 100644
index 9f8583a..0000000
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package com.mes.glassinfo.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.io.Serializable;
-
-/**
- * <p>
- *
- * </p>
- *
- * @author zhoush
- * @since 2024-04-07
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class GlassInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 鐜荤拑淇℃伅琛╥d
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 娴佺▼鍗�
-     */
-    private String flowCardId;
-
-    /**
-     * 娴佺▼鍗$幓鐠冪被鍨�
-     */
-    private Integer glassType;
-
-    /**
-     * 瀹�
-     */
-    private Double width;
-
-    /**
-     * 楂�
-     */
-    private Double height;
-
-    /**
-     * 鍘氬害
-     */
-    private Double thickness;
-
-    /**
-     * 鑶滅郴
-     */
-    private String filmsid;
-
-    /**
-     * 纾ㄥ墠瀹�
-     */
-    private Double edgWidth;
-
-    /**
-     * 纾ㄥ墠楂�
-     */
-    private Double edgHeight;
-
-    /**
-     * 鏄惁閰嶇墖
-     */
-    private Integer ismultiple;
-
-    /**
-     * 閰嶇墖鏈�澶у
-     */
-    private Double maxWidth;
-
-    /**
-     * 閰嶇墖鏈�澶ч珮
-     */
-    private Double maxHeight;
-
-    /**
-     * 閽㈠寲鏄惁鎺ュ彈妯斁
-     */
-    private Integer ishorizontal;
-
-    /**
-     * 鍘熺墖椤哄簭
-     */
-    private Integer patternSequence;
-
-    /**
-     * 閽㈠寲鐗堝浘id
-     */
-    private Integer temperingLayoutId;
-
-    /**
-     * 閽㈠寲鐗堝浘鐗囧簭
-     */
-    private Integer temperingFeedSequence;
-
-    /**
-     * x鍧愭爣
-     */
-    private Integer xCoordinate;
-
-    /**
-     * y鍧愭爣
-     */
-    private Integer yCoordinate;
-
-    /**
-     * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
-     */
-    private Integer angle;
-
-    /**
-     * 宸ョ▼鍙�
-     */
-    private String engineerId;
-
-    /**
-     * 鐢熶骇瑙勫垯id
-     */
-    private Integer ruleId;
-
-    /**
-     * 鐜荤拑ID
-     */
-    private String glassId;
-
-
-}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/WebSocketServer.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/WebSocketServer.java
deleted file mode 100644
index 5fabafa..0000000
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/WebSocketServer.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package com.mes.common;
-
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.*;
-import javax.websocket.server.PathParam;
-import javax.websocket.server.ServerEndpoint;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@ServerEndpoint(value = "/api/talk/{username}")
-@Component("webSocketServer")
-public class WebSocketServer {
-
-
-    public static ConfigurableApplicationContext applicationContext;
-
-    // 瑙e喅鏃犳硶娉ㄥ叆mapper闂 //浣跨敤鏂规硶
-    // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class);
-    public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) {
-        WebSocketServer.applicationContext = configurableApplicationContext;
-    }
-
-    private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class);
-    private List<String> messages;
-    /**
-     * 璁板綍褰撳墠鍦ㄧ嚎杩炴帴鏁�
-     */
-    public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>();
-
-    String username;
-    Session session;
-
-    public WebSocketServer() {
-        this.messages = new ArrayList<>();
-    }
-
-    /**
-     * 杩炴帴寤虹珛鎴愬姛璋冪敤鐨勬柟娉�
-     */
-    @OnOpen
-    public void onOpen(Session session, @PathParam("username") String username) {
-        this.username = username;
-        this.session = session;
-        List<WebSocketServer> webSocketServers = sessionMap.get(username);
-        if (webSocketServers == null) {
-            ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>();
-            arrayListwebserver.add(this);
-            sessionMap.put(username, arrayListwebserver);
-        } else {
-            webSocketServers.add(this);
-        }
-
-        log.info("鏈夋柊鐢ㄦ埛鍔犲叆锛寀sername={}, 褰撳墠鍦ㄧ嚎浜烘暟涓猴細{}", username, sessionMap.get(username).size());
-
-        // JSONObject result = new JSONObject();
-        // JSONArray array = new JSONArray();
-        // result.set("users", array);
-        // for (Object key : sessionMap.keySet()) {
-        // JSONObject jsonObject = new JSONObject();
-        // jsonObject.set("username", key);
-        // array.add(jsonObject);
-        // }
-
-        // sendAllMessage(JSONUtil.toJsonStr(result)); // 鍚庡彴鍙戦�佹秷鎭粰鎵�鏈夌殑瀹㈡埛绔�
-    }
-
-    /**
-     * 杩炴帴鍏抽棴璋冪敤鐨勬柟娉�
-     */
-    @OnClose
-    public void onClose(Session session, @PathParam("username") String username) {
-        List<WebSocketServer> webSocketServers = sessionMap.get(username);
-        ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>();
-        if (webSocketServers.size() > 1) {
-            for (WebSocketServer webSocketServer : webSocketServers) {
-                if (webSocketServer != this) {
-                    arrayListwebserver.add(webSocketServer);
-                }
-            }
-            sessionMap.put(username, arrayListwebserver);
-            log.info("绉婚櫎username={}涓�鍚嶇敤鎴穝ession, {}鐨勫綋鍓嶅湪绾夸汉鏁颁负锛歿}", username, username, sessionMap.get(username).size());
-        } else {
-            sessionMap.remove(username);
-            log.info("绉婚櫎username={}涓�鍚嶇敤鎴穝ession, {}杩炴帴鍏抽棴, 褰撳墠杩炴帴鏁颁负锛歿}", username, username, sessionMap.size());
-        }
-
-    }
-
-    /**
-     * 鏀跺埌瀹㈡埛绔秷鎭悗璋冪敤鐨勬柟娉�
-     * 鍚庡彴鏀跺埌瀹㈡埛绔彂閫佽繃鏉ョ殑娑堟伅
-     * onMessage 鏄竴涓秷鎭殑涓浆绔�
-     * 鎺ュ彈 娴忚鍣ㄧ socket.send 鍙戦�佽繃鏉ョ殑 json鏁版嵁
-     *
-     * @param message 瀹㈡埛绔彂閫佽繃鏉ョ殑娑堟伅
-     */
-    @OnMessage
-    public void onMessage(String message, Session session, @PathParam("username") String username) {
-        log.info("鏈嶅姟绔敹鍒扮敤鎴穟sername={}鐨勬秷鎭�:{}", username, message);
-        JSONObject obj = JSONUtil.parseObj(message);
-        String text = obj.getStr("data");
-
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.set("message", text);
-        this.messages.add(text);
-        this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject)
-
-    }
-
-    @OnError
-    public void onError(Session session, Throwable error) {
-        log.error("鍙戠敓閿欒");
-        error.printStackTrace();
-    }
-
-    /**
-     * 鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔�
-     */
-    public void sendMessage(String message) {
-        try {
-            // log.info("鏈嶅姟绔粰瀹㈡埛绔痆{}]鍙戦�佹秷鎭瘂}", this.session.getId(), message);
-            this.session.getBasicRemote().sendText(message);
-        } catch (Exception e) {
-            log.error("鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔け璐�", e);
-        }
-    }
-
-    // /**
-    //  * 鏈嶅姟绔彂閫佹秷鎭粰鎵�鏈夊鎴风
-    //  */
-    // public void sendAllMessage(String message) {
-    //     try {
-    //         for (WebSocketServer webSocketServer : sessionMap.values()) {
-    //             // log.info("鏈嶅姟绔粰瀹㈡埛绔痆{}]鍙戦�佹秷鎭瘂}", this.session.getId(), message);
-    //             webSocketServer.sendMessage(message);
-    //         }
-    //     } catch (Exception e) {
-    //         log.error("鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔け璐�", e);
-    //     }
-    // }
-
-    public List<String> getMessages() {
-        return messages;
-
-    }
-
-    public void clearMessages() {
-        messages.clear();
-    }
-
-
-}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
deleted file mode 100644
index c38d086..0000000
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package com.mes.glassinfo.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author zhoush
- * @since 2024-03-27
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class GlassInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 鐜荤拑淇℃伅琛╥d
-     */
-      @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 娴佺▼鍗�
-     */
-    private String flowcardId;
-
-    /**
-     * 娴佺▼鍗$幓鐠冪被鍨�
-     */
-    private Integer glassType;
-
-    /**
-     * 瀹�
-     */
-    private Double width;
-
-    /**
-     * 楂�
-     */
-    private Double height;
-
-    /**
-     * 鍘氬害
-     */
-    private Double thickness;
-
-    /**
-     * 鑶滅郴
-     */
-    private String filmsid;
-
-    /**
-     * 纾ㄥ墠瀹�
-     */
-    private Double edgWidth;
-
-    /**
-     * 纾ㄥ墠楂�
-     */
-    private Double edgHeight;
-
-    /**
-     * 鏄惁閰嶇墖
-     */
-    private Integer ismultiple;
-
-    /**
-     * 閰嶇墖鏈�澶у
-     */
-    private Double maxWidth;
-
-    /**
-     * 閰嶇墖鏈�澶ч珮
-     */
-    private Double maxHeight;
-
-    /**
-     * 閽㈠寲鏄惁鎺ュ彈妯斁
-     */
-    private Integer ishorizontal;
-
-    /**
-     * 鍘熺墖椤哄簭
-     */
-    private Integer patternSequence;
-
-    /**
-     * 閽㈠寲鐗堝浘id
-     */
-    private Integer temperingLayoutId;
-
-    /**
-     * 閽㈠寲鐗堝浘鐗囧簭
-     */
-    private Integer temperingFeedSequence;
-
-    /**
-     * x鍧愭爣
-     */
-    private Integer xCoordinate;
-
-    /**
-     * y鍧愭爣
-     */
-    private Integer yCoordinate;
-
-    /**
-     * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
-     */
-    private Integer angle;
-
-    /**
-     * 宸ョ▼鍙�
-     */
-    private Long engineerId;
-
-    /**
-     * 鐢熶骇瑙勫垯id
-     */
-    private Integer ruleId;
-
-
-}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/WebSocketServer.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/WebSocketServer.java
deleted file mode 100644
index 5fabafa..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/WebSocketServer.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package com.mes.common;
-
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.*;
-import javax.websocket.server.PathParam;
-import javax.websocket.server.ServerEndpoint;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@ServerEndpoint(value = "/api/talk/{username}")
-@Component("webSocketServer")
-public class WebSocketServer {
-
-
-    public static ConfigurableApplicationContext applicationContext;
-
-    // 瑙e喅鏃犳硶娉ㄥ叆mapper闂 //浣跨敤鏂规硶
-    // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class);
-    public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) {
-        WebSocketServer.applicationContext = configurableApplicationContext;
-    }
-
-    private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class);
-    private List<String> messages;
-    /**
-     * 璁板綍褰撳墠鍦ㄧ嚎杩炴帴鏁�
-     */
-    public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>();
-
-    String username;
-    Session session;
-
-    public WebSocketServer() {
-        this.messages = new ArrayList<>();
-    }
-
-    /**
-     * 杩炴帴寤虹珛鎴愬姛璋冪敤鐨勬柟娉�
-     */
-    @OnOpen
-    public void onOpen(Session session, @PathParam("username") String username) {
-        this.username = username;
-        this.session = session;
-        List<WebSocketServer> webSocketServers = sessionMap.get(username);
-        if (webSocketServers == null) {
-            ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>();
-            arrayListwebserver.add(this);
-            sessionMap.put(username, arrayListwebserver);
-        } else {
-            webSocketServers.add(this);
-        }
-
-        log.info("鏈夋柊鐢ㄦ埛鍔犲叆锛寀sername={}, 褰撳墠鍦ㄧ嚎浜烘暟涓猴細{}", username, sessionMap.get(username).size());
-
-        // JSONObject result = new JSONObject();
-        // JSONArray array = new JSONArray();
-        // result.set("users", array);
-        // for (Object key : sessionMap.keySet()) {
-        // JSONObject jsonObject = new JSONObject();
-        // jsonObject.set("username", key);
-        // array.add(jsonObject);
-        // }
-
-        // sendAllMessage(JSONUtil.toJsonStr(result)); // 鍚庡彴鍙戦�佹秷鎭粰鎵�鏈夌殑瀹㈡埛绔�
-    }
-
-    /**
-     * 杩炴帴鍏抽棴璋冪敤鐨勬柟娉�
-     */
-    @OnClose
-    public void onClose(Session session, @PathParam("username") String username) {
-        List<WebSocketServer> webSocketServers = sessionMap.get(username);
-        ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>();
-        if (webSocketServers.size() > 1) {
-            for (WebSocketServer webSocketServer : webSocketServers) {
-                if (webSocketServer != this) {
-                    arrayListwebserver.add(webSocketServer);
-                }
-            }
-            sessionMap.put(username, arrayListwebserver);
-            log.info("绉婚櫎username={}涓�鍚嶇敤鎴穝ession, {}鐨勫綋鍓嶅湪绾夸汉鏁颁负锛歿}", username, username, sessionMap.get(username).size());
-        } else {
-            sessionMap.remove(username);
-            log.info("绉婚櫎username={}涓�鍚嶇敤鎴穝ession, {}杩炴帴鍏抽棴, 褰撳墠杩炴帴鏁颁负锛歿}", username, username, sessionMap.size());
-        }
-
-    }
-
-    /**
-     * 鏀跺埌瀹㈡埛绔秷鎭悗璋冪敤鐨勬柟娉�
-     * 鍚庡彴鏀跺埌瀹㈡埛绔彂閫佽繃鏉ョ殑娑堟伅
-     * onMessage 鏄竴涓秷鎭殑涓浆绔�
-     * 鎺ュ彈 娴忚鍣ㄧ socket.send 鍙戦�佽繃鏉ョ殑 json鏁版嵁
-     *
-     * @param message 瀹㈡埛绔彂閫佽繃鏉ョ殑娑堟伅
-     */
-    @OnMessage
-    public void onMessage(String message, Session session, @PathParam("username") String username) {
-        log.info("鏈嶅姟绔敹鍒扮敤鎴穟sername={}鐨勬秷鎭�:{}", username, message);
-        JSONObject obj = JSONUtil.parseObj(message);
-        String text = obj.getStr("data");
-
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.set("message", text);
-        this.messages.add(text);
-        this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject)
-
-    }
-
-    @OnError
-    public void onError(Session session, Throwable error) {
-        log.error("鍙戠敓閿欒");
-        error.printStackTrace();
-    }
-
-    /**
-     * 鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔�
-     */
-    public void sendMessage(String message) {
-        try {
-            // log.info("鏈嶅姟绔粰瀹㈡埛绔痆{}]鍙戦�佹秷鎭瘂}", this.session.getId(), message);
-            this.session.getBasicRemote().sendText(message);
-        } catch (Exception e) {
-            log.error("鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔け璐�", e);
-        }
-    }
-
-    // /**
-    //  * 鏈嶅姟绔彂閫佹秷鎭粰鎵�鏈夊鎴风
-    //  */
-    // public void sendAllMessage(String message) {
-    //     try {
-    //         for (WebSocketServer webSocketServer : sessionMap.values()) {
-    //             // log.info("鏈嶅姟绔粰瀹㈡埛绔痆{}]鍙戦�佹秷鎭瘂}", this.session.getId(), message);
-    //             webSocketServer.sendMessage(message);
-    //         }
-    //     } catch (Exception e) {
-    //         log.error("鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔け璐�", e);
-    //     }
-    // }
-
-    public List<String> getMessages() {
-        return messages;
-
-    }
-
-    public void clearMessages() {
-        messages.clear();
-    }
-
-
-}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
index 132a0e5..8a5142b 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
@@ -11,13 +11,14 @@
 import com.mes.pp.mapper.OptimizeProjectMapper;
 import com.mes.uppattenusage.entity.OptimizeUpPattenUsage;
 import com.mes.uppattenusage.entity.UpPattenUsage;
-import com.mes.uppattenusage.service.UpPattenUsageService;
 import com.mes.uppattenusage.mapper.UpPattenUsageMapper;
+import com.mes.uppattenusage.service.UpPattenUsageService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * <p>
@@ -57,7 +58,7 @@
         List<OptimizeUpPattenUsage> upPattenUsageList = null;
         if (engineeringId != null) {
             upPattenUsageList = optimizeProjectMapper.selectJoinList(OptimizeUpPattenUsage.class, new MPJQueryWrapper<OptimizeProject>()
-                    .select("t.project_no,t.glass_type,b.width,b.height,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.stock_id")
+                    .select("t.project_no,t.glass_type,b.realwidth as width,b.realheight as height ,REGEXP_REPLACE(t.glass_thickness,'\\D','')as glass_thickness,b.stock_id")
                     .leftJoin("optimize_layout b on t.project_no=b.project_no")
                     .eq("b.project_no", engineeringId));
         }
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/GlassInfo.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/GlassInfo.java
deleted file mode 100644
index 78ccdb5..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/GlassInfo.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package com.mes.workstation.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author zhoush
- * @since 2024-04-07
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class GlassInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 鐜荤拑淇℃伅琛╥d
-     */
-      @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 娴佺▼鍗�
-     */
-    private String flowcardId;
-
-    /**
-     * 娴佺▼鍗$幓鐠冪被鍨�
-     */
-    private Integer glassType;
-
-    /**
-     * 瀹�
-     */
-    private Double width;
-
-    /**
-     * 楂�
-     */
-    private Double height;
-
-    /**
-     * 鍘氬害
-     */
-    private Double thickness;
-
-    /**
-     * 鑶滅郴
-     */
-    private Integer filmsid;
-
-    /**
-     * 纾ㄥ墠瀹�
-     */
-    private Double edgWidth;
-
-    /**
-     * 纾ㄥ墠楂�
-     */
-    private Double edgHeight;
-
-    /**
-     * 鏄惁閰嶇墖
-     */
-    private Integer ismultiple;
-
-    /**
-     * 閰嶇墖鏈�澶у
-     */
-    private Double maxWidth;
-
-    /**
-     * 閰嶇墖鏈�澶ч珮
-     */
-    private Double maxHeight;
-
-    /**
-     * 閽㈠寲鏄惁鎺ュ彈妯斁
-     */
-    private Integer ishorizontal;
-
-    /**
-     * 鍘熺墖椤哄簭
-     */
-    private Integer patternSequence;
-
-    /**
-     * 閽㈠寲鐗堝浘id
-     */
-    private Integer temperingLayoutId;
-
-    /**
-     * 閽㈠寲鐗堝浘鐗囧簭
-     */
-    private Integer temperingFeedSequence;
-
-    /**
-     * x鍧愭爣
-     */
-    private Integer xCoordinate;
-
-    /**
-     * y鍧愭爣
-     */
-    private Integer yCoordinate;
-
-    /**
-     * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
-     */
-    private Integer angle;
-
-    /**
-     * 宸ョ▼鍙�
-     */
-    private Long engineerId;
-
-    /**
-     * 鐢熶骇瑙勫垯id
-     */
-    private Integer ruleId;
-
-
-}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
index 625cc04..94840e1 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
@@ -7,5 +7,5 @@
     name: loadGlass
 mybatis-plus:
   mapper-locations: classpath*:mapper/*.xml
-#   configuration:
-#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 鎵撳嵃sql璇彞
\ No newline at end of file
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/GlassInfo.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/GlassInfo.java
deleted file mode 100644
index 9ca72f2..0000000
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/GlassInfo.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package com.mes.temperingglass.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author zhoush
- * @since 2024-04-07
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class GlassInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 鐜荤拑淇℃伅琛╥d
-     */
-      @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 娴佺▼鍗�
-     */
-    private String flowcardId;
-
-    /**
-     * 娴佺▼鍗$幓鐠冪被鍨�
-     */
-    private Integer glassType;
-
-    /**
-     * 瀹�
-     */
-    private Double width;
-
-    /**
-     * 楂�
-     */
-    private Double height;
-
-    /**
-     * 鍘氬害
-     */
-    private Double thickness;
-
-    /**
-     * 鑶滅郴
-     */
-    private Integer filmsid;
-
-    /**
-     * 纾ㄥ墠瀹�
-     */
-    private Double edgWidth;
-
-    /**
-     * 纾ㄥ墠楂�
-     */
-    private Double edgHeight;
-
-    /**
-     * 鏄惁閰嶇墖
-     */
-    private Integer ismultiple;
-
-    /**
-     * 閰嶇墖鏈�澶у
-     */
-    private Double maxWidth;
-
-    /**
-     * 閰嶇墖鏈�澶ч珮
-     */
-    private Double maxHeight;
-
-    /**
-     * 閽㈠寲鏄惁鎺ュ彈妯斁
-     */
-    private Integer ishorizontal;
-
-    /**
-     * 鍘熺墖椤哄簭
-     */
-    private Integer patternSequence;
-
-    /**
-     * 閽㈠寲鐗堝浘id
-     */
-    private Integer temperingLayoutId;
-
-    /**
-     * 閽㈠寲鐗堝浘鐗囧簭
-     */
-    private Integer temperingFeedSequence;
-
-    /**
-     * x鍧愭爣
-     */
-    private Integer xCoordinate;
-
-    /**
-     * y鍧愭爣
-     */
-    private Integer yCoordinate;
-
-    /**
-     * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
-     */
-    private Integer angle;
-
-    /**
-     * 宸ョ▼鍙�
-     */
-    private Long engineerId;
-
-    /**
-     * 鐢熶骇瑙勫垯id
-     */
-    private Integer ruleId;
-
-
-}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
deleted file mode 100644
index 56172d8..0000000
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package com.mes.glassinfo.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.io.Serializable;
-
-/**
- * <p>
- *
- * </p>
- *
- * @author zhoush
- * @since 2024-03-27
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class GlassInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 鐜荤拑淇℃伅琛╥d
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 娴佺▼鍗�
-     */
-    @TableField("flow_card_Id")
-    private String flowCardId;
-
-    /**
-     * 娴佺▼鍗$幓鐠冪被鍨�
-     */
-    private Integer glassType;
-
-    /**
-     * 瀹�
-     */
-    private Double width;
-
-    /**
-     * 楂�
-     */
-    private Double height;
-
-    /**
-     * 鍘氬害
-     */
-    private Double thickness;
-
-    /**
-     * 鑶滅郴
-     */
-    private String filmsid;
-
-    /**
-     * 纾ㄥ墠瀹�
-     */
-    private Double edgWidth;
-
-    /**
-     * 纾ㄥ墠楂�
-     */
-    private Double edgHeight;
-
-    /**
-     * 鏄惁閰嶇墖
-     */
-    private Integer ismultiple;
-
-    /**
-     * 閰嶇墖鏈�澶у
-     */
-    private Double maxWidth;
-
-    /**
-     * 閰嶇墖鏈�澶ч珮
-     */
-    private Double maxHeight;
-
-    /**
-     * 閽㈠寲鏄惁鎺ュ彈妯斁
-     */
-    private Integer ishorizontal;
-
-    /**
-     * 鍘熺墖椤哄簭
-     */
-    private Integer patternSequence;
-
-    /**
-     * 閽㈠寲鐗堝浘id
-     */
-    private Integer temperingLayoutId;
-
-    /**
-     * 閽㈠寲鐗堝浘鐗囧簭
-     */
-    private Integer temperingFeedSequence;
-
-    /**
-     * x鍧愭爣
-     */
-    private Integer xCoordinate;
-
-    /**
-     * y鍧愭爣
-     */
-    private Integer yCoordinate;
-
-    /**
-     * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
-     */
-    private Integer angle;
-
-    /**
-     * 宸ョ▼鍙�
-     */
-    private String engineerId;
-
-    /**
-     * 鐢熶骇瑙勫垯id
-     */
-    private Integer ruleId;
-    /**
-     * 鐜荤拑id
-     */
-    private String glassId;
-}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/tools/WebSocketConfig.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/tools/WebSocketConfig.java
deleted file mode 100644
index 56fb341..0000000
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/tools/WebSocketConfig.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.mes.tools;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.socket.server.standard.ServerEndpointExporter;
-
-@Configuration
-public class WebSocketConfig {
-    
-
-     @Bean
-    public ServerEndpointExporter serverEndpointExporter() {
-        return new ServerEndpointExporter();
-    }
-
-}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/tools/WebSocketServer.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/tools/WebSocketServer.java
deleted file mode 100644
index b10efb4..0000000
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/tools/WebSocketServer.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package com.mes.tools;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.websocket.OnClose;
-import javax.websocket.OnError;
-import javax.websocket.OnMessage;
-import javax.websocket.OnOpen;
-import javax.websocket.Session;
-import javax.websocket.server.PathParam;
-import javax.websocket.server.ServerEndpoint;
-
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-
-@ServerEndpoint(value = "/api/talk/{username}")
-@Component
-public class WebSocketServer {
-
-    // @Autowired
-    // HomeMapper homeMapper;
-
-    static ConfigurableApplicationContext applicationContext;
-
-    // 瑙e喅鏃犳硶娉ㄥ叆mapper闂 //浣跨敤鏂规硶
-    // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class);
-    public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) {
-        WebSocketServer.applicationContext = configurableApplicationContext;
-    }
-
-    private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class);
-    private List<String> messages;
-    /**
-     * 璁板綍褰撳墠鍦ㄧ嚎杩炴帴鏁�
-     */
-    public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>();
-
-    String username;
-    public Session session;
-
-    public WebSocketServer() {
-        this.messages = new ArrayList<>();
-    }
-
-    /**
-     * 杩炴帴寤虹珛鎴愬姛璋冪敤鐨勬柟娉�
-     */
-    @OnOpen
-    public void onOpen(Session session, @PathParam("username") String username) {
-        this.username = username;
-        this.session = session;
-        List<WebSocketServer> webSocketServers = sessionMap.get(username);
-        if (webSocketServers == null) {
-            ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>();
-            arrayListwebserver.add(this);
-            sessionMap.put(username, arrayListwebserver);
-        } else {
-            webSocketServers.add(this);
-            // Short i=0;
-            // for (WebSocketServer webSocketServer : webSocketServers) {
-            //     if(webSocketServer==this){
-            //         i++;
-            //     }
-            // }
-            // if(i==0){
-            //     webSocketServers.add(this);
-            // }
-        }
-
-        log.info("鏈夋柊鐢ㄦ埛鍔犲叆锛寀sername={}, 褰撳墠鍦ㄧ嚎浜烘暟涓猴細{}", username, sessionMap.get(username).size());
-
-        // JSONObject result = new JSONObject();
-        // JSONArray array = new JSONArray();
-        // result.set("users", array);
-        // for (Object key : sessionMap.keySet()) {
-        // JSONObject jsonObject = new JSONObject();
-        // jsonObject.set("username", key);
-        // array.add(jsonObject);
-        // }
-
-        // sendAllMessage(JSONUtil.toJsonStr(result)); // 鍚庡彴鍙戦�佹秷鎭粰鎵�鏈夌殑瀹㈡埛绔�
-    }
-
-    /**
-     * 杩炴帴鍏抽棴璋冪敤鐨勬柟娉�
-     */
-    @OnClose
-    public void onClose(Session session, @PathParam("username") String username) {
-        List<WebSocketServer> webSocketServers = sessionMap.get(username);
-        ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>();
-        if (webSocketServers.size()>1) {
-            for (WebSocketServer webSocketServer : webSocketServers) {
-                if(webSocketServer!=this){
-                    arrayListwebserver.add(webSocketServer);
-                }
-            }
-            sessionMap.put(username, arrayListwebserver);
-            log.info("绉婚櫎username={}涓�鍚嶇敤鎴穝ession, {}鐨勫綋鍓嶅湪绾夸汉鏁颁负锛歿}", username, username, sessionMap.get(username).size());
-        }else{
-            sessionMap.remove(username);
-            log.info("绉婚櫎username={}涓�鍚嶇敤鎴穝ession, {}杩炴帴鍏抽棴, 褰撳墠杩炴帴鏁颁负锛歿}", username, username, sessionMap.size());
-        }
-
-    }
-
-    /**
-     * 鏀跺埌瀹㈡埛绔秷鎭悗璋冪敤鐨勬柟娉�
-     * 鍚庡彴鏀跺埌瀹㈡埛绔彂閫佽繃鏉ョ殑娑堟伅
-     * onMessage 鏄竴涓秷鎭殑涓浆绔�
-     * 鎺ュ彈 娴忚鍣ㄧ socket.send 鍙戦�佽繃鏉ョ殑 json鏁版嵁
-     *
-     * @param message 瀹㈡埛绔彂閫佽繃鏉ョ殑娑堟伅
-     */
-    @OnMessage
-    public void onMessage(String message, Session session, @PathParam("username") String username) {
-        log.info("鏈嶅姟绔敹鍒扮敤鎴穟sername={}鐨勬秷鎭�:{}", username, message);
-        JSONObject obj = JSONUtil.parseObj(message);
-        String text = obj.getStr("data");
-
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.set("message", text);
-        this.messages.add(text);
-        this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject)
-
-    }
-
-    @OnError
-    public void onError(Session session, Throwable error) {
-        log.error("鍙戠敓閿欒");
-        error.printStackTrace();
-    }
-
-    /**
-     * 鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔�
-     */
-    public void sendMessage(String message) {
-        try {
-            // log.info("鏈嶅姟绔粰瀹㈡埛绔痆{}]鍙戦�佹秷鎭瘂}", this.session.getId(), message);
-            this.session.getBasicRemote().sendText(message);
-        } catch (Exception e) {
-            log.error("鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔け璐�", e);
-        }
-    }
-
-    // /**
-    //  * 鏈嶅姟绔彂閫佹秷鎭粰鎵�鏈夊鎴风
-    //  */
-    // public void sendAllMessage(String message) {
-    //     try {
-    //         for (WebSocketServer webSocketServer : sessionMap.values()) {
-    //             // log.info("鏈嶅姟绔粰瀹㈡埛绔痆{}]鍙戦�佹秷鎭瘂}", this.session.getId(), message);
-    //             webSocketServer.sendMessage(message);
-    //         }
-    //     } catch (Exception e) {
-    //         log.error("鏈嶅姟绔彂閫佹秷鎭粰瀹㈡埛绔け璐�", e);
-    //     }
-    // }
-
-    public List<String> getMessages() {
-        return messages;
-
-    }
-
-    public void clearMessages() {
-        messages.clear();
-    }
-}

--
Gitblit v1.8.0