|
@ -2,11 +2,18 @@ package com.lzbi.bi.service; |
|
|
|
|
|
|
|
|
import com.lzbi.bi.domain.*; |
|
|
import com.lzbi.bi.domain.*; |
|
|
import com.lzbi.common.config.TargetModelConfig; |
|
|
import com.lzbi.common.config.TargetModelConfig; |
|
|
|
|
|
import com.lzbi.common.constant.BizConstants; |
|
|
|
|
|
import com.lzbi.common.core.domain.entity.SysDept; |
|
|
|
|
|
import com.lzbi.common.enums.ReportNameEnum; |
|
|
import com.lzbi.common.utils.bean.BeanUtils; |
|
|
import com.lzbi.common.utils.bean.BeanUtils; |
|
|
import com.lzbi.draft.domain.DcBusiTargetDraftDay; |
|
|
import com.lzbi.draft.domain.DcBusiTargetDraftDay; |
|
|
import com.lzbi.draft.domain.DcBusiTargetDraftMonth; |
|
|
import com.lzbi.draft.domain.DcBusiTargetDraftMonth; |
|
|
|
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo; |
|
|
|
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo; |
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper; |
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper; |
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; |
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; |
|
|
|
|
|
import com.lzbi.draft.service.DcBusiTargetDraftDaynewService; |
|
|
|
|
|
import com.lzbi.system.service.ISysDeptService; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -17,7 +24,7 @@ import java.math.BigDecimal; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -37,6 +44,12 @@ public class DcBusiDataScreenNewService { |
|
|
@Resource |
|
|
@Resource |
|
|
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper; |
|
|
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private DcBusiTargetDraftDaynewService dcBusiTargetDraftDaynewService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ISysDeptService deptService; |
|
|
|
|
|
|
|
|
public List<UserIOverViewVO> getUserOverview(DcBusDataScreenNewReq dcBusDataScreenNewReq) { |
|
|
public List<UserIOverViewVO> getUserOverview(DcBusDataScreenNewReq dcBusDataScreenNewReq) { |
|
|
List<UserIOverViewVO> list = new ArrayList<>(); |
|
|
List<UserIOverViewVO> list = new ArrayList<>(); |
|
|
DcBusiTargetDraftDay params = new DcBusiTargetDraftDay(); |
|
|
DcBusiTargetDraftDay params = new DcBusiTargetDraftDay(); |
|
@ -143,131 +156,161 @@ public class DcBusiDataScreenNewService { |
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<ConsumesStatisticsVO> getConsumesStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { |
|
|
public List<ConsumesStatisticsVO> getConsumesStatistics(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|
ConsumesStatisticsDTO consumesStatisticsDTO = new ConsumesStatisticsDTO(); |
|
|
List<ConsumesStatisticsVO> list = new ArrayList<>(); |
|
|
consumesStatisticsDTO.setCompanyId(dcBusDataScreenNewReq.getCompanyId()); |
|
|
SysDept deptParams = new SysDept(); |
|
|
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); |
|
|
deptParams.setParentId(targetDraftDaynewReqVo.getOrgId()); |
|
|
String[] yearMonthDayArr = yearMonthDay.split("-"); |
|
|
deptParams.setOrgType(BizConstants.DcDeptAttr.HEAT_SOURCE); |
|
|
if (yearMonthDayArr.length > 1) { |
|
|
List<SysDept> childrenDept = deptService.selectDeptList(deptParams); |
|
|
consumesStatisticsDTO.setYear(yearMonthDayArr[0]); |
|
|
if (CollectionUtils.isEmpty(childrenDept)) { |
|
|
consumesStatisticsDTO.setMonth(yearMonthDayArr[1]); |
|
|
throw new RuntimeException("该公司无热源"); |
|
|
|
|
|
} |
|
|
|
|
|
List<Long> orgIds = childrenDept.stream().map(SysDept::getDeptId).collect(Collectors.toList()); |
|
|
|
|
|
List<String> names = new ArrayList<>(); |
|
|
|
|
|
names.add(ReportNameEnum.PRIMARY_NET_RECHARGE_WATER.getName()); |
|
|
|
|
|
names.add(ReportNameEnum.DATANG_PRIMARY_NET_RECHARGE_WATER.getName()); |
|
|
|
|
|
names.add(ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName()); |
|
|
|
|
|
names.add(ReportNameEnum.COAL_CONSUMPTION.getName()); |
|
|
|
|
|
targetDraftDaynewReqVo.setReportNames(names); |
|
|
|
|
|
targetDraftDaynewReqVo.setAssetLevel(BizConstants.DcAssetLevel.HEAT_SOURCE); |
|
|
|
|
|
targetDraftDaynewReqVo.setAssetType(BizConstants.DcAssetType.REPORT); |
|
|
|
|
|
targetDraftDaynewReqVo.setOrgIds(orgIds); |
|
|
|
|
|
List<TargetDraftDaynewResVo> targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(targetDraftDaynewReqVo); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(targetDraftDaynewResVos)) { |
|
|
|
|
|
Map<String, List<TargetDraftDaynewResVo>> orgNameMap = targetDraftDaynewResVos.stream().collect(Collectors.groupingBy(TargetDraftDaynewResVo::getOrganizeName)); |
|
|
|
|
|
orgNameMap.forEach((orgName, targetDraftDaynewResVoList) -> { |
|
|
|
|
|
ConsumesStatisticsVO consumesStatisticsVO = new ConsumesStatisticsVO(); |
|
|
|
|
|
consumesStatisticsVO.setLabel(orgName); |
|
|
|
|
|
Map<String, BigDecimal> reportNameMap = targetDraftDaynewResVoList.stream().collect(Collectors.toMap(TargetDraftDaynewResVo::getReportName, TargetDraftDaynewResVo::getValueResult)); |
|
|
|
|
|
BigDecimal water = new BigDecimal(0); |
|
|
|
|
|
if (null != reportNameMap.get(ReportNameEnum.PRIMARY_NET_RECHARGE_WATER.getName())) { |
|
|
|
|
|
water = water.add(reportNameMap.get(ReportNameEnum.PRIMARY_NET_RECHARGE_WATER.getName())); |
|
|
|
|
|
} |
|
|
|
|
|
if (null != reportNameMap.get(ReportNameEnum.DATANG_PRIMARY_NET_RECHARGE_WATER.getName())) { |
|
|
|
|
|
water = water.add(reportNameMap.get(ReportNameEnum.DATANG_PRIMARY_NET_RECHARGE_WATER.getName())); |
|
|
|
|
|
} |
|
|
|
|
|
consumesStatisticsVO.setWater(water); |
|
|
|
|
|
if (null != reportNameMap.get(ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName())) { |
|
|
|
|
|
consumesStatisticsVO.setElectricity(reportNameMap.get(ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName())); |
|
|
|
|
|
} |
|
|
|
|
|
if (null != reportNameMap.get(ReportNameEnum.COAL_CONSUMPTION.getName())) { |
|
|
|
|
|
consumesStatisticsVO.setCoal(reportNameMap.get(ReportNameEnum.COAL_CONSUMPTION.getName())); |
|
|
|
|
|
} |
|
|
|
|
|
list.add(consumesStatisticsVO); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
consumesStatisticsDTO.setElectricityConsumes(targetModelConfig.getElectricityConsumes()); |
|
|
return list; |
|
|
consumesStatisticsDTO.setWaterConsumes(targetModelConfig.getWaterConsumes()); |
|
|
|
|
|
consumesStatisticsDTO.setCoalConsumes(targetModelConfig.getCoalConsumes()); |
|
|
|
|
|
return dcBusiTargetDraftDayMapper.getConsumesStatistics(consumesStatisticsDTO); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<CalorificValueVO> getCalorificValue(DcBusDataScreenNewReq dcBusDataScreenNewReq) { |
|
|
public List<CalorificValueVO> getCalorificValue(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|
List<CalorificValueVO> list = new ArrayList<>(); |
|
|
List<CalorificValueVO> list = new ArrayList<>(); |
|
|
DcBusiTargetDraftDay params = new DcBusiTargetDraftDay(); |
|
|
SysDept deptParams = new SysDept(); |
|
|
BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq); |
|
|
deptParams.setParentId(targetDraftDaynewReqVo.getOrgId()); |
|
|
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); |
|
|
deptParams.setOrgType(BizConstants.DcDeptAttr.HEAT_SOURCE); |
|
|
String[] yearMonthDayArr = yearMonthDay.split("-"); |
|
|
List<SysDept> childrenDept = deptService.selectDeptList(deptParams); |
|
|
if (yearMonthDayArr.length > 1) { |
|
|
if (CollectionUtils.isEmpty(childrenDept)) { |
|
|
params.setCountYear(yearMonthDayArr[0]); |
|
|
throw new RuntimeException("该公司无热源"); |
|
|
params.setCountMonth(yearMonthDayArr[1]); |
|
|
} |
|
|
} |
|
|
List<Long> orgIds = childrenDept.stream().map(SysDept::getDeptId).collect(Collectors.toList()); |
|
|
params.setTargetModelCode(targetModelConfig.getCalorific()); |
|
|
List<String> names = new ArrayList<>(); |
|
|
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params); |
|
|
names.add(ReportNameEnum.TOTAL_HEAT_PRODUCTION.getName()); |
|
|
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) { |
|
|
targetDraftDaynewReqVo.setReportNames(names); |
|
|
Map<Object, List<DcBusiTargetDraftDay>> map; |
|
|
targetDraftDaynewReqVo.setAssetLevel(BizConstants.DcAssetLevel.HEAT_SOURCE); |
|
|
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { |
|
|
targetDraftDaynewReqVo.setAssetType(BizConstants.DcAssetType.REPORT); |
|
|
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId)); |
|
|
targetDraftDaynewReqVo.setOrgIds(orgIds); |
|
|
} else { |
|
|
List<TargetDraftDaynewResVo> targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(targetDraftDaynewReqVo); |
|
|
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode)); |
|
|
if (CollectionUtils.isNotEmpty(targetDraftDaynewResVos)) { |
|
|
} |
|
|
final BigDecimal[] sum = {new BigDecimal(0)}; |
|
|
AtomicReference<BigDecimal> total = new AtomicReference<>(new BigDecimal(0)); |
|
|
targetDraftDaynewResVos.stream().forEach(item -> sum[0] = sum[0].add(item.getValueResult())); |
|
|
map.forEach((key, value) -> { |
|
|
Map<String, BigDecimal> orgNameValueMap = targetDraftDaynewResVos.stream().collect(Collectors.toMap(TargetDraftDaynewResVo::getOrganizeName, TargetDraftDaynewResVo::getValueResult)); |
|
|
|
|
|
final BigDecimal[] percentageSum = {BigDecimal.valueOf(100)}; |
|
|
|
|
|
AtomicInteger size = new AtomicInteger(orgNameValueMap.size()); |
|
|
|
|
|
orgNameValueMap.forEach((label, value) -> { |
|
|
CalorificValueVO calorificValueVO = new CalorificValueVO(); |
|
|
CalorificValueVO calorificValueVO = new CalorificValueVO(); |
|
|
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { |
|
|
calorificValueVO.setLabel(label); |
|
|
calorificValueVO.setLabel(value.get(0).getOrgName()); |
|
|
calorificValueVO.setValue(value); |
|
|
|
|
|
BigDecimal percentage = value.divide(sum[0], 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
|
|
|
|
|
percentageSum[0] = percentageSum[0].subtract(percentage); |
|
|
|
|
|
if (size.get() > 1) { |
|
|
|
|
|
calorificValueVO.setPercentage(percentage.intValue()); |
|
|
} else { |
|
|
} else { |
|
|
calorificValueVO.setLabel(value.get(0).getAssetName()); |
|
|
calorificValueVO.setPercentage(percentageSum[0].intValue()); |
|
|
} |
|
|
|
|
|
BigDecimal sum = new BigDecimal(0); |
|
|
|
|
|
for (int i = 0, len = value.size(); i < len; i++) { |
|
|
|
|
|
sum = sum.add(value.get(i).getValAccumulative()); |
|
|
|
|
|
total.set(total.get().add(value.get(i).getValAccumulative())); |
|
|
|
|
|
} |
|
|
} |
|
|
calorificValueVO.setValue(sum); |
|
|
|
|
|
list.add(calorificValueVO); |
|
|
list.add(calorificValueVO); |
|
|
|
|
|
size.getAndDecrement(); |
|
|
}); |
|
|
}); |
|
|
BigDecimal percentageSum = BigDecimal.valueOf(100); |
|
|
|
|
|
for (int i = 0, len = list.size(); i < len; i++) { |
|
|
|
|
|
CalorificValueVO item = list.get(i); |
|
|
|
|
|
BigDecimal percentage = item.getValue().divide(total.get(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
|
|
|
|
|
if (i < len - 1) { |
|
|
|
|
|
percentageSum = percentageSum.subtract(percentage); |
|
|
|
|
|
item.setPercentage(percentage.intValue()); |
|
|
|
|
|
} else { |
|
|
|
|
|
item.setPercentage(percentageSum.intValue()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public HeatSuppliedVO getHeatSupplied(DcBusDataScreenNewReq dcBusDataScreenNewReq) { |
|
|
public FinishingRateVO getFinishingRate(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|
HeatSuppliedVO heatSuppliedVO = new HeatSuppliedVO(); |
|
|
FinishingRateVO finishingRateVO = new FinishingRateVO(); |
|
|
DcBusiTargetDraftDay params = new DcBusiTargetDraftDay(); |
|
|
// DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
|
|
|
BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq); |
|
|
// BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
|
|
|
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); |
|
|
// String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
|
|
|
String[] yearMonthDayArr = yearMonthDay.split("-"); |
|
|
// String[] yearMonthDayArr = yearMonthDay.split("-");
|
|
|
if (yearMonthDayArr.length > 1) { |
|
|
// if (yearMonthDayArr.length > 1) {
|
|
|
params.setCountYear(yearMonthDayArr[0]); |
|
|
// params.setCountYear(yearMonthDayArr[0]);
|
|
|
params.setCountMonth(yearMonthDayArr[1]); |
|
|
// params.setCountMonth(yearMonthDayArr[1]);
|
|
|
} |
|
|
// }
|
|
|
params.setTargetModelCode(targetModelConfig.getHeatSupplied()); |
|
|
// params.setTargetModelCode(targetModelConfig.getHeatSupplied());
|
|
|
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params); |
|
|
// List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params);
|
|
|
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) { |
|
|
// if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) {
|
|
|
Map<Object, List<DcBusiTargetDraftDay>> map; |
|
|
// Map<Object, List<DcBusiTargetDraftDay>> map;
|
|
|
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { |
|
|
// if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
|
|
|
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId)); |
|
|
// map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId));
|
|
|
} else { |
|
|
// } else {
|
|
|
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode)); |
|
|
// map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
|
|
|
} |
|
|
// }
|
|
|
List<HeatSuppliedVO.Label> labelArray = new ArrayList<>(); |
|
|
// List<FinishingRateVO.Label> labelArray = new ArrayList<>();
|
|
|
List<BigDecimal> valueArr = new ArrayList<>(); |
|
|
// List<BigDecimal> valueArr = new ArrayList<>();
|
|
|
final BigDecimal[] max = {new BigDecimal(0)}; |
|
|
// final BigDecimal[] max = {new BigDecimal(0)};
|
|
|
map.forEach((key, value) -> { |
|
|
// map.forEach((key, value) -> {
|
|
|
HeatSuppliedVO.Label label = new HeatSuppliedVO.Label(); |
|
|
// FinishingRateVO.Label label = new FinishingRateVO.Label();
|
|
|
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { |
|
|
// if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
|
|
|
label.setName(value.get(0).getOrgName()); |
|
|
// label.setName(value.get(0).getOrgName());
|
|
|
} else { |
|
|
// } else {
|
|
|
label.setName(value.get(0).getAssetName()); |
|
|
// label.setName(value.get(0).getAssetName());
|
|
|
} |
|
|
// }
|
|
|
BigDecimal sum = new BigDecimal(0); |
|
|
// BigDecimal sum = new BigDecimal(0);
|
|
|
for (int i = 0, len = value.size(); i < len; i++) { |
|
|
// for (int i = 0, len = value.size(); i < len; i++) {
|
|
|
sum = sum.add(value.get(i).getValAccumulative()); |
|
|
// sum = sum.add(value.get(i).getValAccumulative());
|
|
|
} |
|
|
// }
|
|
|
valueArr.add(sum); |
|
|
// valueArr.add(sum);
|
|
|
if (max[0].compareTo(sum) < 0) { |
|
|
// if (max[0].compareTo(sum) < 0) {
|
|
|
max[0] = sum; |
|
|
// max[0] = sum;
|
|
|
} |
|
|
// }
|
|
|
labelArray.add(label); |
|
|
// labelArray.add(label);
|
|
|
}); |
|
|
// });
|
|
|
labelArray.stream().forEach(label -> label.setMax(max[0])); |
|
|
// labelArray.stream().forEach(label -> label.setMax(max[0]));
|
|
|
heatSuppliedVO.setLabelArr(labelArray); |
|
|
// finishingRateVO.setLabelArr(labelArray);
|
|
|
heatSuppliedVO.setValueArr(valueArr); |
|
|
// finishingRateVO.setValueArr(valueArr);
|
|
|
} |
|
|
// }
|
|
|
return heatSuppliedVO; |
|
|
return finishingRateVO; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public CorporateStatisticsVO getCorporateStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { |
|
|
public CorporateStatisticsVO getCorporateStatistics(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|
CorporateStatisticsDTO corporateStatisticsDTO = new CorporateStatisticsDTO(); |
|
|
CorporateStatisticsVO corporateStatisticsVO = new CorporateStatisticsVO(); |
|
|
corporateStatisticsDTO.setCompanyId(dcBusDataScreenNewReq.getCompanyId()); |
|
|
List<String> names = new ArrayList<>(); |
|
|
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); |
|
|
names.add(ReportNameEnum.HEATING_AREA.getName()); |
|
|
String[] yearMonthDayArr = yearMonthDay.split("-"); |
|
|
names.add(ReportNameEnum.TOTAL_GENERATING_CAPACITY.getName()); |
|
|
if (yearMonthDayArr.length > 1) { |
|
|
names.add(ReportNameEnum.TOTAL_HEAT_PRODUCTION.getName()); |
|
|
corporateStatisticsDTO.setYear(yearMonthDayArr[0]); |
|
|
names.add(ReportNameEnum.TOTAL_HEAT_SUPPLIED.getName()); |
|
|
corporateStatisticsDTO.setMonth(yearMonthDayArr[1]); |
|
|
targetDraftDaynewReqVo.setReportNames(names); |
|
|
|
|
|
targetDraftDaynewReqVo.setAssetLevel(BizConstants.DcAssetLevel.COMPANY); |
|
|
|
|
|
targetDraftDaynewReqVo.setAssetType(BizConstants.DcAssetType.REPORT); |
|
|
|
|
|
List<Long> orgIds = new ArrayList<>(); |
|
|
|
|
|
orgIds.add(targetDraftDaynewReqVo.getOrgId()); |
|
|
|
|
|
targetDraftDaynewReqVo.setOrgIds(orgIds); |
|
|
|
|
|
List<TargetDraftDaynewResVo> targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(targetDraftDaynewReqVo); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(targetDraftDaynewResVos)) { |
|
|
|
|
|
Map<String, BigDecimal> reportMap = targetDraftDaynewResVos.stream().collect(Collectors.toMap(TargetDraftDaynewResVo::getReportName, TargetDraftDaynewResVo::getValueResult)); |
|
|
|
|
|
corporateStatisticsVO.setAcreage(reportMap.get(ReportNameEnum.HEATING_AREA.getName())); |
|
|
|
|
|
corporateStatisticsVO.setOutputOfPlant(reportMap.get(ReportNameEnum.TOTAL_GENERATING_CAPACITY.getName())); |
|
|
|
|
|
corporateStatisticsVO.setCalorificValue(reportMap.get(ReportNameEnum.TOTAL_HEAT_PRODUCTION.getName())); |
|
|
|
|
|
corporateStatisticsVO.setHeatSupplied(reportMap.get(ReportNameEnum.TOTAL_HEAT_SUPPLIED.getName())); |
|
|
} |
|
|
} |
|
|
corporateStatisticsDTO.setAcreage(targetModelConfig.getAcreage()); |
|
|
|
|
|
corporateStatisticsDTO.setOutputOfPlant(targetModelConfig.getOutputOfPlant()); |
|
|
|
|
|
corporateStatisticsDTO.setCalorificValue(targetModelConfig.getCalorific()); |
|
|
|
|
|
corporateStatisticsDTO.setHeatSupplied(targetModelConfig.getHeatSupplied()); |
|
|
|
|
|
CorporateStatisticsVO corporateStatisticsVO = dcBusiTargetDraftDayMapper.getCorporateStatistics(corporateStatisticsDTO); |
|
|
|
|
|
return corporateStatisticsVO; |
|
|
return corporateStatisticsVO; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|