|
@@ -1699,7 +1699,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_h2_fr_syngas_as_fule","H2 fr Syngas as fule","km3"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_h2_fr_syngas_as_fule","H2 fr Syngas as fule","km3"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_hp_product","HP product","Ton"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_hp_product","HP product","Ton"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_sub1_fg_fic1302","SUB1# FG FIC1302","Km3"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_sub1_fg_fic1302","SUB1# FG FIC1302","Km3"));
|
|
- monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_sub2_fg_fic2302","SUB2#FG FIC2302","Km3"));
|
|
|
|
|
|
+ monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_sub2_fg_fic2302","SUB2# FG FIC2302","Km3"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_total_ng_fc3702","total NG FC3702","Km3"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_total_ng_fc3702","total NG FC3702","Km3"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_cost_output","COST(output)","RMB/T"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_cost_output","COST(output)","RMB/T"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_zfy","总费用","RMB"));
|
|
monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_zfy","总费用","RMB"));
|
|
@@ -2804,4 +2804,293 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
|
|
}
|
|
}
|
|
return affectedRows;
|
|
return affectedRows;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改SUB Utility Consumption
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int updateSUBUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO) {
|
|
|
|
+// 受影响行数
|
|
|
|
+ int affectedRows = 0;
|
|
|
|
+ List<MonthlyProductionReportVO> tableData = monthlyUpdateVO.getTableData();
|
|
|
|
+ long year = monthlyUpdateVO.getYear();
|
|
|
|
+ Class clazz = null;
|
|
|
|
+ try {
|
|
|
|
+ clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
|
|
+ } catch (ClassNotFoundException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ for (MonthlyProductionReportVO tableDatum : tableData) {
|
|
|
|
+ for (int i = 0; i < 12; i++) {
|
|
|
|
+ TMonthlyProductionReport report = new TMonthlyProductionReport();
|
|
|
|
+ report.setReportMonth((long)(i + 1));
|
|
|
|
+ report.setReportYear(year);
|
|
|
|
+ Method getMethod = null;
|
|
|
|
+ String monthValue = null;
|
|
|
|
+ try {
|
|
|
|
+ if (i == 0) { getMethod = clazz.getDeclaredMethod("getJan"); }
|
|
|
|
+ if (i == 1) { getMethod = clazz.getDeclaredMethod("getFeb"); }
|
|
|
|
+ if (i == 2) { getMethod = clazz.getDeclaredMethod("getMar"); }
|
|
|
|
+ if (i == 3) { getMethod = clazz.getDeclaredMethod("getApr"); }
|
|
|
|
+ if (i == 4) { getMethod = clazz.getDeclaredMethod("getMay"); }
|
|
|
|
+ if (i == 5) { getMethod = clazz.getDeclaredMethod("getJun"); }
|
|
|
|
+ if (i == 6) { getMethod = clazz.getDeclaredMethod("getJul"); }
|
|
|
|
+ if (i == 7) { getMethod = clazz.getDeclaredMethod("getAug"); }
|
|
|
|
+ if (i == 8) { getMethod = clazz.getDeclaredMethod("getSep"); }
|
|
|
|
+ if (i == 9) { getMethod = clazz.getDeclaredMethod("getOct"); }
|
|
|
|
+ if (i == 10) { getMethod = clazz.getDeclaredMethod("getNov"); }
|
|
|
|
+ if (i == 11) { getMethod = clazz.getDeclaredMethod("getDec"); }
|
|
|
|
+ monthValue = (String) getMethod.invoke(tableDatum);
|
|
|
|
+ } catch (NoSuchMethodException e1){
|
|
|
|
+ e1.printStackTrace();
|
|
|
|
+ } catch (IllegalAccessException e2) {
|
|
|
|
+ e2.printStackTrace();
|
|
|
|
+ } catch (InvocationTargetException e3) {
|
|
|
|
+ e3.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if (monthValue == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_lpg".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConLpg(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_hppa".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConHppa(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_hp_steam_fr_sub_net".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConHpSteamFrSubNet(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_eo_eg_purge_gas".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConEoEgPurgeGas(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_h2_fr_syngas_as_fule".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConH2FrSyngasAsFule(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_hp_product".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConHpProduct(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_sub1_fg_fic1302".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConSub1FgFic1302(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sub_con_sub2_fg_fic2302".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSubConSub2FgFic2302(monthValue);
|
|
|
|
+ }
|
|
|
|
+ // 当前报告年份
|
|
|
|
+ int reportYear = Integer.parseInt(report.getReportYear().toString());
|
|
|
|
+ // 当前报告月份
|
|
|
|
+ int reportMonth = Integer.parseInt(report.getReportMonth().toString());
|
|
|
|
+ // 查询年份=reportYear,月份=reportMonth的月报数据
|
|
|
|
+ int count = tMonthlyProductionReportMapper.selectTMonthlyProductionReportCountByDate(reportYear, reportMonth);
|
|
|
|
+ if (count == 0) { // 新增月报数据
|
|
|
|
+ affectedRows += tMonthlyProductionReportMapper.insertTMonthlyProductionReport(report);
|
|
|
|
+ } else { // 更新月报数据
|
|
|
|
+ affectedRows += tMonthlyProductionReportMapper.updateTMonthlyProductionReport(report);
|
|
|
|
+ }
|
|
|
|
+ // 同步更新月报数据
|
|
|
|
+ SyncAfterMonthlyUpdateThread thread = new SyncAfterMonthlyUpdateThread(
|
|
|
|
+ (int)year,
|
|
|
|
+ (i + 1),
|
|
|
|
+ this.tMonthlyProductionReportMapper
|
|
|
|
+ );
|
|
|
|
+ thread.run();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return affectedRows;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改SCTF Utility Consumption
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int updateSctfUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO) {
|
|
|
|
+ // 受影响行数
|
|
|
|
+ int affectedRows = 0;
|
|
|
|
+ List<MonthlyProductionReportVO> tableData = monthlyUpdateVO.getTableData();
|
|
|
|
+ long year = monthlyUpdateVO.getYear();
|
|
|
|
+ Class clazz = null;
|
|
|
|
+ try {
|
|
|
|
+ clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
|
|
+ } catch (ClassNotFoundException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ for (MonthlyProductionReportVO tableDatum : tableData) {
|
|
|
|
+ for (int i = 0; i < 12; i++) {
|
|
|
|
+ TMonthlyProductionReport report = new TMonthlyProductionReport();
|
|
|
|
+ report.setReportMonth((long)(i + 1));
|
|
|
|
+ report.setReportYear(year);
|
|
|
|
+ Method getMethod = null;
|
|
|
|
+ String monthValue = null;
|
|
|
|
+ try {
|
|
|
|
+ if (i == 0) { getMethod = clazz.getDeclaredMethod("getJan"); }
|
|
|
|
+ if (i == 1) { getMethod = clazz.getDeclaredMethod("getFeb"); }
|
|
|
|
+ if (i == 2) { getMethod = clazz.getDeclaredMethod("getMar"); }
|
|
|
|
+ if (i == 3) { getMethod = clazz.getDeclaredMethod("getApr"); }
|
|
|
|
+ if (i == 4) { getMethod = clazz.getDeclaredMethod("getMay"); }
|
|
|
|
+ if (i == 5) { getMethod = clazz.getDeclaredMethod("getJun"); }
|
|
|
|
+ if (i == 6) { getMethod = clazz.getDeclaredMethod("getJul"); }
|
|
|
|
+ if (i == 7) { getMethod = clazz.getDeclaredMethod("getAug"); }
|
|
|
|
+ if (i == 8) { getMethod = clazz.getDeclaredMethod("getSep"); }
|
|
|
|
+ if (i == 9) { getMethod = clazz.getDeclaredMethod("getOct"); }
|
|
|
|
+ if (i == 10) { getMethod = clazz.getDeclaredMethod("getNov"); }
|
|
|
|
+ if (i == 11) { getMethod = clazz.getDeclaredMethod("getDec"); }
|
|
|
|
+ monthValue = (String) getMethod.invoke(tableDatum);
|
|
|
|
+ } catch (NoSuchMethodException e1){
|
|
|
|
+ e1.printStackTrace();
|
|
|
|
+ } catch (IllegalAccessException e2) {
|
|
|
|
+ e2.printStackTrace();
|
|
|
|
+ } catch (InvocationTargetException e3) {
|
|
|
|
+ e3.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if (monthValue == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_electric".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConElectric(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_ng".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConNg(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_fg_fr_eu".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConFgFrEu(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_lpg".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConLpg(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_hhp_steam".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConHhpSteam(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_mp_steam".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConMpSteam(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_lp_steam".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConLpSteam(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_p_condensate".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConPCondensate(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_cw".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConCw(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_n2".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConN2(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_ia_pa".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConIaPa(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_hppa".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConHppa(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_production_water".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConProductionWater(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_hp_steam_fr_sub_net".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConHpSteamFrSubNet(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_bfw".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConBfw(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_contaminated_ww".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConContaminatedWw(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("sctf_con_production_ww".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setSctfConProductionWw(monthValue);
|
|
|
|
+ }
|
|
|
|
+ // 当前报告年份
|
|
|
|
+ int reportYear = Integer.parseInt(report.getReportYear().toString());
|
|
|
|
+ // 当前报告月份
|
|
|
|
+ int reportMonth = Integer.parseInt(report.getReportMonth().toString());
|
|
|
|
+ // 查询年份=reportYear,月份=reportMonth的月报数据
|
|
|
|
+ int count = tMonthlyProductionReportMapper.selectTMonthlyProductionReportCountByDate(reportYear, reportMonth);
|
|
|
|
+ if (count == 0) { // 新增月报数据
|
|
|
|
+ affectedRows += tMonthlyProductionReportMapper.insertTMonthlyProductionReport(report);
|
|
|
|
+ } else { // 更新月报数据
|
|
|
|
+ affectedRows += tMonthlyProductionReportMapper.updateTMonthlyProductionReport(report);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return affectedRows;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改KBI
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int updateKbi(MonthlyUpdateVO monthlyUpdateVO) {
|
|
|
|
+ // 受影响行数
|
|
|
|
+ int affectedRows = 0;
|
|
|
|
+ List<MonthlyProductionReportVO> tableData = monthlyUpdateVO.getTableData();
|
|
|
|
+ long year = monthlyUpdateVO.getYear();
|
|
|
|
+ Class clazz = null;
|
|
|
|
+ try {
|
|
|
|
+ clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
|
|
|
|
+ } catch (ClassNotFoundException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ for (MonthlyProductionReportVO tableDatum : tableData) {
|
|
|
|
+ for (int i = 0; i < 12; i++) {
|
|
|
|
+ TMonthlyProductionReport report = new TMonthlyProductionReport();
|
|
|
|
+ report.setReportMonth((long)(i + 1));
|
|
|
|
+ report.setReportYear(year);
|
|
|
|
+ Method getMethod = null;
|
|
|
|
+ String monthValue = null;
|
|
|
|
+ try {
|
|
|
|
+ if (i == 0) { getMethod = clazz.getDeclaredMethod("getJan"); }
|
|
|
|
+ if (i == 1) { getMethod = clazz.getDeclaredMethod("getFeb"); }
|
|
|
|
+ if (i == 2) { getMethod = clazz.getDeclaredMethod("getMar"); }
|
|
|
|
+ if (i == 3) { getMethod = clazz.getDeclaredMethod("getApr"); }
|
|
|
|
+ if (i == 4) { getMethod = clazz.getDeclaredMethod("getMay"); }
|
|
|
|
+ if (i == 5) { getMethod = clazz.getDeclaredMethod("getJun"); }
|
|
|
|
+ if (i == 6) { getMethod = clazz.getDeclaredMethod("getJul"); }
|
|
|
|
+ if (i == 7) { getMethod = clazz.getDeclaredMethod("getAug"); }
|
|
|
|
+ if (i == 8) { getMethod = clazz.getDeclaredMethod("getSep"); }
|
|
|
|
+ if (i == 9) { getMethod = clazz.getDeclaredMethod("getOct"); }
|
|
|
|
+ if (i == 10) { getMethod = clazz.getDeclaredMethod("getNov"); }
|
|
|
|
+ if (i == 11) { getMethod = clazz.getDeclaredMethod("getDec"); }
|
|
|
|
+ monthValue = (String) getMethod.invoke(tableDatum);
|
|
|
|
+ } catch (NoSuchMethodException e1){
|
|
|
|
+ e1.printStackTrace();
|
|
|
|
+ } catch (IllegalAccessException e2) {
|
|
|
|
+ e2.printStackTrace();
|
|
|
|
+ } catch (InvocationTargetException e3) {
|
|
|
|
+ e3.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if (monthValue == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if ("kbi_c2_c3_target".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setKbiC2C3Target(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("kbi_c2_c3_target2".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setKbiC2C3Target2(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("kbi_c2_target".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setKbiC2Target(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("kbi_c2_target2".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setKbiC2Target2(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("kbi_lti".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setKbiLti(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("kbi_btx_target".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setKbiBtxTarget(monthValue);
|
|
|
|
+ }
|
|
|
|
+ if ("kbi_btx_target2".equals(tableDatum.getDictLabel())) {
|
|
|
|
+ report.setKbiBtxTarget2(monthValue);
|
|
|
|
+ }
|
|
|
|
+ // 当前报告年份
|
|
|
|
+ int reportYear = Integer.parseInt(report.getReportYear().toString());
|
|
|
|
+ // 当前报告月份
|
|
|
|
+ int reportMonth = Integer.parseInt(report.getReportMonth().toString());
|
|
|
|
+ // 查询年份=reportYear,月份=reportMonth的月报数据
|
|
|
|
+ int count = tMonthlyProductionReportMapper.selectTMonthlyProductionReportCountByDate(reportYear, reportMonth);
|
|
|
|
+ if (count == 0) { // 新增月报数据
|
|
|
|
+ affectedRows += tMonthlyProductionReportMapper.insertTMonthlyProductionReport(report);
|
|
|
|
+ } else { // 更新月报数据
|
|
|
|
+ affectedRows += tMonthlyProductionReportMapper.updateTMonthlyProductionReport(report);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return affectedRows;
|
|
|
|
+ }
|
|
}
|
|
}
|