wangb пре 5 дана
родитељ
комит
eac5764192

+ 1 - 0
generationXK-service/src/main/java/com/gyee/generation/service/WpwindDayInfoService.java

@@ -1397,6 +1397,7 @@ public class WpwindDayInfoService {
                 pepid1ls = proEconWpwindDayInfoService.list(queryWrapper2);
             } else {
                 setInfoYear(pewp);
+                return;
             }
         }
         ProEconWpwindDayInfo pepid = pepid1ls.get(0);

+ 2 - 1
generationXK-service/src/main/java/com/gyee/generation/service/WtwindDayInfoService.java

@@ -1427,9 +1427,10 @@ public class WtwindDayInfoService {
                 pepid1ls = proEconWtwindDayInfoService.list(queryWrapper2);
             } else {
                 setInfoYear(pewp);
+                return;
             }
-
         }
+
         ProEconWtwindDayInfo pepid = pepid1ls.get(0);
         //年静风次数
         pewp.setCf(pewp.getCa() + pepid.getCf());

+ 16 - 16
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java

@@ -1612,14 +1612,14 @@ public class EconomyPointHomePageService {
             hv.setFnlyl("0.00");
         } else {
             List<TurbineInfoDay> currentResults = getFnlyl("AVG(fnlyl) AS fnlyl", nowStart, nowEnd);
-            hv.setFnlyl(String.format("%.2f", currentResults.get(0).getFnlyl()));
+            hv.setFnlyl(String.valueOf(NumberUtil.round(currentResults.get(0).getFnlyl(), 2).doubleValue()));
         }
         List<TurbineInfoDay> lastYearResults1 = getFnlyl("*", lastYearStartDate, lastYearEndDate);
         if (null == lastYearResults1 || lastYearResults1.isEmpty()) {
             hv.setYearTq("0.00");
         } else {
             List<TurbineInfoDay> lastYearResults = getFnlyl("AVG(fnlyl) AS fnlyl", lastYearStartDate, lastYearEndDate);
-            hv.setYearTq(String.format("%.2f", lastYearResults.get(0).getFnlyl()));
+            hv.setYearTq(String.valueOf(NumberUtil.round(lastYearResults.get(0).getFnlyl(), 2).doubleValue()));
         }
         if (Double.parseDouble(hv.getFnlyl()) == 0 && Double.parseDouble(hv.getYearTq()) == 0) {
             hv.setOperation("0.00");
@@ -1629,7 +1629,7 @@ public class EconomyPointHomePageService {
             hv.setOperation("-100");
         } else {
             Double operation = calDivide(Double.parseDouble(hv.getFnlyl()) - Double.parseDouble(hv.getYearTq()), Double.valueOf(hv.getYearTq()));
-            hv.setOperation(String.valueOf(operation));
+            hv.setOperation(String.valueOf(NumberUtil.round(operation * 100, 2).doubleValue()));
         }
         ls2.add(hv);
 
@@ -1648,14 +1648,14 @@ public class EconomyPointHomePageService {
             hv2.setFnlyl("0.00");
         } else {
             List<TurbineInfoDay> currentSbResults = getFnlyl("AVG(klyl) AS klyl", nowStart, nowEnd);
-            hv2.setFnlyl(String.format("%.2f", currentSbResults.get(0).getKlyl()));
+            hv2.setFnlyl(String.valueOf(NumberUtil.round(currentSbResults.get(0).getKlyl(), 2).doubleValue()));
         }
         List<TurbineInfoDay> lastYearQwSb1 = getFnlyl("*", lastYearStartDate, lastYearEndDate);
         if (null == lastYearQwSb1 || lastYearQwSb1.isEmpty()) {
             hv2.setYearTq("0.00");
         } else {
             List<TurbineInfoDay> lastYearQwSb = getFnlyl("AVG(klyl) AS klyl", lastYearStartDate, lastYearEndDate);
-            hv2.setYearTq(String.format("%.2f", lastYearQwSb.get(0).getKlyl()));
+            hv2.setYearTq(String.valueOf(NumberUtil.round(lastYearQwSb.get(0).getKlyl(), 2).doubleValue()));
         }
         if (Double.parseDouble(hv2.getFnlyl()) == 0 && Double.parseDouble(hv2.getYearTq()) == 0) {
             hv2.setOperation("0.00");
@@ -1665,7 +1665,7 @@ public class EconomyPointHomePageService {
             hv2.setOperation("-100");
         } else {
             Double aDouble1 = calDivide(Double.parseDouble(hv2.getFnlyl()) - Double.parseDouble(hv2.getYearTq()), Double.valueOf(hv2.getYearTq()));
-            hv2.setOperation(String.valueOf(aDouble1));
+            hv2.setOperation(String.valueOf(NumberUtil.round(aDouble1 * 100, 2).doubleValue()));
         }
         ls4.add(hv2);
         sbklyl.put("data", ls4);
@@ -1709,29 +1709,29 @@ public class EconomyPointHomePageService {
         Map<String, Object> allmap = new HashMap<>();
         PlanDataVo pd = new PlanDataVo();
         Double week = weekFdlCal();
-        pd.setZfdlsj(NumberUtil.round(week,2).doubleValue());
+        pd.setZfdlsj(NumberUtil.round(week, 2).doubleValue());
         String s = year + "-" + month;
         BigDecimal monCache = yfdlCal.get(s);
 //        pd.setYfdlsj(monCache.add(new BigDecimal(rfdl)).doubleValue());
-        pd.setYfdlsj(NumberUtil.round(monCache.add(new BigDecimal(rfdl)).doubleValue(),2).doubleValue());
+        pd.setYfdlsj(NumberUtil.round(monCache.add(new BigDecimal(rfdl)).doubleValue(), 2).doubleValue());
         BigDecimal yearCache = nfdlCal.get(year);
 //        pd.setNfdlsj(yearCache.add(new BigDecimal(rfdl)).doubleValue());
-        pd.setNfdlsj(NumberUtil.round(yearCache.add(new BigDecimal(rfdl)).doubleValue(),2).doubleValue());
+        pd.setNfdlsj(NumberUtil.round(yearCache.add(new BigDecimal(rfdl)).doubleValue(), 2).doubleValue());
 
         //计划发电量
         pd.setZfdljh(NumberUtil.round(yjh / 4, 0).doubleValue());
         pd.setYfdljh(NumberUtil.round(yjh, 0).doubleValue());
         double zjd = calDivide(pd.getZfdlsj(), pd.getZfdljh());
-        pd.setZjd(NumberUtil.round(zjd * 100,2).doubleValue());
-        pd.setZwcl(NumberUtil.round(zjd,2).doubleValue());
+        pd.setZjd(NumberUtil.round(zjd * 100, 2).doubleValue());
+        pd.setZwcl(NumberUtil.round(zjd, 2).doubleValue());
         double yjd = calDivide(pd.getYfdlsj(), pd.getYfdljh());
-        pd.setYjd(NumberUtil.round(yjd * 100,2).doubleValue());
-        pd.setYwcl(NumberUtil.round(yjd,2).doubleValue());
+        pd.setYjd(NumberUtil.round(yjd * 100, 2).doubleValue());
+        pd.setYwcl(NumberUtil.round(yjd, 2).doubleValue());
 
         pd.setNfdljh(NumberUtil.round(njh, 0).doubleValue());
         double njd = calDivide(pd.getNfdlsj(), pd.getNfdljh());
-        pd.setNjd(NumberUtil.round(njd * 100,2).doubleValue());
-        pd.setNwcl(NumberUtil.round(njd,2).doubleValue());
+        pd.setNjd(NumberUtil.round(njd * 100, 2).doubleValue());
+        pd.setNwcl(NumberUtil.round(njd, 2).doubleValue());
         allmap.put("planData", pd);
 
         QueryWrapper<TurbineInfoDay> qw2 = new QueryWrapper<>();
@@ -1920,7 +1920,7 @@ public class EconomyPointHomePageService {
         GeneratingCapacityVo rfdl = new GeneratingCapacityVo();
         rfdl.setName("日发电量");
         rfdl.setValue(NumberUtil.round(dayFdl, 2).doubleValue());
-        rfdl.setTotal(NumberUtil.round(dayLlfdl,2).doubleValue());
+        rfdl.setTotal(NumberUtil.round(dayLlfdl, 2).doubleValue());
         Double rbfb = calDivide(dayFdl, dayLlfdl);
         rfdl.setBfb(NumberUtil.round(rbfb * 100, 2).doubleValue());
         ls.add(rfdl);

+ 5 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/singleanalysis/SingleAnalysisService.java

@@ -1619,7 +1619,11 @@ public class SingleAnalysisService {
                 date = yearCurrent + "-" + monthCurrent;
             }
         }
-
+        if (now.getMonthValue() == 1) {
+            yearCurrent = yearCurrent - 1;
+            monthCurrent = 12;
+            date = yearCurrent + "-" + monthCurrent;
+        }
         QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
         qw.lambda().eq(TurbineInfoDay::getTurbineId, wtId)
                 .apply("to_char(record_date,'YYYY-MM')='" + date + "'");

+ 5 - 5
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

@@ -1463,7 +1463,7 @@ public class SpecificService {
         List<TurbineInfoDay> currentList = iTurbineInfoDayService.list(currentqw);
         int subYear = Integer.parseInt(year) - 1;
         QueryWrapper<TurbineInfoDay> sameperiodqw = new QueryWrapper<>();
-        sameperiodqw.select("station_id,max(record_date) record_date,sum(rfdl) as rfdl,sum(llfdl) as llfdl");
+        sameperiodqw.select("station_id,max(record_date) record_date,avg(fnlyl) as fnlyl");
         if (type.equals("-1")) {
             currentqw.like("station_id", "_FDC_");
         } else {
@@ -3557,7 +3557,7 @@ public class SpecificService {
         Date now = new Date();
         //获取年份所有当月的数据
         QueryWrapper<TurbineInfoDay> currentqw = new QueryWrapper<>();
-        currentqw.select("station_id,max(record_date) as record_date,sum(jhjxss) as jhjxss,sum(fjhjxss) as fjhjxss,sum(llfdl) as llfdl");
+        currentqw.select("station_id,max(record_date) as record_date,sum(jhjxss) as jhjxss,sum(llfdl) as llfdl");
         currentqw.eq("to_char(record_date,'yyyy')", year);
         currentqw.like("station_id", "_FDC_");
         currentqw.lt("record_date", now);
@@ -3566,7 +3566,7 @@ public class SpecificService {
 
         int subYear = Integer.parseInt(year) - 1;
         QueryWrapper<TurbineInfoDay> sameperiodqw = new QueryWrapper<>();
-        sameperiodqw.select("station_id,max(record_date) record_date,sum(jhjxss) jhjxss,sum(fjhjxss) fjhjxss,sum(llfdl) llfdl");
+        sameperiodqw.select("station_id,max(record_date) record_date,sum(jhjxss) jhjxss,sum(llfdl) llfdl");
         currentqw.like("station_id", "_FDC_");
         sameperiodqw.eq("to_char(record_date,'yyyy')", String.valueOf(subYear));
         sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),station_id");
@@ -3581,7 +3581,7 @@ public class SpecificService {
             vo.setWpid(wpid);
             vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
             double llfdl = i.getLlfdl() != null ? i.getLlfdl() : 0.0;
-            double rfdl = i.getJhjxss() + i.getFjhjxss() != 0 ? i.getJhjxss() + i.getFjhjxss() : 0.0;
+            double rfdl = i.getJhjxss() != 0 ? i.getJhjxss() : 0.0;
             if (llfdl != 0) {
                 Double calculatedValue = DoubleUtils.keepPrecision(rfdl / llfdl * 100, 2);
                 vo.setCurrent(calculatedValue);
@@ -3600,7 +3600,7 @@ public class SpecificService {
                 TurbineInfoDay tqinfoday = optional.get();
 
                 double llfdl = tqinfoday.getLlfdl() != null ? tqinfoday.getLlfdl() : 0.0;
-                double rfdl = tqinfoday.getJhjxss() != null ? tqinfoday.getJhjxss() + tqinfoday.getFjhjxss() : 0.0;
+                double rfdl = tqinfoday.getJhjxss() != null ? tqinfoday.getJhjxss() : 0.0;
                 if (llfdl != 0) {
                     Double calculatedValue = DoubleUtils.keepPrecision(rfdl / llfdl * 100, 2);
                     i.setSameperiod(calculatedValue);