Browse Source

王子文 月报avg/total调整

wangggziwen 2 years ago
parent
commit
2ab392d21f

+ 16 - 11
master/src/main/java/com/ruoyi/project/production/service/impl/TMonthlyProductionReportServiceImpl.java

@@ -1013,6 +1013,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             }
             }
         }
         }
         this.calcTotal(monthlyProductionReportVOs);
         this.calcTotal(monthlyProductionReportVOs);
+        this.calcAvg(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
         return monthlyProductionReportVOs;
     }
     }
 
 
@@ -1171,6 +1172,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             }
             }
         }
         }
         this.calcTotal(monthlyProductionReportVOs);
         this.calcTotal(monthlyProductionReportVOs);
+        this.calcAvg(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
         return monthlyProductionReportVOs;
     }
     }
 
 
@@ -1233,6 +1235,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }
         }
         }
+        this.calcTotal(monthlyProductionReportVOs);
         this.calcAvg(monthlyProductionReportVOs);
         this.calcAvg(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
         return monthlyProductionReportVOs;
     }
     }
@@ -1332,6 +1335,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             }
             }
         }
         }
         this.calcTotal(monthlyProductionReportVOs);
         this.calcTotal(monthlyProductionReportVOs);
+        this.calcAvg(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
         return monthlyProductionReportVOs;
     }
     }
 
 
@@ -1931,20 +1935,20 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
         // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
         List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
         List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_pcur","Plant capacity utilization rate","%"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_pcur","Plant capacity utilization rate","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_energy_consumption","Energy Consumption","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_energy_consumption","Energy Consumption","t"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_pepc","Product of Ethylene and Propylene and C4's base FEED","%"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_pepc","Product of Ethylene and Propylene and C4's base FEED","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_c3_production","C2+C3 Production","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_c3_target","C2+C3 target","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_c3_target2","C2+C3 target","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_target","C2 target","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_target2","C2 target","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_lti","LTI","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_c3_production","C2+C3 Production","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_c3_target","C2+C3 target","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_c3_target2","C2+C3 target","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_target","C2 target","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_c2_target2","C2 target","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_lti","LTI","t"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_yepbf","Yields of Ethylene and propylene base on furnace feeds","%"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_yepbf","Yields of Ethylene and propylene base on furnace feeds","%"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_yebf","Yields of Ethylene  base on furnace feeds","%"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_yebf","Yields of Ethylene  base on furnace feeds","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_aeu_energy_consumption","AEU Energy Consumption","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_btx_production","BTX Production","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_btx_target","BTX target","%"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_btx_target2","BTX target","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_aeu_energy_consumption","AEU Energy Consumption","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_btx_production","BTX Production","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_btx_target","BTX target","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("kbi_btx_target2","BTX target","t"));
         // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
         // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
         for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
         for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
             TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
             TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
@@ -2011,6 +2015,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             }
             }
         }
         }
         this.calcTotal(monthlyProductionReportVOs);
         this.calcTotal(monthlyProductionReportVOs);
+        this.calcAvg(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
         return monthlyProductionReportVOs;
     }
     }
 
 

+ 5 - 2
master/src/main/java/com/ruoyi/project/production/service/impl/thread/SyncAfterDailyUpdateThread.java

@@ -4,7 +4,6 @@ import com.ruoyi.project.production.domain.TDailyProductionReport;
 import com.ruoyi.project.production.domain.TMonthlyProductionReport;
 import com.ruoyi.project.production.domain.TMonthlyProductionReport;
 import com.ruoyi.project.production.mapper.TDailyProductionReportMapper;
 import com.ruoyi.project.production.mapper.TDailyProductionReportMapper;
 import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
 import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
-import org.apache.commons.math3.analysis.function.Subtract;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
@@ -496,7 +495,11 @@ public class SyncAfterDailyUpdateThread extends Thread {
         monthly.setSubConBfw(subConBfw.toString());
         monthly.setSubConBfw(subConBfw.toString());
         monthly.setSubConTotalNgFc3702(subConTotalNgFc3702.toString());
         monthly.setSubConTotalNgFc3702(subConTotalNgFc3702.toString());
 
 
-        BigDecimal kbiPepc = (ethylenProduced.add(propyleneProduced).add(c4LpgProduced)).multiply(crackerRawFeed);
+        BigDecimal kbiPepc = new BigDecimal("0");
+        if (crackerRawFeed.compareTo(BigDecimal.ZERO) != 0) {
+            kbiPepc = (ethylenProduced.add(propyleneProduced).add(c4LpgProduced))
+                    .multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+        }
         BigDecimal kbiC2C3Production = ethylenProduced.add(propyleneProduced);
         BigDecimal kbiC2C3Production = ethylenProduced.add(propyleneProduced);
         BigDecimal kbiYepbf = new BigDecimal("0");
         BigDecimal kbiYepbf = new BigDecimal("0");
         if (crackerRawFeed.compareTo(BigDecimal.ZERO) != 0) {
         if (crackerRawFeed.compareTo(BigDecimal.ZERO) != 0) {

+ 8 - 0
ui/src/views/production/monthly/index.vue

@@ -724,6 +724,7 @@
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
+        <el-table-column prop="avg" label="avg"></el-table-column>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
     <!-- Aromatics Utility Consumption -->
     <!-- Aromatics Utility Consumption -->
@@ -1112,6 +1113,7 @@
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
+        <el-table-column prop="avg" label="avg"></el-table-column>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
     <!-- Plant Load -->
     <!-- Plant Load -->
@@ -1136,6 +1138,7 @@
         <el-table-column prop="oct" :label="this.monthList[9]"></el-table-column>
         <el-table-column prop="oct" :label="this.monthList[9]"></el-table-column>
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
+        <el-table-column prop="total" label="total"></el-table-column>
         <el-table-column prop="avg" label="avg"></el-table-column>
         <el-table-column prop="avg" label="avg"></el-table-column>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -1443,6 +1446,7 @@
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
+        <el-table-column prop="avg" label="avg"></el-table-column>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
     <!-- Shoudown Hour -->
     <!-- Shoudown Hour -->
@@ -1638,6 +1642,7 @@
         <el-table-column prop="oct" :label="this.monthList[9]"></el-table-column>
         <el-table-column prop="oct" :label="this.monthList[9]"></el-table-column>
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
         <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
+        <el-table-column prop="total" label="total"></el-table-column>
         <el-table-column prop="avg" label="avg"></el-table-column>
         <el-table-column prop="avg" label="avg"></el-table-column>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -2400,6 +2405,7 @@
     </div>
     </div>
     <el-table border :data="tableKBI" style="width: 100%;">
     <el-table border :data="tableKBI" style="width: 100%;">
       <el-table-column prop="title" label="KBI" width="150"></el-table-column>
       <el-table-column prop="title" label="KBI" width="150"></el-table-column>
+      <el-table-column prop="unit" label="unit"></el-table-column>
       <el-table-column prop="currently" label="currently"></el-table-column>
       <el-table-column prop="currently" label="currently"></el-table-column>
       <el-table-column prop="jan" :label="this.monthList[0]">
       <el-table-column prop="jan" :label="this.monthList[0]">
         <template slot-scope="{row}">
         <template slot-scope="{row}">
@@ -2702,11 +2708,13 @@
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column prop="total" label="total"></el-table-column>
       <el-table-column prop="total" label="total"></el-table-column>
+      <el-table-column prop="avg" label="avg"></el-table-column>
     </el-table>
     </el-table>
     <!-- Summary -->
     <!-- Summary -->
     <el-table border :data="tableSummary" style="width: 100%;">
     <el-table border :data="tableSummary" style="width: 100%;">
       <el-table-column label="BCC装置主要原材料及公用工程消耗">
       <el-table-column label="BCC装置主要原材料及公用工程消耗">
         <el-table-column prop="title" label="项目" width="150"></el-table-column>
         <el-table-column prop="title" label="项目" width="150"></el-table-column>
+        <el-table-column prop="unit" label="unit"></el-table-column>
         <el-table-column prop="currently" label="currently"></el-table-column>
         <el-table-column prop="currently" label="currently"></el-table-column>
         <el-table-column prop="jan" :label="this.monthList[0]"></el-table-column>
         <el-table-column prop="jan" :label="this.monthList[0]"></el-table-column>
         <el-table-column prop="feb" :label="this.monthList[1]"></el-table-column>
         <el-table-column prop="feb" :label="this.monthList[1]"></el-table-column>