Эх сурвалжийг харах

王子文 月报SUB Utility Consumption, SCTF Utility Consumption, KBI修改

wangggziwen 2 жил өмнө
parent
commit
18bc3d3b84

+ 30 - 0
master/src/main/java/com/ruoyi/project/production/controller/TMonthlyProductionReportController.java

@@ -36,6 +36,36 @@ public class TMonthlyProductionReportController extends BaseController
     @Autowired
     private ITMonthlyProductionReportService tMonthlyProductionReportService;
 
+    /**
+     * 修改SUB Utility Consumption
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:edit')")
+    @PutMapping(value = "/subUtilityConsumption")
+    public AjaxResult updateSUBUtilityConsumption(@RequestBody MonthlyUpdateVO monthlyUpdateVO)
+    {
+        return toAjax(tMonthlyProductionReportService.updateSUBUtilityConsumption(monthlyUpdateVO));
+    }
+
+    /**
+     * 修改SCTF Utility Consumption
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:edit')")
+    @PutMapping(value = "/sctfUtilityConsumption")
+    public AjaxResult updateSctfUtilityConsumption(@RequestBody MonthlyUpdateVO monthlyUpdateVO)
+    {
+        return toAjax(tMonthlyProductionReportService.updateSctfUtilityConsumption(monthlyUpdateVO));
+    }
+
+    /**
+     * 修改KBI
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:edit')")
+    @PutMapping(value = "/kbi")
+    public AjaxResult updateKbi(@RequestBody MonthlyUpdateVO monthlyUpdateVO)
+    {
+        return toAjax(tMonthlyProductionReportService.updateKbi(monthlyUpdateVO));
+    }
+
     /**
      * 修改Cost Fr Ethylene
      */

+ 15 - 0
master/src/main/java/com/ruoyi/project/production/service/ITMonthlyProductionReportService.java

@@ -211,4 +211,19 @@ public interface ITMonthlyProductionReportService
      * 修改Cost Fr Ethylene
      */
     public int updateCostFrEthylene(MonthlyUpdateVO monthlyUpdateVO);
+
+    /**
+     * 修改SUB Utility Consumption
+     */
+    public int updateSUBUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO);
+
+    /**
+     * 修改SCTF Utility Consumption
+     */
+    public int updateSctfUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO);
+
+    /**
+     * 修改KBI
+     */
+    public int updateKbi(MonthlyUpdateVO monthlyUpdateVO);
 }

+ 290 - 1
master/src/main/java/com/ruoyi/project/production/service/impl/TMonthlyProductionReportServiceImpl.java

@@ -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_hp_product","HP product","Ton"));
         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_cost_output","COST(output)","RMB/T"));
         monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_zfy","总费用","RMB"));
@@ -2804,4 +2804,293 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         }
         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;
+    }
 }

+ 22 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/thread/SyncAfterMonthlyUpdateThread.java

@@ -192,6 +192,28 @@ public class SyncAfterMonthlyUpdateThread extends Thread {
         report.setAeuLoad(aeuLoad.toString());
         report.setBtxCapacity(btxCapacity.toString());
 
+        String subConHpSteamFrSubNetStr = report.getSubConHpSteamFrSubNet();
+        String subConHhpSteamStr = report.getSubConHhpSteam();
+        String subConHpProductStr = report.getSubConHpProduct();
+        BigDecimal subConHpSteamFrSubNet = new BigDecimal(subConHpSteamFrSubNetStr == null ? "0" : subConHpSteamFrSubNetStr);
+        BigDecimal subConHhpSteam = new BigDecimal(subConHhpSteamStr == null ? "0" : subConHhpSteamStr);
+        BigDecimal subConHpProduct = new BigDecimal(subConHpProductStr == null ? "0" : subConHpProductStr);
+        BigDecimal subConGljcl = new BigDecimal("0")
+                .subtract(subConHpSteamFrSubNet.add(subConHhpSteam));
+        BigDecimal subConCc = new BigDecimal("0");
+        BigDecimal subConSc = new BigDecimal("0");
+        if (calendarHour.compareTo(BigDecimal.ZERO) != 0) {
+            subConCc = subConHpProduct
+                    .multiply(new BigDecimal("0"))
+                    .divide(calendarHour, 2, RoundingMode.HALF_UP);
+            subConSc = (subConSc.subtract(subConHpSteamFrSubNet.add(subConHhpSteam)))
+                    .multiply(new BigDecimal("0"))
+                    .divide(calendarHour, 2, RoundingMode.HALF_UP);
+        }
+        report.setSubConGljcl(subConGljcl.toString());
+        report.setSubConCc(subConCc.toString());
+        report.setSubConSc(subConSc.toString());
+
         report.setKbiPcur(crackerLoad.toString());
         report.setKbiEnergyConsumption(crackerEnergyTeTeo.toString());
         report.setKbiAeuEnergyConsumption(crackerEnergyEeKgect.toString());

+ 27 - 0
ui/src/api/production/monthly.js

@@ -1,5 +1,32 @@
 import request from '@/utils/request'
 
+// 修改SUB Utility Consumption
+export function updateSUBUtilityConsumption(data) {
+  return request({
+    url: '/production/monthly/subUtilityConsumption',
+    method: 'put',
+    data: data
+  })
+}
+
+// 修改SCTF Utility Consumption
+export function updateSctfUtilityConsumption(data) {
+  return request({
+    url: '/production/monthly/sctfUtilityConsumption',
+    method: 'put',
+    data: data
+  })
+}
+
+// 修改KBI
+export function updateKbi(data) {
+  return request({
+    url: '/production/monthly/kbi',
+    method: 'put',
+    data: data
+  })
+}
+
 // 修改Cost Fr Ethylene
 export function updateCostFrEthylene(data) {
   return request({

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 951 - 37
ui/src/views/production/monthly/index.vue


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно