Selaa lähdekoodia

切入切出接口,月度单机分析接口

shilin 2 vuotta sitten
vanhempi
commit
f9b8a2e6af

+ 71 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/OutputSpeedController.java

@@ -0,0 +1,71 @@
+package com.gyee.runeconomy.controller;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.model.auto.ProEconInOrOutSpeedTotal;
+import com.gyee.runeconomy.service.outputspeed.OutputSpeedService;
+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;
+
+
+@Controller
+@RequestMapping("/outputspeed")
+@Api(value = "切入切出管理",tags =  "切入切出管理")
+public class OutputSpeedController {
+
+    @Resource
+    private OutputSpeedService outputSpeedService;
+
+    /**切入切出列表**/
+    @PostMapping("/outputSpeedlist")
+    @ResponseBody
+    @ApiOperation(value = "切入切出列表", notes = "切入切出列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
+
+    public R outputSpeedlist( Integer pageNum, Integer pageSize, String wpId, String recorddate) {
+
+        Page<ProEconInOrOutSpeedTotal> pageInfo=outputSpeedService.outputSpeedlist(pageNum,pageSize,wpId,recorddate);
+
+        return R.data(ResultMsg.ok(pageInfo));
+
+    }
+
+    /**切入切出历史列表**/
+    @PostMapping("/outputspeedhistorylist")
+    @ResponseBody
+    @ApiOperation(value = "切入切出历史列表", notes = "切入切出历史列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @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")})
+
+    public R outputspeedhistorylist(Integer pageNum, Integer pageSize, String wpId,String wtId, String beginDate,String endDate) {
+
+
+        Page<ProEconInOrOutSpeedTotal> pageInfo=outputSpeedService.outputspeedhistorylist(pageNum,pageSize,wpId,wtId,beginDate,endDate);
+
+
+        return R.data(ResultMsg.ok(pageInfo));
+//        return AjaxResult.successData(ResultCode.SUCCESS, pageInfo);
+
+    }
+
+
+}

+ 199 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/SingleAnalysisController.java

@@ -0,0 +1,199 @@
+package com.gyee.runeconomy.controller;
+
+
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.model.vo.SingleAnalysisVo;
+import com.gyee.runeconomy.service.singleanalysis.SingleAnalysisService;
+import com.gyee.runeconomy.util.DateUtils;
+import com.gyee.runeconomy.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.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 java.util.*;
+
+@Controller
+@RequestMapping("/singleanalysis")
+@Api(value = "单机性能分析" ,tags="单机性能分析")
+public class SingleAnalysisController {
+
+    @Resource
+    private SingleAnalysisService singleAnalysisService;
+
+    @PostMapping("/singleanalysisMain")
+    @ResponseBody
+    @ApiOperation(value = "查询单机性能分析首页", notes = "查询单机性能分析首页")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "month", value = "月份", required = true, dataType = "string", paramType = "query")})
+
+    public R singleanalysisMain(Integer pageNum, Integer pageSize, String wpId, String year, String month) throws Exception {
+
+        List<SingleAnalysisVo> vos =new ArrayList<>();
+
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(year) && StringUtils.notEmp(month)) {
+
+            Calendar cal = Calendar.getInstance();
+            int newyear=cal.get(Calendar.YEAR);
+            int newmonth=cal.get(Calendar.MONTH)+1;
+            Date recordDate=null;
+            if(Integer.valueOf(year)==newyear && Integer.valueOf(month) == newmonth)
+            {
+                cal.add(Calendar.DAY_OF_MONTH,-1);
+                recordDate= DateUtils.truncate(cal.getTime());
+            }else
+            {
+                cal.set(Calendar.YEAR,Integer.valueOf(year));
+                cal.set(Calendar.MONTH,Integer.valueOf(month)-1);
+                cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+                recordDate= DateUtils.truncate(cal.getTime());
+            }
+
+
+            vos =singleAnalysisService.SingleAnalysisList(pageNum, pageSize, wpId,recordDate);
+
+        }
+
+        return R.data(ResultMsg.ok(vos));
+
+    }
+
+    /**
+     * 单机信息总览子页面
+     * @param wtId
+     * @param year
+     * @param month
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("/singleanalysisSub")
+    @ResponseBody
+    @ApiOperation(value = "查询单机性能分析子页面", notes = "查询单机性能分析子页面")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "month", value = "月份", required = true, dataType = "string", paramType = "query")})
+
+    public R singleanalysisSub(String wtId, String year, String month) throws Exception {
+
+        Map<String,Object> map=new HashMap<>();
+
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(year) && StringUtils.notEmp(month)) {
+            Calendar cal = Calendar.getInstance();
+            int newyear=cal.get(Calendar.YEAR);
+            int newmonth=cal.get(Calendar.MONTH)+1;
+            Date recordDate=null;
+            if(Integer.valueOf(year)==newyear && Integer.valueOf(month) == newmonth)
+            {
+                cal.add(Calendar.DAY_OF_MONTH,-1);
+                recordDate= DateUtils.truncate(cal.getTime());
+            }else
+            {
+                cal.set(Calendar.YEAR,Integer.valueOf(year));
+                cal.set(Calendar.MONTH,Integer.valueOf(month)-1);
+                cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+                recordDate= DateUtils.truncate(cal.getTime());
+            }
+
+
+            SingleAnalysisVo  byzb =singleAnalysisService.SingleAnalysisListByWtId(wtId,recordDate);
+
+            cal.add(Calendar.YEAR,-1);
+            Date lastYear=DateUtils.truncate(cal.getTime());
+
+            SingleAnalysisVo  tqzb =singleAnalysisService.SingleAnalysisListByWtId(wtId,lastYear);
+            SingleAnalysisVo  tbzb =singleAnalysisService.SingleAnalysisListByWtId(byzb,tqzb);
+
+
+            cal.setTime(recordDate);
+            cal.add(Calendar.MONTH,-1);
+
+            Date lastMonth=DateUtils.truncate(cal.getTime());
+            SingleAnalysisVo  hqzb =singleAnalysisService.SingleAnalysisListByWtId(wtId,lastMonth);
+            SingleAnalysisVo  hbzb =singleAnalysisService.SingleAnalysisListByWtId(byzb,hqzb);
+
+
+
+            map.put("byzb",byzb);//本月指标
+            map.put("tqzb",tqzb);//全年同期
+            map.put("tbzb",tbzb);//同比指标
+            map.put("hqzb",hqzb);//上月同期
+            map.put("hbzb",hbzb);//环比指标
+        }
+
+//        if (null!=map) {
+//            return AjaxResult.successData(ResultCode.SUCCESS, map);
+//        } else {
+//            return AjaxResult.successData(ResultCode.SUCCESS, map);
+//        }
+
+        return R.data(ResultMsg.ok(map));
+    }
+
+
+    /**
+     * 单机信息总览图表接口(3个)
+     * @param wtId
+     * @param year
+     * @param month
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("/singleanalysisChart")
+    @ResponseBody
+    @ApiOperation(value = "单机信息总览图表接口(3个) 发电量和风速、五项损失、静风频率和待机时间", notes = "单机信息总览图表接口(3个) 发电量和风速、五项损失、静风频率和待机时间")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "month", value = "月份", required = true, dataType = "string", paramType = "query")})
+
+    public R singleanalysisChart(String wtId, String year, String month) throws Exception {
+
+        Map<String,List<SingleAnalysisVo>> map =new HashMap<>();
+
+        if (StringUtils.notEmp(wtId) && 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();
+
+            map =singleAnalysisService.SingleAnalysisListByWtIdDetiml(wtId,beginDate,endDate);
+
+        }
+
+//        map.put("ff",fdlfsls);//发电量和风速
+//        map.put("ws",wsls);//五项损失,绑定五个
+//        map.put("jd",jfpldjsjls);//静风频率和待机时间
+
+//        if (null!=map) {
+//            return AjaxResult.successData(ResultCode.SUCCESS, map);
+//        } else {
+//            return AjaxResult.successData(ResultCode.SUCCESS, map);
+//        }
+        return R.data(ResultMsg.ok(map));
+    }
+
+
+}

+ 83 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbinegoodnessController.java

@@ -0,0 +1,83 @@
+package com.gyee.runeconomy.controller.goodness;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.model.auto.ProEconWindturbineGoodness;
+import com.gyee.runeconomy.service.goodness.WindturbinegoodnessService;
+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;
+
+/**
+ * 单机性能分析列表
+ */
+@Controller
+@RequestMapping("/goodness")
+@Api(value = "单机信息总览首页",tags =  "单机信息总览首页")
+public class WindturbinegoodnessController {
+    @Resource
+    private WindturbinegoodnessService windturbinegoodnessService;
+//    @Resource
+//    private WindturbineanalysisdayService windturbineanalysisdayService;
+
+
+    /**
+     * 获得单机性能总览列表信息
+     * @return
+     */
+    @PostMapping("/windturbinegoodness")
+    @ResponseBody
+    @ApiOperation(value = "获得单机性能总览列表信息", notes = "获得单机性能总览列表信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
+
+    public R windturbinegoodness( Integer pageNum, Integer pageSize, String wpId, String recorddate) {
+
+        Page<ProEconWindturbineGoodness> resultList = windturbinegoodnessService.windturbinegoodnessList(pageNum,pageSize, wpId, recorddate);
+        return R.data(ResultMsg.ok(resultList));
+    }
+
+
+//    /**
+//     * 获得单机性能总览历史列表信息
+//     *
+//     * @param tablepar
+//     * @param wtId
+//     * @param beginDate
+//     * @param endDate
+//     * @return
+//     */
+//    @PostMapping("/goodhistorylist")
+//    @ResponseBody
+//    @ApiOperation(value = "获得单机性能总览历史列表信息", notes = "获得单机性能总览历史列表信息")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "tablepar", value = "分页排序对象", required = true, dataType = "string", paramType = "query"),
+//            @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")})
+//
+//    public AjaxResult goodhistorylist(@RequestBody Tablepar tablepar, String wtId, String beginDate, String endDate) {
+//        List<Windturbineanalysisday> resultList =new ArrayList<>();
+//        if(StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) )
+//        {
+//            resultList = windturbineanalysisdayService.goodhistorylist(tablepar,wtId, DateUtils.parseDate(beginDate),  DateUtils.parseDate(endDate));
+//        }
+//        if (resultList != null) {
+//            return AjaxResult.successData(AjaxStatus.success.code, resultList);
+//        } else {
+//            return AjaxResult.successData(AjaxStatus.success.code, resultList);
+//        }
+//    }
+
+}

+ 104 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/AjaxResult.java

@@ -0,0 +1,104 @@
+package com.gyee.runeconomy.dto;
+
+import java.util.HashMap;
+
+/**
+* @ClassName: AjaxResult
+* @Description: ajax操作消息提醒
+* @author gyee
+* @date 2018年8月18日
+*
+ */
+public class AjaxResult extends HashMap<String, Object>
+{
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 初始化一个新创建的 Message 对象
+     */
+    public AjaxResult()
+    {
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @return 错误消息
+     */
+    public static AjaxResult error()
+    {
+        return error(1, "操作失败");
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param msg 内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(String msg)
+    {
+        return error(500, msg);
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param code 错误码
+     * @param msg 内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(int code, String msg)
+    {
+        AjaxResult json = new AjaxResult();
+        json.put("code", code);
+        json.put("msg", msg);
+        return json;
+    }
+
+    /**
+     * 返回成功消息
+     * 
+     * @param msg 内容
+     * @return 成功消息
+     */
+    public static AjaxResult success(String msg)
+    {
+        AjaxResult json = new AjaxResult();
+        json.put("msg", msg);
+        json.put("code", 200);
+        return json;
+    }
+    
+    /**
+     * 返回成功消息
+     * 
+     * @return 成功消息
+     */
+    public static AjaxResult success()
+    {
+        return AjaxResult.success("操作成功");
+    }
+    
+    public static AjaxResult successData(int code, Object value){
+    	 AjaxResult json = new AjaxResult();
+    	 json.put("code", code);
+         json.put("data", value);
+         return json;
+    }
+   
+    
+    /**
+     * 返回成功消息
+     * 
+     * @param key 键值
+     * @param value 内容
+     * @return 成功消息
+     */
+    @Override
+    public AjaxResult put(String key, Object value)
+    {
+        super.put(key, value);
+        return this;
+    }
+}

+ 72 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/EchartDataVo.java

@@ -0,0 +1,72 @@
+
+package com.gyee.runeconomy.dto;
+
+/**
+ *
+ */
+
+public class EchartDataVo {
+
+    private String name;
+    private String xAxis;
+
+    private ItemStyle itemStyle;
+
+    private String time1;
+    private String time2;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getxAxis() {
+        return xAxis;
+    }
+
+    public void setxAxis(String xAxis) {
+        this.xAxis = xAxis;
+    }
+
+    public String getTime1() {
+        return time1;
+    }
+
+    public void setTime1(String time1) {
+        this.time1 = time1;
+    }
+
+    public String getTime2() {
+        return time2;
+    }
+
+    public void setTime2(String time2) {
+        this.time2 = time2;
+    }
+
+    public ItemStyle getItemStyle() {
+        return itemStyle;
+    }
+
+    public void setItemStyle(ItemStyle itemStyle) {
+        this.itemStyle = itemStyle;
+    }
+
+    public class ItemStyle
+    {
+
+        private String color;
+        public String getColor() {
+            return color;
+        }
+
+        public void setColor(String color) {
+            this.color = color;
+        }
+
+    }
+
+}

+ 29 - 13
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/auto/ProEconWindturbineGoodness.java

@@ -1,5 +1,7 @@
 package com.gyee.runeconomy.model.auto;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -23,60 +25,74 @@ public class ProEconWindturbineGoodness extends Model {
     /**
      * 编号
      */
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
     private Long id;
 
     /**
      * 风机编号
      */
-    private String windturbineid;
+    private String windturbineId;
 
     /**
      * 日拟合优度
      */
-    private Double daygoodness;
+    private Double dayGoodness;
 
     /**
      * 月拟合优度
      */
-    private Double monthgoodness;
+    private Double monthGoodness;
 
     /**
      * 年拟合优度
      */
-    private Double yeargoodness;
+    private Double yearGoodness;
 
     /**
      * 日期
      */
-    private Date recorddate;
-
+    private Date recordDate;
 
     /**
      * 风场编号
      */
-    private String windtpowerstationid;
+    private String windtpowerstationId;
 
     /**
      * 型号编号
      */
-    private String modelid;
-
-
+    private String modelId;
 
     /**
      * 日功率一致性系数
      */
-    private Double daycoefficient;
+    private Double dayCoefficient;
 
     /**
      * 月功率一致性系数
      */
-    private Double monthcoefficient;
+    private Double monthCoefficient;
 
     /**
      * 年功率一致性系数
      */
-    private Double yearcoefficient;
+    private Double yearCoefficient;
+
+    /**
+     * 日排行
+     */
+    private Integer dayTop;
+
+    /**
+     * 月排行
+     */
+    private Integer monthTop;
+
+    /**
+     * 年排行
+     */
+    private Integer yearTop;
+
 
 
 }

+ 78 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/vo/SingleAnalysisVo.java

@@ -0,0 +1,78 @@
+package com.gyee.runeconomy.model.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+
+public class SingleAnalysisVo implements java.io.Serializable {
+
+
+    private static final long serialVersionUID = 1L;
+    // Fields
+
+    private String id;
+    //风机编号
+    private String windturbineid;
+	//风机名称
+	private String windturbineName;
+    //风场编号
+    private String windPowerStationId;
+    //风场名称
+    private String windPowerStationName;
+    //发电量
+    private Double fdl;
+    //上网电量
+    private Double swdl;
+    //购网电量
+    private Double gwdl;
+    //风速
+    private Double fs;
+    //故障损失
+    private Double gzss;
+    //检修损失
+    private Double jxss;
+    //限电损失
+    private Double xdss;
+    //性能发损失
+    private Double xnss;
+    //受累损失
+    private Double slss;
+    //理论发电量
+    private Double llfdl;
+    //故障小时
+    private Double gzxs;
+    //检修小时
+    private Double jxxs;
+    //停机小时
+    private Double tjxs;
+    //中断小时
+    private Double zdxs;
+    //运行小时
+    private Double yxxs;
+    //利用小时
+    private Double lyxs;
+	//设备可利用率
+	private Double sbklyl;
+    //等效可利用系数
+    private Double dxklyxs;
+    //日历小时
+    private Double rlxs;
+    //小风切入
+    private Double xfqr;
+    //功率一致性系数
+    private Double glyzxxs;
+	//有效风时速
+    private Double yxfss;
+	//小风切入率合格率
+    private Double xfqrhgl;
+    //风机容量
+	private Double fjrl;
+	//静风频率
+	private Double jfpl;
+	//日期
+	private Date recorddate;
+
+
+}

+ 853 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/goodness/WindturbinegoodnessService.java

@@ -0,0 +1,853 @@
+package com.gyee.runeconomy.service.goodness;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.vo.benchmark.DataVo;
+import com.gyee.runeconomy.dto.EchartDataVo;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.ProBasicEquipmentPoint;
+import com.gyee.runeconomy.model.auto.ProEconWindturbineGoodness;
+import com.gyee.runeconomy.service.auto.IProEconWindturbineGoodnessService;
+import com.gyee.runeconomy.util.DateUtils;
+import com.gyee.runeconomy.util.StringUtils;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @ClassName : WindturbinegoodnessService
+ * @Author : xieshengjie
+ * @Date: 2021/2/20 20:35
+ * @Description : 单机性能总览service
+ */
+@Service
+public class WindturbinegoodnessService {
+    @Resource
+    private IProEconWindturbineGoodnessService proEconWindturbineGoodnessService;
+
+    @Resource
+    private IEdosUtil edosUtil;
+
+    public Page<ProEconWindturbineGoodness> windturbinegoodnessList(Integer pageNum, Integer pageSize, String wpId, String recorddate) {
+
+        if(StringUtils.empty(pageNum))
+        {
+            pageNum=1;
+        }
+        if(StringUtils.empty(pageSize))
+        {
+            pageSize=10;
+        }
+        //构造分页构造器
+        Page<ProEconWindturbineGoodness> pageInfo = new Page<>(pageNum, pageSize);
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate))
+        {
+            Date date= DateUtils.parseDate(recorddate);
+
+
+            if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate)) {
+
+                //构造条件构造器
+                LambdaQueryWrapper<ProEconWindturbineGoodness> queryWrapper = new LambdaQueryWrapper<>();
+                //添加过滤条件
+                queryWrapper.eq(ProEconWindturbineGoodness::getWindtpowerstationId, wpId).
+                        eq(ProEconWindturbineGoodness::getRecordDate, date);
+                //执行查询
+                proEconWindturbineGoodnessService.page(pageInfo, queryWrapper);
+
+            }
+        }
+
+        return pageInfo;
+    }
+
+    /**
+     * 初始化折线图数据
+     *
+     * @return
+     */
+
+    public List<DataVo> findWtRealPowerChar(String wtId, Date recorddate) throws Exception {
+        List<DataVo> vos = new ArrayList<DataVo>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(recorddate, 1)) + " 01:00:00");
+        Date beginDate = sdfs.parse(sdf.format(recorddate) + " 00:00:00");
+
+        int length = 25;
+        for (int i = 0; i < length; i++) {
+            DataVo vo = new DataVo();
+
+            vo.setValue1(0.0);// 实发功率
+            vo.setValue2(0.0);// 保证功率
+            vo.setValue3(0.0);// 风速
+            vo.setValue4(0.0);// 状态
+            vos.add(vo);
+        }
+
+        Map<String, ProBasicEquipmentPoint> wtpointmap = CacheContext.wtpAimap.get(wtId);
+
+        ProBasicEquipmentPoint sjgl = wtpointmap.get(ContantXk.CJ_SSGL);
+        ProBasicEquipmentPoint bzgl = wtpointmap.get(ContantXk.ZSGL);
+        ProBasicEquipmentPoint pjfs = wtpointmap.get(ContantXk.CJ_SSFS);
+
+
+       // WindTurbineTestingPointAi2 fs = map.get(ContantXk.TPOINT_WT_PJFS);
+
+        if (null != sjgl) {
+            List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+            if(!sjglls.isEmpty())
+            {
+                int count = 0;
+                double temp = 0;
+                for (int i = 0; i < vos.size(); i++) {
+                    vos.get(i).setTime(sjglls.get(i ).getPointTime() * 1000);
+
+                    if (i < sjglls.size() && StringUtils.notEmp(sjglls.get(i ).getPointTime())) {
+
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+                            temp = sjglls.get(i ).getPointValueInDouble();
+                            if (Math.abs(temp) < 10000) {
+                                vos.get(i).setValue1(StringUtils.round(temp, 2));// 实际功率
+                            }
+
+                            count++;
+                        } else {
+                            vos.get(i).setValue1(0d);// 实际功率
+                        }
+
+                    }
+                }
+            }
+
+
+        }
+
+        if (null != bzgl) {
+            List<PointData> bzglls = edosUtil.getHistoryDatasSnap(bzgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+            if(!bzglls.isEmpty())
+            {
+                int count = 0;
+                double temp = 0;
+                for (int i = 0; i < vos.size(); i++) {
+                    // vos.get(i).setTime(bzglls.get(i).getPointTime() * 1000);
+                    if (i < bzglls.size() && StringUtils.notEmp(bzglls.get(i ).getPointTime())) {
+
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+                            temp = bzglls.get(i ).getPointValueInDouble();
+                            if (Math.abs(temp) < 10000) {
+                                vos.get(i).setValue2(StringUtils.round(temp, 2));// 保证功率
+                            }
+
+                            count++;
+                        } else {
+                            vos.get(i).setValue2(0d);// 保证功率
+                        }
+
+                    }
+                }
+            }
+
+
+        }
+
+        if (null != pjfs) {
+            List<PointData> pjfsls = edosUtil.getHistoryDatasSnap(pjfs, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+            if(!pjfsls.isEmpty())
+            {
+                int count = 0;
+                double temp = 0;
+                for (int i = 0; i < vos.size(); i++) {
+                    vos.get(i).setTime(pjfsls.get(i ).getPointTime() * 1000);
+                    if (i < pjfsls.size() && StringUtils.notEmp(pjfsls.get(i ).getPointTime())) {
+
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+                            temp = pjfsls.get(i ).getPointValueInDouble();
+                            vos.get(i).setValue3(StringUtils.round(temp, 2));// 风速
+                            count++;
+                        } else {
+                            vos.get(i).setValue3(0d);// 实际功率
+                        }
+
+                    }
+                }
+
+            }
+
+        }
+
+
+        return vos;
+    }
+    public List<List<EchartDataVo>> getplotBands(String wtId, Date recorddate) throws Exception {
+
+        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
+        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+        Calendar c = Calendar.getInstance();
+        c.setTime(recorddate);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.set(Calendar.MILLISECOND,0);
+
+
+        Date beginDate = c.getTime();
+        c.add(Calendar.DAY_OF_MONTH, 1);
+        Date endDate = c.getTime();
+
+
+
+        List<String> xtime=new ArrayList<>();
+        List<EchartDataVo> vos=new ArrayList<>();
+        List<List<EchartDataVo>> resultvos=new ArrayList<>();
+        Map<String,String> map=new HashMap<>();
+        int length = 240;
+        String plotBands = null;
+        StringBuilder sb = new StringBuilder("");
+        
+        Map<String, ProBasicEquipmentPoint> wtpointmap = CacheContext.wtpAimap.get(wtId);
+        ProBasicEquipmentPoint fjzt = wtpointmap.get(ContantXk.SBZT);
+
+        String beginTime=null;
+        String endTime=null;
+        String time=null;
+
+            if (null != fjzt) {
+                List<PointData> fjztls = edosUtil.getHistoryDatasSnap(fjzt, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 360L);
+
+
+                int zt = 0;
+                for (int i = 0; i < fjztls.size(); i++) {
+                    if (i < fjztls.size()) {
+
+                        PointData pd=fjztls.get(i);
+                        int zttemp = Double.valueOf(pd.getPointValueInDouble()).intValue();
+                        Date resultDate = new Date(pd.getPointTime() * 1000);
+                        beginTime = sdf.format(resultDate);
+                        time=sdf2.format(resultDate);
+                        xtime.add(beginTime);
+                        if (i == 0) {
+                            zt = zttemp;
+                            EchartDataVo vo = new EchartDataVo();
+                            vo.setxAxis(beginTime);
+                            vo.setTime1(time);
+                            vo.setName(judgeSatte(zttemp));
+
+                            EchartDataVo.ItemStyle item= vo.new ItemStyle();
+                            item.setColor(judgeColor(zttemp));
+                            vo.setItemStyle(item);
+
+                            vos.add(vo);
+                        } else {
+                            if (zt != zttemp) {
+                                zt = zttemp;
+                                c = Calendar.getInstance();
+                                c.setTime(resultDate);
+//                                c.add(Calendar.MINUTE, -6);
+                                endTime = sdf.format(c.getTime());
+                                time=sdf2.format(c.getTime());
+
+                                vos.get(0).setTime2(time);
+                                EchartDataVo vo = new EchartDataVo();
+                                vo.setxAxis(endTime);
+                                vos.add(vo);
+
+
+                                if (vos.size() == 2) {
+                                    resultvos.add(vos);
+                                    vos = new ArrayList<>();
+                                    vo = new EchartDataVo();
+                                    vo.setxAxis(beginTime);
+                                    vo.setTime1(sdf2.format(resultDate));
+                                    vo.setName(judgeSatte(zttemp));
+                                    EchartDataVo.ItemStyle item= vo.new ItemStyle();
+                                    item.setColor(judgeColor(zttemp));
+                                    vo.setItemStyle(item);
+                                    vos.add(vo);
+                                }
+                            }else if(i==fjztls.size()-1)
+                            {
+                                zt = zttemp;
+                                c = Calendar.getInstance();
+                                c.setTime(resultDate);
+//                                c.add(Calendar.MINUTE, -6);
+                                endTime = sdf.format(c.getTime());
+                                time=sdf2.format(c.getTime());
+
+                                vos.get(0).setTime2(time);
+                                EchartDataVo vo = new EchartDataVo();
+                                vo.setxAxis(endTime);
+                                vos.add(vo);
+                                resultvos.add(vos);
+                            }
+
+                        }
+
+                    }
+
+                }
+            }
+        return resultvos;
+    }
+
+    private  String judgeSatte(int zt)
+    {
+        String ztname=null;
+        switch ( zt ) {
+            case 0:
+                ztname= "待机";
+                break;
+            case 1:
+                ztname= "运行";
+                break;
+            case 2:
+                ztname= "故障";
+                break;
+            case 3:
+                ztname= "检修";
+                break;
+            case 4:
+                ztname= "限电";
+                break;
+            case 5:
+                ztname= "受累";
+                break;
+            case 6:
+                ztname= "中断";
+                break;
+            default:
+
+        }
+        return ztname;
+    }
+//    运行 #08FCF0 待机 #34A90A  维护 #FD7D1C 故障 #FD0100 限电 #D201D8 离线 #A6A6A6
+    private  String judgeColor(int zt)
+    {
+        String ztname=null;
+        switch ( zt ) {
+            case 0:
+                ztname= "#BFFFDF";
+                break;
+            case 1:
+                ztname= "#E7FFFF";
+                break;
+            case 2:
+                ztname= "#FFBFBF";
+                break;
+            case 3:
+                ztname= "#FFDFBF";
+                break;
+            case 4:
+                ztname= "#FFDFFF";
+                break;
+            case 5:
+                ztname= "#FFDFFF";
+                break;
+            case 6:
+                ztname= "#DDDDDD";
+                break;
+            default:
+
+        }
+        return ztname;
+    }
+
+    public Map<String, String> getPlotBand(String wtId , String begin, String end) throws Exception {
+
+        Map<String, ProBasicEquipmentPoint> wtpointmap = CacheContext.wtpAimap.get(wtId);
+        ProBasicEquipmentPoint fdlAi =wtpointmap.get(ContantXk.RFDL);
+        ProBasicEquipmentPoint fsAi = wtpointmap.get(ContantXk.CJ_SSFS);
+        ProBasicEquipmentPoint llfdlAi =wtpointmap.get(ContantXk.RLLFDL);
+        ProBasicEquipmentPoint glAi = wtpointmap.get(ContantXk.CJ_SSGL);
+        ProBasicEquipmentPoint fjztAi =wtpointmap.get(ContantXk.SBZT);
+
+        Date begindate=DateUtils.parseDate1(begin);
+        Date enddate=DateUtils.parseDate1(end);
+        Map<String, String> tempmap = new HashMap<String, String>();
+
+        // 发电量
+        double beginfdl = 0.0;
+        double endfdl = 0.0;
+        double fdl = 0.0;
+
+//        String[] id=new String[1];
+//        DNAVal[] val= edosUtil.getHistMatrix(id,begindate.getTime() / 1000);
+//        beginfdl=val[0].DValue;
+//        val= edosUtil.getHistMatrix(id,enddate.getTime() / 1000);
+//        endfdl=val[0].DValue;
+        List<PointData> beginfdlls = edosUtil.getHistoryDatasSnap(fdlAi,
+                begindate.getTime() / 1000, begindate.getTime() / 1000,
+                (long) 1, 3600L);
+        if (!beginfdlls.isEmpty()) {
+            beginfdl = beginfdlls.get(0).getPointValueInDouble();
+        }
+        List<PointData> endfdlls = edosUtil.getHistoryDatasSnap(fdlAi,
+                enddate.getTime() / 1000, enddate.getTime() / 1000, (long) 1,
+                3600L);
+        if (!endfdlls.isEmpty()) {
+            endfdl = endfdlls.get(0).getPointValueInDouble();
+        }
+        fdl = endfdl - beginfdl;
+
+        tempmap.put("fdl", String.valueOf(StringUtils.round(fdl, 2)));
+        // 理论电量
+        double beginllfdl = 0.0;
+        double endllfdl = 0.0;
+        double llfdl = 0.0;
+        List<PointData> beginllfdls = edosUtil.getHistoryDatasSnap(llfdlAi,
+                begindate.getTime() / 1000, begindate.getTime() / 1000,
+                (long) 1, 3600L);
+        if (!beginllfdls.isEmpty()) {
+            beginllfdl = beginllfdls.get(0).getPointValueInDouble();
+        }
+        List<PointData> endllfdls = edosUtil.getHistoryDatasSnap(llfdlAi,
+                enddate.getTime() / 1000, enddate.getTime() / 1000, (long) 1,
+                3600L);
+        if (!endllfdls.isEmpty()) {
+            endllfdl = endllfdls.get(0).getPointValueInDouble();
+        }
+        llfdl = endllfdl - beginllfdl;
+        // llfdl=new BigDecimal(llfdl).multiply(new
+        // BigDecimal(10000)).doubleValue();
+
+        tempmap.put("llfdl", String.valueOf(StringUtils.round(llfdl, 2)));
+
+        // 风机状态
+        int fjzt = 0;
+        List<PointData> fjztls = edosUtil.getHistoryDatasSnap(fjztAi,
+                begindate.getTime() / 1000, enddate.getTime() / 1000, (long) 1,
+                3600L);
+        if (!fjztls.isEmpty()) {
+            fjzt =  Double.valueOf(fjztls.get(0).getPointValueInDouble()).intValue();
+
+            tempmap.put("fjzt", judgeSatte(fjzt));
+
+        }
+
+        // 风速
+        double fs = 0.0;
+        Double time1 = new BigDecimal(DateUtils.minutesDiff(begindate, enddate))
+                .divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN)
+                .doubleValue();
+
+        List<PointData> fsls = edosUtil.getHistoryDatasSnap(fsAi,
+                begindate.getTime() / 1000, enddate.getTime() / 1000,
+                (long) time1.longValue(), 3600L);
+        if (!fsls.isEmpty()) {
+            for (PointData po : fsls) {
+                fs = fs + po.getPointValueInDouble();
+            }
+            if (time1 == 0) {
+                time1 = 1.0;
+            }
+            double fstemp = new BigDecimal(fs).divide(
+                    new BigDecimal(time1.doubleValue()), 2,
+                    RoundingMode.HALF_EVEN).doubleValue();
+            tempmap.put("fs", String.valueOf(StringUtils.round(fstemp, 2)));
+        }
+        // 功率
+        double gl = 0.0;
+        Double time2 = new BigDecimal(DateUtils.minutesDiff(begindate, enddate))
+                .divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN)
+                .doubleValue();
+        List<PointData> glls = edosUtil.getHistoryDatasSnap(glAi,
+                begindate.getTime() / 1000, enddate.getTime() / 1000,
+                (long) time2.longValue(), 3600L);
+        if (!glls.isEmpty()) {
+            for (PointData po : glls) {
+                gl = gl + po.getPointValueInDouble();
+            }
+            if (time2 == 0) {
+                time2 = 1.0;
+            }
+            double gltemp = new BigDecimal(gl).divide(
+                    new BigDecimal(time2.doubleValue()), 2,
+                    RoundingMode.HALF_EVEN).doubleValue();
+            tempmap.put("gl", String.valueOf(StringUtils.round(gltemp, 2)));
+        }
+        // 时长
+        tempmap.put("sc", String.valueOf(StringUtils.round(DateUtils.hoursDiff2(begindate, enddate), 2)));
+
+        // 损失电量
+
+        if (fjzt != 1) {
+            fdl = 0.0;
+            tempmap.put("fdl", "0.0");
+            tempmap.put("gl", "0.0");
+        }
+        tempmap.put("ssdl", String.valueOf(StringUtils.round(llfdl - fdl, 2)));
+        tempmap.put("ks", begin);
+        tempmap.put("js", end);
+        return tempmap;
+    }
+
+    private String getColor(StringBuilder temp, Integer zt) {
+        if (StringUtils.notEmp(zt)) {
+            switch (zt) {
+                case 0:
+                    temp.setLength(0);
+                    temp.append("color: '#BFFFDF',");
+                    break;
+                case 1:
+                    temp.setLength(0);
+                    temp.append("color: '#E7FFFF',");
+                    break;
+                case 2:
+                    temp.setLength(0);
+                    temp.append("color: '#FFBFBF',");
+                    break;
+                case 3:
+                    temp.setLength(0);
+                    temp.append("color: '#DDDDDD',");
+                    break;
+                case 4:
+                    temp.setLength(0);
+                    temp.append("color: '#FFDFBF',");
+                    break;
+                case 5:
+                    temp.setLength(0);
+                    temp.append("color: '#FFDFFF',");
+                    break;
+                case 6:
+                    temp.setLength(0);
+                    temp.append("color: '#FFDFFF',");
+                    break;
+                default:
+                    break;
+            }
+        }
+        return String.valueOf(temp);
+    }
+
+    public List<DataVo> findRealPowerCharBy24(String wtId, Date recorddate) throws Exception {
+        List<DataVo> vos = new ArrayList<DataVo>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(recorddate, 1)) + " 00:0:00");
+        Date beginDate = sdfs.parse(sdf.format(recorddate) + " 00:00:00");
+
+        int length = 24;
+        for (int i = 0; i < length; i++) {
+            DataVo vo = new DataVo();
+
+            vo.setValue1(0.0);// scada发电量
+            vo.setValue2(0.0);// 维护损失
+            vo.setValue3(0.0);// 故障损失
+            vo.setValue4(0.0);// 限电损失
+            vo.setValue5(0.0);// 欠发损失
+            vo.setValue6(0.0);// 风速
+
+            vos.add(vo);
+        }
+        Map<String, ProBasicEquipmentPoint> wtpointmap = CacheContext.wtpAimap.get(wtId);
+
+
+        ProBasicEquipmentPoint fdl =wtpointmap.get(ContantXk.RFDL);
+        ProBasicEquipmentPoint whss =wtpointmap.get(ContantXk.RJXSSDL);
+        ProBasicEquipmentPoint gzss =wtpointmap.get(ContantXk.RGZSSDL);
+        ProBasicEquipmentPoint xdss =wtpointmap.get(ContantXk.RXDTJSSDL);
+        ProBasicEquipmentPoint qfss =wtpointmap.get(ContantXk.RXNSSDL);
+        ProBasicEquipmentPoint fs =wtpointmap.get(ContantXk.CJ_SSFS);
+
+        try {
+            if (null != fdl) {
+                List<PointData> fdlls = edosUtil.getHistoryDatasSnap(fdl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                int count = 0;
+                double temp1 = 0;
+                for (int i = 0; i < length; i++) {
+
+                    if (i < fdlls.size() && StringUtils.notEmp(fdlls.get(i + 1).getPointTime())) {
+                        
+                        vos.get(i).setTime(fdlls.get(i + 1).getPointTime() * 1000);
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+
+                            if (i != 0) {
+                                temp1 = fdlls.get(i + 1).getPointValueInDouble();
+                                double temp2 = fdlls.get(i).getPointValueInDouble();
+                                temp1 = temp1 - temp2;
+                                vos.get(i).setValue1(StringUtils.round(temp1, 2));// 发电量
+
+                            } else {
+                                temp1 = fdlls.get(i + 1).getPointValueInDouble();
+                                vos.get(i).setValue1(StringUtils.round(temp1, 2));// 发电量
+                            }
+                            // temp1 = new BigDecimal(temp1).divide(new
+                            // BigDecimal(10000), 2,
+                            // RoundingMode.HALF_EVEN).doubleValue();
+
+                            // temp1 = new BigDecimal(temp1).divide(
+                            // new BigDecimal(100000), 2,
+                            // RoundingMode.HALF_EVEN).multiply(
+                            // new BigDecimal(100)).doubleValue();
+
+                            count++;
+                        } else {
+                            vos.get(i).setTime(fdlls.get(i).getPointTime() * 1000);
+                            vos.get(i).setValue1(0d);// 发电量
+                        }
+
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        /*
+         * 维护损失
+         */
+        try {
+            if (null != whss) {
+                List<PointData> whssls = edosUtil.getHistoryDatasSnap(whss, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                int count = 0;
+                double temp1 = 0;
+                for (int i = 0; i < length; i++) {
+
+                    if (i < whssls.size() && StringUtils.notEmp(whssls.get(i + 1).getPointTime())) {
+                        
+                        vos.get(i).setTime(whssls.get(i + 1).getPointTime() * 1000);
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+                            if (i != 0) {
+                                temp1 = whssls.get(i + 1).getPointValueInDouble();
+                                double temp2 = whssls.get(i).getPointValueInDouble();
+                                temp1 = temp1 - temp2;
+
+                                // temp1 = new BigDecimal(temp1).divide(new
+                                // BigDecimal(10000), 2,
+                                // RoundingMode.HALF_EVEN).doubleValue();
+                                vos.get(i).setValue2(StringUtils.round(temp1, 2));// 维护损失电量
+
+                                count++;
+
+                            } else {
+                                temp1 = whssls.get(i + 1).getPointValueInDouble();
+                                vos.get(i).setValue2(StringUtils.round(temp1, 2));// 维护损失电量
+                            }
+
+                            // temp1 = new BigDecimal(temp1).divide(
+                            // new BigDecimal(100000), 2,
+                            // RoundingMode.HALF_EVEN).multiply(
+                            // new BigDecimal(100)).doubleValue();
+
+                        } else {
+                            // vos.get(i-1).setTime(whssls.get(i).getPointTime()*1000);
+                            vos.get(i).setValue2(0d);// 维护损失电量
+                        }
+
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        /*
+         * 故障损失
+         */
+        try {
+            if (null != gzss) {
+                List<PointData> gzssls = edosUtil.getHistoryDatasSnap(gzss, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                int count = 0;
+                double temp1 = 0;
+                for (int i = 0; i < length; i++) {
+
+                    if (i < gzssls.size() && StringUtils.notEmp(gzssls.get(i + 1).getPointTime())) {
+                        
+                        vos.get(i).setTime(gzssls.get(i + 1).getPointTime() * 1000);
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+                            if (i != 0) {
+                                temp1 = gzssls.get(i + 1).getPointValueInDouble();
+                                double temp2 = gzssls.get(i).getPointValueInDouble();
+                                temp1 = temp1 - temp2;
+
+                                // temp1 = new BigDecimal(temp1).divide(new
+                                // BigDecimal(10000), 2,
+                                // RoundingMode.HALF_EVEN).doubleValue();
+
+                                // temp1 = new BigDecimal(temp1).divide(
+                                // new BigDecimal(100000), 2,
+                                // RoundingMode.HALF_EVEN).multiply(
+                                // new BigDecimal(100)).doubleValue();
+
+                                vos.get(i).setValue3(StringUtils.round(temp1, 2));// 维护损失电量
+
+                                count++;
+
+                            } else {
+                                temp1 = gzssls.get(i + 1).getPointValueInDouble();
+                                vos.get(i).setValue3(StringUtils.round(temp1, 2));// 维护损失电量
+                            }
+
+                        } else {
+                            // vos.get(i-1).setTime(gzssls.get(i).getPointTime()*1000);
+                            vos.get(i).setValue3(0d);// 维护损失电量
+                        }
+
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        /*
+         * 限电损失
+         */
+        try {
+            if (null != xdss) {
+                List<PointData> xdssls = edosUtil.getHistoryDatasSnap(xdss, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                int count = 0;
+                double temp1 = 0;
+                for (int i = 0; i < length; i++) {
+
+                    if (i < xdssls.size() && StringUtils.notEmp(xdssls.get(i + 1).getPointTime())) {
+                        
+                        vos.get(i).setTime(xdssls.get(i + 1).getPointTime() * 1000);
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+                            if (i != 0) {
+                                temp1 = xdssls.get(i + 1).getPointValueInDouble();
+                                double temp2 = xdssls.get(i).getPointValueInDouble();
+                                temp1 = temp1 - temp2;
+
+                                // temp1 = new BigDecimal(temp1).divide(new
+                                // BigDecimal(10000), 2,
+                                // RoundingMode.HALF_EVEN).doubleValue();
+
+                                // temp1 = new BigDecimal(temp1).divide(
+                                // new BigDecimal(100000), 2,
+                                // RoundingMode.HALF_EVEN).multiply(
+                                // new BigDecimal(100)).doubleValue();
+
+                                vos.get(i).setValue4(StringUtils.round(temp1, 2));// 限电损失电量
+
+                                count++;
+
+                            } else {
+                                temp1 = xdssls.get(i + 1).getPointValueInDouble();
+                                vos.get(i).setValue4(StringUtils.round(temp1, 2));// 限电损失电量
+                            }
+
+                        } else {
+                            // vos.get(i).setTime(xdssls.get(i).getPointTime()*1000);
+                            vos.get(i).setValue4(0d);// 限电损失电量
+                        }
+
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        /*
+         * 欠发损失
+         */
+        try {
+            if (null != qfss) {
+                List<PointData> qfssls = edosUtil.getHistoryDatasSnap(qfss, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                int count = 0;
+                double temp1 = 0;
+                for (int i = 0; i < length; i++) {
+
+                    if (i < qfssls.size() && StringUtils.notEmp(qfssls.get(i + 1).getPointTime())) {
+
+                        vos.get(i).setTime(qfssls.get(i + 1).getPointTime() * 1000);
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+                            if (i != 0) {
+                                temp1 = qfssls.get(i + 1).getPointValueInDouble();
+                                double temp2 = qfssls.get(i).getPointValueInDouble();
+                                temp1 = temp1 - temp2;
+
+                                // temp1 = new BigDecimal(temp1).divide(new
+                                // BigDecimal(10000), 2,
+                                // RoundingMode.HALF_EVEN).doubleValue();
+
+                                // temp1 = new BigDecimal(temp1).divide(
+                                // new BigDecimal(100000), 2,
+                                // RoundingMode.HALF_EVEN).multiply(
+                                // new BigDecimal(100)).doubleValue();
+
+                                vos.get(i).setValue5(StringUtils.round(temp1, 2));// 欠发损失电量
+
+                                count++;
+
+                            } else {
+                                temp1 = qfssls.get(i + 1).getPointValueInDouble();
+                                vos.get(i).setValue5(StringUtils.round(temp1, 2));// 欠发损失电量
+                            }
+
+                        } else {
+                            // vos.get(i-1).setTime(qfssls.get(i).getPointTime()*1000);
+                            vos.get(i).setValue5(0d);// 欠发损失电量
+                        }
+
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        /*
+         * 风速
+         */
+        try {
+            if (null != fs) {
+                List<PointData> fsls = edosUtil.getHistoryDatasSnap(fs, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
+
+                int count = 0;
+                double temp1 = 0;
+                for (int i = 0; i < 24; i++) {
+
+                    if (i < fsls.size() && StringUtils.notEmp(fsls.get(i + 1).getPointTime())) {
+                        
+                        vos.get(i).setTime(fsls.get(i + 1).getPointTime() * 1000);
+                        if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
+
+                            temp1 = fsls.get(i + 1).getPointValueInDouble();
+                            // double temp2
+                            // =fsls.get(i-1).getPointValueInDouble();
+                            // temp1=temp1-temp2;
+
+                            // temp1 = new BigDecimal(temp1).divide(new
+                            // BigDecimal(1), 2,
+                            // RoundingMode.HALF_EVEN).doubleValue();
+
+                            // temp1 = new BigDecimal(temp1).divide(
+                            // new BigDecimal(100000), 2,
+                            // RoundingMode.HALF_EVEN).multiply(
+                            // new BigDecimal(100)).doubleValue();
+
+                            vos.get(i).setValue6(StringUtils.round(temp1, 2));// 风速
+                            count++;
+
+                            // else
+                            // {
+                            // temp1 = qfssls.get(i).getPointValueInDouble();
+                            // }
+
+                        } else {
+                            // vos.get(i-1).setTime(qfssls.get(i).getPointTime()*1000);
+                            vos.get(i).setValue6(0d);// 风速
+                        }
+
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        // ////////////////////////////////////////////////
+
+        return vos;
+    }
+}

+ 103 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/outputspeed/OutputSpeedService.java

@@ -0,0 +1,103 @@
+package com.gyee.runeconomy.service.outputspeed;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.runeconomy.model.auto.ProEconInOrOutSpeedTotal;
+import com.gyee.runeconomy.service.auto.IProEconInOrOutSpeedTotalService;
+import com.gyee.runeconomy.util.DateUtils;
+import com.gyee.runeconomy.util.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+@Service
+public class OutputSpeedService {
+
+    @Resource
+    private IProEconInOrOutSpeedTotalService proEconInOrOutSpeedTotalService;
+
+    public Page<ProEconInOrOutSpeedTotal> outputSpeedlist(Integer pageNum, Integer pageSize, String wpId, String recorddate) {
+
+        if(StringUtils.empty(pageNum))
+        {
+            pageNum=1;
+        }
+        if(StringUtils.empty(pageSize))
+        {
+            pageSize=10;
+        }
+        //构造分页构造器
+        Page<ProEconInOrOutSpeedTotal> pageInfo = new Page<>(pageNum, pageSize);
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate))
+        {
+            Date date= DateUtils.parseDate(recorddate);
+
+
+            if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate)) {
+
+                //构造条件构造器
+                LambdaQueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new LambdaQueryWrapper<>();
+                //添加过滤条件
+                queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).
+                        eq(ProEconInOrOutSpeedTotal::getRecordDate, date);
+                //执行查询
+                proEconInOrOutSpeedTotalService.page(pageInfo, queryWrapper);
+
+            }
+        }
+
+        return pageInfo;
+
+    }
+
+
+    public Page<ProEconInOrOutSpeedTotal> outputspeedhistorylist(Integer pageNum, Integer pageSize, String wpId, String wtId, String beginDate, String endDate) {
+
+
+        if(StringUtils.empty(pageNum))
+        {
+            pageNum=1;
+        }
+        if(StringUtils.empty(pageSize))
+        {
+            pageSize=10;
+        }
+        //构造分页构造器
+        Page<ProEconInOrOutSpeedTotal> pageInfo = new Page<>(pageNum, pageSize);
+
+
+
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) &&  StringUtils.notEmp(endDate))
+        {
+
+            Date begin=DateUtils.parseDate(beginDate);
+            Date end=DateUtils.parseDate(endDate);
+
+            //构造条件构造器
+            LambdaQueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new LambdaQueryWrapper<>();
+            //添加过滤条件
+            if(StringUtils.notEmp(wtId))
+            {
+                queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).
+                        eq(ProEconInOrOutSpeedTotal::getWindturbineId,wtId).
+                        ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
+                        le(ProEconInOrOutSpeedTotal::getRecordDate,end);
+            }else
+            {
+                queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).
+                        ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
+                        le(ProEconInOrOutSpeedTotal::getRecordDate,end);
+            }
+
+            //执行查询
+            proEconInOrOutSpeedTotalService.page(pageInfo, queryWrapper);
+
+
+        }
+
+        return pageInfo;
+
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1094 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/singleanalysis/SingleAnalysisService.java