Commit 03f3fd06 authored by chenzhao's avatar chenzhao

Merge remote-tracking branch 'origin/developer' into developer

parents 5c90d655 239cfbeb
......@@ -50,7 +50,7 @@ public class EquipmentSpecificIndex {
private String emergencyLevelColor;
@TableField("is_alarm")
private boolean isAlarm;
private Double isAlarm;
@TableField("emergency_level")
private String emergencyLevel;
......
......@@ -104,13 +104,13 @@ public class TdInfoQueryController extends BaseController {
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
String startDate = dto.getStartDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && startDate.length() == 10) {
startDate = startDate + " " + hhmmss.format(currentDate);
startDate = startDate + " 00:00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":" + mmss.format(currentDate);
startDate = startDate + ":00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":" + ss.format(currentDate);
startDate = startDate + ":00";
}
Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN);
......@@ -121,13 +121,13 @@ public class TdInfoQueryController extends BaseController {
String endDate = dto.getEndDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && endDate.length() == 10) {
endDate = endDate + " " + hhmmss.format(currentDate);
endDate = endDate + " 00:00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":" + mmss.format(currentDate);
endDate = endDate + ":00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":" + ss.format(currentDate);
endDate = endDate + ":00";
}
Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
......@@ -204,13 +204,13 @@ public class TdInfoQueryController extends BaseController {
String startDate = dto.getStartDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && startDate.length() == 10) {
startDate = startDate + " " + hhmmss.format(currentDate);
startDate = startDate + " 00:00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":" + mmss.format(currentDate);
startDate = startDate + ":00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":" + ss.format(currentDate);
startDate = startDate + ":00";
}
......@@ -222,13 +222,13 @@ public class TdInfoQueryController extends BaseController {
String endDate = dto.getEndDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && endDate.length() == 10) {
endDate = endDate + " " + hhmmss.format(currentDate);
endDate = endDate + " 00:00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":" + mmss.format(currentDate);
endDate = endDate + ":00:00";
}
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":" + ss.format(currentDate);
endDate = endDate + ":00";
}
Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
......@@ -288,13 +288,13 @@ public class TdInfoQueryController extends BaseController {
String startDate = dto.getStartDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && startDate.length() == 10) {
startDate = startDate + " " + hhmmss.format(currentDate);
startDate = startDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":" + mmss.format(currentDate);
startDate = startDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":" + ss.format(currentDate);
startDate = startDate + ":00";
}
......@@ -306,13 +306,13 @@ public class TdInfoQueryController extends BaseController {
String endDate = dto.getEndDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && endDate.length() == 10) {
endDate = endDate + " " + hhmmss.format(currentDate);
endDate = endDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":" + mmss.format(currentDate);
endDate = endDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":" + ss.format(currentDate);
endDate = endDate + ":00";
}
......@@ -372,13 +372,13 @@ public class TdInfoQueryController extends BaseController {
String startDate = dto.getStartDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && startDate.length() == 10) {
startDate = startDate + " " + hhmmss.format(currentDate);
startDate = startDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":" + mmss.format(currentDate);
startDate = startDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":" + ss.format(currentDate);
startDate = startDate + ":00";
}
Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN);
......@@ -389,13 +389,13 @@ public class TdInfoQueryController extends BaseController {
String endDate = dto.getEndDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && endDate.length() == 10) {
endDate = endDate + " " + hhmmss.format(currentDate);
endDate = endDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":" + mmss.format(currentDate);
endDate = endDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":" + ss.format(currentDate);
endDate = endDate + ":00";
}
Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
......
......@@ -162,7 +162,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
String analysisObjectType) {
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, tableName, analysisObjectType);
QueryWrapper<IdxBizPvWeight> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "3");
queryWrapper.eq("type", "4");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizPvWeight::getValue));
......@@ -215,7 +215,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
String analysisObjectType) {
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, tableName, analysisObjectType);
QueryWrapper<IdxBizPvWeight> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "4");
queryWrapper.eq("type", "3");
queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizPvWeight::getValue));
......
......@@ -30,6 +30,8 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
@Slf4j
@Service
......@@ -106,43 +108,51 @@ public class TdengineTimeServiceImpl {
String recDate = DateUtil.format(new Date(), "yyyy-MM-dd HH:00:00");
// 8小时 + 59分钟
String startTime = DateUtils.dateFormat(DateUtils.dateAddMinutes(new Date(), -541), DateUtils.DATE_TIME_PATTERN);
// // 测点
// List<IdxBizFanHealthLevel> levelList = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
// List<FanHealthIndex> fanHealthIndices = fanHealthIndexService.getInfoListByGroupByCdFan(startTime, "fan_health_index_moment", "测点");
// saveBatchFan(fanHealthIndices, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelList);
// 测点
List<IdxBizFanHealthLevel> levelList = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
List<FanHealthIndex> fanHealthIndices = fanHealthIndexService.getInfoListByGroupByCdFan(startTime, "fan_health_index_moment", "测点");
saveBatchFan(fanHealthIndices, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelList);
List<FanHealthIndex> healthIndices = fanHealthIndexMapper.getInfoListByGroupByCdFan(startTime, "fan_health_index_moment", "测点");
saveBatchFan(healthIndices, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelList);
// 子系统
List<IdxBizFanHealthLevel> levelListZxt = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "子系统").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesZxt = fanHealthIndexService.getInfoListByGroupByZxtFan(startTime, "fan_health_index_moment", "测点");
List<FanHealthIndex> fanHealthIndicesZxt = fanHealthIndexService.getInfoListByGroupByZxtFan(startTime, "fan_health_index_hour", "测点");
saveBatchFan(fanHealthIndicesZxt, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListZxt);
// 设备
List<IdxBizFanHealthLevel> levelListSb = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "设备").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesSb = fanHealthIndexService.getInfoListByGroupBySbFan(startTime, "fan_health_index_moment", "子系统");
List<FanHealthIndex> fanHealthIndicesSb = fanHealthIndexService.getInfoListByGroupBySbFan(startTime, "fan_health_index_hour", "子系统");
saveBatchFan(fanHealthIndicesSb, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListSb);
// 场站
List<IdxBizFanHealthLevel> levelListCz = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "场站").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesCz = fanHealthIndexService.getInfoListByGroupByCzFan(startTime, "fan_health_index_moment", "设备");
List<FanHealthIndex> fanHealthIndicesCz = fanHealthIndexService.getInfoListByGroupByCzFan(startTime, "fan_health_index_hour", "设备");
saveBatchFan(fanHealthIndicesCz, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListCz);
idxFanHealthIndexMapper.deleteAllDataByTableName("pv_health_index_latest_data", WarningPeriodEnum.HOUR.getName());
// // 测点
// List<IdxBizPvHealthLevel> pvLevelList = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
// List<PvHealthIndex> pvHealthIndices = pvHealthIndexService.getInfoListByGroupByCdPv(startTime, "pv_health_index_hour", "测点");
// saveBatchPv(pvHealthIndices, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), pvLevelList);
// 测点
List<IdxBizPvHealthLevel> pvLevelList = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexService.getInfoListByGroupByCdPv(startTime, "pv_health_index_moment", "测点");
saveBatchPv(pvHealthIndices, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), pvLevelList);
List<IdxBizPvHealthLevel> pvlevelList = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoListByGroupByCdPv(startTime, "pv_health_index_moment", "测点");
saveBatchPv(pvHealthIndices, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), pvlevelList);
// 设备
List<IdxBizPvHealthLevel> pvLevelListSb = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "设备").last("limit 4"));
List<PvHealthIndex> pvHealthIndicesSb = pvHealthIndexService.getInfoListByGroupBySbPv(startTime, "pv_health_index_moment", "测点");
List<PvHealthIndex> pvHealthIndicesSb = pvHealthIndexService.getInfoListByGroupBySbPv(startTime, "pv_health_index_hour", "测点");
saveBatchPv(pvHealthIndicesSb, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), pvLevelListSb);
// 子阵
List<IdxBizPvHealthLevel> pvLevelListZz = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "子阵").last("limit 4"));
List<PvHealthIndex> pvHealthIndicesZz = pvHealthIndexService.getInfoListByGroupByZzPv(startTime, "pv_health_index_moment", "设备");
List<PvHealthIndex> pvHealthIndicesZz = pvHealthIndexService.getInfoListByGroupByZzPv(startTime, "pv_health_index_hour", "设备");
saveBatchPv(pvHealthIndicesZz, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), pvLevelListZz);
// 场站
List<IdxBizPvHealthLevel> pvLevelListCz = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "场站").last("limit 4"));
List<PvHealthIndex> pvHealthIndicesCz = pvHealthIndexService.getInfoListByGroupByCzPv(startTime, "pv_health_index_moment", "子阵");
List<PvHealthIndex> pvHealthIndicesCz = pvHealthIndexService.getInfoListByGroupByCzPv(startTime, "pv_health_index_hour", "子阵");
saveBatchPv(pvHealthIndicesCz, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), pvLevelListCz);
// 区域
List<HealthIndexDTO> healthIndexQyDTOS = fanHealthIndexService.getInfoListByGroupByQy(startTime,"fan_health_index_moment", "pv_health_index_moment","场站");
List<HealthIndexDTO> healthIndexQyDTOS = fanHealthIndexService.getInfoListByGroupByQy(startTime,"fan_health_index_hour", "pv_health_index_hour","场站");
List<IdxBizFanHealthLevel> levelListQy = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "片区").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesQy = healthIndexQyDTOS.stream().map(o -> fanHealthIndexService.toFanHealthIndex(o)).collect(Collectors.toList());
saveBatchFan(fanHealthIndicesQy, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListQy);
......@@ -152,7 +162,7 @@ public class TdengineTimeServiceImpl {
saveBatchPv(pvHealthIndicesQy, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), pvLevelListQy);
// 全域【所有 / 全国】
List<HealthIndexDTO> healthIndexQgDTOS = fanHealthIndexService.getInfoListByGroupByQg(startTime, "fan_health_index_moment", "pv_health_index_moment", "片区");
List<HealthIndexDTO> healthIndexQgDTOS = fanHealthIndexService.getInfoListByGroupByQg(startTime, "fan_health_index_hour", "pv_health_index_hour", "片区");
List<IdxBizFanHealthLevel> levelListQg = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesQg = healthIndexQgDTOS.stream().map(o -> fanHealthIndexService.toFanHealthIndex(o)).collect(Collectors.toList());
saveBatchFan(fanHealthIndicesQg, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListQg);
......@@ -181,42 +191,48 @@ public class TdengineTimeServiceImpl {
String recDate = DateUtil.format(recOriginalDate, "yyyy-MM-dd");
String startTime = DateUtils.dateFormat(DateUtils.dateAddHours(new Date(), -32), DateUtils.DATE_TIME_PATTERN);
// List<IdxBizFanHealthLevel> levelList = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
// List<FanHealthIndex> fanHealthIndices = fanHealthIndexService.getInfoListByGroupByCdFan(startTime, "fan_health_index_hour", "测点");
// saveBatchFan(fanHealthIndices, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelList);
List<IdxBizFanHealthLevel> levelList = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
List<FanHealthIndex> fanHealthIndices = fanHealthIndexService.getInfoListByGroupByCdFan(startTime, "fan_health_index_hour", "测点");
saveBatchFan(fanHealthIndices, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelList);
List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.getInfoListByGroupByCdFan(startTime, "fan_health_index_hour", "测点");
saveBatchFan(fanHealthIndices, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelList);
// 子系统
List<IdxBizFanHealthLevel> levelListZxt = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "子系统").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesZxt = fanHealthIndexService.getInfoListByGroupByZxtFan(startTime, "fan_health_index_hour", "测点");
List<FanHealthIndex> fanHealthIndicesZxt = fanHealthIndexService.getInfoListByGroupByZxtFan(startTime, "fan_health_index_day", "测点");
saveBatchFan(fanHealthIndicesZxt, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListZxt);
// 设备
List<IdxBizFanHealthLevel> levelListSb = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "设备").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesSb = fanHealthIndexService.getInfoListByGroupBySbFan(startTime, "fan_health_index_hour", "子系统");
List<FanHealthIndex> fanHealthIndicesSb = fanHealthIndexService.getInfoListByGroupBySbFan(startTime, "fan_health_index_day", "子系统");
saveBatchFan(fanHealthIndicesSb, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListSb);
// 场站
List<IdxBizFanHealthLevel> levelListCz = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "场站").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesCz = fanHealthIndexService.getInfoListByGroupByCzFan(startTime, "fan_health_index_hour", "设备");
List<FanHealthIndex> fanHealthIndicesCz = fanHealthIndexService.getInfoListByGroupByCzFan(startTime, "fan_health_index_day", "设备");
saveBatchFan(fanHealthIndicesCz, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListCz);
idxFanHealthIndexMapper.deleteAllDataByTableName("pv_health_index_latest_data", WarningPeriodEnum.DAY.getName());
List<IdxBizPvHealthLevel> pvLevelList = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexService.getInfoListByGroupByCdPv(startTime, "pv_health_index_hour", "测点");
saveBatchPv(pvHealthIndices, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvLevelList);
// List<IdxBizPvHealthLevel> pvLevelList = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
// List<PvHealthIndex> pvHealthIndices = pvHealthIndexService.getInfoListByGroupByCdPv(startTime, "pv_health_index_day", "测点");
// saveBatchPv(pvHealthIndices, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvLevelList);
List<IdxBizPvHealthLevel> pvlevelList = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "测点").last("limit 4"));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoListByGroupByCdPv(startTime, "pv_health_index_hour", "测点");
saveBatchPv(pvHealthIndices, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvlevelList);
// 设备
List<IdxBizPvHealthLevel> pvLevelListSb = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "设备").last("limit 4"));
List<PvHealthIndex> pvHealthIndicesSb = pvHealthIndexService.getInfoListByGroupBySbPv(startTime, "pv_health_index_hour", "测点");
List<PvHealthIndex> pvHealthIndicesSb = pvHealthIndexService.getInfoListByGroupBySbPv(startTime, "pv_health_index_day", "测点");
saveBatchPv(pvHealthIndicesSb, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvLevelListSb);
// 子阵
List<IdxBizPvHealthLevel> pvLevelListZz = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "子阵").last("limit 4"));
List<PvHealthIndex> pvHealthIndicesZz = pvHealthIndexService.getInfoListByGroupByZzPv(startTime, "pv_health_index_hour", "设备");
List<PvHealthIndex> pvHealthIndicesZz = pvHealthIndexService.getInfoListByGroupByZzPv(startTime, "pv_health_index_day", "设备");
saveBatchPv(pvHealthIndicesZz, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvLevelListZz);
// 场站
List<IdxBizPvHealthLevel> pvLevelListCz = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "场站").last("limit 4"));
List<PvHealthIndex> pvHealthIndicesCz = pvHealthIndexService.getInfoListByGroupByCzPv(startTime, "pv_health_index_hour", "子阵");
List<PvHealthIndex> pvHealthIndicesCz = pvHealthIndexService.getInfoListByGroupByCzPv(startTime, "pv_health_index_day", "子阵");
saveBatchPv(pvHealthIndicesCz, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvLevelListCz);
// 区域
List<HealthIndexDTO> healthIndexQyDTOS = fanHealthIndexService.getInfoListByGroupByQy(startTime,"fan_health_index_hour", "pv_health_index_hour","场站");
List<HealthIndexDTO> healthIndexQyDTOS = fanHealthIndexService.getInfoListByGroupByQy(startTime,"fan_health_index_day", "pv_health_index_day","场站");
List<IdxBizFanHealthLevel> levelListQy = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "片区").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesQy = healthIndexQyDTOS.stream().map(o -> fanHealthIndexService.toFanHealthIndex(o)).collect(Collectors.toList());
saveBatchFan(fanHealthIndicesQy, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListQy);
......@@ -226,7 +242,7 @@ public class TdengineTimeServiceImpl {
saveBatchPv(pvHealthIndicesQy, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvLevelListQy);
// 全域【所有 / 全国】
List<HealthIndexDTO> healthIndexQgDTOS = fanHealthIndexService.getInfoListByGroupByQg(startTime, "fan_health_index_hour", "pv_health_index_hour", "片区");
List<HealthIndexDTO> healthIndexQgDTOS = fanHealthIndexService.getInfoListByGroupByQg(startTime, "fan_health_index_day", "pv_health_index_day", "片区");
List<IdxBizFanHealthLevel> levelListQg = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesQg = healthIndexQgDTOS.stream().map(o -> fanHealthIndexService.toFanHealthIndex(o)).collect(Collectors.toList());
saveBatchFan(fanHealthIndicesQg, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListQg);
......@@ -519,4 +535,22 @@ public class TdengineTimeServiceImpl {
List<PvHealthIndex> pvHealthIndicesQg = healthIndexQgDTOS.stream().map(o -> fanHealthIndexService.toPvHealthIndex(o)).collect(Collectors.toList());
log.info("片区 => {}", healthIndexQgDTOS);
}
//@PostConstruct
public void test() throws ParseException
{
Date recOriginalDate = new Date();
recOriginalDate = DateUtil.offsetDay(recOriginalDate, -1);
String recDate = DateUtil.format(recOriginalDate, "yyyy-MM-dd");
String startTime = DateUtils.dateFormat(DateUtils.dateAddHours(new Date(), -32), DateUtils.DATE_TIME_PATTERN);
// 全域【所有 / 全国】
List<HealthIndexDTO> healthIndexQgDTOS = fanHealthIndexService.getInfoListByGroupByQg(startTime, "fan_health_index_day", "fan_health_index_day", "片区");
List<IdxBizFanHealthLevel> levelListQg = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesQg = healthIndexQgDTOS.stream().map(o -> fanHealthIndexService.toFanHealthIndex(o)).collect(Collectors.toList());
saveBatchFan(fanHealthIndicesQg, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListQg);
// 全域【所有 / 全国】
List<IdxBizPvHealthLevel> pvLevelListQg = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<PvHealthIndex> pvHealthIndicesQg = healthIndexQgDTOS.stream().map(o -> fanHealthIndexService.toPvHealthIndex(o)).collect(Collectors.toList());
saveBatchPv(pvHealthIndicesQg, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), pvLevelListQg);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment