|
@@ -11,6 +11,8 @@ import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -21,19 +23,35 @@ import com.gyee.frame.common.spring.InitialRunner;
|
|
import com.gyee.frame.model.auto.Weatherfd;
|
|
import com.gyee.frame.model.auto.Weatherfd;
|
|
import com.gyee.frame.model.auto.WeatherfdExample;
|
|
import com.gyee.frame.model.auto.WeatherfdExample;
|
|
import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
|
|
import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
|
|
|
|
+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.DateUtils;
|
|
import com.gyee.frame.util.DateUtils;
|
|
|
|
+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;
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ *
|
|
|
|
+ *@author:Li Miao
|
|
|
|
+ *
|
|
|
|
+ *@description: sis手机app首页数据接入
|
|
|
|
+ *
|
|
|
|
+ *@createTime:2020年5月15日
|
|
|
|
+ *
|
|
|
|
+ */
|
|
@Service
|
|
@Service
|
|
public class IndexService extends SocketToolService{
|
|
public class IndexService 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 index_target_comprehensive_indicators() throws Exception{
|
|
public void index_target_comprehensive_indicators() throws Exception{
|
|
Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
|
|
Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
|
|
@@ -444,5 +462,144 @@ public class IndexService extends SocketToolService{
|
|
}
|
|
}
|
|
this.pushToWeb("pageNumber_6","functionNumber_3",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
this.pushToWeb("pageNumber_6","functionNumber_3",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void index_electricQuantity() throws Exception{
|
|
|
|
+ Map<String, Map<String, WindPowerStationTestingPoint2>> 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 yfdl = 0;
|
|
|
|
+ double nfdl = 0;
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ //月计划发电量
|
|
|
|
+ PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_YFDL).getCode());
|
|
|
|
+ yfdl = new BigDecimal(rfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ //年计划发电量
|
|
|
|
+ PointData aqts_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_NFDL).getCode());
|
|
|
|
+ nfdl = new BigDecimal(aqts_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ pointDataMap.put("yfdl",yfdl);
|
|
|
|
+ pointDataMap.put("nfdl",nfdl);
|
|
|
|
+ windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
|
|
|
|
+ }
|
|
|
|
+ this.pushToWeb("pageNumber_6","functionNumber_4",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void index_target_basic_indicators() throws Exception{
|
|
|
|
+ Map<String, Map<String, WindPowerStationTestingPoint2>> 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_6","functionNumber_5",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|