From 437430655faafbedabd32e00871e7accea02fa42 Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期六, 18 十月 2025 09:12:06 +0800
Subject: [PATCH] 联调
---
src/main/java/com/zy/common/model/LocTypeDto.java | 38 +++++++++++++++-----------------------
1 files changed, 15 insertions(+), 23 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..8fc9892 100644
--- a/src/main/java/com/zy/common/model/LocTypeDto.java
+++ b/src/main/java/com/zy/common/model/LocTypeDto.java
@@ -1,16 +1,19 @@
package com.zy.common.model;
+import com.alibaba.fastjson.JSON;
import com.core.exception.CoolException;
-import com.zy.core.model.protocol.StaProtocol;
+import com.zy.asrs.entity.BasDevp;
import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
/**
* Created by vincent on 2020/10/19
*/
+@Slf4j
@Data
public class LocTypeDto {
- // 楂樹綆绫诲瀷{0:鏈煡,1:浣庡簱浣�,2:楂樺簱浣峿
+ // 楂樹綆绫诲瀷{0:鏈煡,1:浣庡簱浣�,5:楂樺簱浣�,2:涓簱浣�,6:瓒呴珮搴撲綅}
private Short locType1;
// 瀹界獎绫诲瀷{0:鏈煡,1:绐勫簱浣�,2:瀹藉簱浣峿
@@ -22,31 +25,20 @@
public LocTypeDto() {
}
- public LocTypeDto(StaProtocol staProtocol) {
- if (staProtocol.isHigh() == staProtocol.isLow()) {
+ public LocTypeDto(BasDevp basDevp) {
+ if (basDevp.getLocType1() == null || basDevp.getLocType1() == 0) {
throw new CoolException("plc楂樹綆妫�娴嬪紓甯�");
}
- if (staProtocol.isLow()) {
+ if (basDevp.getLocType1() == 1) {
this.locType1 = 1; // 浣庡簱浣�
- } else {
- this.locType1 = 2; // 楂樺簱浣�
+ } else if (basDevp.getLocType1() ==2){
+ this.locType1 = 2; // 涓簱浣�
+ } else if (basDevp.getLocType1() == 5){
+ this.locType1 = 5; // 楂樺簱浣�
+ }else if (basDevp.getLocType1() == 6){
+ this.locType1 = 6;//瓒呴珮搴撲綅
}
- }
-
- /**
- * 搴撲綅绫诲瀷瑙f瀽
- */
- 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); // 楂樺簱浣�
- }
- return dto;
+ log.info(JSON.toJSONString(this));
}
}
--
Gitblit v1.9.1