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(); } }