|
@@ -30,52 +30,95 @@ public class SingleAnalysisService {
|
|
|
@Resource
|
|
|
private IProEconPowerstationInfoDay5Service proEconPowerstationInfoDay5Service;
|
|
|
|
|
|
- private Map<String, ProEconInOrOutSpeedTotal> queryInOrOutSpeedTotal(String wpId, Date recordDate) {
|
|
|
+ private Map<String, ProEconInOrOutSpeedTotal> queryInOrOutSpeedTotal(String cmId,String type,String wpId, Date recordDate) {
|
|
|
+
|
|
|
+ List<ProEconInOrOutSpeedTotal> iostls=null;
|
|
|
+ if(StringUtils.notEmp(wpId))
|
|
|
+ {
|
|
|
+ iostls= proEconInOrOutSpeedTotalService.list()
|
|
|
+ .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+ && i.getCompanyId().equals(cmId)
|
|
|
+ && i.getTypes().equals(type)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ iostls= proEconInOrOutSpeedTotalService.list()
|
|
|
+ .stream().filter(i-> i.getCompanyId().equals(cmId)
|
|
|
+ && i.getTypes().equals(type)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
|
|
|
- List<ProEconInOrOutSpeedTotal> iostls= proEconInOrOutSpeedTotalService.list()
|
|
|
- .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
- && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
- )
|
|
|
- .collect(Collectors.toList());
|
|
|
//List转map
|
|
|
Map<String, ProEconInOrOutSpeedTotal> iostmap=iostls.stream().
|
|
|
collect(Collectors.toMap(ProEconInOrOutSpeedTotal::getWindturbineId, Function.identity(), (key1, key2) -> key2));
|
|
|
return iostmap;
|
|
|
}
|
|
|
|
|
|
- private Map<String, ProEconEquipmentInfoDay1> queryEquipmentInfoDay1(String wpId, Date recordDate) {
|
|
|
+ private Map<String, ProEconEquipmentInfoDay1> queryEquipmentInfoDay1(String cmId,String type,String wpId, Date recordDate) {
|
|
|
|
|
|
|
|
|
- List<ProEconEquipmentInfoDay1> iostls= proEconEquipmentInfoDay1Service.list()
|
|
|
- .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
- && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
- )
|
|
|
- .collect(Collectors.toList());
|
|
|
+ List<ProEconEquipmentInfoDay1> iostls=null;
|
|
|
+ if(StringUtils.notEmp(wpId))
|
|
|
+ {
|
|
|
+ iostls= proEconEquipmentInfoDay1Service.list()
|
|
|
+ .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+ && i.getCompanyId().equals(cmId)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ iostls= proEconEquipmentInfoDay1Service.list()
|
|
|
+ .stream().filter(i-> i.getCompanyId().equals(cmId)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
//List转map
|
|
|
Map<String, ProEconEquipmentInfoDay1> iostmap=iostls.stream().
|
|
|
collect(Collectors.toMap(ProEconEquipmentInfoDay1::getWindturbineId, Function.identity(), (key1, key2) -> key2));
|
|
|
return iostmap;
|
|
|
}
|
|
|
- private Map<String, ProEconEquipmentInfoDay2> queryEquipmentInfoDay2(String wpId, Date recordDate) {
|
|
|
+ private Map<String, ProEconEquipmentInfoDay2> queryEquipmentInfoDay2(String cmId,String type,String wpId, Date recordDate) {
|
|
|
|
|
|
- List<ProEconEquipmentInfoDay2> iostls= proEconEquipmentInfoDay2Service.list()
|
|
|
- .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
- && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
- )
|
|
|
- .collect(Collectors.toList());
|
|
|
+ List<ProEconEquipmentInfoDay2> iostls=null;
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(wpId))
|
|
|
+ {
|
|
|
+ iostls= proEconEquipmentInfoDay2Service.list()
|
|
|
+ .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+ && i.getCompanyId().equals(cmId)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ iostls= proEconEquipmentInfoDay2Service.list()
|
|
|
+ .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+ && i.getCompanyId().equals(cmId)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
//List转map
|
|
|
Map<String, ProEconEquipmentInfoDay2> iostmap=iostls.stream().
|
|
|
collect(Collectors.toMap(ProEconEquipmentInfoDay2::getWindturbineId, Function.identity(), (key1, key2) -> key2));
|
|
|
return iostmap;
|
|
|
}
|
|
|
- private Map<String, ProEconPowerstationInfoDay5> queryPowerstationInfoDay5(String wpId, Date recordDate) {
|
|
|
+ private Map<String, ProEconPowerstationInfoDay5> queryPowerstationInfoDay5(String cmId, Date recordDate) {
|
|
|
|
|
|
|
|
|
- List<ProEconPowerstationInfoDay5> iostls= proEconPowerstationInfoDay5Service.list()
|
|
|
+ List<ProEconPowerstationInfoDay5> iostls=null;
|
|
|
+ iostls= proEconPowerstationInfoDay5Service.list()
|
|
|
.stream().filter(i->
|
|
|
- i.getWindpowerstationId() !=null
|
|
|
- && i.getWindpowerstationId().equals(wpId)
|
|
|
- && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ i.getCompanyId() !=null
|
|
|
+ && i.getCompanyId().equals(cmId)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
)
|
|
|
.collect(Collectors.toList());
|
|
|
//List转map
|
|
@@ -84,14 +127,26 @@ public class SingleAnalysisService {
|
|
|
return iostmap;
|
|
|
}
|
|
|
|
|
|
- private Map<String, ProEconEquipmentInfoDay4> queryEquipmentInfoDay4(String wpId, Date recordDate) {
|
|
|
+ private Map<String, ProEconEquipmentInfoDay4> queryEquipmentInfoDay4(String cmId,String type,String wpId, Date recordDate) {
|
|
|
|
|
|
|
|
|
- List<ProEconEquipmentInfoDay4> iostls= proEconEquipmentInfoDay4Service.list()
|
|
|
- .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
- && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
- )
|
|
|
- .collect(Collectors.toList());
|
|
|
+ List<ProEconEquipmentInfoDay4> iostls= null;
|
|
|
+ if(StringUtils.notEmp(wpId))
|
|
|
+ {
|
|
|
+ iostls= proEconEquipmentInfoDay4Service.list()
|
|
|
+ .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+ && i.getCompanyId().equals(cmId)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ iostls= proEconEquipmentInfoDay4Service.list()
|
|
|
+ .stream().filter(i-> i.getCompanyId().equals(cmId)
|
|
|
+ && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+ )
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
//List转map
|
|
|
Map<String, ProEconEquipmentInfoDay4> iostmap=iostls.stream().
|
|
|
collect(Collectors.toMap(ProEconEquipmentInfoDay4::getWindturbineId, Function.identity(), (key1, key2) -> key2));
|
|
@@ -157,17 +212,17 @@ public class SingleAnalysisService {
|
|
|
|
|
|
|
|
|
|
|
|
- public List<SingleAnalysisVo> SingleAnalysisList(Integer pageNum, Integer pageSize, String wpId,Date recordDate) {
|
|
|
+ public List<SingleAnalysisVo> SingleAnalysisList(Integer pageNum, Integer pageSize, String cmId,String type, String wpId,Date recordDate) {
|
|
|
|
|
|
List<SingleAnalysisVo> vos = new ArrayList<>();
|
|
|
|
|
|
if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recordDate) ) {
|
|
|
|
|
|
- Map<String, ProEconInOrOutSpeedTotal> iostmap=queryInOrOutSpeedTotal(wpId, recordDate);
|
|
|
- Map<String, ProEconEquipmentInfoDay1> eqday1map = queryEquipmentInfoDay1(wpId, recordDate);
|
|
|
- Map<String, ProEconEquipmentInfoDay2> eqday2map = queryEquipmentInfoDay2(wpId, recordDate);
|
|
|
- Map<String, ProEconPowerstationInfoDay5> pwday5map = queryPowerstationInfoDay5(wpId, recordDate);
|
|
|
- Map<String, ProEconEquipmentInfoDay4> eqday4map = queryEquipmentInfoDay4(wpId, recordDate);
|
|
|
+ Map<String, ProEconInOrOutSpeedTotal> iostmap=queryInOrOutSpeedTotal(cmId,type,wpId, recordDate);
|
|
|
+ Map<String, ProEconEquipmentInfoDay1> eqday1map = queryEquipmentInfoDay1(cmId,type,wpId, recordDate);
|
|
|
+ Map<String, ProEconEquipmentInfoDay2> eqday2map = queryEquipmentInfoDay2(cmId,type,wpId, recordDate);
|
|
|
+ Map<String, ProEconPowerstationInfoDay5> pwday5map = queryPowerstationInfoDay5(cmId, recordDate);
|
|
|
+ Map<String, ProEconEquipmentInfoDay4> eqday4map = queryEquipmentInfoDay4(cmId,type,wpId, recordDate);
|
|
|
|
|
|
|
|
|
if (CacheContext.wpwtmap.containsKey(wpId)) {
|
|
@@ -530,7 +585,7 @@ public class SingleAnalysisService {
|
|
|
Map<String, ProEconEquipmentInfoDay1> eqday1map = queryEquipmentInfoDay1ByWt(wtId, recordDate);
|
|
|
Map<String, ProEconEquipmentInfoDay2> eqday2map = queryEquipmentInfoDay2ByWt(wtId, recordDate);
|
|
|
Map<String, ProEconEquipmentInfoDay4> eqday4map = queryEquipmentInfoDay4ByWt(wtId, recordDate);
|
|
|
- Map<String, ProEconPowerstationInfoDay5> pwday5map = queryPowerstationInfoDay5(wt.getWindpowerstationId(), recordDate);
|
|
|
+ Map<String, ProEconPowerstationInfoDay5> pwday5map = queryPowerstationInfoDay5(wt.getCompanyId(), recordDate);
|
|
|
String wpId = CacheContext.wtmap.get(wtId).getWindpowerstationId();
|
|
|
|
|
|
|
|
@@ -676,7 +731,7 @@ public class SingleAnalysisService {
|
|
|
|
|
|
|
|
|
List<ProEconEquipmentInfoDay1> wtday1ls = proEconEquipmentInfoDay1Service.list()
|
|
|
- .stream().filter(i->i.getWindturbineId().equals(wtId)
|
|
|
+ .stream().filter(i->i.getWindturbineId() !=null && i.getWindturbineId().equals(wtId)
|
|
|
&& ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
|
|
|
&& (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
|
|
|
)
|