From 352f73dcbf912a22b2c7c14dc73eebb2fdeef64f Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期六, 02 八月 2025 14:43:31 +0800
Subject: [PATCH] 1
---
src/main/java/com/zy/common/model/LocTypeDto.java | 46 ++++++++++++++++++++++++++++++++--------------
1 files changed, 32 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..f4dc19e 100644
--- a/src/main/java/com/zy/common/model/LocTypeDto.java
+++ b/src/main/java/com/zy/common/model/LocTypeDto.java
@@ -1,6 +1,5 @@
package com.zy.common.model;
-import com.core.exception.CoolException;
import com.zy.core.model.protocol.StaProtocol;
import lombok.Data;
@@ -22,15 +21,34 @@
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楂樹綆妫�娴嬪紓甯�");
- }
+// System.out.println("----------"+staProtocol.getSiteId()+"搴撲綅妫�娴嬪師濮嬫暟鎹负:"+staProtocol.isWeight()+"------------");
+// 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; // 楂樺簱浣�
}
+ if (staProtocol.isWeight() && staProtocol.getSiteId() == 204 || staProtocol.getSiteId() == 104) {
+ this.locType1 = 2;
+ } else {
+ this.locType1 = 1;
+ }
+// System.out.println("----------"+staProtocol.getSiteId()+"搴撲綅妫�娴嬪鐞嗕负鏁版嵁涓�:"+this.locType1+"------------");
+
}
/**
@@ -38,14 +56,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