diff --git a/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java b/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java index 055e88a..2b4c298 100644 --- a/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java +++ b/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java @@ -28,6 +28,7 @@ WaterQualityData("WaterQualityData", "水质站实时监测数据"), SurgeTankData("SurgeTankData", "调蓄池监测数据"), DiverterWellData("DiverterWellData", "分流井监测数据"), + StSlwtRData("StSlwtRData","其他水体监测数据"), ; private String code; private String remark; @@ -80,6 +81,8 @@ } else if (xfDataEnum == XfDataEnum.SurgeTankData) { List surgeTankDataList = JSONObject.parseArray(data, SurgeTankData.class); result = (List)surgeTankDataList.stream().map(SurgeTankDataDto::dataToDto).collect(Collectors.toList()); + }else if (xfDataEnum == XfDataEnum.StSlwtRData) { + result =(List) JSONObject.parseArray(data, MonitorOtherData.class); } return result; diff --git a/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java b/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java index 055e88a..2b4c298 100644 --- a/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java +++ b/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java @@ -28,6 +28,7 @@ WaterQualityData("WaterQualityData", "水质站实时监测数据"), SurgeTankData("SurgeTankData", "调蓄池监测数据"), DiverterWellData("DiverterWellData", "分流井监测数据"), + StSlwtRData("StSlwtRData","其他水体监测数据"), ; private String code; private String remark; @@ -80,6 +81,8 @@ } else if (xfDataEnum == XfDataEnum.SurgeTankData) { List surgeTankDataList = JSONObject.parseArray(data, SurgeTankData.class); result = (List)surgeTankDataList.stream().map(SurgeTankDataDto::dataToDto).collect(Collectors.toList()); + }else if (xfDataEnum == XfDataEnum.StSlwtRData) { + result =(List) JSONObject.parseArray(data, MonitorOtherData.class); } return result; diff --git a/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java b/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java index 6c5d47a..e446d2d 100644 --- a/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java +++ b/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java @@ -101,7 +101,9 @@ DTO = JSONObject.parseArray(data, MonitorSewageData.class); } else if (xfDataEnum == XfDataEnum.WaterQualityData) { DTO = JSONObject.parseArray(data, WaterQualityData.class); - } else if (xfDataEnum == XfDataEnum.SurgeTankData) { + } else if (xfDataEnum == XfDataEnum.StSlwtRData) { + DTO = JSONObject.parseArray(data, MonitorOtherData.class); + }else if (xfDataEnum == XfDataEnum.SurgeTankData) { List surgeTankDataList = JSONObject.parseArray(data, SurgeTankData.class); DTO = surgeTankDataList.stream().map(SurgeTankDataDto::dataToDto).collect(Collectors.toList()); } else if (xfDataEnum == XfDataEnum.DiverterWellData) { @@ -276,6 +278,9 @@ } else if (xfDataEnum == XfDataEnum.WaterQualityData) { WaterQualityData DTO = JSONObject.parseObject(data, WaterQualityData.class); model = RealTimeSerializer.xfObjectToRealMap(DTO); + } else if (xfDataEnum == XfDataEnum.StSlwtRData) { + MonitorOtherData DTO = JSONObject.parseObject(data, MonitorOtherData.class); + model = RealTimeSerializer.xfObjectToRealMap(DTO); } else if (xfDataEnum == XfDataEnum.SurgeTankData) { SurgeTankData surgeTankData = JSONObject.parseObject(data, SurgeTankData.class); model = RealTimeSerializer.xfObjectToRealMap(SurgeTankDataDto.dataToDto(surgeTankData)); diff --git a/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java b/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java index 055e88a..2b4c298 100644 --- a/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java +++ b/src/main/java/org/springnewfiber/dataadapter/xf/XfDataEnum.java @@ -28,6 +28,7 @@ WaterQualityData("WaterQualityData", "水质站实时监测数据"), SurgeTankData("SurgeTankData", "调蓄池监测数据"), DiverterWellData("DiverterWellData", "分流井监测数据"), + StSlwtRData("StSlwtRData","其他水体监测数据"), ; private String code; private String remark; @@ -80,6 +81,8 @@ } else if (xfDataEnum == XfDataEnum.SurgeTankData) { List surgeTankDataList = JSONObject.parseArray(data, SurgeTankData.class); result = (List)surgeTankDataList.stream().map(SurgeTankDataDto::dataToDto).collect(Collectors.toList()); + }else if (xfDataEnum == XfDataEnum.StSlwtRData) { + result =(List) JSONObject.parseArray(data, MonitorOtherData.class); } return result; diff --git a/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java b/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java index 6c5d47a..e446d2d 100644 --- a/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java +++ b/src/main/java/org/springnewfiber/dataadapter/xf/controller/MonitorDataController.java @@ -101,7 +101,9 @@ DTO = JSONObject.parseArray(data, MonitorSewageData.class); } else if (xfDataEnum == XfDataEnum.WaterQualityData) { DTO = JSONObject.parseArray(data, WaterQualityData.class); - } else if (xfDataEnum == XfDataEnum.SurgeTankData) { + } else if (xfDataEnum == XfDataEnum.StSlwtRData) { + DTO = JSONObject.parseArray(data, MonitorOtherData.class); + }else if (xfDataEnum == XfDataEnum.SurgeTankData) { List surgeTankDataList = JSONObject.parseArray(data, SurgeTankData.class); DTO = surgeTankDataList.stream().map(SurgeTankDataDto::dataToDto).collect(Collectors.toList()); } else if (xfDataEnum == XfDataEnum.DiverterWellData) { @@ -276,6 +278,9 @@ } else if (xfDataEnum == XfDataEnum.WaterQualityData) { WaterQualityData DTO = JSONObject.parseObject(data, WaterQualityData.class); model = RealTimeSerializer.xfObjectToRealMap(DTO); + } else if (xfDataEnum == XfDataEnum.StSlwtRData) { + MonitorOtherData DTO = JSONObject.parseObject(data, MonitorOtherData.class); + model = RealTimeSerializer.xfObjectToRealMap(DTO); } else if (xfDataEnum == XfDataEnum.SurgeTankData) { SurgeTankData surgeTankData = JSONObject.parseObject(data, SurgeTankData.class); model = RealTimeSerializer.xfObjectToRealMap(SurgeTankDataDto.dataToDto(surgeTankData)); diff --git a/src/main/java/org/springnewfiber/dataadapter/xf/entity/MonitorOtherData.java b/src/main/java/org/springnewfiber/dataadapter/xf/entity/MonitorOtherData.java new file mode 100644 index 0000000..6ef0a74 --- /dev/null +++ b/src/main/java/org/springnewfiber/dataadapter/xf/entity/MonitorOtherData.java @@ -0,0 +1,19 @@ +package org.springnewfiber.dataadapter.xf.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +/** + * @program: newfiber-data-adapter + * @description: 其他水体实时数据 + * @author: djt + * @create: 2022-06-14 16:11 + **/ +@Data +public class MonitorOtherData extends BaseXfInterfaceEntity{ + @JsonProperty(value = "z") + @ApiModelProperty(value = "水位") + private BigDecimal z; +}