Selaa lähdekoodia

王子文 月报VO属性修改

wangggziwen 2 vuotta sitten
vanhempi
commit
71ae544d14

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

@@ -111,23 +111,23 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         List<TMonthlyProductionReport> tMonthlyProductionReports = tMonthlyProductionReportMapper.selectCrackerRawMaterialByYear(year);
         // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
         List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Cracker Raw Material", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("NAP", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C5", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("NA", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Wison Ethane", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("LPG to Furnace", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C4 Raff3 fr bd and 2ph", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C2 fr LDPE", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C3 fr OXO", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Mixed C3/C4 fr BD", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("HC9", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Offgas fr AEU", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("wash oil", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("toluene", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C4 Recycle(ton)", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("input total", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Total feed", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_raw_input", "Cracker Raw Material", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("nap", "NAP", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c5", "C5", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c6_c8_na", "NA", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("wison_ethane", "Wison Ethane", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("lpg_to_furnace", "LPG to Furnace", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("raff3_fr_bd_and_2ph", "C4 Raff3 fr bd and 2ph", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c2_fr_ldpe", "C2 fr LDPE", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c3_fr_oxo", "C3 fr OXO", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("mixed_c3_c4", "Mixed C3/C4 fr BD", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("hy_c9", "HC9", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_offgas", "Offgas fr AEU", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("wash_oil", "wash oil", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("toluene", "toluene", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("hy_c4_fr_r800", "C4 Recycle(ton)", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_raw_input", "input total", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_raw_feed", "Total feed", "t"));
         // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
         for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
             TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
@@ -280,20 +280,20 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         List<TMonthlyProductionReport> tMonthlyProductionReports = tMonthlyProductionReportMapper.selectCrackerOutputProductByYear(year);
         // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
         List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Cracker Output Product", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("H2", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C2=", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C3=", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C3/C4 LPG", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("C4'S", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("RPG", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("PO", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Naphthalene", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("EBO", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Cracker Residue", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Methane", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("OFFAGE", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("output total", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_output", "Cracker Output Product", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("h2_produced", "H2", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("ethylen_produced", "C2=", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("propylene_produced", "C3=", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c3_c4_lpg_produced", "C3/C4 LPG", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("mixed_c4s_produced", "C4'S", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("rpg_produced", "RPG", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("po_flux_oil_produced", "PO", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("naphthalene_produced", "Naphthalene", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("ebo_produced", "EBO", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("residue_oil_produced", "Cracker Residue", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("methane_produced", "Methane", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("offgas_produced", "OFFAGE", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_output", "output total", "t"));
         // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
         for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
             TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
@@ -437,12 +437,12 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         List<TMonthlyProductionReport> tMonthlyProductionReports = tMonthlyProductionReportMapper.selectAromaticsRawMaterialByYear(year);
         // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
         List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Aromatics Raw Material", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("RPG fr EU", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("H2 to PGU", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Mix BTX Product", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("Mix BTX to AEU", "t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("input total", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("aromatics_raw_input", "Aromatics Raw Material", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_rpg2", "RPG fr EU", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_h2", "H2 to PGU", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_btx_produced", "Mix BTX Product", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_btx_to_aeu", "Mix BTX to AEU", "t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("aromatics_raw_input", "input total", "t"));
         // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
         for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
             TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);

+ 17 - 4
master/src/main/java/com/ruoyi/project/production/service/impl/vo/MonthlyProductionReportVO.java

@@ -7,6 +7,10 @@ package com.ruoyi.project.production.service.impl.vo;
  */
 public class MonthlyProductionReportVO {
 
+    /** 字典表dictLabel的值 */
+    private String dictLabel;
+
+    /** 前端表格最左列显示的文字 */
     private String title;
 
     private String unit;
@@ -39,6 +43,14 @@ public class MonthlyProductionReportVO {
 
     private String total;
 
+    public String getDictLabel() {
+        return dictLabel;
+    }
+
+    public void setDictLabel(String dictLabel) {
+        this.dictLabel = dictLabel;
+    }
+
     public String getTitle() {
         return title;
     }
@@ -168,10 +180,11 @@ public class MonthlyProductionReportVO {
     }
 
     public MonthlyProductionReportVO() {
-    }
+        }
 
-    public MonthlyProductionReportVO(String title, String unit) {
-        this.title = title;
-        this.unit = unit;
+    public MonthlyProductionReportVO(String dictLabel, String title, String unit) {
+            this.dictLabel = dictLabel;
+            this.title = title;
+            this.unit = unit;
     }
 }

+ 2 - 11
ui/src/views/production/monthly/index.vue

@@ -569,8 +569,6 @@ export default {
   name: "Monthly",
   data() {
     return {
-      // 对比指标下拉框
-      chemicalsOptions: [],
       // 趋势图y轴数值
       valueList: [],
       // 趋势图x轴日期
@@ -886,9 +884,6 @@ export default {
     }
   },
   created() {
-    this.getDicts("CHEMICALS").then(response => {
-      this.chemicalsOptions = response.data;
-    });
     // 加载时设置year为今年
     this.year = new Date();
     // 加载月报数据
@@ -901,16 +896,12 @@ export default {
     },
     /** 处理最左列指标点击事件 */
     columnOnclick(row) {
-      let title = row.title;
+      let dictLabel = row.dictLabel;
       let toYear = this.year.getFullYear();
       let toMonth = this.year.getMonth() + 1;
       let fromYear = toYear - 1;
       let fromMonth = toMonth;
-      for (let i = 0; i < this.chemicalsOptions.length; i++) {
-        if (this.chemicalsOptions[i].dictLabel == title) {
-          this.analysisQueryParams.item = this.chemicalsOptions[i].dictValue;
-        }
-      }
+      this.analysisQueryParams.item = dictLabel;
       this.analysisQueryParams.toYear = toYear;
       this.analysisQueryParams.toMonth = toMonth;
       this.analysisQueryParams.fromYear = fromYear;