|
@@ -6,20 +6,15 @@ import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
-import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl;
|
|
|
-import com.ruoyi.project.production.controller.vo.DailyAnalysisQueryVO;
|
|
|
import com.ruoyi.project.production.controller.vo.MonthlyAnalysisDataVO;
|
|
|
import com.ruoyi.project.production.controller.vo.MonthlyAnalysisQueryVO;
|
|
|
-import com.ruoyi.project.production.service.impl.vo.CrackerRawMaterialVO;
|
|
|
-import org.junit.platform.commons.JUnitException;
|
|
|
+import com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
|
|
|
import com.ruoyi.project.production.domain.TMonthlyProductionReport;
|
|
|
import com.ruoyi.project.production.service.ITMonthlyProductionReportService;
|
|
|
|
|
|
-import javax.sound.midi.Soundbank;
|
|
|
-
|
|
|
/**
|
|
|
* 每月生产报告Service业务层处理
|
|
|
*
|
|
@@ -105,7 +100,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectCrackerRawMaterialByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectCrackerRawMaterialByYear(Long year) {
|
|
|
// 当前日期
|
|
|
Date currentDate = new Date();
|
|
|
// 当前年份
|
|
@@ -115,24 +110,24 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
// 从数据库中查出的当前year的月报数据集合,每个元素对应当前year某个月的数据
|
|
|
List<TMonthlyProductionReport> tMonthlyProductionReports = tMonthlyProductionReportMapper.selectCrackerRawMaterialByYear(year);
|
|
|
// 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
|
|
|
- List<CrackerRawMaterialVO> crackerRawMaterialVOs = new ArrayList<>();
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Cracker Raw Material", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("NAP", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C5", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("NA", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Wison Ethane", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("LPG to Furnace", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C4 Raff3 fr bd and 2ph", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C2 fr LDPE", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C3 fr OXO", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Mixed C3/C4 fr BD", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("HC9", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Offgas fr AEU", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("wash oil", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("toluene", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C4 Recycle(ton)", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("input total", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Total feed", "t"));
|
|
|
+ List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_raw_input", "Cracker Raw Material", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("nap", "NAP", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c5", "C5", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c6_c8_na", "NA", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("wison_ethane", "Wison Ethane", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("lpg_to_furnace", "LPG to Furnace", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("raff3_fr_bd_and_2ph", "C4 Raff3 fr bd and 2ph", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c2_fr_ldpe", "C2 fr LDPE", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c3_fr_oxo", "C3 fr OXO", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("mixed_c3_c4", "Mixed C3/C4 fr BD", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("hy_c9", "HC9", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_offgas", "Offgas fr AEU", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("wash_oil", "wash oil", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("toluene", "toluene", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("hy_c4_fr_r800", "C4 Recycle(ton)", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_raw_input", "input total", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_raw_feed", "Total feed", "t"));
|
|
|
// 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
|
|
|
for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
|
|
|
TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
|
|
@@ -159,7 +154,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
try {
|
|
|
Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
|
- clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.CrackerRawMaterialVO");
|
|
|
+ clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
|
switch (reportMonth.toString()) {
|
|
|
case "1": // 一月
|
|
|
method = clazz.getDeclaredMethod("setJan", String.class);
|
|
@@ -199,63 +194,63 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
break;
|
|
|
}
|
|
|
// 按照当前元素的所属月份调取相应set方法
|
|
|
- method.invoke(crackerRawMaterialVOs.get(0), crackerRawInput);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(1), nap);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(2), c5);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(3), c6C8Na);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(4), wisonEthane);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(5), lpgToFurnace);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(6), raff3FrBdAnd2ph);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(7), c2FrLdpe);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(8), c3FrOxo);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(9), mixedC3C4);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(10), hyC9);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(11), pguOffgas);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(12), washOil);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(13), toluene);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(14), hyC4FrR800);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(15), crackerRawInput);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(16), crackerRawFeed);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(0), crackerRawInput);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(1), nap);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(2), c5);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(3), c6C8Na);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(4), wisonEthane);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(5), lpgToFurnace);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(6), raff3FrBdAnd2ph);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(7), c2FrLdpe);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(8), c3FrOxo);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(9), mixedC3C4);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(10), hyC9);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(11), pguOffgas);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(12), washOil);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(13), toluene);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(14), hyC4FrR800);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(15), crackerRawInput);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(16), crackerRawFeed);
|
|
|
// 当前年份=所属年份,当前月份=所属月份
|
|
|
if (currentMonth.equals(reportMonth) && currentYear.equals(reportYear)) {
|
|
|
- crackerRawMaterialVOs.get(0).setCurrently(crackerRawInput);
|
|
|
- crackerRawMaterialVOs.get(1).setCurrently(nap);
|
|
|
- crackerRawMaterialVOs.get(2).setCurrently(c5);
|
|
|
- crackerRawMaterialVOs.get(3).setCurrently(c6C8Na);
|
|
|
- crackerRawMaterialVOs.get(4).setCurrently(wisonEthane);
|
|
|
- crackerRawMaterialVOs.get(5).setCurrently(lpgToFurnace);
|
|
|
- crackerRawMaterialVOs.get(6).setCurrently(raff3FrBdAnd2ph);
|
|
|
- crackerRawMaterialVOs.get(7).setCurrently(c2FrLdpe);
|
|
|
- crackerRawMaterialVOs.get(8).setCurrently(c3FrOxo);
|
|
|
- crackerRawMaterialVOs.get(9).setCurrently(mixedC3C4);
|
|
|
- crackerRawMaterialVOs.get(10).setCurrently(hyC9);
|
|
|
- crackerRawMaterialVOs.get(11).setCurrently(pguOffgas);
|
|
|
- crackerRawMaterialVOs.get(12).setCurrently(washOil);
|
|
|
- crackerRawMaterialVOs.get(13).setCurrently(toluene);
|
|
|
- crackerRawMaterialVOs.get(14).setCurrently(hyC4FrR800);
|
|
|
- crackerRawMaterialVOs.get(15).setCurrently(crackerRawInput);
|
|
|
- crackerRawMaterialVOs.get(16).setCurrently(crackerRawFeed);
|
|
|
+ monthlyProductionReportVOs.get(0).setCurrently(crackerRawInput);
|
|
|
+ monthlyProductionReportVOs.get(1).setCurrently(nap);
|
|
|
+ monthlyProductionReportVOs.get(2).setCurrently(c5);
|
|
|
+ monthlyProductionReportVOs.get(3).setCurrently(c6C8Na);
|
|
|
+ monthlyProductionReportVOs.get(4).setCurrently(wisonEthane);
|
|
|
+ monthlyProductionReportVOs.get(5).setCurrently(lpgToFurnace);
|
|
|
+ monthlyProductionReportVOs.get(6).setCurrently(raff3FrBdAnd2ph);
|
|
|
+ monthlyProductionReportVOs.get(7).setCurrently(c2FrLdpe);
|
|
|
+ monthlyProductionReportVOs.get(8).setCurrently(c3FrOxo);
|
|
|
+ monthlyProductionReportVOs.get(9).setCurrently(mixedC3C4);
|
|
|
+ monthlyProductionReportVOs.get(10).setCurrently(hyC9);
|
|
|
+ monthlyProductionReportVOs.get(11).setCurrently(pguOffgas);
|
|
|
+ monthlyProductionReportVOs.get(12).setCurrently(washOil);
|
|
|
+ monthlyProductionReportVOs.get(13).setCurrently(toluene);
|
|
|
+ monthlyProductionReportVOs.get(14).setCurrently(hyC4FrR800);
|
|
|
+ monthlyProductionReportVOs.get(15).setCurrently(crackerRawInput);
|
|
|
+ monthlyProductionReportVOs.get(16).setCurrently(crackerRawFeed);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
// 遍历前端月报数据集合,计算total的值1~12月之和)
|
|
|
- for (int i = 0; i < crackerRawMaterialVOs.size(); i++) {
|
|
|
- CrackerRawMaterialVO crackerRawMaterialVO = crackerRawMaterialVOs.get(i);
|
|
|
+ for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
|
|
|
+ MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
|
|
|
BigDecimal total = new BigDecimal("0");
|
|
|
- String janStr = crackerRawMaterialVO.getJan();
|
|
|
- String febStr = crackerRawMaterialVO.getFeb();
|
|
|
- String marStr = crackerRawMaterialVO.getMar();
|
|
|
- String aprStr = crackerRawMaterialVO.getApr();
|
|
|
- String mayStr = crackerRawMaterialVO.getMay();
|
|
|
- String junStr = crackerRawMaterialVO.getJun();
|
|
|
- String julStr = crackerRawMaterialVO.getJul();
|
|
|
- String augStr = crackerRawMaterialVO.getAug();
|
|
|
- String sepStr = crackerRawMaterialVO.getSep();
|
|
|
- String octStr = crackerRawMaterialVO.getOct();
|
|
|
- String novStr = crackerRawMaterialVO.getNov();
|
|
|
- String decStr = crackerRawMaterialVO.getDec();
|
|
|
+ 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);
|
|
@@ -269,12 +264,12 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
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);
|
|
|
- crackerRawMaterialVO.setTotal(total.toString());
|
|
|
+ monthlyProductionReportVO.setTotal(total.toString());
|
|
|
}
|
|
|
- return crackerRawMaterialVOs;
|
|
|
+ return monthlyProductionReportVOs;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectCrackerOutputProductByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectCrackerOutputProductByYear(Long year) {
|
|
|
// 当前日期
|
|
|
Date currentDate = new Date();
|
|
|
// 当前年份
|
|
@@ -284,21 +279,21 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
// 从数据库中查出的当前year的月报数据集合,每个元素对应当前year某个月的数据
|
|
|
List<TMonthlyProductionReport> tMonthlyProductionReports = tMonthlyProductionReportMapper.selectCrackerOutputProductByYear(year);
|
|
|
// 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
|
|
|
- List<CrackerRawMaterialVO> crackerRawMaterialVOs = new ArrayList<>();
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Cracker Output Product", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("H2", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C2=", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C3=", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C3/C4 LPG", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("C4'S", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("RPG", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("PO", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Naphthalene", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("EBO", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Cracker Residue ", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("Methane", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("OFFAGE", "t"));
|
|
|
- crackerRawMaterialVOs.add(new CrackerRawMaterialVO("output total", "t"));
|
|
|
+ List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_output", "Cracker Output Product", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("h2_produced", "H2", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("ethylen_produced", "C2=", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("propylene_produced", "C3=", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c3_c4_lpg_produced", "C3/C4 LPG", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("mixed_c4s_produced", "C4'S", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("rpg_produced", "RPG", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("po_flux_oil_produced", "PO", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("naphthalene_produced", "Naphthalene", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("ebo_produced", "EBO", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("residue_oil_produced", "Cracker Residue", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("methane_produced", "Methane", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("offgas_produced", "OFFAGE", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("cracker_output", "output total", "t"));
|
|
|
// 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
|
|
|
for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
|
|
|
TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
|
|
@@ -322,7 +317,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
try {
|
|
|
Long reportMonth = tMonthlyProductionReport.getReportMonth(); // 当前元素的所属月份
|
|
|
Long reportYear = tMonthlyProductionReport.getReportYear(); // 当前元素的所属年份
|
|
|
- clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.CrackerRawMaterialVO");
|
|
|
+ clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
|
switch (reportMonth.toString()) {
|
|
|
case "1": // 一月
|
|
|
method = clazz.getDeclaredMethod("setJan", String.class);
|
|
@@ -362,57 +357,57 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
break;
|
|
|
}
|
|
|
// 按照当前元素的所属月份调取相应set方法
|
|
|
- method.invoke(crackerRawMaterialVOs.get(0), crackerOutput);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(1), h2Produced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(2), ethylenProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(3), propyleneProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(4), c3C4LpgProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(5), mixedC4sProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(6), rpgProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(7), poFluxOilProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(8), naphthaleneProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(9), eboProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(10), residueOilProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(11), methaneProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(12), offgasProduced);
|
|
|
- method.invoke(crackerRawMaterialVOs.get(13), crackerOutput);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(0), crackerOutput);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(1), h2Produced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(2), ethylenProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(3), propyleneProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(4), c3C4LpgProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(5), mixedC4sProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(6), rpgProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(7), poFluxOilProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(8), naphthaleneProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(9), eboProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(10), residueOilProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(11), methaneProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(12), offgasProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(13), crackerOutput);
|
|
|
// 当前年份=所属年份,当前月份=所属月份
|
|
|
if (currentMonth.equals(reportMonth) && currentYear.equals(reportYear)) {
|
|
|
- crackerRawMaterialVOs.get(0).setCurrently(crackerOutput);
|
|
|
- crackerRawMaterialVOs.get(1).setCurrently(h2Produced);
|
|
|
- crackerRawMaterialVOs.get(2).setCurrently(ethylenProduced);
|
|
|
- crackerRawMaterialVOs.get(3).setCurrently(propyleneProduced);
|
|
|
- crackerRawMaterialVOs.get(4).setCurrently(c3C4LpgProduced);
|
|
|
- crackerRawMaterialVOs.get(5).setCurrently(mixedC4sProduced);
|
|
|
- crackerRawMaterialVOs.get(6).setCurrently(rpgProduced);
|
|
|
- crackerRawMaterialVOs.get(7).setCurrently(poFluxOilProduced);
|
|
|
- crackerRawMaterialVOs.get(8).setCurrently(naphthaleneProduced);
|
|
|
- crackerRawMaterialVOs.get(9).setCurrently(eboProduced);
|
|
|
- crackerRawMaterialVOs.get(10).setCurrently(residueOilProduced);
|
|
|
- crackerRawMaterialVOs.get(11).setCurrently(methaneProduced);
|
|
|
- crackerRawMaterialVOs.get(12).setCurrently(offgasProduced);
|
|
|
- crackerRawMaterialVOs.get(13).setCurrently(crackerOutput);
|
|
|
+ monthlyProductionReportVOs.get(0).setCurrently(crackerOutput);
|
|
|
+ monthlyProductionReportVOs.get(1).setCurrently(h2Produced);
|
|
|
+ monthlyProductionReportVOs.get(2).setCurrently(ethylenProduced);
|
|
|
+ monthlyProductionReportVOs.get(3).setCurrently(propyleneProduced);
|
|
|
+ monthlyProductionReportVOs.get(4).setCurrently(c3C4LpgProduced);
|
|
|
+ monthlyProductionReportVOs.get(5).setCurrently(mixedC4sProduced);
|
|
|
+ monthlyProductionReportVOs.get(6).setCurrently(rpgProduced);
|
|
|
+ monthlyProductionReportVOs.get(7).setCurrently(poFluxOilProduced);
|
|
|
+ monthlyProductionReportVOs.get(8).setCurrently(naphthaleneProduced);
|
|
|
+ monthlyProductionReportVOs.get(9).setCurrently(eboProduced);
|
|
|
+ monthlyProductionReportVOs.get(10).setCurrently(residueOilProduced);
|
|
|
+ monthlyProductionReportVOs.get(11).setCurrently(methaneProduced);
|
|
|
+ monthlyProductionReportVOs.get(12).setCurrently(offgasProduced);
|
|
|
+ monthlyProductionReportVOs.get(13).setCurrently(crackerOutput);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
// 遍历前端月报数据集合,计算total的值1~12月之和)
|
|
|
- for (int i = 0; i < crackerRawMaterialVOs.size(); i++) {
|
|
|
- CrackerRawMaterialVO crackerRawMaterialVO = crackerRawMaterialVOs.get(i);
|
|
|
+ for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
|
|
|
+ MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
|
|
|
BigDecimal total = new BigDecimal("0");
|
|
|
- String janStr = crackerRawMaterialVO.getJan();
|
|
|
- String febStr = crackerRawMaterialVO.getFeb();
|
|
|
- String marStr = crackerRawMaterialVO.getMar();
|
|
|
- String aprStr = crackerRawMaterialVO.getApr();
|
|
|
- String mayStr = crackerRawMaterialVO.getMay();
|
|
|
- String junStr = crackerRawMaterialVO.getJun();
|
|
|
- String julStr = crackerRawMaterialVO.getJul();
|
|
|
- String augStr = crackerRawMaterialVO.getAug();
|
|
|
- String sepStr = crackerRawMaterialVO.getSep();
|
|
|
- String octStr = crackerRawMaterialVO.getOct();
|
|
|
- String novStr = crackerRawMaterialVO.getNov();
|
|
|
- String decStr = crackerRawMaterialVO.getDec();
|
|
|
+ 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);
|
|
@@ -426,84 +421,205 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
|
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);
|
|
|
- crackerRawMaterialVO.setTotal(total.toString());
|
|
|
+ monthlyProductionReportVO.setTotal(total.toString());
|
|
|
}
|
|
|
- return crackerRawMaterialVOs;
|
|
|
+ return monthlyProductionReportVOs;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectAromaticsRawMaterialByYear(Long year) {
|
|
|
- return null;
|
|
|
+ public List<MonthlyProductionReportVO> selectAromaticsRawMaterialByYear(Long year) {
|
|
|
+ // 当前日期
|
|
|
+ Date currentDate = new Date();
|
|
|
+ // 当前年份
|
|
|
+ Long currentYear = Long.parseLong(currentDate.getYear() + 1900 + "");
|
|
|
+ // 当前月份
|
|
|
+ Long currentMonth = Long.parseLong(currentDate.getMonth() + 1 + "");
|
|
|
+ // 从数据库中查出的当前year的月报数据集合,每个元素对应当前year某个月的数据
|
|
|
+ List<TMonthlyProductionReport> tMonthlyProductionReports = tMonthlyProductionReportMapper.selectAromaticsRawMaterialByYear(year);
|
|
|
+ // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
|
|
|
+ List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("aromatics_raw_input", "Aromatics Raw Material", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_rpg2", "RPG fr EU", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_h2", "H2 to PGU", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_btx_produced", "Mix BTX Product", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("pgu_btx_to_aeu", "Mix BTX to AEU", "t"));
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("aromatics_raw_input", "input total", "t"));
|
|
|
+ // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
|
|
|
+ for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
|
|
|
+ TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
|
|
|
+ String pguRpg2 = tMonthlyProductionReport.getPguRpg2();
|
|
|
+ String pguH2 = tMonthlyProductionReport.getPguH2();
|
|
|
+ String pguBtxProduced = tMonthlyProductionReport.getPguBtxProduced();
|
|
|
+ String pguBtxToAeu = tMonthlyProductionReport.getPguBtxToAeu();
|
|
|
+ String aromaticsRawInput = tMonthlyProductionReport.getAromaticsRawInput();
|
|
|
+ // 前端数据集合的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;
|
|
|
+ }
|
|
|
+ // 按照当前元素的所属月份调取相应set方法
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(0), aromaticsRawInput);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(1), pguRpg2);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(2), pguH2);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(3), pguBtxProduced);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(4), pguBtxToAeu);
|
|
|
+ method.invoke(monthlyProductionReportVOs.get(5), aromaticsRawInput);
|
|
|
+ // 当前年份=所属年份,当前月份=所属月份
|
|
|
+ if (currentMonth.equals(reportMonth) && currentYear.equals(reportYear)) {
|
|
|
+ monthlyProductionReportVOs.get(0).setCurrently(aromaticsRawInput);
|
|
|
+ monthlyProductionReportVOs.get(1).setCurrently(pguRpg2);
|
|
|
+ monthlyProductionReportVOs.get(2).setCurrently(pguH2);
|
|
|
+ monthlyProductionReportVOs.get(3).setCurrently(pguBtxProduced);
|
|
|
+ monthlyProductionReportVOs.get(4).setCurrently(pguBtxToAeu);
|
|
|
+ monthlyProductionReportVOs.get(5).setCurrently(aromaticsRawInput);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ 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());
|
|
|
+ }
|
|
|
+ return monthlyProductionReportVOs;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectAromaticsOutputProductByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectAromaticsOutputProductByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectEligibleProductRateByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectEligibleProductRateByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectProductYieldByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectProductYieldByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectCrackerUtilityConsumptionByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectCrackerUtilityConsumptionByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectCrackerEnergyConsumptionByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectCrackerEnergyConsumptionByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectAromaticsUtilityConsumptionByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectAromaticsUtilityConsumptionByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectAromaticsEnergyConsumptionByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectAromaticsEnergyConsumptionByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectPlantLoadByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectPlantLoadByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectCostFrEthyleneByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectCostFrEthyleneByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectRuningRateByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectRuningRateByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectShoudownHourByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectShoudownHourByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectOthersideByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectOthersideByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectChemicalConsumeByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectChemicalConsumeByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectSCTUUtilityConsumptionByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectSCTUUtilityConsumptionByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectSUBUtilityConsumptionByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectSUBUtilityConsumptionByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectSCTFUtilityConsumptionByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectSCTFUtilityConsumptionByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectKbiByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectKbiByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
@Override
|
|
|
- public List<CrackerRawMaterialVO> selectSummaryByYear(Long year) {
|
|
|
+ public List<MonthlyProductionReportVO> selectSummaryByYear(Long year) {
|
|
|
return null;
|
|
|
}
|
|
|
|