From 931fce743a01a00ee5309215048cca5ee7ae083d Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期二, 16 四月 2024 11:30:01 +0800
Subject: [PATCH] 增加Swagger注解

---
 hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/UnLoadGlassApplication.java |    4 ++++
 UI-Project/config.js                                                                                |    4 ++--
 /dev/null                                                                                           |   36 ------------------------------------
 UI-Project/vite.config.js                                                                           |    2 +-
 4 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/UI-Project/config.js b/UI-Project/config.js
index 6f46c06..c067b2e 100644
--- a/UI-Project/config.js
+++ b/UI-Project/config.js
@@ -1,5 +1,5 @@
 export default {
-  serverUrl: "localhost:8083",
-  serverUrl2: "localhost:8081/mesModuleTools"
+  serverUrl: "localhost:8085",
+  serverUrl2: "localhost:8085/mesModuleTools"
   //serverUrl:"res.abeim.cn"
 }
\ No newline at end of file
diff --git a/UI-Project/vite.config.js b/UI-Project/vite.config.js
index dc9359d..c0255a0 100644
--- a/UI-Project/vite.config.js
+++ b/UI-Project/vite.config.js
@@ -27,7 +27,7 @@
         rewrite: (path) => path.replace(/^\/api/, '/'),
       },
       '/api2': {
-        target: 'http://localhost:8081/mesModuleTools',
+        target: 'http://localhost:8085/mesModuleTools',
         changeOrigin: true,
         pathRewrite: {
           '^/api2': '',
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/InitUtil.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/InitUtil.java
deleted file mode 100644
index d15c72d..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/InitUtil.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.mes.common;
-
-import cn.hutool.json.JSONArray;
-import cn.hutool.json.JSONObject;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.List;
-
-public class InitUtil {
-    //鍒濆鍖杦ord
-    public static PlcParameterObject initword(String jsonFilePath) {
-        try {
-            FileReader fileReader = new FileReader(jsonFilePath);
-            BufferedReader bufferedReader = new BufferedReader(fileReader);
-
-            StringBuilder content = new StringBuilder();
-            String line;
-
-            while ((line = bufferedReader.readLine()) != null) {
-                content.append(line);
-            }
-
-            bufferedReader.close();
-            fileReader.close();
-
-            JSONObject jsonfileobj = new JSONObject(content.toString());
-            JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor");
-            PlcParameterObject plcParameterObject = new PlcParameterObject();
-            plcParameterObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//璁剧疆璧峰浣嶅湴鍧�
-            plcParameterObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//璁剧疆鍦板潃闀垮害
-
-            for (int i = 0; i < jsonArray.size(); i++) {
-                JSONObject parameterObj = jsonArray.getJSONObject(i);
-                PlcParameterInfo plcParameterInfo = new PlcParameterInfo(jsonfileobj.getStr("plcAddressBegin")); //鍙傛暟瀹炰緥
-                String codeid = parameterObj.getStr("codeId");
-                plcParameterInfo.setCodeId(codeid);
-                plcParameterInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex")));
-                //plcParameterInfo.setRatio(Integer.valueOf(parameterObj.getStr("ratio")));
-                plcParameterInfo.setAddressLength(Integer.valueOf(parameterObj.getStr("addressLenght")));
-                plcParameterInfo.setUnit(parameterObj.getStr("unit"));
-                plcParameterObject.addPlcParameter(plcParameterInfo);
-            }
-           // byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02};
-           // byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
-           // plcParameterObject.setPlcParameterList(getplcvlues);
-
-            return plcParameterObject;
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    //鍒濆鍖朾it
-    public static PlcBitObject initbit(String jsonFilePath) {
-        PlcBitObject plcBitObject = new PlcBitObject();
-
-        try {
-            FileReader fileReader = new FileReader(jsonFilePath);
-            BufferedReader bufferedReader = new BufferedReader(fileReader);
-
-            StringBuilder content = new StringBuilder();
-            String line;
-
-            while ((line = bufferedReader.readLine()) != null) {
-                content.append(line);
-            }
-
-            bufferedReader.close();
-            fileReader.close();
-
-            JSONObject jsonfileobj = new JSONObject(content.toString());
-            JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor");
-            plcBitObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//璁剧疆璧峰浣嶅湴鍧�
-            plcBitObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//璁剧疆鍦板潃闀垮害
-
-            for (int i = 0; i < jsonArray.size(); i++) {
-                JSONObject parameterObj = jsonArray.getJSONObject(i);
-
-                PlcBitInfo plcBitInfo = new PlcBitInfo(jsonfileobj.getStr("plcAddressBegin")); //鍙傛暟瀹炰緥
-                String codeid = parameterObj.getStr("codeId");
-                plcBitInfo.setCodeId(codeid);
-                plcBitInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex")));
-
-                plcBitObject.addPlcBit(plcBitInfo);
-            }
-            System.out.println("");
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-           //Boolean[] values1 = { false, true, true, true, false, false, true, false,
-          //  false, true ,true };
-   // List<Boolean> getplcvlues = new ArrayList<>(Arrays.asList(values1));
-
-//        List<Boolean> getplcvlues = S7control.getinstance().ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength());
-//        plcBitObject.setPlcBitList(getplcvlues);
-        return plcBitObject;
-    }
-
-//
-    public static void readAndUpdateBitValues(PlcBitObject plcBitObject) {
-
-//        Boolean[] values1 = { false, true, true, true, false, false, true, false,
-//          false, true ,true };
-//         List<Boolean> getplcvlues = new ArrayList<>(Arrays.asList(values1));
-        List<Boolean> getplcvlues = S7object.getinstance().plccontrol.ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength());
-        plcBitObject.setPlcBitList(getplcvlues);
-    }
-
-
-    public static void readAndUpdateWordValues(PlcParameterObject plcParameterObject) {
-
-        // byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02};
-        byte[] getplcvlues = S7object.getinstance().plccontrol.ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
-        plcParameterObject.setPlcParameterList(getplcvlues);
-    }
-
-
-
-}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PLCAutoMes.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PLCAutoMes.java
deleted file mode 100644
index 7429f4e..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PLCAutoMes.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.mes.common;
-
-
-import java.io.IOException;
-
-import static com.mes.common.InitUtil.readAndUpdateWordValues;
-
-public class PLCAutoMes extends Thread {
-
-    // // 鐢ㄤ簬瀛樺偍搴旂敤绋嬪簭鐨勯厤缃俊鎭�
-    // private Configuration config;
-    private static InitUtil initUtil;
-    // public static PlcParameterObject PlcMesObject;
-    // public static PlcParameterObject PlcReadObject;
-    // public static PlcParameterObject PlcframeObject;
-
-    // // 鍒涘缓涓�涓嚜瀹氫箟鐨� S7 鎺у埗鍣ㄦ秷鎭鐞嗗櫒瀵硅薄
-    // MessageHandler customS7Control = new MessageHandler();
-
-    // 鍗曚緥瀹炰緥
-    private static PLCAutoMes instance;
-    // private static String PlcMes = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath();
-    private static String PlcAlbania = PLCAutoMes.class.getResource("/JsonFile/PlcLoadGlass.json").getPath();
-    // private static String PlcRead = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath();
-    // private static String Plcframe = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath();
-    // private static String PlcParameter = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath();
-            
-    // private static String PlcSign = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath();
-            
-    // private static String PlcState = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath();
-            
-    // private static String PlcAlarm = PLCAutoMes.class.getResource("/JsonFile/PlcAlarm.json").getPath();
-    // private static String PlcTest = PLCAutoMes.class.getResource("/JsonFile/PlcTest.json").getPath();
-
-    // 璋冪敤initword鏂规硶
-
-    // public static PlcParameterObject plcParameterObject = initUtil.initword(PlcParameter);
-    // public static PlcBitObject plcPlcTest = initUtil.initbit(PlcTest);
-    // public static PlcBitObject  plcBitObject = initUtil.initbit(PlcSign);
-    // public static PlcParameterObject  plcStateObject= initUtil.initword(PlcState);
-    // public static PlcBitObject plcPlcAlarm = initUtil.initbit(PlcAlarm);
-    public static PlcParameterObject PlcMesObject = InitUtil.initword(PlcAlbania);
-    // public static PlcParameterObject PlcReadObject = initUtil.initword(PlcRead);
-    // public static PlcParameterObject PlcframeObject = initUtil.initword(Plcframe);
-  
-    // 绉佹湁鏋勯�犲嚱鏁�
-    public PLCAutoMes() throws IOException {
-        //config = new Configuration("config.properties");
-        initUtil = new InitUtil();
-    }
-
-    // 鑾峰彇鍗曚緥瀹炰緥
-    public static synchronized PLCAutoMes getInstance() throws IOException {
-        if (instance == null) {
-            instance = new PLCAutoMes();
-        }
-        return instance;
-    }
-
-    @Override
-    public void run() {
-        while (this != null) {
-            try {
-                Thread.sleep(100);
-
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-
-            // System.out.println(jsonFilePath);
-
-            //readAndUpdateWordValues(PlcReadObject);
-            readAndUpdateWordValues(PlcMesObject);
-            //readAndUpdateWordValues(PlcframeObject);
-            // readAndUpdateWordValues(PlcframeObject);
-
-            // readAndUpdateWordValues(plcStateObject);
-            // int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex();
-            // // System.out.println(index);
-            // PlcMesObject.getPlcParameter("AddStart").getAddress(index);
-            // // System.out.println(PlcMesObject.getPlcParameter("AddStart").getAddress(index));
-            // List<String> addresses = new ArrayList<>();
-            // addresses.add("FeedID");
-            // addresses.add("AddStart");
-            // // System.out.println(addresses);
-            // // System.out.println(PlcMesObject.getPlcParameterValues(addresses));
-            // List<String> addresses2 = new ArrayList<>();
-            // addresses2.add("FeedID");
-            // addresses2.add("FeedCarStatus");
-
-            //System.out.println(PlcReadObject.getPlcParameterValues(addresses2));
-
-        }
-    }
-}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitInfo.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitInfo.java
deleted file mode 100644
index 0c0f241..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitInfo.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.mes.common;
-
-
-
-public  class PlcBitInfo {
-
-        public PlcBitInfo(String startAddress) {
-            this.startAddress = startAddress;
-        }
-        private String startAddress;
-        // 鍙傛暟鏍囪瘑
-        private String codeId;
-
-        // 鍙傛暟鍚嶇О
-        private String name;
-
-        // 璇诲彇 鍙傛暟鍊�
-        private Boolean value;
-        // 鍙傛暟鍦板潃
-        private int addressIndex;
-
-        public String getCodeId() {
-            return this.codeId;
-        }
-
-        public void setCodeId(String codeId) {
-            this.codeId = codeId;
-        }
-
-        public String getName() {
-            return this.name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public Boolean getValue() {
-            return this.value;
-        }
-
-        public void setValue(Boolean value) {
-            this.value = value;
-        } 
-         
-
-        public int getAddressIndex() {
-            return this.addressIndex;
-        } 
-         /**
-     * 鑾峰彇鍦板潃
-     * 
-     * @param index 绱㈠紩鍦板潃
-     */
-        public String getAddress(int index) {
-            String[] stringdatas = this.startAddress.trim().split("\\.");
-            if (stringdatas.length < 2 )
-                return null;
-            int dbwindex = 0;
-            int bitindex = 0;
-             if (stringdatas.length == 3) {
-                dbwindex = Integer.parseInt(stringdatas[1]);
-                bitindex = Integer.parseInt(stringdatas[2]);
-            } else
-                return null; 
-              dbwindex+=index/8;
-              bitindex+=index%8;
-            return stringdatas[0]+"."+dbwindex+"."+bitindex;
-        }
-
-
-
-
-    public void setAddressIndex(int addressindex) {
-            this.addressIndex = addressindex;
-        } 
-    }
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitObject.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitObject.java
deleted file mode 100644
index e01cb3c..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitObject.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package com.mes.common;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-public class PlcBitObject {
-
-    // 璇ユā鍧楁暟鎹被鍨嬶紝鏁版嵁璧峰浣嶇疆
-    private String plcAddressBegin;
-    // 鏁版嵁鍦板潃闀垮害锛氱涓�鍙傛暟鍒版渶鍚庝竴涓弬鏁扮殑闀垮害
-    private int plcAddressLength;
-    private ArrayList<PlcBitInfo> plcBitList;
-
-    /**
-     * @return 鏁版嵁鍖哄紑濮嬪湴鍧�
-     */
-    public String getPlcAddressBegin() {
-        return plcAddressBegin;
-    }
-
-    /**
-     * @param plcAddressBegin 璁剧疆鏁版嵁鍖哄紑濮嬪湴鍧�
-     */
-    public void setPlcAddressBegin(String plcAddressBegin) {
-        this.plcAddressBegin = plcAddressBegin;
-    }
-
-    /**
-     * @return 鏁版嵁鍖� 璇诲彇鎵�鏈夋暟鎹墍闇�鐨勯暱搴︼紙浠yte绫诲瀷涓哄熀鍑嗭級
-     */
-    public int getPlcAddressLength() {
-        return plcAddressLength;
-    }
-
-    /**
-     * @return 璁剧疆锛氭暟鎹尯 璇诲彇鎵�鏈夋暟鎹墍闇�鐨勯暱搴︼紙浠yte绫诲瀷涓哄熀鍑嗭級
-     */
-    public void setPlcAddressLength(int plcAddressLength) {
-        this.plcAddressLength = plcAddressLength;
-    }
-
-    /**
-     * @return 鑾峰彇鍙傛暟瀹炰緥闆嗗悎
-     */
-    public ArrayList<PlcBitInfo> getBitList() {
-        return plcBitList;
-    }
-
-    /**
-     * 鏍规嵁鍙傛暟鏍囪瘑 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     * 
-     * @param codeid 鍙傛暟鏍囪瘑
-     * @return 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     */
-    public PlcBitInfo getPlcBit(String codeid) {
-        if (plcBitList != null) {
-            for (PlcBitInfo plcbitInfo : plcBitList) {
-                if (plcbitInfo.getCodeId().equals(codeid))
-                    return plcbitInfo;
-            }
-            return null;
-        } else
-            return null;
-    }
-
-    /**
-     * 鏍规嵁鍙傛暟鏍囪瘑 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     * 
-     * @param codeid 鍙傛暟鏍囪瘑
-     * @return 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     */
-    public List<Boolean> getPlcBitValues(List<String> codeids) {
-        List<Boolean> arrayList = new ArrayList<>();
-        if (plcBitList != null) {
-            Map<String, Boolean> resultMap = new LinkedHashMap<>(); // 浣跨敤 LinkedHashMap 淇濈暀鎻掑叆椤哄簭
-            for (PlcBitInfo plcBitInfo : plcBitList) {
-                if (codeids.contains(plcBitInfo.getCodeId().toString())) {
-                    resultMap.put(plcBitInfo.getCodeId().toString(), plcBitInfo.getValue());
-                }
-            }
-            for (String codeId : codeids) { // 鎸夌収浼犲叆鍙傛暟鐨勯『搴忛亶鍘�
-                Boolean value = resultMap.get(codeId);
-                if (value != null) {
-                    arrayList.add(value);
-                } else {
-                    arrayList.add(null); // 濡傛灉鎵句笉鍒板搴旂殑鍊硷紝娣诲姞 null
-                }
-            }
-        }
-        return arrayList;
-    }
-
-
-    public List<String> getAddressListByCodeId(List<String> codeIdList) {
-        List<String> addressList = new ArrayList<>();
-        for (String codeId : codeIdList) {
-            for (PlcBitInfo plcBitInfo : plcBitList) {
-                if (plcBitInfo.getCodeId().equals(codeId)) {
-                    int index = plcBitInfo.getAddressIndex();
-                    String address = plcBitInfo.getAddress(index);
-                    if (address != null) {
-                        addressList.add(address);
-                    }
-                }
-            }
-        }
-        return addressList;
-    }
-
-
-    /**
-     * 娣诲姞鍙傛暟瀹炰緥
-     * 
-     * @param param 鍙傛暟瀹炰緥
-     */
-    public void addPlcBit(PlcBitInfo param) {
-        if (plcBitList != null)
-            plcBitList.add(param);
-        else {
-            plcBitList = new ArrayList<PlcBitInfo>();
-            plcBitList.add(param);
-        }
-    }
-
-    /**
-     * 鏍规嵁PLC杩斿洖鐨勬暟鎹� 缁欏弬鏁板疄渚嬭祴鍊�
-     * 
-     * @param plcValueArray PLC璇诲彇鍥炴潵鐨刡yte绫诲瀷鏁版嵁闆嗗悎
-     */
-    public void setPlcBitList(List<Boolean> plcValueArray) {
-        if (plcBitList != null) {
-            for (PlcBitInfo plcbitInfo : plcBitList) {
-                plcbitInfo.setValue(plcValueArray.get(plcbitInfo.getAddressIndex()));
-            }
-        }
-    }
-   
-
-   
-}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterInfo.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterInfo.java
deleted file mode 100644
index 2ae2998..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterInfo.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package com.mes.common;
-public  class PlcParameterInfo {
-      public PlcParameterInfo(String startAddress) {
-        this.startAddress = startAddress;
-      } 
-        private String startAddress;
-        // 鍙傛暟鏍囪瘑
-        private String codeId;
-
-        // 鍙傛暟鍚嶇О
-        private String name;
-
-        // 璇诲彇 鍙傛暟鍊�
-        private String value;
-
-        // // 鍐欏叆 鍙傛暟鍊�
-        // private String writeValue;
-
-        // 鍙傛暟鍗曚綅
-        private String unit;
-
-        // 鍙傛暟鍊艰浆鎹㈢郴鏁�
-        private int ratio;
-
-        // 鍙傛暟鍦板潃
-        private int addressIndex;
-
-        // 鍙傛暟鍦板潃浣嶉暱搴�
-        private int addressLength;
-
-        public String getCodeId() {
-            return this.codeId;
-        }
-
-        public void setCodeId(String codeId) {
-            this.codeId = codeId;
-        }
-
-        public String getName() {
-            return this.name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public String getValue() {
-            return this.value;
-        }
-
-        public void setValue(String value) {
-            this.value = value;
-        }
-
-        // public String getWriteValue() {
-        //     return this.writeValue;
-        // }
-
-        // public void setWriteValue(String writeValue) {
-        //     this.writeValue = writeValue;
-        // }
-
-        public String getUnit() {
-            return this.unit;
-        }
-
-        public void setUnit(String unit) {
-            this.unit = unit;
-        }
-
-        public int getAddressIndex() {
-            return this.addressIndex;
-        }
-
-        public void setAddressIndex(int addressindex) {
-            this.addressIndex = addressindex;
-        }
-
-        public int getAddressLength() {
-            return this.addressLength;
-        }
-
-        public void setAddressLength(int addresslength) {
-            this.addressLength = addresslength;
-        }
-
-        public int getRatio() {
-            return this.ratio;
-        }
-
-        public void setRatio(int ratio) {
-            this.ratio = ratio;
-        }
-       
-
-           /**
-     * 鑾峰彇鍦板潃
-     * 
-     * @param index 绱㈠紩鍦板潃
-     */
-    public String getAddress(int index) {
-        String[] stringdatas = this.startAddress.trim().split("\\.");
-        int addressLength=this.addressLength;
-        if (addressLength < 2 ){
-            return null;
-        }
-
-        if (addressLength == 2 ) {
-            int wordindex = index;
-
-            return stringdatas[0] + "." + wordindex;
-        }
-        if (addressLength == 14 ) {
-            int wordindex = index;
-            //int newIndex = wordindex + 13;
-            return stringdatas[0] + "." + wordindex ;
-        }
-        return null;
-    }
-
-    public int getPlcAddress() {
-
-        return addressIndex;
-    }
-    public String getAddress() {
-       return getAddress(this.addressIndex);
-    }
-}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterObject.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterObject.java
deleted file mode 100644
index 26736c3..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterObject.java
+++ /dev/null
@@ -1,202 +0,0 @@
-package com.mes.common;
-
-import java.lang.reflect.Array;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-public class PlcParameterObject {
-
-    // 璇ユā鍧楁暟鎹被鍨嬶紝鏁版嵁璧峰浣嶇疆
-    private String plcAddressBegin;
-    // 鏁版嵁鍦板潃闀垮害锛氱涓�鍙傛暟鍒版渶鍚庝竴涓弬鏁扮殑闀垮害
-    private int plcAddressLength;
-    private ArrayList<PlcParameterInfo> plcParameterList;
-
-    /**
-     * @return 鏁版嵁鍖哄紑濮嬪湴鍧�
-     */
-    public String getPlcAddressBegin() {
-        return plcAddressBegin;
-    }
-
-    /**
-     * @param plcAddressBegin 璁剧疆鏁版嵁鍖哄紑濮嬪湴鍧�
-     */
-    public void setPlcAddressBegin(String plcAddressBegin) {
-        this.plcAddressBegin = plcAddressBegin;
-    }
-
-    /**
-     * @return 鏁版嵁鍖� 璇诲彇鎵�鏈夋暟鎹墍闇�鐨勯暱搴︼紙浠yte绫诲瀷涓哄熀鍑嗭級
-     */
-    public int getPlcAddressLength() {
-        return plcAddressLength;
-    }
-
-    /**
-     * @return 璁剧疆锛氭暟鎹尯 璇诲彇鎵�鏈夋暟鎹墍闇�鐨勯暱搴︼紙浠yte绫诲瀷涓哄熀鍑嗭級
-     */
-    public void setPlcAddressLength(int plcAddressLength) {
-        this.plcAddressLength = plcAddressLength;
-    }
-
-    /**
-     * @return 鑾峰彇鍙傛暟瀹炰緥闆嗗悎
-     */
-    public ArrayList<PlcParameterInfo> getPlcParameterList() {
-        return plcParameterList;
-    }
-
-    /**
-     * 鏍规嵁鍙傛暟鏍囪瘑 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     * 
-     * @param codeid 鍙傛暟鏍囪瘑
-     * @return 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     */
-    public PlcParameterInfo getPlcParameter(String codeid) {
-        if (plcParameterList != null) {
-            for (PlcParameterInfo plcParameterInfo : plcParameterList) {
-                if (plcParameterInfo.getCodeId().equals(codeid))
-                    return plcParameterInfo;
-            }
-            return null;
-        } else
-            return null;
-    }
-
-
-
-    /**
-     * 鏍规嵁鍙傛暟鏍囪瘑 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     * 
-     * @param codeids 鍙傛暟鏍囪瘑
-     * @return 鑾峰彇鏌愪釜鍙傛暟瀹炰緥
-     */
-    public List<String> getPlcParameterValues(List<String> codeids) {
-        List<String> arrayList = new ArrayList<>();
-        if (plcParameterList != null) {
-            Map<String, PlcParameterInfo> resultMap = new LinkedHashMap<>(); // 浣跨敤 LinkedHashMap 淇濈暀鎻掑叆椤哄簭
-            for (PlcParameterInfo plcParameterInfo : plcParameterList) {
-                if (codeids.contains(plcParameterInfo.getCodeId())) {
-                    resultMap.put(plcParameterInfo.getCodeId(), plcParameterInfo);
-                }
-            }
-            for (String codeId : codeids) { // 鎸夌収浼犲叆鍙傛暟鐨勯『搴忛亶鍘�
-                PlcParameterInfo plcParameterInfo = resultMap.get(codeId);
-                if (plcParameterInfo != null) {
-                    arrayList.add(plcParameterInfo.getValue());
-                } else {
-                    arrayList.add(null); // 濡傛灉鎵句笉鍒板搴旂殑鍊硷紝娣诲姞 null
-                }
-            }
-        }
-        return arrayList;
-    }
-
-
-    public List<String> getAddressListByCodeId(List<String> codeIdList) {
-        List<String> addressList = new ArrayList<>();
-        for (String codeId : codeIdList) {
-            for (PlcParameterInfo plcParameterInfo : plcParameterList) {
-                if (plcParameterInfo.getCodeId().equals(codeId)) {
-                    int index = plcParameterInfo.getAddressIndex();
-                    String address = plcParameterInfo.getAddress(index);
-                    if (address != null) {
-                        addressList.add(address);
-                    }
-                }
-            }
-        }
-        return addressList;
-    }
-
-
-
-
-
-
-    /**
-     * 娣诲姞鍙傛暟瀹炰緥
-     * 
-     * @param param 鍙傛暟瀹炰緥
-     */
-    public void addPlcParameter(PlcParameterInfo param) {
-        if (plcParameterList != null)
-            plcParameterList.add(param);
-        else {
-            plcParameterList = new ArrayList<PlcParameterInfo>();
-            plcParameterList.add(param);
-        }
-    }
-
-    /**
-     * 鏍规嵁PLC杩斿洖鐨勬暟鎹� 缁欏弬鏁板疄渚嬭祴鍊�
-     * 
-     * @param plcValueArray PLC璇诲彇鍥炴潵鐨刡yte绫诲瀷鏁版嵁闆嗗悎
-     */
-    public void setPlcParameterList(byte[] plcValueArray) {
-        if (plcParameterList != null) {
-          
-            for (PlcParameterInfo plcParameterInfo : plcParameterList) {
-               
-                byte[] valueList = new byte[plcParameterInfo.getAddressLength()];
-
-//                System.out.println(plcParameterInfo.getAddressLength());
-
-                for (int i = 0; i < plcParameterInfo.getAddressLength(); i++) {
-                    Array.setByte(valueList, i, plcValueArray[plcParameterInfo.getAddressIndex() + i]);
-
-                }
-                if (plcParameterInfo.getAddressLength()==2) { 
-                      plcParameterInfo.setValue(String.valueOf(byte2short(valueList)));
-                }
-                else if (plcParameterInfo.getAddressLength()==14) {
-                    plcParameterInfo.setValue((byteToHexString(valueList)));
-                }
-
-                else
-                {
-                    String valuestr = new String(valueList);
-                    plcParameterInfo.setValue(valuestr);
-                }
-            }
-        }
-    }
-     /**
-     * short绫诲瀷杞琤yte[]
-     * 
-     * @param s short绫诲瀷鍊�
-     */
-    public static byte[] short2byte(short s){
-        byte[] b = new byte[2]; 
-        for(int i = 0; i < 2; i++){
-            int offset = 16 - (i+1)*8; //鍥犱负byte鍗�4涓瓧鑺傦紝鎵�浠ヨ璁$畻鍋忕Щ閲�
-            b[i] = (byte)((s >> offset)&0xff); //鎶�16浣嶅垎涓�2涓�8浣嶈繘琛屽垎鍒瓨鍌�
-        }
-        return b;
-   }
-     /**
-     * byte[]绫诲瀷杞瑂hort
-     * 
-     * @param b byte[]绫诲瀷鍊�
-     */
-   public static short byte2short(byte[] b){
-       short l = 0;
-       for (int i = 0; i < 2; i++) {
-           l<<=8; //<<=鍜屾垜浠殑 +=鏄竴鏍风殑锛屾剰鎬濆氨鏄� l = l << 8 
-           l |= (b[i] & 0xff); //鍜屼笂闈篃鏄竴鏍风殑  l = l | (b[i]&0xff)
-       }
-       return l;
-   }
-
-    public static String byteToHexString(byte[] bytes) {
-
-        String str = new String(bytes, StandardCharsets.UTF_8);
-        return str;
-    }
-
-
-}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java
deleted file mode 100644
index 4111dfe..0000000
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.mes.common;
-
-import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
-import com.mes.tools.S7control;
-
-/**
- * @Author : zhoush
- * @Date: 2024/4/9 15:13
- * @Description:
- */
-public class S7object {
-    public S7control plccontrol; // PLC閫氳绫诲疄渚�
-    private EPlcType plcType = EPlcType.S1500; // 瑗块棬瀛怭LC绫诲瀷
-    private String ip = "192.168.10.1"; // plc ip鍦板潃
-    private int port = 102; // plc 绔彛鍙�
-
-    private static volatile S7object instance = null;
-
-    private S7object() {
-        if (plccontrol == null) {
-            plccontrol = new S7control(plcType, ip, port,0,0);
-        }
-    }
-
-    // 鍗曚緥妯″紡 鑾峰彇绫荤殑鍞竴瀹炰緥
-    public static S7object getinstance() {
-        if (instance == null) {
-            synchronized (S7object.class) {
-                if (instance == null) {
-                    instance = new S7object();
-                }
-            }
-        }
-        return instance;
-    }
-}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/UnLoadGlassApplication.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/UnLoadGlassApplication.java
index 47dc741..cd7139c 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/UnLoadGlassApplication.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/UnLoadGlassApplication.java
@@ -1,18 +1,22 @@
 package com.mes;
 
 import com.mes.tools.WebSocketServer;
+import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.context.ConfigurableApplicationContext;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
 /**
  * @Author : zhoush
  * @Date: 2024/4/7 14:36RRRR
  * @Description:
  */
+@Slf4j
 @SpringBootApplication
+@EnableSwagger2
 @EnableDiscoveryClient
 @MapperScan(basePackages = "com.mes.*.mapper")
 public class UnLoadGlassApplication {

--
Gitblit v1.8.0