Jelajahi Sumber

王子文 生产日报导入数据格式处理

wangggziwen 2 tahun lalu
induk
melakukan
116b93f487

+ 200 - 161
master/src/main/java/com/ruoyi/project/production/service/impl/TDailyProductionReportServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.production.service.impl;
 
 import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Date;
 import java.util.List;
 
@@ -99,6 +101,39 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
         return tDailyProductionReportMapper.deleteTDailyProductionReportById(id);
     }
 
+    /**
+     * 小数四舍五入
+     *
+     * @param raw 原始数据
+     * @param scale 精确到小数点后几位
+     * @return
+     */
+    private String roundDecimal(String raw, int scale) {
+        if (raw == null) {
+            return null;
+        }
+        return new BigDecimal(raw)
+                .setScale(scale, RoundingMode.HALF_EVEN)
+                .toString();
+    }
+
+    /**
+     * 百分比四舍五入
+     *
+     * @param raw 原始数据
+     * @param scale 精确到小数点后几位
+     * @return
+     */
+    private String roundPercentage(String raw, int scale) {
+        if (raw == null) {
+            return null;
+        }
+        return new BigDecimal(raw)
+                .setScale(scale, RoundingMode.HALF_EVEN)
+                .multiply(new BigDecimal("100"))
+                .toString() + "%";
+    }
+
     /**
      * 导入每日生产报告数据
      *
@@ -122,177 +157,177 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setToDate(this.getCellDataDate(sheet, 1, 12));
             tDailyProductionReport.setReportDate(this.getCellDataDate(sheet, 2, 21));
             // rowIndex = 4
-            tDailyProductionReport.setNap(this.getCellDataString(sheet, 4, 0));
+            tDailyProductionReport.setNap(this.roundDecimal(this.getCellDataString(sheet, 4, 0), 0));
             // rowIndex = 5
-            tDailyProductionReport.setH2YieldPercentage(this.getCellDataString(sheet, 5, 6));
-            tDailyProductionReport.setH2Produced(this.getCellDataString(sheet, 5, 7));
-            tDailyProductionReport.setH2Inventory(this.getCellDataString(sheet, 5, 8));
-            tDailyProductionReport.setH2Change(this.getCellDataString(sheet, 5, 9));
-            tDailyProductionReport.setH2Import(this.getCellDataString(sheet, 5, 10));
-            tDailyProductionReport.setH2Export(this.getCellDataString(sheet, 5, 11));
-            tDailyProductionReport.setH2ToPgu(this.getCellDataString(sheet, 5, 12));
-            tDailyProductionReport.setH2ToYpc(this.getCellDataString(sheet, 5, 13));
-            tDailyProductionReport.setH2ToOxo(this.getCellDataString(sheet, 5, 14));
-            tDailyProductionReport.setH2FrSyngasToSub(this.getCellDataString(sheet, 5, 15));
+            tDailyProductionReport.setH2YieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 5, 6), 2));
+            tDailyProductionReport.setH2Produced(this.roundDecimal(this.getCellDataString(sheet, 5, 7), 0));
+            tDailyProductionReport.setH2Inventory(this.roundDecimal(this.getCellDataString(sheet, 5, 8), 0));
+            tDailyProductionReport.setH2Change(this.roundDecimal(this.getCellDataString(sheet, 5, 9), 0));
+            tDailyProductionReport.setH2Import(this.roundDecimal(this.getCellDataString(sheet, 5, 10), 0));
+            tDailyProductionReport.setH2Export(this.roundDecimal(this.getCellDataString(sheet, 5, 11), 0));
+            tDailyProductionReport.setH2ToPgu(this.roundDecimal(this.getCellDataString(sheet, 5, 12), 0));
+            tDailyProductionReport.setH2ToYpc(this.roundDecimal(this.getCellDataString(sheet, 5, 13), 0));
+            tDailyProductionReport.setH2ToOxo(this.roundDecimal(this.getCellDataString(sheet, 5, 14), 0));
+            tDailyProductionReport.setH2FrSyngasToSub(this.roundDecimal(this.getCellDataString(sheet, 5, 15), 0));
             // rowIndex = 6
-            tDailyProductionReport.setC5(this.getCellDataString(sheet, 6, 0));
+            tDailyProductionReport.setC5(this.roundDecimal(this.getCellDataString(sheet, 6, 0), 0));
             // rowIndex = 7
-            tDailyProductionReport.setEthylenYieldPercentage(this.getCellDataString(sheet, 7, 6));
-            tDailyProductionReport.setEthylenProduced(this.getCellDataString(sheet, 7, 7));
-            tDailyProductionReport.setEthylenInventory(this.getCellDataString(sheet, 7, 8));
-            tDailyProductionReport.setEthylenChange(this.getCellDataString(sheet, 7, 9));
-            tDailyProductionReport.setEthylenImport(this.getCellDataString(sheet, 7, 10));
-            tDailyProductionReport.setEthylenExport(this.getCellDataString(sheet, 7, 11));
-            tDailyProductionReport.setEthylenToTm(this.getCellDataString(sheet, 7, 12));
-            tDailyProductionReport.setEthylenToTs(this.getCellDataString(sheet, 7, 13));
-            tDailyProductionReport.setEthylenToEoEg(this.getCellDataString(sheet, 7, 14));
-            tDailyProductionReport.setEthylenToOxo(this.getCellDataString(sheet, 7, 15));
-            tDailyProductionReport.setEthylenToYbs(this.getCellDataString(sheet, 7, 16));
-            tDailyProductionReport.setEthylenToYpc(this.getCellDataString(sheet, 7, 17));
-            tDailyProductionReport.setEthylenToWacker(this.getCellDataString(sheet, 7, 18));
-            tDailyProductionReport.setEthylenToDyna(this.getCellDataString(sheet, 7, 19));
-            tDailyProductionReport.setEthylenToCelanLongx(this.getCellDataString(sheet, 7, 20));
-            tDailyProductionReport.setEthylenFrYpc(this.getCellDataString(sheet, 7, 21));
-            tDailyProductionReport.setEthylenFrLongxiang(this.getCellDataString(sheet, 7, 22));
+            tDailyProductionReport.setEthylenYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 7, 6), 2));
+            tDailyProductionReport.setEthylenProduced(this.roundDecimal(this.getCellDataString(sheet, 7, 7), 0));
+            tDailyProductionReport.setEthylenInventory(this.roundDecimal(this.getCellDataString(sheet, 7, 8), 0));
+            tDailyProductionReport.setEthylenChange(this.roundDecimal(this.getCellDataString(sheet, 7, 9), 0));
+            tDailyProductionReport.setEthylenImport(this.roundDecimal(this.getCellDataString(sheet, 7, 10), 0));
+            tDailyProductionReport.setEthylenExport(this.roundDecimal(this.getCellDataString(sheet, 7, 11), 0));
+            tDailyProductionReport.setEthylenToTm(this.roundDecimal(this.getCellDataString(sheet, 7, 12), 0));
+            tDailyProductionReport.setEthylenToTs(this.roundDecimal(this.getCellDataString(sheet, 7, 13), 0));
+            tDailyProductionReport.setEthylenToEoEg(this.roundDecimal(this.getCellDataString(sheet, 7, 14), 0));
+            tDailyProductionReport.setEthylenToOxo(this.roundDecimal(this.getCellDataString(sheet, 7, 15), 0));
+            tDailyProductionReport.setEthylenToYbs(this.roundDecimal(this.getCellDataString(sheet, 7, 16), 0));
+            tDailyProductionReport.setEthylenToYpc(this.roundDecimal(this.getCellDataString(sheet, 7, 17), 0));
+            tDailyProductionReport.setEthylenToWacker(this.roundDecimal(this.getCellDataString(sheet, 7, 18), 0));
+            tDailyProductionReport.setEthylenToDyna(this.roundDecimal(this.getCellDataString(sheet, 7, 19), 0));
+            tDailyProductionReport.setEthylenToCelanLongx(this.roundDecimal(this.getCellDataString(sheet, 7, 20), 0));
+            tDailyProductionReport.setEthylenFrYpc(this.roundDecimal(this.getCellDataString(sheet, 7, 21), 0));
+            tDailyProductionReport.setEthylenFrLongxiang(this.roundDecimal(this.getCellDataString(sheet, 7, 22), 0));
             // rowIndex = 8
-            tDailyProductionReport.setC6C8Na(this.getCellDataString(sheet, 8, 0));
+            tDailyProductionReport.setC6C8Na(this.roundDecimal(this.getCellDataString(sheet, 8, 0), 0));
             // rowIndex = 9
-            tDailyProductionReport.setPropyleneYieldPercentage(this.getCellDataString(sheet, 9, 6));
-            tDailyProductionReport.setPropyleneProduced(this.getCellDataString(sheet, 9, 7));
-            tDailyProductionReport.setPropyleneInventory(this.getCellDataString(sheet, 9, 8));
-            tDailyProductionReport.setPropyleneChange(this.getCellDataString(sheet, 9, 9));
-            tDailyProductionReport.setPropyleneImport(this.getCellDataString(sheet, 9, 10));
-            tDailyProductionReport.setPropyleneExport(this.getCellDataString(sheet, 9, 11));
-            tDailyProductionReport.setPropyleneToAaAe(this.getCellDataString(sheet, 9, 12));
-            tDailyProductionReport.setPropyleneToGaa(this.getCellDataString(sheet, 9, 13));
-            tDailyProductionReport.setPropyleneToOxo(this.getCellDataString(sheet, 9, 14));
-            tDailyProductionReport.setPropyleneToLdpe(this.getCellDataString(sheet, 9, 15));
-            tDailyProductionReport.setPropyleneToYpc(this.getCellDataString(sheet, 9, 16));
-            tDailyProductionReport.setPropyleneToRoad(this.getCellDataString(sheet, 9, 17));
-            tDailyProductionReport.setPropyleneToShip(this.getCellDataString(sheet, 9, 18));
-            tDailyProductionReport.setPropyleneFrYpc(this.getCellDataString(sheet, 9, 19));
-            tDailyProductionReport.setPropyleneFrShip(this.getCellDataString(sheet, 9, 20));
-            tDailyProductionReport.setPropyleneFrChengzhi(this.getCellDataString(sheet, 9, 21));
+            tDailyProductionReport.setPropyleneYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 9, 6), 2));
+            tDailyProductionReport.setPropyleneProduced(this.roundDecimal(this.getCellDataString(sheet, 9, 7), 0));
+            tDailyProductionReport.setPropyleneInventory(this.roundDecimal(this.getCellDataString(sheet, 9, 8), 0));
+            tDailyProductionReport.setPropyleneChange(this.roundDecimal(this.getCellDataString(sheet, 9, 9), 0));
+            tDailyProductionReport.setPropyleneImport(this.roundDecimal(this.getCellDataString(sheet, 9, 10), 0));
+            tDailyProductionReport.setPropyleneExport(this.roundDecimal(this.getCellDataString(sheet, 9, 11), 0));
+            tDailyProductionReport.setPropyleneToAaAe(this.roundDecimal(this.getCellDataString(sheet, 9, 12), 0));
+            tDailyProductionReport.setPropyleneToGaa(this.roundDecimal(this.getCellDataString(sheet, 9, 13), 0));
+            tDailyProductionReport.setPropyleneToOxo(this.roundDecimal(this.getCellDataString(sheet, 9, 14), 0));
+            tDailyProductionReport.setPropyleneToLdpe(this.roundDecimal(this.getCellDataString(sheet, 9, 15), 0));
+            tDailyProductionReport.setPropyleneToYpc(this.roundDecimal(this.getCellDataString(sheet, 9, 16), 0));
+            tDailyProductionReport.setPropyleneToRoad(this.roundDecimal(this.getCellDataString(sheet, 9, 17), 0));
+            tDailyProductionReport.setPropyleneToShip(this.roundDecimal(this.getCellDataString(sheet, 9, 18), 0));
+            tDailyProductionReport.setPropyleneFrYpc(this.roundDecimal(this.getCellDataString(sheet, 9, 19), 0));
+            tDailyProductionReport.setPropyleneFrShip(this.roundDecimal(this.getCellDataString(sheet, 9, 20), 0));
+            tDailyProductionReport.setPropyleneFrChengzhi(this.roundDecimal(this.getCellDataString(sheet, 9, 21), 0));
             // rowIndex = 10
-            tDailyProductionReport.setWisonEthane(this.getCellDataString(sheet, 10, 0));
-            tDailyProductionReport.setC3LpgYieldPercentage(this.getCellDataString(sheet, 10, 6));
-            tDailyProductionReport.setC3LpgProduced(this.getCellDataString(sheet, 10, 7));
+            tDailyProductionReport.setWisonEthane(this.roundDecimal(this.getCellDataString(sheet, 10, 0), 0));
+            tDailyProductionReport.setC3LpgYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 10, 6), 2));
+            tDailyProductionReport.setC3LpgProduced(this.roundDecimal(this.getCellDataString(sheet, 10, 7), 0));
             // rowIndex = 11
-            tDailyProductionReport.setC4LpgYieldPercentage(this.getCellDataString(sheet, 11, 6));
-            tDailyProductionReport.setC4LpgProduced(this.getCellDataString(sheet, 11, 7));
-            tDailyProductionReport.setC3C4Inventory(this.getCellDataString(sheet, 11, 8));
-            tDailyProductionReport.setC3C4Change(this.getCellDataString(sheet, 11, 9));
-            tDailyProductionReport.setC3C4Import(this.getCellDataString(sheet, 11, 10));
-            tDailyProductionReport.setC3C4Export(this.getCellDataString(sheet, 11, 11));
-            tDailyProductionReport.setC3C4ToSub(this.getCellDataString(sheet, 11, 12));
-            tDailyProductionReport.setC3C4ToFurAsFule(this.getCellDataString(sheet, 11, 13));
-            tDailyProductionReport.setC3C4AsFeed(this.getCellDataString(sheet, 11, 14));
-            tDailyProductionReport.setC3C4FrYpc(this.getCellDataString(sheet, 11, 15));
-            tDailyProductionReport.setC3C4FrTruck(this.getCellDataString(sheet, 11, 16));
+            tDailyProductionReport.setC4LpgYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 11, 6), 2));
+            tDailyProductionReport.setC4LpgProduced(this.roundDecimal(this.getCellDataString(sheet, 11, 7), 0));
+            tDailyProductionReport.setC3C4Inventory(this.roundDecimal(this.getCellDataString(sheet, 11, 8), 0));
+            tDailyProductionReport.setC3C4Change(this.roundDecimal(this.getCellDataString(sheet, 11, 9), 0));
+            tDailyProductionReport.setC3C4Import(this.roundDecimal(this.getCellDataString(sheet, 11, 10), 0));
+            tDailyProductionReport.setC3C4Export(this.roundDecimal(this.getCellDataString(sheet, 11, 11), 0));
+            tDailyProductionReport.setC3C4ToSub(this.roundDecimal(this.getCellDataString(sheet, 11, 12), 0));
+            tDailyProductionReport.setC3C4ToFurAsFule(this.roundDecimal(this.getCellDataString(sheet, 11, 13), 0));
+            tDailyProductionReport.setC3C4AsFeed(this.roundDecimal(this.getCellDataString(sheet, 11, 14), 0));
+            tDailyProductionReport.setC3C4FrYpc(this.roundDecimal(this.getCellDataString(sheet, 11, 15), 0));
+            tDailyProductionReport.setC3C4FrTruck(this.roundDecimal(this.getCellDataString(sheet, 11, 16), 0));
             // rowIndex = 12
-            tDailyProductionReport.setLpgToFurnace(this.getCellDataString(sheet, 12, 0));
+            tDailyProductionReport.setLpgToFurnace(this.roundDecimal(this.getCellDataString(sheet, 12, 0), 0));
             // rowIndex = 13
-            tDailyProductionReport.setMixedC4sYieldPercentage(this.getCellDataString(sheet, 13, 6));
-            tDailyProductionReport.setMixedC4sProduced(this.getCellDataString(sheet, 13, 7));
-            tDailyProductionReport.setMixedC4sInventory(this.getCellDataString(sheet, 13, 8));
-            tDailyProductionReport.setMixedC4sChange(this.getCellDataString(sheet, 13, 9));
-            tDailyProductionReport.setMixedC4sImport(this.getCellDataString(sheet, 13, 10));
-            tDailyProductionReport.setMixedC4sExport(this.getCellDataString(sheet, 13, 11));
-            tDailyProductionReport.setMixedC4sToBd(this.getCellDataString(sheet, 13, 12));
-            tDailyProductionReport.setMixedC4sToYpc(this.getCellDataString(sheet, 13, 13));
-            tDailyProductionReport.setMixedC4sToTruck(this.getCellDataString(sheet, 13, 14));
-            tDailyProductionReport.setMixedC4sToShip(this.getCellDataString(sheet, 13, 15));
-            tDailyProductionReport.setMixedC4sFrYpc(this.getCellDataString(sheet, 13, 16));
-            tDailyProductionReport.setMixedC4sFrTruck(this.getCellDataString(sheet, 13, 17));
-            tDailyProductionReport.setMixedC4sFrShip(this.getCellDataString(sheet, 13, 18));
-            tDailyProductionReport.setMixedC4sFrBdR1(this.getCellDataString(sheet, 13, 19));
-            tDailyProductionReport.setMixedC4sToR800(this.getCellDataString(sheet, 13, 20));
+            tDailyProductionReport.setMixedC4sYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 13, 6), 2));
+            tDailyProductionReport.setMixedC4sProduced(this.roundDecimal(this.getCellDataString(sheet, 13, 7), 0));
+            tDailyProductionReport.setMixedC4sInventory(this.roundDecimal(this.getCellDataString(sheet, 13, 8), 0));
+            tDailyProductionReport.setMixedC4sChange(this.roundDecimal(this.getCellDataString(sheet, 13, 9), 0));
+            tDailyProductionReport.setMixedC4sImport(this.roundDecimal(this.getCellDataString(sheet, 13, 10), 0));
+            tDailyProductionReport.setMixedC4sExport(this.roundDecimal(this.getCellDataString(sheet, 13, 11), 0));
+            tDailyProductionReport.setMixedC4sToBd(this.roundDecimal(this.getCellDataString(sheet, 13, 12), 0));
+            tDailyProductionReport.setMixedC4sToYpc(this.roundDecimal(this.getCellDataString(sheet, 13, 13), 0));
+            tDailyProductionReport.setMixedC4sToTruck(this.roundDecimal(this.getCellDataString(sheet, 13, 14), 0));
+            tDailyProductionReport.setMixedC4sToShip(this.roundDecimal(this.getCellDataString(sheet, 13, 15), 0));
+            tDailyProductionReport.setMixedC4sFrYpc(this.roundDecimal(this.getCellDataString(sheet, 13, 16), 0));
+            tDailyProductionReport.setMixedC4sFrTruck(this.roundDecimal(this.getCellDataString(sheet, 13, 17), 0));
+            tDailyProductionReport.setMixedC4sFrShip(this.roundDecimal(this.getCellDataString(sheet, 13, 18), 0));
+            tDailyProductionReport.setMixedC4sFrBdR1(this.roundDecimal(this.getCellDataString(sheet, 13, 19), 0));
+            tDailyProductionReport.setMixedC4sToR800(this.roundDecimal(this.getCellDataString(sheet, 13, 20), 0));
             // rowIndex = 14
-            tDailyProductionReport.setRaff1FrBd(this.getCellDataString(sheet, 14, 0));
+            tDailyProductionReport.setRaff1FrBd(this.roundDecimal(this.getCellDataString(sheet, 14, 0), 0));
             // rowIndex = 15
-            tDailyProductionReport.setEboYieldPercentage(this.getCellDataString(sheet, 15, 6));
-            tDailyProductionReport.setEboProduced(this.getCellDataString(sheet, 15, 7));
-            tDailyProductionReport.setEboInventory(this.getCellDataString(sheet, 15, 8));
-            tDailyProductionReport.setEboChange(this.getCellDataString(sheet, 15, 9));
-            tDailyProductionReport.setEboImport(this.getCellDataString(sheet, 15, 10));
-            tDailyProductionReport.setEboExport(this.getCellDataString(sheet, 15, 11));
-            tDailyProductionReport.setEboToShip(this.getCellDataString(sheet, 15, 12));
-            tDailyProductionReport.setEboToRttf(this.getCellDataString(sheet, 15, 13));
-            tDailyProductionReport.setEboToTrain(this.getCellDataString(sheet, 15, 14));
-            tDailyProductionReport.setEboFrBd(this.getCellDataString(sheet, 15, 15));
+            tDailyProductionReport.setEboYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 15, 6), 0));
+            tDailyProductionReport.setEboProduced(this.roundDecimal(this.getCellDataString(sheet, 15, 7), 0));
+            tDailyProductionReport.setEboInventory(this.roundDecimal(this.getCellDataString(sheet, 15, 8), 0));
+            tDailyProductionReport.setEboChange(this.roundDecimal(this.getCellDataString(sheet, 15, 9), 0));
+            tDailyProductionReport.setEboImport(this.roundDecimal(this.getCellDataString(sheet, 15, 10), 0));
+            tDailyProductionReport.setEboExport(this.roundDecimal(this.getCellDataString(sheet, 15, 11), 0));
+            tDailyProductionReport.setEboToShip(this.roundDecimal(this.getCellDataString(sheet, 15, 12), 0));
+            tDailyProductionReport.setEboToRttf(this.roundDecimal(this.getCellDataString(sheet, 15, 13), 0));
+            tDailyProductionReport.setEboToTrain(this.roundDecimal(this.getCellDataString(sheet, 15, 14), 0));
+            tDailyProductionReport.setEboFrBd(this.roundDecimal(this.getCellDataString(sheet, 15, 15), 0));
             // rowIndex = 16
-            tDailyProductionReport.setRaff2FrIb(this.getCellDataString(sheet, 16, 0));
+            tDailyProductionReport.setRaff2FrIb(this.roundDecimal(this.getCellDataString(sheet, 16, 0), 0));
             // rowIndex = 17
-            tDailyProductionReport.setNaphthaleneYieldPercentage(this.getCellDataString(sheet, 17, 6));
-            tDailyProductionReport.setNaphthaleneProduced(this.getCellDataString(sheet, 17, 7));
-            tDailyProductionReport.setNaphthaleneInventory(this.getCellDataString(sheet, 17, 8));
-            tDailyProductionReport.setNaphthaleneChange(this.getCellDataString(sheet, 17, 9));
-            tDailyProductionReport.setNaphthaleneImport(this.getCellDataString(sheet, 17, 10));
-            tDailyProductionReport.setNaphthaleneExport(this.getCellDataString(sheet, 17, 11));
-            tDailyProductionReport.setNaphthaleneToTruck(this.getCellDataString(sheet, 17, 12));
+            tDailyProductionReport.setNaphthaleneYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 17, 6), 2));
+            tDailyProductionReport.setNaphthaleneProduced(this.roundDecimal(this.getCellDataString(sheet, 17, 7), 0));
+            tDailyProductionReport.setNaphthaleneInventory(this.roundDecimal(this.getCellDataString(sheet, 17, 8), 0));
+            tDailyProductionReport.setNaphthaleneChange(this.roundDecimal(this.getCellDataString(sheet, 17, 9), 0));
+            tDailyProductionReport.setNaphthaleneImport(this.roundDecimal(this.getCellDataString(sheet, 17, 10), 0));
+            tDailyProductionReport.setNaphthaleneExport(this.roundDecimal(this.getCellDataString(sheet, 17, 11), 0));
+            tDailyProductionReport.setNaphthaleneToTruck(this.roundDecimal(this.getCellDataString(sheet, 17, 12), 0));
             // rowIndex = 18
-            tDailyProductionReport.setRaff3FrBd(this.getCellDataString(sheet, 18, 0));
-            tDailyProductionReport.setAeuBenzeneToShip(this.getCellDataString(sheet, 18, 20));
-            tDailyProductionReport.setAeuBenzeneFrShip(this.getCellDataString(sheet, 18, 21));
+            tDailyProductionReport.setRaff3FrBd(this.roundDecimal(this.getCellDataString(sheet, 18, 0), 0));
+            tDailyProductionReport.setAeuBenzeneToShip(this.roundDecimal(this.getCellDataString(sheet, 18, 20), 0));
+            tDailyProductionReport.setAeuBenzeneFrShip(this.roundDecimal(this.getCellDataString(sheet, 18, 21), 0));
             // rowIndex = 19
-            tDailyProductionReport.setPoFluxOilYieldPercentage(this.getCellDataString(sheet, 19, 6));
-            tDailyProductionReport.setPoFluxOilProduced(this.getCellDataString(sheet, 19, 7));
-            tDailyProductionReport.setPoFluxOilInventory(this.getCellDataString(sheet, 19, 8));
-            tDailyProductionReport.setPoFluxOilChange(this.getCellDataString(sheet, 19, 9));
-            tDailyProductionReport.setPoFluxOilImport(this.getCellDataString(sheet, 19, 10));
-            tDailyProductionReport.setPoFluxOilExport(this.getCellDataString(sheet, 19, 11));
-            tDailyProductionReport.setPoFluxOilToBd(this.getCellDataString(sheet, 19, 12));
+            tDailyProductionReport.setPoFluxOilYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 19, 6), 2));
+            tDailyProductionReport.setPoFluxOilProduced(this.roundDecimal(this.getCellDataString(sheet, 19, 7), 0));
+            tDailyProductionReport.setPoFluxOilInventory(this.roundDecimal(this.getCellDataString(sheet, 19, 8), 0));
+            tDailyProductionReport.setPoFluxOilChange(this.roundDecimal(this.getCellDataString(sheet, 19, 9), 0));
+            tDailyProductionReport.setPoFluxOilImport(this.roundDecimal(this.getCellDataString(sheet, 19, 10), 0));
+            tDailyProductionReport.setPoFluxOilExport(this.roundDecimal(this.getCellDataString(sheet, 19, 11), 0));
+            tDailyProductionReport.setPoFluxOilToBd(this.roundDecimal(this.getCellDataString(sheet, 19, 12), 0));
             // rowIndex = 20
-            tDailyProductionReport.setRaffinate2pFr2ph(this.getCellDataString(sheet, 20, 0));
-            tDailyProductionReport.setAeuBenzeneToYbs(this.getCellDataString(sheet, 20, 20));
+            tDailyProductionReport.setRaffinate2pFr2ph(this.roundDecimal(this.getCellDataString(sheet, 20, 0), 0));
+            tDailyProductionReport.setAeuBenzeneToYbs(this.roundDecimal(this.getCellDataString(sheet, 20, 20), 0));
             // rowIndex = 21
-            tDailyProductionReport.setOffgasYieldPercentage(this.getCellDataString(sheet, 21, 6));
-            tDailyProductionReport.setOffgasProduced(this.getCellDataString(sheet, 21, 7));
-            tDailyProductionReport.setOffgasInventory(this.getCellDataString(sheet, 21, 8));
-            tDailyProductionReport.setOffgasChange(this.getCellDataString(sheet, 21, 9));
-            tDailyProductionReport.setOffgasImport(this.getCellDataString(sheet, 21, 10));
-            tDailyProductionReport.setOffgasExport(this.getCellDataString(sheet, 21, 11));
-            tDailyProductionReport.setOffgasToFurnance(this.getCellDataString(sheet, 21, 12));
-            tDailyProductionReport.setOffgasToYbs(this.getCellDataString(sheet, 21, 13));
-            tDailyProductionReport.setOffgasToCEru(this.getCellDataString(sheet, 21, 14));
-            tDailyProductionReport.setOffgasSubInCloseU2(this.getCellDataString(sheet, 21, 15));
-            tDailyProductionReport.setOffgasFlareSctu(this.getCellDataString(sheet, 21, 16));
-            tDailyProductionReport.setOffgasToU2Nm3(this.getCellDataString(sheet, 21, 17));
-            tDailyProductionReport.setOffgasFlareLossT(this.getCellDataString(sheet, 21, 18));
+            tDailyProductionReport.setOffgasYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 21, 6), 2));
+            tDailyProductionReport.setOffgasProduced(this.roundDecimal(this.getCellDataString(sheet, 21, 7), 0));
+            tDailyProductionReport.setOffgasInventory(this.roundDecimal(this.getCellDataString(sheet, 21, 8), 0));
+            tDailyProductionReport.setOffgasChange(this.roundDecimal(this.getCellDataString(sheet, 21, 9), 0));
+            tDailyProductionReport.setOffgasImport(this.roundDecimal(this.getCellDataString(sheet, 21, 10), 0));
+            tDailyProductionReport.setOffgasExport(this.roundDecimal(this.getCellDataString(sheet, 21, 11), 0));
+            tDailyProductionReport.setOffgasToFurnance(this.roundDecimal(this.getCellDataString(sheet, 21, 12), 0));
+            tDailyProductionReport.setOffgasToYbs(this.roundDecimal(this.getCellDataString(sheet, 21, 13), 0));
+            tDailyProductionReport.setOffgasToCEru(this.roundDecimal(this.getCellDataString(sheet, 21, 14), 0));
+            tDailyProductionReport.setOffgasSubInCloseU2(this.roundDecimal(this.getCellDataString(sheet, 21, 15), 0));
+            tDailyProductionReport.setOffgasFlareSctu(this.roundDecimal(this.getCellDataString(sheet, 21, 16), 0));
+            tDailyProductionReport.setOffgasToU2Nm3(this.roundDecimal(this.getCellDataString(sheet, 21, 17), 0));
+            tDailyProductionReport.setOffgasFlareLossT(this.roundDecimal(this.getCellDataString(sheet, 21, 18), 0));
             // rowIndex = 22
-            tDailyProductionReport.setC2FrLdpe(this.getCellDataString(sheet, 22, 0));
-            tDailyProductionReport.setAeuBenzeneToRttf(this.getCellDataString(sheet, 22, 20));
-            tDailyProductionReport.setAeuBenzeneToTrain(this.getCellDataString(sheet, 22, 21));
+            tDailyProductionReport.setC2FrLdpe(this.roundDecimal(this.getCellDataString(sheet, 22, 0), 0));
+            tDailyProductionReport.setAeuBenzeneToRttf(this.roundDecimal(this.getCellDataString(sheet, 22, 20), 1));
+            tDailyProductionReport.setAeuBenzeneToTrain(this.roundDecimal(this.getCellDataString(sheet, 22, 21), 0));
             // rowIndex = 23
-            tDailyProductionReport.setRpgYieldPercentage(this.getCellDataString(sheet, 23, 6));
-            tDailyProductionReport.setRpgProduced(this.getCellDataString(sheet, 23, 7));
-            tDailyProductionReport.setRpgInventory(this.getCellDataString(sheet, 23, 8));
-            tDailyProductionReport.setRpgChange(this.getCellDataString(sheet, 23, 9));
-            tDailyProductionReport.setRpgImport(this.getCellDataString(sheet, 23, 10));
-            tDailyProductionReport.setRpgExport(this.getCellDataString(sheet, 23, 11));
-            tDailyProductionReport.setRpgToPgu(this.getCellDataString(sheet, 23, 12));
-            tDailyProductionReport.setRpgFrYfcc(this.getCellDataString(sheet, 23, 13));
+            tDailyProductionReport.setRpgYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 23, 6), 2));
+            tDailyProductionReport.setRpgProduced(this.roundDecimal(this.getCellDataString(sheet, 23, 7), 0));
+            tDailyProductionReport.setRpgInventory(this.roundDecimal(this.getCellDataString(sheet, 23, 8), 0));
+            tDailyProductionReport.setRpgChange(this.roundDecimal(this.getCellDataString(sheet, 23, 9), 0));
+            tDailyProductionReport.setRpgImport(this.roundDecimal(this.getCellDataString(sheet, 23, 10), 0));
+            tDailyProductionReport.setRpgExport(this.roundDecimal(this.getCellDataString(sheet, 23, 11), 0));
+            tDailyProductionReport.setRpgToPgu(this.roundDecimal(this.getCellDataString(sheet, 23, 12), 0));
+            tDailyProductionReport.setRpgFrYfcc(this.roundDecimal(this.getCellDataString(sheet, 23, 13), 0));
             // rowIndex = 24
-            tDailyProductionReport.setC3FrOxo(this.getCellDataString(sheet, 24, 0));
+            tDailyProductionReport.setC3FrOxo(this.roundDecimal(this.getCellDataString(sheet, 24, 0), 0));
             // rowIndex = 25
-            tDailyProductionReport.setMethaneYieldPercentage(this.getCellDataString(sheet, 25, 6));
-            tDailyProductionReport.setMethaneProduced(this.getCellDataString(sheet, 25, 7));
-            tDailyProductionReport.setMethaneToEoEg(this.getCellDataString(sheet, 25, 8));
-            tDailyProductionReport.setAeuTolueneToShip(this.getCellDataString(sheet, 25, 20));
-            tDailyProductionReport.setAeuTolueneFrShip(this.getCellDataString(sheet, 25, 21));
+            tDailyProductionReport.setMethaneYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 25, 6), 2));
+            tDailyProductionReport.setMethaneProduced(this.roundDecimal(this.getCellDataString(sheet, 25, 7), 0));
+            tDailyProductionReport.setMethaneToEoEg(this.roundDecimal(this.getCellDataString(sheet, 25, 8), 0));
+            tDailyProductionReport.setAeuTolueneToShip(this.roundDecimal(this.getCellDataString(sheet, 25, 20), 0));
+            tDailyProductionReport.setAeuTolueneFrShip(this.roundDecimal(this.getCellDataString(sheet, 25, 21), 0));
             // rowIndex = 26
-            tDailyProductionReport.setMixedC3C4(this.getCellDataString(sheet, 26, 0));
-            tDailyProductionReport.setAeuBenzeneYeildPercentage(this.getCellDataString(sheet, 26, 17));
-            tDailyProductionReport.setAeuBenzeneInventory(this.getCellDataString(sheet, 26, 18));
+            tDailyProductionReport.setMixedC3C4(this.roundDecimal(this.getCellDataString(sheet, 26, 0), 0));
+            tDailyProductionReport.setAeuBenzeneYeildPercentage(this.roundPercentage(this.getCellDataString(sheet, 26, 17), 0));
+            tDailyProductionReport.setAeuBenzeneInventory(this.roundDecimal(this.getCellDataString(sheet, 26, 18), 0));
             // rowIndex = 27
-            tDailyProductionReport.setResidueOilYieldPercentage(this.getCellDataString(sheet, 27, 6));
-            tDailyProductionReport.setResidueOilProduced(this.getCellDataString(sheet, 27, 7));
-            tDailyProductionReport.setAeuBenzeneProduced(this.getCellDataString(sheet, 27, 17));
-            tDailyProductionReport.setAeuBenzeneChange(this.getCellDataString(sheet, 27, 18));
-            tDailyProductionReport.setAeuTolueneToYpc(this.getCellDataString(sheet, 27, 20));
-            tDailyProductionReport.setAeuTolueneFrYpc(this.getCellDataString(sheet, 27, 21));
+            tDailyProductionReport.setResidueOilYieldPercentage(this.roundPercentage(this.getCellDataString(sheet, 27, 6), 2));
+            tDailyProductionReport.setResidueOilProduced(this.roundDecimal(this.getCellDataString(sheet, 27, 7), 0));
+            tDailyProductionReport.setAeuBenzeneProduced(this.roundDecimal(this.getCellDataString(sheet, 27, 17), 0));
+            tDailyProductionReport.setAeuBenzeneChange(this.roundDecimal(this.getCellDataString(sheet, 27, 18), 0));
+            tDailyProductionReport.setAeuTolueneToYpc(this.roundDecimal(this.getCellDataString(sheet, 27, 20), 0));
+            tDailyProductionReport.setAeuTolueneFrYpc(this.roundDecimal(this.getCellDataString(sheet, 27, 21), 2));
             // rowIndex = 28
-            tDailyProductionReport.setHyC9(this.getCellDataString(sheet, 28, 0));
+            tDailyProductionReport.setHyC9(this.roundDecimal(this.getCellDataString(sheet, 28, 0), 0));
             tDailyProductionReport.setAeuTolueneYeildPercentage(this.getCellDataString(sheet, 28, 17));
             tDailyProductionReport.setAeuTolueneInventory(this.getCellDataString(sheet, 28, 18));
             // rowIndex = 29
@@ -301,7 +336,7 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setAeuTolueneToRttf(this.getCellDataString(sheet, 29, 20));
             tDailyProductionReport.setAeuTolueneFrYbs(this.getCellDataString(sheet, 29, 21));
             // rowIndex = 30
-            tDailyProductionReport.setPguOffgas(this.getCellDataString(sheet, 30, 0));
+            tDailyProductionReport.setPguOffgas(this.roundDecimal(this.getCellDataString(sheet, 30, 0), 0));
             tDailyProductionReport.setPguAeuTH(this.getCellDataString(sheet, 30, 13));
             tDailyProductionReport.setAeuXyleneYeildPercentage(this.getCellDataString(sheet, 30, 17));
             tDailyProductionReport.setAeuXyleneInventory(this.getCellDataString(sheet, 30, 18));
@@ -310,7 +345,7 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setAeuXyleneChange(this.getCellDataString(sheet, 31, 18));
             tDailyProductionReport.setAeuTolueneToEu(this.getCellDataString(sheet, 31, 20));
             // rowIndex = 32
-            tDailyProductionReport.setWashOil(this.getCellDataString(sheet, 32, 0));
+            tDailyProductionReport.setWashOil(this.roundDecimal(this.getCellDataString(sheet, 32, 0), 0));
             tDailyProductionReport.setPguToAeu(this.getCellDataString(sheet, 32, 13));
             tDailyProductionReport.setAeuC6C8NaYeildPercentage(this.getCellDataString(sheet, 32, 17));
             tDailyProductionReport.setAeuC6C8NaInventory(this.getCellDataString(sheet, 32, 18));
@@ -322,7 +357,7 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setAeuC6C8NaProduced(this.getCellDataString(sheet, 33, 17));
             tDailyProductionReport.setAeuC6C8NaChange(this.getCellDataString(sheet, 33, 18));
             // rowIndex = 34
-            tDailyProductionReport.setToluene(this.getCellDataString(sheet, 34, 0));
+            tDailyProductionReport.setToluene(this.roundDecimal(this.getCellDataString(sheet, 34, 0), 0));
             tDailyProductionReport.setRpgToPgu2(this.getCellDataString(sheet, 34, 6));
             tDailyProductionReport.setPguBtxProduced(this.getCellDataString(sheet, 34, 10));
             tDailyProductionReport.setPguBtxChange(this.getCellDataString(sheet, 34, 11));
@@ -333,7 +368,7 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             // rowIndex = 35
             tDailyProductionReport.setPguRpg1(this.getCellDataString(sheet, 35, 5));
             // rowIndex = 36
-            tDailyProductionReport.setHyC4FrR800(this.getCellDataString(sheet, 36, 0));
+            tDailyProductionReport.setHyC4FrR800(this.roundDecimal(this.getCellDataString(sheet, 36, 0), 0));
             tDailyProductionReport.setPguRpg2(this.getCellDataString(sheet, 36, 5));
             tDailyProductionReport.setPguToRpg(this.getCellDataString(sheet, 36, 6));
             tDailyProductionReport.setAeuTotalFeed(this.getCellDataString(sheet, 36, 17));
@@ -346,7 +381,7 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setAeuOutput(this.getCellDataString(sheet, 37, 17));
             tDailyProductionReport.setPguAeuOutput(this.getCellDataString(sheet, 37, 18));
             // rowIndex = 38
-            tDailyProductionReport.setTotalInput(this.getCellDataString(sheet, 38, 2));
+            tDailyProductionReport.setTotalInput(this.roundDecimal(this.getCellDataString(sheet, 38, 2), 0));
             tDailyProductionReport.setPguWashoilProduced(this.getCellDataString(sheet, 38, 10));
             tDailyProductionReport.setPguWashoilChange(this.getCellDataString(sheet, 38, 11));
             tDailyProductionReport.setPguWashoilToEu(this.getCellDataString(sheet, 38, 12));
@@ -354,28 +389,32 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setPguAeuTotalLoss(this.getCellDataString(sheet, 38, 18));
             tDailyProductionReport.setAeuXyleneToRttf(this.getCellDataString(sheet, 38, 20));
             // rowIndex = 39
-            tDailyProductionReport.setTotalOutput(this.getCellDataString(sheet, 39, 2));
+            tDailyProductionReport.setTotalOutput(this.roundDecimal(this.getCellDataString(sheet, 39, 2), 0));
             tDailyProductionReport.setPguH2(this.getCellDataString(sheet, 39, 5));
             tDailyProductionReport.setPguOffgasYeildPercentage(this.getCellDataString(sheet, 39, 10));
             tDailyProductionReport.setPguOffgasInventory(this.getCellDataString(sheet, 39, 11));
             tDailyProductionReport.setAeuLossPercentage(this.getCellDataString(sheet, 39, 17));
             tDailyProductionReport.setPguAeuLossPercentage(this.getCellDataString(sheet, 39, 18));
             // rowIndex = 40
-            tDailyProductionReport.setTotalLoss(this.getCellDataString(sheet, 40, 2));
+            String totalLoss = this.roundDecimal(this.getCellDataString(sheet, 40, 2), 0);
+            totalLoss = "(" + totalLoss.substring(1) + ")";
+            tDailyProductionReport.setTotalLoss(totalLoss);
             tDailyProductionReport.setPguOffgasProduced(this.getCellDataString(sheet, 40, 10));
             tDailyProductionReport.setPguOffgasChange(this.getCellDataString(sheet, 40, 11));
             tDailyProductionReport.setPguOffgasToEu(this.getCellDataString(sheet, 40, 12));
             tDailyProductionReport.setAeuFeedLoadPercentage(this.getCellDataString(sheet, 40, 17));
             tDailyProductionReport.setPguAeuFeedLoadPercentage(this.getCellDataString(sheet, 40, 18));
             // rowIndex = 41
-            tDailyProductionReport.setLossPercentage(this.getCellDataString(sheet, 41, 2));
+            String lossPercentage = this.roundDecimal(this.getCellDataString(sheet, 41, 2), 3);
+            lossPercentage = "(" + lossPercentage.substring(1) + ")";
+            tDailyProductionReport.setLossPercentage(lossPercentage);
             tDailyProductionReport.setPguTotalFeed(this.getCellDataString(sheet, 41, 6));
             tDailyProductionReport.setPguC5YeildPercentage(this.getCellDataString(sheet, 41, 10));
             tDailyProductionReport.setPguC5Export(this.getCellDataString(sheet, 41, 12));
             tDailyProductionReport.setAeuC6C8NaToEu(this.getCellDataString(sheet, 41, 20));
             tDailyProductionReport.setAeuC6C8NaToYpc(this.getCellDataString(sheet, 41, 21));
             // rowIndex = 42
-            tDailyProductionReport.setTotalFurnanceFeed(this.getCellDataString(sheet, 42, 2));
+            tDailyProductionReport.setTotalFurnanceFeed(this.roundDecimal(this.getCellDataString(sheet, 42, 2), 0));
             tDailyProductionReport.setPguOutput(this.getCellDataString(sheet, 42, 6));
             tDailyProductionReport.setPguC5Produced(this.getCellDataString(sheet, 42, 10));
             tDailyProductionReport.setPguC5RaffInput(this.getCellDataString(sheet, 42, 11));
@@ -383,13 +422,13 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setPguC5ToEu(this.getCellDataString(sheet, 42, 13));
             tDailyProductionReport.setPguC5ToYuanguan(this.getCellDataString(sheet, 42, 14));
             // rowIndex = 43
-            tDailyProductionReport.setNapFrCltf(this.getCellDataString(sheet, 43, 2));
+            tDailyProductionReport.setNapFrCltf(this.roundDecimal(this.getCellDataString(sheet, 43, 2), 0));
             tDailyProductionReport.setPguTotalLoss(this.getCellDataString(sheet, 43, 6));
             tDailyProductionReport.setPguC9YeildPercentage(this.getCellDataString(sheet, 43, 10));
             tDailyProductionReport.setPguC9Inventory(this.getCellDataString(sheet, 43, 11));
             tDailyProductionReport.setPguC9Export(this.getCellDataString(sheet, 43, 12));
             // rowIndex = 44
-            tDailyProductionReport.setTotalPE(this.getCellDataString(sheet, 44, 2));
+            tDailyProductionReport.setTotalPE(this.roundDecimal(this.getCellDataString(sheet, 44, 2), 3));
             tDailyProductionReport.setPguLossPercentage(this.getCellDataString(sheet, 44, 6));
             tDailyProductionReport.setPguC9Produced(this.getCellDataString(sheet, 44, 10));
             tDailyProductionReport.setPguC9Change(this.getCellDataString(sheet, 44, 11));
@@ -401,11 +440,11 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setPlantModeIs(this.getCellDataString(sheet, 45, 2));
             tDailyProductionReport.setPguFeedLoadPercentage(this.getCellDataString(sheet, 45, 6));
             // rowIndex = 46
-            tDailyProductionReport.setPlantLoad3495tD(this.getCellDataString(sheet, 46, 2));
+            tDailyProductionReport.setPlantLoad3495tD(this.roundPercentage(this.getCellDataString(sheet, 46, 2), 2));
             // rowIndex = 47
-            tDailyProductionReport.setAvgFurnanceFeedTH(this.getCellDataString(sheet, 47, 2));
+            tDailyProductionReport.setAvgFurnanceFeedTH(this.roundDecimal(this.getCellDataString(sheet, 47, 2), 0));
             // rowIndex = 48
-            tDailyProductionReport.setFeedingRatioPercentage(this.getCellDataString(sheet, 48, 2));
+            tDailyProductionReport.setFeedingRatioPercentage(this.roundPercentage(this.getCellDataString(sheet, 48, 2), 2));
             // rowIndex = 50
             tDailyProductionReport.setSctfStorageTotalC2(this.getCellDataString(sheet, 50, 16));
             tDailyProductionReport.setSctfStorageTk1061(this.getCellDataString(sheet, 50, 17));

+ 0 - 1
ui/src/views/production/daily/index.vue

@@ -1188,7 +1188,6 @@
             <td class="bg-yellow-light">
               <span v-if="!updating">{{reportData.totalInput}}</span>
               <el-input v-if="updating" size="mini" v-model="reportData.totalInput"/>
-              {{reportData.totalInput}}
             </td>
             <td class="no-border" colspan="2"></td>
             <td class="bg-blue-light">H2</td>