From c411387fa86ad7fd247a768c259b8f21caa70a8c Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期六, 02 一月 2021 15:30:35 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/model/LocTypeDto.java | 27 ++++----------------------- 1 files changed, 4 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..b6343ba 100644 --- a/src/main/java/com/zy/common/model/LocTypeDto.java +++ b/src/main/java/com/zy/common/model/LocTypeDto.java @@ -1,7 +1,7 @@ package com.zy.common.model; import com.core.exception.CoolException; -import com.zy.core.model.protocol.StaProtocol; +import com.zy.asrs.entity.BasDevp; import lombok.Data; /** @@ -19,34 +19,15 @@ // 杞婚噸绫诲瀷{0:鏈煡,1:杞诲簱浣�,2:閲嶅簱浣峿 private Short locType3; - 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; // 楂樺簱浣� } - } - - /** - * 搴撲綅绫诲瀷瑙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; } } -- Gitblit v1.9.1