|
@@ -1,12 +1,12 @@
|
|
|
package com.gyee.runeconomy.service.homepage;
|
|
|
|
|
|
|
|
|
+import com.gyee.backconfig.model.auto.ProBasicOrganizeTree;
|
|
|
import com.gyee.common.util.DateUtils;
|
|
|
import com.gyee.runeconomy.dto.response.EconHomePagePointRateDTO;
|
|
|
import com.gyee.runeconomy.dto.response.ProEconPointCodeDTO;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.auto.*;
|
|
|
-import jdk.nashorn.internal.runtime.regexp.joni.constants.StackType;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -48,6 +48,9 @@ public class EconomyPointHomePageService {
|
|
|
@Autowired
|
|
|
private IProEconPointCodeService proEconPointCodeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IProBasicOrganizeTreeService proBasicOrganizeTreeService;
|
|
|
+
|
|
|
/**
|
|
|
* 指标率相应类
|
|
|
*/
|
|
@@ -144,10 +147,10 @@ public class EconomyPointHomePageService {
|
|
|
wstimemap = proEconPowerstationInfoDay2Service.getEconFiveLossTime(foreignKeyId, staType, dateType, date);
|
|
|
|
|
|
/** 装机容量 */
|
|
|
- capacity = new BigDecimal(proBasicCompanyService.getProBasicCompanyCapacity("", foreignKeyId));
|
|
|
+ capacity = new BigDecimal(proBasicOrganizeTreeService.getProBasicCompanyCapacity("", foreignKeyId));
|
|
|
|
|
|
/**装机数量*/
|
|
|
- quantity = proBasicCompanyService.getProBasicCompanyQuantity("", foreignKeyId);
|
|
|
+ quantity = proBasicOrganizeTreeService.getProBasicCompanyQuantity("", foreignKeyId);
|
|
|
//综合场用电量
|
|
|
zhcydllist = proEconPowerstationInfoDay5Service.getEconZhcydldb(foreignKeyId, staType, dateType, date);
|
|
|
|
|
@@ -237,8 +240,8 @@ public class EconomyPointHomePageService {
|
|
|
stainfo = new ArrayList<>();
|
|
|
//电量统计分析
|
|
|
Map<String, ProEconPowerstationInfoDay1> stamap = new HashMap<>();//场站站五损电量
|
|
|
- List<ProBasicPowerstation> powerstationList = proBasicPowerstationService.getProBasicPowerstationlist("", foreignKeyId, staType);
|
|
|
- List<String> prids = powerstationList.stream().map(ProBasicPowerstation::getId).collect(Collectors.toList());
|
|
|
+ List<ProBasicOrganizeTree> powerstationList = proBasicOrganizeTreeService.getProBasicPowerstationlist("", foreignKeyId, staType);
|
|
|
+ List<String> prids = powerstationList.stream().map(ProBasicOrganizeTree::getId).collect(Collectors.toList());
|
|
|
List<ProEconPowerstationInfoDay1> stafnlyl = proEconPowerstationInfoDay1Service.getEconFiveLosslist(prids, date);
|
|
|
stafnlyl.stream().forEach(s -> {
|
|
|
stamap.put(s.getForeignKeyId(), s);
|
|
@@ -248,11 +251,15 @@ public class EconomyPointHomePageService {
|
|
|
Map<String, Object> info = new HashMap<>();
|
|
|
ProEconPowerstationInfoDay1 day1 = stamap.get(p.getId());
|
|
|
info.put("aname", p.getAname());
|
|
|
- info.put("name", p.getName());
|
|
|
+ info.put("name", p.getAname());
|
|
|
info.put("nemCode", p.getNemCode());
|
|
|
- info.put("capacity", (p.getJrwindCapacity() + p.getJrCapacity()) / 10000);
|
|
|
- info.put("xPoint",p.getXEmPoint());
|
|
|
- info.put("yPoint",p.getYEmPoint());
|
|
|
+ if (p.getJrWindCapacity() != null && p.getJrCapacity() != null) {
|
|
|
+ info.put("capacity", (p.getJrWindCapacity() + p.getJrCapacity()) / 10000);
|
|
|
+ }else {
|
|
|
+ info.put("capacity", 0.0);
|
|
|
+ }
|
|
|
+ info.put("xPoint",p.getXPoint());
|
|
|
+ info.put("yPoint",p.getYPoint());
|
|
|
if (null != day1) {
|
|
|
info.put("fdl", day1.getRfdl().divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP));
|
|
|
info.put("fnlyl", compare0(day1.getRllfdl()) ? compare100(day1.getRfdl().divide(day1.getRllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))) : new BigDecimal(0));
|