Selaa lähdekoodia

修正功率曲线

shilin 3 vuotta sitten
vanhempi
commit
d220ad193c
22 muutettua tiedostoa jossa 24056 lisäystä ja 29 poistoa
  1. 30 1
      src/main/java/com/gyee/frame/controller/warn/WeatherAnalysisController.java
  2. 198 0
      src/main/java/com/gyee/frame/controller/yaw/YawController.java
  3. 105 0
      src/main/java/com/gyee/frame/mapper/auto/WindturbinepoweryawMapper.java
  4. 107 0
      src/main/java/com/gyee/frame/mapper/auto/WindturbinewindyawMapper.java
  5. 1833 0
      src/main/java/com/gyee/frame/model/auto/Windturbinepoweryaw.java
  6. 6732 0
      src/main/java/com/gyee/frame/model/auto/WindturbinepoweryawExample.java
  7. 1825 0
      src/main/java/com/gyee/frame/model/auto/Windturbinewindyaw.java
  8. 6732 0
      src/main/java/com/gyee/frame/model/auto/WindturbinewindyawExample.java
  9. 1737 0
      src/main/java/com/gyee/frame/model/custom/YawValuesVo.java
  10. 66 0
      src/main/java/com/gyee/frame/model/custom/YawVo.java
  11. 132 0
      src/main/java/com/gyee/frame/service/WindturbinepoweryawService.java
  12. 109 0
      src/main/java/com/gyee/frame/service/WindturbinewindyawService.java
  13. 21 0
      src/main/java/com/gyee/frame/service/recommen/RecommenService.java
  14. 78 0
      src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java
  15. 18 18
      src/main/java/com/gyee/frame/service/websocket/RealPowerPushService.java
  16. 51 0
      src/main/java/com/gyee/frame/service/yaw/YawService.java
  17. 2 2
      src/main/resources/mybatis-generator.xml
  18. 2082 0
      src/main/resources/mybatis/auto/WindturbinepoweryawMapper.xml
  19. 2084 0
      src/main/resources/mybatis/auto/WindturbinewindyawMapper.xml
  20. 7 5
      src/test/java/test/GenreSetPushTest.java
  21. 3 3
      src/test/java/test/RealPowerPushTest.java
  22. 104 0
      src/test/java/test/YawServiceTest.java

+ 30 - 1
src/main/java/com/gyee/frame/controller/warn/WeatherAnalysisController.java

@@ -1,9 +1,10 @@
-package com.gyee.frame.controller.warn;
+package com.gyee.frame.controller.weather;
 
 import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.service.weather.WeatherService;
+import com.gyee.frame.service.websocket.GenreSetPushService;
 import com.gyee.frame.service.websocket.RealPowerPushService;
 import com.gyee.frame.util.StringUtils;
 import io.swagger.annotations.Api;
@@ -31,6 +32,9 @@ public class WeatherAnalysisController {
     private WeatherService weatherService;
     @Resource
     private RealPowerPushService realPowerPushService;
+    @Resource
+    private GenreSetPushService genreSetPushService;
+
 
     @PostMapping("/weatherInfo")
     @ResponseBody
@@ -80,4 +84,29 @@ public class WeatherAnalysisController {
 
     }
 
+    @PostMapping("/powerChart")
+    @ResponseBody
+    @ApiOperation(value = "风速、电量、功率图表", notes = "风速、电量、功率图表")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult powerChart(String wpId) throws Exception {
+
+        List<DataVo> glvos = new ArrayList<>();
+
+        if (StringUtils.notEmp(wpId)) {
+
+
+            glvos = genreSetPushService.findPowerWpChart(wpId);
+        }
+
+        if (null != glvos) {
+            return AjaxResult.successData(AjaxStatus.success.code, glvos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, glvos);
+        }
+
+    }
+
 }

+ 198 - 0
src/main/java/com/gyee/frame/controller/yaw/YawController.java

@@ -0,0 +1,198 @@
+package com.gyee.frame.controller.yaw;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.YawValuesVo;
+import com.gyee.frame.model.custom.YawVo;
+import com.gyee.frame.service.yaw.YawService;
+import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.StringUtils;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+@RequestMapping("/yaw")
+@Api(value = "偏航对风分析", tags = "偏航对风分析")
+public class YawController {
+
+    private static final String format = "yyyy-MM-dd HH:mm";
+    @Resource
+    private YawService YawService;
+
+
+
+    @PostMapping("/getPassRate")
+    @ResponseBody
+    @ApiOperation(value = "功率或风速合格率", notes = "功率或风速合格率")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, 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 = "类型 1 功率 2风速", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult getPassRate(String wtId, String beginDate, String endDate,String type) throws Exception {
+
+        List<YawVo>  vos = new ArrayList<>();
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate)  && StringUtils.notEmp(endDate) && StringUtils.notEmp(type)) {
+
+            List<YawVo> ls=new ArrayList<>();
+            if(type.equals("1"))
+            {
+                ls = YawService.getYawPowerTotal(wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate));
+
+                if(!ls.isEmpty())
+                {
+                    for(YawVo vo:ls)
+                    {
+                        if(vo.getPower()>0)
+                        {
+                            int hgsl=vo.getQualified();
+                            int bhgsl=vo.getUnqualified();
+                            if((hgsl+bhgsl)!=0)
+                            {
+                                double rate = new BigDecimal(hgsl).divide(new BigDecimal(hgsl+bhgsl), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                                vo.setPassrate(rate);
+                            }else
+                            {
+                                vo.setPassrate(100.0);
+                            }
+
+                            vo.setPower(vo.getPower()*100);
+                            vos.add(vo);
+                        }
+                    }
+                }
+            }else  if(type.equals("2"))
+            {
+                ls = YawService.getYawSpeedTotal(wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate));
+                if(!ls.isEmpty())
+                {
+                    for(YawVo vo:ls)
+                    {
+                        if(vo.getSpeed()>2)
+                        {
+                            int hgsl=vo.getQualified();
+                            int bhgsl=vo.getUnqualified();
+                            if((hgsl+bhgsl)!=0)
+                            {
+                                double rate = new BigDecimal(hgsl).divide(new BigDecimal(hgsl+bhgsl), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                                vo.setPassrate(rate);
+                            }else
+                            {
+                                vo.setPassrate(100.0);
+                            }
+                            vos.add(vo);
+                        }
+                    }
+                }
+            }
+        }
+        if (null != vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+
+    @PostMapping("/getRanges")
+    @ResponseBody
+    @ApiOperation(value = "偏航对风合格区域分析", notes = "偏航对风合格区域分析")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, 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 = "value", value = "功率、风速对应数值", required = true, dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "type", value = "类型 1 功率 2风速", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult getRanges(String wtId, String beginDate, String endDate,Integer value,String type) throws Exception {
+
+        YawValuesVo vo=new YawValuesVo();
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate)  && StringUtils.notEmp(endDate) && StringUtils.notEmp(value) && StringUtils.notEmp(type) ) {
+            List<YawValuesVo>  vos = new ArrayList<>();
+            if(type.equals("1"))
+            {
+                vos = YawService.getYawValuesPowerTotal(wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate),value);
+
+                if(!vos.isEmpty())
+                {
+                    vo=vos.get(0);
+
+                }
+            }else  if(type.equals("2"))
+            {
+                vos = YawService.getYawValuesSpeedTotal(wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate),value);
+                if(!vos.isEmpty())
+                {
+                    vo=vos.get(0);
+
+                }
+            }
+        }
+        if (null != vo) {
+            return AjaxResult.successData(AjaxStatus.success.code, vo);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vo);
+        }
+
+    }
+
+
+
+    @PostMapping("/getTotalRanges")
+    @ResponseBody
+    @ApiOperation(value = "所有风速偏航对风合格区域分析", notes = "所有风速偏航对风合格区域分析")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, 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 = "类型 1 功率 2风速", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult getTotalRanges(String wtId, String beginDate, String endDate,String type) throws Exception {
+
+        YawValuesVo vo=new YawValuesVo();
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate)  && StringUtils.notEmp(endDate) && StringUtils.notEmp(type) ) {
+            List<YawValuesVo>  vos = new ArrayList<>();
+            if(type.equals("1"))
+            {
+                vos = YawService.getYawValuesPowerTotalAll(wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate));
+
+                if(!vos.isEmpty())
+                {
+                    vo=vos.get(0);
+
+                }
+            }else  if(type.equals("2"))
+            {
+                vos = YawService.getYawValuesSpeedTotalAll(wtId, DateUtils.parseDate(beginDate), DateUtils.parseDate(endDate));
+                if(!vos.isEmpty())
+                {
+                    vo=vos.get(0);
+
+                }
+            }
+        }
+        if (null != vo) {
+            return AjaxResult.successData(AjaxStatus.success.code, vo);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vo);
+        }
+
+    }
+
+
+
+}

+ 105 - 0
src/main/java/com/gyee/frame/mapper/auto/WindturbinepoweryawMapper.java

@@ -0,0 +1,105 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Windturbinepoweryaw;
+import com.gyee.frame.model.auto.WindturbinepoweryawExample;
+import com.gyee.frame.model.custom.YawValuesVo;
+import com.gyee.frame.model.custom.YawVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+public interface WindturbinepoweryawMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    long countByExample(WindturbinepoweryawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(WindturbinepoweryawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int insert(Windturbinepoweryaw record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Windturbinepoweryaw record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    List<Windturbinepoweryaw> selectByExample(WindturbinepoweryawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    Windturbinepoweryaw selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Windturbinepoweryaw record, @Param("example") WindturbinepoweryawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Windturbinepoweryaw record, @Param("example") WindturbinepoweryawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Windturbinepoweryaw record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEPOWERYAW
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Windturbinepoweryaw record);
+
+    List<YawVo> getYawTotal(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    List<YawValuesVo> getYawValuesTotal(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("value") Integer value);
+    List<YawValuesVo> getYawTotalAll(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+}

+ 107 - 0
src/main/java/com/gyee/frame/mapper/auto/WindturbinewindyawMapper.java

@@ -0,0 +1,107 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Windturbinewindyaw;
+import com.gyee.frame.model.auto.WindturbinewindyawExample;
+import com.gyee.frame.model.custom.YawValuesVo;
+import com.gyee.frame.model.custom.YawVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+public interface WindturbinewindyawMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    long countByExample(WindturbinewindyawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(WindturbinewindyawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int insert(Windturbinewindyaw record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Windturbinewindyaw record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    List<Windturbinewindyaw> selectByExample(WindturbinewindyawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    Windturbinewindyaw selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Windturbinewindyaw record, @Param("example") WindturbinewindyawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Windturbinewindyaw record, @Param("example") WindturbinewindyawExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Windturbinewindyaw record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table WINDTURBINEWINDYAW
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Windturbinewindyaw record);
+
+    List<YawVo> getYawTotal(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+    List<YawValuesVo> getYawValuesTotal(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("value") Integer value);
+
+    List<YawValuesVo> getYawTotalAll(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1833 - 0
src/main/java/com/gyee/frame/model/auto/Windturbinepoweryaw.java


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 6732 - 0
src/main/java/com/gyee/frame/model/auto/WindturbinepoweryawExample.java


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1825 - 0
src/main/java/com/gyee/frame/model/auto/Windturbinewindyaw.java


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 6732 - 0
src/main/java/com/gyee/frame/model/auto/WindturbinewindyawExample.java


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1737 - 0
src/main/java/com/gyee/frame/model/custom/YawValuesVo.java


+ 66 - 0
src/main/java/com/gyee/frame/model/custom/YawVo.java

@@ -0,0 +1,66 @@
+package com.gyee.frame.model.custom;
+
+import java.io.Serializable;
+
+public class YawVo implements Serializable {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    private String wtId;
+    private Integer speed;
+    private Integer power;
+    private Integer qualified;
+    private Integer unqualified;
+    private Double passrate;
+
+    public Double getPassrate() {
+        return passrate;
+    }
+
+    public void setPassrate(Double passrate) {
+        this.passrate = passrate;
+    }
+
+    public String getWtId() {
+        return wtId;
+    }
+
+    public void setWtId(String wtId) {
+        this.wtId = wtId;
+    }
+
+    public Integer getSpeed() {
+        return speed;
+    }
+
+    public void setSpeed(Integer speed) {
+        this.speed = speed;
+    }
+
+    public Integer getPower() {
+        return power;
+    }
+
+    public void setPower(Integer power) {
+        this.power = power;
+    }
+
+    public Integer getQualified() {
+        return qualified;
+    }
+
+    public void setQualified(Integer qualified) {
+        this.qualified = qualified;
+    }
+
+    public Integer getUnqualified() {
+        return unqualified;
+    }
+
+    public void setUnqualified(Integer unqualified) {
+        this.unqualified = unqualified;
+    }
+}

+ 132 - 0
src/main/java/com/gyee/frame/service/WindturbinepoweryawService.java

@@ -0,0 +1,132 @@
+package com.gyee.frame.service;
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.support.Convert;
+import com.gyee.frame.mapper.auto.WindturbinepoweryawMapper;
+import com.gyee.frame.model.auto.Windturbinepoweryaw;
+import com.gyee.frame.model.auto.WindturbinepoweryawExample;
+import com.gyee.frame.model.custom.YawValuesVo;
+import com.gyee.frame.model.custom.YawVo;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+
+@Service
+public class WindturbinepoweryawService implements BaseService<Windturbinepoweryaw, WindturbinepoweryawExample> {
+	@Resource
+	private WindturbinepoweryawMapper windturbinepoweryawMapper;
+	
+
+	@Override
+	public int deleteByPrimaryKey(String ids) {
+				
+			List<Integer> lista=Convert.toIntArrayList(ids);
+			WindturbinepoweryawExample example=new WindturbinepoweryawExample();
+			example.createCriteria().andIdIn(lista);
+			return windturbinepoweryawMapper.deleteByExample(example);
+			
+				
+	}
+	
+	
+	@Override
+	public Windturbinepoweryaw selectByPrimaryKey(String id) {
+				
+			return windturbinepoweryawMapper.selectByPrimaryKey(Integer.valueOf(id));
+				
+	}
+
+	
+	@Override
+	public int updateByPrimaryKeySelective(Windturbinepoweryaw record) {
+		return windturbinepoweryawMapper.updateByPrimaryKeySelective(record);
+	}
+	
+	
+	/**
+	 * 添加
+	 */
+	@Override
+	public int insertSelective(Windturbinepoweryaw record) {
+				
+
+			
+				
+		return windturbinepoweryawMapper.insertSelective(record);
+	}
+	
+	
+	@Override
+	public int updateByExampleSelective(Windturbinepoweryaw record, WindturbinepoweryawExample example) {
+		
+		return windturbinepoweryawMapper.updateByExampleSelective(record, example);
+	}
+
+	
+	@Override
+	public int updateByExample(Windturbinepoweryaw record, WindturbinepoweryawExample example) {
+		
+		return windturbinepoweryawMapper.updateByExample(record, example);
+	}
+
+	@Override
+	public List<Windturbinepoweryaw> selectByExample(WindturbinepoweryawExample example) {
+		
+		return windturbinepoweryawMapper.selectByExample(example);
+	}
+
+	
+	@Override
+	public long countByExample(WindturbinepoweryawExample example) {
+		
+		return windturbinepoweryawMapper.countByExample(example);
+	}
+
+	
+	@Override
+	public int deleteByExample(WindturbinepoweryawExample example) {
+		
+		return windturbinepoweryawMapper.deleteByExample(example);
+	}
+
+
+	public List<YawVo> getYawTotal(String wtId, Date beginDate, Date endDate)
+	{
+		return windturbinepoweryawMapper.getYawTotal(wtId, beginDate, endDate);
+	}
+
+	public List<YawValuesVo> getYawValuesTotal(String wtId, Date beginDate,Date endDate, Integer value)
+	{
+		return windturbinepoweryawMapper.getYawValuesTotal(wtId, beginDate, endDate,value);
+	}
+
+	public List<YawValuesVo> getYawValuesTotalAll(String wtId, Date beginDate, Date endDate)
+	{
+		return windturbinepoweryawMapper.getYawTotalAll(wtId, beginDate, endDate);
+	}
+//	public List<Windturbinepoweryaw> findWindturbinepoweryaw(Date beginDate,Date endDate,String wpId) {
+//
+//		List<Windturbinepoweryaw> list=new ArrayList<>();
+//
+//		if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+//
+//			WindturbinepoweryawExample example=new WindturbinepoweryawExample();
+//			example.setOrderByClause("recodedata DESC");
+//
+//			WindturbinepoweryawExample.Criteria criteria =example.createCriteria();
+//
+//			criteria.andRecodedataGreaterThanOrEqualTo(beginDate).andRecodedataLessThan(endDate);
+//
+//			criteria.andWindpowerstationidEqualTo(wpId);
+//			criteria.andWindpowerstationidLike("%FDC");
+//			list= windturbinepoweryawMapper.selectByExample(example);
+//
+//		}
+//		return list;
+//
+//	}
+
+}

+ 109 - 0
src/main/java/com/gyee/frame/service/WindturbinewindyawService.java

@@ -0,0 +1,109 @@
+package com.gyee.frame.service;
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.support.Convert;
+import com.gyee.frame.mapper.auto.WindturbinewindyawMapper;
+import com.gyee.frame.model.auto.Windturbinewindyaw;
+import com.gyee.frame.model.auto.WindturbinewindyawExample;
+import com.gyee.frame.model.custom.YawValuesVo;
+import com.gyee.frame.model.custom.YawVo;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+
+@Service
+public class WindturbinewindyawService implements BaseService<Windturbinewindyaw, WindturbinewindyawExample> {
+	@Resource
+	private WindturbinewindyawMapper windturbinewindyawMapper;
+	
+
+	@Override
+	public int deleteByPrimaryKey(String ids) {
+				
+			List<Integer> lista=Convert.toIntArrayList(ids);
+			WindturbinewindyawExample example=new WindturbinewindyawExample();
+			example.createCriteria().andIdIn(lista);
+			return windturbinewindyawMapper.deleteByExample(example);
+			
+				
+	}
+	
+	
+	@Override
+	public Windturbinewindyaw selectByPrimaryKey(String id) {
+				
+			return windturbinewindyawMapper.selectByPrimaryKey(Integer.valueOf(id));
+				
+	}
+
+	
+	@Override
+	public int updateByPrimaryKeySelective(Windturbinewindyaw record) {
+		return windturbinewindyawMapper.updateByPrimaryKeySelective(record);
+	}
+	
+	
+	/**
+	 * 添加
+	 */
+	@Override
+	public int insertSelective(Windturbinewindyaw record) {
+
+			
+				
+		return windturbinewindyawMapper.insertSelective(record);
+	}
+	
+	
+	@Override
+	public int updateByExampleSelective(Windturbinewindyaw record, WindturbinewindyawExample example) {
+		
+		return windturbinewindyawMapper.updateByExampleSelective(record, example);
+	}
+
+	
+	@Override
+	public int updateByExample(Windturbinewindyaw record, WindturbinewindyawExample example) {
+		
+		return windturbinewindyawMapper.updateByExample(record, example);
+	}
+
+	@Override
+	public List<Windturbinewindyaw> selectByExample(WindturbinewindyawExample example) {
+		
+		return windturbinewindyawMapper.selectByExample(example);
+	}
+
+	
+	@Override
+	public long countByExample(WindturbinewindyawExample example) {
+		
+		return windturbinewindyawMapper.countByExample(example);
+	}
+
+	
+	@Override
+	public int deleteByExample(WindturbinewindyawExample example) {
+		
+		return windturbinewindyawMapper.deleteByExample(example);
+	}
+
+
+	public List<YawVo> getYawTotal(String wtId, Date beginDate, Date endDate)
+	{
+		return windturbinewindyawMapper.getYawTotal(wtId, beginDate, endDate);
+	}
+
+	public List<YawValuesVo> getYawValuesTotal(String wtId, Date beginDate, Date endDate, Integer value)
+	{
+		return windturbinewindyawMapper.getYawValuesTotal(wtId, beginDate, endDate,value);
+	}
+
+	public List<YawValuesVo> getYawValuesTotalAll(String wtId, Date beginDate, Date endDate)
+	{
+		return windturbinewindyawMapper.getYawTotalAll(wtId, beginDate, endDate);
+	}
+}

+ 21 - 0
src/main/java/com/gyee/frame/service/recommen/RecommenService.java

@@ -5,6 +5,7 @@ import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.*;
 import com.gyee.frame.service.*;
+import com.gyee.frame.service.report.*;
 import com.gyee.frame.util.*;
 import org.springframework.stereotype.Service;
 
@@ -53,6 +54,11 @@ public class RecommenService {
 	@Resource
 	private EliminatingeqService eliminatingeqService;
 
+	@Resource
+	private Wttragetreport3Service wttragetreport3Service;
+	@Resource
+	private WtReportFault3Service wtReportFault3Service;
+
 	private final String QS = "0";
 	private final String FD = "-1";
 	private final String GF = "-2";
@@ -409,6 +415,21 @@ public class RecommenService {
 			vo.setTjyy(rm.getReason());
 
 			WtReportMain wrm = wtReportMainService.findWtReportMainById(rm.getWtid(), rm.getCreatedate());
+
+//			WtReportFault3 wrm =new WtReportFault3();
+//			List<Wttragetreport3> wtreportls = wttragetreport3Service.findWttragetreport3(rm.getWtid(),DateUtils.truncate(rm.getRecodedate()));
+
+//			if (!wtreportls.isEmpty()) {
+//				//获得健康报告主表信息
+//				Wttragetreport3 wtreport = wtreportls.get(0);
+//				//获得检修数据
+//				List<WtReportFault3> wtfaultls = wtReportFault3Service.findWtReportFault3(wtreport.getId(), rm.getWtid());
+//
+//				if(!wtfaultls.isEmpty())
+//				{
+//					wrm =wtfaultls.get(0);
+//				}
+//			}
 			// 如果判定状态为下单,进入该判读
 			if (StringUtils.notEmp(rm.getIsmain()) && rm.getIsmain().equals(XQQR)
 					&& StringUtils.notEmp(rm.getWobugid())) {

+ 78 - 0
src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -1148,6 +1148,84 @@ public class GenreSetPushService {
         return vos;
     }
 
+
+
+    public List<DataVo> findPowerWpChart(String wpId) throws Exception {
+        List<DataVo> vos = new ArrayList<DataVo>();
+        if (StringUtils.empty(wpId)) {
+            wpId = "0";
+        }
+
+        Calendar c = Calendar.getInstance();
+
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.set(Calendar.MILLISECOND, 0);
+
+        for (int i = 0; i < 24; i++) {
+
+            DataVo vo = new DataVo();
+
+            vo.setTime(c.getTime().getTime());
+//                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);// 24小时预测功率
+//                vo.setValue8(0.0);// 72小时预测功率
+//                vo.setValue9(0.0);// 最优功率律
+
+            vos.add(vo);
+            c.add(Calendar.HOUR_OF_DAY,1);
+        }
+        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);
+
+        Date beginDate = cal.getTime();
+
+        cal = Calendar.getInstance();
+        Date endDate = cal.getTime();
+
+
+
+        long num = DateUtils.hoursDiff(beginDate, endDate) ;
+        // long num = 30;
+
+        WindPowerStationTestingPoint2 rfdlai = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_RFDL);
+        WindPowerStationTestingPoint2 sjgl = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SJGL);
+        WindPowerStationTestingPoint2 ssfs = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SSFS);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        List<PointData> rfdls = realApiUtil.getHistoryDatasSnap(rfdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 3600L);
+        List<PointData> sjglls = realApiUtil.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 3600L);
+        List<PointData> ssfss = realApiUtil.getHistoryDatasSnap(ssfs, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 3600L);
+
+        if (!rfdls.isEmpty() && !sjglls.isEmpty()
+                && rfdls.size() == sjglls.size()
+        ) {
+            int count = 0;
+            double temp = 0;
+            for (int i = 0; i < rfdls.size(); i++) {
+                vos.get(i).setTime(rfdls.get(i).getPointTime()* 1000);
+
+                temp = rfdls.get(i).getPointValueInDouble();
+                vos.get(i).setValue1(StringUtils.round(temp, 2));// 日发电量
+                temp = sjglls.get(i).getPointValueInDouble();
+                vos.get(i).setValue2(StringUtils.round(temp, 2));// 实际功率
+                temp = ssfss.get(i).getPointValueInDouble();
+                vos.get(i).setValue3(StringUtils.round(temp, 2));// 风速
+            }
+        }
+
+        return vos;
+    }
     private void setPlanInfo(Map<String, Double> gxkmap, List<ProjectPlan> planls, String id) {
 
         double yfdljh = 0.0;

+ 18 - 18
src/main/java/com/gyee/frame/service/websocket/RealPowerPushService.java

@@ -345,15 +345,15 @@ public class RealPowerPushService {
                                     }
 
 
-                                    total = datas.size() + subresult;
-                                    subresult = length - (total);
-
-                                    if (subresult > 0)
-                                        for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.HOUR_OF_DAY, 1);
-                                            vos.get(total + i).setTime(cal.getTime().getTime());
-                                            vos.get(total + i).setValue7(null);
-                                        }
+//                                    total = datas.size() + subresult;
+//                                    subresult = length - (total);
+//
+//                                    if (subresult > 0)
+//                                        for (int i = 0; i < subresult; i++) {
+//                                            cal.add(Calendar.HOUR_OF_DAY, 1);
+//                                            vos.get(total + i).setTime(cal.getTime().getTime());
+//                                            vos.get(total + i).setValue7(null);
+//                                        }
                                 }
 
                             }
@@ -757,15 +757,15 @@ public class RealPowerPushService {
                                     }
 
 
-                                    total = datas.size() + subresult;
-                                    subresult = length - (total);
-
-                                    if (subresult > 0)
-                                        for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.HOUR_OF_DAY, 1);
-                                            vos.get(total + i).setTime(cal.getTime().getTime());
-                                            vos.get(total + i).setValue7(null);
-                                        }
+//                                    total = datas.size() + subresult;
+//                                    subresult = length - (total);
+//
+//                                    if (subresult > 0)
+//                                        for (int i = 0; i < subresult; i++) {
+//                                            cal.add(Calendar.HOUR_OF_DAY, 1);
+//                                            vos.get(total + i).setTime(cal.getTime().getTime());
+//                                            vos.get(total + i).setValue7(null);
+//                                        }
                                 }
 
                             }

+ 51 - 0
src/main/java/com/gyee/frame/service/yaw/YawService.java

@@ -0,0 +1,51 @@
+package com.gyee.frame.service.yaw;
+
+import com.gyee.frame.model.custom.YawValuesVo;
+import com.gyee.frame.model.custom.YawVo;
+import com.gyee.frame.service.WindturbinepoweryawService;
+import com.gyee.frame.service.WindturbinewindyawService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+
+@Service
+public class YawService  {
+    @Resource
+    private WindturbinepoweryawService windturbinepoweryawService;
+    @Resource
+    private WindturbinewindyawService windturbinewindyawService;
+
+    public List<YawVo> getYawPowerTotal(String wtId, Date beginDate, Date endDate)
+    {
+        return windturbinepoweryawService.getYawTotal(wtId, beginDate, endDate);
+    }
+
+    public List<YawValuesVo> getYawValuesPowerTotal(String wtId, Date beginDate, Date endDate, Integer value)
+    {
+        return windturbinepoweryawService.getYawValuesTotal(wtId, beginDate, endDate,value);
+    }
+
+    public List<YawVo> getYawSpeedTotal(String wtId, Date beginDate, Date endDate)
+    {
+        return windturbinewindyawService.getYawTotal(wtId, beginDate, endDate);
+    }
+
+    public List<YawValuesVo> getYawValuesSpeedTotal(String wtId, Date beginDate, Date endDate, Integer value)
+    {
+        return windturbinewindyawService.getYawValuesTotal(wtId, beginDate, endDate,value);
+    }
+
+
+    public List<YawValuesVo> getYawValuesSpeedTotalAll(String wtId, Date beginDate, Date endDate)
+    {
+        return windturbinewindyawService.getYawValuesTotalAll(wtId, beginDate, endDate);
+    }
+
+    public List<YawValuesVo> getYawValuesPowerTotalAll(String wtId, Date beginDate, Date endDate)
+    {
+        return windturbinepoweryawService.getYawValuesTotalAll(wtId, beginDate, endDate);
+    }
+}

+ 2 - 2
src/main/resources/mybatis-generator.xml

@@ -109,8 +109,8 @@
 <!--        <table tableName='StopAnalysis' domainObjectName='StopAnalysis'/>-->
 <!--        <table tableName='StopAnalysismain' domainObjectName='StopAnalysismain'/>-->
 <!--        <table tableName='StopAnalysismainVo' domainObjectName='StopAnalysismainVo'/>-->
-        <table tableName='StopAnalysisDetail' domainObjectName='StopAnalysisDetail'/>
-        <table tableName='StopAnalysisDetailVo' domainObjectName='StopAnalysisDetailVo'/>
+        <table tableName='Windturbinepoweryaw' domainObjectName='Windturbinepoweryaw'/>
+        <table tableName='Windturbinewindyaw' domainObjectName='Windturbinewindyaw'/>
 
 
     </context>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2082 - 0
src/main/resources/mybatis/auto/WindturbinepoweryawMapper.xml


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2084 - 0
src/main/resources/mybatis/auto/WindturbinewindyawMapper.xml


+ 7 - 5
src/test/java/test/GenreSetPushTest.java

@@ -3,9 +3,11 @@ package test;
 import com.gyee.SpringbootStart;
 import com.gyee.frame.common.spring.SpringUtils;
 import com.gyee.frame.controller.monitor.GenreSetPushController;
+import com.gyee.frame.model.custom.DataVo;
+import com.gyee.frame.service.websocket.GenreSetPushService;
 import org.springframework.boot.SpringApplication;
 
-import java.util.Map;
+import java.util.List;
 
 public class GenreSetPushTest {
 
@@ -25,8 +27,8 @@ public class GenreSetPushTest {
 
         GenreSetPushController genreSetPushController= SpringUtils.getBean("genreSetPushController");
 
-
-        Map<String, Object> map =genreSetPushController.findBasicDataInfo("0");
+        GenreSetPushService genreSetPushService= SpringUtils.getBean("genreSetPushService");
+//        Map<String, Object> map =genreSetPushController.findBasicDataInfo("0");
 //        Map<String, Object> map =genreSetPushController.findDayInfo("0","rfdl");
 
 //        Map<String, Object> map2 =genreSetPushController.findBasicDataInfo("MHS_FDC");
@@ -38,9 +40,9 @@ public class GenreSetPushTest {
 //        map.put(GF, genreSetPushService.findBasicDataInfo(GF));
 
 
+        List<DataVo> vos = genreSetPushService.findPowerWpChart("MHS_FDC");
 
-
-         System.out.println(map.size());
+         System.out.println(vos.size());
 
 
 

+ 3 - 3
src/test/java/test/RealPowerPushTest.java

@@ -28,9 +28,9 @@ public class RealPowerPushTest {
 
 
 
-        Map<String, Object> map = realPowerPushService.genreSetMap();
-
-
+//        Map<String, Object> map = realPowerPushService.genreSetMap();
+        Map<String, Object> map = realPowerPushService.genreSetWpMap("0");
+        Map<String, Object> map1 = realPowerPushService.genreSetWpMap("MHS_FDC");
 
          System.out.println(map.size());
 

+ 104 - 0
src/test/java/test/YawServiceTest.java

@@ -0,0 +1,104 @@
+package test;
+
+import com.gyee.SpringbootStart;
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.model.custom.YawValuesVo;
+import com.gyee.frame.service.yaw.YawService;
+import org.springframework.boot.SpringApplication;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+public class YawServiceTest {
+
+
+    public static void main(String[] args) throws Exception {
+
+        SpringApplication.run(SpringbootStart.class, args);
+
+          String QS = "0";
+          String FD = "-1";
+          String GF = "-2";
+
+        String wtId="MG01_03";
+        String wpId="MHS_FDC";
+        String year="2021";
+        String month="1";
+
+
+
+        YawService yawService= SpringUtils.getBean("yawService");
+//        Map<String, Object> map =genreSetPushController.findBasicDataInfo("0");
+//        Map<String, Object> map =genreSetPushController.findDayInfo("0","rfdl");
+
+//        Map<String, Object> map2 =genreSetPushController.findBasicDataInfo("MHS_FDC");
+//        Map<String, Object> map = new HashMap<>();
+//
+//
+//        map.put(QS, genreSetPushService.findBasicDataInfo(QS));
+//        map.put(FD, genreSetPushService.findBasicDataInfo(FD));
+//        map.put(GF, genreSetPushService.findBasicDataInfo(GF));
+
+
+        Calendar c = Calendar.getInstance();
+
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.set(Calendar.DAY_OF_MONTH,1);
+
+
+        Date beginDate = c.getTime();
+
+        c.add(Calendar.MONTH,1);
+
+        Date endDate = c.getTime();
+        List<YawValuesVo> vos1 = yawService.getYawValuesPowerTotalAll("XG01_03",beginDate,endDate);
+
+//        List<YawValuesVo> vos2 = yawService.getYawValuesPowerTotal("MG01_01",beginDate,endDate,4);
+//
+//        List<YawVo> vos3 = yawService.getYawSpeedTotal("MG01_01",beginDate,endDate);
+//
+//        List<YawValuesVo> vos4 = yawService.getYawValuesSpeedTotal("MG01_01",beginDate,endDate,4);
+
+         System.out.println(vos1.size());
+
+
+
+//        AjaxResult ar = singleAnalysisController.singleanalysisSub(wtId,year,month);
+//
+//        Map<String,Object> map=( Map<String,Object>)ar.get("data");
+//        for(SingleAnalysisVo wtd:vos)
+//        {
+//            System.out.println(wtd.getXfqr()+"----------------"+wtd.getXfqrhgl());
+//        }
+//
+//        AjaxResult ar = singleAnalysisController.singleanalysisChart(wtId,year,month);
+//
+//        Map<String, List<SingleAnalysisVo>> map=( Map<String,List<SingleAnalysisVo>>)ar.get("data");
+//        List<SingleAnalysisVo> vos=map.get("ff");
+//        for(SingleAnalysisVo wtd:vos)
+//        {
+//            System.out.println(wtd.getFdl()+"----------------"+wtd.getFs());
+//        }
+//
+//        System.out.println("---------------------------------------------------------------------------------");
+//        vos=map.get("ws");
+//        for(SingleAnalysisVo wtd:vos)
+//        {
+//            System.out.println(wtd.getGzss()+"----------------"+wtd.getJxss()+"----------------"+wtd.getXdss()
+//                    +"----------------"+wtd.getXnss()+"----------------"+wtd.getSlss());
+//        }
+//        System.out.println("---------------------------------------------------------------------------------");
+//        vos=map.get("jd");
+//        for(SingleAnalysisVo wtd:vos)
+//        {
+//            System.out.println(wtd.getJfpl()+"----------------"+wtd.getTjxs());
+//        }
+//
+//
+//
+    }
+}