From 6994981f40f1573f54de1a1e402a7743073cf38e Mon Sep 17 00:00:00 2001
From: fyxc <fyxc@qq.com>
Date: 星期四, 22 五月 2025 14:26:30 +0800
Subject: [PATCH] server commit file

---
 src/main/java/com/zy/common/model/LocTypeDto.java |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 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..6044c53 100644
--- a/src/main/java/com/zy/common/model/LocTypeDto.java
+++ b/src/main/java/com/zy/common/model/LocTypeDto.java
@@ -19,18 +19,30 @@
     // 杞婚噸绫诲瀷{0:鏈煡,1:杞诲簱浣�,2:閲嶅簱浣峿
     private Short locType3;
 
+    private Integer siteId;
+
     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()) {
+            this.locType1 = 2;
+        } else if (!staProtocol.isHigh() && staProtocol.isLow()) {
+            this.locType1 = 1;
+        } else {
             throw new CoolException("plc楂樹綆妫�娴嬪紓甯�");
         }
-        if (staProtocol.isLow()) {
-            this.locType1 = 1; // 浣庡簱浣�
-        } else {
-            this.locType1 = 2; // 楂樺簱浣�
-        }
+//        if (staProtocol.getSiteId() == 106 || staProtocol.getSiteId() == 159){
+//            this.locType1 = 2; // 楂樺簱浣�
+//        }else {
+//            this.locType1 = 1; // 浣庡簱浣�
+//        }
     }
 
     /**
@@ -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