浏览代码

月电量分析

wangchangsheng 2 年之前
父节点
当前提交
3b6433675d
共有 19 个文件被更改,包括 1059 次插入75 次删除
  1. 76 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/peranalysis/ElePerAnalysis.java
  2. 58 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/peranalysis/PointPerSis.java
  3. 53 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/peranalysis/StationPersis.java
  4. 16 19
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/warn/ShutdowneventController.java
  5. 36 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/ElePerAnalysisVo.java
  6. 11 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/InitVo.java
  7. 7 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/PointPerSisVo.java
  8. 14 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/StationPersisVo.java
  9. 79 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/ProjectplanPGService.java
  10. 81 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/RegionPGService.java
  11. 35 50
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/ShutdowneventService.java
  12. 14 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerinfodayService.java
  13. 86 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerstationPGService.java
  14. 47 6
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerstationService.java
  15. 92 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/peranalysis/ElePerAnalysisService.java
  16. 67 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/peranalysis/FreedomService.java
  17. 87 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/peranalysis/PointPerSisService.java
  18. 63 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/util/ClassUtil.java
  19. 137 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/util/DoubleUtils.java

+ 76 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/peranalysis/ElePerAnalysis.java

@@ -0,0 +1,76 @@
+package com.gyee.frame.controller.peranalysis;
+
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.ElePerAnalysisVo;
+import com.gyee.frame.service.peranalysis.ElePerAnalysisService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+@RestController
+@RequestMapping("/eleperanalysis")
+@Api(value = "月电量分析", tags = "月电量分析")
+public class ElePerAnalysis {
+
+
+    @Autowired
+    private ElePerAnalysisService elePerAnalysisService;
+
+    /**
+     * 月电量分析
+     *
+     * @param companyid
+     * @param regionid
+     * @param station
+     * @param year
+     * @param month
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/geteleperanalysislist")
+    @ResponseBody
+    @ApiOperation(value = "月电量分析", notes = "月电量分析")
+    public AjaxResult ElePerAnalysisList(
+            @RequestParam(value = "companyid", required = false) String companyid,
+            @RequestParam(value = "regionid", required = false) String regionid,
+            @RequestParam(value = "station", required = false) String station,
+            @RequestParam(value = "year", required = false) String year,
+            @RequestParam(value = "month", required = false) String month
+    ) throws Exception {
+
+        List<ElePerAnalysisVo> vos = new ArrayList<>();
+        if (StringUtils.notEmp(station) && StringUtils.notEmp(year) && StringUtils.notEmp(month)) {
+
+            Calendar cal = Calendar.getInstance();
+            cal.set(Calendar.HOUR_OF_DAY, 0);
+            cal.set(Calendar.MINUTE, 0);
+            cal.set(Calendar.SECOND, 0);
+            cal.set(Calendar.MILLISECOND, 0);
+
+            cal.set(Calendar.YEAR, Integer.valueOf(year));
+            cal.set(Calendar.MONTH, Integer.valueOf(month) - 1);
+            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+            Date beginDate = cal.getTime();
+            cal.add(Calendar.MONTH, 1);
+            Date endDate = cal.getTime();
+            vos = elePerAnalysisService.getElePerAnalysisList(companyid, regionid, station, beginDate, endDate);
+        }
+
+        if (null != vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+
+}

+ 58 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/peranalysis/PointPerSis.java

@@ -0,0 +1,58 @@
+package com.gyee.frame.controller.peranalysis;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.PointPerSisVo;
+import com.gyee.frame.service.peranalysis.PointPerSisService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/pointpersis")
+@Api(value = "测点曲线分析", tags = "测点曲线分析")
+public class PointPerSis {
+
+
+    @Autowired
+    private PointPerSisService pointPerSisService;
+
+
+    /**
+     * 测点曲线分析
+     * @param station
+     * @param beginDate
+     * @param endDate
+     * @param interval
+     * @param uniformcodes
+     * @return
+     */
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    @GetMapping(value = "/getPointPerSisList")
+    public AjaxResult getPointPerSisList(
+            @RequestParam(value = "station",required = true)String station,
+            @RequestParam(value = "beginDate",required = true)Long beginDate,
+            @RequestParam(value = "endDate",required = true)Long endDate,
+            @RequestParam(value = "interval",required = true)Integer interval,
+            @RequestParam(value = "uniformcodes",required = true)String uniformcodes
+
+    ){
+        try {
+            List<PointPerSisVo> list =  pointPerSisService.freedomList(station,beginDate,endDate,interval,uniformcodes);
+
+            if (null != list){
+                return AjaxResult.successData(AjaxStatus.success.code, list);
+            }else {
+                return AjaxResult.successData(AjaxStatus.error.code, "操作失败");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.successData(AjaxStatus.error.code, "系统异常");
+        }
+    }
+
+
+
+}

+ 53 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/peranalysis/StationPersis.java

@@ -0,0 +1,53 @@
+package com.gyee.frame.controller.peranalysis;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.StationPersisVo;
+import com.gyee.frame.service.WindpowerstationService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+@RestController
+@RequestMapping("/stationPersis")
+@Api(value = "场站性能分析", tags = "场站性能分析")
+public class StationPersis {
+
+    @Autowired
+    private WindpowerstationService windpowerstationService;
+
+    /**
+     * 场站性能分析
+     * @param station
+     * @param startdate
+     * @param enddate
+     */
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    @GetMapping(value = "/getStationPersis")
+    public AjaxResult getStationPersis(
+            @RequestParam(value = "station",required = false) String station,
+            @RequestParam(value = "startdate",required = false) String startdate,
+            @RequestParam(value = "enddate",required = false) String enddate){
+        try {
+
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date startdt = simpleDateFormat.parse(startdate);
+            Date enddt = simpleDateFormat.parse(enddate);
+
+            List<StationPersisVo> list =   windpowerstationService.getStationPersis(station,startdt,enddt);
+
+            if (null != list){
+                return AjaxResult.successData(AjaxStatus.success.code, list);
+            }else {
+                return AjaxResult.successData(AjaxStatus.error.code, "操作失败");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.successData(AjaxStatus.error.code, "系统异常");
+        }
+    }
+}

+ 16 - 19
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/warn/ShutdowneventController.java

@@ -12,15 +12,11 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
-@Controller
+@RestController
 @RequestMapping("/event")
 @Api(value = "停机事件", tags = "停机事件")
 public class ShutdowneventController {
@@ -70,7 +66,8 @@ public class ShutdowneventController {
 
     /**
      * 长停分析
-     * @param tablepar
+     * @param pageNum
+     * @param pageSize
      * @param wpId
      * @param wtId
      * @param beginDate
@@ -79,22 +76,22 @@ public class ShutdowneventController {
      * @return
      * @throws Exception
      */
-    @PostMapping("/getLonShutdownevent")
-    @ResponseBody
+    @GetMapping("/getLonShutdownevent")
     @ApiOperation(value = "长停事件查询", notes = "长停事件查询")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "tablepar", value = "分页控件", required = true, dataType = "string", paramType = "query"),
-            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
-            @ApiImplicitParam(name = "wtId", value = "风机编号", required = false, dataType = "string", paramType = "query"),
-            @ApiImplicitParam(name = "beginDate", value = "开始日期", required = true, dataType = "string", paramType = "query"),
-            @ApiImplicitParam(name = "endDate", value = "结束日期", required = true, dataType = "string", paramType = "query"),
-            @ApiImplicitParam(name = "type", value = "类型", required = false, dataType = "string", paramType = "query")})
-    public AjaxResult getLonShutdownevent(@RequestBody  Tablepar tablepar, String wpId, String wtId, String beginDate, String endDate, String type) throws Exception {
+    public AjaxResult getLonShutdownevent(
+            @RequestParam(value = "pageNum", required = true) Integer pageNum,
+            @RequestParam(value = "pageSize", required = true) Integer pageSize,
+            @RequestParam(value = "wpId", required = false) String wpId,
+            @RequestParam(value = "wtId", required = false) String wtId,
+            @RequestParam(value = "beginDate", required = true) String beginDate,
+            @RequestParam(value = "endDate", required = true) String endDate,
+            @RequestParam(value = "type", required = false) String type
+    ) throws Exception {
 
         PageInfo<ShutdowneventVo> result=new PageInfo<>() ;
-        if (StringUtils.notEmp(tablepar) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+        if (StringUtils.notEmp(pageNum) && StringUtils.notEmp(pageSize) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
-            result=shutdowneventService.getLongShutdownevent(tablepar, wpId, wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate), type);
+            result=shutdowneventService.getLongShutdownevent(pageNum,pageSize, wpId, wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate), type);
 
         }
         if (null != result) {

+ 36 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/ElePerAnalysisVo.java

@@ -0,0 +1,36 @@
+package com.gyee.frame.model.custom;
+
+import lombok.Data;
+
+@Data
+public class ElePerAnalysisVo {
+
+    //场站id
+    private String id;
+
+    //场站名称
+    private String name;
+
+    //发电量
+    private double generation;
+
+    //风速
+    private double fs;
+
+    //计划发电量
+    private double generatingcapacity;
+
+    //运行
+    private double runhours;
+
+    //停机
+    private double stophours;
+
+    //故障小时
+    private double faulthours;
+
+    //完成率
+    private double finishrate;
+
+
+}

+ 11 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/InitVo.java

@@ -0,0 +1,11 @@
+package com.gyee.frame.model.custom;
+
+import lombok.Data;
+
+@Data
+public class InitVo {
+
+    private String wtid;
+
+    private String wtname;
+}

+ 7 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/PointPerSisVo.java

@@ -0,0 +1,7 @@
+package com.gyee.frame.model.custom;
+
+import lombok.Data;
+
+@Data
+public class PointPerSisVo {
+}

+ 14 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/StationPersisVo.java

@@ -0,0 +1,14 @@
+package com.gyee.frame.model.custom;
+
+import lombok.Data;
+
+@Data
+public class StationPersisVo {
+
+
+    private long datatime;//时间戳
+    private double rpjfs;//风速
+    private double sszgl;//功率
+
+
+}

+ 79 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/ProjectplanPGService.java

@@ -0,0 +1,79 @@
+package com.gyee.frame.service;
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.dataSources.DataSource;
+import com.gyee.frame.common.dataSources.DataSourceType;
+import com.gyee.frame.mapper.auto.ProjectplanPGMapper;
+import com.gyee.frame.model.auto.ProjectplanPG;
+import com.gyee.frame.model.auto.ProjectplanPGExample;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class ProjectplanPGService implements BaseService<ProjectplanPG, ProjectplanPGExample> {
+
+    @Resource
+    private ProjectplanPGMapper projectplanPGMapper;
+    @Override
+    public int deleteByPrimaryKey(String id) {
+        return 0;
+    }
+
+    @Override
+    public int insertSelective(ProjectplanPG record) {
+        return 0;
+    }
+
+    @Override
+    public ProjectplanPG selectByPrimaryKey(String id) {
+        return null;
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(ProjectplanPG record) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExampleSelective(ProjectplanPG record, ProjectplanPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExample(ProjectplanPG record, ProjectplanPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public List<ProjectplanPG> selectByExample(ProjectplanPGExample example) {
+        return null;
+    }
+
+    @Override
+    public long countByExample(ProjectplanPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public int deleteByExample(ProjectplanPGExample example) {
+        return 0;
+    }
+
+
+    @DataSource(value = DataSourceType.SLAVE)
+    public List<ProjectplanPG> findProjectplanPG(String station,String year,String month) {
+
+        List<ProjectplanPG> list=new ArrayList<>();
+        ProjectplanPGExample example=new ProjectplanPGExample();
+        ProjectplanPGExample.Criteria criteria =example.createCriteria();
+        criteria.andWindpowerEqualTo(station);
+        criteria.andYearEqualTo(year);
+        criteria.andMonthEqualTo(month);
+        list= projectplanPGMapper.selectByExample(example);
+        return list;
+
+    }
+}

+ 81 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/RegionPGService.java

@@ -0,0 +1,81 @@
+package com.gyee.frame.service;
+
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.dataSources.DataSource;
+import com.gyee.frame.common.dataSources.DataSourceType;
+import com.gyee.frame.mapper.auto.RegionPGMapper;
+import com.gyee.frame.model.auto.RegionPG;
+import com.gyee.frame.model.auto.RegionPGExample;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class RegionPGService implements BaseService<RegionPG, RegionPGExample> {
+
+    @Resource
+    private RegionPGMapper regionPGMapper;
+    @Override
+    public int deleteByPrimaryKey(String id) {
+        return 0;
+    }
+
+    @Override
+    public int insertSelective(RegionPG record) {
+        return 0;
+    }
+
+    @Override
+    public RegionPG selectByPrimaryKey(String id) {
+        return null;
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(RegionPG record) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExampleSelective(RegionPG record, RegionPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExample(RegionPG record, RegionPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public List<RegionPG> selectByExample(RegionPGExample example) {
+        return null;
+    }
+
+    @Override
+    public long countByExample(RegionPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public int deleteByExample(RegionPGExample example) {
+        return 0;
+    }
+
+
+    @DataSource(value = DataSourceType.SLAVE)
+    public List<RegionPG> findRegionPG() {
+
+        List<RegionPG> list=new ArrayList<>();
+
+        RegionPGExample example=new RegionPGExample();
+        example.setOrderByClause(" id asc");
+
+        RegionPGExample.Criteria criteria =example.createCriteria();
+        criteria.andCompanyidEqualTo("QJNY");
+        list= regionPGMapper.selectByExample(example);
+        return list;
+
+    }
+}

+ 35 - 50
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/ShutdowneventService.java

@@ -26,78 +26,78 @@ import java.util.*;
 public class ShutdowneventService implements BaseService<Shutdownevent, ShutdowneventExample> {
 	@Resource
 	private ShutdowneventMapper shutdowneventMapper;
-	
+
 
 	@Override
 	public int deleteByPrimaryKey(String ids) {
-				
-			List<String> lista=Convert.toListStrArray(ids);
-			ShutdowneventExample example=new ShutdowneventExample();
-			example.createCriteria().andIdIn(lista);
-			return shutdowneventMapper.deleteByExample(example);
-			
-				
+
+		List<String> lista=Convert.toListStrArray(ids);
+		ShutdowneventExample example=new ShutdowneventExample();
+		example.createCriteria().andIdIn(lista);
+		return shutdowneventMapper.deleteByExample(example);
+
+
 	}
-	
-	
+
+
 	@Override
 	public Shutdownevent selectByPrimaryKey(String id) {
-				
-			return shutdowneventMapper.selectByPrimaryKey(id);
-				
+
+		return shutdowneventMapper.selectByPrimaryKey(id);
+
 	}
 
-	
+
 	@Override
 	public int updateByPrimaryKeySelective(Shutdownevent record) {
 		return shutdowneventMapper.updateByPrimaryKeySelective(record);
 	}
-	
-	
+
+
 	/**
 	 * 添加
 	 */
 	@Override
 	public int insertSelective(Shutdownevent record) {
-				
+
 		//添加雪花主键id
 		record.setId(SnowflakeIdWorker.getUUID());
-			
-				
+
+
 		return shutdowneventMapper.insertSelective(record);
 	}
-	
-	
+
+
 	@Override
 	public int updateByExampleSelective(Shutdownevent record, ShutdowneventExample example) {
-		
+
 		return shutdowneventMapper.updateByExampleSelective(record, example);
 	}
 
-	
+
 	@Override
 	public int updateByExample(Shutdownevent record, ShutdowneventExample example) {
-		
+
 		return shutdowneventMapper.updateByExample(record, example);
 	}
 
 	@Override
 	public List<Shutdownevent> selectByExample(ShutdowneventExample example) {
-		
+
 		return shutdowneventMapper.selectByExample(example);
 	}
 
-	
+
 	@Override
 	public long countByExample(ShutdowneventExample example) {
-		
+
 		return shutdowneventMapper.countByExample(example);
 	}
 
-	
+
 	@Override
 	public int deleteByExample(ShutdowneventExample example) {
-		
+
 		return shutdowneventMapper.deleteByExample(example);
 	}
 
@@ -328,9 +328,9 @@ public class ShutdowneventService implements BaseService<Shutdownevent, Shutdown
 			String  eString = formatter.format(endDate);
 			criteria.andStoptimeGreaterThanOrEqualTo2(bString).andStoptimeLessThanOrEqualTo2(eString);
 			criteria.andStophoursIsNotNull();
-		//	criteria.andStoptypeidNotEqualTo("wh");
-		//	criteria.andStoptypeidNotEqualTo("other");
-		//	criteria.andStoptypeidNotEqualTo("gzbmq");
+			//	criteria.andStoptypeidNotEqualTo("wh");
+			//	criteria.andStoptypeidNotEqualTo("other");
+			//	criteria.andStoptypeidNotEqualTo("gzbmq");
 			criteria.andStophoursLessThan(Double.valueOf(24*7));
 			list= shutdowneventMapper.selectByExample(example);
 
@@ -546,27 +546,12 @@ public class ShutdowneventService implements BaseService<Shutdownevent, Shutdown
 
 	}
 
-	public PageInfo<ShutdowneventVo> getLongShutdownevent(Tablepar tablepar,String wpId,String wtId, Date beginDate, Date endDate,String type)  {
+	public PageInfo<ShutdowneventVo> getLongShutdownevent(int pageNum,int pageSize,String wpId,String wtId, Date beginDate, Date endDate,String type)  {
 
 		PageInfo<ShutdowneventVo> pageInfo=new PageInfo<>();
 		List<Shutdownevent> list =new ArrayList<>();
 		ShutdowneventExample example=new ShutdowneventExample();
 		String order =null;
-		if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
-		{
-			StringBuilder sb=new StringBuilder();
-			sb.append(" ").append(tablepar.getOrderByColumn());
-			if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
-			{
-				sb.append(" ").append(tablepar.getIsAsc());
-			}else
-			{
-				sb.append(" asc ");
-			}
-			order=String.valueOf(sb);
-		}else {
-			order=" stoptime desc";
-		}
 
 		ShutdowneventExample.Criteria criteria =example.createCriteria();
 
@@ -584,12 +569,12 @@ public class ShutdowneventService implements BaseService<Shutdownevent, Shutdown
 			criteria.andStatuscodeEqualTo(Integer.valueOf(type));
 		}
 
-		criteria.andStophoursGreaterThanOrEqualTo(168.00);//长停168小时
+		criteria.andStophoursGreaterThanOrEqualTo(10.00);//长停168小时
 
 		criteria.andStoptimeGreaterThanOrEqualTo(beginDate).andStoptimeLessThanOrEqualTo(endDate);
 
 
-		PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+		PageHelper.startPage(pageNum, pageSize);
 		list= shutdowneventMapper.selectByExample(example);
 		List<ShutdowneventVo> sdelist=new ArrayList<>();
 

+ 14 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerinfodayService.java

@@ -141,4 +141,18 @@ public class WindpowerinfodayService implements BaseService<Windpowerinfoday, Wi
 		return list;
 
 	}
+
+	public List<Windpowerinfoday> getWindpowerinfodayList2(String station, Date beginDate, Date endDate) {
+
+		List<Windpowerinfoday> list = new ArrayList<>();
+		if (StringUtils.notEmp(station) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+			WindpowerinfodayExample example = new WindpowerinfodayExample();
+			WindpowerinfodayExample.Criteria criteria = example.createCriteria();
+			criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThan(endDate);
+			criteria.andForeignkeyidEqualTo(station);
+			list = windpowerinfodayMapper.selectByExample(example);
+		}
+		return list;
+
+	}
 }

+ 86 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerstationPGService.java

@@ -0,0 +1,86 @@
+package com.gyee.frame.service;
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.dataSources.DataSource;
+import com.gyee.frame.common.dataSources.DataSourceType;
+import com.gyee.frame.mapper.auto.WindpowerstationPGMapper;
+import com.gyee.frame.model.auto.WindpowerstationPG;
+import com.gyee.frame.model.auto.WindpowerstationPGExample;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class WindpowerstationPGService implements BaseService<WindpowerstationPG, WindpowerstationPGExample> {
+
+    @Resource
+    private WindpowerstationPGMapper windpowerstationPGMapper;
+    @Override
+    public int deleteByPrimaryKey(String id) {
+        return 0;
+    }
+
+    @Override
+    public int insertSelective(WindpowerstationPG record) {
+        return 0;
+    }
+
+    @Override
+    public WindpowerstationPG selectByPrimaryKey(String id) {
+        return null;
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(WindpowerstationPG record) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExampleSelective(WindpowerstationPG record, WindpowerstationPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExample(WindpowerstationPG record, WindpowerstationPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public List<WindpowerstationPG> selectByExample(WindpowerstationPGExample example) {
+        return null;
+    }
+
+    @Override
+    public long countByExample(WindpowerstationPGExample example) {
+        return 0;
+    }
+
+    @Override
+    public int deleteByExample(WindpowerstationPGExample example) {
+        return 0;
+    }
+
+
+    @DataSource(value = DataSourceType.SLAVE)
+    public List<WindpowerstationPG> findWindpowerstationPG(String companyid,String regionid,String station ) {
+
+        List<WindpowerstationPG> list=new ArrayList<>();
+
+        WindpowerstationPGExample example=new WindpowerstationPGExample();
+        example.setOrderByClause(" id asc");
+        WindpowerstationPGExample.Criteria criteria =example.createCriteria();
+        criteria.andCompanyidEqualTo(companyid);
+        criteria.andRegionidEqualTo(regionid);
+        criteria.andIdEqualTo(station);
+
+        list= windpowerstationPGMapper.selectByExample(example);
+        return list;
+
+    }
+
+
+
+
+}

+ 47 - 6
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerstationService.java

@@ -1,13 +1,21 @@
 package com.gyee.frame.service;
 
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.cache.IGlobalCache;
 import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.WindpowerstationMapper;
 import com.gyee.frame.model.auto.Windpowerstation;
 import com.gyee.frame.model.auto.WindpowerstationExample;
+import com.gyee.frame.model.auto.Windpowerstationpointnew;
+import com.gyee.frame.model.custom.PointData;
+import com.gyee.frame.model.custom.StationPersisVo;
 import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
+import com.gyee.frame.util.RealTimeDataBaseFactory;
 import com.gyee.frame.util.SnowflakeIdWorker;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.cache.annotation.CacheConfig;
@@ -15,10 +23,7 @@ import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 风场 WindpowerstationService
@@ -34,8 +39,11 @@ import java.util.Map;
 public class WindpowerstationService implements BaseService<Windpowerstation, WindpowerstationExample> {
 	@Resource
 	private WindpowerstationMapper windpowerstationMapper;
-	
-      	   	      	      	      	      	      	      	      	      	      	
+
+	@Resource
+	private IGlobalCache globalCache;
+
+	IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 	/**
 	 * 分页查询
 	 * @param tablepar
@@ -164,4 +172,37 @@ public class WindpowerstationService implements BaseService<Windpowerstation, Wi
 
 		return list;
 	}
+
+
+
+	public List<StationPersisVo> getStationPersis(String station, Date startdate, Date enddate) throws Exception {
+
+		List<StationPersisVo> list = new ArrayList<>();
+		String wpString = (String) (globalCache.get(station));
+
+		Map<String, Windpowerstationpointnew> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
+		});
+		if (null != stringMapMap) {
+			String fs = stringMapMap.get("RPJFS").getCode();//日平局风速
+			List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, startdate.getTime(), enddate.getTime(), null, 60000L);
+			String gl = stringMapMap.get("SSZGL").getCode();//功率
+			List<PointData> gls = realApiUtil.getHistoryDatasSnap(gl, startdate.getTime(), enddate.getTime(), null, 60000L);
+			if (!fss.isEmpty() && !gls.isEmpty()) {
+
+				for (int i =0; i <= fss.size()-1; i++) {
+					StationPersisVo vo = new StationPersisVo();
+					vo.setDatatime(fss.get(i).getPointTime());
+					vo.setRpjfs(fss.get(i).getPointValueInDouble());
+					vo.setSszgl(gls.get(i).getPointValueInDouble());
+					list.add(vo);
+				}
+			}
+		}
+
+		return list;
+	}
+
+
+
+
 }

+ 92 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/peranalysis/ElePerAnalysisService.java

@@ -0,0 +1,92 @@
+package com.gyee.frame.service.peranalysis;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.gyee.frame.common.cache.IGlobalCache;
+import com.gyee.frame.model.auto.ProjectplanPG;
+import com.gyee.frame.model.auto.Windpowerinfoday;
+import com.gyee.frame.model.auto.WindpowerstationPG;
+import com.gyee.frame.model.auto.Windpowerstationpointnew;
+import com.gyee.frame.model.custom.ElePerAnalysisVo;
+import com.gyee.frame.model.custom.PointData;
+import com.gyee.frame.service.*;
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
+import com.gyee.frame.util.RealTimeDataBaseFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Service
+public class ElePerAnalysisService {
+
+
+    @Resource
+    private IGlobalCache globalCache;
+
+    @Autowired
+    private WindpowerinfodayService windpowerinfodayService;
+//
+//    @Autowired
+//    private CompanysPGService companysPGService;
+//
+//    @Autowired
+//    private RegionPGService regionPGService;
+
+    @Autowired
+    private ProjectplanPGService projectplanPGService;
+
+    @Autowired
+    private WindpowerstationPGService windpowerstationPGService;
+
+    IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
+
+
+    public List<ElePerAnalysisVo> getElePerAnalysisList(String companyid, String regionid, String station, Date beginDate, Date endDate) throws Exception {
+
+
+        List<ElePerAnalysisVo> vos = new ArrayList<>();
+
+        List<WindpowerstationPG> list = windpowerstationPGService.findWindpowerstationPG(companyid, regionid, station);
+        for (WindpowerstationPG wp : list) {
+            String wpString = (String) (globalCache.get(station));
+            Map<String, Windpowerstationpointnew> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
+            });
+
+
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(beginDate);
+            List<ProjectplanPG> pgList = projectplanPGService.findProjectplanPG(station, String.valueOf(calendar.get(Calendar.YEAR)), String.valueOf(calendar.get(Calendar.MONTH)));
+            //(风场、发电量 YFDL、风速 YPJFS、计划发电量、发电小时、停机小时、故障小时、电量完成率)
+            ElePerAnalysisVo vo = new ElePerAnalysisVo();
+            vo.setId(wp.getId());
+            vo.setName(wp.getName());
+
+            if (null != stringMapMap) {
+                String fs = stringMapMap.get("YPJFS").getCode();//月平局风速
+                List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, endDate.getTime() - 2, endDate.getTime() - 1, 1l, null);
+                String yfdl = stringMapMap.get("YFDL").getCode();//发电量
+                List<PointData> yfdls = realApiUtil.getHistoryDatasSnap(yfdl, endDate.getTime() - 2, endDate.getTime() - 1, 1l, null);
+                if (!fss.isEmpty() && !yfdl.isEmpty()) {
+                    vo.setFs(fss.get(0).getPointValueInDouble());
+                    vo.setGeneration(yfdls.get(0).getPointValueInDouble());
+                }
+                vo.setGeneratingcapacity(Double.valueOf(pgList.get(0).getGeneratingcapacity()));
+            }
+
+            List<Windpowerinfoday> windpowerinfodayList = windpowerinfodayService.getWindpowerinfodayList2(station, beginDate, endDate);
+            Double runhourssum = windpowerinfodayList.stream().mapToDouble(Windpowerinfoday::getRunhours).sum();
+            Double stophourssum = windpowerinfodayList.stream().mapToDouble(Windpowerinfoday::getStophours).sum();
+            Double faulthourssum = windpowerinfodayList.stream().mapToDouble(Windpowerinfoday::getFaulthours).sum();
+            vo.setRunhours(runhourssum);
+            vo.setStophours(stophourssum);
+            vo.setFaulthours(faulthourssum);
+            vos.add(vo);
+        }
+
+        return vos;
+
+    }
+}

+ 67 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/peranalysis/FreedomService.java

@@ -0,0 +1,67 @@
+package com.gyee.frame.service.peranalysis;
+
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.mapper.auto.FreedomMapper;
+import com.gyee.frame.model.auto.Freedom;
+import com.gyee.frame.model.auto.FreedomExample;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+public class FreedomService implements BaseService<Freedom, FreedomExample> {
+
+    @Autowired
+    private FreedomMapper freedomMapper;
+
+    @Override
+    public int deleteByPrimaryKey(String id) {
+        return 0;
+    }
+
+    @Override
+    public int insertSelective(Freedom record) {
+        return 0;
+    }
+
+    @Override
+    public Freedom selectByPrimaryKey(String id) {
+        return null;
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(Freedom record) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExampleSelective(Freedom record, FreedomExample example) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExample(Freedom record, FreedomExample example) {
+        return 0;
+    }
+
+    @Override
+    public List<Freedom> selectByExample(FreedomExample example) {
+        return null;
+    }
+
+    @Override
+    public long countByExample(FreedomExample example) {
+        return 0;
+    }
+
+    @Override
+    public int deleteByExample(FreedomExample example) {
+        return 0;
+    }
+
+    public List<Freedom> selectAll() {
+        FreedomExample example = new FreedomExample();
+        return freedomMapper.selectByExample(example);
+
+    }
+}

+ 87 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/peranalysis/PointPerSisService.java

@@ -0,0 +1,87 @@
+package com.gyee.frame.service.peranalysis;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.gyee.frame.common.cache.IGlobalCache;
+import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.Freedom;
+import com.gyee.frame.model.auto.Windpowerstationpointnew;
+import com.gyee.frame.model.custom.InitVo;
+import com.gyee.frame.model.custom.PointData;
+import com.gyee.frame.model.custom.PointPerSisVo;
+import com.gyee.frame.util.*;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Service
+public class PointPerSisService {
+
+    @Resource
+    private IGlobalCache globalCache;
+
+    @Resource
+    private FreedomService freedomService;
+
+
+    IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
+
+    public List<PointPerSisVo> freedomList(String station, Long beginDate, Long endDate, Integer interval, String uniformcodes) throws Exception {
+        List<PointPerSisVo> vos = new ArrayList<>();
+
+        {
+            String[] codes = uniformcodes.split(",");
+
+            String wpString = (String) (globalCache.get(station));
+
+            Map<String, Windpowerstationpointnew> windturbinetestingpointaiMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
+            });
+
+
+            List<Object> resultList = new ArrayList<>();
+
+            Map<String, List<PointData>> pointDataMap = new HashMap<>();
+            for (int i = 0; i < codes.length; i++) {
+                Windpowerstationpointnew windturbinetestingpointai = windturbinetestingpointaiMap.get(StringUtils.upperCase(codes[i]));
+                if (StringUtils.isNotNull(windturbinetestingpointai)) {
+                    try {
+                        List<PointData> historyDatas = realApiUtil.getHistoryDatasSnap(windturbinetestingpointai, beginDate / 1000, endDate / 1000, null, interval * 60l);
+                        pointDataMap.put(codes[i], historyDatas);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+
+            }
+
+            List<PointData> pointData = pointDataMap.get(codes[0]);
+            if (StringUtils.isNotNull(pointData)) {
+                for (int i = 0; i < pointData.size(); i++) {
+                    InitVo initVo = new InitVo();
+                    initVo.setWtid(station);
+                    initVo.setWtname(InitialRunner.wtmap.get(station).getCode());
+                    LinkedHashMap addMap = new LinkedHashMap();
+                    LinkedHashMap addValMap = new LinkedHashMap();
+
+                    addMap.put("time", Class.forName("java.lang.Long"));
+                    addValMap.put("time", pointData.get(i).getPointTime() * 1000);
+
+                    for (int j = 0; j < codes.length; j++) {
+                        addMap.put(StringUtils.upperCase(codes[j]), Class.forName("java.lang.Double"));
+                        addValMap.put(StringUtils.upperCase(codes[j]), DoubleUtils.keepPrecision(pointDataMap.get(codes[j]).get(i).getPointValueInDouble(), 2));
+                    }
+                    Object o = new ClassUtil().dynamicClass(initVo, addMap, addValMap);
+                    resultList.add(o);
+                }
+            }
+            return vos;
+
+        }
+    }
+
+
+    public List<Freedom> points() {
+        return freedomService.selectAll();
+    }
+}

+ 63 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/util/ClassUtil.java

@@ -0,0 +1,63 @@
+package com.gyee.frame.util;
+
+
+import com.gyee.common.vo.analysis.DynamicBean;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Set;
+
+/**
+ * @ClassName : ClassUtil
+ * @Author : xieshengjie
+ * @Date: 2021/3/8 17:16
+ * @Description : 动态添加属性
+ */
+public class ClassUtil {
+    /**
+     *
+     * @param object   旧的对象带值
+     * @param addMap   动态需要添加的属性和属性类型
+     * @param addValMap  动态需要添加的属性和属性值
+     * @return  新的对象
+     * @throws Exception
+     */
+    public static Object dynamicClass(Object object, LinkedHashMap addMap, LinkedHashMap addValMap) throws Exception {
+        LinkedHashMap returnMap = new LinkedHashMap();
+        LinkedHashMap typeMap = new LinkedHashMap();
+
+
+        Class<?> type = object.getClass();
+        BeanInfo beanInfo = Introspector.getBeanInfo(type);
+        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+        for (int i = 0; i < propertyDescriptors.length; i++) {
+            PropertyDescriptor descriptor = propertyDescriptors[i];
+            String propertyName = descriptor.getName();
+            if (!propertyName.equals("class")) {
+                Method readMethod = descriptor.getReadMethod();
+                Object result = readMethod.invoke(object);
+                //可以判断为 NULL不赋值
+                returnMap.put(propertyName, result);
+                typeMap.put(propertyName, descriptor.getPropertyType());
+            }
+        }
+
+        returnMap.putAll(addValMap);
+        typeMap.putAll(addMap);
+        //map转换成实体对象
+        DynamicBean bean = new DynamicBean(typeMap);
+        //赋值
+        Set keys = typeMap.keySet();
+        for (Iterator it = keys.iterator(); it.hasNext(); ) {
+            String key = (String) it.next();
+            bean.setValue(key, returnMap.get(key));
+        }
+        Object obj = bean.getObject();
+        return obj;
+    }
+
+}

+ 137 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/util/DoubleUtils.java

@@ -0,0 +1,137 @@
+package com.gyee.frame.util;
+
+import java.math.BigDecimal;
+
+/**
+ * @ClassName : DoubleUtils
+ * @Author : xieshengjie
+ * @Date: 2021/11/16 17:00
+ * @Description :
+ */
+public class DoubleUtils {
+
+    /**
+     * 保留两位小数
+     * @param number
+     * @param precision
+     * @return
+     */
+    public static double keepPrecision(double number, int precision) {
+        BigDecimal bg = new BigDecimal(number);
+        return bg.setScale(precision, BigDecimal.ROUND_HALF_UP).doubleValue();
+    }
+
+
+    /**
+     * double保留小数点位数,四舍五入
+     * 比如处理价格等数据
+     * @param d 要处理的double值
+     * @param n 要保留的位数
+     * @return
+     */
+    public static double getRoundingNum(double d , int n) {
+        BigDecimal b = new BigDecimal(String.valueOf(d));
+        b = b.divide(BigDecimal.ONE, n, BigDecimal.ROUND_HALF_UP);
+        return b.doubleValue();
+    }
+    /**
+     *
+     * @param numA 数字A
+     * @param numB 数字B
+     * @param operate 运算符
+     * @return
+     */
+    public static double GetResult(double numA, double numB, String operate){
+        double res = 0;
+        BigDecimal bigA = new BigDecimal(Double.toString(numA));
+        BigDecimal bigB = new BigDecimal(Double.toString(numB));
+        switch (operate) {
+
+            case "+":
+                res = bigA.add(bigB).doubleValue();
+                break;
+            case "-":
+                res = bigA.subtract(bigB).doubleValue();
+                break;
+            case "*":
+                res = bigA.multiply(bigB).doubleValue();
+                break;
+            case "/":
+                res = bigA.divide(bigB,2,BigDecimal.ROUND_HALF_UP).doubleValue();
+                break;
+            default :
+                System.out.println("运算符不合法~");
+                break;
+        }
+        return res;
+    }
+
+
+    public static Double sum(Double ...in){
+        Double result = 0.0;
+        for (int i = 0; i < in.length; i++){
+            result = result+(ifNullSet0(in[i]));
+        }
+        return result;
+    }
+
+    public static String hb(String ...in){
+        String result = "";
+        for (int i = 0; i < in.length; i++){
+            result = result+in[i];
+        }
+        return result;
+    }
+
+    public static Integer sum(Integer ...in) {
+        Integer result = 0;
+        for (int i = 0; i < in.length; i++){
+            result = result+(ifNullSet0(in[i]));
+        }
+        return result;
+    }
+
+    public static Double max(Double ...in){
+        Double result = 0.0;
+        for (int i = 0; i < in.length; i++){
+            if (result<ifNullSet0(in[i])){
+                result=ifNullSet0(in[i]);
+            }
+        }
+        return result;
+    }
+
+    public static Double min(Double ...in){
+        Double result = 0.0;
+        for (int i = 0; i < in.length; i++){
+            if (i==0){
+                result=ifNullSet0(in[0]);
+            }
+            if (result>ifNullSet0(in[i])){
+                result=ifNullSet0(in[i]);
+            }
+        }
+        return result;
+    }
+    public static Double ave(Double ...in){
+        if(in.length==0){
+            return 0.0;
+        }else{
+            return sum(in)/in.length;
+        }
+
+    }
+    public static Double ifNullSet0(Double in) {
+        if (in != null) {
+            return in;
+        }
+        return 0.0;
+    }
+
+    public static Integer ifNullSet0(Integer in) {
+        if (in != null) {
+            return in;
+        }
+        return 0;
+    }
+}