|
@@ -4,15 +4,19 @@ import com.gyee.frame.common.spring.Constant;
|
|
import com.gyee.frame.common.spring.InitialRunner;
|
|
import com.gyee.frame.common.spring.InitialRunner;
|
|
import com.gyee.frame.common.spring.SpringUtils;
|
|
import com.gyee.frame.common.spring.SpringUtils;
|
|
import com.gyee.frame.model.auto.WindPowerstationTestingPoint;
|
|
import com.gyee.frame.model.auto.WindPowerstationTestingPoint;
|
|
|
|
+import com.gyee.frame.model.auto.Windpowerinfoday;
|
|
import com.gyee.frame.model.auto.Windpowerstation;
|
|
import com.gyee.frame.model.auto.Windpowerstation;
|
|
import com.gyee.frame.model.custom.PointData;
|
|
import com.gyee.frame.model.custom.PointData;
|
|
import com.gyee.frame.model.enumeration.Messagetype;
|
|
import com.gyee.frame.model.enumeration.Messagetype;
|
|
import com.gyee.frame.netty.websocket.util.SocketToolService;
|
|
import com.gyee.frame.netty.websocket.util.SocketToolService;
|
|
|
|
+import com.gyee.frame.service.WindpowerinfodayService;
|
|
|
|
+import com.gyee.frame.util.StringUtils;
|
|
import com.gyee.frame.util.mongodb.IMongodbUtil;
|
|
import com.gyee.frame.util.mongodb.IMongodbUtil;
|
|
import com.gyee.frame.util.mongodb.MongodbUtilImpl;
|
|
import com.gyee.frame.util.mongodb.MongodbUtilImpl;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -30,7 +34,8 @@ public class WindpowerstationdetailService extends SocketToolService {
|
|
@Autowired
|
|
@Autowired
|
|
private InitialRunner initialRunner;
|
|
private InitialRunner initialRunner;
|
|
private static int decimal_digit = 0;
|
|
private static int decimal_digit = 0;
|
|
-
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private WindpowerinfodayService windpowerinfodayService;
|
|
public void windpowerstationdetail_comprehensive_target() throws Exception {
|
|
public void windpowerstationdetail_comprehensive_target() throws Exception {
|
|
|
|
|
|
Map<String, Map<String, WindPowerstationTestingPoint>> stationPointmap = InitialRunner.stationPointmap;
|
|
Map<String, Map<String, WindPowerstationTestingPoint>> stationPointmap = InitialRunner.stationPointmap;
|
|
@@ -117,6 +122,104 @@ public class WindpowerstationdetailService extends SocketToolService {
|
|
|
|
|
|
this.pushToWeb("pageNumber_7","functionNumber_1",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
this.pushToWeb("pageNumber_7","functionNumber_1",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
}
|
|
}
|
|
|
|
+ public void windpowerstationdetail_springbox_target() throws Exception {
|
|
|
|
+ Map<String, Map<String, WindPowerstationTestingPoint>> stationPointmap = InitialRunner.stationPointmap;
|
|
|
|
+ List<Windpowerstation> wpls = new ArrayList<>();
|
|
|
|
+ for(Windpowerstation wp:InitialRunner.wpls){
|
|
|
|
+ wpls.add(wp);
|
|
|
|
+ }
|
|
|
|
+ Windpowerstation windpowerstationAll = new Windpowerstation();
|
|
|
|
+ windpowerstationAll.setId("0");
|
|
|
|
+ wpls.add(windpowerstationAll);
|
|
|
|
+ Map<String,Map<String,Double>> windpowerstationpointDataMap = new HashMap();
|
|
|
|
+ IMongodbUtil mongodb = new MongodbUtilImpl();
|
|
|
|
+
|
|
|
|
+ for(Windpowerstation windpowerstation:wpls){
|
|
|
|
+ Map<String,Double> pointDataMap = new HashMap();
|
|
|
|
+ double mttr = 99;
|
|
|
|
+ double mtbf = 99;
|
|
|
|
+ double jybm = 99;
|
|
|
|
+ double jpeyhl = 99;
|
|
|
|
+ double ylyxs = 99;
|
|
|
|
+ double nlyxs = 99;
|
|
|
|
+ double jyys = 99;
|
|
|
|
+ double zhcydl = 99;
|
|
|
|
+ double sbklyl = 99;
|
|
|
|
+ double jpeyht = 99;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //mttr
|
|
|
|
+ mttr = jybm + 10;
|
|
|
|
+
|
|
|
|
+ //mtbf
|
|
|
|
+ mtbf = jpeyht + 12;
|
|
|
|
+
|
|
|
|
+ try{
|
|
|
|
+ //节约标煤
|
|
|
|
+ PointData jybm_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_JYBM).getCode());
|
|
|
|
+ jybm = new BigDecimal(jybm_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ try{
|
|
|
|
+ //减排二氧化硫
|
|
|
|
+ PointData jpeyhl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_JPEYHL).getCode());
|
|
|
|
+ jpeyhl = new BigDecimal(jpeyhl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ try{
|
|
|
|
+ //节约用水
|
|
|
|
+ PointData jyys_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_JYS).getCode());
|
|
|
|
+ jyys = new BigDecimal(jyys_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
|
+ Windpowerinfoday wp=windpowerinfodayService.findListByDate("CL_FDC",c.getTime());
|
|
|
|
+ if(StringUtils.isNotNull(wp))
|
|
|
|
+ {
|
|
|
|
+ ylyxs=wp.getMonthlyxs();
|
|
|
|
+ nlyxs=wp.getYearlyxs();
|
|
|
|
+ //综合场用电率
|
|
|
|
+ zhcydl=wp.getDayzhcydl();
|
|
|
|
+ //设备可利用率
|
|
|
|
+ sbklyl=wp.getDaysbklyl();
|
|
|
|
+ System.out.println(wp.getRecorddate()+ "___" +wp.getMonthlyxs());
|
|
|
|
+ System.out.println(wp.getRecorddate()+ "___" +wp.getYearlyxs());
|
|
|
|
+ System.out.println(wp.getRecorddate()+ "___" +wp.getDayzhcydl());
|
|
|
|
+ System.out.println(wp.getRecorddate()+ "___" +wp.getDaysbklyl());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ try{
|
|
|
|
+ //减排二氧化碳
|
|
|
|
+ PointData jpeyht_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_JPEYHT).getCode());
|
|
|
|
+ jpeyht = new BigDecimal(jpeyht_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ pointDataMap.put("mttr",mttr);
|
|
|
|
+ pointDataMap.put("mtbf",mtbf);
|
|
|
|
+ pointDataMap.put("jybm",jybm);
|
|
|
|
+ pointDataMap.put("jpeyhl",jpeyhl);
|
|
|
|
+ pointDataMap.put("ylyxs",ylyxs);
|
|
|
|
+ pointDataMap.put("nlyxs",nlyxs);
|
|
|
|
+ pointDataMap.put("jyys",jyys);
|
|
|
|
+ pointDataMap.put("zhcydl",zhcydl);
|
|
|
|
+ pointDataMap.put("sbklyl",sbklyl);
|
|
|
|
+ pointDataMap.put("jpeyht",jpeyht);
|
|
|
|
+ windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
|
|
|
|
+ }
|
|
|
|
+ this.pushToWeb("pageNumber_7","functionNumber_2",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
|
+ }
|
|
|
|
|
|
/* double focastpower(String name){
|
|
/* double focastpower(String name){
|
|
ForecastwindspeedamendedService forecastwindspeedamendedService= SpringUtils.getBean("forecastwindspeedamendedService");
|
|
ForecastwindspeedamendedService forecastwindspeedamendedService= SpringUtils.getBean("forecastwindspeedamendedService");
|