调整数据格式

This commit is contained in:
wr
2025-04-11 13:09:42 +08:00
parent fecc53e36a
commit bfd03b4950
2 changed files with 8 additions and 5 deletions

View File

@@ -212,7 +212,7 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
Map<String, List<DataPowerPDto>> lineP = dataPowerPList.stream().collect(Collectors.groupingBy(DataPowerPDto::getLineId)); Map<String, List<DataPowerPDto>> lineP = dataPowerPList.stream().collect(Collectors.groupingBy(DataPowerPDto::getLineId));
//获取用户信息 //获取用户信息
List<NewUserReportVO> userPower = userLedgerFeignClient.getUserReportByIds(new ArrayList<>(objIdMap.values())).getData(); List<NewUserReportVO> userPower = userLedgerFeignClient.getUserReportByIds(new ArrayList<>(objIdMap.values())).getData();
Map<String, Double> userPowerMap = userPower.stream().collect(Collectors.toMap(NewUserReportVO::getId, NewUserReportVO::getRatePower)); Map<String, Double> userPowerMap = userPower.stream().filter(x->ObjectUtil.isNotNull(x.getRatePower())).collect(Collectors.toMap(NewUserReportVO::getId, NewUserReportVO::getRatePower));
lineP.forEach((lineId, dtoList) -> { lineP.forEach((lineId, dtoList) -> {
if (objIdMap.containsKey(lineId)) { if (objIdMap.containsKey(lineId)) {
//根据监测点找到用户,再根据用户找到额定有功功率 //根据监测点找到用户,再根据用户找到额定有功功率

View File

@@ -2,6 +2,7 @@ package com.njcn.dataProcess.service.impl.relation;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@@ -93,9 +94,9 @@ public class RelationDataLimitRateDetailImpl extends MppServiceImpl<RStatLimitRa
dto.setUbalanceOvertime(toList(detailD.getUbalanceOvertime())); dto.setUbalanceOvertime(toList(detailD.getUbalanceOvertime()));
dto.setUaberranceOvertime(toList(detailD.getUaberranceOvertime())); dto.setUaberranceOvertime(toList(detailD.getUaberranceOvertime()));
dto.setINegOvertime(toList(detailD.getINegOvertime())); dto.setINegOvertime(toList(detailD.getINegOvertime()));
dto.setUharmOvertime(toList(detailD,2,25,"uharm")); dto.setUharmOvertime(toList(detailD,2,25,"getUharm"));
dto.setIharmOvertime(toList(detailD,2,25,"iharm")); dto.setIharmOvertime(toList(detailD,2,25,"getIharm"));
dto.setInuharmOvertime(toList(detailD,1,16,"inuharm")); dto.setInuharmOvertime(toList(detailD,1,16,"getInuharm"));
info.add(dto); info.add(dto);
} }
return info; return info;
@@ -139,7 +140,9 @@ public class RelationDataLimitRateDetailImpl extends MppServiceImpl<RStatLimitRa
// 获取 DataHarmDto 类的 getVx 方法 // 获取 DataHarmDto 类的 getVx 方法
Method getVMethod = RStatLimitRateDetailD.class.getMethod(methodName); Method getVMethod = RStatLimitRateDetailD.class.getMethod(methodName);
String value = (String) getVMethod.invoke(detailD); String value = (String) getVMethod.invoke(detailD);
if(StrUtil.isNotBlank(value)){
json.addAll(JSON.parseArray(value, AbnormalData.Json.class)); json.addAll(JSON.parseArray(value, AbnormalData.Json.class));
}
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {