Browse Source

1、bi大屏接口

develop
bobol 10 months ago
parent
commit
a1c1cc3942
  1. 3
      lzbi-common/src/main/java/com/lzbi/common/enums/ReportNameEnum.java
  2. 39
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java
  3. 4
      lzbi-module/src/main/java/com/lzbi/bi/domain/FinishingRateVO.java
  4. 261
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java
  5. 27
      lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewAggregateResVo.java

3
lzbi-common/src/main/java/com/lzbi/common/enums/ReportNameEnum.java

@ -20,7 +20,8 @@ public enum ReportNameEnum
SECOND_NETWORK_WATER_CONSUMPTION_RATE("二次网耗水率"), SECOND_NETWORK_WATER_CONSUMPTION_RATE("二次网耗水率"),
PRIMARY_NET_RECHARGE_WATER("一次网补水量"), PRIMARY_NET_RECHARGE_WATER("一次网补水量"),
DATANG_PRIMARY_NET_RECHARGE_WATER("从大唐补一次网水量"), DATANG_PRIMARY_NET_RECHARGE_WATER("从大唐补一次网水量"),
POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT("热源厂电耗率"); POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT("热源厂电耗率"),
TOTAL_HEAT_SUPPLIED("总供热量");
private final String name; private final String name;

39
lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java

@ -4,11 +4,10 @@ import com.lzbi.bi.domain.DcBusDataScreenNewReq;
import com.lzbi.bi.service.DcBusiDataScreenNewService; import com.lzbi.bi.service.DcBusiDataScreenNewService;
import com.lzbi.common.core.controller.BaseController; import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult; import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 大屏控制器 * 大屏控制器
@ -55,43 +54,43 @@ public class DcBusiDataScreenNewController extends BaseController {
/** /**
* 消耗 * 消耗
* @param dcBusDataScreenNewReq * @param targetDraftDaynewReqVo
* @return * @return
*/ */
@GetMapping("/consumeStatistics") @PostMapping("/consumeStatistics")
public AjaxResult consumeStatistics(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { public AjaxResult consumeStatistics(@Validated @RequestBody TargetDraftDaynewReqVo targetDraftDaynewReqVo) {
return success(dcBusiDataScreenNewService.getConsumesStatistics(dcBusDataScreenNewReq)); return success(dcBusiDataScreenNewService.getConsumesStatistics(targetDraftDaynewReqVo));
} }
/** /**
* 发热量 * 发热量
* @param dcBusDataScreenNewReq * @param targetDraftDaynewReqVo
* @return * @return
*/ */
@GetMapping("/calorificValue") @PostMapping("/calorificValue")
public AjaxResult calorificValue(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { public AjaxResult calorificValue(@Validated @RequestBody TargetDraftDaynewReqVo targetDraftDaynewReqVo) {
return success(dcBusiDataScreenNewService.getCalorificValue(dcBusDataScreenNewReq)); return success(dcBusiDataScreenNewService.getCalorificValue(targetDraftDaynewReqVo));
} }
/** /**
* 供热量 * 完成率
* @param dcBusDataScreenNewReq * @param targetDraftDaynewReqVo
* @return * @return
*/ */
@GetMapping("/heatSupplied") @PostMapping("/finishingRate")
public AjaxResult heatSupplied(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { public AjaxResult finishingRate(@Validated @RequestBody TargetDraftDaynewReqVo targetDraftDaynewReqVo) {
return success(dcBusiDataScreenNewService.getHeatSupplied(dcBusDataScreenNewReq)); return success(dcBusiDataScreenNewService.getFinishingRate(targetDraftDaynewReqVo));
} }
/** /**
* 公司统计 * 公司统计
* @param dcBusDataScreenNewReq * @param targetDraftDaynewReqVo
* @return * @return
*/ */
@GetMapping("/corporateStatistics") @PostMapping("/corporateStatistics")
public AjaxResult corporateStatistics(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { public AjaxResult corporateStatistics(@Validated @RequestBody TargetDraftDaynewReqVo targetDraftDaynewReqVo) {
return success(dcBusiDataScreenNewService.getCorporateStatistics(dcBusDataScreenNewReq)); return success(dcBusiDataScreenNewService.getCorporateStatistics(targetDraftDaynewReqVo));
} }
} }

4
lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java → lzbi-module/src/main/java/com/lzbi/bi/domain/FinishingRateVO.java

@ -8,10 +8,10 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
* 供热量 * 完成率
*/ */
@Data @Data
public class HeatSuppliedVO { public class FinishingRateVO {
private List<Label> labelArr; private List<Label> labelArr;

261
lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java

@ -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("该公司无热源");
} }
consumesStatisticsDTO.setElectricityConsumes(targetModelConfig.getElectricityConsumes()); List<Long> orgIds = childrenDept.stream().map(SysDept::getDeptId).collect(Collectors.toList());
consumesStatisticsDTO.setWaterConsumes(targetModelConfig.getWaterConsumes()); List<String> names = new ArrayList<>();
consumesStatisticsDTO.setCoalConsumes(targetModelConfig.getCoalConsumes()); names.add(ReportNameEnum.PRIMARY_NET_RECHARGE_WATER.getName());
return dcBusiTargetDraftDayMapper.getConsumesStatistics(consumesStatisticsDTO); 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);
});
}
return list;
} }
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]);
} }
params.setTargetModelCode(targetModelConfig.getCalorific()); List<Long> orgIds = childrenDept.stream().map(SysDept::getDeptId).collect(Collectors.toList());
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params); List<String> names = new ArrayList<>();
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) { names.add(ReportNameEnum.TOTAL_HEAT_PRODUCTION.getName());
Map<Object, List<DcBusiTargetDraftDay>> map; targetDraftDaynewReqVo.setReportNames(names);
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { targetDraftDaynewReqVo.setAssetLevel(BizConstants.DcAssetLevel.HEAT_SOURCE);
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId)); targetDraftDaynewReqVo.setAssetType(BizConstants.DcAssetType.REPORT);
} else { targetDraftDaynewReqVo.setOrgIds(orgIds);
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode)); List<TargetDraftDaynewResVo> targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(targetDraftDaynewReqVo);
} if (CollectionUtils.isNotEmpty(targetDraftDaynewResVos)) {
AtomicReference<BigDecimal> total = new AtomicReference<>(new BigDecimal(0)); final BigDecimal[] sum = {new BigDecimal(0)};
map.forEach((key, value) -> { targetDraftDaynewResVos.stream().forEach(item -> sum[0] = sum[0].add(item.getValueResult()));
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;
} }
} }

27
lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewAggregateResVo.java

@ -0,0 +1,27 @@
package com.lzbi.draft.domain.vo;
import com.lzbi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
public class TargetDraftDaynewAggregateResVo {
@ApiModelProperty(name = "组织Id",notes = "organizeId")
private String organizeId;
@ApiModelProperty(name = "组织名称",notes = "organizeName")
private String organizeName;
@ApiModelProperty(name = "图表名称",notes = "reportName")
private String reportName;
@ApiModelProperty(name = "指标结果值",notes = "valueResult")
private BigDecimal valueResult = BigDecimal.ZERO;
@ApiModelProperty(name = "指标计划值",notes = "valueResult")
private BigDecimal valuePlan = BigDecimal.ZERO;
@Excel(name = "单位")
private String targetUnit;
}
Loading…
Cancel
Save