Commit 6879fe91 authored by hezhuozhi's avatar hezhuozhi

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

parents 1a8f3066 baea7d1f
...@@ -35,7 +35,7 @@ public enum AcceptanceStatusEnum { ...@@ -35,7 +35,7 @@ public enum AcceptanceStatusEnum {
线下验收完成("验收完成", "10", "hygf_ys6","0"), 线下验收完成("验收完成", "10", "hygf_ys6","0"),
工程审核不通过("审核不通过", "12", "hygf_bw2","5"); 工程审核不通过("并网审核不通过", "12", "hygf_bw2","5");
/** /**
* 名称,描述 * 名称,描述
*/ */
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
WHEN bga.acceptance_status = '8' THEN '待线下验收' WHEN bga.acceptance_status = '8' THEN '待线下验收'
WHEN bga.acceptance_status = '9' THEN '线下验收不通过' WHEN bga.acceptance_status = '9' THEN '线下验收不通过'
WHEN bga.acceptance_status = '11' THEN '是否线下验收' WHEN bga.acceptance_status = '11' THEN '是否线下验收'
WHEN bga.acceptance_status = '12' THEN '并网审核不通过'
ELSE '验收完成' END AS acceptanceStatus, ELSE '验收完成' END AS acceptanceStatus,
bga.work_order_id workOrderId, bga.work_order_id workOrderId,
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = bga.work_order_id LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = bga.work_order_id
<where> <where>
bga.is_delete = 0 bga.is_delete = 0
AND bga.acceptance_status IS NOT NULL AND bga.acceptance_status != '' AND bga.acceptance_status IS NOT NULL AND bga.acceptance_status != '' AND bga.acceptance_status !=12
<if test="param != null"> <if test="param != null">
<if test="param.sequenceNbr != null and param.sequenceNbr != ''"> <if test="param.sequenceNbr != null and param.sequenceNbr != ''">
AND bga.sequence_nbr = #{param.sequenceNbr} AND bga.sequence_nbr = #{param.sequenceNbr}
......
...@@ -84,7 +84,7 @@ public class AmosJxiopAnalyseApplication { ...@@ -84,7 +84,7 @@ public class AmosJxiopAnalyseApplication {
public void initMqtt() throws Exception { public void initMqtt() throws Exception {
if (openHealth) { if (openHealth) {
//订阅固化周期性数据成功的消息 //订阅固化周期性数据成功的消息
emqKeeper.subscript("sync_esdata_to_tdengine_notice1", 1, syncESDataToTdengineMqttListener); emqKeeper.subscript("sync_esdata_to_tdengine_notice", 1, syncESDataToTdengineMqttListener);
//订阅业务固化同步数据成功消息 //订阅业务固化同步数据成功消息
emqKeeper.subscript("sync_iotdata_to_tdengine_notice", 1, syncDasSuccessMqttListener); emqKeeper.subscript("sync_iotdata_to_tdengine_notice", 1, syncDasSuccessMqttListener);
} }
......
...@@ -69,8 +69,10 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper; ...@@ -69,8 +69,10 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil; import com.yeejoin.amos.boot.module.jxiop.biz.utils.TimeRangeUtil;
...@@ -155,12 +157,12 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -155,12 +157,12 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟"); wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
if (CharSequenceUtil.isNotEmpty(stationCode)) { if (CharSequenceUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId();
if ("FDZ".equals(stationBasic.getStationType())) { if ("FDZ".equals(stationBasic.getStationType())) {
stationCode = stationBasic.getFanGatewayId();
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站"); wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.eq(FanHealthIndex::getGatewayId, stationCode); wrapper.eq(FanHealthIndex::getGatewayId, stationCode);
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper); FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
//预防空指针 // 预防空指针
if (Objects.isNull(fanHealthIndex)) { if (Objects.isNull(fanHealthIndex)) {
stringBigDecimalHashMap.put("value", ""); stringBigDecimalHashMap.put("value", "");
} else { } else {
...@@ -173,9 +175,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -173,9 +175,8 @@ public class TDBigScreenAnalyseController extends BaseController {
pvwrapper.eq(PvHealthIndex::getGatewayId, stationCode); pvwrapper.eq(PvHealthIndex::getGatewayId, stationCode);
pvwrapper.orderByDesc(PvHealthIndex::getTs); pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 1"); pvwrapper.last("limit 1");
pvwrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟");
PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(pvwrapper); PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(pvwrapper);
//预防空指针 // 预防空指针
if (Objects.isNull(pvHealthIndex)) { if (Objects.isNull(pvHealthIndex)) {
stringBigDecimalHashMap.put("value", ""); stringBigDecimalHashMap.put("value", "");
} else { } else {
...@@ -195,7 +196,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -195,7 +196,8 @@ public class TDBigScreenAnalyseController extends BaseController {
} }
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper); FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
stringBigDecimalHashMap.put("value", BigDecimal.valueOf(fanHealthIndex.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP)); stringBigDecimalHashMap.put("value",
BigDecimal.valueOf(fanHealthIndex.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP));
return ResponseHelper.buildResponse(stringBigDecimalHashMap); return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
...@@ -286,7 +288,6 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -286,7 +288,6 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 折线图", notes = "场站设备健康状态指数与趋势 - 折线图") @ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 折线图", notes = "场站设备健康状态指数与趋势 - 折线图")
@GetMapping(value = "/getHealthListInfoByMinute") @GetMapping(value = "/getHealthListInfoByMinute")
...@@ -332,20 +333,23 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -332,20 +333,23 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站"); wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.eq(FanHealthIndex::getGatewayId, finalStationCode); wrapper.eq(FanHealthIndex::getGatewayId, finalStationCode);
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper); List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper);
valueList = fanHealthIndexList.stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()) valueList = fanHealthIndexList.stream()
.setScale(1, BigDecimal.ROUND_HALF_UP))).collect(Collectors.toList()); .map(t -> String
.valueOf(BigDecimal.valueOf(t.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP)))
.collect(Collectors.toList());
dateList = fanHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList()); dateList = fanHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList());
} else { } else {
LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>(); LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站"); pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
pvwrapper.eq(PvHealthIndex::getGatewayId, finalStationCode); pvwrapper.eq(PvHealthIndex::getGatewayId, stationCode);
pvwrapper.orderByDesc(PvHealthIndex::getTs); pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 15"); pvwrapper.last("limit 15");
pvwrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟");
List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvwrapper); List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvwrapper);
valueList = pvHealthIndexList.stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()) valueList = pvHealthIndexList.stream()
.setScale(1, BigDecimal.ROUND_HALF_UP))).collect(Collectors.toList()); .map(t -> String
.valueOf(BigDecimal.valueOf(t.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP)))
.collect(Collectors.toList());
dateList = pvHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList()); dateList = pvHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList());
} }
stringStringHashMap.put("data", valueList); stringStringHashMap.put("data", valueList);
...@@ -362,8 +366,9 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -362,8 +366,9 @@ public class TDBigScreenAnalyseController extends BaseController {
} }
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper); List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper);
valueList = fanHealthIndexList.stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()) valueList = fanHealthIndexList.stream()
.setScale(1, BigDecimal.ROUND_HALF_UP))).collect(Collectors.toList()); .map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP)))
.collect(Collectors.toList());
dateList = fanHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList()); dateList = fanHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList());
stringStringHashMap.put("data", valueList); stringStringHashMap.put("data", valueList);
arrayList.add(stringStringHashMap); arrayList.add(stringStringHashMap);
...@@ -455,7 +460,6 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -455,7 +460,6 @@ public class TDBigScreenAnalyseController extends BaseController {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
list = Arrays.asList("华北区域", "东北区域", "华东区域", "华南区域", "西南区域", "西北区域", "华中区域"); list = Arrays.asList("华北区域", "东北区域", "华东区域", "华南区域", "西南区域", "西北区域", "华中区域");
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
...@@ -465,7 +469,6 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -465,7 +469,6 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域片区设备健康状态指数 ", notes = "全域片区设备健康状态指数 ") @ApiOperation(httpMethod = "GET", value = "全域片区设备健康状态指数 ", notes = "全域片区设备健康状态指数 ")
@GetMapping(value = "/getAreaHealthInfoByMinute") @GetMapping(value = "/getAreaHealthInfoByMinute")
...@@ -474,69 +477,100 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -474,69 +477,100 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper.orderByDesc(FanHealthIndex::getTs); wrapper.orderByDesc(FanHealthIndex::getTs);
wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟"); wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
wrapper.eq(FanHealthIndex::getAnalysisObjType, "片区"); wrapper.eq(FanHealthIndex::getAnalysisObjType, "片区");
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper); wrapper.last("limit 1");
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
LambdaQueryWrapper<FanHealthIndex> wrapperl = new LambdaQueryWrapper<FanHealthIndex>();
wrapperl.select(FanHealthIndex::getTs,FanHealthIndex::getArea,FanHealthIndex::getHealthIndex);
wrapperl.eq(FanHealthIndex::getAnalysisType, "按10分钟");
wrapperl.eq(FanHealthIndex::getAnalysisObjType, "片区");
wrapperl.eq(FanHealthIndex::getAnalysisTime, fanHealthIndex.getAnalysisTime());
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapperl);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
Map<String, List<FanHealthIndex>> groupedData = fanHealthIndexList.stream() Map<String, List<FanHealthIndex>> groupedData = fanHealthIndexList.stream()
.collect(Collectors.groupingBy(FanHealthIndex::getArea)); .collect(Collectors.groupingBy(FanHealthIndex::getArea));
Map<String, FanHealthIndex> latestData = groupedData.values().stream().map(list -> list.stream() Map<String, FanHealthIndex> latestData = groupedData.values().stream()
.max(Comparator.comparing(FanHealthIndex::getTs)) .map(list -> list.stream().max(Comparator.comparing(FanHealthIndex::getTs)).get())
.get()).collect(Collectors.toMap(FanHealthIndex::getArea, Function.identity())); .collect(Collectors.toMap(FanHealthIndex::getArea, Function.identity()));
List<String> axisData = latestData.values().stream().map(t -> t.getArea()).collect(Collectors.toList()); List<String> axisData = latestData.values().stream().map(t -> t.getArea()).collect(Collectors.toList());
List<String> list = Arrays.asList("华北区域", "东北区域", "华东区域", "华南区域", "西南区域", "西北区域", "华中区域"); List<String> list = Arrays.asList("华北区域", "东北区域", "华东区域", "华南区域", "西南区域", "西北区域", "华中区域");
List<String> finalList = Stream.concat(list.stream(), axisData.stream()).distinct().collect(Collectors.toList()); List<String> finalList = Stream.concat(list.stream(), axisData.stream()).distinct()
.collect(Collectors.toList());
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
finalList.forEach(item -> finalList.forEach(item -> seriesData.add(latestData.get(item) == null ? "100.0"
seriesData.add(latestData.get(item) == null ? "100.0" : String.valueOf(BigDecimal.valueOf(latestData.get(item).getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP)))); : String.valueOf(BigDecimal.valueOf(latestData.get(item).getHealthIndex()).setScale(1,
BigDecimal.ROUND_HALF_UP))));
resultMap.put("axisData", finalList); resultMap.put("axisData", finalList);
resultMap.put("seriesData", seriesData); resultMap.put("seriesData", seriesData);
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "片区场站设备健康状态指数 ", notes = "片区场站设备健康状态指数 ") @ApiOperation(httpMethod = "GET", value = "片区场站设备健康状态指数 ", notes = "片区场站设备健康状态指数 ")
@GetMapping(value = "/getStationHealthInfoByMinute") @GetMapping(value = "/getStationHealthInfoByMinute")
public ResponseModel<Map<String, Object>> getStationHealthInfoByMinute(@RequestParam(required = false) String areaCode) { public ResponseModel<Map<String, Object>> getStationHealthInfoByMinute(
@RequestParam(required = false) String areaCode) {
Map<String, Object> resultMap = new HashMap<>();
LambdaQueryWrapper<FanHealthIndex> wrapper = new LambdaQueryWrapper<FanHealthIndex>(); LambdaQueryWrapper<FanHealthIndex> wrapper = new LambdaQueryWrapper<FanHealthIndex>();
wrapper.orderByDesc(FanHealthIndex::getTs); wrapper.orderByDesc(FanHealthIndex::getTs);
wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟"); wrapper.eq(FanHealthIndex::getAnalysisType, "按10分钟");
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站"); wrapper.eq(FanHealthIndex::getAnalysisObjType, "片区");
wrapper.like(FanHealthIndex::getArea, "%" + areaCode + "%"); wrapper.last("limit 1");
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
Map<String, Object> resultMap = new HashMap<>(); LambdaQueryWrapper<FanHealthIndex> wrapperl = new LambdaQueryWrapper<FanHealthIndex>();
wrapperl.select(FanHealthIndex::getTs,FanHealthIndex::getStation,FanHealthIndex::getHealthIndex);
wrapperl.eq(FanHealthIndex::getAnalysisType, "按10分钟");
wrapperl.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapperl.eq(FanHealthIndex::getArea, areaCode+"区域");
wrapperl.eq(FanHealthIndex::getAnalysisTime, fanHealthIndex.getAnalysisTime());
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper); List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper);
LambdaQueryWrapper<PvHealthIndex> wrapper1 = new LambdaQueryWrapper<PvHealthIndex>();
wrapper1.orderByDesc(PvHealthIndex::getTs);
wrapper1.eq(PvHealthIndex::getAnalysisType, "按10分钟");
wrapper1.eq(PvHealthIndex::getAnalysisObjType, "片区");
wrapper1.last("limit 1");
PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(wrapper1);
LambdaQueryWrapper<PvHealthIndex> pvWrapper = new LambdaQueryWrapper<PvHealthIndex>(); LambdaQueryWrapper<PvHealthIndex> pvWrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvWrapper.orderByDesc(PvHealthIndex::getTs); pvWrapper.select(PvHealthIndex::getTs,PvHealthIndex::getStation,PvHealthIndex::getHealthIndex);
pvWrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟"); pvWrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟");
pvWrapper.eq(PvHealthIndex::getAnalysisObjType, "场站"); pvWrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
pvWrapper.like(PvHealthIndex::getArea, "%" + areaCode + "%"); pvWrapper.eq(PvHealthIndex::getArea, areaCode+"区域");
pvWrapper.eq(PvHealthIndex::getAnalysisTime, pvHealthIndex.getAnalysisTime());
List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvWrapper); List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvWrapper);
Map<String, List<FanHealthIndex>> fanHealthGroupedData = fanHealthIndexList.stream() Map<String, List<FanHealthIndex>> fanHealthGroupedData = fanHealthIndexList.stream()
.collect(Collectors.groupingBy(FanHealthIndex::getStation)); .collect(Collectors.groupingBy(FanHealthIndex::getStation));
Map<String, FanHealthIndex> fanHealthLatestData = fanHealthGroupedData.values().stream().map(list -> list.stream() Map<String, FanHealthIndex> fanHealthLatestData = fanHealthGroupedData.values().stream()
.max(Comparator.comparing(FanHealthIndex::getTs)) .map(list -> list.stream().max(Comparator.comparing(FanHealthIndex::getTs)).get())
.get()).collect(Collectors.toMap(FanHealthIndex::getStation, Function.identity())); .collect(Collectors.toMap(FanHealthIndex::getStation, Function.identity()));
Map<String, List<PvHealthIndex>> pvHealthGroupedData = pvHealthIndexList.stream() Map<String, List<PvHealthIndex>> pvHealthGroupedData = pvHealthIndexList.stream()
.collect(Collectors.groupingBy(PvHealthIndex::getStation)); .collect(Collectors.groupingBy(PvHealthIndex::getStation));
Map<String, PvHealthIndex> pvHealthLatestData = pvHealthGroupedData.values().stream().map(list -> list.stream() Map<String, PvHealthIndex> pvHealthLatestData = pvHealthGroupedData.values().stream()
.max(Comparator.comparing(PvHealthIndex::getTs)) .map(list -> list.stream().max(Comparator.comparing(PvHealthIndex::getTs)).get())
.get()).collect(Collectors.toMap(PvHealthIndex::getStation, Function.identity())); .collect(Collectors.toMap(PvHealthIndex::getStation, Function.identity()));
List<String> finalAxisData = new ArrayList<>(); List<String> finalAxisData = new ArrayList<>();
List<Object> finaleSeriesData = new ArrayList<>(); List<Object> finaleSeriesData = new ArrayList<>();
finalAxisData.addAll(fanHealthLatestData.values().stream().map(t -> t.getStation()).collect(Collectors.toList())); finalAxisData
finalAxisData.addAll(pvHealthLatestData.values().stream().map(t -> t.getStation()).collect(Collectors.toList())); .addAll(fanHealthLatestData.values().stream().map(t -> t.getStation()).collect(Collectors.toList()));
finaleSeriesData.addAll(fanHealthLatestData.values().stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP))).collect(Collectors.toList())); finalAxisData
finaleSeriesData.addAll(pvHealthLatestData.values().stream().map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP))).collect(Collectors.toList())); .addAll(pvHealthLatestData.values().stream().map(t -> t.getStation()).collect(Collectors.toList()));
finaleSeriesData.addAll(fanHealthLatestData.values().stream()
.map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP)))
.collect(Collectors.toList()));
finaleSeriesData.addAll(pvHealthLatestData.values().stream()
.map(t -> String.valueOf(BigDecimal.valueOf(t.getHealthIndex()).setScale(1, BigDecimal.ROUND_HALF_UP)))
.collect(Collectors.toList()));
resultMap.put("axisData", finalAxisData); resultMap.put("axisData", finalAxisData);
resultMap.put("seriesData", finaleSeriesData); resultMap.put("seriesData", finaleSeriesData);
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域各场站设备实时预警处置信息", notes = "全域各场站设备实时预警处置信息") @ApiOperation(httpMethod = "GET", value = "全域各场站设备实时预警处置信息", notes = "全域各场站设备实时预警处置信息")
@GetMapping(value = "/getEquipWarningInfoByPage") @GetMapping(value = "/getEquipWarningInfoByPage")
...@@ -1594,7 +1628,6 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1594,7 +1628,6 @@ public class TDBigScreenAnalyseController extends BaseController {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(lambdaQueryWrapper); List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(lambdaQueryWrapper);
List<String> time = new ArrayList<>(); List<String> time = new ArrayList<>();
List<Object> valueList = new ArrayList<>(); List<Object> valueList = new ArrayList<>();
fanHealthIndexList.forEach(item -> { fanHealthIndexList.forEach(item -> {
......
...@@ -191,13 +191,13 @@ spring.kafka.consumer.max-poll-records=30 ...@@ -191,13 +191,13 @@ spring.kafka.consumer.max-poll-records=30
last.month.num = 12 last.month.num = 12
#����� �㷨���� #����� �㷨����
base.url.XGX=http://139.9.171.247:8052/intelligent-analysis/correlation base.url.XGX=http://10.20.1.29:8052/intelligent-analysis/correlation
#�������� �㷨���õ�ַ #�������� �㷨���õ�ַ
base.url.GKHF=http://139.9.171.247:8052/intelligent-analysis/working-condition-division base.url.GKHF=http://10.20.1.29:8052/intelligent-analysis/working-condition-division
#����� �㷨���� #����� �㷨����
base.url.ZXZ=http://139.9.171.247:8052/intelligent-analysis/central-value base.url.ZXZ=http://10.20.1.29:8052/intelligent-analysis/central-value
#ָ���������㷨���� #ָ���������㷨����
base.url.zsfx:http://139.9.171.247:8052/intelligent-analysis/index-analysis base.url.zsfx:http://10.20.1.29:8052/intelligent-analysis/index-analysis
forecast.url= forecast.url=
......
...@@ -2,7 +2,7 @@ spring.application.name=AMOS-JXIOP-ANALYSE-CZ ...@@ -2,7 +2,7 @@ spring.application.name=AMOS-JXIOP-ANALYSE-CZ
server.servlet.context-path=/jxiop-analyse server.servlet.context-path=/jxiop-analyse
server.port=33400 server.port=33400
server.uri-encoding=UTF-8 server.uri-encoding=UTF-8
spring.profiles.active=dev spring.profiles.active=dev1
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml logging.config=classpath:logback-${spring.profiles.active}.xml
......
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