1.增加导出模板下拉框设置
2.支持台区导入和发电用户导入模板 3.添加灿能云远程监测点接口,流量信息
This commit is contained in:
@@ -51,6 +51,7 @@ import org.springframework.util.CollectionUtils;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -87,6 +88,8 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
|
||||
private final PqsCommunicateMapper pqsCommunicateMapper;
|
||||
|
||||
private final TerminalMaintainMapper terminalMaintainMapper;
|
||||
|
||||
@Override
|
||||
public LineDetailDataVO getLineDetailData(String id) {
|
||||
//根据id查询当前信息的pids
|
||||
@@ -508,29 +511,42 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
@Override
|
||||
public List<LineDetailVO.Detail> getLineDetailByIds(List<String> ids) {
|
||||
List<LineDetailVO.Detail> details = this.baseMapper.selectByIds(ids);
|
||||
//获取行政区域
|
||||
List<String> areaIds = details.stream().map(LineDetailVO.Detail::getAreaId).distinct().collect(Collectors.toList());
|
||||
List<Area> data = areaFeignClient.areaNameByList(areaIds).getData();
|
||||
Map<String, String> areaMap = data.stream().collect(Collectors.toMap(Area::getId, Area::getName));
|
||||
//获取电压字典
|
||||
List<DictData> dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
Map<String, String> dictMap = dictType.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
//获取终端等级
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
if(CollUtil.isNotEmpty(details)){
|
||||
List<String> devIds = details.stream().map(LineDetailVO.Detail::getDevId).distinct().collect(Collectors.toList());
|
||||
//获取终端流量信息
|
||||
List<LineFlowMealDetailVO> flow = terminalMaintainMapper.getMonthFlow(devIds, DateUtil.beginOfMonth(DateUtil.date()), DateUtil.endOfMonth(DateUtil.date()));
|
||||
Map<String, LineFlowMealDetailVO> flowMap = flow.stream().collect(Collectors.toMap(LineFlowMealDetailVO::getId, Function.identity()));
|
||||
//获取行政区域
|
||||
List<String> areaIds = details.stream().map(LineDetailVO.Detail::getAreaId).distinct().collect(Collectors.toList());
|
||||
List<Area> data = areaFeignClient.areaNameByList(areaIds).getData();
|
||||
Map<String, String> areaMap = data.stream().collect(Collectors.toMap(Area::getId, Area::getName));
|
||||
//获取电压字典
|
||||
List<DictData> dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
Map<String, String> dictMap = dictType.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
//获取终端等级
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
|
||||
for (LineDetailVO.Detail detail : details) {
|
||||
//获取行政区域名称
|
||||
if(areaMap.containsKey(detail.getAreaId())){
|
||||
detail.setAreaName(areaMap.get(detail.getAreaId()));
|
||||
}
|
||||
//电压
|
||||
if(dictMap.containsKey(detail.getVoltageLevel())){
|
||||
detail.setVoltageLevel(dictMap.get(detail.getVoltageLevel()));
|
||||
}
|
||||
//终端等级
|
||||
if(gradeMap.containsKey(detail.getLineGrade())){
|
||||
detail.setLineGrade(String.valueOf(gradeMap.get(detail.getLineGrade())));
|
||||
for (LineDetailVO.Detail detail : details) {
|
||||
//获取行政区域名称
|
||||
if(areaMap.containsKey(detail.getAreaId())){
|
||||
detail.setAreaName(areaMap.get(detail.getAreaId()));
|
||||
}
|
||||
//电压
|
||||
if(dictMap.containsKey(detail.getVoltageLevel())){
|
||||
detail.setVoltageLevel(dictMap.get(detail.getVoltageLevel()));
|
||||
}
|
||||
//终端等级
|
||||
if(gradeMap.containsKey(detail.getLineGrade())){
|
||||
detail.setLineGrade(String.valueOf(gradeMap.get(detail.getLineGrade())));
|
||||
}
|
||||
//终端等级
|
||||
if(flowMap.containsKey(detail.getDevId())){
|
||||
LineFlowMealDetailVO flowVo = flowMap.get(detail.getDevId());
|
||||
detail.setFlowMeal(flowVo.getFlowMeal());
|
||||
detail.setStatisValue(flowVo.getStatisValue());
|
||||
detail.setFlowProportion(flowVo.getFlowProportion()*100);
|
||||
}
|
||||
}
|
||||
}
|
||||
return details;
|
||||
|
||||
Reference in New Issue
Block a user