Jelajahi Sumber

首页后台数据采集

shilin 5 tahun lalu
induk
melakukan
45eaecc7b3

+ 41 - 0
src/main/java/com/gyee/frame/common/quartz/task/index_curve_columnar_five_loss.java

@@ -0,0 +1,41 @@
+package com.gyee.frame.common.quartz.task;
+
+import com.gyee.frame.service.app.index.IndexDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ *
+ */
+@Component("index_curve_columnar_five_loss")
+public class index_curve_columnar_five_loss {
+
+	@Autowired
+    private IndexDetailService indexDetailService;
+    /**
+     * 无参的任务
+     * @throws Exception 
+     */
+    public void index_curve_columnar_five_loss() throws Exception {
+    	indexDetailService.index_curve_columnar_five_loss();//调用list方法完成对 key :"weatherProphet_1" ,路径"weather/weatherProphet_1"的推送     
+        //System.out.println("我已执行");
+    }   
+       
+
+    /**
+     * 有参任务
+     * 目前仅执行常见的数据类型  Integer Long  带L  string  带 ''  bool Double 带 d
+     * @param a
+     * @param b
+     * 
+     */
+    public void runTask2(Integer a,Long b,String c,Boolean d,Double e)
+    {
+    	//List<TsysUser> list=  tsysUserMapper.selectByExample(new TsysUserExample());
+    	//System.err.println("用户查询num:"+list.size());
+        System.out.println("正在执行定时任务,带多个参数的方法"+a+"   "+b+" "+c+"  "+d+" "+e+"执行时间:"+new Date().toLocaleString());
+    }
+
+}

+ 42 - 0
src/main/java/com/gyee/frame/common/quartz/task/index_curve_columnar_windSpeed_power.java

@@ -0,0 +1,42 @@
+package com.gyee.frame.common.quartz.task;
+
+import com.gyee.frame.mapper.auto.TsysUserMapper;
+import com.gyee.frame.service.app.index.IndexDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ *
+ */
+@Component("index_curve_columnar_windSpeed_power")
+public class index_curve_columnar_windSpeed_power {
+
+	@Autowired
+    private IndexDetailService indexDetailService;
+    /**
+     * 无参的任务
+     * @throws Exception 
+     */
+    public void index_curve_columnar_windSpeed_power() throws Exception {
+    	indexDetailService.index_curve_columnar_windSpeed_power();//调用list方法完成对 key :"weatherProphet_1" ,路径"weather/weatherProphet_1"的推送     
+        //System.out.println("我已执行");
+    }   
+       
+
+    /**
+     * 有参任务
+     * 目前仅执行常见的数据类型  Integer Long  带L  string  带 ''  bool Double 带 d
+     * @param a
+     * @param b
+     * 
+     */
+    public void runTask2(Integer a,Long b,String c,Boolean d,Double e)
+    {
+    	//List<TsysUser> list=  tsysUserMapper.selectByExample(new TsysUserExample());
+    	//System.err.println("用户查询num:"+list.size());
+        System.out.println("正在执行定时任务,带多个参数的方法"+a+"   "+b+" "+c+"  "+d+" "+e+"执行时间:"+new Date().toLocaleString());
+    }
+
+}

+ 41 - 0
src/main/java/com/gyee/frame/common/quartz/task/index_windStation_card.java

@@ -0,0 +1,41 @@
+package com.gyee.frame.common.quartz.task;
+
+import com.gyee.frame.service.app.index.IndexDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ *
+ */
+@Component("index_windStation_card")
+public class index_windStation_card {
+
+	@Autowired
+    private IndexDetailService indexDetailService;
+    /**
+     * 无参的任务
+     * @throws Exception 
+     */
+    public void index_windStation_card() throws Exception {
+    	indexDetailService.index_windStation_card();//调用list方法完成对 key :"weatherProphet_1" ,路径"weather/weatherProphet_1"的推送     
+        //System.out.println("我已执行");
+    }   
+       
+
+    /**
+     * 有参任务
+     * 目前仅执行常见的数据类型  Integer Long  带L  string  带 ''  bool Double 带 d
+     * @param a
+     * @param b
+     * 
+     */
+    public void runTask2(Integer a,Long b,String c,Boolean d,Double e)
+    {
+    	//List<TsysUser> list=  tsysUserMapper.selectByExample(new TsysUserExample());
+    	//System.err.println("用户查询num:"+list.size());
+        System.out.println("正在执行定时任务,带多个参数的方法"+a+"   "+b+" "+c+"  "+d+" "+e+"执行时间:"+new Date().toLocaleString());
+    }
+
+}

+ 183 - 0
src/main/java/com/gyee/frame/model/custom/DataVo.java

@@ -0,0 +1,183 @@
+/**
+ * <p>文件名:	DataVo.java</p>
+ * <p>版权:  </p>
+ * <p>公司:	company Co., Ltd.</p>
+ * <p>项目名:lnly</p>
+ * <p>作者:	刘厦(liusha.information@gmail.com)</p>
+ */
+package com.gyee.frame.model.custom;
+
+/**
+ *
+ */
+
+public class DataVo {
+
+    private Long time;
+    private String timestr;
+    private Double value1;
+
+    private Double value2;
+
+    private Double value3;
+
+    private Double value4;
+
+    private Double value5;
+
+    private Double value6;
+
+    private Double value7;
+
+    private Double value8;
+
+    private Double value9;
+    
+    private Double value10;
+    
+    private Double value11;
+    
+    private Double value12;
+    
+    private Double value13;
+
+    private Double speed;
+
+    private String name;
+
+    public Long getTime() {
+        return time;
+    }
+
+    public void setTime(Long time) {
+        this.time = time;
+    }
+
+    public String getTimestr() {
+        return timestr;
+    }
+
+    public void setTimestr(String timestr) {
+        this.timestr = timestr;
+    }
+
+    public Double getValue1() {
+        return value1;
+    }
+
+    public void setValue1(Double value1) {
+        this.value1 = value1;
+    }
+
+    public Double getValue2() {
+        return value2;
+    }
+
+    public void setValue2(Double value2) {
+        this.value2 = value2;
+    }
+
+    public Double getValue3() {
+        return value3;
+    }
+
+    public void setValue3(Double value3) {
+        this.value3 = value3;
+    }
+
+    public Double getValue4() {
+        return value4;
+    }
+
+    public void setValue4(Double value4) {
+        this.value4 = value4;
+    }
+
+    public Double getValue5() {
+        return value5;
+    }
+
+    public void setValue5(Double value5) {
+        this.value5 = value5;
+    }
+
+    public Double getValue6() {
+        return value6;
+    }
+
+    public void setValue6(Double value6) {
+        this.value6 = value6;
+    }
+
+    public Double getValue7() {
+        return value7;
+    }
+
+    public void setValue7(Double value7) {
+        this.value7 = value7;
+    }
+
+    public Double getValue8() {
+        return value8;
+    }
+
+    public void setValue8(Double value8) {
+        this.value8 = value8;
+    }
+
+    public Double getValue9() {
+        return value9;
+    }
+
+    public void setValue9(Double value9) {
+        this.value9 = value9;
+    }
+
+    public Double getValue10() {
+        return value10;
+    }
+
+    public void setValue10(Double value10) {
+        this.value10 = value10;
+    }
+
+    public Double getValue11() {
+        return value11;
+    }
+
+    public void setValue11(Double value11) {
+        this.value11 = value11;
+    }
+
+    public Double getValue12() {
+        return value12;
+    }
+
+    public void setValue12(Double value12) {
+        this.value12 = value12;
+    }
+
+    public Double getValue13() {
+        return value13;
+    }
+
+    public void setValue13(Double value13) {
+        this.value13 = value13;
+    }
+
+    public Double getSpeed() {
+        return speed;
+    }
+
+    public void setSpeed(Double speed) {
+        this.speed = speed;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 196 - 0
src/main/java/com/gyee/frame/service/ProjectplanService.java

@@ -0,0 +1,196 @@
+package com.gyee.frame.service;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.support.Convert;
+import com.gyee.frame.mapper.auto.ProjectplanMapper;
+import com.gyee.frame.model.auto.Forecastwindspeedamended;
+import com.gyee.frame.model.auto.ForecastwindspeedamendedExample;
+import com.gyee.frame.model.auto.Projectplan;
+import com.gyee.frame.model.auto.ProjectplanExample;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.util.SnowflakeIdWorker;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 项目 ProjectService
+ * @Title: ProjectService.java 
+ * @Package com.gyee.frame.service 
+ * @author gyee_自动生成
+ * @email 1@qq.com
+ * @date 2019-12-31 14:58:09  
+ **/
+@Service
+public class ProjectplanService implements BaseService<Projectplan, ProjectplanExample>{
+	@Resource
+	private ProjectplanMapper projectplanMapper;
+	
+      	   	      	      	      	      	      	      	      	      	      	
+	/**
+	 * 分页查询
+	 * @param tablepar
+	 * @param name
+	 * @return
+	 */
+	 public PageInfo<Projectplan> list(Tablepar tablepar,String name){
+	        ProjectplanExample testExample=new ProjectplanExample();
+	        testExample.setOrderByClause("id ASC");
+	        if(name!=null&&!"".equals(name)){
+	        	testExample.createCriteria().andIdLike("%"+name+"%");
+	        }
+
+	        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+	        List<Projectplan> list= projectplanMapper.selectByExample(testExample);
+	        PageInfo<Projectplan> pageInfo = new PageInfo<Projectplan>(list);
+	        return  pageInfo;
+	 }
+
+	@Override
+	public int deleteByPrimaryKey(String ids) {
+				
+			List<String> lista=Convert.toListStrArray(ids);
+			ProjectplanExample example=new ProjectplanExample();
+			example.createCriteria().andIdIn(lista);
+			return projectplanMapper.deleteByExample(example);
+			
+				
+	}
+	
+	
+	@Override
+	public Projectplan selectByPrimaryKey(String id) {
+				
+			return projectplanMapper.selectByPrimaryKey(id);
+				
+	}
+
+	
+	@Override
+	public int updateByPrimaryKeySelective(Projectplan record) {
+		return projectplanMapper.updateByPrimaryKeySelective(record);
+	}
+	
+	
+	/**
+	 * 添加
+	 */
+	@Override
+	public int insertSelective(Projectplan record) {
+				
+		//添加雪花主键id
+		record.setId(SnowflakeIdWorker.getUUID());
+			
+				
+		return projectplanMapper.insertSelective(record);
+	}
+	
+	
+	@Override
+	public int updateByExampleSelective(Projectplan record, ProjectplanExample example) {
+		
+		return projectplanMapper.updateByExampleSelective(record, example);
+	}
+
+	
+	@Override
+	public int updateByExample(Projectplan record, ProjectplanExample example) {
+		
+		return projectplanMapper.updateByExample(record, example);
+	}
+
+	@Override
+	public List<Projectplan> selectByExample(ProjectplanExample example) {
+		
+		return projectplanMapper.selectByExample(example);
+	}
+
+	
+	@Override
+	public long countByExample(ProjectplanExample example) {
+		
+		return projectplanMapper.countByExample(example);
+	}
+
+	
+	@Override
+	public int deleteByExample(ProjectplanExample example) {
+		
+		return projectplanMapper.deleteByExample(example);
+	}
+	
+	/**
+	 * 检查name
+	 * @param project
+	 * @return
+	 */
+	public int checkNameUnique(Projectplan project){
+		ProjectplanExample example=new ProjectplanExample();
+		example.createCriteria().andIdEqualTo(project.getId());
+		List<Projectplan> list=projectplanMapper.selectByExample(example);
+		return list.size();
+	}
+
+	public double planMonthPower(String name){
+
+
+		ProjectplanExample example=new ProjectplanExample();
+		Calendar c = Calendar.getInstance();
+
+		int year= c.get(Calendar.YEAR);
+		int month= c.get(Calendar.MONTH)+1;
+
+
+		if(name.equals("0"))
+		{
+			example.createCriteria().andYearEqualTo(String.valueOf(year)).andMonthEqualTo(String.valueOf(month));
+
+		}else
+		{
+			example.createCriteria().andWindpoweridEqualTo(name).andYearEqualTo(String.valueOf(year)).andMonthEqualTo(String.valueOf(month));
+
+
+		}
+		List<Projectplan> wtls = selectByExample(example);
+		double tmp = 0;
+		for(Projectplan wt:wtls)
+		{
+			tmp = tmp + Double.valueOf(wt.getGeneratingcapacity());
+		}
+		return tmp;
+	}
+
+	public double planYearPower(String name){
+
+
+		ProjectplanExample example=new ProjectplanExample();
+		Calendar c = Calendar.getInstance();
+
+		int year= c.get(Calendar.YEAR);
+		int month= c.get(Calendar.MONTH)+1;
+
+
+		if(name.equals("0"))
+		{
+			example.createCriteria().andYearEqualTo(String.valueOf(year)).andMonthIsNull();
+
+		}else
+		{
+			example.createCriteria().andWindpoweridEqualTo(name).andYearEqualTo(String.valueOf(year)).andMonthIsNull();
+
+
+		}
+		List<Projectplan> wtls = selectByExample(example);
+		double tmp = 0;
+		for(Projectplan wt:wtls)
+		{
+			tmp = tmp + Double.valueOf(wt.getGeneratingcapacity());
+		}
+		return tmp;
+	}
+}

+ 98 - 0
src/main/java/com/gyee/frame/service/app/index/FocastpowerService.java

@@ -0,0 +1,98 @@
+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.*;
+
+/**
+ *
+ */
+@Service
+public class FocastpowerService extends SocketToolService{
+
+    @Resource
+    private ForecastwindspeedamendedService forecastwindspeedamendedService;
+
+
+    public double focastpower(String name){
+
+
+        ForecastwindspeedamendedExample forecastwindspeedamendedExample=new ForecastwindspeedamendedExample();
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date begin=c.getTime();
+        c.add(Calendar.DAY_OF_MONTH,1);
+        Date end=c.getTime();
+
+        if(name.equals("0"))
+        {
+            forecastwindspeedamendedExample.createCriteria().andRecodedateBetween(begin,end);
+
+        }else
+        {
+            forecastwindspeedamendedExample.createCriteria().andWpidEqualTo(name).andRecodedateBetween(begin,end);
+
+        }
+        List<Forecastwindspeedamended> wtls = forecastwindspeedamendedService.selectByExample(forecastwindspeedamendedExample);
+        double tmp = 0;
+        for(Forecastwindspeedamended wt:wtls)
+        {
+            tmp = tmp + wt.getDaypower().doubleValue()+wt.getNightpower().doubleValue();
+        }
+        return tmp;
+    }
+
+    public double focastspeed(String name){
+
+
+        ForecastwindspeedamendedExample forecastwindspeedamendedExample=new ForecastwindspeedamendedExample();
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date begin=c.getTime();
+        c.add(Calendar.DAY_OF_MONTH,1);
+        Date end=c.getTime();
+
+        if(name.equals("0"))
+        {
+            forecastwindspeedamendedExample.createCriteria().andRecodedateBetween(begin,end);
+
+        }else
+        {
+            forecastwindspeedamendedExample.createCriteria().andWpidEqualTo(name).andRecodedateBetween(begin,end);
+
+        }
+        List<Forecastwindspeedamended> wtls = forecastwindspeedamendedService.selectByExample(forecastwindspeedamendedExample);
+        double tmp = 0;
+        for(Forecastwindspeedamended wt:wtls)
+        {
+            tmp = tmp + wt.getDayspeed().doubleValue()+wt.getNightspeed().doubleValue();
+            tmp=StringUtils.round(tmp/2,2);
+        }
+        return tmp;
+    }
+
+}

+ 489 - 0
src/main/java/com/gyee/frame/service/app/index/IndexDetailService.java

@@ -0,0 +1,489 @@
+package com.gyee.frame.service.app.index;
+
+import com.gyee.frame.common.conf.redis.CacheContext;
+import com.gyee.frame.common.spring.Constant;
+import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.model.auto.*;
+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 com.gyee.frame.util.golden.StringUtil;
+import com.gyee.frame.util.mongodb.IMongodbUtil;
+import com.gyee.frame.util.mongodb.MongodbUtilImpl;
+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.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ *
+ */
+@Service
+public class IndexDetailService extends SocketToolService{
+	@Autowired
+    private InitialRunner initialRunner;
+    private static int decimal_digit = 0;
+	IEdosUtil mongodb = new EdosUtil();
+    @Resource
+    private WindpowerinfodayService windpowerinfodayService;
+    @Resource
+    private FocastpowerService focastpowerService;
+
+    public void index_curve_columnar_windSpeed_power() throws Exception {
+
+        Map<String, List<DataVo>> pointDataMap = new HashMap();
+
+        List<Windpowerstation> wpls = new ArrayList<>();
+        for (Windpowerstation wp : InitialRunner.wpls) {
+            wpls.add(wp);
+        }
+        Windpowerstation windpowerstationAll = new Windpowerstation();
+        windpowerstationAll.setId("0");
+        wpls.add(windpowerstationAll);
+
+        String[] ycPoints = Constant.TPOINT_WP_FGLYC.split(",");
+        String[] ycPoints2 = Constant.TPOINT_WP_FGLYC2.split(",");
+
+
+
+        Calendar c = Calendar.getInstance();
+        Date endDate = c.getTime();
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date beginDate = c.getTime();
+        long num = DateUtils.hoursDiff(beginDate, endDate);
+        Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
+
+        for (Windpowerstation windpowerstation : wpls) {
+
+            List<DataVo> vos = new ArrayList<DataVo>();
+            int length = 24;
+            for (int i = 0; i < length; i++) {
+                DataVo vo = new DataVo();
+
+                vo.setValue1(0.0);// 预测功率
+                vo.setValue2(0.0);// 理论功率
+                vo.setValue3(0.0);// 实发功率
+                vo.setValue4(0.0);// 平均风速
+                vos.add(vo);
+            }
+
+            Map<String, WindPowerStationTestingPoint2> map = stationPointmap.get(windpowerstation.getId());
+
+
+            WindPowerStationTestingPoint2 sjgl = map.get(Constant.TPOINT_WP_SJGL);
+            WindPowerStationTestingPoint2 llgl = map.get(Constant.TPOINT_WP_ZLLGL);
+            WindPowerStationTestingPoint2 pjfs = map.get(Constant.TPOINT_WP_SSFS);
+
+            Calendar cal = Calendar.getInstance();
+            //理论功率
+            WindPowerStationTestingPoint2 ycgl1 = stationPointmap.get(map).get(ycPoints[0]);
+            Date tempdate = null;
+            if (num > 0) {
+                List<PointData> datas = mongodb.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 3600L);
+
+                for (int j = 0; j < datas.size(); j++) {
+
+                    vos.get(j).setTime(datas.get(j).getPointTime() * 1000);
+                    vos.get(j).setValue1(StringUtils.round(datas.get(j).getPointValueInDouble(), 2));
+                    if (j == datas.size() - 1) {
+                        tempdate = new Date(datas.get(j).getPointTime() * 1000);
+                        cal.setTime(tempdate);
+                    }
+                }
+                int subresult = 0;
+                int total = 0;
+                if (length > datas.size()) {
+                    subresult = length - datas.size();
+                    if (subresult >= 8) {
+                        subresult = 8;
+                    }
+                    for (int i = 0; i < subresult; i++) {
+                        cal.add(Calendar.MINUTE, 30);
+                        vos.get(datas.size() + i).setTime(cal.getTime().getTime());
+                        WindPowerStationTestingPoint2 ycgl = map.get(ycPoints2[i]);
+                        vos.get(datas.size() + i).setValue1(StringUtils.round(mongodb.getRealData(ycgl).getPointValueInDouble(), 2));
+                    }
+                    total = datas.size() + subresult;
+                    subresult = length - (total);
+
+                    if (subresult > 0)
+                        for (int i = 0; i < subresult; i++) {
+                            cal.add(Calendar.MINUTE, 30);
+                            vos.get(total + i).setTime(cal.getTime().getTime());
+                            vos.get(total + i).setValue1(null);
+                        }
+                }
+
+            }
+            
+            WindPowerStationTestingPoint2 gdsjgl = InitialRunner.stationPointmap.get("-2").get(Constant.TPOINT_WP_SJGL);
+            List<PointData> gdsjglls = mongodb.getHistoryDatasSnap(gdsjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+            //实际功率
+            try {
+                if (null != llgl) {
+                           List<PointData> llglls = mongodb.getHistoryDatasSnap(llgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                    int count = 0;
+                    double temp1 = 0;
+                    double temp2 = 0;
+                    for (int i = 0; i < vos.size(); i++) {
+
+                        if (i < llglls.size() && StringUtils.isNotNull(llglls.get(i).getPointTime())) {
+
+                            if (vos.get(i).getTime() <= new Date().getTime()) {
+                                temp1 = llglls.get(i).getPointValueInDouble();
+                                temp2 = gdsjglls.get(i).getPointValueInDouble();
+                                temp1 = new BigDecimal(temp1).divide(new BigDecimal(100000), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                                // temp2 = new BigDecimal(temp2).divide(
+                                // new BigDecimal(100000), 2,
+                                // RoundingMode.HALF_EVEN).multiply(
+                                // new BigDecimal(100)).doubleValue();
+
+                                if (Math.abs(temp1) < 10000) {
+
+                                    if (windpowerstation.getId().equals("0")) {
+                                        vos.get(i).setValue2(StringUtils.round(temp1 + temp2, 2));// 理论功率
+                                    } else {
+                                        vos.get(i).setValue2(StringUtils.round(temp1, 2));// 理论功率
+                                    }
+
+                                }
+
+                                count++;
+                            } else {
+                                vos.get(i).setValue2(0d);// 理论功率
+                            }
+
+                        }
+                    }
+                    // for(int i=0;i<vos.size();i++){
+                    // vos.get(i).setValue8((double)count);
+                    // }
+                }
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+
+
+            if (null != sjgl) {
+                List<PointData> sjglls = mongodb.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+                int count = 0;
+                double temp = 0;
+                for (int i = 0; i < vos.size(); i++) {
+
+                    if (i < sjglls.size() && StringUtils.isNotNull(sjglls.get(i).getPointTime())) {
+
+                        if (vos.get(i).getTime() <= new Date().getTime()) {
+                            temp = sjglls.get(i).getPointValueInDouble();
+                            if (Math.abs(temp) < 10000) {
+                                vos.get(i).setValue3(StringUtils.round(temp, 2));// 实际功率
+                            }
+
+                            count++;
+                        } else {
+                            vos.get(i).setValue3(0d);// 实际功率
+                        }
+
+                    }
+                }
+                for (int i = 0; i < vos.size(); i++) {
+                    vos.get(i).setValue3((double) count);
+                }
+            }
+            try {
+                if (null != pjfs) {
+                    List<PointData> pjfsls = mongodb.getHistoryDatasSnap(pjfs, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                    double temp = 0;
+                    for (int i = 0; i < vos.size(); i++) {
+
+                        if (i < pjfsls.size() && StringUtils.isNotNull(pjfsls.get(i).getPointTime())) {
+
+                            if (vos.get(i).getTime() <= new Date().getTime()) {
+                                temp = pjfsls.get(i).getPointValueInDouble();
+
+                                if (Math.abs(temp) < 10000) {
+                                    vos.get(i).setValue4(StringUtils.round(temp, 2));// 平均风速
+                                }
+                            } else {
+                                vos.get(i).setValue4(0d);// 平均风速
+                            }
+
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+
+            pointDataMap.put(windpowerstation.getId(),vos);
+
+        }
+
+        this.pushToWeb("pageNumber_6", "functionNumber_6", pointDataMap, Messagetype.MESSAGE);
+
+    }
+
+
+    public void index_curve_columnar_five_loss() throws Exception {
+
+        Map<String, List<DataVo>> pointDataMap = new HashMap();
+
+        List<Windpowerstation> wpls = new ArrayList<>();
+        for (Windpowerstation wp : InitialRunner.wpls) {
+            wpls.add(wp);
+        }
+        Windpowerstation windpowerstationAll = new Windpowerstation();
+        windpowerstationAll.setId("0");
+        wpls.add(windpowerstationAll);
+
+
+        Calendar c = Calendar.getInstance();
+        Date endDate = c.getTime();
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date beginDate = c.getTime();
+
+        Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
+
+        for (Windpowerstation windpowerstation : wpls) {
+
+            List<DataVo> vos = new ArrayList<DataVo>();
+            long length = 7;
+            for (int i = 0; i < length; i++) {
+                DataVo vo = new DataVo();
+
+                vo.setValue1(0.0);// 发电量
+                vo.setValue2(0.0);// 故障损失
+                vo.setValue3(0.0);// 检修损失
+                vo.setValue4(0.0);// 限电损失
+                vo.setValue5(0.0);// 性能损失
+                vo.setValue6(0.0);// 受累损失
+                vo.setValue7(0.0);// 应发电量
+                vos.add(vo);
+            }
+            Map<String, WindPowerStationTestingPoint2> map = stationPointmap.get(windpowerstation.getId());
+
+//            public static final String RGZZSDL = "RGZZSDL";// 故障
+//            public static final String RSZZSDL = "RSZZSDL";// 故障
+//            public static final String RJXZSDL = "RJXZSDL";// 维护
+//            public static final String RLZZSDL = "RLZZSDL";// 维护
+//            public static final String RQFZSDL = "RQFZSDL";// 性能
+//            public static final String RXDZSDL = "RXDZSDL";// 限电
+//            public static final String RWZZSDL = "RWZZSDL";// 受累
+//            public static final String RTZZSDL = "RTZZSDL";// 受累
+
+            WindPowerStationTestingPoint2 fdl = map.get(Constant.TPOINT_WP_RFDL);
+
+            WindPowerStationTestingPoint2 gzss = map.get(Constant.RGZZSDL);
+            WindPowerStationTestingPoint2 gzsl = map.get(Constant.RSZZSDL);
+
+            WindPowerStationTestingPoint2 jxss = map.get(Constant.RJXZSDL);
+            WindPowerStationTestingPoint2 jxsl = map.get(Constant.RLZZSDL);
+
+            WindPowerStationTestingPoint2 xnss = map.get(Constant.RQFZSDL);
+            WindPowerStationTestingPoint2 xdss = map.get(Constant.RXDZSDL);
+
+            WindPowerStationTestingPoint2 slss = map.get(Constant.RWZZSDL);
+            WindPowerStationTestingPoint2 slsl = map.get(Constant.RTZZSDL);
+
+            Calendar cal = Calendar.getInstance();
+            //发电量
+            List<PointData> fdlls = mongodb.getHistoryDatasSnap(fdl, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+
+            for (int j = 0; j < fdlls.size(); j++) {
+
+                vos.get(j).setTime(fdlls.get(j).getPointTime() * 1000);
+                vos.get(j).setValue1(StringUtils.round(fdlls.get(j).getPointValueInDouble(),2));
+            }
+
+            try {
+
+                //故障损失
+                List<PointData> gzssls = mongodb.getHistoryDatasSnap(gzss, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+                //故障受累失
+                List<PointData> gzslls = mongodb.getHistoryDatasSnap(gzsl, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+
+                double temp1 = 0;
+                double temp2 = 0;
+                for (int i = 0; i < vos.size(); i++) {
+
+                    temp1 = new BigDecimal(gzssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    temp2 = new BigDecimal(gzslls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    vos.get(i).setValue4(StringUtils.round(temp1+temp2, 2));// 故障损失
+
+                }
+
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+
+            try {
+                //检修损失
+                List<PointData> jxssls = mongodb.getHistoryDatasSnap(jxss, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+                //检修受累
+                List<PointData> jxslls = mongodb.getHistoryDatasSnap(jxsl, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+
+                double temp1 = 0;
+                double temp2 = 0;
+                for (int i = 0; i < vos.size(); i++) {
+
+                    temp1 = new BigDecimal(jxssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    temp2 = new BigDecimal(jxslls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    vos.get(i).setValue3(StringUtils.round(temp1+temp2, 2));// 检修损失
+
+                }
+
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+
+            try {
+                //限电损失
+                List<PointData> xdssls = mongodb.getHistoryDatasSnap(xdss, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+
+                double temp = 0;
+                for (int i = 0; i < vos.size(); i++) {
+                    temp = new BigDecimal(xdssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    vos.get(i).setValue4(temp);// 限电损失
+
+                }
+
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+            try {
+                //性能损失
+                List<PointData> xnssls = mongodb.getHistoryDatasSnap(xnss, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+
+                double temp = 0;
+                for (int i = 0; i < vos.size(); i++) {
+                    temp = new BigDecimal(xnssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    vos.get(i).setValue5(temp);// 性能损失
+
+                }
+
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+
+            try {
+                //天气受累
+                List<PointData> slssls = mongodb.getHistoryDatasSnap(slss, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+                //电网受累
+                List<PointData> slslls = mongodb.getHistoryDatasSnap(slsl, beginDate.getTime() / 1000, endDate.getTime() / 1000, length, 3600*24L);
+
+                double temp1 = 0;
+                double temp2 = 0;
+                for (int i = 0; i < vos.size(); i++) {
+
+                    temp1 = new BigDecimal(slssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    temp2 = new BigDecimal(slslls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    vos.get(i).setValue6(StringUtils.round(temp1+temp2, 2));// 受累损失
+
+                }
+
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+
+            for(DataVo vo:vos)
+            {
+                vo.setValue7(StringUtils.round(vo.getValue1()+vo.getValue2()+vo.getValue3()+vo.getValue4()+vo.getValue5()+vo.getValue6(), 2));
+            }
+            pointDataMap.put(windpowerstation.getId(),vos);
+
+        }
+
+        this.pushToWeb("pageNumber_6", "functionNumber_7", pointDataMap, Messagetype.MESSAGE);
+
+    }
+
+
+    public void index_windStation_card() 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();
+
+        for(Windpowerstation windpowerstation:wpls){
+
+            Map<String,Object> pointDataMap = new HashMap();
+            double rfdl = 0;
+            double ycdl = 0;
+            double ssgl = 0;
+            double ssfs = 0;
+
+
+            try {
+                //日发电量
+                PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_RFDL).getCode());
+                rfdl = new BigDecimal(rfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                pointDataMap.put("rfdl_real",rfdl_real);
+                pointDataMap.put("rfdl",rfdl);
+            }catch (Exception e){
+                System.out.println(e.getMessage());
+            }
+
+            try {
+                //实时功率
+
+                PointData ssgl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SJGL).getCode());
+                ssgl = new BigDecimal(ssgl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                pointDataMap.put("ssgl",ssgl);
+                pointDataMap.put("ssgl_real",ssgl_real);
+            }catch (Exception e){
+                System.out.println(e.getMessage());
+            }
+
+
+            try{
+                //实时风速
+                PointData ssfs_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SSFS).getCode());
+                ssfs = new BigDecimal(ssfs_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                pointDataMap.put("ssfs",ssfs);
+                pointDataMap.put("ssfs_real",ssfs_real);
+            }catch (Exception e){
+                System.out.println(e.getMessage());
+            }
+
+            //预测发电量
+            ycdl=focastpowerService.focastpower(windpowerstation.getId());
+
+
+            pointDataMap.put("ycdl",ycdl);
+
+            windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
+        }
+
+
+        this.pushToWeb("pageNumber_6","functionNumber_8",windpowerstationpointDataMap, Messagetype.MESSAGE);
+    }
+
+
+
+
+}

+ 49 - 48
src/main/java/com/gyee/frame/service/app/index/IndexService.java

@@ -8,6 +8,7 @@ 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.StringUtils;
 import com.gyee.frame.util.golden.EdosUtil;
@@ -37,7 +38,10 @@ public class IndexService extends SocketToolService{
 	IEdosUtil mongodb = new EdosUtil();
     @Resource
     private WindpowerinfodayService windpowerinfodayService;
-	
+    @Resource
+    private ProjectplanService projectplanService;
+    @Resource
+    private FocastpowerService focastpowerService;
 	public void index_target_comprehensive_indicators() throws Exception{
 		 Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
 	        List<Windpowerstation> wpls = new ArrayList<>();
@@ -47,11 +51,11 @@ public class IndexService extends SocketToolService{
 	        Windpowerstation windpowerstationAll = new Windpowerstation();
 	        windpowerstationAll.setId("0");
 	        wpls.add(windpowerstationAll);
-	        Map<String,Map<String,Double>> windpowerstationpointDataMap = new HashMap();
+	        Map<String,Map<String,Object>> windpowerstationpointDataMap = new HashMap();
 
 
 	        for(Windpowerstation windpowerstation:wpls){
-	            Map<String,Double> pointDataMap = new HashMap();
+	            Map<String,Object> pointDataMap = new HashMap();
 	            double rfdl = 0;
 	            double aqts = 0;
 	            double swdl = 0;
@@ -60,8 +64,9 @@ public class IndexService extends SocketToolService{
 
 	            try {
 	                //日发电量
-	                PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_ALL_RFDL).getCode());
+	                PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_RFDL).getCode());
 	                rfdl = new BigDecimal(rfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                    pointDataMap.put("rfdl_real",rfdl_real);
 	            }catch (Exception e){
 	                System.out.println(e.getMessage());
 	            }
@@ -70,6 +75,7 @@ public class IndexService extends SocketToolService{
 	                //安全天数
 	                PointData aqts_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_AQTS).getCode());
 	                aqts = new BigDecimal(aqts_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                    pointDataMap.put("aqts_real",aqts_real);
 	            }catch (Exception e){
 	                System.out.println(e.getMessage());
 	            }
@@ -79,24 +85,13 @@ public class IndexService extends SocketToolService{
 	                //上网电量
 	                PointData 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();
+                    pointDataMap.put("swdl_real",swdl_real);
 	            }catch (Exception e){
 	                System.out.println(e.getMessage());
 	            }
 
 	            //预测发电量
-	            try{
-	                if(windpowerstation.getId().equalsIgnoreCase("0")){
-	                    List<Windpowerstation> wps = InitialRunner.wpls;
-	                    for(Windpowerstation windpowerstationinner:wps){
-	                        ycfdl = ycfdl + 12;
-	                    }
-	                }else{
-	                    ycfdl = 6;
-	                }
-	            }
-	            catch(Exception e){
-	                System.out.printf(e.getMessage());
-	            }
+                ycfdl=focastpowerService.focastpower(windpowerstation.getId());
 
 	            //装机容量
 	            try{
@@ -132,11 +127,11 @@ public class IndexService extends SocketToolService{
         Windpowerstation windpowerstationAll = new Windpowerstation();
         windpowerstationAll.setId("0");
         wpls.add(windpowerstationAll);
-        Map<String,Map<String,Double>> windpowerstationpointDataMap = new HashMap();
+        Map<String,Map<String,Object>> windpowerstationpointDataMap = new HashMap();
 
 
         for(Windpowerstation windpowerstation:wpls){
-            Map<String,Double> pointDataMap = new HashMap();
+            Map<String,Object> pointDataMap = new HashMap();
             double pjfs = 0;
             double pjfsMin = 0;
             double pjfsMax = 0;
@@ -152,8 +147,9 @@ public class IndexService extends SocketToolService{
 
             try {
                 //平均风速
-                PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_PJFS).getCode());
-                pjfs = new BigDecimal(rfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                PointData pjfs_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_PJFS).getCode());
+                pjfs = new BigDecimal(pjfs_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                pointDataMap.put("pjfs_real",pjfs_real);
             }catch (Exception e){
                 System.out.println(e.getMessage());
             }
@@ -197,19 +193,7 @@ public class IndexService extends SocketToolService{
             }
             
             //预测风速
-            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());
-            }
+            ycfs=focastpowerService.focastspeed(windpowerstation.getId());
             
           //预测风速min
             try{
@@ -251,8 +235,9 @@ public class IndexService extends SocketToolService{
 
             try{
                 //实际功率
-                PointData swdl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SJGL).getCode());
-                sjgl = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                PointData sjgl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SJGL).getCode());
+                sjgl = new BigDecimal(sjgl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                pointDataMap.put("sjgl_real",sjgl_real);
             }catch (Exception e){
                 System.out.println(e.getMessage());
             }
@@ -297,8 +282,9 @@ public class IndexService extends SocketToolService{
             
             try{
                 //理论功率
-                PointData swdl_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();
+                PointData llgl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_ZLLGL).getCode());
+                llgl = new BigDecimal(llgl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                pointDataMap.put("llgl_real",llgl_real);
             }catch (Exception e){
                 System.out.println(e.getMessage());
             }
@@ -464,25 +450,30 @@ public class IndexService extends SocketToolService{
 	            Map<String,Double> pointDataMap = new HashMap();
 	            double yfdl = 0;
 	            double nfdl = 0;
-
+                double yjhfdl = 0;
+                double njhfdl = 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();
+	                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();
 	            }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();
+	                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();
 	            }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",windpowerstationpointDataMap, Messagetype.MESSAGE);
@@ -497,11 +488,11 @@ public class IndexService extends SocketToolService{
        Windpowerstation windpowerstationAll = new Windpowerstation();
        windpowerstationAll.setId("0");
        wpls.add(windpowerstationAll);
-       Map<String,Map<String,Double>> windpowerstationpointDataMap = new HashMap();
+       Map<String,Map<String,Object>> windpowerstationpointDataMap = new HashMap();
 
 
        for(Windpowerstation windpowerstation:wpls){
-           Map<String,Double> pointDataMap = new HashMap();
+           Map<String,Object> pointDataMap = new HashMap();
            double mttr = 99;
            double mtbf = 99;
            double jybm = 99;
@@ -524,6 +515,7 @@ public class IndexService extends SocketToolService{
                //节约标煤
                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());
            }
@@ -533,6 +525,8 @@ public class IndexService extends SocketToolService{
                //减排二氧化硫
                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());
            }
@@ -542,6 +536,7 @@ public class IndexService extends SocketToolService{
                //节约用水
                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());
            }
@@ -567,6 +562,7 @@ public class IndexService extends SocketToolService{
                //减排二氧化碳
                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());
            }
@@ -574,14 +570,19 @@ public class IndexService extends SocketToolService{
 
            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("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",windpowerstationpointDataMap, Messagetype.MESSAGE);

+ 1 - 1
src/main/java/com/gyee/frame/service/app/windpowerstationdetail/WindpowerstationdetailService.java

@@ -61,7 +61,7 @@ public class WindpowerstationdetailService extends SocketToolService {
 
             try {
                 //日发电量
-                PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_ALL_RFDL).getCode());
+                PointData rfdl_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_RFDL).getCode());
                 rfdl = new BigDecimal(rfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
             }catch (Exception e){
                 System.out.println(e.getMessage());

+ 7 - 0
src/main/java/com/gyee/frame/util/StringUtils.java

@@ -1,5 +1,7 @@
 package com.gyee.frame.util;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Collection;
 import java.util.Map;
 
@@ -435,4 +437,9 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
         }
         return columnToJava(tableName);
     }
+
+    public static double round(double num, int digit) {
+
+        return new BigDecimal(num).setScale(digit, RoundingMode.HALF_UP).doubleValue();
+    }
 }