From d1fee2d2ac8f4bd510bf44f70aec743619712039 Mon Sep 17 00:00:00 2001 From: tqs <56479841@qq.com> Date: 星期六, 18 五月 2024 15:40:30 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/model/LocTypeDto.java | 31 +++++++++++++++++-------------- 1 files changed, 17 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..f6d344d 100644 --- a/src/main/java/com/zy/common/model/LocTypeDto.java +++ b/src/main/java/com/zy/common/model/LocTypeDto.java @@ -22,14 +22,17 @@ 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()) { - throw new CoolException("plc楂樹綆妫�娴嬪紓甯�"); - } - if (staProtocol.isLow()) { - this.locType1 = 1; // 浣庡簱浣� + if (staProtocol.isWeight()) { + this.locType1 = 1; // 閲嶈揣 } else { - this.locType1 = 2; // 楂樺簱浣� + this.locType1 = 2; // 杞昏揣 } } @@ -38,14 +41,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