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.WindPowerStationTestingPoint2;
import com.gyee.frame.model.auto.Windpowerinfoday;
import com.gyee.frame.model.auto.Windpowerstation;
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.ProjectplanService;
import com.gyee.frame.service.WindpowerinfodayService;
import com.gyee.frame.util.IRealTimeDataBaseUtil;
import com.gyee.frame.util.RealTimeDataBaseFactory;
import com.gyee.frame.util.StringUtils;
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.*;

@Service
public class IndexService extends SocketToolService{
	@Resource
	private ProjectplanService projectplanService;
	@Resource
	private WindpowerinfodayService windpowerinfodayService;
	@Autowired
    private InitialRunner initialRunner;
    private static int decimal_digit = 0;
	
	public void index_target_comprehensive_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,Object>> windpowerstationpointDataMap = new HashMap();
	        IRealTimeDataBaseUtil mongodb= RealTimeDataBaseFactory.createRealTimeDataBase();

	        for(Windpowerstation windpowerstation:wpls){
	            Map<String,Object> pointDataMap = new HashMap();
	            double rfdl = 0;
	            double aqts = 0;
	            double swdl = 0;
	            double ycfdl = 0;
	            double zjrl = 0;
				PointData swdl_real=new PointData();
				PointData aqts_real=new PointData();
				PointData zjrl_real=new PointData();
				PointData ycfdl_real=new PointData();
				PointData rfdl_real=new PointData();
	            try {
	                //日发电量
	                rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_ALL_RFDL).getCode());
	                rfdl = new BigDecimal(rfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }

	            try {
	                //安全天数
	                aqts_real = mongodb.getRealData(InitialRunner.stationPointmap.get("0").get(Constant.TPOINT_AQTS).getCode());
	                aqts = new BigDecimal(aqts_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }


	            try{
	                //上网电量
	                swdl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SWDL).getCode());
	                swdl = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }

				try{
					//装机容量
					zjrl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SWDL).getCode());
					zjrl = new BigDecimal(zjrl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
				}catch (Exception e){
					//System.out.println(e.getMessage());
				}

				try{
					//预测发电量
					ycfdl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.RFDLE).getCode());
					ycfdl = new BigDecimal(ycfdl_real.getPointValueInDouble()).divide(new BigDecimal(10000), 0, RoundingMode.HALF_EVEN).doubleValue();

				}catch (Exception e){
					//System.out.println(e.getMessage());
				}



	            //装机容量
	            try{
	                if(windpowerstation.getCapacity()==null){
	                    List<Windpowerstation> wps = InitialRunner.wpls;
	                    for(Windpowerstation windpowerstationinner:wps){
	                        zjrl = zjrl + windpowerstationinner.getCapacity();
	                    }
	                }else{
	                    zjrl = windpowerstation.getCapacity();
	                }

	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }
	            pointDataMap.put("rfdl",rfdl);
				pointDataMap.put("rfdl_real",rfdl_real);
	            pointDataMap.put("aqts",aqts);
				pointDataMap.put("aqts_real",aqts_real);
	            pointDataMap.put("swdl",swdl);
				pointDataMap.put("swdl_real",swdl_real);
	            pointDataMap.put("ycfdl",ycfdl);
				pointDataMap.put("ycfdl_real",ycfdl_real);
	            pointDataMap.put("zjrl",zjrl);
				pointDataMap.put("zjrl_real",zjrl_real);
	            windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
	        }
        this.pushToWeb("pageNumber_6","functionNumber_1","all",windpowerstationpointDataMap, Messagetype.JSONOBJECT);
	}
	
	
	public void index_target_windSpeed_power() 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,Object>> windpowerstationpointDataMap = new HashMap();
        IRealTimeDataBaseUtil mongodb= RealTimeDataBaseFactory.createRealTimeDataBase();

        for(Windpowerstation windpowerstation:wpls){
            Map<String,Object> pointDataMap = new HashMap();
            double pjfs = 0;
            double pjfsMin = 0;
            double pjfsMax = 0;
            double ycfs = 0;
            double ycfsMin = 0;
            double ycfsMax = 0;
            double sjgl = 0;
            double sjglMin = 0;
            double sjglMax = 0;
            double llgl = 0;
            double llglMax = 0;
            double llglMin = 0;

            try {
                //平均风速
                PointData pjfs_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_PJFS).getCode());
				pointDataMap.put("pjfs_real",pjfs_real);
                pjfs = new BigDecimal(pjfs_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
            }catch (Exception e){
                //System.out.println(e.getMessage());
            }
            
            //平均风速min
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){                  	
                    	if(pjfs==0){
                    		pjfsMin=pjfs;
                    	}else{
                    		pjfsMin = pjfs - 2;
                    	}
                    }
                }else{
                	if(pjfs==0){
                		pjfsMin=pjfs;
                	}else{
                		pjfsMin = pjfs - 2;
                	}
                }
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }
            
          //平均风速max
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){
                    	pjfsMax = pjfs + 2;
                    }
                }else{
                	pjfsMax = pjfs + 2;
                }
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }
            
            //预测风速
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){
                    	ycfs = pjfs + 2;
                    }
                }else{
                	ycfs = pjfs + 2;
                }
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }
            
          //预测风速min
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){                   	
                    	if(ycfs==0){
                    		ycfsMin = ycfs;
                    	}else{
                    		ycfsMin = ycfs - 2;
                    	}
                    }
                }else{
                	if(ycfs==0){
                		ycfsMin = ycfs;
                	}else{
                		ycfsMin = ycfs - 2;
                	}
                }
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }
            
          //预测风速max
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){
                    	ycfsMax = ycfs + 2;
                    }
                }else{
                	ycfsMax = ycfs + 2;
                }
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }

            try{
                //实际功率
                PointData sjgl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SJGL).getCode());
				pointDataMap.put("sjgl_real",sjgl_real);
                sjgl = new BigDecimal(sjgl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
            }catch (Exception e){
                //System.out.println(e.getMessage());
            }
            
          //实际功率min
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){                 	
                    	if(sjgl==0){
                    		sjglMin = sjgl;
                    	}else{
                    		sjglMin = sjgl - 2;
                    	}
                    }
                }else{
                	if(sjgl==0){
                		sjglMin = sjgl;
                	}else{
                		sjglMin = sjgl - 2;
                	}
                }
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }
            
          //实际功率max
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){
                    	sjglMax = sjgl + 2;
                    }
                }else{
                	sjglMax = sjgl + 2;
                }
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }
            
            try{
                //理论功率
                PointData llgl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_ZLLGL).getCode());
                //llgl = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
				pointDataMap.put("llgl_real",llgl_real);
				llgl =new BigDecimal(llgl_real.getPointValueInDouble()).divide(new BigDecimal(1000), decimal_digit, RoundingMode.HALF_EVEN).doubleValue();

			}catch (Exception e){
                //System.out.println(e.getMessage());
            }
            
          //理论功率min
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){                   	
                    	if(llgl==0){
                    		llglMin = llgl;
                    	}else{
                    		llglMin = llgl - 2;
                    	}
                    }
                }else{
                	if(llgl==0){
                		llglMin = llgl;
                	}else{
                		llglMin = llgl - 2;
                	}
                }
				//llglMin =new BigDecimal(llglMin).divide(new BigDecimal(1000), decimal_digit, RoundingMode.HALF_EVEN).doubleValue();

			}
            catch(Exception e){
                System.out.printf(e.getMessage());
            }
            
          //理论功率max
            try{
                if(windpowerstation.getId().equalsIgnoreCase("0")){
                    List<Windpowerstation> wps = InitialRunner.wpls;
                    for(Windpowerstation windpowerstationinner:wps){
                    	llglMax = llgl + 2;
                    }
                }else{
                	llglMax = llgl + 2;
                }


//				llglMax =new BigDecimal(llglMax).divide(new BigDecimal(1000), decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
            }
            catch(Exception e){
                System.out.printf(e.getMessage());
            }


                      
            pointDataMap.put("pjfs",pjfs);
            pointDataMap.put("pjfsMin",pjfsMin);
            pointDataMap.put("pjfsMax",pjfsMax);
            pointDataMap.put("ycfs",ycfs);
            pointDataMap.put("ycfsMin",ycfsMin);
            pointDataMap.put("ycfsMax",ycfsMax);
            pointDataMap.put("sjgl",sjgl);
            pointDataMap.put("sjglMin",sjglMin);
            pointDataMap.put("sjglMax",sjglMax);
            pointDataMap.put("llgl",llgl);
            pointDataMap.put("llglMin",llglMin);
            pointDataMap.put("llglMax",llglMax);
            windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
        }
        this.pushToWeb("pageNumber_6","functionNumber_2","all",windpowerstationpointDataMap, Messagetype.MESSAGE);
	}
	
	public void index_windturbine_status() 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();
	        IRealTimeDataBaseUtil mongodb= RealTimeDataBaseFactory.createRealTimeDataBase();

	        for(Windpowerstation windpowerstation:wpls){
	            Map<String,Double> pointDataMap = new HashMap();
	            double jr = 0;
	            double dj = 0;
	            double yx = 0;
	            double gz = 0;
	            double wh = 0;
	            double lx = 0;

	            try {	                //待机
					//待机
					/*//System.out.println(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_DJTS).getCode());*/
	                PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_DJTS).getCode());
	                dj = 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_WT_YXTS).getCode());
	                yx = new BigDecimal(aqts_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }


	            try{
	                //上网电量
	                PointData swdl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_GZTJ).getCode());
	                gz = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }
	            
	            try{
	                //维护
	                PointData swdl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_WHTJ).getCode());
	                wh = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }
	            
	            try{
	                //离线
	                PointData swdl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_TXZD).getCode());
	                lx = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }

	            

	            //接入
	            try{
	                if(windpowerstation.getCapacity()==null){
	                    List<Windpowerstation> wps = InitialRunner.wpls;
	                    for(Windpowerstation windpowerstationinner:wps){
	                        jr = dj+yx+gz+wh+lx;
	                    }
	                }else{
	                	jr = dj+yx+gz+wh+lx;
	                }

	            }catch (Exception e){
	                //System.out.println(e.getMessage());
	            }
	            pointDataMap.put("jr",jr);
	            pointDataMap.put("dj",dj);
	            pointDataMap.put("yx",yx);
	            pointDataMap.put("gz",gz);
	            pointDataMap.put("wh",wh);
	            pointDataMap.put("lx",lx);
	            windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
	        }
       this.pushToWeb("pageNumber_6","functionNumber_3","all",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();
		IRealTimeDataBaseUtil mongodb= RealTimeDataBaseFactory.createRealTimeDataBase();

		for(Windpowerstation windpowerstation:wpls){
			Map<String,Double> pointDataMap = new HashMap();
			double yfdl = 0;
			double nfdl = 0;
			double yjhfdl = 0;
			double njhfdl = 0;
			try {
				//月发电量
				PointData yfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_YFDL).getCode());
				yfdl = new BigDecimal(yfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
				// yfdl =new BigDecimal(yfdl_real.getPointValueInDouble()).divide(new BigDecimal(10000), decimal_digit, RoundingMode.HALF_EVEN).doubleValue();

			}catch (Exception e){
				//System.out.println(e.getMessage());
			}

			try {
				//年发电量
				PointData nfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_NFDL).getCode());
				nfdl = new BigDecimal(nfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
				//nfdl =new BigDecimal(nfdl_real.getPointValueInDouble()).divide(new BigDecimal(10000), decimal_digit, RoundingMode.HALF_EVEN).doubleValue();

			}catch (Exception e){
				//System.out.println(e.getMessage());
			}

			yjhfdl=projectplanService.planMonthPower(windpowerstation.getId());
			njhfdl=projectplanService.planYearPower(windpowerstation.getId());
			pointDataMap.put("yfdl",yfdl);
			pointDataMap.put("nfdl",nfdl);
			pointDataMap.put("yjhfdl",yjhfdl);
			pointDataMap.put("njhfdl",njhfdl);
			windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
		}
		this.pushToWeb("pageNumber_6","functionNumber_4","all",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,Object>> windpowerstationpointDataMap = new HashMap();
		IRealTimeDataBaseUtil mongodb= RealTimeDataBaseFactory.createRealTimeDataBase();


		for(Windpowerstation windpowerstation:wpls){
			Map<String,Object> 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;
			double zjrl=0.0;

			if(windpowerstation.getCapacity()==null){
				List<Windpowerstation> wps = InitialRunner.wpls;
				for(Windpowerstation windpowerstationinner:wps){
					zjrl = zjrl + windpowerstationinner.getCapacity();
				}
			}else{
				zjrl = windpowerstation.getCapacity();
			}
			//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();
				pointDataMap.put("jybm_real",jybm_real);
			}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();

				pointDataMap.put("jpeyhl_real",jpeyhl_real);
			}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();
				pointDataMap.put("jyys_real",jyys_real);
			}catch (Exception e){
				//System.out.println(e.getMessage());
			}

			Calendar c = Calendar.getInstance();
			Windpowerinfoday wp=windpowerinfodayService.findListByDate(windpowerstation.getId(),c.getTime());
			if(StringUtils.isNotNull(wp))
			{
				ylyxs=wp.getMonthlyxs();
				nlyxs=wp.getYearlyxs();
				//综合场用电率
				zhcydl=wp.getDayzhcydl();
				//设备可利用率
				sbklyl=wp.getDaysbklyl();
				ylyxs=wp.getMonthlyxs();
				nlyxs=wp.getYearlyxs();
//               //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());
			}

//			// 月利用小时
//			double temp = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_YFDL).getCode()).getPointValueInDouble();
//			ylyxs = (new BigDecimal(temp).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
//			// 年利用小时
//			temp = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_NFDL).getCode()).getPointValueInDouble();
//			nlyxs = (new BigDecimal(temp).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
//


			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();
				pointDataMap.put("jpeyht_real",jpeyht_real);
			}catch (Exception e){
				//System.out.println(e.getMessage());
			}


			pointDataMap.put("mttr",mttr);
			pointDataMap.put("mtbf",mtbf);

			pointDataMap.put("ylyxs",ylyxs);
			pointDataMap.put("nlyxs",nlyxs);

			pointDataMap.put("zhcydl",zhcydl);
			pointDataMap.put("sbklyl",sbklyl);

			pointDataMap.put("jybm",jybm);
			pointDataMap.put("jpeyhl",jpeyhl);
			pointDataMap.put("jyys",jyys);
			pointDataMap.put("jpeyht",jpeyht);


			windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
		}
		this.pushToWeb("pageNumber_6","functionNumber_5","all",windpowerstationpointDataMap, Messagetype.MESSAGE);
	}


}
