Commit 6a7b92af authored by hezhuozhi's avatar hezhuozhi

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

parents 83213bc5 909d27d0
......@@ -17,7 +17,9 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -457,58 +459,29 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "片区、场站设备健康状态指数 ", notes = "片区、场站设备健康状态指数 ")
@GetMapping(value = "/getHealthInfoByMinute")
public ResponseModel<Map<String, Object>> getHealthInfoByMinute(@RequestParam(required = false) String areaCode) {
@ApiOperation(httpMethod = "GET", value = "全域片区设备健康状态指数 ", notes = "全域片区设备健康状态指数 ")
@GetMapping(value = "/getAreaHealthInfoByMinute")
public ResponseModel<Map<String, Object>> getHealthInfoByAreaAndMinute() {
LambdaQueryWrapper<FanHealthIndex> wrapper = new LambdaQueryWrapper<FanHealthIndex>();
wrapper.orderByDesc(FanHealthIndex::getTs);
wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
if (CharSequenceUtil.isNotEmpty(areaCode)) {
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.like(FanHealthIndex::getArea, "%" + areaCode + "%");
}else{
wrapper.eq(FanHealthIndex::getAnalysisObjType, "片区");
}
List<Object> seriesData = new ArrayList<>();
List<String> axisData = new ArrayList<>();
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper);
Map<String, Object> resultMap = new HashMap<>();
if (CharSequenceUtil.isNotEmpty(areaCode)) {
Map<String, Map<String, List<FanHealthIndex>>> groupedData = fanHealthIndexList.stream()
.collect(Collectors.groupingBy(FanHealthIndex::getArea, Collectors.groupingBy(FanHealthIndex::getStation)));
Map<String, Map<String, FanHealthIndex>> latestData = groupedData.entrySet().stream()
.collect(Collectors.toMap(
Map.Entry::getKey,
e -> e.getValue().values().stream()
.map(list -> list.stream()
.max(Comparator.comparing(FanHealthIndex::getTs))
.get())
.collect(Collectors.toMap(FanHealthIndex::getStation, Function.identity()))
));
List<Object> finalSeriesData = new ArrayList<>();
List<String> finalAxisData = new ArrayList<>();
latestData.values().forEach(s -> {
s.forEach((k,v) -> {
finalSeriesData.add(v.getHealthIndex());
finalAxisData.add(v.getStation());
});
});
seriesData.addAll(finalSeriesData);
axisData.addAll(finalAxisData);
}else{
Map<String, List<FanHealthIndex>> groupedData = fanHealthIndexList.stream()
.collect(Collectors.groupingBy(FanHealthIndex::getArea));
Map<String, FanHealthIndex> latestData = groupedData.values().stream().map(list -> list.stream()
.max(Comparator.comparing(FanHealthIndex::getTs))
.get())
.collect(Collectors.toMap(FanHealthIndex::getArea, Function.identity()));
seriesData = latestData.values().stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex())
.setScale(1, BigDecimal.ROUND_HALF_UP))).collect(Collectors.toList());
axisData = latestData.values().stream().map(t -> t.getArea()).collect(Collectors.toList());
}
resultMap.put("axisData", axisData);
.get()).collect(Collectors.toMap(FanHealthIndex::getArea, Function.identity()));
List<String> axisData = latestData.values().stream().map(t -> t.getArea()).collect(Collectors.toList());
List<String> list = Arrays.asList("华北区域", "东北区域", "华东区域", "华南区域", "西南区域", "西北区域", "华中区域");
List<String> finalList = Stream.concat(axisData.stream(),list.stream()).distinct().collect(Collectors.toList());
List<Object> seriesData = new ArrayList<>();
latestData.values().forEach(item -> {
Predicate<String> condition = finalList::contains;
seriesData.add(condition.test(item.getArea()) ? String.valueOf(BigDecimal.valueOf(item.getHealthIndex())) : "100.0");
});
resultMap.put("axisData", finalList);
resultMap.put("seriesData", seriesData);
return ResponseHelper.buildResponse(resultMap);
}
......@@ -516,6 +489,50 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "片区场站设备健康状态指数 ", notes = "片区场站设备健康状态指数 ")
@GetMapping(value = "/getStationHealthInfoByMinute")
public ResponseModel<Map<String, Object>> getHealthInfoByStationAndMinute(@RequestParam(required = false) String areaCode) {
LambdaQueryWrapper<FanHealthIndex> wrapper = new LambdaQueryWrapper<FanHealthIndex>();
wrapper.orderByDesc(FanHealthIndex::getTs);
wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.like(FanHealthIndex::getArea, "%" + areaCode + "%");
Map<String, Object> resultMap = new HashMap<>();
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper);
LambdaQueryWrapper<PvHealthIndex> pvWrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvWrapper.orderByDesc(PvHealthIndex::getTs);
pvWrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟");
pvWrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
pvWrapper.like(PvHealthIndex::getArea, "%" + areaCode + "%");
List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvWrapper);
Map<String, List<FanHealthIndex>> fanHealthGroupedData = fanHealthIndexList.stream()
.collect(Collectors.groupingBy(FanHealthIndex::getArea));
Map<String, FanHealthIndex> fanHealthLatestData = fanHealthGroupedData.values().stream().map(list -> list.stream()
.max(Comparator.comparing(FanHealthIndex::getTs))
.get()).collect(Collectors.toMap(FanHealthIndex::getArea, Function.identity()));
Map<String, List<PvHealthIndex>> pvHealthGroupedData = pvHealthIndexList.stream()
.collect(Collectors.groupingBy(PvHealthIndex::getStation));
Map<String, PvHealthIndex> pvHealthLatestData = pvHealthGroupedData.values().stream().map(list -> list.stream()
.max(Comparator.comparing(PvHealthIndex::getTs))
.get()).collect(Collectors.toMap(PvHealthIndex::getStation, Function.identity()));
List<String> finalAxisData = new ArrayList<>();
List<Object> finaleSeriesData = new ArrayList<>();
finalAxisData.addAll(fanHealthLatestData.values().stream().map(t -> t.getArea()).collect(Collectors.toList()));
finalAxisData.addAll(pvHealthLatestData.values().stream().map(t -> t.getArea()).collect(Collectors.toList()));
finaleSeriesData.addAll(fanHealthLatestData.values().stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()))).collect(Collectors.toList()));
finaleSeriesData.addAll(pvHealthLatestData.values().stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()))).collect(Collectors.toList()));
resultMap.put("axisData", finalAxisData);
resultMap.put("seriesData", finaleSeriesData);
return ResponseHelper.buildResponse(resultMap);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域各场站设备实时预警处置信息", notes = "全域各场站设备实时预警处置信息")
@GetMapping(value = "/getEquipWarningInfoByPage")
public ResponseModel<IPage<FanWarningRecord>> getEquipWarningInfoByPage(
......
......@@ -741,7 +741,7 @@ public class HealthStatusIndicatorServiceImpl {
wrapper.orderByAsc(PvHealthIndexHour::getTs);
List<PvHealthIndexHour> healthIndices = pvHealthIndexHourMapper.selectList(wrapper);
List<String> collect = healthIndices.stream().map(PvHealthIndexHour::getAnalysisObjSeq).collect(Collectors.toList());
if (null == healthIndices) {
if (null == healthIndices||collect==null||collect.isEmpty()) {
return;
}
LambdaQueryWrapper<IdxBizPvWarningRuleSet> queryWrapper = new LambdaQueryWrapper<>();
......
......@@ -198,3 +198,7 @@ base.url.GKHF=http://139.9.171.247:8052/intelligent-analysis/working-condition-d
base.url.ZXZ=http://139.9.171.247:8052/intelligent-analysis/central-value
#ָ���������㷨����
base.url.zsfx:http://139.9.171.247:8052/intelligent-analysis/index-analysis
forecast.url=
logic=
\ No newline at end of file
......@@ -2,7 +2,7 @@ spring.application.name=AMOS-JXIOP-ANALYSE-CZ
server.servlet.context-path=/jxiop-analyse
server.port=33400
server.uri-encoding=UTF-8
spring.profiles.active=kingbase8
spring.profiles.active=dev1
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
......@@ -90,4 +90,4 @@ healthValue_HourCount=6
healthValue_MinCount=5
##是否打开健康计算计算 true 打开 false 关闭
openHealth = true
\ No newline at end of file
openHealth = false
\ No newline at end of file
......@@ -160,7 +160,7 @@
</if>
</where>
ORDER BY
log.REC_DATE DESC
log.CREATE_DATE DESC
LIMIT #{start}, #{size}
</select>
......
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