|
@@ -1,20 +1,27 @@
|
|
|
package com.gyee.runeconomy.service.auto.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.gyee.backconfig.model.auto.ProBasicOrganizeTree;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.runeconomy.dto.response.ProEconPointCodeDTO;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
-import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.mapper.auto.ProEconPointCodeMapper;
|
|
|
+import com.gyee.runeconomy.model.auto.ProEconPointCode;
|
|
|
+import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay1;
|
|
|
+import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay4;
|
|
|
+import com.gyee.runeconomy.service.auto.IProBasicOrganizeTreeService;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPointCodeService;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay1Service;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay4Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Comparator;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -38,7 +45,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
@Autowired
|
|
|
private IProEconPowerstationInfoDay4Service proEconPowerstationInfoDay4Service;
|
|
|
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private IProBasicOrganizeTreeService proBasicOrganizeTreeService;
|
|
|
|
|
|
@Override
|
|
|
public List<ProEconPointCode> getEconPointCodeList() {
|
|
@@ -60,7 +68,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
|
|
|
@Override
|
|
|
public List<ProEconPointCodeDTO> getEconPointRanking(String regionId, String companyId, String pointCode, Date date, String dateType, boolean popup,String statype) {
|
|
|
- List<ProBasicPowerstation> powerstationList = proBasicPowerstationService.getProBasicPowerstationlist(regionId, companyId, statype);
|
|
|
+
|
|
|
+ List<ProBasicOrganizeTree> powerstationList = proBasicOrganizeTreeService.getProBasicPowerstationlist(regionId, companyId, statype);
|
|
|
|
|
|
ProEconPointCode proEconPointCode = getProEconPointCode(pointCode);
|
|
|
if (null == proEconPointCode){
|
|
@@ -122,7 +131,7 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
|
|
|
|
|
|
List<String> newsto = dtos.stream().map(ProEconPointCodeDTO::getStationcode).collect(Collectors.toList());
|
|
|
- List<String> newsta = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ List<String> newsta = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
List<String> reduce1 = newsta.stream().filter(item -> !newsto.contains(item)).collect(Collectors.toList());
|
|
|
for (String i : reduce1) {
|
|
|
ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
|
|
@@ -142,8 +151,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
/**
|
|
|
* 发电量
|
|
|
*/
|
|
|
- private List<ProEconPointCodeDTO> fdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> fdl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -175,8 +184,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
/**
|
|
|
* 欠发电量
|
|
|
*/
|
|
|
- private List<ProEconPointCodeDTO> qfdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> qfdl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -205,8 +214,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
|
|
|
|
|
|
// 风能利用率
|
|
|
- private List<ProEconPointCodeDTO> fnlyl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> fnlyl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -243,8 +252,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
/**
|
|
|
* 受累损失电量
|
|
|
*/
|
|
|
- private List<ProEconPointCodeDTO> slssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> slssdl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -273,8 +282,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
|
|
|
|
|
|
/** 检修损失电量 */
|
|
|
- private List<ProEconPointCodeDTO> jxssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> jxssdl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -302,8 +311,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 限电损失电量*/
|
|
|
- private List<ProEconPointCodeDTO> xdjclssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> xdjclssdl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -331,8 +340,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 故障损失电量*/
|
|
|
- private List<ProEconPointCodeDTO> gzssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> gzssdl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -360,8 +369,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 性能损失电量*/
|
|
|
- private List<ProEconPointCodeDTO> xnssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> xnssdl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -389,8 +398,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 复位及时率 */
|
|
|
- private List<ProEconPointCodeDTO> fwjsl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> fwjsl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay4> list = proEconPowerstationInfoDay4Service.getEconThreeRateCurvelist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -418,8 +427,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 状态转换及时率 */
|
|
|
- private List<ProEconPointCodeDTO> ztzhjsl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> ztzhjsl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay4> list = proEconPowerstationInfoDay4Service.getEconThreeRateCurvelist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -447,8 +456,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 故障消缺及时率 */
|
|
|
- private List<ProEconPointCodeDTO> gzxqjsl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> gzxqjsl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay4> list = proEconPowerstationInfoDay4Service.getEconThreeRateCurvelist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -476,8 +485,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 受累损失率 */
|
|
|
- private List<ProEconPointCodeDTO> slssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> slssl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -508,8 +517,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 检修损失率 */
|
|
|
- private List<ProEconPointCodeDTO> jxssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> jxssl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -540,8 +549,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 限电损失率 */
|
|
|
- private List<ProEconPointCodeDTO> xdjclssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> xdjclssl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -570,8 +579,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 故障损失率*/
|
|
|
- private List<ProEconPointCodeDTO> gzssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> gzssl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|
|
@@ -600,8 +609,8 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
/** 性能损失率 */
|
|
|
- private List<ProEconPointCodeDTO> xnssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
- List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
|
|
|
+ private List<ProEconPointCodeDTO> xnssl(List<ProBasicOrganizeTree> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
|
|
|
+ List<String> stationlist = powerstationList.stream().map(ProBasicOrganizeTree::getNemCode).collect(Collectors.toList());
|
|
|
|
|
|
List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
|
|
|
List<ProEconPointCodeDTO> dtos = new ArrayList<>();
|