Kaynağa Gözat

王子文 月报Chemical Consume

wangggziwen 2 yıl önce
ebeveyn
işleme
a6bb342296

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

@@ -36,6 +36,16 @@ public class TMonthlyProductionReportController extends BaseController
     @Autowired
     private ITMonthlyProductionReportService tMonthlyProductionReportService;
 
+    /**
+     * 修改Chemical Consume
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:edit')")
+    @PutMapping(value = "/chemicalConsume")
+    public AjaxResult updateChemicalConsume(@RequestBody MonthlyUpdateVO monthlyUpdateVO)
+    {
+        return toAjax(tMonthlyProductionReportService.updateChemicalConsume(monthlyUpdateVO));
+    }
+
     /**
      * 修改Runing Rate
      */

+ 267 - 1
master/src/main/java/com/ruoyi/project/production/domain/TMonthlyProductionReport.java

@@ -9,7 +9,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  * 每月生产报告对象 t_monthly_production_report
  *
  * @author ruoyi
- * @date 2022-11-15
+ * @date 2022-11-16
  */
 public class TMonthlyProductionReport extends BaseEntity
 {
@@ -594,6 +594,82 @@ public class TMonthlyProductionReport extends BaseEntity
     @Excel(name = "Plant Load BTX Capacity")
     private String btxCapacity;
 
+    /** Chemical Consume PT-3000 */
+    @Excel(name = "Chemical Consume PT-3000")
+    private String chemicalConsumePt3000;
+
+    /** Chemical Consume NAOH */
+    @Excel(name = "Chemical Consume NAOH")
+    private String chemicalConsumeNaoh;
+
+    /** Chemical Consume PT-4000 */
+    @Excel(name = "Chemical Consume PT-4000")
+    private String chemicalConsumePt4000;
+
+    /** Chemical Consume EC3392A */
+    @Excel(name = "Chemical Consume EC3392A")
+    private String chemicalConsumeEc3392a;
+
+    /** Chemical Consume 2W906 */
+    @Excel(name = "Chemical Consume 2W906")
+    private String chemicalConsume2w906;
+
+    /** Chemical Consume EC1489A */
+    @Excel(name = "Chemical Consume EC1489A")
+    private String chemicalConsumeEc1489a;
+
+    /** Chemical Consume EC1486A */
+    @Excel(name = "Chemical Consume EC1486A")
+    private String chemicalConsumeEc1486a;
+
+    /** Chemical Consume 20Y3483 */
+    @Excel(name = "Chemical Consume 20Y3483")
+    private String chemicalConsume20y3483;
+
+    /** Chemical Consume 8Q202 */
+    @Excel(name = "Chemical Consume 8Q202")
+    private String chemicalConsume8q202;
+
+    /** Chemical Consume 20Y97A */
+    @Excel(name = "Chemical Consume 20Y97A")
+    private String chemicalConsume20y97a;
+
+    /** Chemical Consume EC3269A */
+    @Excel(name = "Chemical Consume EC3269A")
+    private String chemicalConsumeEc3269a;
+
+    /** Chemical Consume 20Y25 */
+    @Excel(name = "Chemical Consume 20Y25")
+    private String chemicalConsume20y25;
+
+    /** Chemical Consume 20Y77 */
+    @Excel(name = "Chemical Consume 20Y77")
+    private String chemicalConsume20y77;
+
+    /** Chemical Consume 510WS */
+    @Excel(name = "Chemical Consume 510WS")
+    private String chemicalConsume510ws;
+
+    /** Chemical Consume N130 */
+    @Excel(name = "Chemical Consume N130")
+    private String chemicalConsumeN130;
+
+    /** Chemical Consume H2SO4 */
+    @Excel(name = "Chemical Consume H2SO4")
+    private String chemicalConsumeH2so4;
+
+    /** Chemical Consume NaOH */
+    @Excel(name = "Chemical Consume NaOH")
+    private String chemicalConsumeNaoh2;
+
+    /** Chemical Consume CH3OH */
+    @Excel(name = "Chemical Consume CH3OH")
+    private String chemicalConsumeCh3oh;
+
+    /** Chemical Consume PT-3000 */
+    @Excel(name = "Chemical Consume PT-3000")
+    private String chemicalConsumePt30002;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -1899,6 +1975,177 @@ public class TMonthlyProductionReport extends BaseEntity
     {
         return btxCapacity;
     }
+    public void setChemicalConsumePt3000(String chemicalConsumePt3000)
+    {
+        this.chemicalConsumePt3000 = chemicalConsumePt3000;
+    }
+
+    public String getChemicalConsumePt3000()
+    {
+        return chemicalConsumePt3000;
+    }
+    public void setChemicalConsumeNaoh(String chemicalConsumeNaoh)
+    {
+        this.chemicalConsumeNaoh = chemicalConsumeNaoh;
+    }
+
+    public String getChemicalConsumeNaoh()
+    {
+        return chemicalConsumeNaoh;
+    }
+    public void setChemicalConsumePt4000(String chemicalConsumePt4000)
+    {
+        this.chemicalConsumePt4000 = chemicalConsumePt4000;
+    }
+
+    public String getChemicalConsumePt4000()
+    {
+        return chemicalConsumePt4000;
+    }
+    public void setChemicalConsumeEc3392a(String chemicalConsumeEc3392a)
+    {
+        this.chemicalConsumeEc3392a = chemicalConsumeEc3392a;
+    }
+
+    public String getChemicalConsumeEc3392a()
+    {
+        return chemicalConsumeEc3392a;
+    }
+    public void setChemicalConsume2w906(String chemicalConsume2w906)
+    {
+        this.chemicalConsume2w906 = chemicalConsume2w906;
+    }
+
+    public String getChemicalConsume2w906()
+    {
+        return chemicalConsume2w906;
+    }
+    public void setChemicalConsumeEc1489a(String chemicalConsumeEc1489a)
+    {
+        this.chemicalConsumeEc1489a = chemicalConsumeEc1489a;
+    }
+
+    public String getChemicalConsumeEc1489a()
+    {
+        return chemicalConsumeEc1489a;
+    }
+    public void setChemicalConsumeEc1486a(String chemicalConsumeEc1486a)
+    {
+        this.chemicalConsumeEc1486a = chemicalConsumeEc1486a;
+    }
+
+    public String getChemicalConsumeEc1486a()
+    {
+        return chemicalConsumeEc1486a;
+    }
+    public void setChemicalConsume20y3483(String chemicalConsume20y3483)
+    {
+        this.chemicalConsume20y3483 = chemicalConsume20y3483;
+    }
+
+    public String getChemicalConsume20y3483()
+    {
+        return chemicalConsume20y3483;
+    }
+    public void setChemicalConsume8q202(String chemicalConsume8q202)
+    {
+        this.chemicalConsume8q202 = chemicalConsume8q202;
+    }
+
+    public String getChemicalConsume8q202()
+    {
+        return chemicalConsume8q202;
+    }
+    public void setChemicalConsume20y97a(String chemicalConsume20y97a)
+    {
+        this.chemicalConsume20y97a = chemicalConsume20y97a;
+    }
+
+    public String getChemicalConsume20y97a()
+    {
+        return chemicalConsume20y97a;
+    }
+    public void setChemicalConsumeEc3269a(String chemicalConsumeEc3269a)
+    {
+        this.chemicalConsumeEc3269a = chemicalConsumeEc3269a;
+    }
+
+    public String getChemicalConsumeEc3269a()
+    {
+        return chemicalConsumeEc3269a;
+    }
+    public void setChemicalConsume20y25(String chemicalConsume20y25)
+    {
+        this.chemicalConsume20y25 = chemicalConsume20y25;
+    }
+
+    public String getChemicalConsume20y25()
+    {
+        return chemicalConsume20y25;
+    }
+    public void setChemicalConsume20y77(String chemicalConsume20y77)
+    {
+        this.chemicalConsume20y77 = chemicalConsume20y77;
+    }
+
+    public String getChemicalConsume20y77()
+    {
+        return chemicalConsume20y77;
+    }
+    public void setChemicalConsume510ws(String chemicalConsume510ws)
+    {
+        this.chemicalConsume510ws = chemicalConsume510ws;
+    }
+
+    public String getChemicalConsume510ws()
+    {
+        return chemicalConsume510ws;
+    }
+    public void setChemicalConsumeN130(String chemicalConsumeN130)
+    {
+        this.chemicalConsumeN130 = chemicalConsumeN130;
+    }
+
+    public String getChemicalConsumeN130()
+    {
+        return chemicalConsumeN130;
+    }
+    public void setChemicalConsumeH2so4(String chemicalConsumeH2so4)
+    {
+        this.chemicalConsumeH2so4 = chemicalConsumeH2so4;
+    }
+
+    public String getChemicalConsumeH2so4()
+    {
+        return chemicalConsumeH2so4;
+    }
+    public void setChemicalConsumeNaoh2(String chemicalConsumeNaoh2)
+    {
+        this.chemicalConsumeNaoh2 = chemicalConsumeNaoh2;
+    }
+
+    public String getChemicalConsumeNaoh2()
+    {
+        return chemicalConsumeNaoh2;
+    }
+    public void setChemicalConsumeCh3oh(String chemicalConsumeCh3oh)
+    {
+        this.chemicalConsumeCh3oh = chemicalConsumeCh3oh;
+    }
+
+    public String getChemicalConsumeCh3oh()
+    {
+        return chemicalConsumeCh3oh;
+    }
+    public void setChemicalConsumePt30002(String chemicalConsumePt30002)
+    {
+        this.chemicalConsumePt30002 = chemicalConsumePt30002;
+    }
+
+    public String getChemicalConsumePt30002()
+    {
+        return chemicalConsumePt30002;
+    }
 
     @Override
     public String toString() {
@@ -2048,6 +2295,25 @@ public class TMonthlyProductionReport extends BaseEntity
             .append("ethyleneCapacity", getEthyleneCapacity())
             .append("aeuLoad", getAeuLoad())
             .append("btxCapacity", getBtxCapacity())
+            .append("chemicalConsumePt3000", getChemicalConsumePt3000())
+            .append("chemicalConsumeNaoh", getChemicalConsumeNaoh())
+            .append("chemicalConsumePt4000", getChemicalConsumePt4000())
+            .append("chemicalConsumeEc3392a", getChemicalConsumeEc3392a())
+            .append("chemicalConsume2w906", getChemicalConsume2w906())
+            .append("chemicalConsumeEc1489a", getChemicalConsumeEc1489a())
+            .append("chemicalConsumeEc1486a", getChemicalConsumeEc1486a())
+            .append("chemicalConsume20y3483", getChemicalConsume20y3483())
+            .append("chemicalConsume8q202", getChemicalConsume8q202())
+            .append("chemicalConsume20y97a", getChemicalConsume20y97a())
+            .append("chemicalConsumeEc3269a", getChemicalConsumeEc3269a())
+            .append("chemicalConsume20y25", getChemicalConsume20y25())
+            .append("chemicalConsume20y77", getChemicalConsume20y77())
+            .append("chemicalConsume510ws", getChemicalConsume510ws())
+            .append("chemicalConsumeN130", getChemicalConsumeN130())
+            .append("chemicalConsumeH2so4", getChemicalConsumeH2so4())
+            .append("chemicalConsumeNaoh2", getChemicalConsumeNaoh2())
+            .append("chemicalConsumeCh3oh", getChemicalConsumeCh3oh())
+            .append("chemicalConsumePt30002", getChemicalConsumePt30002())
             .toString();
     }
 }

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

@@ -201,4 +201,9 @@ public interface ITMonthlyProductionReportService
      * 修改Runing Rate
      */
     public int updateRuningRate(MonthlyUpdateVO monthlyUpdateVO);
+
+    /**
+     * 修改Chemical Consume
+     */
+    public int updateChemicalConsume(MonthlyUpdateVO monthlyUpdateVO);
 }

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

@@ -1457,7 +1457,114 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
      */
     @Override
     public List<MonthlyProductionReportVO> selectChemicalConsumeByYear(Long year) {
-        return  null;
+        // 当前日期
+        Date currentDate = new Date();
+        // 当前年份
+        Long currentYear = Long.parseLong(currentDate.getYear() + 1900 + "");
+        // 当前月份
+        Long currentMonth = Long.parseLong(currentDate.getMonth() + 1 + "");
+        // 从数据库中查出的当前year的月报数据集合,每个元素对应当前year某个月的数据
+        List<TMonthlyProductionReport> tMonthlyProductionReports = tMonthlyProductionReportMapper.selectChemicalConsumeByYear(year);
+        // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
+        List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_pt3000","PT-3000","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_naoh","NAOH","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_pt4000","PT-4000","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_ec3392a","EC3392A","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_2w906","2W906","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_ec1489a","EC1489A","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_ec1486a","EC1486A","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_20y3483","20Y3483","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_8q202","8Q202","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_20y97a","20Y97A","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_ec3269a","EC3269A","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_20y25","20Y25","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_20y77","20Y77","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_510ws","510WS","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_n130","N130","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_h2so4","H2SO4","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_naoh2","NaOH","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_ch3oh","CH3OH","TO"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("chemical_consume_pt30002","PT-3000","TO"));
+        // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
+        for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
+            TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
+            String chemicalConsumePt3000 = tMonthlyProductionReport.getChemicalConsumePt3000();
+            String chemicalConsumeNaoh = tMonthlyProductionReport.getChemicalConsumeNaoh();
+            String chemicalConsumePt4000 = tMonthlyProductionReport.getChemicalConsumePt4000();
+            String chemicalConsumeEc3392a = tMonthlyProductionReport.getChemicalConsumeEc3392a();
+            String chemicalConsume2w906 = tMonthlyProductionReport.getChemicalConsume2w906();
+            String chemicalConsumeEc1489a = tMonthlyProductionReport.getChemicalConsumeEc1489a();
+            String chemicalConsumeEc1486a = tMonthlyProductionReport.getChemicalConsumeEc1486a();
+            String chemicalConsume20y3483 = tMonthlyProductionReport.getChemicalConsume20y3483();
+            String chemicalConsume8q202 = tMonthlyProductionReport.getChemicalConsume8q202();
+            String chemicalConsume20y97a = tMonthlyProductionReport.getChemicalConsume20y97a();
+            String chemicalConsumeEc3269a = tMonthlyProductionReport.getChemicalConsumeEc3269a();
+            String chemicalConsume20y25 = tMonthlyProductionReport.getChemicalConsume20y25();
+            String chemicalConsume20y77 = tMonthlyProductionReport.getChemicalConsume20y77();
+            String chemicalConsume510ws = tMonthlyProductionReport.getChemicalConsume510ws();
+            String chemicalConsumeN130 = tMonthlyProductionReport.getChemicalConsumeN130();
+            String chemicalConsumeH2so4 = tMonthlyProductionReport.getChemicalConsumeH2so4();
+            String chemicalConsumeNaoh2 = tMonthlyProductionReport.getChemicalConsumeNaoh2();
+            String chemicalConsumeCh3oh = tMonthlyProductionReport.getChemicalConsumeCh3oh();
+            String chemicalConsumePt30002 = tMonthlyProductionReport.getChemicalConsumePt30002();
+            Long reportMonth = tMonthlyProductionReport.getReportMonth();   // 当前元素的所属月份
+            Long reportYear = tMonthlyProductionReport.getReportYear();     // 当前元素的所属年份
+            // 前端数据集合的class
+            Class clazz = null;
+            // 当前元素调用的set方法
+            Method method = null;
+            try {
+                clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
+                method = this.getSetMethod(reportMonth, clazz);
+                // 按照当前元素的所属月份调取相应set方法
+                method.invoke(monthlyProductionReportVOs.get(0), chemicalConsumePt3000);
+                method.invoke(monthlyProductionReportVOs.get(1), chemicalConsumeNaoh);
+                method.invoke(monthlyProductionReportVOs.get(2), chemicalConsumePt4000);
+                method.invoke(monthlyProductionReportVOs.get(3), chemicalConsumeEc3392a);
+                method.invoke(monthlyProductionReportVOs.get(4), chemicalConsume2w906);
+                method.invoke(monthlyProductionReportVOs.get(5), chemicalConsumeEc1489a);
+                method.invoke(monthlyProductionReportVOs.get(6), chemicalConsumeEc1486a);
+                method.invoke(monthlyProductionReportVOs.get(7), chemicalConsume20y3483);
+                method.invoke(monthlyProductionReportVOs.get(8), chemicalConsume8q202);
+                method.invoke(monthlyProductionReportVOs.get(9), chemicalConsume20y97a);
+                method.invoke(monthlyProductionReportVOs.get(10), chemicalConsumeEc3269a);
+                method.invoke(monthlyProductionReportVOs.get(11), chemicalConsume20y25);
+                method.invoke(monthlyProductionReportVOs.get(12), chemicalConsume20y77);
+                method.invoke(monthlyProductionReportVOs.get(13), chemicalConsume510ws);
+                method.invoke(monthlyProductionReportVOs.get(14), chemicalConsumeN130);
+                method.invoke(monthlyProductionReportVOs.get(15), chemicalConsumeH2so4);
+                method.invoke(monthlyProductionReportVOs.get(16), chemicalConsumeNaoh2);
+                method.invoke(monthlyProductionReportVOs.get(17), chemicalConsumeCh3oh);
+                method.invoke(monthlyProductionReportVOs.get(18), chemicalConsumePt30002);
+                // 当前年份=所属年份,当前月份=所属月份
+                if (currentMonth.equals(reportMonth) && currentYear.equals(reportYear)) {
+                    monthlyProductionReportVOs.get(0).setCurrently(chemicalConsumePt3000);
+                    monthlyProductionReportVOs.get(1).setCurrently(chemicalConsumeNaoh);
+                    monthlyProductionReportVOs.get(2).setCurrently(chemicalConsumePt4000);
+                    monthlyProductionReportVOs.get(3).setCurrently(chemicalConsumeEc3392a);
+                    monthlyProductionReportVOs.get(4).setCurrently(chemicalConsume2w906);
+                    monthlyProductionReportVOs.get(5).setCurrently(chemicalConsumeEc1489a);
+                    monthlyProductionReportVOs.get(6).setCurrently(chemicalConsumeEc1486a);
+                    monthlyProductionReportVOs.get(7).setCurrently(chemicalConsume20y3483);
+                    monthlyProductionReportVOs.get(8).setCurrently(chemicalConsume8q202);
+                    monthlyProductionReportVOs.get(9).setCurrently(chemicalConsume20y97a);
+                    monthlyProductionReportVOs.get(10).setCurrently(chemicalConsumeEc3269a);
+                    monthlyProductionReportVOs.get(11).setCurrently(chemicalConsume20y25);
+                    monthlyProductionReportVOs.get(12).setCurrently(chemicalConsume20y77);
+                    monthlyProductionReportVOs.get(13).setCurrently(chemicalConsume510ws);
+                    monthlyProductionReportVOs.get(14).setCurrently(chemicalConsumeN130);
+                    monthlyProductionReportVOs.get(15).setCurrently(chemicalConsumeH2so4);
+                    monthlyProductionReportVOs.get(16).setCurrently(chemicalConsumeNaoh2);
+                    monthlyProductionReportVOs.get(17).setCurrently(chemicalConsumeCh3oh);
+                    monthlyProductionReportVOs.get(18).setCurrently(chemicalConsumePt30002);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        this.calcTotal(monthlyProductionReportVOs);
+        return monthlyProductionReportVOs;
     }
 
     /**
@@ -1931,4 +2038,123 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         }
         return affectedRows;
     }
+
+    /**
+     * 修改Chemical Consume
+     */
+    @Override
+    public int updateChemicalConsume(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 ("chemical_consume_pt3000".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumePt3000(monthValue);
+                }
+                if ("chemical_consume_naoh".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeNaoh(monthValue);
+                }
+                if ("chemical_consume_pt4000".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumePt4000(monthValue);
+                }
+                if ("chemical_consume_ec3392a".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeEc3392a(monthValue);
+                }
+                if ("chemical_consume_2w906".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsume2w906(monthValue);
+                }
+                if ("chemical_consume_ec1489a".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeEc1489a(monthValue);
+                }
+                if ("chemical_consume_ec1486a".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeEc1486a(monthValue);
+                }
+                if ("chemical_consume_20y3483".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsume20y3483(monthValue);
+                }
+                if ("chemical_consume_8q202".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsume8q202(monthValue);
+                }
+                if ("chemical_consume_20y97a".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsume20y97a(monthValue);
+                }
+                if ("chemical_consume_ec3269a".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeEc3269a(monthValue);
+                }
+                if ("chemical_consume_20y25".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsume20y25(monthValue);
+                }
+                if ("chemical_consume_20y77".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsume20y77(monthValue);
+                }
+                if ("chemical_consume_510ws".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsume510ws(monthValue);
+                }
+                if ("chemical_consume_n130".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeN130(monthValue);
+                }
+                if ("chemical_consume_h2so4".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeH2so4(monthValue);
+                }
+                if ("chemical_consume_naoh2".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeNaoh2(monthValue);
+                }
+                if ("chemical_consume_ch3oh".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumeCh3oh(monthValue);
+                }
+                if ("chemical_consume_pt30002".equals(tableDatum.getDictLabel())) {
+                    report.setChemicalConsumePt30002(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;
+    }
 }

+ 89 - 1
master/src/main/resources/mybatis/production/TMonthlyProductionReportMapper.xml

@@ -150,6 +150,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="ethyleneCapacity"         column="ethylene_capacity"    />
         <result property="aeuLoad"                  column="aeu_load"    />
         <result property="btxCapacity"              column="btx_capacity"    />
+        <result property="chemicalConsumePt3000"    column="chemical_consume_pt3000"    />
+        <result property="chemicalConsumeNaoh"      column="chemical_consume_naoh"    />
+        <result property="chemicalConsumePt4000"    column="chemical_consume_pt4000"    />
+        <result property="chemicalConsumeEc3392a"   column="chemical_consume_ec3392a"    />
+        <result property="chemicalConsume2w906"     column="chemical_consume_2w906"    />
+        <result property="chemicalConsumeEc1489a"   column="chemical_consume_ec1489a"    />
+        <result property="chemicalConsumeEc1486a"   column="chemical_consume_ec1486a"    />
+        <result property="chemicalConsume20y3483"   column="chemical_consume_20y3483"    />
+        <result property="chemicalConsume8q202"     column="chemical_consume_8q202"    />
+        <result property="chemicalConsume20y97a"    column="chemical_consume_20y97a"    />
+        <result property="chemicalConsumeEc3269a"   column="chemical_consume_ec3269a"    />
+        <result property="chemicalConsume20y25"     column="chemical_consume_20y25"    />
+        <result property="chemicalConsume20y77"     column="chemical_consume_20y77"    />
+        <result property="chemicalConsume510ws"     column="chemical_consume_510ws"    />
+        <result property="chemicalConsumeN130"      column="chemical_consume_n130"    />
+        <result property="chemicalConsumeH2so4"     column="chemical_consume_h2so4"    />
+        <result property="chemicalConsumeNaoh2"     column="chemical_consume_naoh2"    />
+        <result property="chemicalConsumeCh3oh"     column="chemical_consume_ch3oh"    />
+        <result property="chemicalConsumePt30002"   column="chemical_consume_pt30002"    />
     </resultMap>
 
     <select id="selectCrackerRawMaterialByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
@@ -293,7 +312,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where d.report_year = #{year}
     </select>
 
-    <select id="selectChemicalConsumeByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+    <select id="selectChemicalConsumeByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
+        select
+               d.id, d.report_month, d.report_year,
+               d.chemical_consume_pt3000, d.chemical_consume_naoh, d.chemical_consume_pt4000,
+               d.chemical_consume_ec3392a, d.chemical_consume_2w906, d.chemical_consume_ec1489a,
+               d.chemical_consume_ec1486a, d.chemical_consume_20y3483, d.chemical_consume_8q202,
+               d.chemical_consume_20y97a, d.chemical_consume_ec3269a, d.chemical_consume_20y25,
+               d.chemical_consume_20y77, d.chemical_consume_510ws, d.chemical_consume_n130,
+               d.chemical_consume_h2so4, d.chemical_consume_naoh2, d.chemical_consume_ch3oh, d.chemical_consume_pt30002
+        from
+             t_monthly_production_report d
+        where d.report_year = #{year}
+    </select>
 
     <select id="selectSCTUUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
 
@@ -468,6 +499,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ethyleneCapacity != null">ethylene_capacity,</if>
             <if test="aeuLoad != null">aeu_load,</if>
             <if test="btxCapacity != null">btx_capacity,</if>
+            <if test="chemicalConsumePt3000 != null">chemical_consume_pt3000,</if>
+            <if test="chemicalConsumeNaoh != null">chemical_consume_naoh,</if>
+            <if test="chemicalConsumePt4000 != null">chemical_consume_pt4000,</if>
+            <if test="chemicalConsumeEc3392a != null">chemical_consume_ec3392a,</if>
+            <if test="chemicalConsume2w906 != null">chemical_consume_2w906,</if>
+            <if test="chemicalConsumeEc1489a != null">chemical_consume_ec1489a,</if>
+            <if test="chemicalConsumeEc1486a != null">chemical_consume_ec1486a,</if>
+            <if test="chemicalConsume20y3483 != null">chemical_consume_20y3483,</if>
+            <if test="chemicalConsume8q202 != null">chemical_consume_8q202,</if>
+            <if test="chemicalConsume20y97a != null">chemical_consume_20y97a,</if>
+            <if test="chemicalConsumeEc3269a != null">chemical_consume_ec3269a,</if>
+            <if test="chemicalConsume20y25 != null">chemical_consume_20y25,</if>
+            <if test="chemicalConsume20y77 != null">chemical_consume_20y77,</if>
+            <if test="chemicalConsume510ws != null">chemical_consume_510ws,</if>
+            <if test="chemicalConsumeN130 != null">chemical_consume_n130,</if>
+            <if test="chemicalConsumeH2so4 != null">chemical_consume_h2so4,</if>
+            <if test="chemicalConsumeNaoh2 != null">chemical_consume_naoh2,</if>
+            <if test="chemicalConsumeCh3oh != null">chemical_consume_ch3oh,</if>
+            <if test="chemicalConsumePt30002 != null">chemical_consume_pt30002,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -615,6 +665,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ethyleneCapacity != null">#{ethyleneCapacity},</if>
             <if test="aeuLoad != null">#{aeuLoad},</if>
             <if test="btxCapacity != null">#{btxCapacity},</if>
+            <if test="chemicalConsumePt3000 != null">#{chemicalConsumePt3000},</if>
+            <if test="chemicalConsumeNaoh != null">#{chemicalConsumeNaoh},</if>
+            <if test="chemicalConsumePt4000 != null">#{chemicalConsumePt4000},</if>
+            <if test="chemicalConsumeEc3392a != null">#{chemicalConsumeEc3392a},</if>
+            <if test="chemicalConsume2w906 != null">#{chemicalConsume2w906},</if>
+            <if test="chemicalConsumeEc1489a != null">#{chemicalConsumeEc1489a},</if>
+            <if test="chemicalConsumeEc1486a != null">#{chemicalConsumeEc1486a},</if>
+            <if test="chemicalConsume20y3483 != null">#{chemicalConsume20y3483},</if>
+            <if test="chemicalConsume8q202 != null">#{chemicalConsume8q202},</if>
+            <if test="chemicalConsume20y97a != null">#{chemicalConsume20y97a},</if>
+            <if test="chemicalConsumeEc3269a != null">#{chemicalConsumeEc3269a},</if>
+            <if test="chemicalConsume20y25 != null">#{chemicalConsume20y25},</if>
+            <if test="chemicalConsume20y77 != null">#{chemicalConsume20y77},</if>
+            <if test="chemicalConsume510ws != null">#{chemicalConsume510ws},</if>
+            <if test="chemicalConsumeN130 != null">#{chemicalConsumeN130},</if>
+            <if test="chemicalConsumeH2so4 != null">#{chemicalConsumeH2so4},</if>
+            <if test="chemicalConsumeNaoh2 != null">#{chemicalConsumeNaoh2},</if>
+            <if test="chemicalConsumeCh3oh != null">#{chemicalConsumeCh3oh},</if>
+            <if test="chemicalConsumePt30002 != null">#{chemicalConsumePt30002},</if>
         </trim>
     </insert>
 
@@ -763,6 +832,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ethyleneCapacity != null">ethylene_capacity = #{ethyleneCapacity},</if>
             <if test="aeuLoad != null">aeu_load = #{aeuLoad},</if>
             <if test="btxCapacity != null">btx_capacity = #{btxCapacity},</if>
+            <if test="chemicalConsumePt3000 != null">chemical_consume_pt3000 = #{chemicalConsumePt3000},</if>
+            <if test="chemicalConsumeNaoh != null">chemical_consume_naoh = #{chemicalConsumeNaoh},</if>
+            <if test="chemicalConsumePt4000 != null">chemical_consume_pt4000 = #{chemicalConsumePt4000},</if>
+            <if test="chemicalConsumeEc3392a != null">chemical_consume_ec3392a = #{chemicalConsumeEc3392a},</if>
+            <if test="chemicalConsume2w906 != null">chemical_consume_2w906 = #{chemicalConsume2w906},</if>
+            <if test="chemicalConsumeEc1489a != null">chemical_consume_ec1489a = #{chemicalConsumeEc1489a},</if>
+            <if test="chemicalConsumeEc1486a != null">chemical_consume_ec1486a = #{chemicalConsumeEc1486a},</if>
+            <if test="chemicalConsume20y3483 != null">chemical_consume_20y3483 = #{chemicalConsume20y3483},</if>
+            <if test="chemicalConsume8q202 != null">chemical_consume_8q202 = #{chemicalConsume8q202},</if>
+            <if test="chemicalConsume20y97a != null">chemical_consume_20y97a = #{chemicalConsume20y97a},</if>
+            <if test="chemicalConsumeEc3269a != null">chemical_consume_ec3269a = #{chemicalConsumeEc3269a},</if>
+            <if test="chemicalConsume20y25 != null">chemical_consume_20y25 = #{chemicalConsume20y25},</if>
+            <if test="chemicalConsume20y77 != null">chemical_consume_20y77 = #{chemicalConsume20y77},</if>
+            <if test="chemicalConsume510ws != null">chemical_consume_510ws = #{chemicalConsume510ws},</if>
+            <if test="chemicalConsumeN130 != null">chemical_consume_n130 = #{chemicalConsumeN130},</if>
+            <if test="chemicalConsumeH2so4 != null">chemical_consume_h2so4 = #{chemicalConsumeH2so4},</if>
+            <if test="chemicalConsumeNaoh2 != null">chemical_consume_naoh2 = #{chemicalConsumeNaoh2},</if>
+            <if test="chemicalConsumeCh3oh != null">chemical_consume_ch3oh = #{chemicalConsumeCh3oh},</if>
+            <if test="chemicalConsumePt30002 != null">chemical_consume_pt30002 = #{chemicalConsumePt30002},</if>
         </trim>
         where report_month = #{reportMonth} and report_year = #{reportYear}
     </update>

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

@@ -1,5 +1,14 @@
 import request from '@/utils/request'
 
+// 修改Chemical Consume
+export function updateChemicalConsume(data) {
+  return request({
+    url: '/production/monthly/chemicalConsume',
+    method: 'put',
+    data: data
+  })
+}
+
 // 修改Runing Rate
 export function updateRuningRate(data) {
   return request({

+ 188 - 75
ui/src/views/production/monthly/index.vue

@@ -1532,6 +1532,32 @@
       </el-table-column>
     </el-table>
     <!-- Chemical Consume -->
+    <div class="editDiv">
+      <el-button
+        :disabled="chemicalConsumeUpdating"
+        type="primary"
+        icon="el-icon-edit"
+        size="mini"
+        @click="handleChemicalConsumeUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('编辑Chemical Consume') }}</el-button>
+      <el-button
+        :disabled="!chemicalConsumeUpdating"
+        type="success"
+        icon="el-icon-check"
+        size="mini"
+        @click="handleConfirmChemicalConsumeUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('保存') }}</el-button>
+      <el-button
+        :disabled="!chemicalConsumeUpdating"
+        type="info"
+        icon="el-icon-close"
+        size="mini"
+        @click="handleCancelChemicalConsumeUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('取消') }}</el-button>
+    </div>
     <el-table border :data="tableChemicalConsume" style="width: 100%;">
       <el-table-column label="chemical consume">
         <el-table-column width="150" prop="title" label="">
@@ -1541,18 +1567,102 @@
         </el-table-column>
         <el-table-column prop="unit" label="unit"></el-table-column>
         <el-table-column prop="currently" label="currently"></el-table-column>
-        <el-table-column prop="jan" :label="this.monthList[0]"></el-table-column>
-        <el-table-column prop="feb" :label="this.monthList[1]"></el-table-column>
-        <el-table-column prop="mar" :label="this.monthList[2]"></el-table-column>
-        <el-table-column prop="apr" :label="this.monthList[3]"></el-table-column>
-        <el-table-column prop="may" :label="this.monthList[4]"></el-table-column>
-        <el-table-column prop="jun" :label="this.monthList[5]"></el-table-column>
-        <el-table-column prop="jul" :label="this.monthList[6]"></el-table-column>
-        <el-table-column prop="aug" :label="this.monthList[7]"></el-table-column>
-        <el-table-column prop="sep" :label="this.monthList[8]"></el-table-column>
-        <el-table-column prop="oct" :label="this.monthList[9]"></el-table-column>
-        <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
-        <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
+        <el-table-column prop="jan" :label="this.monthList[0]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.jan}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.jan" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="feb" :label="this.monthList[1]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.feb}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.feb" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="mar" :label="this.monthList[2]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.mar}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.mar" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="apr" :label="this.monthList[3]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.apr}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.apr" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="may" :label="this.monthList[4]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.may}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.may" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jun" :label="this.monthList[5]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.jun}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.jun" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jul" :label="this.monthList[6]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.jul}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.jul" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="aug" :label="this.monthList[7]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.aug}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.aug" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sep" :label="this.monthList[8]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.sep}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.sep" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="oct" :label="this.monthList[9]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.oct}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.oct" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="nov" :label="this.monthList[10]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.nov}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.nov" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="dec" :label="this.monthList[11]">
+          <template slot-scope="{row}">
+            <div v-if="!chemicalConsumeUpdating">{{row.dec}}</div>
+            <div v-if="chemicalConsumeUpdating">
+              <el-input v-model="row.dec" clearable="true"></el-input>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
       </el-table-column>
     </el-table>
@@ -1724,7 +1834,8 @@ import {
   updateCrackerUtilityConsumption,
   updateAromaticsUtilityConsumption,
   updateShoudownHour,
-  updateRuningRate
+  updateRuningRate,
+  updateChemicalConsume
 } from "@/api/production/monthly";
 
 export default {
@@ -1732,6 +1843,7 @@ export default {
   data() {
     return {
       // 修改中
+      chemicalConsumeUpdating: false,
       runingRateUpdating: false,
       shoudownHourUpdating: false,
       aromaticsUtilityConsumptionUpdating: false,
@@ -1795,31 +1907,7 @@ export default {
       tableRuningRate: [],
       tableShoudownHour: [],
       tableOtherside: [],
-      tableChemicalConsume: [
-        {title: "Cracker and PGU"},
-        {title: "PT-3000"},
-        {title: "NAOH"},
-        {title: "PT-4000"},
-        {title: "EC3392A"},
-        {title: "2W906"},
-        {title: "EC1489A"},
-        {title: "EC1486A"},
-        {title: "20Y3483"},
-        {title: "8Q202"},
-        {title: "20Y97A"},
-        {title: "EC3269A"},
-        {title: "20Y25"},
-        {title: "20Y77"},
-        {title: "510WS"},
-        {title: "N130"},
-        {title: "H2SO4"},
-        {title: "NaOH"},
-        {title: "CH3OH"},
-        {title: ""},
-        {title: "PT-3000"},
-        {title: ""},
-        {title: ""},
-      ],
+      tableChemicalConsume: [],
       tableSCTUUtilityConsumption: [
         {title: "FG ( NG+Offage)"},
         {title: "MP"},
@@ -1939,12 +2027,15 @@ export default {
   },
   methods: {
     /** 编辑按钮操作 */
+    handleChemicalConsumeUpdate(row) {
+      this.chemicalConsumeUpdating = true;
+    },
     handleRuningRateUpdate(row) {
       this.runingRateUpdating = true;
     },
     handleShoudownHourUpdate(row) {
-  this.shoudownHourUpdating = true;
-},
+      this.shoudownHourUpdating = true;
+    },
     handleAromaticsUtilityConsumptionUpdate(row) {
       this.aromaticsUtilityConsumptionUpdating = true;
     },
@@ -1955,6 +2046,22 @@ export default {
       this.eligibleProductRateUpdating = true;
     },
     /** 确定修改按钮操作 */
+    handleConfirmChemicalConsumeUpdate(row) {
+      this.chemicalConsumeUpdating = false;
+      updateChemicalConsume({
+        tableData: this.tableChemicalConsume,
+        year: this.year.getFullYear()
+      }).then(response => {
+        if (response.code == 200) {
+          this.$message.success("修改成功");
+        } else {
+          this.$message.error("未知错误,请联系管理员。");
+        }
+        getChemicalConsume(year).then(response => {
+          this.tableChemicalConsume = response.data;
+        });
+      });
+    },
     handleConfirmRuningRateUpdate(row) {
       this.runingRateUpdating = false;
       updateRuningRate({
@@ -1977,38 +2084,38 @@ export default {
       });
     },
     handleConfirmShoudownHourUpdate(row) {
-  this.shoudownHourUpdating = false;
-  updateShoudownHour({
-    tableData: [
-      this.tableShoudownHour[0],
-      this.tableShoudownHour[1],
-      this.tableShoudownHour[2],
-      this.tableShoudownHour[3],
-      this.tableShoudownHour[4],
-      this.tableShoudownHour[5],
-      this.tableShoudownHour[6],
-      this.tableShoudownHour[7],
-      this.tableShoudownHour[8],
-      this.tableShoudownHour[9],
-    ],
-    year: this.year.getFullYear()
-  }).then(response => {
-    if (response.code == 200) {
-      this.$message.success("修改成功");
-    } else {
-      this.$message.error("未知错误,请联系管理员。");
-    }
-    getShoudownHour(year).then(response => {
-      this.tableShoudownHour = response.data;
-    });
-    getRuningRate(year).then(response => {
-      this.tableRuningRate = response.data;
-    });
-    getPlantLoad(year).then(response => {
-      this.tablePlantLoad = response.data;
-    });
-  });
-},
+      this.shoudownHourUpdating = false;
+      updateShoudownHour({
+        tableData: [
+          this.tableShoudownHour[0],
+          this.tableShoudownHour[1],
+          this.tableShoudownHour[2],
+          this.tableShoudownHour[3],
+          this.tableShoudownHour[4],
+          this.tableShoudownHour[5],
+          this.tableShoudownHour[6],
+          this.tableShoudownHour[7],
+          this.tableShoudownHour[8],
+          this.tableShoudownHour[9],
+        ],
+        year: this.year.getFullYear()
+      }).then(response => {
+        if (response.code == 200) {
+          this.$message.success("修改成功");
+        } else {
+          this.$message.error("未知错误,请联系管理员。");
+        }
+        getShoudownHour(year).then(response => {
+          this.tableShoudownHour = response.data;
+        });
+        getRuningRate(year).then(response => {
+          this.tableRuningRate = response.data;
+        });
+        getPlantLoad(year).then(response => {
+          this.tablePlantLoad = response.data;
+        });
+      });
+    },
     handleConfirmAromaticsUtilityConsumptionUpdate(row) {
       this.aromaticsUtilityConsumptionUpdating = false;
       updateAromaticsUtilityConsumption({
@@ -2075,6 +2182,12 @@ export default {
       });
     },
     /** 取消修改按钮操作 */
+    handleCancelChemicalConsumeUpdate(row) {
+      this.chemicalConsumeUpdating = false;
+      getChemicalConsume(year).then(response => {
+        this.tableChemicalConsume = response.data;
+      });
+    },
     handleCancelRuningRateUpdate(row) {
       this.runingRateUpdating = false;
       getRuningRate(year).then(response => {
@@ -2287,9 +2400,9 @@ export default {
       getOtherside(year).then(response => {
         this.tableOtherside = response.data;
       });
-      // getChemicalConsume(year).then(response => {
-      //   this.tableChemicalConsume = response.data;
-      // });
+      getChemicalConsume(year).then(response => {
+        this.tableChemicalConsume = response.data;
+      });
       // getSCTUUtilityConsumption(year).then(response => {
       //   this.tableSCTUUtilityConsumption = response.data;
       // });