Browse Source

王子文 月报 有效位数

wangggziwen 2 năm trước cách đây
mục cha
commit
fafb1a5183

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

@@ -2070,23 +2070,23 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_cl_rlq","燃料气产量","t"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_cl_jzs","精制水产量","t"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_cl_tpny","透平凝液产量","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_yb","乙丙收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_sny","石脑油收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_c5_raff","C5 raff收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_yw","乙烷收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_jqtj","加氢碳九收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_yxjy","乙烯焦油收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_hhc4","混合C4收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_sb","三苯收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_ljtw","裂解碳五收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_ljtj","裂解碳九收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_ccsny","重整石脑油收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_zqzh","蒸汽综合收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_lqs","冷却水收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_d","电收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_rlq","燃料气收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_jzs","精制水收率","t"));
-        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_tpny","透平凝液收率","t"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_yb","乙丙收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_sny","石脑油收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_c5_raff","C5 raff收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_yw","乙烷收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_jqtj","加氢碳九收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_yxjy","乙烯焦油收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_hhc4","混合C4收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_sb","三苯收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_ljtw","裂解碳五收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_ljtj","裂解碳九收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_ccsny","重整石脑油收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_zqzh","蒸汽综合收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_lqs","冷却水收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_d","电收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_rlq","燃料气收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_jzs","精制水收率",""));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("summary_sl_tpny","透平凝液收率",""));
         // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
         for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
             TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
@@ -3247,7 +3247,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         rowCount = this.setTableHearder(sheet, rowCount, "Plant Load", 3);
         rowCount = this.setTableData(sheet, rowCount, plantLoad, 3);
         rowCount = this.setTableHearder(sheet, rowCount, "Cost Fr Ethylene", 1);
-        rowCount = this.setTableData(sheet, rowCount, costFrEthylene, 1);
+        rowCount = this.setTableData(sheet, rowCount, costFrEthylene, 2);
         rowCount = this.setTableHearder(sheet, rowCount, "Runing Rate", 3);
         rowCount = this.setTableData(sheet, rowCount, runingRate, 3);
         rowCount = this.setTableHearder(sheet, rowCount, "Shoudown Hour", 1);
@@ -3364,7 +3364,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         row0.getCell(0).setCellValue(header);
         rowCount++;
         XSSFRow row1 = sheet.getRow(rowCount);
-        row1.getCell(0).setCellValue("Title");
+        row1.getCell(0).setCellValue("");
         row1.getCell(1).setCellValue("Unit");
         row1.getCell(2).setCellValue("Currently");
         row1.getCell(3).setCellValue("Jan");

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

@@ -205,7 +205,7 @@ public class SyncAfterDailyUpdateThread extends Thread {
         monthly.setPguBtxProduced(pguBtxProduced.toString());
         BigDecimal aeuTolueneToEu = new BigDecimal(aeuTolueneToEuStr == null ? "0" : aeuTolueneToEuStr);
         BigDecimal aeuTolueneProducedMEu = new BigDecimal("0");
-        aeuTolueneProducedMEu = aeuTolueneProducedMEu.subtract(aeuTolueneToEu);
+        aeuTolueneProducedMEu = aeuTolueneProduced.subtract(aeuTolueneToEu);
         monthly.setAeuTolueneProducedMEu(aeuTolueneProducedMEu.toString());
         BigDecimal aromaticsOutput = new BigDecimal("0");
         aromaticsOutput = aromaticsOutput.add(aeuBenzeneProduced).add(aeuTolueneProduced).add(aeuXyleneProduced)
@@ -540,16 +540,19 @@ public class SyncAfterDailyUpdateThread extends Thread {
         monthly.setSummaryClYxjy(summaryClYxjy.toString());
         monthly.setSummaryClHhc4(summaryClHhc4.toString());
         monthly.setSummaryClSb(summaryClSb.toString());
-        monthly.setSummaryClLjtw(pguC5Produced.toString());
-        monthly.setSummaryClLjtj(pguC9Produced.toString());
-        monthly.setSummaryClCcsny(aeuC6C8NaProduced.toString());
+        BigDecimal clLjtw = new BigDecimal("0").subtract(pguC5Produced);
+        BigDecimal clLjtj = new BigDecimal("0").subtract(pguC9Produced);
+        BigDecimal clCzssy = new BigDecimal("0").subtract(aeuC6C8NaProduced);
+        monthly.setSummaryClLjtw(clLjtw.toString());
+        monthly.setSummaryClLjtj(clLjtj.toString());
+        monthly.setSummaryClCcsny(clCzssy.toString());
         monthly.setSummaryClZqzh(summaryClZqzh.toString());
         monthly.setSummaryClLqs(summaryClLqs.toString());
         monthly.setSummaryClD(summaryClD.toString());
         monthly.setSummaryClRlq(fuelGasOffgasCracker.toString());
         monthly.setSummaryClJzs(polishedConCracker.toString());
         monthly.setSummaryClTpny(turbineConCracker.toString());
-        BigDecimal summarySlYb = ethyleneYield.add(propyleneProduced);
+        BigDecimal summarySlYb = ethyleneYield.add(propyleneYield);
         BigDecimal summarySlSny = new BigDecimal("0");
         BigDecimal summarySlC5Raff = new BigDecimal("0");
         BigDecimal summarySlYw = new BigDecimal("0");
@@ -567,22 +570,22 @@ public class SyncAfterDailyUpdateThread extends Thread {
         BigDecimal summarySlJzs = new BigDecimal("0");
         BigDecimal summarySlTpny = new BigDecimal("0");
         if (summaryClYb.compareTo(BigDecimal.ZERO) != 0) {
-            summarySlSny = nap.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlC5Raff = c5.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlYw = wisonEthane.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlJqtj = hyC9.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlYxjy = summaryClYxjy.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlHhc4 = summaryClHhc4.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlSb = summaryClSb.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlLjtw = pguC5Produced.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlLjtj = pguC9Produced.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlCcsny = aeuC6C8NaProduced.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlZqzh = summaryClZqzh.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlLqs = summaryClLqs.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlD = summaryClD.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlRlq = fuelGasOffgasCracker.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlJzs = polishedConCracker.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
-            summarySlTpny = turbineConCracker.multiply(hundred).divide(summaryClYb, 2, RoundingMode.HALF_UP);
+            summarySlSny = nap.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlC5Raff = c5.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlYw = wisonEthane.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlJqtj = hyC9.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlYxjy = summaryClYxjy.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlHhc4 = summaryClHhc4.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlSb = summaryClSb.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlLjtw = pguC5Produced.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlLjtj = pguC9Produced.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlCcsny = aeuC6C8NaProduced.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlZqzh = summaryClZqzh.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlLqs = summaryClLqs.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlD = summaryClD.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlRlq = fuelGasOffgasCracker.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlJzs = polishedConCracker.divide(summaryClYb, 3, RoundingMode.HALF_UP);
+            summarySlTpny = turbineConCracker.divide(summaryClYb, 3, RoundingMode.HALF_UP);
         }
         monthly.setSummarySlYb(summarySlYb.toString());
         monthly.setSummarySlSny(summarySlSny.toString());