Browse Source

开发对标管理接口

shilin 4 years ago
parent
commit
713633e305

+ 113 - 6
src/main/java/com/gyee/frame/controller/contrast/ContrastController.java

@@ -12,10 +12,12 @@ import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -29,9 +31,9 @@ public class ContrastController {
     @Resource
     private ContrastWtService contrastWtService;
     /**
-     * 查询五损列表信息
+     * 查询风机列表信息
      **/
-    @GetMapping("/benchmarkLossList")
+    @PostMapping("/benchmarkLossList")
     @ResponseBody
     public AjaxResult benchmarkLossList(Tablepar tablepar, String wpId, String beginDate, String endDate) {
 
@@ -55,6 +57,58 @@ public class ContrastController {
     }
 
     /**
+     * 查询场内对标列表信息
+     **/
+    @PostMapping("/benchmarkWpList")
+    @ResponseBody
+    public AjaxResult benchmarkWpList(Tablepar tablepar, String wpId, String beginDate, String endDate) {
+
+        List<BenchMarkVo> vos =contrastWpService.benchmarkWpList(wpId, beginDate,  endDate);
+
+
+
+        if (vos != null && !vos.isEmpty()) {
+            BenchmarkUtil bu = new BenchmarkUtil();
+            vos = bu.getBenchMarkOrder(vos);
+            //默认综合排序,不需要从新排序,除非指定字段排序
+            if(StringUtils.notEmp(tablepar) && StringUtils.isNotEmpty(tablepar.getOrderByColumn()) )
+            {
+                vos = bu.getBenchMarkOrder(vos,tablepar);
+            }
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.emptyresultset.code, vos);
+        }
+
+    }
+
+    /**
+     * 查询场内对标列表信息
+     **/
+    @PostMapping("/benchmarkWpOutList")
+    @ResponseBody
+    public AjaxResult benchmarkWpOutList(Tablepar tablepar, String wpId, String beginDate, String endDate) {
+
+        List<BenchMarkVo> vos =contrastWpService.benchmarkWpOutList(wpId, beginDate,  endDate);
+
+
+
+        if (vos != null && !vos.isEmpty()) {
+            BenchmarkUtil bu = new BenchmarkUtil();
+            vos = bu.getBenchMarkOrder(vos);
+            //默认综合排序,不需要从新排序,除非指定字段排序
+            if(StringUtils.notEmp(tablepar) && StringUtils.isNotEmpty(tablepar.getOrderByColumn()) )
+            {
+                vos = bu.getBenchMarkOrder(vos,tablepar);
+            }
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.emptyresultset.code, vos);
+        }
+
+    }
+
+    /**
      * 查询等级评估日所有信息
      **/
     @GetMapping("/findWpPowerOutChat")
@@ -88,13 +142,37 @@ public class ContrastController {
     }
 
     /**
-     * 查询风机列表信息
+     * 查询五损风机列表信息
+     **/
+    @PostMapping("/benchmarkWtList")
+    @ResponseBody
+    public AjaxResult benchmarkWtList(Tablepar tablepar, String wpId,String wtId, String beginDate, String endDate) {
+
+        List<BenchMarkVo> vos =contrastWtService.benchmarkWtList(wpId,wtId, beginDate,  endDate);
+
+        if (vos != null && !vos.isEmpty()) {
+            BenchmarkUtil bu = new BenchmarkUtil();
+            vos = bu.getBenchMarkOrder(vos);
+            //默认综合排序,不需要从新排序,除非指定字段排序
+            if(StringUtils.notEmp(tablepar) && StringUtils.isNotEmpty(tablepar.getOrderByColumn()) )
+            {
+                vos = bu.getBenchMarkOrder(vos,tablepar);
+            }
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.emptyresultset.code, vos);
+        }
+
+    }
+
+    /**
+     * 查询场内风机列表信息
      **/
-    @GetMapping("/benchmarkLossWtList")
+    @PostMapping("/benchmarkWpInWtList")
     @ResponseBody
-    public AjaxResult benchmarkLossWtList(Tablepar tablepar, String wpId, String beginDate, String endDate) {
+    public AjaxResult benchmarkWpInWtList(Tablepar tablepar, String wpId,String wtId, String beginDate, String endDate) {
 
-        List<BenchMarkVo> vos =contrastWtService.benchmarkLossWtList(wpId, beginDate,  endDate);
+        List<BenchMarkVo> vos =contrastWtService.benchmarkWtList(wpId,wtId,beginDate, endDate);
 
         if (vos != null && !vos.isEmpty()) {
             BenchmarkUtil bu = new BenchmarkUtil();
@@ -111,5 +189,34 @@ public class ContrastController {
 
     }
 
+
+    /**
+     * 新增值际对标
+     **/
+    @PostMapping("/addBenchmarkZj")
+    @ResponseBody
+    public AjaxResult addBenchmarkZj(HttpServletRequest request,Tablepar tablepar, String wpId, String year, String month, String zjs) {
+
+        List<BenchMarkVo> vos=null;
+       // List<BenchMarkVo> vos =contrastWtService.benchmarkWtList(wpId,wtId,beginDate, endDate);
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(year) && StringUtils.notEmp(month) && StringUtils.notEmp(zjs)) {
+
+
+        }
+
+        if (vos != null && !vos.isEmpty()) {
+            BenchmarkUtil bu = new BenchmarkUtil();
+            vos = bu.getBenchMarkOrder(vos);
+            //默认综合排序,不需要从新排序,除非指定字段排序
+            if(StringUtils.notEmp(tablepar) && StringUtils.isNotEmpty(tablepar.getOrderByColumn()) )
+            {
+                vos = bu.getBenchMarkOrder(vos,tablepar);
+            }
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.emptyresultset.code, vos);
+        }
+
+    }
 }
 

+ 30 - 0
src/main/java/com/gyee/frame/model/custom/ConditionVo.java

@@ -0,0 +1,30 @@
+package com.gyee.frame.model.custom;
+
+import java.util.Date;
+
+public class ConditionVo {
+
+	private Date beginDate;
+	private Date endDate;
+	String wpId;
+
+	public String getWpId() {
+		return wpId;
+	}
+	public void setWpId(String wpId) {
+		this.wpId = wpId;
+	}
+	public Date getBeginDate() {
+		return beginDate;
+	}
+	public void setBeginDate(Date beginDate) {
+		this.beginDate = beginDate;
+	}
+	public Date getEndDate() {
+		return endDate;
+	}
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+	
+}

+ 47 - 0
src/main/java/com/gyee/frame/service/FaultEliminateDefectsService.java

@@ -12,6 +12,7 @@ import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -171,6 +172,52 @@ public class FaultEliminateDefectsService implements BaseService<FaultEliminateD
 		return stmap;
 	}
 
+
+
+	public Map<String, Map<String, FaultEliminateDefects>> getFaultEliminateDefectsByWt(String wpId, Date beginDate, Date endDate){
+
+		Map<String, Map<String, FaultEliminateDefects>> stmap = new HashMap<String, Map<String, FaultEliminateDefects>>();
+		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+
+		List<FaultEliminateDefects> list=new ArrayList<>();
+
+		FaultEliminateDefectsExample example=new FaultEliminateDefectsExample();
+		example.setOrderByClause("windpowerstationid ASC");
+
+		FaultEliminateDefectsExample.Criteria criteria =example.createCriteria();
+
+		if(StringUtils.isNotEmpty(wpId))
+		{
+			criteria.andWindpowerstationidEqualTo(wpId);
+		}
+
+		if(beginDate!=null && endDate!=null ){
+
+
+			criteria.andDatetimeGreaterThanOrEqualTo(beginDate).andDatetimeLessThanOrEqualTo(endDate);
+			list= faultEliminateDefectsMapper.selectByExample(example);
+		}
+		if(list!=null)
+		{
+			for(FaultEliminateDefects st:list)
+			{
+				String day = df.format(st.getDatetime());
+				if(stmap.containsKey(st.getWindpowerstationid()))
+				{
+					Map<String, FaultEliminateDefects> map=stmap.get(st.getWindpowerstationid());
+					map.put(day, st);
+					stmap.put(st.getWindpowerstationid(),map);
+				}else
+				{
+					Map<String, FaultEliminateDefects> map=new HashMap<String, FaultEliminateDefects>();
+					map.put(day, st);
+					stmap.put(st.getWindpowerstationid(),map);
+				}
+			}
+		}
+		return stmap;
+	}
+
 	public Map<String, FaultEliminateDefects> getFaultEliminateDefectsByWtTotal(String id, Date beginDate, Date endDate,int type){
 
 		Map<String, FaultEliminateDefects> stmap = new HashMap<String, FaultEliminateDefects>();

+ 47 - 0
src/main/java/com/gyee/frame/service/StatetransitionratesService.java

@@ -12,6 +12,7 @@ import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -310,4 +311,50 @@ public class StatetransitionratesService implements BaseService<Statetransitionr
 		return stmap;
 	}
 
+
+	public Map<String, Map<String, Statetransitionrates>>  getStatetransitionratesByWt(String id, Date beginDate, Date endDate){
+
+		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+
+		Map<String, Map<String, Statetransitionrates>> stmap = new HashMap<String, Map<String, Statetransitionrates>>();
+
+		List<Statetransitionrates> list=new ArrayList<>();
+
+		StatetransitionratesExample example=new StatetransitionratesExample();
+		example.setOrderByClause("windpwoerid ASC");
+
+		StatetransitionratesExample.Criteria criteria =example.createCriteria();
+
+		if(StringUtils.notEmp(id)){
+			criteria.andWindpwoeridEqualTo(id);
+		}
+		if(beginDate!=null && endDate!=null){
+
+
+			criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
+			list= statetransitionratesMapper.selectByExample(example);
+		}
+
+		if(list!=null)
+		{
+
+			for(Statetransitionrates st:list)
+			{
+				String day = df.format(st.getRecorddate());
+				if(stmap.containsKey(st.getWindpwoerid()))
+				{
+					Map<String, Statetransitionrates> map=stmap.get(st.getWindpwoerid());
+
+					map.put(day, st);
+					stmap.put(st.getWindpwoerid(),map);
+				}else
+				{
+					Map<String, Statetransitionrates> map=new HashMap<String, Statetransitionrates>();
+					map.put(day, st);
+					stmap.put(st.getWindpwoerid(),map);
+				}
+			}
+		}
+		return stmap;
+	}
 }

+ 6 - 7
src/main/java/com/gyee/frame/service/Windpowerinfoday3Service.java

@@ -664,7 +664,7 @@ public class Windpowerinfoday3Service implements BaseService<Windpowerinfoday3,
 	}
 
 
-	public List<Windpowerinfoday3> getWindpowerinfoday3(List<String> wpIds, Date beginDate, Date endDate,String location,String foreignkeyid) {
+	public List<Windpowerinfoday3> getWindpowerinfoday3(List<String> ids, Date beginDate, Date endDate,String location) {
 
 
 		List<Windpowerinfoday3> list=new ArrayList<>();
@@ -674,9 +674,9 @@ public class Windpowerinfoday3Service implements BaseService<Windpowerinfoday3,
 
 		Windpowerinfoday3Example.Criteria criteria =example.createCriteria();
 
-		if(StringUtils.isNotEmpty(wpIds))
+		if(StringUtils.isNotEmpty(ids))
 		{
-			criteria.andForeignkeyidIn(wpIds);
+			criteria.andForeignkeyidIn(ids);
 		}
 
 		if(beginDate!=null && endDate!=null ){
@@ -687,10 +687,9 @@ public class Windpowerinfoday3Service implements BaseService<Windpowerinfoday3,
 			criteria.andLocationEqualTo(location);
 		}
 
-		if(StringUtils.isNotEmpty(foreignkeyid))
-		{
-			criteria.andForeignkeyidLike(foreignkeyid);
-		}
+		criteria.andForeignkeyidLike("%FDC");
+
+
 
 		list= windpowerinfoday3Mapper.selectByExample(example);
 		return list;

+ 17 - 1
src/main/java/com/gyee/frame/service/Windturbineinfoday3Service.java

@@ -785,7 +785,7 @@ public class Windturbineinfoday3Service implements BaseService<Windturbineinfoda
 
     }
 
-    public List<Windturbineinfoday3> getWindturbineinfoday3(String wpId, Date beginDate, Date endDate) {
+    public List<Windturbineinfoday3> getWindturbineinfoday3(String wpId,String wtId, Date beginDate, Date endDate) {
 
 
         List<Windturbineinfoday3> list=new ArrayList<>();
@@ -799,7 +799,23 @@ public class Windturbineinfoday3Service implements BaseService<Windturbineinfoda
         {
             criteria.andWindpowerstationidEqualTo(wpId);
         }
+        List<String> wtids = new ArrayList<String>();
+        if (StringUtils.notEmp(wtId)) {
+            if (wtId.indexOf(",") != -1) {
+                String[] strs = wtId.split(",");
+                if (strs.length > 0) {
+                    for (int i = 0; i < strs.length; i++) {
+                        wtids.add(strs[i]);
+                    }
+                }
+            } else {
+                wtids.add(wtId);
+            }
+        }
 
+        if (!wtids.isEmpty()) {
+            criteria.andWindturbineidIn(wtids);
+        }
         if(beginDate!=null && endDate!=null ){
             criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
         }

+ 293 - 0
src/main/java/com/gyee/frame/service/contrast/ContrastPjService.java

@@ -0,0 +1,293 @@
+package com.gyee.frame.service.contrast;
+
+import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.custom.BenchMarkVo;
+import com.gyee.frame.service.FaultEliminateDefectsService;
+import com.gyee.frame.service.StatetransitionratesService;
+import com.gyee.frame.service.Windpowerinfoday3Service;
+import com.gyee.frame.util.DateUtils;
+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 ContrastPjService {
+	@Resource
+	private Windpowerinfoday3Service windpowerinfoday3Service;
+	@Autowired
+	private FaultEliminateDefectsService faultEliminateDefectsService;
+	@Autowired
+	private StatetransitionratesService statetransitionratesService;
+
+
+
+	public List<BenchMarkVo> benchmarkPjList(String wpId,String pjId, String beginDate, String endDate) {
+		List<BenchMarkVo> vos = new ArrayList<>();
+		Date tempDate = null;
+		if (StringUtils.isNotEmpty(beginDate) && StringUtils.isNotEmpty(endDate)) {
+			Date begin = DateUtils.parseDate(beginDate);
+			Date end = DateUtils.parseDate(endDate);
+
+			// 获得复位及时率、状态转换及时率数据
+			Map<String, Statetransitionrates> stmap = statetransitionratesService.getStatetransitionratesByWpTotal(null, begin, end);
+			// 获得消缺及时率数据
+			Map<String, FaultEliminateDefects> fdmap = faultEliminateDefectsService.getFaultEliminateDefectsByWpTotal(null, begin, end);
+
+			List<String> wpids = new ArrayList<String>();
+			if (StringUtils.notEmp(wpId)) {
+				if (wpId.indexOf(",") != -1) {
+					String[] strs = wpId.split(",");
+					if (strs.length > 0) {
+						for (int i = 0; i < strs.length; i++) {
+							wpids.add(strs[i]);
+						}
+					}
+				} else {
+					wpids.add(wpId);
+				}
+			}
+
+			List<String> pjids = new ArrayList<String>();
+			if (StringUtils.notEmp(pjId)) {
+				if (pjId.indexOf(",") != -1) {
+					String[] strs = pjId.split(",");
+					if (strs.length > 0) {
+						for (int i = 0; i < strs.length; i++) {
+							pjids.add(strs[i]);
+						}
+					}
+				} else {
+					pjids.add(pjId);
+				}
+			}
+			List<Windpowerinfoday3> ls =null;
+			if (!pjids.isEmpty()) {
+				ls =windpowerinfoday3Service.getWindpowerinfoday3(pjids, begin, end, "project");
+			} else if (!wpids.isEmpty()) {
+				ls =windpowerinfoday3Service.getWindpowerinfoday3(wpids, begin, end, "windpower");
+			}
+
+			Map<String, Windpowerstation> wpmap = InitialRunner.wpmap;
+
+			Map<String, Project> pjmap = InitialRunner.pjmap;
+
+			Map<String, Windpowerinfoday3> wdmap = new HashMap<String, Windpowerinfoday3>();
+			if (!ls.isEmpty()) {
+				for (Windpowerinfoday3 wd : ls) {
+					if (wdmap.containsKey(wd.getProjectid())) {
+						Windpowerinfoday3 w = wdmap.get(wd.getProjectid());
+						w.setWindpowerstationid(wd.getWindpowerstationid());
+						w.setProjectid(wd.getProjectid());
+						double losspower1 = null != wd.getDaynhxdssdl() ? wd.getDaynhxdssdl() : 0.0;
+						double losspower2 = null != wd.getDaynhgzssdl() ? wd.getDaynhgzssdl() : 0.0;
+						double losspower3 = null != wd.getDaynhwhssdl() ? wd.getDaynhwhssdl() : 0.0;
+						double losspower4 = null != wd.getDaynhqfdl() ? wd.getDaynhqfdl() : 0.0;
+						double scadafdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0; // scada发电量
+
+						w.setDaynhxdssdl(w.getDaynhxdssdl() + losspower1);
+						w.setDaynhgzssdl(w.getDaynhgzssdl() + losspower2);
+						w.setDaynhwhssdl(w.getDaynhwhssdl() + losspower3);
+						w.setDaynhqfdl(w.getDaynhqfdl() + losspower4);
+						w.setDaydl2(w.getDaydl2() + scadafdl);
+						wdmap.put(wd.getProjectid(), w);
+					} else {
+						Windpowerinfoday3 w = new Windpowerinfoday3();
+						w.setWindpowerstationid(wd.getWindpowerstationid());
+						w.setProjectid(wd.getProjectid());
+						double scadafdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0; // scada发电量
+						double losspower1 = null != wd.getDaynhxdssdl() ? wd.getDaynhxdssdl() : 0.0;
+						double losspower2 = null != wd.getDaynhgzssdl() ? wd.getDaynhgzssdl() : 0.0;
+						double losspower3 = null != wd.getDaynhwhssdl() ? wd.getDaynhwhssdl() : 0.0;
+						double losspower4 = null != wd.getDaynhqfdl() ? wd.getDaynhqfdl() : 0.0;
+						w.setDaydl2(scadafdl);
+						w.setDaynhxdssdl(losspower1);
+						w.setDaynhgzssdl(losspower2);
+						w.setDaynhwhssdl(losspower3);
+						w.setDaynhqfdl(losspower4);
+						wdmap.put(wd.getProjectid(), w);
+					}
+				}
+
+				Set<Map.Entry<String, Windpowerinfoday3>> set = wdmap.entrySet();
+				for (Iterator<Map.Entry<String, Windpowerinfoday3>> it = set.iterator(); it.hasNext();) {
+					Map.Entry<String, Windpowerinfoday3> entry = (Map.Entry<String, Windpowerinfoday3>) it.next();
+					// System.out.println(entry.getKey() + "--->" +
+					// entry.getValue());
+
+					Windpowerinfoday3 wd = entry.getValue();
+					BenchMarkVo vo = new BenchMarkVo();
+
+					if (pjmap.containsKey(wd.getProjectid())) {
+						Project pj = pjmap.get(wd.getProjectid());
+						vo.setPjId(wd.getProjectid());
+						vo.setPjName(pj.getName());
+
+					}
+					if (wpmap.containsKey(wd.getWindpowerstationid())) {
+						Windpowerstation wp = wpmap.get(wd.getWindpowerstationid());
+						vo.setWpId(wd.getWindpowerstationid());
+						vo.setWpName(wp.getName());
+					}
+					// vo.setRecordDate(DateUtils.truncate(wd.getRecorddate()));
+					double scadafdl = null != wd.getDaydl2() ? (new BigDecimal(wd.getDaydl2()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue()) : 0; // scada发电量
+					double fdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0; // 发电量
+					double qfss = null != wd.getDaynhqfdl() ? (new BigDecimal(wd.getDaynhqfdl()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue()) : 0;// 欠发损失发电量
+					double gzss = null != wd.getDaynhgzssdl() ? (new BigDecimal(wd.getDaynhgzssdl()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue()) : 0;// 故障损失发电量
+					double whss = null != wd.getDaynhwhssdl() ? (new BigDecimal(wd.getDaynhwhssdl()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue()) : 0;// 维护损失发电量
+					double xdss = null != wd.getDaynhxdssdl() ? (new BigDecimal(wd.getDaynhxdssdl()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue()) : 0;// 限电损失发电量
+					double llfdl = scadafdl + qfss + gzss + whss + xdss;// 理论发电量
+					vo.setFdl(fdl);// 发电量
+					vo.setFjhtyssdl(gzss);// 非计划停运损失电量
+					vo.setSbyxssdl(qfss);// 设备运行状态损失电量
+					vo.setSlssl(0.0);// 受累损失电量
+
+					vo.setScadafdl(scadafdl);
+					vo.setGzss(gzss);
+					vo.setWhss(whss);
+					vo.setQfss(qfss);
+					vo.setXdss(xdss);
+					vo.setSlss(0.0);
+
+					if (llfdl != 0) {
+						double temp = xdss;
+
+						BigDecimal b1 = new BigDecimal(temp);
+						BigDecimal b2 = new BigDecimal(llfdl);
+
+						temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+						// temp 弃风率
+						vo.setQfl(temp);
+						temp = qfss;
+
+						b1 = new BigDecimal(temp);
+						b2 = new BigDecimal(llfdl);
+
+						temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+						// temp 性能损失率
+						vo.setXnssl(temp);
+						temp = gzss;
+
+						b1 = new BigDecimal(temp);
+						b2 = new BigDecimal(llfdl);
+
+						temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+						// temp 故障损失率
+						vo.setGzssl(temp);
+
+						temp = whss;
+
+						b1 = new BigDecimal(temp);
+						b2 = new BigDecimal(llfdl);
+
+						temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+						// temp 检修损失率
+						vo.setJxssl(temp);
+						temp = 0;
+
+						b1 = new BigDecimal(temp);
+						b2 = new BigDecimal(llfdl);
+
+						temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+						// temp 受累损失率
+						vo.setSlssl(temp);
+						temp = scadafdl;
+
+						b1 = new BigDecimal(temp);
+						b2 = new BigDecimal(llfdl);
+
+						temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+						// temp 风能利用率
+						vo.setFnlyl(temp);
+					} else {
+						// temp 风能利用率
+						vo.setFnlyl(0.0);
+						// temp 故障损失率
+						vo.setGzssl(0.0);
+						// temp 检修损失率
+						vo.setJxssl(0.0);
+						// temp 弃风率
+						vo.setQfl(0.0);
+						// temp 受累损失率
+						vo.setSlssl(0.0);
+						// temp 性能损失率
+						vo.setXnssl(0.0);
+					}
+
+					if (stmap.containsKey(wd.getWindpowerstationid())) {
+						Statetransitionrates st = stmap.get(wd.getWindpowerstationid());
+
+						double temp1 = st.getTimerate1();// 小于3米5分钟转换及时次数
+						double temp2 = st.getTimerate13();// 小于3米状态转换总次数
+
+						if (temp2 != 0) {
+							double temp = 0;
+
+							BigDecimal b1 = new BigDecimal(temp1);
+							BigDecimal b2 = new BigDecimal(temp2);
+
+							temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+							// temp 复位及时率
+							vo.setFwjsl(temp);
+						} else {
+							vo.setFwjsl(100.0);
+						}
+
+						temp1 = st.getTimerate16();// 5分钟复位及时次数
+						temp2 = st.getTimerate20();// 总复位次数
+
+						if (temp2 != 0) {
+							double temp = 0;
+
+							BigDecimal b1 = new BigDecimal(temp1);
+							BigDecimal b2 = new BigDecimal(temp2);
+
+							temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+							// temp 状态转换及时率
+							vo.setZtzhjsl(temp);
+						} else {
+							vo.setZtzhjsl(100.0);
+						}
+
+					} else {
+						vo.setZtzhjsl(100.0);
+						vo.setFwjsl(100.0);
+					}
+					if (fdmap.containsKey(wd.getWindpowerstationid())) {
+						FaultEliminateDefects fd = fdmap.get(wd.getWindpowerstationid());
+
+						double temp1 = fd.getRightcount();// 消缺及时次数
+						double temp2 = fd.getFaultcount();// 故障次数
+
+						if (temp2 != 0) {
+							double temp = 0;
+
+							BigDecimal b1 = new BigDecimal(temp1);
+							BigDecimal b2 = new BigDecimal(temp2);
+
+							temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+							// temp 消缺及时率
+							vo.setXqjsl(temp);
+						} else {
+							vo.setXqjsl(100.0);
+						}
+
+					} else {
+						vo.setXqjsl(100.0);
+					}
+
+					vos.add(vo);
+
+				}
+			}
+
+		}
+		return vos;
+	}
+}

File diff suppressed because it is too large
+ 763 - 316
src/main/java/com/gyee/frame/service/contrast/ContrastWpService.java


+ 273 - 64
src/main/java/com/gyee/frame/service/contrast/ContrastWtService.java

@@ -10,12 +10,14 @@ import com.gyee.frame.service.FaultEliminateDefectsService;
 import com.gyee.frame.service.StatetransitionratesService;
 import com.gyee.frame.service.Windturbineinfoday3Service;
 import com.gyee.frame.util.DateUtils;
+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.text.SimpleDateFormat;
 import java.util.*;
 
 
@@ -28,16 +30,29 @@ public class ContrastWtService {
 	@Autowired
 	private StatetransitionratesService statetransitionratesService;
 
-	public List<BenchMarkVo> benchmarkLossWtList(String wpId, String beginDate, String endDate)
+	public List<BenchMarkVo> benchmarkWtList(String wpId,String wtId, String beginDate, String endDate)
 	{
 		List<BenchMarkVo> vos=new ArrayList<>();
-		getBenchMarkInfo(vos,wpId, beginDate, endDate);
+		getBenchMarkInfo(vos,wpId,wtId, beginDate, endDate);
 		return vos;
 	}
-	public void getBenchMarkInfo(List<BenchMarkVo> vos,String wpId, String beginDate, String endDate)   {
+	public void getBenchMarkInfo(List<BenchMarkVo> vos,String wpId,String wtId, String beginDate, String endDate)   {
 		Map<String, BenchMarkVo> bmmap = new HashMap<String, BenchMarkVo>();
 
-		setBenchmarkInfo(bmmap, wpId,DateUtils.parseDate(beginDate),DateUtils.parseDate(endDate));
+		List<String> wpids = new ArrayList<String>();
+		if (StringUtils.notEmp(wpId)) {
+			if (wpId.indexOf(",") != -1) {
+				String[] strs = wpId.split(",");
+				if (strs.length > 0) {
+					for (int i = 0; i < strs.length; i++) {
+						wpids.add(strs[i]);
+					}
+				}
+			} else {
+				wpids.add(wpId);
+			}
+		}
+		setBenchmarkInfo(bmmap, wpids, wtId,DateUtils.parseDate(beginDate),DateUtils.parseDate(endDate));
 
 		Set<Map.Entry<String, BenchMarkVo>> set = bmmap.entrySet();
 		for (Iterator<Map.Entry<String, BenchMarkVo>> it = set.iterator(); it.hasNext();) {
@@ -50,69 +65,72 @@ public class ContrastWtService {
 
 	}
 
-	private void setBenchmarkInfo(Map<String, BenchMarkVo> bmmap, String wpId, Date beginDate, Date endDate) {
-		// 获得复位及时率、状态转换及时率数据
-		Map<String, Statetransitionrates> stmap = statetransitionratesService.getStatetransitionratesByWtTotal(wpId, beginDate, endDate, 1);
-		// 获得消缺及时率数据
-		Map<String, FaultEliminateDefects> fdmap = faultEliminateDefectsService.getFaultEliminateDefectsByWtTotal(wpId, beginDate, endDate, 1);
-
+	private void setBenchmarkInfo(Map<String, BenchMarkVo> bmmap, List<String> wpids,String wtId, Date beginDate, Date endDate) {
+		if (!wpids.isEmpty()) {
+			for (String wpid : wpids) {
+				// 获得复位及时率、状态转换及时率数据
+				Map<String, Statetransitionrates> stmap = statetransitionratesService.getStatetransitionratesByWtTotal(wpid, beginDate, endDate, 1);
+				// 获得消缺及时率数据
+				Map<String, FaultEliminateDefects> fdmap = faultEliminateDefectsService.getFaultEliminateDefectsByWtTotal(wpid, beginDate, endDate, 1);
+
+				List<Windturbineinfoday3> ls =windturbineinfoday3Service.getWindturbineinfoday3(wpid,wtId, beginDate, endDate) ;
+
+				Map<String, Windturbine> wtmap = InitialRunner.wtmap;
+
+				if (!ls.isEmpty()) {
+					for (Windturbineinfoday3 wd : ls) {
+
+						if (bmmap.containsKey(wd.getWindturbineid())) {
+							BenchMarkVo bm = bmmap.get(wd.getWindturbineid());
+							bm.setScadafdl(bm.getScadafdl() + wd.getDaydl2());
+							bm.setGzss(bm.getGzss() + wd.getDaynhgzssdl());
+							bm.setWhss(bm.getWhss() + wd.getDaynhwhssdl());
+							bm.setQfss(bm.getQfss() + wd.getDaynhqfdl());
+							bm.setXdss(bm.getXdss() + wd.getDaynhxdssdl());
+							bmmap.put(wd.getWindturbineid(), bm);
+						} else {
+							BenchMarkVo bm = new BenchMarkVo();
+							intialBenchMarkTemp(bm);
+							bm.setScadafdl(bm.getScadafdl() + wd.getDaydl2());
+							bm.setGzss(bm.getGzss() + wd.getDaynhgzssdl());
+							bm.setWhss(bm.getWhss() + wd.getDaynhwhssdl());
+							bm.setQfss(bm.getQfss() + wd.getDaynhqfdl());
+							bm.setXdss(bm.getXdss() + wd.getDaynhxdssdl());
+							if (wtmap.containsKey(wd.getWindturbineid())) {
+								Windturbine wt = wtmap.get(wd.getWindturbineid());
+								// bm.setWtName(wt.getName());
+								bm.setWtName(wt.getCode());
+							}
+							bm.setWtId(wd.getWindturbineid());
+
+							if (stmap.containsKey(wd.getWindturbineid())) {
+								Statetransitionrates st = stmap.get(wd.getWindturbineid());
+
+								Double temp1 = st.getTimerate1();// 小于3米5分钟转换及时次数
+								Double temp2 = st.getTimerate13();// 小于3米状态转换总次数
+								bm.setZtcs(bm.getZtcs() + temp1.intValue());
+								bm.setZtzcs(bm.getZtzcs() + temp2.intValue());
+								temp1 = st.getTimerate16();// 5分钟复位及时次数
+								temp2 = st.getTimerate20();// 总复位次数
+								bm.setFwcs(bm.getFwcs() + temp1.intValue());
+								bm.setFwzcs(bm.getFwzcs() + temp2.intValue());
+							}
+							if (fdmap.containsKey(wd.getWindturbineid())) {
+								FaultEliminateDefects fd = fdmap.get(wd.getWindturbineid());
+
+								Integer temp1 = fd.getRightcount();// 消缺及时次数
+								Integer temp2 = fd.getFaultcount();// 故障次数
+
+								bm.setXqcs(bm.getXqcs() + temp1.intValue());
+								bm.setXqzcs(bm.getXqzcs() + temp2.intValue());
+
+							}
+							bmmap.put(wd.getWindturbineid(), bm);
+
+						}
 
-		List<Windturbineinfoday3> ls =windturbineinfoday3Service.getWindturbineinfoday3(wpId, beginDate, endDate) ;
-
-		Map<String, Windturbine> wtmap = InitialRunner.wtmap;
-
-		if (!ls.isEmpty()) {
-			for (Windturbineinfoday3 wd : ls) {
-
-				if (bmmap.containsKey(wd.getWindturbineid())) {
-					BenchMarkVo bm = bmmap.get(wd.getWindturbineid());
-					bm.setScadafdl(bm.getScadafdl() + wd.getDaydl2());
-					bm.setGzss(bm.getGzss() + wd.getDaynhgzssdl());
-					bm.setWhss(bm.getWhss() + wd.getDaynhwhssdl());
-					bm.setQfss(bm.getQfss() + wd.getDaynhqfdl());
-					bm.setXdss(bm.getXdss() + wd.getDaynhxdssdl());
-					bmmap.put(wd.getWindturbineid(), bm);
-				} else {
-					BenchMarkVo bm = new BenchMarkVo();
-					intialBenchMarkTemp(bm);
-					bm.setScadafdl(bm.getScadafdl() + wd.getDaydl2());
-					bm.setGzss(bm.getGzss() + wd.getDaynhgzssdl());
-					bm.setWhss(bm.getWhss() + wd.getDaynhwhssdl());
-					bm.setQfss(bm.getQfss() + wd.getDaynhqfdl());
-					bm.setXdss(bm.getXdss() + wd.getDaynhxdssdl());
-					if (wtmap.containsKey(wd.getWindturbineid())) {
-						Windturbine wt = wtmap.get(wd.getWindturbineid());
-						// bm.setWtName(wt.getName());
-						bm.setWtName(wt.getCode());
 					}
-					bm.setWtId(wd.getWindturbineid());
-
-					if (stmap.containsKey(wd.getWindturbineid())) {
-						Statetransitionrates st = stmap.get(wd.getWindturbineid());
-
-						Double temp1 = st.getTimerate1();// 小于3米5分钟转换及时次数
-						Double temp2 = st.getTimerate13();// 小于3米状态转换总次数
-						bm.setZtcs(bm.getZtcs() + temp1.intValue());
-						bm.setZtzcs(bm.getZtzcs() + temp2.intValue());
-						temp1 = st.getTimerate16();// 5分钟复位及时次数
-						temp2 = st.getTimerate20();// 总复位次数
-						bm.setFwcs(bm.getFwcs() + temp1.intValue());
-						bm.setFwzcs(bm.getFwzcs() + temp2.intValue());
-					}
-					if (fdmap.containsKey(wd.getWindturbineid())) {
-						FaultEliminateDefects fd = fdmap.get(wd.getWindturbineid());
-
-						Integer temp1 = fd.getRightcount();// 消缺及时次数
-						Integer temp2 = fd.getFaultcount();// 故障次数
-
-						bm.setXqcs(bm.getXqcs() + temp1.intValue());
-						bm.setXqzcs(bm.getXqzcs() + temp2.intValue());
-
-					}
-					bmmap.put(wd.getWindturbineid(), bm);
-
 				}
-
 			}
 		}
 	}
@@ -262,4 +280,195 @@ public class ContrastWtService {
 			bm.setXqjsl(100.0);
 		}
 	}
+
+
+	public List<BenchMarkVo> benchmarkWpInWtList( String wpId,String wtId, String beginDate, String endDate) {
+		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+
+		Date begin=DateUtils.parseDate(beginDate);
+		Date end=DateUtils.parseDate(endDate);
+		// 获得复位及时率、状态转换及时率数据
+		Map<String, Map<String, Statetransitionrates>> stmap = statetransitionratesService.getStatetransitionratesByWt(wpId, begin, end);
+		// 获得消缺及时率数据
+		Map<String, Map<String, FaultEliminateDefects>> fdmap = faultEliminateDefectsService.getFaultEliminateDefectsByWt(wpId, begin, end);
+
+
+		List<Windturbineinfoday3> ls =windturbineinfoday3Service.getWindturbineinfoday3(wpId,wtId, begin, end) ;
+
+		Map<String, Windturbine> wtmap = InitialRunner.wtmap;
+		List<BenchMarkVo> vos=new ArrayList<>();
+		if (!ls.isEmpty()) {
+
+			String name = null;
+
+			for (Windturbineinfoday3 wd : ls) {
+				if (wtmap.containsKey(wd.getWindturbineid())) {
+					Windturbine wp = wtmap.get(wd.getWindturbineid());
+					// name = wp.getName();
+					name = wp.getCode();
+
+				}
+				BenchMarkVo vo = new BenchMarkVo();
+				vo.setWtId(wd.getWindturbineid());
+				vo.setWtName(name);
+				vo.setRecordDate(DateUtils.truncate(wd.getRecorddate()));
+				double scadafdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0; // scada发电量
+				double fdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0; // 发电量
+
+				double qfss = null != wd.getDaynhqfdl() ? wd.getDaynhqfdl() : 0;// 欠发损失发电量
+				double gzss = null != wd.getDaynhgzssdl() ? wd.getDaynhgzssdl() : 0;// 故障损失发电量
+				double whss = null != wd.getDaynhwhssdl() ? wd.getDaynhwhssdl() : 0;// 维护损失发电量
+				double xdss = null != wd.getDaynhxdssdl() ? wd.getDaynhxdssdl() : 0;// 限电损失发电量
+				double llfdl = scadafdl + qfss + gzss + whss + xdss;// 理论发电量
+				vo.setFdl(fdl);// 发电量
+				vo.setFjhtyssdl(gzss);// 非计划停运损失电量
+				vo.setSbyxssdl(qfss);// 设备运行状态损失电量
+				vo.setSlssl(0.0);// 受累损失电量
+				//
+				vo.setScadafdl(scadafdl);
+				vo.setGzss(gzss);
+				vo.setWhss(whss);
+				vo.setQfss(qfss);
+				vo.setXdss(xdss);
+				vo.setSlss(0.0);
+
+				if (llfdl != 0) {
+					double temp = xdss;
+
+					BigDecimal b1 = new BigDecimal(temp);
+					BigDecimal b2 = new BigDecimal(llfdl);
+
+					temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+					// temp 弃风率
+					vo.setQfl(temp);
+					temp = qfss;
+
+					b1 = new BigDecimal(temp);
+					b2 = new BigDecimal(llfdl);
+
+					temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+					// temp 性能损失率
+					vo.setXnssl(temp);
+
+					temp = gzss;
+
+					b1 = new BigDecimal(temp);
+					b2 = new BigDecimal(llfdl);
+
+					temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+					// temp 故障损失率
+					vo.setGzssl(temp);
+
+					temp = whss;
+
+					b1 = new BigDecimal(temp);
+					b2 = new BigDecimal(llfdl);
+
+					temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+					// temp 检修损失率
+					vo.setJxssl(temp);
+					temp = 0;
+
+					b1 = new BigDecimal(temp);
+					b2 = new BigDecimal(llfdl);
+
+					temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+					// temp 受累损失率
+					vo.setSlssl(temp);
+					temp = scadafdl;
+
+					b1 = new BigDecimal(temp);
+					b2 = new BigDecimal(llfdl);
+
+					temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+					// temp 风能利用率
+					vo.setFnlyl(temp);
+				} else {
+					// temp 弃风率
+					vo.setQfl(0.0);
+					// temp 故障损失率
+					vo.setGzssl(0.0);
+					// temp 检修损失率
+					vo.setJxssl(0.0);
+					// temp 受累损失率
+					vo.setSlssl(0.0);
+					// temp 风能利用率
+					vo.setFnlyl(0.0);
+					// temp 性能损失率
+					vo.setXnssl(0.0);
+				}
+				String day = df.format(wd.getRecorddate());
+				if (stmap.containsKey(wd.getWindturbineid())) {
+					Map<String, Statetransitionrates> smap = stmap.get(wd.getWindturbineid());
+					if (smap.containsKey(day)) {
+						Statetransitionrates st = smap.get(day);
+
+						double temp1 = st.getTimerate1();// 小于3米5分钟转换及时次数
+						double temp2 = st.getTimerate13();// 小于3米状态转换总次数
+
+						if (temp2 != 0) {
+							double temp = 0;
+
+							BigDecimal b1 = new BigDecimal(temp1);
+							BigDecimal b2 = new BigDecimal(temp2);
+
+							temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+							// temp 复位及时率
+							vo.setFwjsl(temp);
+						} else {
+							vo.setFwjsl(100.0);
+						}
+
+						temp1 = st.getTimerate16();// 5分钟复位及时次数
+						temp2 = st.getTimerate20();// 总复位次数
+
+						if (temp2 != 0) {
+							double temp = 0;
+
+							BigDecimal b1 = new BigDecimal(temp1);
+							BigDecimal b2 = new BigDecimal(temp2);
+
+							temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+							// temp 状态转换及时率
+							vo.setZtzhjsl(temp);
+						} else {
+							vo.setZtzhjsl(100.0);
+						}
+
+					}
+
+				} else {
+					vo.setZtzhjsl(100.0);
+					vo.setFwjsl(100.0);
+				}
+				if (fdmap.containsKey(wd.getWindturbineid())) {
+					Map<String, FaultEliminateDefects> fmap = fdmap.get(wd.getWindturbineid());
+					if (fmap.containsKey(day)) {
+						FaultEliminateDefects fd = fmap.get(day);
+
+						double temp1 = fd.getRightcount();// 消缺及时次数
+						double temp2 = fd.getFaultcount();// 故障次数
+
+						if (temp2 != 0) {
+							double temp = 0;
+
+							BigDecimal b1 = new BigDecimal(temp1);
+							BigDecimal b2 = new BigDecimal(temp2);
+
+							temp = b1.divide(b2, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue();
+							// temp 消缺及时率
+							vo.setXqjsl(temp);
+						} else {
+							vo.setXqjsl(100.0);
+						}
+					}
+				} else {
+					vo.setXqjsl(100.0);
+				}
+
+				vos.add(vo);
+			}
+		}
+		return vos;
+	}
 }

+ 104 - 0
src/main/java/com/gyee/frame/service/contrast/ContrastZjService.java

@@ -0,0 +1,104 @@
+package com.gyee.frame.service.contrast;
+
+import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.Windpowerstation;
+import com.gyee.frame.model.custom.BenchMarkVo;
+import com.gyee.frame.model.custom.ConditionVo;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.service.FaultEliminateDefectsService;
+import com.gyee.frame.service.StatetransitionratesService;
+import com.gyee.frame.service.Windpowerinfoday3Service;
+import com.gyee.frame.util.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
+@Service
+public class ContrastZjService {
+    @Resource
+    private Windpowerinfoday3Service windpowerinfoday3Service;
+    @Autowired
+    private FaultEliminateDefectsService faultEliminateDefectsService;
+    @Autowired
+    private StatetransitionratesService statetransitionratesService;
+
+
+    public List<BenchMarkVo> benchmarkZjList(HttpServletRequest request, Tablepar tablepar, String wpId, String year, String month, String zjs) {
+        List<BenchMarkVo> vos = new ArrayList<>();
+
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(zjs)) {
+            Map<String, Windpowerstation> wpmap = InitialRunner.wpmap;
+
+            List<ConditionVo> ctvos = new ArrayList<ConditionVo>();
+            if (zjs.indexOf(",") > 0) {
+                String[] strs = zjs.split(",");
+
+                for (String str : strs) {
+                    BenchMarkVo bm = new BenchMarkVo();
+                    if (wpmap.containsKey(wpId)) {
+                        Windpowerstation wp = wpmap.get(wpId);
+                        bm.setWpId(wp.getId());
+                        bm.setWpName(wp.getName());
+                    }
+                    intialBenchMarkTemp(bm);
+
+//                    initialDateInfo(pattern, str, bm);// 获得开始结束时间
+//
+//                    ConditionVo vo = new ConditionVo();
+//                    vo.setBeginDate(beginDate);
+//                    vo.setEndDate(endDate);
+//                    vo.setWpId(wpId);
+//                    ctvos.add(vo);
+//
+//                    setBenchMarkInfo(bm);// 统计值际数据
+//                    setBenchMark(bm, ctvos, str);
+                }
+            } else {
+                BenchMarkVo bm = new BenchMarkVo();
+                if (wpmap.containsKey(wpId)) {
+                    Windpowerstation wp = wpmap.get(wpId);
+                    bm.setWpId(wp.getId());
+                    bm.setWpName(wp.getName());
+                }
+                intialBenchMarkTemp(bm);
+//                initialDateInfo(pattern, zjs, bm);// 获得开始结束时间
+//
+//                ConditionVo vo = new ConditionVo();
+//                vo.setBeginDate(beginDate);
+//                vo.setEndDate(endDate);
+//                vo.setWpId(wpId);
+//                ctvos.add(vo);
+//
+//                setBenchMarkInfo(bm);// 统计值际数据
+//                setBenchMark(bm, ctvos, zjs);
+            }
+
+        }
+
+        return vos;
+    }
+
+
+    private void intialBenchMarkTemp(BenchMarkVo bm) {
+        bm.setScadafdl(0.0);
+        bm.setGzss(0.0);
+        bm.setWhss(0.0);
+        bm.setQfss(0.0);
+        bm.setXdss(0.0);
+        bm.setSlss(0.0);
+        bm.setFwcs(0);
+        bm.setFwzcs(0);
+        bm.setZtcs(0);
+        bm.setZtzcs(0);
+        bm.setXqcs(0);
+        bm.setXqzcs(0);
+        bm.setGzcs(0);
+        bm.setFjts(0);
+    }
+}

+ 1 - 1
src/main/java/com/gyee/frame/util/BenchmarkUtil.java

@@ -528,7 +528,7 @@ public class BenchmarkUtil {
     }
 
     private void setTargetFraction(BenchMarkVo bm, BigDecimal b1, BigDecimal b2, List<BenchMarkVo> vos) {
-        double frae = b1.divide(b2, 4, BigDecimal.ROUND_HALF_UP).doubleValue();
+        double frae = b1.divide(b2, 4, RoundingMode.HALF_UP).doubleValue();
         /***************************************************************************/
         if (bm.getFwjsl() <= 100 && bm.getFwjsl() >= 90) {
             bm.setFwjslfraction(10);

+ 2 - 0
src/main/resources/application.yml

@@ -31,6 +31,8 @@ golden :
 #tomcat config
 server :
   port : 8082
+  session:
+    timeout: 7200
   ##项目名字配置
   #servlet : 
   #  context-path : /demo