Browse Source

fix:修改模型向量数据属性类型后部分字段为空的问题

zhongwei
luyie 2 months ago
parent
commit
fd5953bf37
  1. 54
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/vo/DeviceModelData.java

54
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.ModelAttrVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
/** /**
@ -12,6 +15,9 @@ import org.springblade.core.tool.utils.Func;
* @Date: 2024/9/19 7:55 * @Date: 2024/9/19 7:55
*/ */
@Data @Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DeviceModelData { public class DeviceModelData {
/** /**
* 模型id * 模型id
@ -157,20 +163,50 @@ public class DeviceModelData {
private String type; private String type;
public static DeviceModelData of(ModelAttrVO data) { public static DeviceModelData of(ModelAttrVO data) {
DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class); return DeviceModelData.builder()
deviceModelData.setType("0"); .modelId(data.getModelId().toString())
return deviceModelData; .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) { public static DeviceModelData of(ModelFuncVO data) {
DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class); return DeviceModelData.builder()
deviceModelData.setType("1"); .modelId(data.getModelId().toString())
return deviceModelData; .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) { public static DeviceModelData of(ModelEventVO data) {
DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class); return DeviceModelData.builder()
deviceModelData.setType("2"); .modelId(data.getModelId().toString())
return deviceModelData; .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();
} }
} }

Loading…
Cancel
Save