From 26419bf11ec888de7af9141a0ac1874065775e61 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 04 十一月 2023 13:59:51 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/model/LocTypeDto.java | 24 ++++++++++--------------
1 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/zy/common/model/LocTypeDto.java b/src/main/java/com/zy/common/model/LocTypeDto.java
index ccd52fc..7dc5c7b 100644
--- a/src/main/java/com/zy/common/model/LocTypeDto.java
+++ b/src/main/java/com/zy/common/model/LocTypeDto.java
@@ -23,14 +23,10 @@
}
public LocTypeDto(StaProtocol staProtocol) {
- if (staProtocol.isHigh() == staProtocol.isLow()) {
+ if (staProtocol.getLocType1() == null || staProtocol.getLocType1() == 0) {
throw new CoolException("plc楂樹綆妫�娴嬪紓甯�");
}
- if (staProtocol.isLow()) {
- this.locType1 = 1; // 浣庡簱浣�
- } else {
- this.locType1 = 2; // 楂樺簱浣�
- }
+ this.locType1 = staProtocol.getLocType1();
}
/**
@@ -38,14 +34,14 @@
*/
public static LocTypeDto process(StaProtocol staProtocol) {
LocTypeDto dto = new LocTypeDto();
- if (staProtocol.isHigh() == staProtocol.isLow()) {
- throw new CoolException("plc楂樹綆妫�娴嬪紓甯�");
- }
- if (staProtocol.isLow()) {
- dto.setLocType1((short) 1); // 浣庡簱浣�
- } else {
- dto.setLocType1((short) 2); // 楂樺簱浣�
- }
+// if (staProtocol.isHigh() == staProtocol.isLow()) {
+// throw new CoolException("plc楂樹綆妫�娴嬪紓甯�");
+// }
+// if (staProtocol.isLow()) {
+// dto.setLocType1((short) 1); // 浣庡簱浣�
+// } else {
+// dto.setLocType1((short) 2); // 楂樺簱浣�
+// }
return dto;
}
--
Gitblit v1.9.1