|
@@ -1,28 +1,16 @@
|
|
|
package com.gyee.frame.service.app.index;
|
|
|
|
|
|
-import com.gyee.frame.common.spring.Constant;
|
|
|
-import com.gyee.frame.common.spring.InitialRunner;
|
|
|
import com.gyee.frame.model.auto.Forecastwindspeedamended;
|
|
|
import com.gyee.frame.model.auto.ForecastwindspeedamendedExample;
|
|
|
-import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
|
|
|
-import com.gyee.frame.model.auto.Windpowerstation;
|
|
|
-import com.gyee.frame.model.custom.DataVo;
|
|
|
-import com.gyee.frame.model.custom.PointData;
|
|
|
-import com.gyee.frame.model.enumeration.Messagetype;
|
|
|
import com.gyee.frame.netty.websocket.util.SocketToolService;
|
|
|
import com.gyee.frame.service.ForecastwindspeedamendedService;
|
|
|
-import com.gyee.frame.service.WindpowerinfodayService;
|
|
|
-import com.gyee.frame.util.DateUtils;
|
|
|
import com.gyee.frame.util.StringUtils;
|
|
|
-import com.gyee.frame.util.golden.EdosUtil;
|
|
|
-import com.gyee.frame.util.golden.IEdosUtil;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.math.RoundingMode;
|
|
|
-import java.util.*;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -87,11 +75,17 @@ public class FocastpowerService extends SocketToolService{
|
|
|
}
|
|
|
List<Forecastwindspeedamended> wtls = forecastwindspeedamendedService.selectByExample(forecastwindspeedamendedExample);
|
|
|
double tmp = 0;
|
|
|
- for(Forecastwindspeedamended wt:wtls)
|
|
|
+
|
|
|
+ if(!wtls.isEmpty())
|
|
|
{
|
|
|
- tmp = tmp + wt.getDayspeed().doubleValue()+wt.getNightspeed().doubleValue();
|
|
|
- tmp=StringUtils.round(tmp/2,2);
|
|
|
+ for(Forecastwindspeedamended wt:wtls)
|
|
|
+ {
|
|
|
+ tmp = tmp + wt.getDayspeed().doubleValue()+wt.getNightspeed().doubleValue();
|
|
|
+
|
|
|
+ }
|
|
|
+ tmp=StringUtils.round(tmp/(wtls.size()*2),2);
|
|
|
}
|
|
|
+
|
|
|
return tmp;
|
|
|
}
|
|
|
|