|
@@ -1,5 +1,6 @@
|
|
|
package com.gyee.runeconomy.controller.goodness;
|
|
|
|
|
|
+import cn.hutool.core.util.NumberUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.gyee.common.util.DateUtils;
|
|
|
import com.gyee.common.vo.benchmark.ValueVo;
|
|
@@ -22,6 +23,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -67,6 +71,11 @@ public class WindturbineGoodnessDetailController {
|
|
|
if (StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate)) {
|
|
|
|
|
|
Date date = DateUtils.parseDate(recorddate);
|
|
|
+ LocalDate localDate = LocalDate.parse(recorddate, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
+ LocalDate firstOfMonth = localDate.withDayOfMonth(1);
|
|
|
+ Date firstDayOfMonth = Date.from(firstOfMonth.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
|
|
+ LocalDate localdate2 = localDate.withDayOfYear(1);
|
|
|
+ Date firstDayOfYear = Date.from(localdate2.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
|
|
QueryWrapper<ProEconWtAlysisDay> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("record_date", date).eq("windturbine_id", wtId);
|
|
|
List<ProEconWtAlysisDay> wtadls = proEconWtAlysisDayService.list(queryWrapper);
|
|
@@ -79,11 +88,44 @@ public class WindturbineGoodnessDetailController {
|
|
|
QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
|
|
|
qw.lambda().eq(TurbineInfoDay::getRecordDate, date).eq(TurbineInfoDay::getTurbineId, wtId);
|
|
|
List<TurbineInfoDay> turbineInfoDays = turbineInfoDayService.list(qw);
|
|
|
+
|
|
|
+ TurbineInfoDay ytb = turbineInfoDayService.getTurbineSingle(wtId, firstDayOfMonth, date);
|
|
|
+ TurbineInfoDay ntb = turbineInfoDayService.getTurbineSingle(wtId, firstDayOfYear, date);
|
|
|
+
|
|
|
TurbineInfoDay tb = turbineInfoDays.get(0);
|
|
|
- wtday.setRfdl(Math.round((tb.getRfdl() / 1000) * 100.0) / 100.0);
|
|
|
- wtday.setRyfdl(Math.round((tb.getLlfdl() / 1000) * 100.0) / 100.0);
|
|
|
- wtday.setNpjfs(tb.getPjfs());
|
|
|
+ wtday.setRfdl(NumberUtil.round(tb.getRfdl() / 1000, 2).doubleValue());
|
|
|
+ wtday.setRyfdl(NumberUtil.round(tb.getLlfdl() / 1000, 2).doubleValue());
|
|
|
+ wtday.setRpjfs(NumberUtil.round(tb.getPjfs(), 2).doubleValue());
|
|
|
+ wtday.setRyxxs(NumberUtil.round(tb.getYxMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setRjxxs(NumberUtil.round(tb.getTjMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setRgzxs(NumberUtil.round(tb.getGzMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setRdjxs(NumberUtil.round(tb.getDjMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setRzdxs(NumberUtil.round(tb.getLxMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setRyxfs(NumberUtil.round(tb.getYxfss(), 2).doubleValue());
|
|
|
+ wtday.setRssdl(NumberUtil.round((tb.getGzss() + tb.getSlss() + tb.getXdss() + tb.getJhjxss() + tb.getFjhjxss() + tb.getXnss()) / 1000, 2).doubleValue());
|
|
|
+ wtday.setRtjcs(NumberUtil.round(tb.getTjcs(), 2).doubleValue());
|
|
|
+ wtday.setRsbklyl(NumberUtil.round(tb.getKlyl(), 2).doubleValue());
|
|
|
+ wtday.setRpjwd(NumberUtil.round(tb.getHjwd(), 2).doubleValue());
|
|
|
+ wtday.setYfdl(NumberUtil.round(ytb.getRfdl() / 1000, 2).doubleValue());
|
|
|
+ wtday.setYyfdl(NumberUtil.round(ytb.getLlfdl() / 1000, 2).doubleValue());
|
|
|
+ wtday.setYpjfs(NumberUtil.round(ytb.getPjfs(), 2).doubleValue());
|
|
|
+ wtday.setYyxxs(NumberUtil.round(ytb.getYxMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setYdjxs(NumberUtil.round(ytb.getTjMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setYgzxs(NumberUtil.round(ytb.getGzMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setYjxxs(NumberUtil.round(ytb.getJxMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setYzdxs(NumberUtil.round(ytb.getLxMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setYyxfs(NumberUtil.round(ytb.getYxfss(), 2).doubleValue());
|
|
|
+ wtday.setYtjcs(NumberUtil.round(ytb.getTjcs(), 2).doubleValue());
|
|
|
+ wtday.setNfdl(NumberUtil.round(ntb.getRfdl() / 1000, 2).doubleValue());
|
|
|
+ wtday.setNyfdl(NumberUtil.round(ntb.getLlfdl() / 1000, 2).doubleValue());
|
|
|
+ wtday.setNpjfs(NumberUtil.round(ntb.getPjfs(), 2).doubleValue());
|
|
|
+ wtday.setNyxxs(NumberUtil.round(ntb.getYxMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setNgzxs(NumberUtil.round(ntb.getGzMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setNjxxs(NumberUtil.round(ntb.getJxMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setNzdxs(NumberUtil.round(ntb.getTjMin() / 60, 2).doubleValue());
|
|
|
+ wtday.setNyxfs(NumberUtil.round(ntb.getYxfss(), 2).doubleValue());
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if (null != wtday) {
|
|
|
return R.data(ResultMsg.ok(wtday));
|