From 78b52c20a27a02466c8af9c0c8222b9f2f3ff20c Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期四, 18 一月 2024 19:59:47 +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..6e4ccff 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