From f778d39fbbb49efe4dd0aaa0b2f89ed7fa3d5ea6 Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期三, 02 八月 2023 15:37:05 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/model/LocTypeDto.java | 34 +++++++++++++++++++++++-----------
1 files changed, 23 insertions(+), 11 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..03a89cd 100644
--- a/src/main/java/com/zy/common/model/LocTypeDto.java
+++ b/src/main/java/com/zy/common/model/LocTypeDto.java
@@ -22,15 +22,27 @@
public LocTypeDto() {
}
+ public LocTypeDto(Short locType1, Short locType2, Short locType3) {
+ this.locType1 = locType1;
+ this.locType2 = locType2;
+ this.locType3 = locType3;
+ }
+
public LocTypeDto(StaProtocol staProtocol) {
- if (staProtocol.isHigh() == staProtocol.isLow()) {
+ if (staProtocol.isHigh() == staProtocol.isLow() == staProtocol.isMedium() == staProtocol.isMedium_high()) {
throw new CoolException("plc楂樹綆妫�娴嬪紓甯�");
}
if (staProtocol.isLow()) {
this.locType1 = 1; // 浣庡簱浣�
- } else {
- this.locType1 = 2; // 楂樺簱浣�
+ } else if (staProtocol.isHigh()){
+ this.locType1 = 2; // 涓簱浣�
+ } else if (staProtocol.isMedium()) {
+ this.locType1 = 3; // 涓珮搴撲綅
+ } else if (staProtocol.isMedium_high()) {
+ this.locType1 = 4; // 楂樺簱浣�
}
+
+
}
/**
@@ -38,14 +50,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