Merge remote-tracking branch 'lanjuMes/master' into mes

master
FCD 4 days ago
commit 7e302f80ad

@ -2,12 +2,10 @@ package com.op.energy.report.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.energy.base.domain.BaseBuildInfo;
import com.op.energy.base.domain.BaseBusinessType;
import com.op.energy.base.domain.BaseMonitorInfo;
import com.op.energy.base.domain.BaseTypeRelation;
import com.op.energy.base.domain.*;
import com.op.energy.base.mapper.BaseBuildInfoMapper;
import com.op.energy.base.mapper.BaseBusinessTypeMapper;
import com.op.energy.base.mapper.BaseSubentryTypeMapper;
import com.op.energy.base.mapper.BaseTypeRelationMapper;
import com.op.energy.base.service.IBaseMonitorInfoService;
import com.op.energy.base.utils.DateUtils;
@ -58,6 +56,9 @@ public class EnergyPreviewServiceImpl implements IEnergyPreviewService {
@Autowired
private BaseBusinessTypeMapper baseBusinessTypeMapper;
@Autowired
private BaseSubentryTypeMapper baseSubentryTypeMapper;
@Autowired
private RecordDnbInstantMapper recordDnbInstantMapper;
@ -663,15 +664,25 @@ public class EnergyPreviewServiceImpl implements IEnergyPreviewService {
List<String> timeList = new ArrayList<>();
List<Long> monitorIdLists = new ArrayList<>();
LinkedHashMap<String, List<Float>> monitorInfoMap = new LinkedHashMap<>();
if (!paramMap.containsKey("type") || !paramMap.containsKey("energyType") ||
if (!paramMap.containsKey("relationType") || !paramMap.containsKey("type") || !paramMap.containsKey("energyType") ||
String.valueOf(paramMap.get("startTime")).equals("") || String.valueOf(paramMap.get("endTime")).equals("")) {
return result;
}
String energyType = String.valueOf(paramMap.get("energyType"));
//小时 天 月 年
String type = String.valueOf(paramMap.get("type"));
BaseBuildInfo baseBuildInfo = new BaseBuildInfo();
List<BaseBuildInfo> buildInfoList = baseBuildInfoMapper.selectBaseBuildInfoList(baseBuildInfo);
String relationType = String.valueOf(paramMap.get("relationType"));
List<BaseBuildInfo> buildInfoList = null;
List<BaseBusinessType> businessTypeList = null;
List<BaseSubentryType> baseSubentryTypeList = null;
if (relationType.equals("0")){
buildInfoList = baseBuildInfoMapper.selectBaseBuildInfoList(new BaseBuildInfo());
} else if (relationType.equals("1")){
businessTypeList = baseBusinessTypeMapper.selectBaseBusinessTypeList(new BaseBusinessType());
} else if (relationType.equals("2")){
baseSubentryTypeList = baseSubentryTypeMapper.selectBaseSubentryTypeList(new BaseSubentryType());
}
if (paramMap.containsKey("monitorIds")) {
String monitorIds = String.valueOf(paramMap.get("monitorIds"));
if (monitorIds.contains(",")) {
@ -701,14 +712,23 @@ public class EnergyPreviewServiceImpl implements IEnergyPreviewService {
break;
}
List<List<Float>> lists = new ArrayList<>();
for (Long buildOId : monitorIdLists) {
for (Long oId : monitorIdLists) {
List<Float> monitorValueList = new ArrayList<>();
List<String> monitorNameList = buildInfoList.stream().filter(e -> e.getObjid().equals(buildOId))
.map(BaseBuildInfo::getBuildName).collect(Collectors.toList());
List<String> monitorNameList = null;
if (relationType.equals("0")){
monitorNameList = buildInfoList.stream().filter(e -> e.getObjid().equals(oId))
.map(BaseBuildInfo::getBuildName).collect(Collectors.toList());
} else if (relationType.equals("1")){
monitorNameList = businessTypeList.stream().filter(e -> e.getObjid().equals(oId))
.map(BaseBusinessType::getBusinessName).collect(Collectors.toList());
} else if (relationType.equals("2")){
monitorNameList = baseSubentryTypeList.stream().filter(e -> e.getObjid().equals(oId))
.map(BaseSubentryType::getSubentryName).collect(Collectors.toList());
}
BaseTypeRelation relation = new BaseTypeRelation();
relation.setType(0L);
relation.setRelationId(buildOId);
relation.setType(Long.parseLong(relationType));
relation.setRelationId(oId);
List<BaseTypeRelation> baseTypeRelations = baseTypeRelationMapper.selectBaseTypeRelationList(relation);
List<String> collect = baseTypeRelations.stream().map(BaseTypeRelation::getMonitorId).collect(Collectors.toList());
paramMap.put("monitorIdList", collect);

Loading…
Cancel
Save