Browse Source

经济运行报告设备利用率调整

王波 2 weeks ago
parent
commit
a7e4ab9e4c

+ 20 - 8
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/EarlyWarning/ReportService.java

@@ -10,6 +10,7 @@ import com.gyee.runeconomy.model.vo.IndicatorData;
 import com.gyee.runeconomy.service.auto.IProEconWindturbineStatusService;
 import com.gyee.runeconomy.service.auto.ITurbineInfoDayService;
 import com.gyee.runeconomy.util.DateUtils;
+import com.gyee.runeconomy.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -110,10 +111,7 @@ public class ReportService {
                 .setScale(2, RoundingMode.HALF_UP)
                 .doubleValue();
 
-        double currentEquipmentUtilization = ((yxsj / jhyxsj) * 100);
-        currentEquipmentUtilization = new BigDecimal(currentEquipmentUtilization).setScale(2, RoundingMode.HALF_UP).doubleValue();
-        double lastYearEquipmentUtilization = (tqyxsj / tqjhyxsj * 1);
-        lastYearEquipmentUtilization = new BigDecimal(lastYearEquipmentUtilization).setScale(2, RoundingMode.HALF_UP).doubleValue();
+
 
         double jxsj = statuses.stream()
                 .filter(y -> y.getSatusCode() != null && y.getSatusCode().equals(6))
@@ -138,10 +136,6 @@ public class ReportService {
                 .setScale(2, RoundingMode.HALF_UP)
                 .doubleValue();
 
-        double currentEfficiencyCoefficient = ((yxsj + jxsj) / jhyxsj) * 100;
-        currentEfficiencyCoefficient = new BigDecimal(currentEfficiencyCoefficient).setScale(2, RoundingMode.HALF_UP).doubleValue();
-        double lastYearEfficiencyCoefficient = (tqyxsj + tqjxsj) / tqjhyxsj * 1;
-        lastYearEfficiencyCoefficient = new BigDecimal(lastYearEfficiencyCoefficient).setScale(2, RoundingMode.HALF_UP).doubleValue();
 
         double currentSmallWindSpeed = averageRounded(turbineList, t -> t.getXfqrfs());
         double lastYearSmallWindSpeed = averageRounded(tqturbineList, t -> t.getXfqrfs());
@@ -201,6 +195,24 @@ public class ReportService {
                 .reduce(BigDecimal.ZERO, BigDecimal::add)
                 .setScale(2, RoundingMode.HALF_UP)
                 .doubleValue();//同期故障时间
+
+
+//        double currentEquipmentUtilization = ((yxsj / jhyxsj) * 100);
+//        currentEquipmentUtilization = new BigDecimal(currentEquipmentUtilization).setScale(2, RoundingMode.HALF_UP).doubleValue();
+//        double lastYearEquipmentUtilization = (tqyxsj / tqjhyxsj * 1);
+//        lastYearEquipmentUtilization = new BigDecimal(lastYearEquipmentUtilization).setScale(2, RoundingMode.HALF_UP).doubleValue();
+
+        double currentEquipmentUtilization = (jhyxsj - currentFaultDowntime) / jhyxsj * 100;
+        double lastYearEquipmentUtilization = (tqjhyxsj - lastYearFaultDowntime) / tqjhyxsj * 100;
+
+//        double currentEfficiencyCoefficient = ((yxsj + jxsj) / jhyxsj) * 100;
+//        currentEfficiencyCoefficient = new BigDecimal(currentEfficiencyCoefficient).setScale(2, RoundingMode.HALF_UP).doubleValue();
+//        double lastYearEfficiencyCoefficient = (tqyxsj + tqjxsj) / tqjhyxsj * 1;
+//        lastYearEfficiencyCoefficient = new BigDecimal(lastYearEfficiencyCoefficient).setScale(2, RoundingMode.HALF_UP).doubleValue();
+
+        double currentEfficiencyCoefficient = StringUtils.round((jhyxsj - currentFaultDowntime) / jhyxsj * 100,0);
+        double lastYearEfficiencyCoefficient = StringUtils.round((tqjhyxsj - lastYearFaultDowntime) / tqjhyxsj * 100,0);
+
         double currentMaintenanceDowntime = DoubleUtils.getRoundingNum((jxsj),2);
         double lastYearMaintenanceDowntime = DoubleUtils.getRoundingNum((tqjxsj),2);
         double currentGridConnectionTime = DoubleUtils.getRoundingNum((yxsj),2);