监测数据为空不返回

This commit is contained in:
zy 2025-11-24 17:25:45 +08:00
parent 4702f39cd8
commit 19393e0825
2 changed files with 12 additions and 9 deletions

View File

@ -278,6 +278,9 @@ public class BigScreenController {
transdataSoil.setDataSoilDdl("0"); transdataSoil.setDataSoilDdl("0");
transdataSoil.setDataSoilDdl2("0"); transdataSoil.setDataSoilDdl2("0");
transdataSoil.setDataSoilDdl3("0"); transdataSoil.setDataSoilDdl3("0");
transdataSoil.setDataSoilPh("0");
transdataSoil.setDataSoilDo("0");
transdataSoil.setDataSoilNtu("0");
jsonObject.putAll(JSONObject.parseObject(JSON.toJSONString(transdataSoil))); jsonObject.putAll(JSONObject.parseObject(JSON.toJSONString(transdataSoil)));
} }
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备 }else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
@ -868,20 +871,20 @@ public class BigScreenController {
SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode()); SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode());
if(transdataSoil!=null) { if(transdataSoil!=null) {
transdataSoil.setStationName(survStationInfo.getStationName()); transdataSoil.setStationName(survStationInfo.getStationName());
returnSoilArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataSoil, SerializerFeature.WriteNullStringAsEmpty))); returnSoilArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataSoil, SerializerFeature.WriteMapNullValue)));
} }
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备 }else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
SurvTransdataAirVo transdataAir= transdataAirService.getNewestData(survDeviceDeploy.getDeployCode()); SurvTransdataAirVo transdataAir= transdataAirService.getNewestData(survDeviceDeploy.getDeployCode());
if(transdataAir!=null) { if(transdataAir!=null) {
transdataAir.setStationName(survStationInfo.getStationName()); transdataAir.setStationName(survStationInfo.getStationName());
returnAirArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataAir, SerializerFeature.WriteNullStringAsEmpty))); returnAirArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataAir, SerializerFeature.WriteMapNullValue)));
} }
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//水质设备 }else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//水质设备
SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode()); SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode());
if(transdataSoil!=null) { if(transdataSoil!=null) {
transdataSoil.setStationName(survStationInfo.getStationName()); transdataSoil.setStationName(survStationInfo.getStationName());
returnWaterArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataSoil, SerializerFeature.WriteNullStringAsEmpty))); returnWaterArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataSoil, SerializerFeature.WriteMapNullValue)));
} }
}else if(PollutionConstants.STINK.equals(survDeviceDeploy.getDeployType())) {//恶臭 }else if(PollutionConstants.STINK.equals(survDeviceDeploy.getDeployType())) {//恶臭
SurvTransdataStinkVo survTransdataAirVo = transdataVocsService.getNewestData(survDeviceDeploy.getDeployCode()); SurvTransdataStinkVo survTransdataAirVo = transdataVocsService.getNewestData(survDeviceDeploy.getDeployCode());

View File

@ -248,14 +248,14 @@ public class SurvStationInfoController {
//水实时 //水实时
if(orientList.size()>0) { if(orientList.size()>0) {
SurvTransdataOrientwaterVo survTransdataOrientwaterVo = orientwaterService.getNewestDataWithStation(orientList); SurvTransdataOrientwaterVo survTransdataOrientwaterVo = orientwaterService.getNewestDataWithStation(orientList);
jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataOrientwaterVo, SerializerFeature.WriteNullStringAsEmpty))); jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataOrientwaterVo, SerializerFeature.WriteMapNullValue)));
//计算历史数据量 //计算历史数据量
Integer dataCounts = hisdataOrientwaterService.getHisDataCount(orientList); Integer dataCounts = hisdataOrientwaterService.getHisDataCount(orientList);
finalDataCounts=finalDataCounts+dataCounts; finalDataCounts=finalDataCounts+dataCounts;
} }
if(liveList.size()>0) { if(liveList.size()>0) {
SurvTransdataLivestockwaterVo survTransdataLivestockwaterVo = livestockwaterService.getNewestDataWithStation(liveList); SurvTransdataLivestockwaterVo survTransdataLivestockwaterVo = livestockwaterService.getNewestDataWithStation(liveList);
jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataLivestockwaterVo, SerializerFeature.WriteNullStringAsEmpty))); jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataLivestockwaterVo, SerializerFeature.WriteMapNullValue)));
//计算历史数据量 //计算历史数据量
Integer dataCounts = hisdataLivestockwaterService.getHisDataCount(liveList); Integer dataCounts = hisdataLivestockwaterService.getHisDataCount(liveList);
finalDataCounts=finalDataCounts+dataCounts; finalDataCounts=finalDataCounts+dataCounts;
@ -263,7 +263,7 @@ public class SurvStationInfoController {
//气实时 //气实时
if(airList.size()>0) { if(airList.size()>0) {
SurvTransdataAirVo survTransdataAirVo=transdataAirService.getNewestDataWithStation(airList); SurvTransdataAirVo survTransdataAirVo=transdataAirService.getNewestDataWithStation(airList);
jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataAirVo, SerializerFeature.WriteNullStringAsEmpty))); jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataAirVo, SerializerFeature.WriteMapNullValue)));
//计算历史数据量 //计算历史数据量
Integer dataCounts = hisdataAirService.getHisDataCount(airList); Integer dataCounts = hisdataAirService.getHisDataCount(airList);
finalDataCounts=finalDataCounts+dataCounts; finalDataCounts=finalDataCounts+dataCounts;
@ -271,7 +271,7 @@ public class SurvStationInfoController {
//土壤实时 //土壤实时
if(soilList.size()>0){ if(soilList.size()>0){
SurvTransdataSoilVo survTransdataSoilVo = transdataSoilService.getNewestDataWithStation(soilList); SurvTransdataSoilVo survTransdataSoilVo = transdataSoilService.getNewestDataWithStation(soilList);
jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataSoilVo, SerializerFeature.WriteNullStringAsEmpty))); jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataSoilVo, SerializerFeature.WriteMapNullValue)));
//计算历史数据量 //计算历史数据量
Integer dataCounts = hisdataSoilService.getHisDataCount(soilList); Integer dataCounts = hisdataSoilService.getHisDataCount(soilList);
finalDataCounts=finalDataCounts+dataCounts; finalDataCounts=finalDataCounts+dataCounts;
@ -279,7 +279,7 @@ public class SurvStationInfoController {
//水质实时 //水质实时
if(waterList.size()>0){ if(waterList.size()>0){
SurvTransdataSoilVo survTransdataSoilVo = transdataSoilService.getNewestDataWithStation(waterList); SurvTransdataSoilVo survTransdataSoilVo = transdataSoilService.getNewestDataWithStation(waterList);
jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataSoilVo, SerializerFeature.WriteNullStringAsEmpty))); jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataSoilVo, SerializerFeature.WriteMapNullValue)));
//计算历史数据量 //计算历史数据量
Integer dataCounts = hisdataSoilService.getHisDataCount(waterList); Integer dataCounts = hisdataSoilService.getHisDataCount(waterList);
finalDataCounts=finalDataCounts+dataCounts; finalDataCounts=finalDataCounts+dataCounts;
@ -287,7 +287,7 @@ public class SurvStationInfoController {
//恶臭实时 //恶臭实时
if(stinkList.size()>0){ if(stinkList.size()>0){
SurvTransdataStinkVo survTransdataStinkVo = survTransdataVocsService.getNewestDataWithStation(stinkList); SurvTransdataStinkVo survTransdataStinkVo = survTransdataVocsService.getNewestDataWithStation(stinkList);
jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataStinkVo, SerializerFeature.WriteNullStringAsEmpty))); jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataStinkVo, SerializerFeature.WriteMapNullValue)));
//计算历史数据量 //计算历史数据量
Integer dataCounts = survHisdataVocsService.getHisDataCount(stinkList); Integer dataCounts = survHisdataVocsService.getHisDataCount(stinkList);
finalDataCounts=finalDataCounts+dataCounts; finalDataCounts=finalDataCounts+dataCounts;