|
@ -2,28 +2,21 @@ package com.lzbi.bi.service; |
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import com.lzbi.bi.domain.*; |
|
|
import com.lzbi.bi.domain.*; |
|
|
import com.lzbi.common.config.TargetModelConfig; |
|
|
|
|
|
import com.lzbi.common.constant.BizConstants; |
|
|
import com.lzbi.common.constant.BizConstants; |
|
|
import com.lzbi.common.core.domain.entity.SysDept; |
|
|
import com.lzbi.common.core.domain.entity.SysDept; |
|
|
import com.lzbi.common.enums.ReportNameEnum; |
|
|
import com.lzbi.common.enums.ReportNameEnum; |
|
|
import com.lzbi.common.utils.bean.BeanUtils; |
|
|
|
|
|
import com.lzbi.draft.domain.DcBusiTargetDraftDay; |
|
|
|
|
|
import com.lzbi.draft.domain.DcBusiTargetDraftMonth; |
|
|
|
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo; |
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo; |
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo; |
|
|
import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo; |
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper; |
|
|
import com.lzbi.draft.domain.vo.TargetDraftMonthAggregateResVo; |
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; |
|
|
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; |
|
|
import com.lzbi.draft.service.DcBusiTargetDraftDaynewService; |
|
|
import com.lzbi.draft.service.DcBusiTargetDraftDaynewService; |
|
|
import com.lzbi.system.service.ISysDeptService; |
|
|
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.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
@ -40,12 +33,6 @@ import static java.util.stream.Collectors.groupingBy; |
|
|
@Service |
|
|
@Service |
|
|
public class DcBusiDataScreenNewService { |
|
|
public class DcBusiDataScreenNewService { |
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private TargetModelConfig targetModelConfig; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
@Resource |
|
|
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper; |
|
|
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper; |
|
|
|
|
|
|
|
@ -205,8 +192,8 @@ public class DcBusiDataScreenNewService { |
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public FinishingRateVO getFinishingRate(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|
public FinishingRate getFinishingRate(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|
FinishingRateVO finishingRateVO = new FinishingRateVO(); |
|
|
FinishingRate finishingRate = new FinishingRate(); |
|
|
// DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
|
|
|
// DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
|
|
|
// BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
|
|
|
// BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
|
|
|
// String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
|
|
|
// String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
|
|
@ -224,11 +211,11 @@ public class DcBusiDataScreenNewService { |
|
|
// } else {
|
|
|
// } else {
|
|
|
// map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
|
|
|
// map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
|
|
|
// }
|
|
|
// }
|
|
|
// List<FinishingRateVO.Label> labelArray = new ArrayList<>();
|
|
|
// List<FinishingRate.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) -> {
|
|
|
// FinishingRateVO.Label label = new FinishingRateVO.Label();
|
|
|
// FinishingRate.Label label = new FinishingRate.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 {
|
|
@ -245,10 +232,25 @@ public class DcBusiDataScreenNewService { |
|
|
// labelArray.add(label);
|
|
|
// labelArray.add(label);
|
|
|
// });
|
|
|
// });
|
|
|
// labelArray.stream().forEach(label -> label.setMax(max[0]));
|
|
|
// labelArray.stream().forEach(label -> label.setMax(max[0]));
|
|
|
// finishingRateVO.setLabelArr(labelArray);
|
|
|
// finishingRate.setLabelArr(labelArray);
|
|
|
// finishingRateVO.setValueArr(valueArr);
|
|
|
// finishingRate.setValueArr(valueArr);
|
|
|
// }
|
|
|
// }
|
|
|
return finishingRateVO; |
|
|
List<String> names = new ArrayList<>(); |
|
|
|
|
|
names.add(ReportNameEnum.FIRST_NETWORK_WATER_CONSUMPTION_RATE.getName()); |
|
|
|
|
|
names.add(ReportNameEnum.SECOND_NETWORK_WATER_CONSUMPTION_RATE.getName()); |
|
|
|
|
|
names.add(ReportNameEnum.POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT.getName()); |
|
|
|
|
|
names.add(ReportNameEnum.SECOND_NETWORK_ELECTRICITY_CONSUMPTION_RATE.getName()); |
|
|
|
|
|
names.add(ReportNameEnum.COAL_CONSUMPTION_PER_UNIT.getName()); |
|
|
|
|
|
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); |
|
|
|
|
|
List<TargetDraftMonthAggregateResVo> targetDraftMonthAggregateResVos = dcBusiTargetDraftMonthMapper.selectDcBusiTargetDraftMontAggregateList(targetDraftDaynewReqVo); |
|
|
|
|
|
|
|
|
|
|
|
return finishingRate; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public CorporateStatisticsVO getCorporateStatistics(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|
public CorporateStatisticsVO getCorporateStatistics(TargetDraftDaynewReqVo targetDraftDaynewReqVo) { |
|
|