From 5d6da5dd842088e148c9fd11db329fe75e4b4d12 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期日, 27 八月 2023 13:44:28 +0800
Subject: [PATCH] 优化Modbus-TCP命令发送
---
igds-core/src/main/java/com/ld/igds/constant/DepotStatus.java | 80 +++++++++++++++++++++++----------------
1 files changed, 47 insertions(+), 33 deletions(-)
diff --git a/igds-core/src/main/java/com/ld/igds/constant/DepotStatus.java b/igds-core/src/main/java/com/ld/igds/constant/DepotStatus.java
index 4beaac8..bb7f5cc 100644
--- a/igds-core/src/main/java/com/ld/igds/constant/DepotStatus.java
+++ b/igds-core/src/main/java/com/ld/igds/constant/DepotStatus.java
@@ -5,44 +5,58 @@
*/
public enum DepotStatus {
- STATUS_01("01", "绌轰粨"),
- STATUS_02("02", "婊′粨"),
- STATUS_03("03", "鍏ュ簱涓�"),
- STATUS_04("04", "鍑哄簱涓�"),
- STATUS_05("05", "姘旇皟涓�"),
- STATUS_06("06", "鐔忚捀涓�"),
- STATUS_07("07", "閫氶涓�"),
- STATUS_09("09", "娓╂帶涓�"),
- STATUS_08("08", "缁翠慨涓�");
+ STATUS_1("1", "绌轰粨"),
+ STATUS_2("2", "鍏ュ簱涓�"),
+ STATUS_3("3", "灏佷粨"),
+ STATUS_4("4", "鍑哄簱涓�"),
+ STATUS_31("31", "灏佷粨-姘旇皟涓�"),
+ STATUS_32("32", "灏佷粨-鐔忚捀涓�"),
+ STATUS_33("33", "灏佷粨-閫氶涓�"),
+ STATUS_34("34", "灏佷粨-娓╂帶涓�"),
+ STATUS_9("9", "鍏朵粬");
- private String code;
- private String msg;
+ private String code;
+ private String msg;
- DepotStatus(String code, String msg) {
- this.code = code;
- this.msg = msg;
- }
+ DepotStatus(String code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
- public String getCode() {
- return code;
- }
+ public String getCode() {
+ return code;
+ }
- public String getMsg() {
- return msg;
- }
+ public String getMsg() {
+ return msg;
+ }
- public static String getMsg(String code) {
- if(null == code) return null;
+ public static String getMsg(String code) {
+ if (null == code) return null;
- if(DepotStatus.STATUS_01.getCode().equals(code)) return DepotStatus.STATUS_01.getMsg();
- if(DepotStatus.STATUS_02.getCode().equals(code)) return DepotStatus.STATUS_02.getMsg();
- if(DepotStatus.STATUS_03.getCode().equals(code)) return DepotStatus.STATUS_03.getMsg();
- if(DepotStatus.STATUS_04.getCode().equals(code)) return DepotStatus.STATUS_04.getMsg();
- if(DepotStatus.STATUS_05.getCode().equals(code)) return DepotStatus.STATUS_05.getMsg();
- if(DepotStatus.STATUS_06.getCode().equals(code)) return DepotStatus.STATUS_06.getMsg();
- if(DepotStatus.STATUS_07.getCode().equals(code)) return DepotStatus.STATUS_07.getMsg();
- if(DepotStatus.STATUS_08.getCode().equals(code)) return DepotStatus.STATUS_08.getMsg();
- return code;
- }
+ if (DepotStatus.STATUS_1.getCode().equals(code)) return DepotStatus.STATUS_1.getMsg();
+ if (DepotStatus.STATUS_2.getCode().equals(code)) return DepotStatus.STATUS_2.getMsg();
+ if (DepotStatus.STATUS_3.getCode().equals(code)) return DepotStatus.STATUS_3.getMsg();
+ if (DepotStatus.STATUS_4.getCode().equals(code)) return DepotStatus.STATUS_4.getMsg();
+ if (DepotStatus.STATUS_31.getCode().equals(code)) return DepotStatus.STATUS_31.getMsg();
+ if (DepotStatus.STATUS_32.getCode().equals(code)) return DepotStatus.STATUS_32.getMsg();
+ if (DepotStatus.STATUS_33.getCode().equals(code)) return DepotStatus.STATUS_33.getMsg();
+ if (DepotStatus.STATUS_34.getCode().equals(code)) return DepotStatus.STATUS_34.getMsg();
+
+ return DepotStatus.STATUS_9.getMsg();
+ }
+
+
+ public static String getGBCode(String code) {
+ if (null == code) DepotStatus.STATUS_9.getCode();
+
+ if (DepotStatus.STATUS_31.equals(code)) return DepotStatus.STATUS_3.getCode();
+ if (DepotStatus.STATUS_32.equals(code)) return DepotStatus.STATUS_3.getCode();
+ if (DepotStatus.STATUS_33.equals(code)) return DepotStatus.STATUS_3.getCode();
+ if (DepotStatus.STATUS_34.equals(code)) return DepotStatus.STATUS_3.getCode();
+
+ return code;
+ }
+
}
--
Gitblit v1.9.3