增加水五常支持
This commit is contained in:
parent
c6d74e9dcd
commit
5367184917
|
|
@ -17,6 +17,7 @@ import org.jeecg.common.entity.*;
|
||||||
import org.jeecg.common.constant.enums.PollutionEnum;
|
import org.jeecg.common.constant.enums.PollutionEnum;
|
||||||
import org.jeecg.common.iot.common.VOSurvIntegrateOrientDetail;
|
import org.jeecg.common.iot.common.VOSurvIntegrateOrientDetail;
|
||||||
import org.jeecg.common.iot.common.VOSurvIntegrateResult;
|
import org.jeecg.common.iot.common.VOSurvIntegrateResult;
|
||||||
|
import org.jeecg.common.iot.common.VOTransData;
|
||||||
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
||||||
import org.jeecg.common.util.R;
|
import org.jeecg.common.util.R;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
|
@ -24,7 +25,9 @@ import org.jeecg.common.vo.*;
|
||||||
import org.jeecg.common.vo.statistic.ScreenIndexSummaryDetailVo;
|
import org.jeecg.common.vo.statistic.ScreenIndexSummaryDetailVo;
|
||||||
import org.jeecg.common.vo.statistic.ScreenSummaryVo;
|
import org.jeecg.common.vo.statistic.ScreenSummaryVo;
|
||||||
import org.jeecg.modules.appmana.service.*;
|
import org.jeecg.modules.appmana.service.*;
|
||||||
|
import org.jeecg.modules.appmana.service.impl.IotCommonP2ServiceImpl;
|
||||||
import org.jeecg.modules.appmana.service.impl.IotCommonServiceImpl;
|
import org.jeecg.modules.appmana.service.impl.IotCommonServiceImpl;
|
||||||
|
import org.jeecg.modules.appmana.utils.CommonUtils;
|
||||||
import org.jeecg.modules.appmana.utils.Iotutils;
|
import org.jeecg.modules.appmana.utils.Iotutils;
|
||||||
import org.jeecg.modules.appmana.utils.YSUtils;
|
import org.jeecg.modules.appmana.utils.YSUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -122,6 +125,10 @@ public class BigScreenController {
|
||||||
@Lazy
|
@Lazy
|
||||||
private IotCommonServiceImpl commonService;
|
private IotCommonServiceImpl commonService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private IotCommonP2ServiceImpl commonP2Service;
|
||||||
|
|
||||||
@ApiOperation("获取萤石云token")
|
@ApiOperation("获取萤石云token")
|
||||||
@PostMapping(value = "/getYsToken")
|
@PostMapping(value = "/getYsToken")
|
||||||
public Result getToken(){
|
public Result getToken(){
|
||||||
|
|
@ -256,7 +263,7 @@ public class BigScreenController {
|
||||||
List<SurvDeviceDeploy> remainList = new ArrayList<>();
|
List<SurvDeviceDeploy> remainList = new ArrayList<>();
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
||||||
deployList.add(survDeviceDeploy.getId());
|
deployList.add(survDeviceDeploy.getId());
|
||||||
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType()) || PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//土壤水质设备
|
||||||
SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode());
|
SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode());
|
||||||
if(transdataSoil!=null) {
|
if(transdataSoil!=null) {
|
||||||
jsonObject.putAll(JSONObject.parseObject(JSON.toJSONString(transdataSoil)));
|
jsonObject.putAll(JSONObject.parseObject(JSON.toJSONString(transdataSoil)));
|
||||||
|
|
@ -358,7 +365,7 @@ public class BigScreenController {
|
||||||
|
|
||||||
@PostMapping("/getNewestData")
|
@PostMapping("/getNewestData")
|
||||||
@ApiOperation("站点最新数据")
|
@ApiOperation("站点最新数据")
|
||||||
public Result getNewestData(@RequestParam(value = "stationCode",required = false)String stationCode){
|
public Result getNewestData(@RequestParam(value = "stationCode",required = false)String stationCode,@RequestParam(required = false) String dataMode){
|
||||||
|
|
||||||
List<SurvStationInfo> stationList = survStationInfoService.getAllStationAndDevice(stationCode,"","token");
|
List<SurvStationInfo> stationList = survStationInfoService.getAllStationAndDevice(stationCode,"","token");
|
||||||
//补充最新数据进入
|
//补充最新数据进入
|
||||||
|
|
@ -373,6 +380,7 @@ public class BigScreenController {
|
||||||
List<String> soilList = new ArrayList<>();
|
List<String> soilList = new ArrayList<>();
|
||||||
List<String> orientList = new ArrayList<>();
|
List<String> orientList = new ArrayList<>();
|
||||||
List<String> liveList = new ArrayList<>();
|
List<String> liveList = new ArrayList<>();
|
||||||
|
List<SurvDeviceDeploy> waterList = new ArrayList<>();
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
||||||
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
||||||
soilList.add(survDeviceDeploy.getDeployCode());
|
soilList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
|
@ -382,6 +390,8 @@ public class BigScreenController {
|
||||||
orientList.add(survDeviceDeploy.getDeployCode());
|
orientList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
||||||
liveList.add(survDeviceDeploy.getDeployCode());
|
liveList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())) {//水质
|
||||||
|
waterList.add(survDeviceDeploy);
|
||||||
}else if(PollutionConstants.CAMERA.equals(survDeviceDeploy.getDeployType())) {//摄像头
|
}else if(PollutionConstants.CAMERA.equals(survDeviceDeploy.getDeployType())) {//摄像头
|
||||||
//只保留摄像头的数据
|
//只保留摄像头的数据
|
||||||
// remainList.add(survDeviceDeploy);
|
// remainList.add(survDeviceDeploy);
|
||||||
|
|
@ -402,10 +412,15 @@ public class BigScreenController {
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }else
|
// }else
|
||||||
|
String dataTypes = "all";//全部数据=all,water=水质数据,orient=面源和畜禽
|
||||||
|
if(StringUtils.isNotBlank(dataMode)){
|
||||||
|
dataTypes = dataMode;
|
||||||
|
}
|
||||||
|
if(IotConstants.Data_Types_All.equals(dataMode) || IotConstants.Data_Types_Nsp.equals(dataMode)) {
|
||||||
|
|
||||||
if(orientList.size()>0){//面源
|
if (orientList.size() > 0) {//面源
|
||||||
SurvTransdataOrientwaterVo transdataOrientwaterVo=transdataOrientwaterService.getNewestDataWithStation(orientList);
|
SurvTransdataOrientwaterVo transdataOrientwaterVo = transdataOrientwaterService.getNewestDataWithStation(orientList);
|
||||||
if(transdataOrientwaterVo!=null) {
|
if (transdataOrientwaterVo != null) {
|
||||||
transdataOrientwaterVo.setStationName(survStationInfo.getStationName());
|
transdataOrientwaterVo.setStationName(survStationInfo.getStationName());
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -414,42 +429,42 @@ public class BigScreenController {
|
||||||
List<CommonDataTrans> noList = new ArrayList<>();
|
List<CommonDataTrans> noList = new ArrayList<>();
|
||||||
// for (SurvHisdataOrientwater survHisdataOrientwater : oriDataList) {
|
// for (SurvHisdataOrientwater survHisdataOrientwater : oriDataList) {
|
||||||
|
|
||||||
CommonDataTrans tpent = new CommonDataTrans();
|
CommonDataTrans tpent = new CommonDataTrans();
|
||||||
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
||||||
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
||||||
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
||||||
tpent.setStationName(survStationInfo.getStationName());
|
tpent.setStationName(survStationInfo.getStationName());
|
||||||
tpent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
tpent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||||
tpent.setStationType(survStationInfo.getStationType());
|
tpent.setStationType(survStationInfo.getStationType());
|
||||||
tpent.setStationCode(survStationInfo.getStationCode());
|
tpent.setStationCode(survStationInfo.getStationCode());
|
||||||
tpent.setSurvItem(PollutionEnum.dataWaterTp.getCode());
|
tpent.setSurvItem(PollutionEnum.dataWaterTp.getCode());
|
||||||
|
|
||||||
CommonDataTrans tnent = new CommonDataTrans();
|
CommonDataTrans tnent = new CommonDataTrans();
|
||||||
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
||||||
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
||||||
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
||||||
tnent.setStationName(survStationInfo.getStationName());
|
tnent.setStationName(survStationInfo.getStationName());
|
||||||
tnent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
tnent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||||
tnent.setStationType(survStationInfo.getStationType());
|
tnent.setStationType(survStationInfo.getStationType());
|
||||||
tnent.setStationCode(survStationInfo.getStationCode());
|
tnent.setStationCode(survStationInfo.getStationCode());
|
||||||
tnent.setSurvItem(PollutionEnum.dataWaterTn.getCode());
|
tnent.setSurvItem(PollutionEnum.dataWaterTn.getCode());
|
||||||
|
|
||||||
CommonDataTrans noent = new CommonDataTrans();
|
CommonDataTrans noent = new CommonDataTrans();
|
||||||
noent.setName(PollutionEnum.dataWaterNo.getDescription());
|
noent.setName(PollutionEnum.dataWaterNo.getDescription());
|
||||||
noent.setUnit(PollutionEnum.dataWaterNo.getUnit());
|
noent.setUnit(PollutionEnum.dataWaterNo.getUnit());
|
||||||
noent.setColor(PollutionEnum.dataWaterNo.getColor());
|
noent.setColor(PollutionEnum.dataWaterNo.getColor());
|
||||||
noent.setStationName(survStationInfo.getStationName());
|
noent.setStationName(survStationInfo.getStationName());
|
||||||
noent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
noent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||||
noent.setStationType(survStationInfo.getStationType());
|
noent.setStationType(survStationInfo.getStationType());
|
||||||
noent.setStationCode(survStationInfo.getStationCode());
|
noent.setStationCode(survStationInfo.getStationCode());
|
||||||
noent.setSurvItem(PollutionEnum.dataWaterNo.getCode());
|
noent.setSurvItem(PollutionEnum.dataWaterNo.getCode());
|
||||||
|
|
||||||
tpent.setValue(transdataOrientwaterVo.getDataWaterTp());
|
tpent.setValue(transdataOrientwaterVo.getDataWaterTp());
|
||||||
tnent.setValue(transdataOrientwaterVo.getDataWaterTn());
|
tnent.setValue(transdataOrientwaterVo.getDataWaterTn());
|
||||||
noent.setValue(transdataOrientwaterVo.getDataWaterNo());
|
noent.setValue(transdataOrientwaterVo.getDataWaterNo());
|
||||||
tpList.add(tpent);
|
tpList.add(tpent);
|
||||||
tnList.add(tnent);
|
tnList.add(tnent);
|
||||||
noList.add(noent);
|
noList.add(noent);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
listFinal.addAll(tnList);
|
listFinal.addAll(tnList);
|
||||||
|
|
@ -459,73 +474,84 @@ public class BigScreenController {
|
||||||
|
|
||||||
// returnArrs.add(JSONObject.parseObject(JSON.toJSONString(transdataOrientwaterVo)));
|
// returnArrs.add(JSONObject.parseObject(JSON.toJSONString(transdataOrientwaterVo)));
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
jsonObject.put("HisSurvData",new ArrayList<>());
|
jsonObject.put("HisSurvData", new ArrayList<>());
|
||||||
}
|
}
|
||||||
if(liveList.size()>0){//畜禽
|
if (liveList.size() > 0) {//畜禽
|
||||||
SurvTransdataLivestockwaterVo transdataLivestockwaterVo=transdataLivestockwaterService.getNewestDataWithStation(liveList);
|
SurvTransdataLivestockwaterVo transdataLivestockwaterVo = transdataLivestockwaterService.getNewestDataWithStation(liveList);
|
||||||
if(transdataLivestockwaterVo!=null) {
|
if (transdataLivestockwaterVo != null) {
|
||||||
List<CommonDataTrans> tpList = new ArrayList<>();
|
List<CommonDataTrans> tpList = new ArrayList<>();
|
||||||
List<CommonDataTrans> tnList = new ArrayList<>();
|
List<CommonDataTrans> tnList = new ArrayList<>();
|
||||||
List<CommonDataTrans> nhList = new ArrayList<>();
|
List<CommonDataTrans> nhList = new ArrayList<>();
|
||||||
List<CommonDataTrans> codList = new ArrayList<>();
|
List<CommonDataTrans> codList = new ArrayList<>();
|
||||||
// for (SurvHisdataLivestockwater survHisdataLivestockwater : liveDataList) {
|
// for (SurvHisdataLivestockwater survHisdataLivestockwater : liveDataList) {
|
||||||
CommonDataTrans tpent = new CommonDataTrans();
|
CommonDataTrans tpent = new CommonDataTrans();
|
||||||
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
||||||
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
||||||
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
||||||
tpent.setStationName(survStationInfo.getStationName());
|
tpent.setStationName(survStationInfo.getStationName());
|
||||||
tpent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
tpent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
tpent.setStationType(survStationInfo.getStationType());
|
tpent.setStationType(survStationInfo.getStationType());
|
||||||
tpent.setStationCode(survStationInfo.getStationCode());
|
tpent.setStationCode(survStationInfo.getStationCode());
|
||||||
tpent.setSurvItem(PollutionEnum.dataWaterTp.getCode());
|
tpent.setSurvItem(PollutionEnum.dataWaterTp.getCode());
|
||||||
CommonDataTrans tnent = new CommonDataTrans();
|
CommonDataTrans tnent = new CommonDataTrans();
|
||||||
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
||||||
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
||||||
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
||||||
tnent.setStationName(survStationInfo.getStationName());
|
tnent.setStationName(survStationInfo.getStationName());
|
||||||
tnent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
tnent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
tnent.setStationType(survStationInfo.getStationType());
|
tnent.setStationType(survStationInfo.getStationType());
|
||||||
tnent.setStationCode(survStationInfo.getStationCode());
|
tnent.setStationCode(survStationInfo.getStationCode());
|
||||||
tnent.setSurvItem(PollutionEnum.dataWaterTn.getCode());
|
tnent.setSurvItem(PollutionEnum.dataWaterTn.getCode());
|
||||||
CommonDataTrans nhent = new CommonDataTrans();
|
CommonDataTrans nhent = new CommonDataTrans();
|
||||||
nhent.setName(PollutionEnum.dataWaterNh.getDescription());
|
nhent.setName(PollutionEnum.dataWaterNh.getDescription());
|
||||||
nhent.setUnit(PollutionEnum.dataWaterNh.getUnit());
|
nhent.setUnit(PollutionEnum.dataWaterNh.getUnit());
|
||||||
nhent.setColor(PollutionEnum.dataWaterNh.getColor());
|
nhent.setColor(PollutionEnum.dataWaterNh.getColor());
|
||||||
nhent.setStationName(survStationInfo.getStationName());
|
nhent.setStationName(survStationInfo.getStationName());
|
||||||
nhent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
nhent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
nhent.setStationType(survStationInfo.getStationType());
|
nhent.setStationType(survStationInfo.getStationType());
|
||||||
nhent.setStationCode(survStationInfo.getStationCode());
|
nhent.setStationCode(survStationInfo.getStationCode());
|
||||||
nhent.setSurvItem(PollutionEnum.dataWaterNh.getCode());
|
nhent.setSurvItem(PollutionEnum.dataWaterNh.getCode());
|
||||||
CommonDataTrans codent = new CommonDataTrans();
|
CommonDataTrans codent = new CommonDataTrans();
|
||||||
codent.setName(PollutionEnum.dataWaterCod.getDescription());
|
codent.setName(PollutionEnum.dataWaterCod.getDescription());
|
||||||
codent.setUnit(PollutionEnum.dataWaterCod.getUnit());
|
codent.setUnit(PollutionEnum.dataWaterCod.getUnit());
|
||||||
codent.setColor(PollutionEnum.dataWaterCod.getColor());
|
codent.setColor(PollutionEnum.dataWaterCod.getColor());
|
||||||
codent.setStationName(survStationInfo.getStationName());
|
codent.setStationName(survStationInfo.getStationName());
|
||||||
codent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
codent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
codent.setStationType(survStationInfo.getStationType());
|
codent.setStationType(survStationInfo.getStationType());
|
||||||
codent.setStationCode(survStationInfo.getStationCode());
|
codent.setStationCode(survStationInfo.getStationCode());
|
||||||
codent.setSurvItem(PollutionEnum.dataWaterCod.getCode());
|
codent.setSurvItem(PollutionEnum.dataWaterCod.getCode());
|
||||||
|
|
||||||
tpent.setValue(transdataLivestockwaterVo.getDataWaterTp());
|
tpent.setValue(transdataLivestockwaterVo.getDataWaterTp());
|
||||||
tnent.setValue(transdataLivestockwaterVo.getDataWaterTn());
|
tnent.setValue(transdataLivestockwaterVo.getDataWaterTn());
|
||||||
nhent.setValue(transdataLivestockwaterVo.getDataWaterNh());
|
nhent.setValue(transdataLivestockwaterVo.getDataWaterNh());
|
||||||
codent.setValue(transdataLivestockwaterVo.getDataWaterCod());
|
codent.setValue(transdataLivestockwaterVo.getDataWaterCod());
|
||||||
|
|
||||||
tpList.add(tpent);
|
tpList.add(tpent);
|
||||||
tnList.add(tnent);
|
tnList.add(tnent);
|
||||||
nhList.add(nhent);
|
nhList.add(nhent);
|
||||||
codList.add(codent);
|
codList.add(codent);
|
||||||
// }
|
// }
|
||||||
listFinal.addAll(tnList);
|
listFinal.addAll(tnList);
|
||||||
listFinal.addAll(tpList);
|
listFinal.addAll(tpList);
|
||||||
listFinal.addAll(nhList);
|
listFinal.addAll(nhList);
|
||||||
listFinal.addAll(codList);
|
listFinal.addAll(codList);
|
||||||
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
jsonObject.put("HisSurvData", new ArrayList<>());
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
jsonObject.put("HisSurvData", new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(IotConstants.Data_Types_All.equals(dataMode) || IotConstants.Data_Types_Water.equals(dataMode)) {
|
||||||
|
if (!waterList.isEmpty()) { //五常
|
||||||
|
List<CommonDataTrans> commonDataTrans = CommonUtils.transData(waterList.get(0), false, null, null, null, null).getTransData();
|
||||||
|
listFinal.addAll(commonDataTrans);
|
||||||
|
} else {
|
||||||
|
jsonObject.put("HisSurvData", new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//移除非摄像头设备
|
//移除非摄像头设备
|
||||||
// survStationInfo.getDeviceList().retainAll(remainList);
|
// survStationInfo.getDeviceList().retainAll(remainList);
|
||||||
}
|
}
|
||||||
|
|
@ -631,6 +657,7 @@ public class BigScreenController {
|
||||||
List<String> liveList = new ArrayList<>();
|
List<String> liveList = new ArrayList<>();
|
||||||
List<String> orientIdList = new ArrayList<>();
|
List<String> orientIdList = new ArrayList<>();
|
||||||
List<String> liveIdList = new ArrayList<>();
|
List<String> liveIdList = new ArrayList<>();
|
||||||
|
List<String> waterIdList = new ArrayList<>();
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
||||||
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
||||||
soilList.add(survDeviceDeploy.getDeployCode());
|
soilList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
|
@ -642,23 +669,20 @@ public class BigScreenController {
|
||||||
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
||||||
liveList.add(survDeviceDeploy.getDeployCode());
|
liveList.add(survDeviceDeploy.getDeployCode());
|
||||||
liveIdList.add(survDeviceDeploy.getId());
|
liveIdList.add(survDeviceDeploy.getId());
|
||||||
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())) {//水质
|
||||||
|
waterIdList.add(survDeviceDeploy.getId());
|
||||||
}else if(PollutionConstants.CAMERA.equals(survDeviceDeploy.getDeployType())) {//摄像头
|
}else if(PollutionConstants.CAMERA.equals(survDeviceDeploy.getDeployType())) {//摄像头
|
||||||
//只保留摄像头的数据
|
//只保留摄像头的数据
|
||||||
// remainList.add(survDeviceDeploy);
|
// remainList.add(survDeviceDeploy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// deviceMap.put(survStationInfo.getStationCode()+"_soil",soilList);
|
|
||||||
// deviceMap.put(survStationInfo.getStationCode()+"_air",airList);
|
|
||||||
// deviceMap.put(survStationInfo.getStationCode()+"_orient",orientList);
|
|
||||||
// deviceMap.put(survStationInfo.getStationCode()+"_live",liveList);
|
|
||||||
|
|
||||||
// if(soilList.size()>0){
|
//查询五常数据
|
||||||
// List<DataTrans> airSummry = hisdataSoilService.getMonthSummry(soilList);
|
log.warn("ccc======"+waterIdList.size());
|
||||||
// }
|
ScreenIndexSummaryDetailVo waterQuality = commonP2Service.processWaterQuality(screenSummaryVo,waterIdList,startTime,endTime);
|
||||||
// if(airList.size()>0){
|
|
||||||
// transdataAirService.getMonthSummry(airList);
|
|
||||||
// }
|
if(!orientList.isEmpty()){
|
||||||
if(orientList.size()>0){
|
|
||||||
|
|
||||||
List<Double> avgTN = new ArrayList<>();
|
List<Double> avgTN = new ArrayList<>();
|
||||||
List<Double> avgTP = new ArrayList<>();
|
List<Double> avgTP = new ArrayList<>();
|
||||||
|
|
@ -720,13 +744,17 @@ public class BigScreenController {
|
||||||
screenIndexSummaryDetailVo.setDatas(maps);
|
screenIndexSummaryDetailVo.setDatas(maps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//如果有五常数据同步加入
|
||||||
|
if(waterQuality!=null){
|
||||||
|
screenIndexSummaryDetailVo.getDatas().putAll(waterQuality.getDatas());
|
||||||
|
}
|
||||||
|
//设置站名等信息
|
||||||
screenIndexSummaryDetailVo.setGroupId(survStationInfo.getGroupId());
|
screenIndexSummaryDetailVo.setGroupId(survStationInfo.getGroupId());
|
||||||
screenIndexSummaryDetailVo.setGroupName(survStationInfo.getGroupName());
|
screenIndexSummaryDetailVo.setGroupName(survStationInfo.getGroupName());
|
||||||
screenIndexSummaryDetailVo.setStationName(survStationInfo.getStationName());
|
screenIndexSummaryDetailVo.setStationName(survStationInfo.getStationName());
|
||||||
results.add(screenIndexSummaryDetailVo);
|
results.add(screenIndexSummaryDetailVo);
|
||||||
}
|
}
|
||||||
if(liveList.size()>0) {
|
if(!liveList.isEmpty()) {
|
||||||
|
|
||||||
List<Double> avgTN = new ArrayList<>();
|
List<Double> avgTN = new ArrayList<>();
|
||||||
List<Double> avgTP = new ArrayList<>();
|
List<Double> avgTP = new ArrayList<>();
|
||||||
|
|
@ -790,7 +818,11 @@ public class BigScreenController {
|
||||||
screenIndexSummaryDetailVo.setDatas(maps);
|
screenIndexSummaryDetailVo.setDatas(maps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//如果有五常数据同步加入
|
||||||
|
if(waterQuality!=null){
|
||||||
|
screenIndexSummaryDetailVo.getDatas().putAll(waterQuality.getDatas());
|
||||||
|
}
|
||||||
|
//设置站名等信息
|
||||||
screenIndexSummaryDetailVo.setGroupId(survStationInfo.getGroupId());
|
screenIndexSummaryDetailVo.setGroupId(survStationInfo.getGroupId());
|
||||||
screenIndexSummaryDetailVo.setGroupName(survStationInfo.getGroupName());
|
screenIndexSummaryDetailVo.setGroupName(survStationInfo.getGroupName());
|
||||||
screenIndexSummaryDetailVo.setStationName(survStationInfo.getStationName());
|
screenIndexSummaryDetailVo.setStationName(survStationInfo.getStationName());
|
||||||
|
|
@ -817,6 +849,7 @@ public class BigScreenController {
|
||||||
//补充最新数据进入
|
//补充最新数据进入
|
||||||
JSONArray returnArrs= new JSONArray();
|
JSONArray returnArrs= new JSONArray();
|
||||||
JSONArray returnSoilArrs= new JSONArray();
|
JSONArray returnSoilArrs= new JSONArray();
|
||||||
|
JSONArray returnWaterArrs= new JSONArray();
|
||||||
JSONArray returnAirArrs= new JSONArray();
|
JSONArray returnAirArrs= new JSONArray();
|
||||||
JSONArray returnStinkArrs= new JSONArray();
|
JSONArray returnStinkArrs= new JSONArray();
|
||||||
if(stationList!=null&&stationList.size()>0){
|
if(stationList!=null&&stationList.size()>0){
|
||||||
|
|
@ -844,6 +877,12 @@ public class BigScreenController {
|
||||||
returnAirArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataAir, SerializerFeature.WriteNullStringAsEmpty)));
|
returnAirArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataAir, SerializerFeature.WriteNullStringAsEmpty)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//水质设备
|
||||||
|
SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode());
|
||||||
|
if(transdataSoil!=null) {
|
||||||
|
transdataSoil.setStationName(survStationInfo.getStationName());
|
||||||
|
returnWaterArrs.add(JSONObject.parseObject(JSONObject.toJSONString(transdataSoil, SerializerFeature.WriteNullStringAsEmpty)));
|
||||||
|
}
|
||||||
}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());
|
||||||
returnStinkArrs.add(survTransdataAirVo);
|
returnStinkArrs.add(survTransdataAirVo);
|
||||||
|
|
@ -964,6 +1003,7 @@ public class BigScreenController {
|
||||||
survStationInfo.setLatestSoilData(returnSoilArrs);
|
survStationInfo.setLatestSoilData(returnSoilArrs);
|
||||||
survStationInfo.setLatestAirData(returnAirArrs);
|
survStationInfo.setLatestAirData(returnAirArrs);
|
||||||
survStationInfo.setLatestStinkData(returnStinkArrs);
|
survStationInfo.setLatestStinkData(returnStinkArrs);
|
||||||
|
survStationInfo.setLatestWaterData(returnWaterArrs);
|
||||||
|
|
||||||
//补充监测项
|
//补充监测项
|
||||||
// List<String> allSurv = new ArrayList<>();
|
// List<String> allSurv = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ public class BigScreenControllerP2 {
|
||||||
SurvMaintainRecord survMaintainRecord = new SurvMaintainRecord();
|
SurvMaintainRecord survMaintainRecord = new SurvMaintainRecord();
|
||||||
survMaintainRecord.setBeginDate(stationMaintainPage.getStartTime());
|
survMaintainRecord.setBeginDate(stationMaintainPage.getStartTime());
|
||||||
survMaintainRecord.setEndDate(stationMaintainPage.getEndTime());
|
survMaintainRecord.setEndDate(stationMaintainPage.getEndTime());
|
||||||
|
survMaintainRecord.setStationCode(stationMaintainPage.getStationCode());
|
||||||
IPage<SurvMaintainRecord> records = maintainRecordService.pages(page,survMaintainRecord);
|
IPage<SurvMaintainRecord> records = maintainRecordService.pages(page,survMaintainRecord);
|
||||||
return Result.OK(records);
|
return Result.OK(records);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,19 +8,17 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.entity.PollutionSetVo;
|
import org.jeecg.common.entity.PollutionSetVo;
|
||||||
import org.jeecg.common.entity.ScEquZhibiao;
|
import org.jeecg.common.entity.ScEquZhibiao;
|
||||||
import org.jeecg.common.iot.common.VOIntegrateStatistic;
|
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||||
import org.jeecg.common.iot.common.VOSurvIntegrateParam;
|
import org.jeecg.common.iot.common.*;
|
||||||
import org.jeecg.common.iot.common.VOSurvIntegrateResult;
|
import org.jeecg.common.vo.CommonDataTrans;
|
||||||
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
|
||||||
import org.jeecg.common.vo.inner.TransSurvObjVo;
|
import org.jeecg.common.vo.inner.TransSurvObjVo;
|
||||||
import org.jeecg.common.vo.inner.TransZhiBiaoVo;
|
import org.jeecg.common.vo.inner.TransZhiBiaoVo;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvDeviceDeployService;
|
||||||
import org.jeecg.modules.appmana.service.impl.IotCommonServiceImpl;
|
import org.jeecg.modules.appmana.service.impl.IotCommonServiceImpl;
|
||||||
|
import org.jeecg.modules.appmana.utils.CommonUtils;
|
||||||
import org.jeecg.modules.appmana.utils.Iotutils;
|
import org.jeecg.modules.appmana.utils.Iotutils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
@ -34,7 +32,8 @@ public class InnerController {
|
||||||
private IotCommonServiceImpl iotCommonService;
|
private IotCommonServiceImpl iotCommonService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private Iotutils iotutils;
|
private Iotutils iotutils;
|
||||||
|
@Autowired
|
||||||
|
private ISurvDeviceDeployService deviceDeployService;
|
||||||
|
|
||||||
@ApiOperation(value = "1. 空气土壤监测综合数据统计", notes = "")
|
@ApiOperation(value = "1. 空气土壤监测综合数据统计", notes = "")
|
||||||
@ApiOperationSupport(order = 1)
|
@ApiOperationSupport(order = 1)
|
||||||
|
|
@ -79,4 +78,16 @@ public class InnerController {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "6. 实时数据构造", notes = "")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@PostMapping(value = "/deviceNewestData")
|
||||||
|
public VOTransData deviceNewestData(@RequestParam String deployId) {
|
||||||
|
SurvDeviceDeploy deploy = deviceDeployService.getById(deployId);
|
||||||
|
if(deploy!=null){
|
||||||
|
return CommonUtils.transData(deploy, false, null, null, null, null);
|
||||||
|
}
|
||||||
|
return new VOTransData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ public class ScEquZhibiaoController extends JeecgController<ScEquZhibiao, IScEqu
|
||||||
for (PollutionEnum e : values) {
|
for (PollutionEnum e : values) {
|
||||||
PolutionVo pvo = new PolutionVo();
|
PolutionVo pvo = new PolutionVo();
|
||||||
pvo.setCode(e.getCode());
|
pvo.setCode(e.getCode());
|
||||||
pvo.setDescription(e.getDescription());
|
pvo.setDescription(e.getDescription()+"("+e.getCode()+")");
|
||||||
pvo.setUnit(e.getUnit());
|
pvo.setUnit(e.getUnit());
|
||||||
pvo.setIcon(e.getIcon());
|
pvo.setIcon(e.getIcon());
|
||||||
pvo.setColor(e.getColor());
|
pvo.setColor(e.getColor());
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@
|
||||||
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result property="dataSoilPh" column="DATA_SOIL_PH" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilNtu" column="DATA_SOIL_NTU" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilDo" column="DATA_SOIL_DO" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||||
<result property="dataGatherType" column="DATA_GATHER_TYPE" jdbcType="VARCHAR"/>
|
<result property="dataGatherType" column="DATA_GATHER_TYPE" jdbcType="VARCHAR"/>
|
||||||
<result property="stationId" column="STATION_ID" jdbcType="VARCHAR"/>
|
<result property="stationId" column="STATION_ID" jdbcType="VARCHAR"/>
|
||||||
|
|
@ -35,7 +40,7 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="baseSql">
|
<sql id="baseSql">
|
||||||
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TRANS_DATE,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID
|
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TRANS_DATE,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID,DATA_SOIL_PH,DATA_SOIL_NTU,DATA_SOIL_DO
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -83,7 +88,10 @@
|
||||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_WET4 as decimal(10,1))), 2),'0') as dataSoilWet4,-->
|
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_WET4 as decimal(10,1))), 2),'0') as dataSoilWet4,-->
|
||||||
ifnull(ROUND(avg(cast(DATA_SOIL_DDL as decimal(10,1))), 2),'0') as dataSoilDdl,
|
ifnull(ROUND(avg(cast(DATA_SOIL_DDL as decimal(10,1))), 2),'0') as dataSoilDdl,
|
||||||
ifnull(ROUND(avg(cast(DATA_SOIL_DDL2 as decimal(10,1))), 2),'0') as dataSoilDdl2,
|
ifnull(ROUND(avg(cast(DATA_SOIL_DDL2 as decimal(10,1))), 2),'0') as dataSoilDdl2,
|
||||||
ifnull(ROUND(avg(cast(DATA_SOIL_DDL3 as decimal(10,1))), 2),'0') as dataSoilDdl3
|
ifnull(ROUND(avg(cast(DATA_SOIL_DDL3 as decimal(10,1))), 2),'0') as dataSoilDdl3,
|
||||||
|
ifnull(ROUND(avg(cast(DATA_SOIL_PH as decimal(10,1))), 2),'0') as dataSoilPh,
|
||||||
|
ifnull(ROUND(avg(cast(DATA_SOIL_NTU as decimal(10,1))), 2),'0') as dataSoilNtu,
|
||||||
|
ifnull(ROUND(avg(cast(DATA_SOIL_DO as decimal(10,1))), 2),'0') as dataSoilDo
|
||||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_DDL4 as decimal(10,1))), 2),'0') as dataSoilDdl4,-->
|
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_DDL4 as decimal(10,1))), 2),'0') as dataSoilDdl4,-->
|
||||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PH as decimal(10,1))), 2),'0') as dataSoilPh,-->
|
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PH as decimal(10,1))), 2),'0') as dataSoilPh,-->
|
||||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NION as decimal(10,1))), 2),'0') as dataSoilNion,-->
|
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NION as decimal(10,1))), 2),'0') as dataSoilNion,-->
|
||||||
|
|
|
||||||
|
|
@ -49,5 +49,6 @@
|
||||||
<if test="query.endDate!=null and query.endDate!=''">
|
<if test="query.endDate!=null and query.endDate!=''">
|
||||||
and MAINTAIN_TIME <= CONCAT(#{query.endDate}, ' 23:59:59')
|
and MAINTAIN_TIME <= CONCAT(#{query.endDate}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
|
order by MAINTAIN_TIME desc,CREATE_TIME desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -14,6 +14,11 @@
|
||||||
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result property="dataSoilPh" column="DATA_SOIL_PH" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilNtu" column="DATA_SOIL_NTU" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilDo" column="DATA_SOIL_DO" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
<result property="dataGatherType" column="DATA_GATHER_TYPE" jdbcType="VARCHAR"/>
|
<result property="dataGatherType" column="DATA_GATHER_TYPE" jdbcType="VARCHAR"/>
|
||||||
<result property="stationId" column="STATION_ID" jdbcType="VARCHAR"/>
|
<result property="stationId" column="STATION_ID" jdbcType="VARCHAR"/>
|
||||||
<result property="deviceId" column="DEVICE_ID" jdbcType="VARCHAR"/>
|
<result property="deviceId" column="DEVICE_ID" jdbcType="VARCHAR"/>
|
||||||
|
|
@ -44,12 +49,17 @@
|
||||||
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result property="dataSoilPh" column="DATA_SOIL_PH" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilNtu" column="DATA_SOIL_NTU" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilDo" column="DATA_SOIL_DO" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||||
<result property="deployId" column="DEPLOY_ID"/>
|
<result property="deployId" column="DEPLOY_ID"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="baseSql">
|
<sql id="baseSql">
|
||||||
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_DATE_TIME,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID
|
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_DATE_TIME,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID,DATA_SOIL_PH,DATA_SOIL_NTU,DATA_SOIL_DO
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getNewestData" resultMap="simpleResultMap">
|
<select id="getNewestData" resultMap="simpleResultMap">
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,20 @@
|
||||||
package org.jeecg.modules.appmana.service.impl;
|
package org.jeecg.modules.appmana.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.constant.IotConstants;
|
||||||
|
import org.jeecg.common.constant.enums.PollutionEnum;
|
||||||
|
import org.jeecg.common.constant.enums.ScreenIndexSummaryEnum;
|
||||||
|
import org.jeecg.common.iot.common.VOSurvIntegrateParam;
|
||||||
|
import org.jeecg.common.iot.common.VOSurvIntegrateResult;
|
||||||
|
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
||||||
import org.jeecg.common.vo.VOHisFormResult;
|
import org.jeecg.common.vo.VOHisFormResult;
|
||||||
import org.jeecg.common.vo.VOHisResult;
|
import org.jeecg.common.vo.VOHisResult;
|
||||||
|
import org.jeecg.common.vo.statistic.ScreenIndexSummaryDetailVo;
|
||||||
|
import org.jeecg.common.vo.statistic.ScreenSummaryVo;
|
||||||
import org.jeecg.modules.appmana.mapper.IOTStatisticMapper;
|
import org.jeecg.modules.appmana.mapper.IOTStatisticMapper;
|
||||||
import org.jeecg.modules.appmana.utils.Iotutils;
|
import org.jeecg.modules.appmana.utils.Iotutils;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -12,8 +22,11 @@ import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
@ -21,6 +34,9 @@ public class IotCommonP2ServiceImpl {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IOTStatisticMapper iotStatisticMapper;
|
private IOTStatisticMapper iotStatisticMapper;
|
||||||
|
@Resource
|
||||||
|
@Lazy
|
||||||
|
private IotCommonServiceImpl commonService;
|
||||||
|
|
||||||
public VOHisResult summaryDayHours(String deployCode, String tableName, String survItem, String dateStr) {
|
public VOHisResult summaryDayHours(String deployCode, String tableName, String survItem, String dateStr) {
|
||||||
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
|
@ -53,4 +69,216 @@ public class IotCommonP2ServiceImpl {
|
||||||
}
|
}
|
||||||
return voHisResult;
|
return voHisResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScreenIndexSummaryDetailVo processWaterQuality(ScreenSummaryVo screenSummaryVo,List<String> deviceList,String startTime,String endTime) {
|
||||||
|
if(deviceList.isEmpty()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreenIndexSummaryDetailVo screenIndexSummaryDetailVo = new ScreenIndexSummaryDetailVo();
|
||||||
|
List<Double> avgTemp = new ArrayList<>();
|
||||||
|
List<Double> avgPh = new ArrayList<>();
|
||||||
|
List<Double> avgDdl = new ArrayList<>();
|
||||||
|
List<Double> avgNtu = new ArrayList<>();
|
||||||
|
List<Double> avgDo = new ArrayList<>();
|
||||||
|
|
||||||
|
VOSurvIntegrateParam voSurvIntegrateParam = new VOSurvIntegrateParam();
|
||||||
|
voSurvIntegrateParam.setDeployIds(deviceList);
|
||||||
|
voSurvIntegrateParam.setSummrayMode(screenSummaryVo.getSummrayMode());
|
||||||
|
voSurvIntegrateParam.setStartTime(startTime);
|
||||||
|
voSurvIntegrateParam.setEndTime(endTime);
|
||||||
|
VOSurvIntegrateResult survIntegrateResult =commonService.survDataIntegrateStatistic(voSurvIntegrateParam);
|
||||||
|
if(IotConstants.day_hours.equals(screenSummaryVo.getSummrayMode())) {
|
||||||
|
//处理时间格式
|
||||||
|
survIntegrateResult.setIndexs(commonService.processTime(survIntegrateResult.getIndexs(),"yyyy-MM-dd HH","H时"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//数据
|
||||||
|
LinkedHashMap<String, List<Double>> maps = new LinkedHashMap<>();
|
||||||
|
LinkedHashMap<String,List<String>> survResult = survIntegrateResult.getSurvResult();
|
||||||
|
List<String> tempDatas = new ArrayList<>();
|
||||||
|
List<String> phDatas = new ArrayList<>();
|
||||||
|
List<String> ddlDatas = new ArrayList<>();
|
||||||
|
List<String> ntuDatas = new ArrayList<>();
|
||||||
|
List<String> doDatas = new ArrayList<>();
|
||||||
|
|
||||||
|
List<String> timeList = new ArrayList<>();
|
||||||
|
LocalDateTime nowDay = LocalDateTime.now();
|
||||||
|
DateTimeFormatter daydtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
DateTimeFormatter monthdtf = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||||
|
DateTimeFormatter yeardtf = DateTimeFormatter.ofPattern("yyyy");
|
||||||
|
|
||||||
|
//使用数据的数量,默认
|
||||||
|
int todayDataCounts = 0;
|
||||||
|
//需要拼接的数量
|
||||||
|
int yesterDataCounts = 0;
|
||||||
|
if(IotConstants.day_hours.equals(screenSummaryVo.getSummrayMode())) {//日需要24数据
|
||||||
|
todayDataCounts =24;
|
||||||
|
}else if(IotConstants.month_days.equals(screenSummaryVo.getSummrayMode())){//月需要数据量
|
||||||
|
LocalDate curDateMark = LocalDate.parse(startTime+"-01",daydtf);
|
||||||
|
todayDataCounts = curDateMark.with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IotConstants.day_hours.equals(screenSummaryVo.getSummrayMode())){//检查是否是今天
|
||||||
|
if(nowDay.format(daydtf).equals(startTime)){//如果查询是今天,再查询一次昨天,拼接为24小时
|
||||||
|
LocalDateTime yesterday = nowDay.minusDays(1);
|
||||||
|
|
||||||
|
todayDataCounts = nowDay.getHour()+1;//0点开始,故+1
|
||||||
|
yesterDataCounts = todayDataCounts;
|
||||||
|
String newTimes = yesterday.format(daydtf);
|
||||||
|
voSurvIntegrateParam.setStartTime(newTimes);
|
||||||
|
voSurvIntegrateParam.setEndTime(newTimes);
|
||||||
|
VOSurvIntegrateResult yesterData = commonService.survDataIntegrateStatistic(voSurvIntegrateParam);
|
||||||
|
LinkedHashMap<String,List<String>> yesterResult = yesterData.getSurvResult();
|
||||||
|
//处理时间格式
|
||||||
|
yesterData.setIndexs(commonService.processTime(yesterData.getIndexs(),"yyyy-MM-dd HH","H时"));
|
||||||
|
List<String> y1 = yesterResult.get(PollutionEnum.dataSoilTemp.getCode());
|
||||||
|
if(y1!=null){
|
||||||
|
tempDatas.addAll(y1.subList(yesterDataCounts,y1.size()));
|
||||||
|
}
|
||||||
|
List<String> y2= yesterResult.get(PollutionEnum.dataSoilPh.getCode());
|
||||||
|
if(y2!=null){
|
||||||
|
phDatas.addAll(y2.subList(yesterDataCounts,y2.size()));
|
||||||
|
}
|
||||||
|
List<String> y3 = yesterResult.get(PollutionEnum.dataSoilDdl.getCode());
|
||||||
|
if(y3!=null){
|
||||||
|
ddlDatas.addAll(y3.subList(yesterDataCounts,y3.size()));
|
||||||
|
}
|
||||||
|
List<String> y4 = yesterResult.get(PollutionEnum.dataSoilNtu.getCode());
|
||||||
|
if(y4!=null) {
|
||||||
|
ntuDatas.addAll(y4.subList(yesterDataCounts,y4.size()));
|
||||||
|
}
|
||||||
|
List<String> y5 = yesterResult.get(PollutionEnum.dataSoilDo.getCode());
|
||||||
|
if(y5!=null){
|
||||||
|
doDatas.addAll(y5.subList(yesterDataCounts,y5.size()));
|
||||||
|
}
|
||||||
|
timeList.addAll(yesterData.getIndexs().subList(yesterDataCounts,yesterData.getIndexs().size()));
|
||||||
|
}
|
||||||
|
} else if (IotConstants.month_days.equals(screenSummaryVo.getSummrayMode())){//检查是否是本月
|
||||||
|
if(nowDay.format(monthdtf).equals(startTime)){//如果查询是本月,再查询一次上个月,拼接为30天
|
||||||
|
LocalDateTime yesterMonth = nowDay.minusMonths(1);
|
||||||
|
|
||||||
|
todayDataCounts = nowDay.getDayOfMonth();
|
||||||
|
yesterDataCounts = todayDataCounts;
|
||||||
|
String newTimes = yesterMonth.format(monthdtf);
|
||||||
|
voSurvIntegrateParam.setStartTime(newTimes);
|
||||||
|
voSurvIntegrateParam.setEndTime(newTimes);
|
||||||
|
VOSurvIntegrateResult yesterData = commonService.survDataIntegrateStatistic(voSurvIntegrateParam);
|
||||||
|
LinkedHashMap<String,List<String>> yesterResult = yesterData.getSurvResult();
|
||||||
|
List<String> y1 = yesterResult.get(PollutionEnum.dataSoilTemp.getCode());
|
||||||
|
if(y1!=null){
|
||||||
|
tempDatas.addAll(y1.subList(yesterDataCounts,y1.size()));
|
||||||
|
}
|
||||||
|
List<String> y2= yesterResult.get(PollutionEnum.dataSoilPh.getCode());
|
||||||
|
if(y2!=null){
|
||||||
|
phDatas.addAll(y2.subList(yesterDataCounts,y2.size()));
|
||||||
|
}
|
||||||
|
List<String> y3 = yesterResult.get(PollutionEnum.dataSoilDdl.getCode());
|
||||||
|
if(y3!=null){
|
||||||
|
ddlDatas.addAll(y3.subList(yesterDataCounts,y3.size()));
|
||||||
|
}
|
||||||
|
List<String> y4 = yesterResult.get(PollutionEnum.dataSoilNtu.getCode());
|
||||||
|
if(y4!=null) {
|
||||||
|
ntuDatas.addAll(y4.subList(yesterDataCounts,y4.size()));
|
||||||
|
}
|
||||||
|
List<String> y5 = yesterResult.get(PollutionEnum.dataSoilDo.getCode());
|
||||||
|
if(y5!=null){
|
||||||
|
doDatas.addAll(y5.subList(yesterDataCounts,y5.size()));
|
||||||
|
}
|
||||||
|
timeList.addAll(yesterData.getIndexs().subList(yesterDataCounts,yesterData.getIndexs().size()));
|
||||||
|
}
|
||||||
|
} else if (IotConstants.year_months.equals(screenSummaryVo.getSummrayMode())){//检查是否是本年
|
||||||
|
if(nowDay.format(yeardtf).equals(startTime)){//如果查询是本年,再查询一次去年,拼接为12个月
|
||||||
|
LocalDateTime yesterYear = nowDay.minusYears(1);
|
||||||
|
|
||||||
|
todayDataCounts = nowDay.getMonthValue();
|
||||||
|
yesterDataCounts = todayDataCounts;
|
||||||
|
String newTimes = yesterYear.format(yeardtf);
|
||||||
|
voSurvIntegrateParam.setStartTime(newTimes);
|
||||||
|
voSurvIntegrateParam.setEndTime(newTimes);
|
||||||
|
VOSurvIntegrateResult yesterData = commonService.survDataIntegrateStatistic(voSurvIntegrateParam);
|
||||||
|
LinkedHashMap<String,List<String>> yesterResult = yesterData.getSurvResult();
|
||||||
|
List<String> y1 = yesterResult.get(PollutionEnum.dataSoilTemp.getCode());
|
||||||
|
if(y1!=null){
|
||||||
|
tempDatas.addAll(y1.subList(yesterDataCounts,y1.size()));
|
||||||
|
}
|
||||||
|
List<String> y2= yesterResult.get(PollutionEnum.dataSoilPh.getCode());
|
||||||
|
if(y2!=null){
|
||||||
|
phDatas.addAll(y2.subList(yesterDataCounts,y2.size()));
|
||||||
|
}
|
||||||
|
List<String> y3 = yesterResult.get(PollutionEnum.dataSoilDdl.getCode());
|
||||||
|
if(y3!=null){
|
||||||
|
ddlDatas.addAll(y3.subList(yesterDataCounts,y3.size()));
|
||||||
|
}
|
||||||
|
List<String> y4 = yesterResult.get(PollutionEnum.dataSoilNtu.getCode());
|
||||||
|
if(y4!=null) {
|
||||||
|
ntuDatas.addAll(y4.subList(yesterDataCounts,y4.size()));
|
||||||
|
}
|
||||||
|
List<String> y5 = yesterResult.get(PollutionEnum.dataSoilDo.getCode());
|
||||||
|
if(y5!=null){
|
||||||
|
doDatas.addAll(y5.subList(yesterDataCounts,y5.size()));
|
||||||
|
}
|
||||||
|
timeList.addAll(yesterData.getIndexs().subList(yesterDataCounts,yesterData.getIndexs().size()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
timeList.addAll(survIntegrateResult.getIndexs().subList(0,todayDataCounts));
|
||||||
|
List<String> t1 = survResult.get(PollutionEnum.dataSoilTemp.getCode());
|
||||||
|
if(t1!=null){
|
||||||
|
tempDatas.addAll(t1.subList(0,todayDataCounts)) ;
|
||||||
|
}
|
||||||
|
List<String> t2= survResult.get(PollutionEnum.dataSoilPh.getCode());
|
||||||
|
if(t2!=null){
|
||||||
|
phDatas.addAll(t2.subList(0,todayDataCounts));
|
||||||
|
}
|
||||||
|
List<String> t3 = survResult.get(PollutionEnum.dataSoilDdl.getCode());
|
||||||
|
if(t3!=null){
|
||||||
|
ddlDatas.addAll(t3.subList(0,todayDataCounts));
|
||||||
|
}
|
||||||
|
List<String> t4 = survResult.get(PollutionEnum.dataSoilNtu.getCode());
|
||||||
|
if(t4!=null) {
|
||||||
|
ntuDatas.addAll(t4.subList(0,todayDataCounts));
|
||||||
|
}
|
||||||
|
List<String> t5 = survResult.get(PollutionEnum.dataSoilDo.getCode());
|
||||||
|
if(t5!=null){
|
||||||
|
doDatas.addAll(t5.subList(0,todayDataCounts));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!tempDatas.isEmpty()) {
|
||||||
|
avgTemp = tempDatas.stream()
|
||||||
|
.map(Double::parseDouble)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if(!phDatas.isEmpty()) {
|
||||||
|
avgPh = phDatas.stream()
|
||||||
|
.map(Double::parseDouble)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if(!ddlDatas.isEmpty()) {
|
||||||
|
avgDdl = ddlDatas.stream()
|
||||||
|
.map(Double::parseDouble)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if(!ntuDatas.isEmpty()) {
|
||||||
|
avgNtu = ntuDatas.stream()
|
||||||
|
.map(Double::parseDouble)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if(!doDatas.isEmpty()) {
|
||||||
|
avgDo = doDatas.stream()
|
||||||
|
.map(Double::parseDouble)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
maps.put(ScreenIndexSummaryEnum.TEMPSummry.getDesc(),avgTemp);
|
||||||
|
maps.put(ScreenIndexSummaryEnum.PHSummry.getDesc(),avgPh);
|
||||||
|
maps.put(ScreenIndexSummaryEnum.DDLSummry.getDesc(),avgDdl);
|
||||||
|
maps.put(ScreenIndexSummaryEnum.NTUSummry.getDesc(),avgNtu);
|
||||||
|
maps.put(ScreenIndexSummaryEnum.DOSummry.getDesc(),avgDo);
|
||||||
|
|
||||||
|
screenIndexSummaryDetailVo.setDatas(maps);
|
||||||
|
//时间
|
||||||
|
screenIndexSummaryDetailVo.setDateStr(timeList);
|
||||||
|
|
||||||
|
return screenIndexSummaryDetailVo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,14 @@ public class IotCommonServiceImpl {
|
||||||
List<String> deployTypes = new ArrayList<>();
|
List<String> deployTypes = new ArrayList<>();
|
||||||
deployTypes.add(PollutionConstants.AIR_SURV);
|
deployTypes.add(PollutionConstants.AIR_SURV);
|
||||||
deployTypes.add(PollutionConstants.SOIL_SURV);
|
deployTypes.add(PollutionConstants.SOIL_SURV);
|
||||||
List<SurvDeviceDeploy> deploys = fDeviceDeployService.getAllDevice(voSurvIntegrateParam.getStationCode(),deployTypes);
|
deployTypes.add(PollutionConstants.WATER_QULITY);
|
||||||
|
List<SurvDeviceDeploy> deploys = new ArrayList<>();
|
||||||
|
if(voSurvIntegrateParam.getDeployIds() !=null && !voSurvIntegrateParam.getDeployIds().isEmpty()){
|
||||||
|
deploys = fDeviceDeployService.listByIds(voSurvIntegrateParam.getDeployIds());
|
||||||
|
}else if(voSurvIntegrateParam.getStationCode()!=null && StringUtils.isNotBlank(voSurvIntegrateParam.getStationCode())){
|
||||||
|
deploys = fDeviceDeployService.getAllDevice(voSurvIntegrateParam.getStationCode(),deployTypes);
|
||||||
|
}
|
||||||
|
|
||||||
VOIntegrateStatistic voIntegrateStatistic = new VOIntegrateStatistic();
|
VOIntegrateStatistic voIntegrateStatistic = new VOIntegrateStatistic();
|
||||||
if(!deploys.isEmpty()){
|
if(!deploys.isEmpty()){
|
||||||
voSurvIntegrateParam.setDeployIds(deploys.stream().map(SurvDeviceDeploy::getId).collect(Collectors.toList()));
|
voSurvIntegrateParam.setDeployIds(deploys.stream().map(SurvDeviceDeploy::getId).collect(Collectors.toList()));
|
||||||
|
|
@ -87,7 +94,13 @@ public class IotCommonServiceImpl {
|
||||||
List<String> deployTypes = new ArrayList<>();
|
List<String> deployTypes = new ArrayList<>();
|
||||||
deployTypes.add(PollutionConstants.WATER_ORIENT);
|
deployTypes.add(PollutionConstants.WATER_ORIENT);
|
||||||
deployTypes.add(PollutionConstants.WATER_LIVE);
|
deployTypes.add(PollutionConstants.WATER_LIVE);
|
||||||
List<SurvDeviceDeploy> deploys = fDeviceDeployService.getAllDevice(voSurvIntegrateParam.getStationCode(),deployTypes);
|
|
||||||
|
List<SurvDeviceDeploy> deploys = new ArrayList<>();
|
||||||
|
if(voSurvIntegrateParam.getDeployIds() !=null && !voSurvIntegrateParam.getDeployIds().isEmpty()){
|
||||||
|
deploys = fDeviceDeployService.listByIds(voSurvIntegrateParam.getDeployIds());
|
||||||
|
}else if(voSurvIntegrateParam.getStationCode()!=null && StringUtils.isNotBlank(voSurvIntegrateParam.getStationCode())){
|
||||||
|
deploys = fDeviceDeployService.getAllDevice(voSurvIntegrateParam.getStationCode(),deployTypes);
|
||||||
|
}
|
||||||
VOIntegrateStatistic voIntegrateStatistic = new VOIntegrateStatistic();
|
VOIntegrateStatistic voIntegrateStatistic = new VOIntegrateStatistic();
|
||||||
if(!deploys.isEmpty()) {
|
if(!deploys.isEmpty()) {
|
||||||
voSurvIntegrateParam.setDeployIds(deploys.stream().map(SurvDeviceDeploy::getId).collect(Collectors.toList()));
|
voSurvIntegrateParam.setDeployIds(deploys.stream().map(SurvDeviceDeploy::getId).collect(Collectors.toList()));
|
||||||
|
|
@ -156,6 +169,10 @@ public class IotCommonServiceImpl {
|
||||||
soilDevice.add(deploy.getDeployCode());
|
soilDevice.add(deploy.getDeployCode());
|
||||||
commonDataTransList.addAll(CommonUtils.transData(deploy, false, null, null, null, null).getTransData());
|
commonDataTransList.addAll(CommonUtils.transData(deploy, false, null, null, null, null).getTransData());
|
||||||
break;
|
break;
|
||||||
|
case PollutionConstants.WATER_QULITY:
|
||||||
|
soilDevice.add(deploy.getDeployCode());
|
||||||
|
commonDataTransList.addAll(CommonUtils.transData(deploy, false, null, null, null, null).getTransData());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String timeDataFormat = "";
|
String timeDataFormat = "";
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ w * @param pageNo 非必传,虫情孢子类,杀虫灯传入
|
||||||
} else {
|
} else {
|
||||||
if (transdataWater != null) {
|
if (transdataWater != null) {
|
||||||
transdataWater.setDeployId(deployId);
|
transdataWater.setDeployId(deployId);
|
||||||
voTransData.setTransData(CommonUtils.markZhibiao(CommonUtils.constructWater(transdataWater), zhibiaoList));
|
voTransData.setTransData(CommonUtils.markZhibiao(CommonUtils.constructSoil(transdataWater), zhibiaoList));
|
||||||
return voTransData;
|
return voTransData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,17 @@ package org.jeecg.system.applet.client;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.jeecg.common.entity.PollutionSetVo;
|
import org.jeecg.common.entity.PollutionSetVo;
|
||||||
|
import org.jeecg.common.iot.common.VOIntegrateStatistic;
|
||||||
import org.jeecg.common.iot.common.VOSurvIntegrateParam;
|
import org.jeecg.common.iot.common.VOSurvIntegrateParam;
|
||||||
|
import org.jeecg.common.iot.common.VOTransData;
|
||||||
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
||||||
import org.jeecg.common.vo.inner.TransSurvObjVo;
|
import org.jeecg.common.vo.inner.TransSurvObjVo;
|
||||||
import org.jeecg.common.vo.inner.TransZhiBiaoVo;
|
import org.jeecg.common.vo.inner.TransZhiBiaoVo;
|
||||||
|
import org.jeecg.common.vo.iot.common.Result;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -17,18 +21,26 @@ import java.util.List;
|
||||||
@FeignClient(value = "zh-applet-admin")
|
@FeignClient(value = "zh-applet-admin")
|
||||||
public interface ZhAdminFeignClient {
|
public interface ZhAdminFeignClient {
|
||||||
|
|
||||||
@GetMapping("/appmana/inner/api/survIntegrateStatistic")
|
@PostMapping("/appmana/inner/api/survIntegrateStatistic")
|
||||||
JSONObject survIntegrateStatistic(@RequestBody VOSurvIntegrateParam voSurvIntegrateParam);
|
Result<VOIntegrateStatistic> survIntegrateStatistic(@RequestBody VOSurvIntegrateParam voSurvIntegrateParam);
|
||||||
|
|
||||||
@GetMapping("/appmana/inner/api/waterIntegrateStatistic")
|
@PostMapping("/appmana/inner/api/waterIntegrateStatistic")
|
||||||
JSONObject waterIntegrateStatistic(@RequestBody VOWaterSurvIntegrateParam waterSurvIntegrateParam);
|
Result<VOIntegrateStatistic> waterIntegrateStatistic(@RequestBody VOWaterSurvIntegrateParam waterSurvIntegrateParam);
|
||||||
|
|
||||||
@GetMapping("/appmana/inner/api/getPollutionDict")
|
@PostMapping("/appmana/inner/api/getPollutionDict")
|
||||||
JSONArray getPollutionDict();
|
JSONArray getPollutionDict();
|
||||||
|
|
||||||
@GetMapping("/appmana/inner/api/translatePollution")
|
@PostMapping("/appmana/inner/api/translatePollution")
|
||||||
List<PollutionSetVo> translatePollution(@RequestBody TransZhiBiaoVo transZhiBiaoVo);
|
List<PollutionSetVo> translatePollution(@RequestBody TransZhiBiaoVo transZhiBiaoVo);
|
||||||
|
|
||||||
@GetMapping("/appmana/inner/api/translateArrPollution")
|
@PostMapping("/appmana/inner/api/translateArrPollution")
|
||||||
List<PollutionSetVo> translateArrPollution(@RequestBody TransSurvObjVo transSurvObjVo);
|
List<PollutionSetVo> translateArrPollution(@RequestBody TransSurvObjVo transSurvObjVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备最新数据
|
||||||
|
* @param deployId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/appmana/inner/api/deviceNewestData")
|
||||||
|
VOTransData deviceNewestData(String deployId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ public class SurvDeviceDeployController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "空气土壤监测综合数据统计", notes = "")
|
@ApiOperation(value = "站点/设备空气土壤监测综合数据统计", notes = "")
|
||||||
@PostMapping(value = "/survIntegrateStatistic")
|
@PostMapping(value = "/survIntegrateStatistic")
|
||||||
public R<VOIntegrateStatistic> survIntegrateStatistic(@RequestBody VOSurvIntegrateParam voSurvIntegrateParam) {
|
public R<VOIntegrateStatistic> survIntegrateStatistic(@RequestBody VOSurvIntegrateParam voSurvIntegrateParam) {
|
||||||
JSONObject job = zhAdminFeignClient.survIntegrateStatistic(voSurvIntegrateParam);
|
JSONObject job = zhAdminFeignClient.survIntegrateStatistic(voSurvIntegrateParam);
|
||||||
|
|
@ -107,7 +107,7 @@ public class SurvDeviceDeployController {
|
||||||
return R.ok(voIntegrateStatistic);
|
return R.ok(voIntegrateStatistic);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "水质监测综合数据统计", notes = "")
|
@ApiOperation(value = "站点/设备面源畜禽监测综合数据统计", notes = "")
|
||||||
@PostMapping(value = "/waterIntegrateStatistic")
|
@PostMapping(value = "/waterIntegrateStatistic")
|
||||||
public R<VOIntegrateStatistic> waterIntegrateStatistic(@RequestBody VOWaterSurvIntegrateParam waterSurvIntegrateParam) {
|
public R<VOIntegrateStatistic> waterIntegrateStatistic(@RequestBody VOWaterSurvIntegrateParam waterSurvIntegrateParam) {
|
||||||
JSONObject job = zhAdminFeignClient.waterIntegrateStatistic(waterSurvIntegrateParam);
|
JSONObject job = zhAdminFeignClient.waterIntegrateStatistic(waterSurvIntegrateParam);
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,7 @@ public class SurvStationInfoController {
|
||||||
List<String> orientList = new ArrayList<>();
|
List<String> orientList = new ArrayList<>();
|
||||||
List<String> liveList = new ArrayList<>();
|
List<String> liveList = new ArrayList<>();
|
||||||
List<String> stinkList = new ArrayList<>();
|
List<String> stinkList = new ArrayList<>();
|
||||||
|
List<String> waterList = new ArrayList<>();
|
||||||
if(curStation.getDeviceList()!=null&&curStation.getDeviceList().size()>0){
|
if(curStation.getDeviceList()!=null&&curStation.getDeviceList().size()>0){
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : curStation.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : curStation.getDeviceList()) {
|
||||||
deployList.add(survDeviceDeploy.getId());
|
deployList.add(survDeviceDeploy.getId());
|
||||||
|
|
@ -216,7 +217,9 @@ public class SurvStationInfoController {
|
||||||
soilList.add(survDeviceDeploy.getDeployCode());
|
soilList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
||||||
airList.add(survDeviceDeploy.getDeployCode());
|
airList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//水质设备
|
||||||
|
waterList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
||||||
orientList.add(survDeviceDeploy.getDeployCode());
|
orientList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
||||||
liveList.add(survDeviceDeploy.getDeployCode());
|
liveList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
|
@ -273,6 +276,14 @@ public class SurvStationInfoController {
|
||||||
Integer dataCounts = hisdataSoilService.getHisDataCount(soilList);
|
Integer dataCounts = hisdataSoilService.getHisDataCount(soilList);
|
||||||
finalDataCounts=finalDataCounts+dataCounts;
|
finalDataCounts=finalDataCounts+dataCounts;
|
||||||
}
|
}
|
||||||
|
//水质实时
|
||||||
|
if(waterList.size()>0){
|
||||||
|
SurvTransdataSoilVo survTransdataSoilVo = transdataSoilService.getNewestDataWithStation(waterList);
|
||||||
|
jsonArray.add(JSONObject.parseObject(JSONObject.toJSONString(survTransdataSoilVo, SerializerFeature.WriteNullStringAsEmpty)));
|
||||||
|
//计算历史数据量
|
||||||
|
Integer dataCounts = hisdataSoilService.getHisDataCount(waterList);
|
||||||
|
finalDataCounts=finalDataCounts+dataCounts;
|
||||||
|
}
|
||||||
//恶臭实时
|
//恶臭实时
|
||||||
if(stinkList.size()>0){
|
if(stinkList.size()>0){
|
||||||
SurvTransdataStinkVo survTransdataStinkVo = survTransdataVocsService.getNewestDataWithStation(stinkList);
|
SurvTransdataStinkVo survTransdataStinkVo = survTransdataVocsService.getNewestDataWithStation(stinkList);
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jeecg.common.constant.IotConstants;
|
||||||
import org.jeecg.common.constant.PollutionConstants;
|
import org.jeecg.common.constant.PollutionConstants;
|
||||||
import org.jeecg.common.constant.StationConstants;
|
import org.jeecg.common.constant.StationConstants;
|
||||||
import org.jeecg.common.entity.*;
|
import org.jeecg.common.entity.*;
|
||||||
import org.jeecg.common.constant.enums.PollutionEnum;
|
import org.jeecg.common.constant.enums.PollutionEnum;
|
||||||
|
import org.jeecg.common.iot.common.VOIntegrateStatistic;
|
||||||
|
import org.jeecg.common.iot.common.VOSurvIntegrateParam;
|
||||||
|
import org.jeecg.common.iot.common.VOTransData;
|
||||||
import org.jeecg.common.util.R;
|
import org.jeecg.common.util.R;
|
||||||
import org.jeecg.common.vo.*;
|
import org.jeecg.common.vo.*;
|
||||||
import org.jeecg.common.vo.inner.TransZhiBiaoVo;
|
import org.jeecg.common.vo.inner.TransZhiBiaoVo;
|
||||||
|
import org.jeecg.common.vo.iot.common.Result;
|
||||||
import org.jeecg.system.applet.client.ZhAdminFeignClient;
|
import org.jeecg.system.applet.client.ZhAdminFeignClient;
|
||||||
import org.jeecg.system.applet.service.*;
|
import org.jeecg.system.applet.service.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -50,6 +56,8 @@ public class WxAppletController {
|
||||||
ISurvDeviceDeployService deviceDeployService;
|
ISurvDeviceDeployService deviceDeployService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISurvHisdataAirService hisdataAirService;
|
private ISurvHisdataAirService hisdataAirService;
|
||||||
|
@Autowired
|
||||||
|
private ZhAdminFeignClient zhAdminFeignClient;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISurvHisdataSoilService hisdataSoilService;
|
private ISurvHisdataSoilService hisdataSoilService;
|
||||||
|
|
@ -69,9 +77,6 @@ public class WxAppletController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISurvHisdataVocsService vocsService;
|
private ISurvHisdataVocsService vocsService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ZhAdminFeignClient zhAdminFeignClient;
|
|
||||||
|
|
||||||
// @PostMapping("/getNewestData")
|
// @PostMapping("/getNewestData")
|
||||||
// @ApiOperation("获取首页最新数据")
|
// @ApiOperation("获取首页最新数据")
|
||||||
// public R getNewestData(){
|
// public R getNewestData(){
|
||||||
|
|
@ -132,7 +137,7 @@ public class WxAppletController {
|
||||||
|
|
||||||
@PostMapping("/getNewestData")
|
@PostMapping("/getNewestData")
|
||||||
@ApiOperation("获取首页最新数据")
|
@ApiOperation("获取首页最新数据")
|
||||||
public R getNewestData(){
|
public R getNewestData(@RequestParam(required = false) String dataMode){
|
||||||
List<SurvStationInfo> stationList = stationInfoService.getAllStationAndDevice("","","token");
|
List<SurvStationInfo> stationList = stationInfoService.getAllStationAndDevice("","","token");
|
||||||
Integer dataCounts = stationInfoService.getCountOfAllData();
|
Integer dataCounts = stationInfoService.getCountOfAllData();
|
||||||
//补充最新数据进入
|
//补充最新数据进入
|
||||||
|
|
@ -145,11 +150,14 @@ public class WxAppletController {
|
||||||
List<String> soilList = new ArrayList<>();
|
List<String> soilList = new ArrayList<>();
|
||||||
List<String> orientList = new ArrayList<>();
|
List<String> orientList = new ArrayList<>();
|
||||||
List<String> liveList = new ArrayList<>();
|
List<String> liveList = new ArrayList<>();
|
||||||
|
List<String> waterList = new ArrayList<>();
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
||||||
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
||||||
soilList.add(survDeviceDeploy.getDeployCode());
|
soilList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
||||||
airList.add(survDeviceDeploy.getDeployCode());
|
airList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//气象设备
|
||||||
|
waterList.add(survDeviceDeploy.getId());
|
||||||
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
||||||
orientList.add(survDeviceDeploy.getDeployCode());
|
orientList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
||||||
|
|
@ -174,126 +182,137 @@ public class WxAppletController {
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }else
|
// }else
|
||||||
|
String dataTypes = "all";//全部数据=all,water=水质数据,orient=面源和畜禽
|
||||||
if(orientList.size()>0){//面源
|
if(StringUtils.isNotBlank(dataMode)){
|
||||||
SurvTransdataOrientwaterVo transdataOrientwaterVo=orientwaterService.getNewestDataWithStation(orientList);
|
dataTypes = dataMode;
|
||||||
if(transdataOrientwaterVo!=null) {
|
}
|
||||||
transdataOrientwaterVo.setStationName(survStationInfo.getStationName());
|
if(IotConstants.Data_Types_All.equals(dataMode) || IotConstants.Data_Types_Nsp.equals(dataMode)) {
|
||||||
|
if (orientList.size() > 0) {//面源
|
||||||
|
SurvTransdataOrientwaterVo transdataOrientwaterVo = orientwaterService.getNewestDataWithStation(orientList);
|
||||||
|
if (transdataOrientwaterVo != null) {
|
||||||
|
transdataOrientwaterVo.setStationName(survStationInfo.getStationName());
|
||||||
|
|
||||||
|
|
||||||
List<CommonDataTrans> tpList = new ArrayList<>();
|
List<CommonDataTrans> tpList = new ArrayList<>();
|
||||||
List<CommonDataTrans> tnList = new ArrayList<>();
|
List<CommonDataTrans> tnList = new ArrayList<>();
|
||||||
List<CommonDataTrans> noList = new ArrayList<>();
|
List<CommonDataTrans> noList = new ArrayList<>();
|
||||||
// for (SurvHisdataOrientwater survHisdataOrientwater : oriDataList) {
|
// for (SurvHisdataOrientwater survHisdataOrientwater : oriDataList) {
|
||||||
|
|
||||||
CommonDataTrans tpent = new CommonDataTrans();
|
CommonDataTrans tpent = new CommonDataTrans();
|
||||||
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
||||||
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
||||||
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
||||||
tpent.setStationName(survStationInfo.getStationName());
|
tpent.setStationName(survStationInfo.getStationName());
|
||||||
tpent.setStationCode(survStationInfo.getStationCode());
|
tpent.setStationCode(survStationInfo.getStationCode());
|
||||||
tpent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
tpent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||||
|
|
||||||
CommonDataTrans tnent = new CommonDataTrans();
|
CommonDataTrans tnent = new CommonDataTrans();
|
||||||
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
||||||
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
||||||
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
||||||
tnent.setStationName(survStationInfo.getStationName());
|
tnent.setStationName(survStationInfo.getStationName());
|
||||||
tnent.setStationCode(survStationInfo.getStationCode());
|
tnent.setStationCode(survStationInfo.getStationCode());
|
||||||
tnent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
tnent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||||
|
|
||||||
CommonDataTrans noent = new CommonDataTrans();
|
CommonDataTrans noent = new CommonDataTrans();
|
||||||
noent.setName(PollutionEnum.dataWaterNo.getDescription());
|
noent.setName(PollutionEnum.dataWaterNo.getDescription());
|
||||||
noent.setUnit(PollutionEnum.dataWaterNo.getUnit());
|
noent.setUnit(PollutionEnum.dataWaterNo.getUnit());
|
||||||
noent.setColor(PollutionEnum.dataWaterNo.getColor());
|
noent.setColor(PollutionEnum.dataWaterNo.getColor());
|
||||||
noent.setStationName(survStationInfo.getStationName());
|
noent.setStationName(survStationInfo.getStationName());
|
||||||
noent.setStationCode(survStationInfo.getStationCode());
|
noent.setStationCode(survStationInfo.getStationCode());
|
||||||
noent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
noent.setDataDateTime(transdataOrientwaterVo.getDataDateTime());
|
||||||
|
|
||||||
tpent.setValue(transdataOrientwaterVo.getDataWaterTp());
|
tpent.setValue(transdataOrientwaterVo.getDataWaterTp());
|
||||||
tnent.setValue(transdataOrientwaterVo.getDataWaterTn());
|
tnent.setValue(transdataOrientwaterVo.getDataWaterTn());
|
||||||
noent.setValue(transdataOrientwaterVo.getDataWaterNo());
|
noent.setValue(transdataOrientwaterVo.getDataWaterNo());
|
||||||
|
|
||||||
tpent.setDataCounts(dataCounts);
|
tpent.setDataCounts(dataCounts);
|
||||||
tnent.setDataCounts(dataCounts);
|
tnent.setDataCounts(dataCounts);
|
||||||
noent.setDataCounts(dataCounts);
|
noent.setDataCounts(dataCounts);
|
||||||
|
|
||||||
|
|
||||||
tpList.add(tpent);
|
tpList.add(tpent);
|
||||||
tnList.add(tnent);
|
tnList.add(tnent);
|
||||||
noList.add(noent);
|
noList.add(noent);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
listFinal.addAll(tnList);
|
listFinal.addAll(tnList);
|
||||||
listFinal.addAll(tpList);
|
listFinal.addAll(tpList);
|
||||||
listFinal.addAll(noList);
|
listFinal.addAll(noList);
|
||||||
|
|
||||||
|
|
||||||
// returnArrs.add(JSONObject.parseObject(JSON.toJSONString(transdataOrientwaterVo)));
|
// returnArrs.add(JSONObject.parseObject(JSON.toJSONString(transdataOrientwaterVo)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(liveList.size()>0){//畜禽
|
if (liveList.size() > 0) {//畜禽
|
||||||
SurvTransdataLivestockwaterVo transdataLivestockwaterVo=livestockwaterService.getNewestDataWithStation(liveList);
|
SurvTransdataLivestockwaterVo transdataLivestockwaterVo = livestockwaterService.getNewestDataWithStation(liveList);
|
||||||
if(transdataLivestockwaterVo!=null) {
|
if (transdataLivestockwaterVo != null) {
|
||||||
List<CommonDataTrans> tpList = new ArrayList<>();
|
List<CommonDataTrans> tpList = new ArrayList<>();
|
||||||
List<CommonDataTrans> tnList = new ArrayList<>();
|
List<CommonDataTrans> tnList = new ArrayList<>();
|
||||||
List<CommonDataTrans> nhList = new ArrayList<>();
|
List<CommonDataTrans> nhList = new ArrayList<>();
|
||||||
List<CommonDataTrans> codList = new ArrayList<>();
|
List<CommonDataTrans> codList = new ArrayList<>();
|
||||||
// for (SurvHisdataLivestockwater survHisdataLivestockwater : liveDataList) {
|
// for (SurvHisdataLivestockwater survHisdataLivestockwater : liveDataList) {
|
||||||
CommonDataTrans tpent = new CommonDataTrans();
|
CommonDataTrans tpent = new CommonDataTrans();
|
||||||
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
tpent.setName(PollutionEnum.dataWaterTp.getDescription());
|
||||||
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
tpent.setUnit(PollutionEnum.dataWaterTp.getUnit());
|
||||||
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
tpent.setColor(PollutionEnum.dataWaterTp.getColor());
|
||||||
tpent.setStationName(survStationInfo.getStationName());
|
tpent.setStationName(survStationInfo.getStationName());
|
||||||
tpent.setStationCode(survStationInfo.getStationCode());
|
tpent.setStationCode(survStationInfo.getStationCode());
|
||||||
tpent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
tpent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
CommonDataTrans tnent = new CommonDataTrans();
|
CommonDataTrans tnent = new CommonDataTrans();
|
||||||
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
tnent.setName(PollutionEnum.dataWaterTn.getDescription());
|
||||||
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
tnent.setUnit(PollutionEnum.dataWaterTn.getUnit());
|
||||||
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
tnent.setColor(PollutionEnum.dataWaterTn.getColor());
|
||||||
tnent.setStationName(survStationInfo.getStationName());
|
tnent.setStationName(survStationInfo.getStationName());
|
||||||
tnent.setStationCode(survStationInfo.getStationCode());
|
tnent.setStationCode(survStationInfo.getStationCode());
|
||||||
tnent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
tnent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
CommonDataTrans nhent = new CommonDataTrans();
|
CommonDataTrans nhent = new CommonDataTrans();
|
||||||
nhent.setName(PollutionEnum.dataWaterNh.getDescription());
|
nhent.setName(PollutionEnum.dataWaterNh.getDescription());
|
||||||
nhent.setUnit(PollutionEnum.dataWaterNh.getUnit());
|
nhent.setUnit(PollutionEnum.dataWaterNh.getUnit());
|
||||||
nhent.setColor(PollutionEnum.dataWaterNh.getColor());
|
nhent.setColor(PollutionEnum.dataWaterNh.getColor());
|
||||||
nhent.setStationName(survStationInfo.getStationName());
|
nhent.setStationName(survStationInfo.getStationName());
|
||||||
nhent.setStationCode(survStationInfo.getStationCode());
|
nhent.setStationCode(survStationInfo.getStationCode());
|
||||||
nhent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
nhent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
CommonDataTrans codent = new CommonDataTrans();
|
CommonDataTrans codent = new CommonDataTrans();
|
||||||
codent.setName(PollutionEnum.dataWaterCod.getDescription());
|
codent.setName(PollutionEnum.dataWaterCod.getDescription());
|
||||||
codent.setUnit(PollutionEnum.dataWaterCod.getUnit());
|
codent.setUnit(PollutionEnum.dataWaterCod.getUnit());
|
||||||
codent.setColor(PollutionEnum.dataWaterCod.getColor());
|
codent.setColor(PollutionEnum.dataWaterCod.getColor());
|
||||||
codent.setStationName(survStationInfo.getStationName());
|
codent.setStationName(survStationInfo.getStationName());
|
||||||
codent.setStationCode(survStationInfo.getStationCode());
|
codent.setStationCode(survStationInfo.getStationCode());
|
||||||
codent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
codent.setDataDateTime(transdataLivestockwaterVo.getDataDateTime());
|
||||||
|
|
||||||
tpent.setValue(transdataLivestockwaterVo.getDataWaterTp());
|
tpent.setValue(transdataLivestockwaterVo.getDataWaterTp());
|
||||||
tnent.setValue(transdataLivestockwaterVo.getDataWaterTn());
|
tnent.setValue(transdataLivestockwaterVo.getDataWaterTn());
|
||||||
nhent.setValue(transdataLivestockwaterVo.getDataWaterNh());
|
nhent.setValue(transdataLivestockwaterVo.getDataWaterNh());
|
||||||
codent.setValue(transdataLivestockwaterVo.getDataWaterCod());
|
codent.setValue(transdataLivestockwaterVo.getDataWaterCod());
|
||||||
|
|
||||||
|
|
||||||
|
tpent.setDataCounts(dataCounts);
|
||||||
|
tnent.setDataCounts(dataCounts);
|
||||||
|
nhent.setDataCounts(dataCounts);
|
||||||
|
codent.setDataCounts(dataCounts);
|
||||||
|
|
||||||
tpent.setDataCounts(dataCounts);
|
tpList.add(tpent);
|
||||||
tnent.setDataCounts(dataCounts);
|
tnList.add(tnent);
|
||||||
nhent.setDataCounts(dataCounts);
|
nhList.add(nhent);
|
||||||
codent.setDataCounts(dataCounts);
|
codList.add(codent);
|
||||||
|
|
||||||
tpList.add(tpent);
|
|
||||||
tnList.add(tnent);
|
|
||||||
nhList.add(nhent);
|
|
||||||
codList.add(codent);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
listFinal.addAll(tnList);
|
listFinal.addAll(tnList);
|
||||||
listFinal.addAll(tpList);
|
listFinal.addAll(tpList);
|
||||||
listFinal.addAll(nhList);
|
listFinal.addAll(nhList);
|
||||||
listFinal.addAll(codList);
|
listFinal.addAll(codList);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(IotConstants.Data_Types_All.equals(dataMode) || IotConstants.Data_Types_Water.equals(dataMode)) {
|
||||||
|
if(!waterList.isEmpty()) {//五常
|
||||||
|
VOTransData voTransData = zhAdminFeignClient.deviceNewestData(waterList.get(0));
|
||||||
|
if(voTransData!=null){
|
||||||
|
listFinal.addAll(voTransData.getTransData());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -372,6 +391,7 @@ public class WxAppletController {
|
||||||
List<SurvDeviceDeploy> stationDeviceList = new ArrayList<>();
|
List<SurvDeviceDeploy> stationDeviceList = new ArrayList<>();
|
||||||
List<String> airList = new ArrayList<>();
|
List<String> airList = new ArrayList<>();
|
||||||
List<String> soilList = new ArrayList<>();
|
List<String> soilList = new ArrayList<>();
|
||||||
|
List<String> waterList = new ArrayList<>();
|
||||||
List<String> orientList = new ArrayList<>();
|
List<String> orientList = new ArrayList<>();
|
||||||
List<String> liveList = new ArrayList<>();
|
List<String> liveList = new ArrayList<>();
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
||||||
|
|
@ -379,6 +399,8 @@ public class WxAppletController {
|
||||||
soilList.add(survDeviceDeploy.getDeployCode());
|
soilList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
||||||
airList.add(survDeviceDeploy.getDeployCode());
|
airList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//气象设备
|
||||||
|
waterList.add(survDeviceDeploy.getId());
|
||||||
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
||||||
orientList.add(survDeviceDeploy.getDeployCode());
|
orientList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
||||||
|
|
@ -839,7 +861,15 @@ public class WxAppletController {
|
||||||
listFinal.addAll(soilddl3);
|
listFinal.addAll(soilddl3);
|
||||||
job.put("dataList",listFinal);
|
job.put("dataList",listFinal);
|
||||||
|
|
||||||
}else{
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){
|
||||||
|
VOTransData voTransData = zhAdminFeignClient.deviceNewestData(survDeviceDeploy.getId());
|
||||||
|
if(voTransData!=null){
|
||||||
|
job.put("dataList",voTransData.getTransData());
|
||||||
|
}else{
|
||||||
|
job.put("dataList",new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
job.put("dataList",new ArrayList<>());
|
job.put("dataList",new ArrayList<>());
|
||||||
}
|
}
|
||||||
return R.ok(job);
|
return R.ok(job);
|
||||||
|
|
@ -864,11 +894,14 @@ public class WxAppletController {
|
||||||
List<String> orientList = new ArrayList<>();
|
List<String> orientList = new ArrayList<>();
|
||||||
List<String> liveList = new ArrayList<>();
|
List<String> liveList = new ArrayList<>();
|
||||||
List<String> stinkList = new ArrayList<>();
|
List<String> stinkList = new ArrayList<>();
|
||||||
|
List<String> waterList = new ArrayList<>();
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
||||||
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备
|
||||||
soilList.add(survDeviceDeploy.getDeployCode());
|
soilList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
}else if(PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())){//气象设备
|
||||||
airList.add(survDeviceDeploy.getDeployCode());
|
airList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
}else if(PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())){//气象设备
|
||||||
|
waterList.add(survDeviceDeploy.getId());
|
||||||
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
}else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
||||||
orientList.add(survDeviceDeploy.getDeployCode());
|
orientList.add(survDeviceDeploy.getDeployCode());
|
||||||
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
}else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
||||||
|
|
@ -978,6 +1011,25 @@ public class WxAppletController {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(waterList.size()>0){
|
||||||
|
VOSurvIntegrateParam voSurvIntegrateParam = new VOSurvIntegrateParam();
|
||||||
|
voSurvIntegrateParam.setDeployIds(waterList);
|
||||||
|
voSurvIntegrateParam.setStartTime(curYear);
|
||||||
|
voSurvIntegrateParam.setEndTime(curYear);
|
||||||
|
voSurvIntegrateParam.setSummrayMode(IotConstants.year_months);
|
||||||
|
Result<VOIntegrateStatistic> result = zhAdminFeignClient.survIntegrateStatistic(voSurvIntegrateParam);
|
||||||
|
if(result!=null){
|
||||||
|
if(result.getResult()!=null){
|
||||||
|
if(result.getResult().getObjResults()!=null){
|
||||||
|
List<String> datas = result.getResult().getObjResults().get(pollutionCode);
|
||||||
|
returnArrs = JSONArray.parseArray(JSONObject.toJSONString(datas));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(orientList.size()>0){
|
if(orientList.size()>0){
|
||||||
List<OrientDataTrans> orientSummry = hisdataOrientwaterService.getMonthSummry(orientList,curYear);
|
List<OrientDataTrans> orientSummry = hisdataOrientwaterService.getMonthSummry(orientList,curYear);
|
||||||
List<Double> avgTN = new ArrayList<>();
|
List<Double> avgTN = new ArrayList<>();
|
||||||
|
|
@ -1077,12 +1129,15 @@ public class WxAppletController {
|
||||||
List<String> orientList = new ArrayList<>();
|
List<String> orientList = new ArrayList<>();
|
||||||
List<String> liveList = new ArrayList<>();
|
List<String> liveList = new ArrayList<>();
|
||||||
List<String> stinkList = new ArrayList<>();
|
List<String> stinkList = new ArrayList<>();
|
||||||
|
List<String> waterList =new ArrayList<>();
|
||||||
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) {
|
||||||
if (PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())) {//土壤设备
|
if (PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())) {//土壤设备
|
||||||
soilList.add(survDeviceDeploy.getDeployCode());
|
soilList.add(survDeviceDeploy.getDeployCode());
|
||||||
} else if (PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())) {//气象设备
|
} else if (PollutionConstants.AIR_SURV.equals(survDeviceDeploy.getDeployType())) {//气象设备
|
||||||
airList.add(survDeviceDeploy.getDeployCode());
|
airList.add(survDeviceDeploy.getDeployCode());
|
||||||
} else if (PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
} else if (PollutionConstants.WATER_QULITY.equals(survDeviceDeploy.getDeployType())) {//气象设备
|
||||||
|
waterList.add(survDeviceDeploy.getId());
|
||||||
|
}else if (PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源
|
||||||
orientList.add(survDeviceDeploy.getDeployCode());
|
orientList.add(survDeviceDeploy.getDeployCode());
|
||||||
} else if (PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
} else if (PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽
|
||||||
liveList.add(survDeviceDeploy.getDeployCode());
|
liveList.add(survDeviceDeploy.getDeployCode());
|
||||||
|
|
@ -1132,6 +1187,10 @@ public class WxAppletController {
|
||||||
Page<SurvTransdataStinkVo> page = new Page<SurvTransdataStinkVo>(pageNo, pageSize);
|
Page<SurvTransdataStinkVo> page = new Page<SurvTransdataStinkVo>(pageNo, pageSize);
|
||||||
IPage<SurvTransdataStinkVo> pages = vocsService.getPageResentData(page, stinkList);
|
IPage<SurvTransdataStinkVo> pages = vocsService.getPageResentData(page, stinkList);
|
||||||
return R.ok(pages);
|
return R.ok(pages);
|
||||||
|
}else if (PollutionConstants.SOIL_SURV.equals(pollutionEnum.getType()) && !waterList.isEmpty()) {//水质
|
||||||
|
Page<SurvTransdataSoilVo> page = new Page<SurvTransdataSoilVo>(pageNo, pageSize);
|
||||||
|
IPage<SurvTransdataSoilVo> pages = hisdataSoilService.getPageResentData(page, waterList);
|
||||||
|
return R.ok(pages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@
|
||||||
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result property="dataSoilPh" column="DATA_SOIL_PH" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilNtu" column="DATA_SOIL_NTU" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilDo" column="DATA_SOIL_DO" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||||
<result property="deviceCode" column="DEVICE_CODE" jdbcType="VARCHAR"/>
|
<result property="deviceCode" column="DEVICE_CODE" jdbcType="VARCHAR"/>
|
||||||
<result property="deployId" column="DEPLOY_ID"/>
|
<result property="deployId" column="DEPLOY_ID"/>
|
||||||
|
|
@ -21,13 +26,13 @@
|
||||||
|
|
||||||
<select id="getMonthSummry" resultType="org.jeecg.common.vo.SoilDataTrans">
|
<select id="getMonthSummry" resultType="org.jeecg.common.vo.SoilDataTrans">
|
||||||
SELECT t1.index,IFNULL(t2.dataSoilTemp,0) as dataSoilTemp,IFNULL(t2.dataSoilWet,0) as dataSoilWet,IFNULL(t2.dataSoilSalt,0) as dataSoilSalt,IFNULL(t2.dataSoilTemp2,0) as dataSoilTemp2,IFNULL(t2.dataSoilWet2,0) as dataSoilWet2,IFNULL(t2.dataSoilTemp3,0) as dataSoilTemp3
|
SELECT t1.index,IFNULL(t2.dataSoilTemp,0) as dataSoilTemp,IFNULL(t2.dataSoilWet,0) as dataSoilWet,IFNULL(t2.dataSoilSalt,0) as dataSoilSalt,IFNULL(t2.dataSoilTemp2,0) as dataSoilTemp2,IFNULL(t2.dataSoilWet2,0) as dataSoilWet2,IFNULL(t2.dataSoilTemp3,0) as dataSoilTemp3
|
||||||
,IFNULL(t2.dataSoilWet3,0) as dataSoilWet3,IFNULL(t2.dataSoilDdl,0) as dataSoilDdl,IFNULL(t2.dataSoilDdl2,0) as dataSoilDdl2,IFNULL(t2.dataSoilDdl3,0) as dataSoilDdl3
|
,IFNULL(t2.dataSoilWet3,0) as dataSoilWet3,IFNULL(t2.dataSoilDdl,0) as dataSoilDdl,IFNULL(t2.dataSoilDdl2,0) as dataSoilDdl2,IFNULL(t2.dataSoilDdl3,0) as dataSoilDdl3,IFNULL(t2.dataSoilPh,0) as dataSoilPh,IFNULL(t2.dataSoilNtu,0) as dataSoilNtu,IFNULL(t2.dataSoilDo,0) as dataSoilDo
|
||||||
FROM (
|
FROM (
|
||||||
SELECT @a:=@a + 1 AS `index` FROM mysql.help_topic,(SELECT @a:=0) temp LIMIT 12
|
SELECT @a:=@a + 1 AS `index` FROM mysql.help_topic,(SELECT @a:=0) temp LIMIT 12
|
||||||
) t1
|
) t1
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT ROUND(AVG(t.DATA_SOIL_TEMP),2) AS dataSoilTemp,ROUND(AVG(t.DATA_SOIL_WET),2) AS dataSoilWet,ROUND(AVG(t.DATA_SOIL_SALT),2) AS dataSoilSalt,ROUND(AVG(t.DATA_SOIL_TEMP2),2) AS dataSoilTemp2,ROUND(AVG(t.DATA_SOIL_WET2),2) AS dataSoilWet2,ROUND(AVG(t.DATA_SOIL_TEMP3),2) AS dataSoilTemp3
|
SELECT ROUND(AVG(t.DATA_SOIL_TEMP),2) AS dataSoilTemp,ROUND(AVG(t.DATA_SOIL_WET),2) AS dataSoilWet,ROUND(AVG(t.DATA_SOIL_SALT),2) AS dataSoilSalt,ROUND(AVG(t.DATA_SOIL_TEMP2),2) AS dataSoilTemp2,ROUND(AVG(t.DATA_SOIL_WET2),2) AS dataSoilWet2,ROUND(AVG(t.DATA_SOIL_TEMP3),2) AS dataSoilTemp3
|
||||||
,ROUND(AVG(t.DATA_SOIL_WET3),2) AS dataSoilWet3,ROUND(AVG(t.DATA_SOIL_DDL),2) AS dataSoilDdl,ROUND(AVG(t.DATA_SOIL_DDL2),2) AS dataSoilDdl2,ROUND(AVG(t.DATA_SOIL_DDL3),2) AS dataSoilDdl3,MONTH(t.DATA_DATE_TIME) AS month
|
,ROUND(AVG(t.DATA_SOIL_WET3),2) AS dataSoilWet3,ROUND(AVG(t.DATA_SOIL_DDL),2) AS dataSoilDdl,ROUND(AVG(t.DATA_SOIL_DDL2),2) AS dataSoilDdl2,ROUND(AVG(t.DATA_SOIL_DDL3),2) AS dataSoilDdl3,ROUND(AVG(t.DATA_SOIL_PH),2) AS dataSoilPh,ROUND(AVG(t.DATA_SOIL_NTU),2) AS dataSoilNtu,ROUND(AVG(t.DATA_SOIL_DO),2) AS dataSoilDo,MONTH(t.DATA_DATE_TIME) AS month
|
||||||
FROM surv_hisdata_soil t where 1 = 1
|
FROM surv_hisdata_soil t where 1 = 1
|
||||||
<if test="yearStr!=null and yearStr!=''">
|
<if test="yearStr!=null and yearStr!=''">
|
||||||
and DATE_FORMAT(DATA_DATE_TIME, '%Y') = #{yearStr}
|
and DATE_FORMAT(DATA_DATE_TIME, '%Y') = #{yearStr}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@
|
||||||
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl" column="DATA_SOIL_DDL" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
||||||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilPh" column="DATA_SOIL_PH" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilNtu" column="DATA_SOIL_NTU" jdbcType="VARCHAR"/>
|
||||||
|
<result property="dataSoilDo" column="DATA_SOIL_DO" jdbcType="VARCHAR"/>
|
||||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||||
<result property="deviceCode" column="DEVICE_CODE"/>
|
<result property="deviceCode" column="DEVICE_CODE"/>
|
||||||
<result property="deployId" column="DEPLOY_ID"/>
|
<result property="deployId" column="DEPLOY_ID"/>
|
||||||
|
|
|
||||||
|
|
@ -249,4 +249,19 @@ public interface IotConstants {
|
||||||
*/
|
*/
|
||||||
String mqtt_device_status="mqtt_device_status:";
|
String mqtt_device_status="mqtt_device_status:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全部站点监测数据
|
||||||
|
*/
|
||||||
|
String Data_Types_All="all";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点水质监测数据
|
||||||
|
*/
|
||||||
|
String Data_Types_Water="water";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点面源畜禽监测数据
|
||||||
|
*/
|
||||||
|
String Data_Types_Nsp="nsp";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,12 @@ public enum PollutionEnum {
|
||||||
dataSoilPbion("dataSoilPbion", "土壤铅离子", "ppm", "sys/icon/zhandian_icon_pb-.png", "soil", "#92D1F3", "sys/mobile/icon/zhandian_icon_pb-.png", "sys/bs/icon/zhandian_icon_pb-.png", "zhandian_icon_pb-.png"),
|
dataSoilPbion("dataSoilPbion", "土壤铅离子", "ppm", "sys/icon/zhandian_icon_pb-.png", "soil", "#92D1F3", "sys/mobile/icon/zhandian_icon_pb-.png", "sys/bs/icon/zhandian_icon_pb-.png", "zhandian_icon_pb-.png"),
|
||||||
dataSoilCdion("dataSoilCdion", "土壤镉离子", "ppm", "sys/icon/zhandian_icon_cd-.png", "soil", "#92D1F5", "sys/mobile/icon/zhandian_icon_cd-.png", "sys/bs/icon/zhandian_icon_cd-.png", "zhandian_icon_cd-.png"),
|
dataSoilCdion("dataSoilCdion", "土壤镉离子", "ppm", "sys/icon/zhandian_icon_cd-.png", "soil", "#92D1F5", "sys/mobile/icon/zhandian_icon_cd-.png", "sys/bs/icon/zhandian_icon_cd-.png", "zhandian_icon_cd-.png"),
|
||||||
|
|
||||||
|
//20251122 新增五常二项,三项已有
|
||||||
|
dataSoilNtu("dataSoilNtu", "浊度", "ntu", "sys/icon/shebei_icon_ntu.png", "soil", "#92D0F3", "sys/mobile/icon/shebei_icon_ntu.png", "sys/bs/icon/shebei_icon_nto.png", "shebei_icon_nto.png"),
|
||||||
|
dataSoilDo("dataSoilDo", "溶解氧", "mg/L", "sys/icon/shebei_icon_do.png", "soil", "#92D0F5", "sys/mobile/icon/shebei_icon_do.png", "sys/bs/icon/shebei_icon_do.png", "shebei_icon_do.png"),
|
||||||
|
|
||||||
|
dataWaterTemp("dataWaterTemp", "水温", "℃", "sys/icon/shebei_icon_watertemp.png", "water", "#92D0F3", "sys/mobile/icon/shebei_icon_watertemp.png", "sys/bs/icon/shebei_icon_watertemp.png", "shebei_icon_watertemp.png"),
|
||||||
|
dataWaterPh("dataWaterPh", "pH", "℃", "sys/icon/shebei_icon_waterph.png", "water", "#92D1F3", "sys/mobile/icon/shebei_icon_waterph.png", "sys/bs/icon/shebei_icon_waterph.png", "shebei_icon_waterph.png"),
|
||||||
dataWaterTp("dataWaterTp", "总磷", "mg/L", "sys/icon/shebei_icon_tp.png", "water", "#C8CC00", "sys/mobile/icon/shebei_icon_tp.png", "sys/bs/icon/shebei_icon_tp.png", "shebei_icon_tp.png"),
|
dataWaterTp("dataWaterTp", "总磷", "mg/L", "sys/icon/shebei_icon_tp.png", "water", "#C8CC00", "sys/mobile/icon/shebei_icon_tp.png", "sys/bs/icon/shebei_icon_tp.png", "shebei_icon_tp.png"),
|
||||||
dataWaterTn("dataWaterTn", "总氮", "mg/L", "sys/icon/shebei_icon_tn.png", "water", "#009DB2", "sys/mobile/icon/shebei_icon_tn.png", "sys/bs/icon/shebei_icon_tn.png", "shebei_icon_tn.png"),
|
dataWaterTn("dataWaterTn", "总氮", "mg/L", "sys/icon/shebei_icon_tn.png", "water", "#009DB2", "sys/mobile/icon/shebei_icon_tn.png", "sys/bs/icon/shebei_icon_tn.png", "shebei_icon_tn.png"),
|
||||||
dataWaterNo("dataWaterNo", "硝态氮", "mg/L", "sys/icon/shebei_icon_no3n.png", "water_orient", "#72BAA7", "sys/mobile/icon/shebei_icon_no3n.png", "sys/bs/icon/shebei_icon_no3n.png", "shebei_icon_no3n.png"),
|
dataWaterNo("dataWaterNo", "硝态氮", "mg/L", "sys/icon/shebei_icon_no3n.png", "water_orient", "#72BAA7", "sys/mobile/icon/shebei_icon_no3n.png", "sys/bs/icon/shebei_icon_no3n.png", "shebei_icon_no3n.png"),
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,11 @@ public enum ScreenIndexSummaryEnum {
|
||||||
NHSummry("NHSummry","氨氮"),
|
NHSummry("NHSummry","氨氮"),
|
||||||
NOSummry("NOSummry","硝态氮"),
|
NOSummry("NOSummry","硝态氮"),
|
||||||
CODSummry("CODSummry","化学需氧量"),
|
CODSummry("CODSummry","化学需氧量"),
|
||||||
|
TEMPSummry("TEMPSummry","水温"),
|
||||||
|
PHSummry("PHSummry","pH"),
|
||||||
|
DDLSummry("DDLSummry","电导率"),
|
||||||
|
NTUSummry("NTUSummry","浊度"),
|
||||||
|
DOSummry("DOSummry","溶解氧"),
|
||||||
OTHER("other","其他")
|
OTHER("other","其他")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,25 @@ public class SurvHisdataSoil implements Serializable {
|
||||||
@Excel(name = "电导率3", width = 15)
|
@Excel(name = "电导率3", width = 15)
|
||||||
@ApiModelProperty(value = "电导率3")
|
@ApiModelProperty(value = "电导率3")
|
||||||
private String dataSoilDdl3;
|
private String dataSoilDdl3;
|
||||||
|
|
||||||
|
|
||||||
|
/**ph*/
|
||||||
|
@Excel(name = "ph", width = 15)
|
||||||
|
@ApiModelProperty(value = "ph")
|
||||||
|
private String dataSoilPh;
|
||||||
|
|
||||||
|
/**浊度*/
|
||||||
|
@Excel(name = "浊度", width = 15)
|
||||||
|
@ApiModelProperty(value = "浊度")
|
||||||
|
private String dataSoilNtu;
|
||||||
|
|
||||||
|
/**溶解氧*/
|
||||||
|
@Excel(name = "溶解氧", width = 15)
|
||||||
|
@ApiModelProperty(value = "溶解氧")
|
||||||
|
private String dataSoilDo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**数据更新时间*/
|
/**数据更新时间*/
|
||||||
@Excel(name = "数据更新时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "数据更新时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,10 @@ public class SurvStationInfo implements Serializable {
|
||||||
@ApiModelProperty(value = "最新恶臭监测数据")
|
@ApiModelProperty(value = "最新恶臭监测数据")
|
||||||
private JSONArray latestStinkData;
|
private JSONArray latestStinkData;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "最新五常水质监测数据")
|
||||||
|
private JSONArray latestWaterData;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,21 @@ public class SurvTransdataSoil implements Serializable {
|
||||||
@ApiModelProperty(value = "电导率3")
|
@ApiModelProperty(value = "电导率3")
|
||||||
private String dataSoilDdl3;
|
private String dataSoilDdl3;
|
||||||
|
|
||||||
|
/**ph*/
|
||||||
|
@Excel(name = "ph", width = 15)
|
||||||
|
@ApiModelProperty(value = "ph")
|
||||||
|
private String dataSoilPh;
|
||||||
|
|
||||||
|
/**浊度*/
|
||||||
|
@Excel(name = "浊度", width = 15)
|
||||||
|
@ApiModelProperty(value = "浊度")
|
||||||
|
private String dataSoilNtu;
|
||||||
|
|
||||||
|
/**溶解氧*/
|
||||||
|
@Excel(name = "溶解氧", width = 15)
|
||||||
|
@ApiModelProperty(value = "溶解氧")
|
||||||
|
private String dataSoilDo;
|
||||||
|
|
||||||
/**数据更新时间*/
|
/**数据更新时间*/
|
||||||
@Excel(name = "数据更新时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "数据更新时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -202,4 +202,21 @@ public class VOSurvIntegrateSoilDetail {
|
||||||
@ApiModelProperty(value = "叶面湿度")
|
@ApiModelProperty(value = "叶面湿度")
|
||||||
private String dataLeafWet;
|
private String dataLeafWet;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浊度
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "浊度")
|
||||||
|
private String dataSoilNtu;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 溶解氧
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "溶解氧")
|
||||||
|
private String dataSoilDo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package org.jeecg.common.util;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
public class EntityFieldUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字段名称获取实体对象的字段值
|
||||||
|
* @param entity 实体对象
|
||||||
|
* @param fieldName 字段名称
|
||||||
|
* @return 字段值
|
||||||
|
*/
|
||||||
|
public static Object getFieldValue(Object entity, String fieldName) {
|
||||||
|
if (entity == null || fieldName == null || fieldName.trim().isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Field field = getField(entity.getClass(), fieldName);
|
||||||
|
if (field == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
field.setAccessible(true);
|
||||||
|
return field.get(entity);
|
||||||
|
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException("无法访问字段: " + fieldName, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归获取字段(包括父类)
|
||||||
|
*/
|
||||||
|
private static Field getField(Class<?> clazz, String fieldName) {
|
||||||
|
for (Class<?> superClass = clazz; superClass != Object.class; superClass = superClass.getSuperclass()) {
|
||||||
|
try {
|
||||||
|
return superClass.getDeclaredField(fieldName);
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
// 继续在父类中查找
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -87,6 +87,21 @@ public class SurvTransdataSoilVo implements Serializable {
|
||||||
@ApiModelProperty(value = "设备编号")
|
@ApiModelProperty(value = "设备编号")
|
||||||
private String deviceCode;
|
private String deviceCode;
|
||||||
|
|
||||||
|
/**ph*/
|
||||||
|
@Excel(name = "ph", width = 15)
|
||||||
|
@ApiModelProperty(value = "ph")
|
||||||
|
private String dataSoilPh;
|
||||||
|
|
||||||
|
/**浊度*/
|
||||||
|
@Excel(name = "浊度", width = 15)
|
||||||
|
@ApiModelProperty(value = "浊度")
|
||||||
|
private String dataSoilNtu;
|
||||||
|
|
||||||
|
/**溶解氧*/
|
||||||
|
@Excel(name = "溶解氧", width = 15)
|
||||||
|
@ApiModelProperty(value = "溶解氧")
|
||||||
|
private String dataSoilDo;
|
||||||
|
|
||||||
/**数据更新时间*/
|
/**数据更新时间*/
|
||||||
@Excel(name = "数据更新时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "数据更新时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,177 @@
|
||||||
|
package org.jeecg.common.vo.iot.common;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口返回数据格式
|
||||||
|
* @author scott
|
||||||
|
* @email jeecgos@163.com
|
||||||
|
* @date 2019年1月19日
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value="接口返回对象", description="接口返回对象")
|
||||||
|
public class Result<T> implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功标志
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "成功标志")
|
||||||
|
private boolean success = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回处理消息
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "返回处理消息")
|
||||||
|
private String message = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回代码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "返回代码")
|
||||||
|
private Integer code = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回数据对象 data
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "返回数据对象")
|
||||||
|
private T result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间戳
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "时间戳")
|
||||||
|
private long timestamp = System.currentTimeMillis();
|
||||||
|
|
||||||
|
public Result() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 兼容VUE3版token失效不跳转登录页面
|
||||||
|
* @param code
|
||||||
|
* @param message
|
||||||
|
*/
|
||||||
|
public Result(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<T> success(String message) {
|
||||||
|
this.message = message;
|
||||||
|
this.code = CommonConstant.SC_OK_200;
|
||||||
|
this.success = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> ok() {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> ok(String msg) {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
//Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
|
||||||
|
r.setResult((T) msg);
|
||||||
|
r.setMessage(msg);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> ok(T data) {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setResult(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> OK() {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此方法是为了兼容升级所创建
|
||||||
|
*
|
||||||
|
* @param msg
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static<T> Result<T> OK(String msg) {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setMessage(msg);
|
||||||
|
//Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
|
||||||
|
r.setResult((T) msg);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> OK(T data) {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setResult(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> OK(String msg, T data) {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(true);
|
||||||
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
|
r.setMessage(msg);
|
||||||
|
r.setResult(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> error(String msg, T data) {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setSuccess(false);
|
||||||
|
r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||||
|
r.setMessage(msg);
|
||||||
|
r.setResult(data);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> error(String msg) {
|
||||||
|
return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static<T> Result<T> error(int code, String msg) {
|
||||||
|
Result<T> r = new Result<T>();
|
||||||
|
r.setCode(code);
|
||||||
|
r.setMessage(msg);
|
||||||
|
r.setSuccess(false);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<T> error500(String message) {
|
||||||
|
this.message = message;
|
||||||
|
this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
|
||||||
|
this.success = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无权限访问返回结果
|
||||||
|
*/
|
||||||
|
public static<T> Result<T> noauth(String msg) {
|
||||||
|
return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
private String onlTable;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -6,4 +6,5 @@ import lombok.Data;
|
||||||
public class StationMaintainPage {
|
public class StationMaintainPage {
|
||||||
private String startTime;
|
private String startTime;
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
private String stationCode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue