wangggziwen 2 лет назад
Родитель
Сommit
38729122f4

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

@@ -99,6 +99,102 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         return tMonthlyProductionReportMapper.deleteTMonthlyProductionReportById(id);
     }
 
+    /**
+     * 计算total的值:1~12月之和
+     *
+     * @param monthlyProductionReportVOs 前端月报数据集合
+     */
+    private void calcTotal(List<MonthlyProductionReportVO> monthlyProductionReportVOs) {
+        for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
+            MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
+            BigDecimal total = new BigDecimal("0");
+            String janStr = monthlyProductionReportVO.getJan();
+            String febStr = monthlyProductionReportVO.getFeb();
+            String marStr = monthlyProductionReportVO.getMar();
+            String aprStr = monthlyProductionReportVO.getApr();
+            String mayStr = monthlyProductionReportVO.getMay();
+            String junStr = monthlyProductionReportVO.getJun();
+            String julStr = monthlyProductionReportVO.getJul();
+            String augStr = monthlyProductionReportVO.getAug();
+            String sepStr = monthlyProductionReportVO.getSep();
+            String octStr = monthlyProductionReportVO.getOct();
+            String novStr = monthlyProductionReportVO.getNov();
+            String decStr = monthlyProductionReportVO.getDec();
+            BigDecimal jan = new BigDecimal(janStr == null ? "0" : janStr);
+            BigDecimal feb = new BigDecimal(febStr == null ? "0" : febStr);
+            BigDecimal mar = new BigDecimal(marStr == null ? "0" : marStr);
+            BigDecimal apr = new BigDecimal(aprStr == null ? "0" : aprStr);
+            BigDecimal may = new BigDecimal(mayStr == null ? "0" : mayStr);
+            BigDecimal jun = new BigDecimal(junStr == null ? "0" : junStr);
+            BigDecimal jul = new BigDecimal(julStr == null ? "0" : julStr);
+            BigDecimal aug = new BigDecimal(augStr == null ? "0" : augStr);
+            BigDecimal sep = new BigDecimal(sepStr == null ? "0" : sepStr);
+            BigDecimal oct = new BigDecimal(octStr == null ? "0" : octStr);
+            BigDecimal nov = new BigDecimal(novStr == null ? "0" : novStr);
+            BigDecimal dec = new BigDecimal(decStr == null ? "0" : decStr);
+            total = jan.add(feb).add(mar).add(apr).add(may).add(jun).add(jul).add(aug).add(sep).add(oct).add(nov).add(dec);
+            monthlyProductionReportVO.setTotal(total.toString());
+        }
+    }
+
+    /**
+     * 根据当前月份,获取相应的set方法
+     *
+     * @param reportMonth 当前月份
+     * @param clazz VO的类型
+     * @return 相应的set方法
+     */
+    private Method getSetMethod(Long reportMonth, Class clazz) {
+        Method method = null;
+        try {
+            switch (reportMonth.toString()) {
+                case "1":   // 一月
+                    method =  clazz.getDeclaredMethod("setJan", String.class);
+                    break;
+                case "2":   // 二月
+                    method =  clazz.getDeclaredMethod("setFeb", String.class);
+                    break;
+                case "3":   // 三月
+                    method =  clazz.getDeclaredMethod("setMar", String.class);
+                    break;
+                case "4":   // 四月
+                    method =  clazz.getDeclaredMethod("setApr", String.class);
+                    break;
+                case "5":   // 五月
+                    method =  clazz.getDeclaredMethod("setMay", String.class);
+                    break;
+                case "6":   // 六月
+                    method =  clazz.getDeclaredMethod("setJun", String.class);
+                    break;
+                case "7":   // 七月
+                    method =  clazz.getDeclaredMethod("setJul", String.class);
+                    break;
+                case "8":   // 八月
+                    method =  clazz.getDeclaredMethod("setAug", String.class);
+                    break;
+                case "9":   // 九月
+                    method =  clazz.getDeclaredMethod("setSep", String.class);
+                    break;
+                case "10":   // 十月
+                    method =  clazz.getDeclaredMethod("setOct", String.class);
+                    break;
+                case "11":   // 十一月
+                    method =  clazz.getDeclaredMethod("setNov", String.class);
+                    break;
+                case "12":   // 十二月
+                    method =  clazz.getDeclaredMethod("setDec", String.class);
+                    break;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            return method;
+        }
+    }
+
+    /**
+     * 按年份查询Cracker Raw Material
+     */
     @Override
     public List<MonthlyProductionReportVO> selectCrackerRawMaterialByYear(Long year) {
         // 当前日期
@@ -147,52 +243,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             String hyC4FrR800 = tMonthlyProductionReport.getHyC4FrR800();
             String crackerRawInput = tMonthlyProductionReport.getCrackerRawInput();
             String crackerRawFeed = tMonthlyProductionReport.getCrackerRawFeed();
+            Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
+            Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
             // 前端数据集合的class
             Class clazz = null;
             // 当前元素调用的set方法
             Method method = null;
             try {
-                Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
-                Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
                 clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
-                switch (reportMonth.toString()) {
-                    case "1":   // 一月
-                        method = clazz.getDeclaredMethod("setJan", String.class);
-                        break;
-                    case "2":   // 二月
-                        method = clazz.getDeclaredMethod("setFeb", String.class);
-                        break;
-                    case "3":   // 三月
-                        method = clazz.getDeclaredMethod("setMar", String.class);
-                        break;
-                    case "4":   // 四月
-                        method = clazz.getDeclaredMethod("setApr", String.class);
-                        break;
-                    case "5":   // 五月
-                        method = clazz.getDeclaredMethod("setMay", String.class);
-                        break;
-                    case "6":   // 六月
-                        method = clazz.getDeclaredMethod("setJun", String.class);
-                        break;
-                    case "7":   // 七月
-                        method = clazz.getDeclaredMethod("setJul", String.class);
-                        break;
-                    case "8":   // 八月
-                        method = clazz.getDeclaredMethod("setAug", String.class);
-                        break;
-                    case "9":   // 九月
-                        method = clazz.getDeclaredMethod("setSep", String.class);
-                        break;
-                    case "10":   // 十月
-                        method = clazz.getDeclaredMethod("setOct", String.class);
-                        break;
-                    case "11":   // 十一月
-                        method = clazz.getDeclaredMethod("setNov", String.class);
-                        break;
-                    case "12":   // 十二月
-                        method = clazz.getDeclaredMethod("setDec", String.class);
-                        break;
-                }
+                method = this.getSetMethod(reportMonth, clazz);
                 // 按照当前元素的所属月份调取相应set方法
                 method.invoke(monthlyProductionReportVOs.get(0), crackerRawInput);
                 method.invoke(monthlyProductionReportVOs.get(1), nap);
@@ -235,39 +294,13 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
                 e.printStackTrace();
             }
         }
-        // 遍历前端月报数据集合,计算total的值1~12月之和)
-        for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
-            MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
-            BigDecimal total = new BigDecimal("0");
-            String janStr = monthlyProductionReportVO.getJan();
-            String febStr = monthlyProductionReportVO.getFeb();
-            String marStr = monthlyProductionReportVO.getMar();
-            String aprStr = monthlyProductionReportVO.getApr();
-            String mayStr = monthlyProductionReportVO.getMay();
-            String junStr = monthlyProductionReportVO.getJun();
-            String julStr = monthlyProductionReportVO.getJul();
-            String augStr = monthlyProductionReportVO.getAug();
-            String sepStr = monthlyProductionReportVO.getSep();
-            String octStr = monthlyProductionReportVO.getOct();
-            String novStr = monthlyProductionReportVO.getNov();
-            String decStr = monthlyProductionReportVO.getDec();
-            BigDecimal jan = new BigDecimal(janStr == null ? "0" : janStr);
-            BigDecimal feb = new BigDecimal(febStr == null ? "0" : febStr);
-            BigDecimal mar = new BigDecimal(marStr == null ? "0" : marStr);
-            BigDecimal apr = new BigDecimal(aprStr == null ? "0" : aprStr);
-            BigDecimal may = new BigDecimal(mayStr == null ? "0" : mayStr);
-            BigDecimal jun = new BigDecimal(junStr == null ? "0" : junStr);
-            BigDecimal jul = new BigDecimal(julStr == null ? "0" : julStr);
-            BigDecimal aug = new BigDecimal(augStr == null ? "0" : augStr);
-            BigDecimal sep = new BigDecimal(sepStr == null ? "0" : sepStr);
-            BigDecimal oct = new BigDecimal(octStr == null ? "0" : octStr);
-            BigDecimal nov = new BigDecimal(novStr == null ? "0" : novStr);
-            BigDecimal dec = new BigDecimal(decStr == null ? "0" : decStr);
-            total = jan.add(feb).add(mar).add(apr).add(may).add(jun).add(jul).add(aug).add(sep).add(oct).add(nov).add(dec);
-            monthlyProductionReportVO.setTotal(total.toString());
-        }
+        this.calcTotal(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
     }
+
+    /**
+     * 按年份查询Cracker Output Product
+     */
     @Override
     public List<MonthlyProductionReportVO> selectCrackerOutputProductByYear(Long year) {
         // 当前日期
@@ -310,52 +343,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             String methaneProduced = tMonthlyProductionReport.getMethaneProduced();
             String offgasProduced = tMonthlyProductionReport.getOffgasProduced();
             String crackerOutput = tMonthlyProductionReport.getCrackerOutput();
+            Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
+            Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
             // 前端数据集合的class
             Class clazz = null;
             // 当前元素调用的set方法
             Method method = null;
             try {
-                Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
-                Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
                 clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
-                switch (reportMonth.toString()) {
-                    case "1":   // 一月
-                        method = clazz.getDeclaredMethod("setJan", String.class);
-                        break;
-                    case "2":   // 二月
-                        method = clazz.getDeclaredMethod("setFeb", String.class);
-                        break;
-                    case "3":   // 三月
-                        method = clazz.getDeclaredMethod("setMar", String.class);
-                        break;
-                    case "4":   // 四月
-                        method = clazz.getDeclaredMethod("setApr", String.class);
-                        break;
-                    case "5":   // 五月
-                        method = clazz.getDeclaredMethod("setMay", String.class);
-                        break;
-                    case "6":   // 六月
-                        method = clazz.getDeclaredMethod("setJun", String.class);
-                        break;
-                    case "7":   // 七月
-                        method = clazz.getDeclaredMethod("setJul", String.class);
-                        break;
-                    case "8":   // 八月
-                        method = clazz.getDeclaredMethod("setAug", String.class);
-                        break;
-                    case "9":   // 九月
-                        method = clazz.getDeclaredMethod("setSep", String.class);
-                        break;
-                    case "10":   // 十月
-                        method = clazz.getDeclaredMethod("setOct", String.class);
-                        break;
-                    case "11":   // 十一月
-                        method = clazz.getDeclaredMethod("setNov", String.class);
-                        break;
-                    case "12":   // 十二月
-                        method = clazz.getDeclaredMethod("setDec", String.class);
-                        break;
-                }
+                method = this.getSetMethod(reportMonth, clazz);
                 // 按照当前元素的所属月份调取相应set方法
                 method.invoke(monthlyProductionReportVOs.get(0), crackerOutput);
                 method.invoke(monthlyProductionReportVOs.get(1), h2Produced);
@@ -392,39 +388,13 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
                 e.printStackTrace();
             }
         }
-        // 遍历前端月报数据集合,计算total的值1~12月之和)
-        for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
-            MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
-            BigDecimal total = new BigDecimal("0");
-            String janStr = monthlyProductionReportVO.getJan();
-            String febStr = monthlyProductionReportVO.getFeb();
-            String marStr = monthlyProductionReportVO.getMar();
-            String aprStr = monthlyProductionReportVO.getApr();
-            String mayStr = monthlyProductionReportVO.getMay();
-            String junStr = monthlyProductionReportVO.getJun();
-            String julStr = monthlyProductionReportVO.getJul();
-            String augStr = monthlyProductionReportVO.getAug();
-            String sepStr = monthlyProductionReportVO.getSep();
-            String octStr = monthlyProductionReportVO.getOct();
-            String novStr = monthlyProductionReportVO.getNov();
-            String decStr = monthlyProductionReportVO.getDec();
-            BigDecimal jan = new BigDecimal(janStr == null ? "0" : janStr);
-            BigDecimal feb = new BigDecimal(febStr == null ? "0" : febStr);
-            BigDecimal mar = new BigDecimal(marStr == null ? "0" : marStr);
-            BigDecimal apr = new BigDecimal(aprStr == null ? "0" : aprStr);
-            BigDecimal may = new BigDecimal(mayStr == null ? "0" : mayStr);
-            BigDecimal jun = new BigDecimal(junStr == null ? "0" : junStr);
-            BigDecimal jul = new BigDecimal(julStr == null ? "0" : julStr);
-            BigDecimal aug = new BigDecimal(augStr == null ? "0" : augStr);
-            BigDecimal sep = new BigDecimal(sepStr == null ? "0" : sepStr);
-            BigDecimal oct = new BigDecimal(octStr == null ? "0" : octStr);
-            BigDecimal nov = new BigDecimal(novStr == null ? "0" : novStr);
-            BigDecimal dec = new BigDecimal(decStr == null ? "0" : decStr);
-            total = jan.add(feb).add(mar).add(apr).add(may).add(jun).add(jul).add(aug).add(sep).add(oct).add(nov).add(dec);
-            monthlyProductionReportVO.setTotal(total.toString());
-        }
+        this.calcTotal(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
     }
+
+    /**
+     * 按年份查询Aromatics Raw Material
+     */
     @Override
     public List<MonthlyProductionReportVO> selectAromaticsRawMaterialByYear(Long year) {
         // 当前日期
@@ -451,52 +421,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             String pguBtxProduced = tMonthlyProductionReport.getPguBtxProduced();
             String pguBtxToAeu = tMonthlyProductionReport.getPguBtxToAeu();
             String aromaticsRawInput = tMonthlyProductionReport.getAromaticsRawInput();
+            Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
+            Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
             // 前端数据集合的class
             Class clazz = null;
             // 当前元素调用的set方法
             Method method = null;
             try {
-                Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
-                Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
                 clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
-                switch (reportMonth.toString()) {
-                    case "1":   // 一月
-                        method = clazz.getDeclaredMethod("setJan", String.class);
-                        break;
-                    case "2":   // 二月
-                        method = clazz.getDeclaredMethod("setFeb", String.class);
-                        break;
-                    case "3":   // 三月
-                        method = clazz.getDeclaredMethod("setMar", String.class);
-                        break;
-                    case "4":   // 四月
-                        method = clazz.getDeclaredMethod("setApr", String.class);
-                        break;
-                    case "5":   // 五月
-                        method = clazz.getDeclaredMethod("setMay", String.class);
-                        break;
-                    case "6":   // 六月
-                        method = clazz.getDeclaredMethod("setJun", String.class);
-                        break;
-                    case "7":   // 七月
-                        method = clazz.getDeclaredMethod("setJul", String.class);
-                        break;
-                    case "8":   // 八月
-                        method = clazz.getDeclaredMethod("setAug", String.class);
-                        break;
-                    case "9":   // 九月
-                        method = clazz.getDeclaredMethod("setSep", String.class);
-                        break;
-                    case "10":   // 十月
-                        method = clazz.getDeclaredMethod("setOct", String.class);
-                        break;
-                    case "11":   // 十一月
-                        method = clazz.getDeclaredMethod("setNov", String.class);
-                        break;
-                    case "12":   // 十二月
-                        method = clazz.getDeclaredMethod("setDec", String.class);
-                        break;
-                }
+                method = this.getSetMethod(reportMonth, clazz);
                 // 按照当前元素的所属月份调取相应set方法
                 method.invoke(monthlyProductionReportVOs.get(0), aromaticsRawInput);
                 method.invoke(monthlyProductionReportVOs.get(1), pguRpg2);
@@ -517,39 +450,13 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
                 e.printStackTrace();
             }
         }
-        // 遍历前端月报数据集合,计算total的值1~12月之和)
-        for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
-            MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
-            BigDecimal total = new BigDecimal("0");
-            String janStr = monthlyProductionReportVO.getJan();
-            String febStr = monthlyProductionReportVO.getFeb();
-            String marStr = monthlyProductionReportVO.getMar();
-            String aprStr = monthlyProductionReportVO.getApr();
-            String mayStr = monthlyProductionReportVO.getMay();
-            String junStr = monthlyProductionReportVO.getJun();
-            String julStr = monthlyProductionReportVO.getJul();
-            String augStr = monthlyProductionReportVO.getAug();
-            String sepStr = monthlyProductionReportVO.getSep();
-            String octStr = monthlyProductionReportVO.getOct();
-            String novStr = monthlyProductionReportVO.getNov();
-            String decStr = monthlyProductionReportVO.getDec();
-            BigDecimal jan = new BigDecimal(janStr == null ? "0" : janStr);
-            BigDecimal feb = new BigDecimal(febStr == null ? "0" : febStr);
-            BigDecimal mar = new BigDecimal(marStr == null ? "0" : marStr);
-            BigDecimal apr = new BigDecimal(aprStr == null ? "0" : aprStr);
-            BigDecimal may = new BigDecimal(mayStr == null ? "0" : mayStr);
-            BigDecimal jun = new BigDecimal(junStr == null ? "0" : junStr);
-            BigDecimal jul = new BigDecimal(julStr == null ? "0" : julStr);
-            BigDecimal aug = new BigDecimal(augStr == null ? "0" : augStr);
-            BigDecimal sep = new BigDecimal(sepStr == null ? "0" : sepStr);
-            BigDecimal oct = new BigDecimal(octStr == null ? "0" : octStr);
-            BigDecimal nov = new BigDecimal(novStr == null ? "0" : novStr);
-            BigDecimal dec = new BigDecimal(decStr == null ? "0" : decStr);
-            total = jan.add(feb).add(mar).add(apr).add(may).add(jun).add(jul).add(aug).add(sep).add(oct).add(nov).add(dec);
-            monthlyProductionReportVO.setTotal(total.toString());
-        }
+        this.calcTotal(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
     }
+
+    /**
+     * 按年份查询Aromatics Output Product
+     */
     @Override
     public List<MonthlyProductionReportVO> selectAromaticsOutputProductByYear(Long year) {
         // 当前日期
@@ -590,52 +497,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
             String pguBtxProduced = tMonthlyProductionReport.getPguBtxProduced();
             String aeuTolueneProducedMEu = tMonthlyProductionReport.getAeuTolueneProducedMEu();
             String aromaticsOutput = tMonthlyProductionReport.getAromaticsOutput();
+            Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
+            Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
             // 前端数据集合的class
             Class clazz = null;
             // 当前元素调用的set方法
             Method method = null;
             try {
-                Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
-                Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
                 clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
-                switch (reportMonth.toString()) {
-                    case "1":   // 一月
-                        method = clazz.getDeclaredMethod("setJan", String.class);
-                        break;
-                    case "2":   // 二月
-                        method = clazz.getDeclaredMethod("setFeb", String.class);
-                        break;
-                    case "3":   // 三月
-                        method = clazz.getDeclaredMethod("setMar", String.class);
-                        break;
-                    case "4":   // 四月
-                        method = clazz.getDeclaredMethod("setApr", String.class);
-                        break;
-                    case "5":   // 五月
-                        method = clazz.getDeclaredMethod("setMay", String.class);
-                        break;
-                    case "6":   // 六月
-                        method = clazz.getDeclaredMethod("setJun", String.class);
-                        break;
-                    case "7":   // 七月
-                        method = clazz.getDeclaredMethod("setJul", String.class);
-                        break;
-                    case "8":   // 八月
-                        method = clazz.getDeclaredMethod("setAug", String.class);
-                        break;
-                    case "9":   // 九月
-                        method = clazz.getDeclaredMethod("setSep", String.class);
-                        break;
-                    case "10":   // 十月
-                        method = clazz.getDeclaredMethod("setOct", String.class);
-                        break;
-                    case "11":   // 十一月
-                        method = clazz.getDeclaredMethod("setNov", String.class);
-                        break;
-                    case "12":   // 十二月
-                        method = clazz.getDeclaredMethod("setDec", String.class);
-                        break;
-                }
+                method = this.getSetMethod(reportMonth, clazz);
                 // 按照当前元素的所属月份调取相应set方法
                 method.invoke(monthlyProductionReportVOs.get(0), aromaticsOutput);
                 method.invoke(monthlyProductionReportVOs.get(1), aeuBenzeneProduced);
@@ -670,108 +540,152 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
                 e.printStackTrace();
             }
         }
-        // 遍历前端月报数据集合,计算total的值1~12月之和)
-        for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
-            MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
-            BigDecimal total = new BigDecimal("0");
-            String janStr = monthlyProductionReportVO.getJan();
-            String febStr = monthlyProductionReportVO.getFeb();
-            String marStr = monthlyProductionReportVO.getMar();
-            String aprStr = monthlyProductionReportVO.getApr();
-            String mayStr = monthlyProductionReportVO.getMay();
-            String junStr = monthlyProductionReportVO.getJun();
-            String julStr = monthlyProductionReportVO.getJul();
-            String augStr = monthlyProductionReportVO.getAug();
-            String sepStr = monthlyProductionReportVO.getSep();
-            String octStr = monthlyProductionReportVO.getOct();
-            String novStr = monthlyProductionReportVO.getNov();
-            String decStr = monthlyProductionReportVO.getDec();
-            BigDecimal jan = new BigDecimal(janStr == null ? "0" : janStr);
-            BigDecimal feb = new BigDecimal(febStr == null ? "0" : febStr);
-            BigDecimal mar = new BigDecimal(marStr == null ? "0" : marStr);
-            BigDecimal apr = new BigDecimal(aprStr == null ? "0" : aprStr);
-            BigDecimal may = new BigDecimal(mayStr == null ? "0" : mayStr);
-            BigDecimal jun = new BigDecimal(junStr == null ? "0" : junStr);
-            BigDecimal jul = new BigDecimal(julStr == null ? "0" : julStr);
-            BigDecimal aug = new BigDecimal(augStr == null ? "0" : augStr);
-            BigDecimal sep = new BigDecimal(sepStr == null ? "0" : sepStr);
-            BigDecimal oct = new BigDecimal(octStr == null ? "0" : octStr);
-            BigDecimal nov = new BigDecimal(novStr == null ? "0" : novStr);
-            BigDecimal dec = new BigDecimal(decStr == null ? "0" : decStr);
-            total = jan.add(feb).add(mar).add(apr).add(may).add(jun).add(jul).add(aug).add(sep).add(oct).add(nov).add(dec);
-            monthlyProductionReportVO.setTotal(total.toString());
-        }
+        this.calcTotal(monthlyProductionReportVOs);
         return monthlyProductionReportVOs;
     }
+
+    /**
+     * 按年份查询Eligible Product Rate
+     */
     @Override
     public List<MonthlyProductionReportVO> selectEligibleProductRateByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Product Yield
+     */
     @Override
     public List<MonthlyProductionReportVO> selectProductYieldByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Cracker Utility Consumption
+     */
     @Override
     public List<MonthlyProductionReportVO> selectCrackerUtilityConsumptionByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Cracker Energy Consumption
+     */
     @Override
     public List<MonthlyProductionReportVO> selectCrackerEnergyConsumptionByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Aromatics Utility Consumption
+     */
     @Override
     public List<MonthlyProductionReportVO> selectAromaticsUtilityConsumptionByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Aromatics Energy Consumption
+     */
     @Override
     public List<MonthlyProductionReportVO> selectAromaticsEnergyConsumptionByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Plant Load
+     */
     @Override
     public List<MonthlyProductionReportVO> selectPlantLoadByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Cost Fr Ethylene
+     */
     @Override
     public List<MonthlyProductionReportVO> selectCostFrEthyleneByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Runing Rate
+     */
     @Override
     public List<MonthlyProductionReportVO> selectRuningRateByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Shoudown Hour
+     */
     @Override
     public List<MonthlyProductionReportVO> selectShoudownHourByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Otherside
+     */
     @Override
     public List<MonthlyProductionReportVO> selectOthersideByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Chemical Consume
+     */
     @Override
     public List<MonthlyProductionReportVO> selectChemicalConsumeByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询SCTU Utility Consumption
+     */
     @Override
     public List<MonthlyProductionReportVO> selectSCTUUtilityConsumptionByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询SUB Utility Consumption
+     */
     @Override
     public List<MonthlyProductionReportVO> selectSUBUtilityConsumptionByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询SCTF Utility Consumption
+     */
     @Override
     public List<MonthlyProductionReportVO> selectSCTFUtilityConsumptionByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询KBI
+     */
     @Override
     public List<MonthlyProductionReportVO> selectKbiByYear(Long year) {
         return  null;
     }
+
+    /**
+     * 按年份查询Summary
+     */
     @Override
     public List<MonthlyProductionReportVO> selectSummaryByYear(Long year) {
         return  null;
     }
 
+    /**
+     * 查询趋势分析数据
+     *
+     * @param monthlyAnalysisQueryVO 查询参数
+     * @return
+     */
     @Override
     public List<MonthlyAnalysisDataVO> selectAnalysisData(MonthlyAnalysisQueryVO monthlyAnalysisQueryVO) {
         if (monthlyAnalysisQueryVO.getFromYear()==monthlyAnalysisQueryVO.getToYear()) {