From fd5953bf3789d97f9cffe0055573d3ffc4e2cca9 Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 27 Sep 2024 14:56:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=90=91=E9=87=8F=E6=95=B0=E6=8D=AE=E5=B1=9E=E6=80=A7=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=90=8E=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gglm/bigmodel/business/vo/DeviceModelData.java | 54 ++++++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/vo/DeviceModelData.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/vo/DeviceModelData.java index 5593352..dc24aca 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/vo/DeviceModelData.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/vo/DeviceModelData.java @@ -4,7 +4,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import org.springblade.core.tool.utils.Func; /** @@ -12,6 +15,9 @@ import org.springblade.core.tool.utils.Func; * @Date: 2024/9/19 7:55 */ @Data +@Builder +@AllArgsConstructor +@NoArgsConstructor public class DeviceModelData { /** * 模型id @@ -157,20 +163,50 @@ public class DeviceModelData { private String type; public static DeviceModelData of(ModelAttrVO data) { - DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class); - deviceModelData.setType("0"); - return deviceModelData; + return DeviceModelData.builder() + .modelId(data.getModelId().toString()) + .name(data.getName()) + .signage(data.getSignage()) + .dbType(data.getDbType()) + .fieldLength(data.getFieldLength()) + .keepFigures(data.getKeepFigures().toString()) + .accessRules(data.getAccessRules().toString()) + .descs(data.getDescs()) + .modelClassifyId(data.getModelClassifyId().toString()) + .type("0").build(); } public static DeviceModelData of(ModelFuncVO data) { - DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class); - deviceModelData.setType("1"); - return deviceModelData; + return DeviceModelData.builder() + .modelId(data.getModelId().toString()) + .name(data.getName()) + .signage(data.getSignage()) + .parameterJson(data.getParameterJson()) + .controlStatus(data.getControlStatus().toString()) + .parameterTag(data.getParameterTag()) + .isPopup(data.getIsPopup().toString()) + .isCheck(data.getIsCheck().toString()) + .parameterSource(data.getParameterSource().toString()) + .sourceAttrSignage(data.getSourceAttrSignage()) + .controlParameter(data.getControlParameter().toString()) + .intervalLength(data.getIntervalLength().toString()) + .minValue(data.getMinValue().toString()) + .maxValue(data.getMaxValue().toString()) + .coefficient(data.getCoefficient().toString()) + .descs(data.getDescs()) + .type("1").build(); } public static DeviceModelData of(ModelEventVO data) { - DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class); - deviceModelData.setType("2"); - return deviceModelData; + return DeviceModelData.builder() + .modelId(data.getModelId().toString()) + .name(data.getName()) + .signage(data.getSignage()) + .modelClassifyId(data.getModelClassifyId().toString()) + .level(data.getLevel().toString()) + .duration(data.getDuration().toString()) + .descs(data.getDescs()) + .modelClassifyId(data.getModelClassifyId().toString()) + .type("2").build(); } }