|
@@ -37,8 +37,12 @@ public class SingleAnalysisService {
|
|
|
if(StringUtils.notEmp(wpId))
|
|
|
{
|
|
|
QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("types",type).eq("record_date",recordDate)
|
|
|
- .eq("company_id",cmId).eq("windpowerstation_id",wpId);
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("windpowerstation_id",wpId);
|
|
|
+ if(StringUtils.notEmp(type) && !type.equals("0"))
|
|
|
+ {
|
|
|
+ queryWrapper.eq("types",type);
|
|
|
+ }
|
|
|
iostls= proEconInOrOutSpeedTotalService.list(queryWrapper);
|
|
|
// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
// && i.getCompanyId().equals(cmId)
|
|
@@ -46,11 +50,31 @@ public class SingleAnalysisService {
|
|
|
// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
// )
|
|
|
// .collect(Collectors.toList());
|
|
|
- }else
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.cpmap.containsKey(cmId))
|
|
|
{
|
|
|
QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("types",type).eq("record_date",recordDate)
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
.eq("company_id",cmId);
|
|
|
+ if(StringUtils.notEmp(type) && !type.equals("0"))
|
|
|
+ {
|
|
|
+ queryWrapper.eq("types",type);
|
|
|
+ }
|
|
|
+ iostls= proEconInOrOutSpeedTotalService.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getTypes().equals(type)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.rgmap.containsKey(cmId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("region_Id",cmId);
|
|
|
+ if(StringUtils.notEmp(type) && !type.equals("0"))
|
|
|
+ {
|
|
|
+ queryWrapper.eq("types",type);
|
|
|
+ }
|
|
|
iostls= proEconInOrOutSpeedTotalService.list(queryWrapper);
|
|
|
// .stream().filter(i-> i.getCompanyId().equals(cmId)
|
|
|
// && i.getTypes().equals(type)
|
|
@@ -73,25 +97,41 @@ public class SingleAnalysisService {
|
|
|
{
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("record_date",recordDate)
|
|
|
- .eq("company_id",cmId).eq("windpowerstation_id",wpId);
|
|
|
+ .eq("windpowerstation_id",wpId);
|
|
|
+
|
|
|
iostls= proEconEquipmentInfoDay1Service.list(queryWrapper);
|
|
|
// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
// && i.getCompanyId().equals(cmId)
|
|
|
// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
// )
|
|
|
// .collect(Collectors.toList());
|
|
|
- }else
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.cpmap.containsKey(cmId))
|
|
|
{
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("record_date",recordDate)
|
|
|
.eq("company_id",cmId);
|
|
|
+
|
|
|
iostls= proEconEquipmentInfoDay1Service.list(queryWrapper);
|
|
|
-// .stream().filter(i-> i.getCompanyId().equals(cmId)
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.rgmap.containsKey(cmId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("region_Id",cmId);
|
|
|
+
|
|
|
+ iostls= proEconEquipmentInfoDay1Service.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && 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));
|
|
@@ -105,18 +145,32 @@ public class SingleAnalysisService {
|
|
|
{
|
|
|
QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("record_date",recordDate)
|
|
|
- .eq("company_id",cmId).eq("windpowerstation_id",wpId);
|
|
|
+ .eq("windpowerstation_id",wpId);
|
|
|
+
|
|
|
iostls= proEconEquipmentInfoDay2Service.list(queryWrapper);
|
|
|
// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
// && i.getCompanyId().equals(cmId)
|
|
|
// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
// )
|
|
|
// .collect(Collectors.toList());
|
|
|
- }else
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.cpmap.containsKey(cmId))
|
|
|
{
|
|
|
QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("record_date",recordDate)
|
|
|
.eq("company_id",cmId);
|
|
|
+
|
|
|
+ iostls= proEconEquipmentInfoDay2Service.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.rgmap.containsKey(cmId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("region_Id",cmId);
|
|
|
+
|
|
|
iostls= proEconEquipmentInfoDay2Service.list(queryWrapper);
|
|
|
// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
// && i.getCompanyId().equals(cmId)
|
|
@@ -129,14 +183,87 @@ public class SingleAnalysisService {
|
|
|
collect(Collectors.toMap(ProEconEquipmentInfoDay2::getWindturbineId, Function.identity(), (key1, key2) -> key2));
|
|
|
return iostmap;
|
|
|
}
|
|
|
- private Map<String, ProEconPowerstationInfoDay5> queryPowerstationInfoDay5(String cmId, Date recordDate) {
|
|
|
+ private Map<String, ProEconPowerstationInfoDay5> queryPowerstationInfoDay5(String cmId,String type,String wpId, Date recordDate) {
|
|
|
|
|
|
|
|
|
List<ProEconPowerstationInfoDay5> iostls=null;
|
|
|
- QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("record_date",recordDate).isNotNull("company_id")
|
|
|
- .eq("company_id",cmId);
|
|
|
- iostls= proEconPowerstationInfoDay5Service.list(queryWrapper);
|
|
|
+ if(StringUtils.notEmp(wpId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("windpowerstation_id",wpId);
|
|
|
+ if(StringUtils.notEmp(type) )
|
|
|
+ {
|
|
|
+ queryWrapper.eq("foreign_key_id",wpId+type);
|
|
|
+ }
|
|
|
+ iostls= proEconPowerstationInfoDay5Service.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.cpmap.containsKey(cmId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("company_id",cmId);
|
|
|
+ if(StringUtils.notEmp(type) )
|
|
|
+ {
|
|
|
+ queryWrapper.eq("foreign_key_id",cmId+type);
|
|
|
+ }
|
|
|
+ iostls= proEconPowerstationInfoDay5Service.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.rgmap.containsKey(cmId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("region_Id",cmId);
|
|
|
+ if(StringUtils.notEmp(type) )
|
|
|
+ {
|
|
|
+ queryWrapper.eq("foreign_key_id",cmId+type);
|
|
|
+ }
|
|
|
+ iostls= proEconPowerstationInfoDay5Service.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+// .stream().filter(i->
|
|
|
+// i.getCompanyId() !=null
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ //List转map
|
|
|
+ Map<String, ProEconPowerstationInfoDay5> iostmap=iostls.stream().
|
|
|
+ collect(Collectors.toMap(ProEconPowerstationInfoDay5::getWindpowerstationId, Function.identity(), (key1, key2) -> key2));
|
|
|
+ return iostmap;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, ProEconPowerstationInfoDay5> queryPowerstationInfoDay5(String wpId, Date recordDate) {
|
|
|
+
|
|
|
+
|
|
|
+ List<ProEconPowerstationInfoDay5> iostls=new ArrayList<>();
|
|
|
+ if(StringUtils.notEmp(wpId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("windpowerstation_id",wpId);
|
|
|
+
|
|
|
+ iostls= proEconPowerstationInfoDay5Service.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
// .stream().filter(i->
|
|
|
// i.getCompanyId() !=null
|
|
|
// && i.getCompanyId().equals(cmId)
|
|
@@ -157,20 +284,35 @@ public class SingleAnalysisService {
|
|
|
{
|
|
|
QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("record_date",recordDate)
|
|
|
- .eq("company_id",cmId).eq("windpowerstation_id",wpId);
|
|
|
+ .eq("windpowerstation_id",wpId);
|
|
|
+
|
|
|
iostls= proEconEquipmentInfoDay4Service.list(queryWrapper);
|
|
|
// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
// && i.getCompanyId().equals(cmId)
|
|
|
// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
// )
|
|
|
// .collect(Collectors.toList());
|
|
|
- }else
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.cpmap.containsKey(cmId))
|
|
|
{
|
|
|
QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("record_date",recordDate)
|
|
|
- .eq("company_id",cmId).eq("windpowerstation_id",wpId);
|
|
|
+ .eq("company_id",cmId);
|
|
|
+
|
|
|
iostls= proEconEquipmentInfoDay4Service.list(queryWrapper);
|
|
|
-// .stream().filter(i-> i.getCompanyId().equals(cmId)
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
+// )
|
|
|
+// .collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.notEmp(cmId) && CacheContext.rgmap.containsKey(cmId))
|
|
|
+ {
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",recordDate)
|
|
|
+ .eq("region_Id",cmId);
|
|
|
+
|
|
|
+ iostls= proEconEquipmentInfoDay4Service.list(queryWrapper);
|
|
|
+// .stream().filter(i->i.getWindpowerstationId().equals(wpId)
|
|
|
+// && i.getCompanyId().equals(cmId)
|
|
|
// && i.getRecordDate().compareTo(recordDate) == 0
|
|
|
// )
|
|
|
// .collect(Collectors.toList());
|
|
@@ -258,7 +400,7 @@ public class SingleAnalysisService {
|
|
|
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, ProEconPowerstationInfoDay5> pwday5map = queryPowerstationInfoDay5(cmId,type,wpId, recordDate);
|
|
|
Map<String, ProEconEquipmentInfoDay4> eqday4map = queryEquipmentInfoDay4(cmId,type,wpId, recordDate);
|
|
|
|
|
|
List<ProBasicEquipment> wtls =new ArrayList<>();
|
|
@@ -648,7 +790,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.getCompanyId(), recordDate);
|
|
|
+ Map<String, ProEconPowerstationInfoDay5> pwday5map = queryPowerstationInfoDay5(wt.getWindpowerstationId(), recordDate);
|
|
|
String wpId = CacheContext.wtmap.get(wtId).getWindpowerstationId();
|
|
|
|
|
|
|