Browse Source

王子文 月报 开工锅炉公用工程单价维护

wangggziwen 2 years ago
parent
commit
bb0e56b202

+ 125 - 0
master/src/main/java/com/ruoyi/project/production/controller/TMonthlyProductionPriceController.java

@@ -0,0 +1,125 @@
+package com.ruoyi.project.production.controller;
+
+import java.util.List;
+
+import com.ruoyi.project.production.controller.vo.MonthlyUpdateVO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.production.domain.TMonthlyProductionPrice;
+import com.ruoyi.project.production.service.ITMonthlyProductionPriceService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * 生产月报单价维护Controller
+ *
+ * @author ruoyi
+ * @date 2022-11-18
+ */
+@RestController
+@RequestMapping("/production/price")
+public class TMonthlyProductionPriceController extends BaseController
+{
+    @Autowired
+    private ITMonthlyProductionPriceService tMonthlyProductionPriceService;
+
+    /**
+     * 修改单价列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:edit')")
+    @PutMapping(value = "/updatePriceList")
+    public AjaxResult updatePriceList(@RequestBody MonthlyUpdateVO monthlyUpdateVO)
+    {
+        return toAjax(tMonthlyProductionPriceService.updatePriceList(monthlyUpdateVO));
+    }
+
+    /**
+     * 按年份查询单价
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:query')")
+    @GetMapping(value = "/getByYear/{year}")
+    public AjaxResult getPriceByYear(@PathVariable("year") Long year)
+    {
+        return AjaxResult.success(tMonthlyProductionPriceService.selectPriceByYear(year));
+    }
+
+    /**
+     * 查询生产月报单价维护列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TMonthlyProductionPrice tMonthlyProductionPrice)
+    {
+        startPage();
+        List<TMonthlyProductionPrice> list = tMonthlyProductionPriceService.selectTMonthlyProductionPriceList(tMonthlyProductionPrice);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出生产月报单价维护列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:export')")
+    @Log(title = "生产月报单价维护", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TMonthlyProductionPrice tMonthlyProductionPrice)
+    {
+        List<TMonthlyProductionPrice> list = tMonthlyProductionPriceService.selectTMonthlyProductionPriceList(tMonthlyProductionPrice);
+        ExcelUtil<TMonthlyProductionPrice> util = new ExcelUtil<TMonthlyProductionPrice>(TMonthlyProductionPrice.class);
+        return util.exportExcel(list, "price");
+    }
+
+    /**
+     * 获取生产月报单价维护详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tMonthlyProductionPriceService.selectTMonthlyProductionPriceById(id));
+    }
+
+    /**
+     * 新增生产月报单价维护
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:add')")
+    @Log(title = "生产月报单价维护", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TMonthlyProductionPrice tMonthlyProductionPrice)
+    {
+        return toAjax(tMonthlyProductionPriceService.insertTMonthlyProductionPrice(tMonthlyProductionPrice));
+    }
+
+    /**
+     * 修改生产月报单价维护
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:edit')")
+    @Log(title = "生产月报单价维护", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TMonthlyProductionPrice tMonthlyProductionPrice)
+    {
+        return toAjax(tMonthlyProductionPriceService.updateTMonthlyProductionPrice(tMonthlyProductionPrice));
+    }
+
+    /**
+     * 删除生产月报单价维护
+     */
+    @PreAuthorize("@ss.hasPermi('production:price:remove')")
+    @Log(title = "生产月报单价维护", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tMonthlyProductionPriceService.deleteTMonthlyProductionPriceByIds(ids));
+    }
+}

+ 219 - 0
master/src/main/java/com/ruoyi/project/production/domain/TMonthlyProductionPrice.java

@@ -0,0 +1,219 @@
+package com.ruoyi.project.production.domain;
+
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 生产月报单价维护对象 t_monthly_production_price
+ *
+ * @author ruoyi
+ * @date 2022-11-18
+ */
+public class TMonthlyProductionPrice extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long reportMonth;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long reportYear;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConElectricPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConNgPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConFgFrEuPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConLpgPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConHhpSteamPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConPCondensatePrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConCwPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConIaPaPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConBfwPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConEoEgPurgeGasPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String subConH2FulePrice;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setReportMonth(Long reportMonth)
+    {
+        this.reportMonth = reportMonth;
+    }
+
+    public Long getReportMonth()
+    {
+        return reportMonth;
+    }
+    public void setReportYear(Long reportYear)
+    {
+        this.reportYear = reportYear;
+    }
+
+    public Long getReportYear()
+    {
+        return reportYear;
+    }
+    public void setSubConElectricPrice(String subConElectricPrice)
+    {
+        this.subConElectricPrice = subConElectricPrice;
+    }
+
+    public String getSubConElectricPrice()
+    {
+        return subConElectricPrice;
+    }
+    public void setSubConNgPrice(String subConNgPrice)
+    {
+        this.subConNgPrice = subConNgPrice;
+    }
+
+    public String getSubConNgPrice()
+    {
+        return subConNgPrice;
+    }
+    public void setSubConFgFrEuPrice(String subConFgFrEuPrice)
+    {
+        this.subConFgFrEuPrice = subConFgFrEuPrice;
+    }
+
+    public String getSubConFgFrEuPrice()
+    {
+        return subConFgFrEuPrice;
+    }
+    public void setSubConLpgPrice(String subConLpgPrice)
+    {
+        this.subConLpgPrice = subConLpgPrice;
+    }
+
+    public String getSubConLpgPrice()
+    {
+        return subConLpgPrice;
+    }
+    public void setSubConHhpSteamPrice(String subConHhpSteamPrice)
+    {
+        this.subConHhpSteamPrice = subConHhpSteamPrice;
+    }
+
+    public String getSubConHhpSteamPrice()
+    {
+        return subConHhpSteamPrice;
+    }
+    public void setSubConPCondensatePrice(String subConPCondensatePrice)
+    {
+        this.subConPCondensatePrice = subConPCondensatePrice;
+    }
+
+    public String getSubConPCondensatePrice()
+    {
+        return subConPCondensatePrice;
+    }
+    public void setSubConCwPrice(String subConCwPrice)
+    {
+        this.subConCwPrice = subConCwPrice;
+    }
+
+    public String getSubConCwPrice()
+    {
+        return subConCwPrice;
+    }
+    public void setSubConIaPaPrice(String subConIaPaPrice)
+    {
+        this.subConIaPaPrice = subConIaPaPrice;
+    }
+
+    public String getSubConIaPaPrice()
+    {
+        return subConIaPaPrice;
+    }
+    public void setSubConBfwPrice(String subConBfwPrice)
+    {
+        this.subConBfwPrice = subConBfwPrice;
+    }
+
+    public String getSubConBfwPrice()
+    {
+        return subConBfwPrice;
+    }
+    public void setSubConEoEgPurgeGasPrice(String subConEoEgPurgeGasPrice)
+    {
+        this.subConEoEgPurgeGasPrice = subConEoEgPurgeGasPrice;
+    }
+
+    public String getSubConEoEgPurgeGasPrice()
+    {
+        return subConEoEgPurgeGasPrice;
+    }
+    public void setSubConH2FulePrice(String subConH2FulePrice)
+    {
+        this.subConH2FulePrice = subConH2FulePrice;
+    }
+
+    public String getSubConH2FulePrice()
+    {
+        return subConH2FulePrice;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("reportMonth", getReportMonth())
+            .append("reportYear", getReportYear())
+            .append("subConElectricPrice", getSubConElectricPrice())
+            .append("subConNgPrice", getSubConNgPrice())
+            .append("subConFgFrEuPrice", getSubConFgFrEuPrice())
+            .append("subConLpgPrice", getSubConLpgPrice())
+            .append("subConHhpSteamPrice", getSubConHhpSteamPrice())
+            .append("subConPCondensatePrice", getSubConPCondensatePrice())
+            .append("subConCwPrice", getSubConCwPrice())
+            .append("subConIaPaPrice", getSubConIaPaPrice())
+            .append("subConBfwPrice", getSubConBfwPrice())
+            .append("subConEoEgPurgeGasPrice", getSubConEoEgPurgeGasPrice())
+            .append("subConH2FulePrice", getSubConH2FulePrice())
+            .toString();
+    }
+}

+ 80 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TMonthlyProductionPriceMapper.java

@@ -0,0 +1,80 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TMonthlyProductionPrice;
+import com.ruoyi.project.production.domain.TMonthlyProductionReport;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 生产月报单价维护Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-11-18
+ */
+public interface TMonthlyProductionPriceMapper 
+{
+    /**
+     * 查询生产月报单价维护
+     * 
+     * @param id 生产月报单价维护ID
+     * @return 生产月报单价维护
+     */
+    public TMonthlyProductionPrice selectTMonthlyProductionPriceById(Long id);
+
+    /**
+     * 查询生产月报单价维护列表
+     * 
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 生产月报单价维护集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TMonthlyProductionPrice> selectTMonthlyProductionPriceList(TMonthlyProductionPrice tMonthlyProductionPrice);
+
+    /**
+     * 新增生产月报单价维护
+     * 
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 结果
+     */
+    public int insertTMonthlyProductionPrice(TMonthlyProductionPrice tMonthlyProductionPrice);
+
+    /**
+     * 修改生产月报单价维护
+     * 
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 结果
+     */
+    public int updateTMonthlyProductionPrice(TMonthlyProductionPrice tMonthlyProductionPrice);
+
+    /**
+     * 删除生产月报单价维护
+     * 
+     * @param id 生产月报单价维护ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionPriceById(Long id);
+
+    /**
+     * 批量删除生产月报单价维护
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionPriceByIds(Long[] ids);
+
+    List<TMonthlyProductionPrice> selectPriceByYear(Long year);
+
+    /**
+     * 查询单价记录是否已存在
+     * 返回结果==0表示不存在,>=0表示已存在
+     *
+     * @param reportYear    年份
+     * @param reportMonth   月份
+     * @return
+     */
+    public int selectTMonthlyProductionPriceCountByDate(
+            @Param("reportYear")int reportYear,
+            @Param("reportMonth")int reportMonth
+    );
+}

+ 68 - 0
master/src/main/java/com/ruoyi/project/production/service/ITMonthlyProductionPriceService.java

@@ -0,0 +1,68 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+
+import com.ruoyi.project.production.controller.vo.MonthlyUpdateVO;
+import com.ruoyi.project.production.domain.TMonthlyProductionPrice;
+import com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO;
+
+/**
+ * 生产月报单价维护Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-11-18
+ */
+public interface ITMonthlyProductionPriceService 
+{
+    /**
+     * 查询生产月报单价维护
+     * 
+     * @param id 生产月报单价维护ID
+     * @return 生产月报单价维护
+     */
+    public TMonthlyProductionPrice selectTMonthlyProductionPriceById(Long id);
+
+    /**
+     * 查询生产月报单价维护列表
+     * 
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 生产月报单价维护集合
+     */
+    public List<TMonthlyProductionPrice> selectTMonthlyProductionPriceList(TMonthlyProductionPrice tMonthlyProductionPrice);
+
+    /**
+     * 新增生产月报单价维护
+     * 
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 结果
+     */
+    public int insertTMonthlyProductionPrice(TMonthlyProductionPrice tMonthlyProductionPrice);
+
+    /**
+     * 修改生产月报单价维护
+     * 
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 结果
+     */
+    public int updateTMonthlyProductionPrice(TMonthlyProductionPrice tMonthlyProductionPrice);
+
+    /**
+     * 批量删除生产月报单价维护
+     * 
+     * @param ids 需要删除的生产月报单价维护ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionPriceByIds(Long[] ids);
+
+    /**
+     * 删除生产月报单价维护信息
+     * 
+     * @param id 生产月报单价维护ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionPriceById(Long id);
+
+    List<MonthlyProductionReportVO> selectPriceByYear(Long year);
+
+    int updatePriceList(MonthlyUpdateVO monthlyUpdateVO);
+}

+ 252 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TMonthlyProductionPriceServiceImpl.java

@@ -0,0 +1,252 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.project.production.controller.vo.MonthlyUpdateVO;
+import com.ruoyi.project.production.domain.TMonthlyProductionReport;
+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.TMonthlyProductionPriceMapper;
+import com.ruoyi.project.production.domain.TMonthlyProductionPrice;
+import com.ruoyi.project.production.service.ITMonthlyProductionPriceService;
+
+/**
+ * 生产月报单价维护Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-11-18
+ */
+@Service
+public class TMonthlyProductionPriceServiceImpl implements ITMonthlyProductionPriceService
+{
+    @Autowired
+    private TMonthlyProductionPriceMapper tMonthlyProductionPriceMapper;
+
+    /**
+     * 查询生产月报单价维护
+     *
+     * @param id 生产月报单价维护ID
+     * @return 生产月报单价维护
+     */
+    @Override
+    public TMonthlyProductionPrice selectTMonthlyProductionPriceById(Long id)
+    {
+        return tMonthlyProductionPriceMapper.selectTMonthlyProductionPriceById(id);
+    }
+
+    /**
+     * 查询生产月报单价维护列表
+     *
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 生产月报单价维护
+     */
+    @Override
+    public List<TMonthlyProductionPrice> selectTMonthlyProductionPriceList(TMonthlyProductionPrice tMonthlyProductionPrice)
+    {
+        return tMonthlyProductionPriceMapper.selectTMonthlyProductionPriceList(tMonthlyProductionPrice);
+    }
+
+    /**
+     * 新增生产月报单价维护
+     *
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 结果
+     */
+    @Override
+    public int insertTMonthlyProductionPrice(TMonthlyProductionPrice tMonthlyProductionPrice)
+    {
+        return tMonthlyProductionPriceMapper.insertTMonthlyProductionPrice(tMonthlyProductionPrice);
+    }
+
+    /**
+     * 修改生产月报单价维护
+     *
+     * @param tMonthlyProductionPrice 生产月报单价维护
+     * @return 结果
+     */
+    @Override
+    public int updateTMonthlyProductionPrice(TMonthlyProductionPrice tMonthlyProductionPrice)
+    {
+        return tMonthlyProductionPriceMapper.updateTMonthlyProductionPrice(tMonthlyProductionPrice);
+    }
+
+    /**
+     * 批量删除生产月报单价维护
+     *
+     * @param ids 需要删除的生产月报单价维护ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonthlyProductionPriceByIds(Long[] ids)
+    {
+        return tMonthlyProductionPriceMapper.deleteTMonthlyProductionPriceByIds(ids);
+    }
+
+    /**
+     * 删除生产月报单价维护信息
+     *
+     * @param id 生产月报单价维护ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonthlyProductionPriceById(Long id)
+    {
+        return tMonthlyProductionPriceMapper.deleteTMonthlyProductionPriceById(id);
+    }
+
+    @Override
+    public List<MonthlyProductionReportVO> selectPriceByYear(Long year) {
+        TMonthlyProductionReportServiceImpl tMonthlyProductionReportService = new TMonthlyProductionReportServiceImpl();
+        // 当前日期
+        Date currentDate = new Date();
+        // 当前年份
+        Long currentYear = Long.parseLong(currentDate.getYear() + 1900 + "");
+        // 当前月份
+        Long currentMonth = Long.parseLong(currentDate.getMonth() + 1 + "");
+        // 从数据库中查出的当前year的月报数据集合,每个元素对应当前year某个月的数据
+        List<TMonthlyProductionPrice> tMonthlyProductionPrices = tMonthlyProductionPriceMapper.selectPriceByYear(year);
+        // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
+        List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_electric_price","Electric","cny/MWh"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_ng_price","NG","cny/KM3"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_fg_fr_eu_price","FG fr EU","cny/tom"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_lpg_price","LPG","cny/Ton"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_hhp_steam_price","HHP Steam","cny/Ton"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_p_condensate_price","P. Condensate","cny/Ton"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_cw_price","CW","cny/KT"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_ia_pa_price","IA&PA","cny/KM3"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_bfw_price","BFW","cny/Ton"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_eo_eg_purge_gas_price","EO/EG purge gas","cny/Km3"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("sub_con_h2_fule_price","H2 fr Syngas as fule","cny/km3"));
+        // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
+        for (int i = 0; i < tMonthlyProductionPrices.size(); i++) {
+            TMonthlyProductionPrice tMonthlyProductionPrice = tMonthlyProductionPrices.get(i);
+            String subConElectricPrice = tMonthlyProductionPrice.getSubConElectricPrice();
+            String subConNgPrice = tMonthlyProductionPrice.getSubConNgPrice();
+            String subConFgFrEuPrice = tMonthlyProductionPrice.getSubConFgFrEuPrice();
+            String subConLpgPrice = tMonthlyProductionPrice.getSubConLpgPrice();
+            String subConHhpSteamPrice = tMonthlyProductionPrice.getSubConHhpSteamPrice();
+            String subConPCondensatePrice = tMonthlyProductionPrice.getSubConPCondensatePrice();
+            String subConCwPrice = tMonthlyProductionPrice.getSubConCwPrice();
+            String subConIaPaPrice = tMonthlyProductionPrice.getSubConIaPaPrice();
+            String subConBfwPrice = tMonthlyProductionPrice.getSubConBfwPrice();
+            String subConEoEgPurgeGasPrice = tMonthlyProductionPrice.getSubConEoEgPurgeGasPrice();
+            String subConH2FulePrice = tMonthlyProductionPrice.getSubConH2FulePrice();
+            Long reportMonth = tMonthlyProductionPrice.getReportMonth();   // 当前元素的所属月份
+            Long reportYear = tMonthlyProductionPrice.getReportYear();     // 当前元素的所属年份
+            // 前端数据集合的class
+            Class clazz = null;
+            // 当前元素调用的set方法
+            Method method = null;
+            try {
+                clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
+                method = tMonthlyProductionReportService.getSetMethod(reportMonth, clazz);
+                // 按照当前元素的所属月份调取相应set方法
+                method.invoke(monthlyProductionReportVOs.get(0), subConElectricPrice);
+                method.invoke(monthlyProductionReportVOs.get(1), subConNgPrice);
+                method.invoke(monthlyProductionReportVOs.get(2), subConFgFrEuPrice);
+                method.invoke(monthlyProductionReportVOs.get(3), subConLpgPrice);
+                method.invoke(monthlyProductionReportVOs.get(4), subConHhpSteamPrice);
+                method.invoke(monthlyProductionReportVOs.get(5), subConPCondensatePrice);
+                method.invoke(monthlyProductionReportVOs.get(6), subConCwPrice);
+                method.invoke(monthlyProductionReportVOs.get(7), subConIaPaPrice);
+                method.invoke(monthlyProductionReportVOs.get(8), subConBfwPrice);
+                method.invoke(monthlyProductionReportVOs.get(9), subConEoEgPurgeGasPrice);
+                method.invoke(monthlyProductionReportVOs.get(10), subConH2FulePrice);
+                // 当前年份=所属年份,当前月份=所属月份
+                if (currentMonth.equals(reportMonth) && currentYear.equals(reportYear)) {
+                    monthlyProductionReportVOs.get(0).setCurrently(subConElectricPrice);
+                    monthlyProductionReportVOs.get(1).setCurrently(subConNgPrice);
+                    monthlyProductionReportVOs.get(2).setCurrently(subConFgFrEuPrice);
+                    monthlyProductionReportVOs.get(3).setCurrently(subConLpgPrice);
+                    monthlyProductionReportVOs.get(4).setCurrently(subConHhpSteamPrice);
+                    monthlyProductionReportVOs.get(5).setCurrently(subConPCondensatePrice);
+                    monthlyProductionReportVOs.get(6).setCurrently(subConCwPrice);
+                    monthlyProductionReportVOs.get(7).setCurrently(subConIaPaPrice);
+                    monthlyProductionReportVOs.get(8).setCurrently(subConBfwPrice);
+                    monthlyProductionReportVOs.get(9).setCurrently(subConEoEgPurgeGasPrice);
+                    monthlyProductionReportVOs.get(10).setCurrently(subConH2FulePrice);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        tMonthlyProductionReportService.calcAvg(monthlyProductionReportVOs);
+        return monthlyProductionReportVOs;
+    }
+
+    @Override
+    public int updatePriceList(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++) {
+                TMonthlyProductionPrice price = new TMonthlyProductionPrice();
+                price.setReportMonth((long)(i + 1));
+                price.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_electric_price".equals(tableDatum.getDictLabel())) {price.setSubConElectricPrice(monthValue);}
+                if ("sub_con_ng_price".equals(tableDatum.getDictLabel())) {price.setSubConNgPrice(monthValue);}
+                if ("sub_con_fg_fr_eu_price".equals(tableDatum.getDictLabel())) {price.setSubConFgFrEuPrice(monthValue);}
+                if ("sub_con_lpg_price".equals(tableDatum.getDictLabel())) {price.setSubConLpgPrice(monthValue);}
+                if ("sub_con_hhp_steam_price".equals(tableDatum.getDictLabel())) {price.setSubConHhpSteamPrice(monthValue);}
+                if ("sub_con_p_condensate_price".equals(tableDatum.getDictLabel())) {price.setSubConPCondensatePrice(monthValue);}
+                if ("sub_con_cw_price".equals(tableDatum.getDictLabel())) {price.setSubConCwPrice(monthValue);}
+                if ("sub_con_ia_pa_price".equals(tableDatum.getDictLabel())) {price.setSubConIaPaPrice(monthValue);}
+                if ("sub_con_bfw_price".equals(tableDatum.getDictLabel())) {price.setSubConBfwPrice(monthValue);}
+                if ("sub_con_eo_eg_purge_gas_price".equals(tableDatum.getDictLabel())) {price.setSubConEoEgPurgeGasPrice(monthValue);}
+                if ("sub_con_h2_fule_price".equals(tableDatum.getDictLabel())) {price.setSubConH2FulePrice(monthValue);}
+                // 当前报告年份
+                int reportYear = Integer.parseInt(price.getReportYear().toString());
+                // 当前报告月份
+                int reportMonth = Integer.parseInt(price.getReportMonth().toString());
+                // 查询年份=reportYear,月份=reportMonth的单价数据
+                int count = tMonthlyProductionPriceMapper.selectTMonthlyProductionPriceCountByDate(reportYear, reportMonth);
+                if (count == 0) {   // 新增月报数据
+                    affectedRows += tMonthlyProductionPriceMapper.insertTMonthlyProductionPrice(price);
+                } else {    // 更新月报数据
+                    affectedRows += tMonthlyProductionPriceMapper.updateTMonthlyProductionPrice(price);
+                }
+            }
+        }
+        return affectedRows;
+    }
+}

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

@@ -108,7 +108,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
      *
      * @param monthlyProductionReportVOs 前端月报数据集合
      */
-    private void calcAvg(List<MonthlyProductionReportVO> monthlyProductionReportVOs) {
+    protected void calcAvg(List<MonthlyProductionReportVO> monthlyProductionReportVOs) {
         for (int i = 0; i < monthlyProductionReportVOs.size(); i++) {
             MonthlyProductionReportVO monthlyProductionReportVO = monthlyProductionReportVOs.get(i);
             BigDecimal total = new BigDecimal("0");
@@ -264,7 +264,7 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
      * @param clazz VO的类型
      * @return 相应的set方法
      */
-    private Method getSetMethod(Long reportMonth, Class clazz) {
+    protected Method getSetMethod(Long reportMonth, Class clazz) {
         Method method = null;
         try {
             switch (reportMonth.toString()) {

+ 151 - 0
master/src/main/resources/mybatis/production/TMonthlyProductionPriceMapper.xml

@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.production.mapper.TMonthlyProductionPriceMapper">
+    
+    <resultMap type="TMonthlyProductionPrice" id="TMonthlyProductionPriceResult">
+        <result property="id"                       column="id"    />
+        <result property="reportMonth"              column="report_month"    />
+        <result property="reportYear"               column="report_year"    />
+        <result property="subConElectricPrice"      column="sub_con_electric_price"    />
+        <result property="subConNgPrice"            column="sub_con_ng_price"    />
+        <result property="subConFgFrEuPrice"        column="sub_con_fg_fr_eu_price"    />
+        <result property="subConLpgPrice"           column="sub_con_lpg_price"    />
+        <result property="subConHhpSteamPrice"      column="sub_con_hhp_steam_price"    />
+        <result property="subConPCondensatePrice"   column="sub_con_p_condensate_price"    />
+        <result property="subConCwPrice"            column="sub_con_cw_price"    />
+        <result property="subConIaPaPrice"          column="sub_con_ia_pa_price"    />
+        <result property="subConBfwPrice"           column="sub_con_bfw_price"    />
+        <result property="subConEoEgPurgeGasPrice"  column="sub_con_eo_eg_purge_gas_price"    />
+        <result property="subConH2FulePrice"        column="sub_con_h2_fule_price"    />
+    </resultMap>
+
+    <sql id="selectTMonthlyProductionPriceVo">
+        select d.id, d.report_month, d.report_year, d.sub_con_electric_price, d.sub_con_ng_price, d.sub_con_fg_fr_eu_price, d.sub_con_lpg_price, d.sub_con_hhp_steam_price, d.sub_con_p_condensate_price, d.sub_con_cw_price, d.sub_con_ia_pa_price, d.sub_con_bfw_price, d.sub_con_eo_eg_purge_gas_price, d.sub_con_h2_fule_price ,s.dept_name from t_monthly_production_price d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTMonthlyProductionPriceCountByDate" parameterType="int" resultType="int">
+        select count(id)
+        from t_monthly_production_price d
+        where d.report_month = #{reportMonth} and d.report_year = #{reportYear}
+    </select>
+
+    <select id="selectPriceByYear" parameterType="Long" resultMap="TMonthlyProductionPriceResult">
+        select
+               d.id, d.report_month, d.report_year,
+               d.sub_con_electric_price,
+               d.sub_con_ng_price,
+               d.sub_con_fg_fr_eu_price,
+               d.sub_con_lpg_price,
+               d.sub_con_hhp_steam_price,
+               d.sub_con_p_condensate_price,
+               d.sub_con_cw_price,
+               d.sub_con_ia_pa_price,
+               d.sub_con_bfw_price,
+               d.sub_con_eo_eg_purge_gas_price,
+               d.sub_con_h2_fule_price
+        from
+             t_monthly_production_price d
+        where d.report_year = #{year}
+    </select>
+
+    <select id="selectTMonthlyProductionPriceList" parameterType="TMonthlyProductionPrice" resultMap="TMonthlyProductionPriceResult">
+        <include refid="selectTMonthlyProductionPriceVo"/>
+        <where>  
+            <if test="reportMonth != null "> and report_month = #{reportMonth}</if>
+            <if test="reportYear != null "> and report_year = #{reportYear}</if>
+            <if test="subConElectricPrice != null  and subConElectricPrice != ''"> and sub_con_electric_price = #{subConElectricPrice}</if>
+            <if test="subConNgPrice != null  and subConNgPrice != ''"> and sub_con_ng_price = #{subConNgPrice}</if>
+            <if test="subConFgFrEuPrice != null  and subConFgFrEuPrice != ''"> and sub_con_fg_fr_eu_price = #{subConFgFrEuPrice}</if>
+            <if test="subConLpgPrice != null  and subConLpgPrice != ''"> and sub_con_lpg_price = #{subConLpgPrice}</if>
+            <if test="subConHhpSteamPrice != null  and subConHhpSteamPrice != ''"> and sub_con_hhp_steam_price = #{subConHhpSteamPrice}</if>
+            <if test="subConPCondensatePrice != null  and subConPCondensatePrice != ''"> and sub_con_p_condensate_price = #{subConPCondensatePrice}</if>
+            <if test="subConCwPrice != null  and subConCwPrice != ''"> and sub_con_cw_price = #{subConCwPrice}</if>
+            <if test="subConIaPaPrice != null  and subConIaPaPrice != ''"> and sub_con_ia_pa_price = #{subConIaPaPrice}</if>
+            <if test="subConBfwPrice != null  and subConBfwPrice != ''"> and sub_con_bfw_price = #{subConBfwPrice}</if>
+            <if test="subConEoEgPurgeGasPrice != null  and subConEoEgPurgeGasPrice != ''"> and sub_con_eo_eg_purge_gas_price = #{subConEoEgPurgeGasPrice}</if>
+            <if test="subConH2FulePrice != null  and subConH2FulePrice != ''"> and sub_con_h2_fule_price = #{subConH2FulePrice}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTMonthlyProductionPriceById" parameterType="Long" resultMap="TMonthlyProductionPriceResult">
+        <include refid="selectTMonthlyProductionPriceVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTMonthlyProductionPrice" parameterType="TMonthlyProductionPrice">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_monthly_production_price.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_monthly_production_price
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="reportMonth != null">report_month,</if>
+            <if test="reportYear != null">report_year,</if>
+            <if test="subConElectricPrice != null">sub_con_electric_price,</if>
+            <if test="subConNgPrice != null">sub_con_ng_price,</if>
+            <if test="subConFgFrEuPrice != null">sub_con_fg_fr_eu_price,</if>
+            <if test="subConLpgPrice != null">sub_con_lpg_price,</if>
+            <if test="subConHhpSteamPrice != null">sub_con_hhp_steam_price,</if>
+            <if test="subConPCondensatePrice != null">sub_con_p_condensate_price,</if>
+            <if test="subConCwPrice != null">sub_con_cw_price,</if>
+            <if test="subConIaPaPrice != null">sub_con_ia_pa_price,</if>
+            <if test="subConBfwPrice != null">sub_con_bfw_price,</if>
+            <if test="subConEoEgPurgeGasPrice != null">sub_con_eo_eg_purge_gas_price,</if>
+            <if test="subConH2FulePrice != null">sub_con_h2_fule_price,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="reportMonth != null">#{reportMonth},</if>
+            <if test="reportYear != null">#{reportYear},</if>
+            <if test="subConElectricPrice != null">#{subConElectricPrice},</if>
+            <if test="subConNgPrice != null">#{subConNgPrice},</if>
+            <if test="subConFgFrEuPrice != null">#{subConFgFrEuPrice},</if>
+            <if test="subConLpgPrice != null">#{subConLpgPrice},</if>
+            <if test="subConHhpSteamPrice != null">#{subConHhpSteamPrice},</if>
+            <if test="subConPCondensatePrice != null">#{subConPCondensatePrice},</if>
+            <if test="subConCwPrice != null">#{subConCwPrice},</if>
+            <if test="subConIaPaPrice != null">#{subConIaPaPrice},</if>
+            <if test="subConBfwPrice != null">#{subConBfwPrice},</if>
+            <if test="subConEoEgPurgeGasPrice != null">#{subConEoEgPurgeGasPrice},</if>
+            <if test="subConH2FulePrice != null">#{subConH2FulePrice},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTMonthlyProductionPrice" parameterType="TMonthlyProductionPrice">
+        update t_monthly_production_price
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="reportMonth != null">report_month = #{reportMonth},</if>
+            <if test="reportYear != null">report_year = #{reportYear},</if>
+            <if test="subConElectricPrice != null">sub_con_electric_price = #{subConElectricPrice},</if>
+            <if test="subConNgPrice != null">sub_con_ng_price = #{subConNgPrice},</if>
+            <if test="subConFgFrEuPrice != null">sub_con_fg_fr_eu_price = #{subConFgFrEuPrice},</if>
+            <if test="subConLpgPrice != null">sub_con_lpg_price = #{subConLpgPrice},</if>
+            <if test="subConHhpSteamPrice != null">sub_con_hhp_steam_price = #{subConHhpSteamPrice},</if>
+            <if test="subConPCondensatePrice != null">sub_con_p_condensate_price = #{subConPCondensatePrice},</if>
+            <if test="subConCwPrice != null">sub_con_cw_price = #{subConCwPrice},</if>
+            <if test="subConIaPaPrice != null">sub_con_ia_pa_price = #{subConIaPaPrice},</if>
+            <if test="subConBfwPrice != null">sub_con_bfw_price = #{subConBfwPrice},</if>
+            <if test="subConEoEgPurgeGasPrice != null">sub_con_eo_eg_purge_gas_price = #{subConEoEgPurgeGasPrice},</if>
+            <if test="subConH2FulePrice != null">sub_con_h2_fule_price = #{subConH2FulePrice},</if>
+        </trim>
+        where report_month = #{reportMonth} and report_year = #{reportYear}
+    </update>
+
+    <update id="deleteTMonthlyProductionPriceById" parameterType="Long">
+        update t_monthly_production_price set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTMonthlyProductionPriceByIds" parameterType="String">
+        update t_monthly_production_price set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    
+</mapper>

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

@@ -72,7 +72,6 @@ export function updateAromaticsUtilityConsumption(data) {
   })
 }
 
-
 // 修改Cracker Utility Consumption
 export function updateCrackerUtilityConsumption(data) {
   return request({
@@ -82,7 +81,6 @@ export function updateCrackerUtilityConsumption(data) {
   })
 }
 
-
 // 修改Eligible Product Rate
 export function updateEligibleProductRate(data) {
   return request({

+ 70 - 0
ui/src/api/production/price.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 修改单价列表
+export function updatePriceList(data) {
+  return request({
+    url: '/production/price/updatePriceList',
+    method: 'put',
+    data: data
+  })
+}
+
+// 按年份查询单价
+export function getPriceByYear(year) {
+  return request({
+    url: '/production/price/getByYear/' + year,
+    method: 'get'
+  })
+}
+
+// 查询生产月报单价维护列表
+export function listPrice(query) {
+  return request({
+    url: '/production/price/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询生产月报单价维护详细
+export function getPrice(id) {
+  return request({
+    url: '/production/price/' + id,
+    method: 'get'
+  })
+}
+
+// 新增生产月报单价维护
+export function addPrice(data) {
+  return request({
+    url: '/production/price',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改生产月报单价维护
+export function updatePrice(data) {
+  return request({
+    url: '/production/price',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除生产月报单价维护
+export function delPrice(id) {
+  return request({
+    url: '/production/price/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出生产月报单价维护
+export function exportPrice(query) {
+  return request({
+    url: '/production/price/export',
+    method: 'get',
+    params: query
+  })
+}

+ 182 - 0
ui/src/views/production/monthly/index.vue

@@ -27,6 +27,7 @@
           icon="el-icon-download"
           size="mini"
           v-hasPermi="['production:monthly:edit']"
+          @click="handleQueryPrice()"
         >开工锅炉公用工程单价维护</el-button>
       </el-form-item>
     </el-form>
@@ -2753,6 +2754,137 @@
       </el-form>
       <div id="trendChart" style="width:1340px;height:600px;"></div>
     </el-dialog>
+    <!-- 开工锅炉公用工程单价维护对话框 -->
+    <el-dialog :title="priceMgmt.title" :visible.sync="priceMgmt.open" width="1400px" append-to-body>
+      <div style="margin-bottom: 10px;">
+        <el-button
+          :disabled="priceUpdating"
+          type="primary"
+          icon="el-icon-edit"
+          size="mini"
+          @click="handlePriceUpdate"
+          v-hasPermi="['production:price:edit']"
+        >{{ $t('编辑') }}</el-button>
+        <el-button
+          :disabled="!priceUpdating"
+          type="success"
+          icon="el-icon-check"
+          size="mini"
+          @click="handleConfirmPriceUpdate"
+          v-hasPermi="['production:price:edit']"
+        >{{ $t('保存') }}</el-button>
+        <el-button
+          :disabled="!priceUpdating"
+          type="info"
+          icon="el-icon-close"
+          size="mini"
+          @click="handleCancelPriceUpdate"
+          v-hasPermi="['production:price:edit']"
+        >{{ $t('取消') }}</el-button>
+      </div>
+      <el-table border :data="tablePrice" style="width: 100%; margin-bottom: 20px;">
+        <el-table-column width="150" prop="title" label=""></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]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.jan}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.jan" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="feb" :label="this.monthList[1]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.feb}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.feb" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="mar" :label="this.monthList[2]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.mar}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.mar" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="apr" :label="this.monthList[3]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.apr}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.apr" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="may" :label="this.monthList[4]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.may}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.may" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jun" :label="this.monthList[5]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.jun}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.jun" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jul" :label="this.monthList[6]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.jul}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.jul" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="aug" :label="this.monthList[7]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.aug}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.aug" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sep" :label="this.monthList[8]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.sep}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.sep" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="oct" :label="this.monthList[9]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.oct}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.oct" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="nov" :label="this.monthList[10]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.nov}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.nov" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="dec" :label="this.monthList[11]">
+          <template slot-scope="{row}">
+            <div v-if="!priceUpdating">{{row.dec}}</div>
+            <div v-if="priceUpdating">
+              <el-input v-model="row.dec" clearable></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="avg" label="avg"></el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 
@@ -2791,12 +2923,17 @@ import {
   updateSctfUtilityConsumption,
   updateKbi
 } from "@/api/production/monthly";
+import {
+  getPriceByYear,
+  updatePriceList
+} from "@/api/production/price";
 
 export default {
   name: "Monthly",
   data() {
     return {
       // 修改中
+      priceUpdating: false,
       subUtilityConsumptionUpdating: false,
       sctfUtilityConsumptionUpdating: false,
       kbiUpdating: false,
@@ -2824,6 +2961,13 @@ export default {
         // 弹出层标题
         title: "",
       },
+      // 价格管理参数
+      priceMgmt: {
+        // 是否显示弹出层
+        open: false,
+        // 弹出层标题
+        title: "",
+      },
       // 趋势图查询参数
       analysisQueryParams: {
         // 指标
@@ -2869,6 +3013,7 @@ export default {
       tableSCTFUtilityConsumption: [],
       tableKBI: [],
       tableSummary: [],
+      tablePrice: []
     }
   },
   created() {
@@ -2878,7 +3023,19 @@ export default {
     this.getMonthlyReport();
   },
   methods: {
+    /** 点击开工锅炉公用工程单价维护事件处理 */
+    handleQueryPrice() {
+      let year = this.year.getFullYear();
+      this.priceMgmt.title = year + "年开工锅炉公用工程单价维护";
+      this.priceMgmt.open = true;
+      getPriceByYear(year).then(response => {
+        this.tablePrice = response.data;
+      });
+    },
     /** 编辑按钮操作 */
+    handlePriceUpdate(row) {
+      this.priceUpdating = true;
+    },
     handleSubUtilityConsumptionUpdate(row) {
       this.subUtilityConsumptionUpdating = true;
     },
@@ -2932,6 +3089,25 @@ export default {
       }
     },
     /** 确定修改按钮操作 */
+    handleConfirmPriceUpdate(row) {
+      if (this.isNumberInput() == false) {
+        return false;
+      }
+      this.priceUpdating = false;
+      updatePriceList({
+        tableData: this.tablePrice,
+        year: this.year.getFullYear()
+      }).then(response => {
+        if (response.code == 200) {
+          this.$message.success("修改成功");
+        } else {
+          this.$message.error("未知错误,请联系管理员。");
+        }
+        getPriceByYear(year).then(response => {
+          this.tablePrice = response.data;
+        });
+      });
+    },
     handleConfirmSubUtilityConsumptionUpdate(row) {
       if (this.isNumberInput() == false) {
         return false;
@@ -3179,6 +3355,12 @@ export default {
       });
     },
     /** 取消修改按钮操作 */
+    handleCancelPriceUpdate(row) {
+      this.priceUpdating = false;
+      getPriceByYear(year).then(response => {
+        this.tablePrice = response.data;
+      });
+    },
     handleCancelSUBUtilityConsumptionUpdate(row) {
       this.subUtilityConsumptionUpdating = false;
       getSUBUtilityConsumption(year).then(response => {