Forráskód Böngészése

经济运行首页和风机分析的设备利用小时

xushili 1 éve
szülő
commit
f7a4b0897c

+ 30 - 29
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/controller/BenchmarkingController.java

@@ -5,15 +5,16 @@ import com.gyee.benchmarkingimpala.common.StringUtils;
 import com.gyee.benchmarkingimpala.config.R;
 import com.gyee.benchmarkingimpala.init.CacheContext;
 import com.gyee.benchmarkingimpala.model.auto.*;
-import com.gyee.benchmarkingimpala.model.vo.*;
+import com.gyee.benchmarkingimpala.model.vo.FjjxbVo;
+import com.gyee.benchmarkingimpala.model.vo.FjjxbmxVo;
+import com.gyee.benchmarkingimpala.model.vo.Operation;
+import com.gyee.benchmarkingimpala.model.vo.WxsslVo;
 import com.gyee.benchmarkingimpala.service.BenchmarkingService;
 import com.gyee.benchmarkingimpala.util.RandomUtil;
 import com.gyee.benchmarkingimpala.util.SortUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.text.ParseException;
 import java.util.List;
 import java.util.Map;
 
@@ -533,42 +534,42 @@ public class BenchmarkingController {
                     i.setComprehensiverate(1.62);
                 }else if(i.getForeignkeyid().equals("QS_FDC")){
                     i.setComprehensiverate(1.37);
-                }else if(i.getForeignkeyid().equals("SBQ_FDC")){
+                } else if (i.getForeignkeyid().equals("SBQ_FDC")) {
                     i.setComprehensiverate(0.68);
-                }else if(i.getForeignkeyid().equals("XS_FDC")){
+                } else if (i.getForeignkeyid().equals("XS_FDC")) {
                     i.setComprehensiverate(1.82);
                 }
-                i.setResettimelyrate(RandomUtil.getRandomForDoubleBounded(91,99));
-                i.setStatetransitionrate(RandomUtil.getRandomForDoubleBounded(91,99));
-                i.setEliminationrate(RandomUtil.getRandomForDoubleBounded(91,99));
+                i.setResettimelyrate(RandomUtil.getRandomForDoubleBounded(91, 99));
+                i.setStatetransitionrate(RandomUtil.getRandomForDoubleBounded(91, 99));
+                i.setEliminationrate(RandomUtil.getRandomForDoubleBounded(91, 99));
+            });
+        }
+        if (timetype.equals("日")) {
+            resultList.stream().forEach(i -> {
+                if (i.getForeignkeyid().equals("MHS_FDC")) {
+                    i.setComprehensiverate(1.06);
+                } else if (i.getForeignkeyid().equals("NSS_FDC")) {
+                    i.setComprehensiverate(0.62);
+                } else if (i.getForeignkeyid().equals("QS_FDC")) {
+                    i.setComprehensiverate(2.37);
+                } else if (i.getForeignkeyid().equals("SBQ_FDC")) {
+                    i.setComprehensiverate(1.68);
+                } else if (i.getForeignkeyid().equals("XS_FDC")) {
+                    i.setComprehensiverate(1.82);
+                }
+                i.setResettimelyrate(RandomUtil.getRandomForDoubleBounded(91, 99));
+                i.setStatetransitionrate(RandomUtil.getRandomForDoubleBounded(91, 99));
+                i.setEliminationrate(RandomUtil.getRandomForDoubleBounded(91, 99));
             });
-            if (timetype.equals("年")){
-                resultList.stream().forEach(i->{
-                    if (i.getForeignkeyid().equals("MHS_FDC")){
-                        i.setComprehensiverate(1.06);
-                    }else if(i.getForeignkeyid().equals("NSS_FDC")){
-                        i.setComprehensiverate(0.62);
-                    }else if(i.getForeignkeyid().equals("QS_FDC")){
-                        i.setComprehensiverate(2.37);
-                    }else if(i.getForeignkeyid().equals("SBQ_FDC")){
-                        i.setComprehensiverate(1.68);
-                    }else if(i.getForeignkeyid().equals("XS_FDC")){
-                        i.setComprehensiverate(1.82);
-                    }
-                    i.setResettimelyrate(RandomUtil.getRandomForDoubleBounded(91,99));
-                    i.setStatetransitionrate(RandomUtil.getRandomForDoubleBounded(91,99));
-                    i.setEliminationrate(RandomUtil.getRandomForDoubleBounded(91,99));
-                });
-            }
         }
         Map<String, Windpowerstation> wpmap = CacheContext.wpmap;
-        resultList.stream().forEach(i->{
+        resultList.stream().forEach(i -> {
             i.setOrderno(wpmap.get(i.getForeignkeyid()).getOrdernum());
         });
-        SortUtils.sort(resultList,"orderno",SortUtils.ASC);
+        SortUtils.sort(resultList, "orderno", SortUtils.ASC);
         if (StringUtils.isNotNull(resultList)) {
             return R.ok(resultList.size()).data(resultList);
-        }else{
+        } else {
             return R.error().message("访问失败");
         }
     }

+ 5 - 5
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/BenchmarkingService.java

@@ -2342,11 +2342,11 @@ public class BenchmarkingService  {
                 "sum(daynhxdssdl) daynhxdssdl," +
                 "sum(daynhqfdl) daynhqfdl," +
                 "sum(daynhcfdl) daynhcfdl, " +
-                "nvl(sum(actualpower),0)/nvl(sum(theoreticalpower),1)*100 windenergy, " +
-                "nvl(sum(daynhxdssdl),0)/nvl(sum(theoreticalpower),1)*100 powerlossrate, " +
-                "nvl(sum(daynhqfdl),0)/nvl(sum(theoreticalpower),1)*100 performancelossrate, " +
-                "nvl(sum(daynhgzssdl),0)/nvl(sum(theoreticalpower),1)*100 failurelossrate, " +
-                "nvl(sum(daynhwhssdl),0)/nvl(sum(theoreticalpower),1)*100 mainlossrate," +
+                "nvl(sum(actualpower),0)/decode(sum(theoreticalpower),0,100,null,100)*100 windenergy, " +
+                "nvl(sum(daynhxdssdl),0)/decode(sum(theoreticalpower),0,100,null,100)*100 powerlossrate, " +
+                "nvl(sum(daynhqfdl),0)/decode(sum(theoreticalpower),0,100,null,100)*100 performancelossrate, " +
+                "nvl(sum(daynhgzssdl),0)/decode(sum(theoreticalpower),0,100,null,100)*100 failurelossrate, " +
+                "nvl(sum(daynhwhssdl),0)/decode(sum(theoreticalpower),0,100,null,100)*100 mainlossrate," +
                 "avg(comprehensiverate) comprehensiverate,sum(actualpower)/avg(capacity) utilizationhours," +
                 "avg(windpoweraccuracy) windpoweraccuracy," +
                 "avg(agccurvefollowing) agccurvefollowing," +