|
@@ -82,13 +82,57 @@ public class GhostService {
|
|
|
|
|
|
|
|
|
|
|
|
+// for(Faultrecord fr:resultList)
|
|
|
+// {
|
|
|
+// if(StringUtils.notEmp(fr.getFaultduration()))
|
|
|
+// {
|
|
|
+// QueryWrapper<Windpowerinfoday> windturbineinfodayQueryWrapper = new QueryWrapper<>();
|
|
|
+// windturbineinfodayQueryWrapper.eq("recorddate",DateUtils.truncate(fr.getBegindate()));
|
|
|
+// windturbineinfodayQueryWrapper.eq("foreignkeyid",fr.getWpid());
|
|
|
+// List<Windpowerinfoday> windturbineinfodayList = windpowerinfodayService.list(windturbineinfodayQueryWrapper);
|
|
|
+//
|
|
|
+// Map<String,Windpowerinfoday> wtdaymap=new HashMap<>();
|
|
|
+// if(!windturbineinfodayList.isEmpty())
|
|
|
+// {
|
|
|
+// for ( Windpowerinfoday wtday:windturbineinfodayList)
|
|
|
+// {
|
|
|
+// wtdaymap.put(wtday.getWindpowerstationid(),wtday);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// double gzsc=DateUtils.hoursDiff1(fr.getBegindate(),fr.getEnddate());
|
|
|
+//
|
|
|
+// if(wtdaymap.containsKey(fr.getWpid()))
|
|
|
+// {
|
|
|
+// Windpowerinfoday wpday=wtdaymap.get(fr.getWpid());
|
|
|
+//
|
|
|
+// if(CacheContext.wpwtlsmap.containsKey(wpday.getWindpowerstationid()))
|
|
|
+// {
|
|
|
+// List<Windturbine> wtls=CacheContext.wpwtlsmap.get(wpday.getWindpowerstationid());
|
|
|
+// double rfdl= wpday.getGeneratingcapacity2();
|
|
|
+// double ssdl = new BigDecimal(rfdl).divide(new BigDecimal(wtls.size()), 2, RoundingMode.HALF_EVEN).divide(new BigDecimal(24), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(gzsc)).doubleValue();
|
|
|
+//
|
|
|
+//
|
|
|
+// fr.setPowerloss(StringUtils.round(ssdl,2));
|
|
|
+// if(StringUtils.round(ssdl,2)==0)
|
|
|
+// {
|
|
|
+// ssdl=0.01;
|
|
|
+// fr.setPowerloss(ssdl);
|
|
|
+// }
|
|
|
+// faultrecordService.saveOrUpdate(fr);
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
for(Faultrecord fr:resultList)
|
|
|
{
|
|
|
if(StringUtils.notEmp(fr.getFaultduration()))
|
|
|
{
|
|
|
QueryWrapper<Windpowerinfoday> windturbineinfodayQueryWrapper = new QueryWrapper<>();
|
|
|
windturbineinfodayQueryWrapper.eq("recorddate",DateUtils.truncate(fr.getBegindate()));
|
|
|
- windturbineinfodayQueryWrapper.eq("foreignkeyid",fr.getWpid());
|
|
|
+ windturbineinfodayQueryWrapper.eq("foreignkeyid",fr.getProjectid());
|
|
|
List<Windpowerinfoday> windturbineinfodayList = windpowerinfodayService.list(windturbineinfodayQueryWrapper);
|
|
|
|
|
|
Map<String,Windpowerinfoday> wtdaymap=new HashMap<>();
|
|
@@ -96,23 +140,23 @@ public class GhostService {
|
|
|
{
|
|
|
for ( Windpowerinfoday wtday:windturbineinfodayList)
|
|
|
{
|
|
|
- wtdaymap.put(wtday.getWindpowerstationid(),wtday);
|
|
|
+ wtdaymap.put(wtday.getForeignkeyid(),wtday);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
double gzsc=DateUtils.hoursDiff1(fr.getBegindate(),fr.getEnddate());
|
|
|
|
|
|
- if(wtdaymap.containsKey(fr.getWpid()))
|
|
|
+ if(wtdaymap.containsKey(fr.getProjectid()))
|
|
|
{
|
|
|
- Windpowerinfoday wpday=wtdaymap.get(fr.getWpid());
|
|
|
+ Windpowerinfoday wpday=wtdaymap.get(fr.getProjectid());
|
|
|
|
|
|
- if(CacheContext.wpwtlsmap.containsKey(wpday.getWindpowerstationid()))
|
|
|
+ if(CacheContext.pjwtlsmap.containsKey(wpday.getProjectid()))
|
|
|
{
|
|
|
- List<Windturbine> wtls=CacheContext.wpwtlsmap.get(wpday.getWindpowerstationid());
|
|
|
+ List<Windturbine> wtls=CacheContext.pjwtlsmap.get(wpday.getProjectid());
|
|
|
+ wtls = wtls.stream().filter(a -> fr.getProjectid().equals(a.getProjectid())).collect(Collectors.toList());
|
|
|
double rfdl= wpday.getGeneratingcapacity2();
|
|
|
double ssdl = new BigDecimal(rfdl).divide(new BigDecimal(wtls.size()), 2, RoundingMode.HALF_EVEN).divide(new BigDecimal(24), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(gzsc)).doubleValue();
|
|
|
-
|
|
|
-
|
|
|
+ if("内报".equals(fr.getType())) ssdl = ssdl * 0.6;
|
|
|
fr.setPowerloss(StringUtils.round(ssdl,2));
|
|
|
if(StringUtils.round(ssdl,2)==0)
|
|
|
{
|
|
@@ -170,9 +214,9 @@ public class GhostService {
|
|
|
{
|
|
|
Windpowerinfoday wpday=wtdaymap.get(fr.getProjectid());
|
|
|
|
|
|
- if(CacheContext.wpwtlsmap.containsKey(wpday.getWindpowerstationid()))
|
|
|
+ if(CacheContext.pjwtlsmap.containsKey(wpday.getProjectid()))
|
|
|
{
|
|
|
- List<Windturbine> wtls=CacheContext.wpwtlsmap.get(wpday.getWindpowerstationid());
|
|
|
+ List<Windturbine> wtls=CacheContext.pjwtlsmap.get(wpday.getProjectid());
|
|
|
wtls = wtls.stream().filter(a -> fr.getProjectid().equals(a.getProjectid())).collect(Collectors.toList());
|
|
|
double rfdl= wpday.getGeneratingcapacity2();
|
|
|
double ssdl = new BigDecimal(rfdl).divide(new BigDecimal(wtls.size()), 2, RoundingMode.HALF_EVEN).divide(new BigDecimal(24), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(gzsc)).doubleValue();
|