|
@@ -99,6 +99,102 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
return tMonthlyProductionReportMapper.deleteTMonthlyProductionReportById(id);
|
|
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
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectCrackerRawMaterialByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectCrackerRawMaterialByYear(Long year) {
|
|
// 当前日期
|
|
// 当前日期
|
|
@@ -147,52 +243,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
String hyC4FrR800 = tMonthlyProductionReport.getHyC4FrR800();
|
|
String hyC4FrR800 = tMonthlyProductionReport.getHyC4FrR800();
|
|
String crackerRawInput = tMonthlyProductionReport.getCrackerRawInput();
|
|
String crackerRawInput = tMonthlyProductionReport.getCrackerRawInput();
|
|
String crackerRawFeed = tMonthlyProductionReport.getCrackerRawFeed();
|
|
String crackerRawFeed = tMonthlyProductionReport.getCrackerRawFeed();
|
|
|
|
+ Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
+ Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
// 前端数据集合的class
|
|
// 前端数据集合的class
|
|
Class clazz = null;
|
|
Class clazz = null;
|
|
// 当前元素调用的set方法
|
|
// 当前元素调用的set方法
|
|
Method method = null;
|
|
Method method = null;
|
|
try {
|
|
try {
|
|
- Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
- Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
|
|
clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
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方法
|
|
// 按照当前元素的所属月份调取相应set方法
|
|
method.invoke(monthlyProductionReportVOs.get(0), crackerRawInput);
|
|
method.invoke(monthlyProductionReportVOs.get(0), crackerRawInput);
|
|
method.invoke(monthlyProductionReportVOs.get(1), nap);
|
|
method.invoke(monthlyProductionReportVOs.get(1), nap);
|
|
@@ -235,39 +294,13 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
e.printStackTrace();
|
|
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;
|
|
return monthlyProductionReportVOs;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Cracker Output Product
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectCrackerOutputProductByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectCrackerOutputProductByYear(Long year) {
|
|
// 当前日期
|
|
// 当前日期
|
|
@@ -310,52 +343,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
String methaneProduced = tMonthlyProductionReport.getMethaneProduced();
|
|
String methaneProduced = tMonthlyProductionReport.getMethaneProduced();
|
|
String offgasProduced = tMonthlyProductionReport.getOffgasProduced();
|
|
String offgasProduced = tMonthlyProductionReport.getOffgasProduced();
|
|
String crackerOutput = tMonthlyProductionReport.getCrackerOutput();
|
|
String crackerOutput = tMonthlyProductionReport.getCrackerOutput();
|
|
|
|
+ Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
+ Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
// 前端数据集合的class
|
|
// 前端数据集合的class
|
|
Class clazz = null;
|
|
Class clazz = null;
|
|
// 当前元素调用的set方法
|
|
// 当前元素调用的set方法
|
|
Method method = null;
|
|
Method method = null;
|
|
try {
|
|
try {
|
|
- Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
- Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
|
|
clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
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方法
|
|
// 按照当前元素的所属月份调取相应set方法
|
|
method.invoke(monthlyProductionReportVOs.get(0), crackerOutput);
|
|
method.invoke(monthlyProductionReportVOs.get(0), crackerOutput);
|
|
method.invoke(monthlyProductionReportVOs.get(1), h2Produced);
|
|
method.invoke(monthlyProductionReportVOs.get(1), h2Produced);
|
|
@@ -392,39 +388,13 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
e.printStackTrace();
|
|
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;
|
|
return monthlyProductionReportVOs;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Aromatics Raw Material
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectAromaticsRawMaterialByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectAromaticsRawMaterialByYear(Long year) {
|
|
// 当前日期
|
|
// 当前日期
|
|
@@ -451,52 +421,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
String pguBtxProduced = tMonthlyProductionReport.getPguBtxProduced();
|
|
String pguBtxProduced = tMonthlyProductionReport.getPguBtxProduced();
|
|
String pguBtxToAeu = tMonthlyProductionReport.getPguBtxToAeu();
|
|
String pguBtxToAeu = tMonthlyProductionReport.getPguBtxToAeu();
|
|
String aromaticsRawInput = tMonthlyProductionReport.getAromaticsRawInput();
|
|
String aromaticsRawInput = tMonthlyProductionReport.getAromaticsRawInput();
|
|
|
|
+ Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
+ Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
// 前端数据集合的class
|
|
// 前端数据集合的class
|
|
Class clazz = null;
|
|
Class clazz = null;
|
|
// 当前元素调用的set方法
|
|
// 当前元素调用的set方法
|
|
Method method = null;
|
|
Method method = null;
|
|
try {
|
|
try {
|
|
- Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
- Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
|
|
clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
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方法
|
|
// 按照当前元素的所属月份调取相应set方法
|
|
method.invoke(monthlyProductionReportVOs.get(0), aromaticsRawInput);
|
|
method.invoke(monthlyProductionReportVOs.get(0), aromaticsRawInput);
|
|
method.invoke(monthlyProductionReportVOs.get(1), pguRpg2);
|
|
method.invoke(monthlyProductionReportVOs.get(1), pguRpg2);
|
|
@@ -517,39 +450,13 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
e.printStackTrace();
|
|
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;
|
|
return monthlyProductionReportVOs;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Aromatics Output Product
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectAromaticsOutputProductByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectAromaticsOutputProductByYear(Long year) {
|
|
// 当前日期
|
|
// 当前日期
|
|
@@ -590,52 +497,15 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
String pguBtxProduced = tMonthlyProductionReport.getPguBtxProduced();
|
|
String pguBtxProduced = tMonthlyProductionReport.getPguBtxProduced();
|
|
String aeuTolueneProducedMEu = tMonthlyProductionReport.getAeuTolueneProducedMEu();
|
|
String aeuTolueneProducedMEu = tMonthlyProductionReport.getAeuTolueneProducedMEu();
|
|
String aromaticsOutput = tMonthlyProductionReport.getAromaticsOutput();
|
|
String aromaticsOutput = tMonthlyProductionReport.getAromaticsOutput();
|
|
|
|
+ Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
+ Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
// 前端数据集合的class
|
|
// 前端数据集合的class
|
|
Class clazz = null;
|
|
Class clazz = null;
|
|
// 当前元素调用的set方法
|
|
// 当前元素调用的set方法
|
|
Method method = null;
|
|
Method method = null;
|
|
try {
|
|
try {
|
|
- Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
|
- Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
|
|
clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
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方法
|
|
// 按照当前元素的所属月份调取相应set方法
|
|
method.invoke(monthlyProductionReportVOs.get(0), aromaticsOutput);
|
|
method.invoke(monthlyProductionReportVOs.get(0), aromaticsOutput);
|
|
method.invoke(monthlyProductionReportVOs.get(1), aeuBenzeneProduced);
|
|
method.invoke(monthlyProductionReportVOs.get(1), aeuBenzeneProduced);
|
|
@@ -670,108 +540,152 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
e.printStackTrace();
|
|
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;
|
|
return monthlyProductionReportVOs;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Eligible Product Rate
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectEligibleProductRateByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectEligibleProductRateByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Product Yield
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectProductYieldByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectProductYieldByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Cracker Utility Consumption
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectCrackerUtilityConsumptionByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectCrackerUtilityConsumptionByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Cracker Energy Consumption
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectCrackerEnergyConsumptionByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectCrackerEnergyConsumptionByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Aromatics Utility Consumption
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectAromaticsUtilityConsumptionByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectAromaticsUtilityConsumptionByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Aromatics Energy Consumption
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectAromaticsEnergyConsumptionByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectAromaticsEnergyConsumptionByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Plant Load
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectPlantLoadByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectPlantLoadByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Cost Fr Ethylene
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectCostFrEthyleneByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectCostFrEthyleneByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Runing Rate
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectRuningRateByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectRuningRateByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Shoudown Hour
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectShoudownHourByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectShoudownHourByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Otherside
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectOthersideByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectOthersideByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Chemical Consume
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectChemicalConsumeByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectChemicalConsumeByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询SCTU Utility Consumption
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectSCTUUtilityConsumptionByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectSCTUUtilityConsumptionByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询SUB Utility Consumption
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectSUBUtilityConsumptionByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectSUBUtilityConsumptionByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询SCTF Utility Consumption
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectSCTFUtilityConsumptionByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectSCTFUtilityConsumptionByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询KBI
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectKbiByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectKbiByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 按年份查询Summary
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyProductionReportVO> selectSummaryByYear(Long year) {
|
|
public List<MonthlyProductionReportVO> selectSummaryByYear(Long year) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查询趋势分析数据
|
|
|
|
+ *
|
|
|
|
+ * @param monthlyAnalysisQueryVO 查询参数
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<MonthlyAnalysisDataVO> selectAnalysisData(MonthlyAnalysisQueryVO monthlyAnalysisQueryVO) {
|
|
public List<MonthlyAnalysisDataVO> selectAnalysisData(MonthlyAnalysisQueryVO monthlyAnalysisQueryVO) {
|
|
if (monthlyAnalysisQueryVO.getFromYear()==monthlyAnalysisQueryVO.getToYear()) {
|
|
if (monthlyAnalysisQueryVO.getFromYear()==monthlyAnalysisQueryVO.getToYear()) {
|