Quellcode durchsuchen

王子文 生产月报

wangggziwen vor 2 Jahren
Ursprung
Commit
5e1dcfbea8

+ 1 - 1
master/src/main/java/com/ruoyi/project/production/controller/TDailyProductionReportController.java

@@ -42,7 +42,7 @@ public class TDailyProductionReportController extends BaseController
     private ITDailyProductionReportService tDailyProductionReportService;
 
     /**
-     * 查询每日生产报告列表
+     * 查询每日生产报告趋势数据
      */
     @PreAuthorize("@ss.hasPermi('production:report:list')")
     @GetMapping("/getAnalysisData")

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

@@ -0,0 +1,103 @@
+package com.ruoyi.project.production.controller;
+
+import java.util.List;
+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.TMonthlyProductionReport;
+import com.ruoyi.project.production.service.ITMonthlyProductionReportService;
+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-10-31
+ */
+@RestController
+@RequestMapping("/production/monthly")
+public class TMonthlyProductionReportController extends BaseController
+{
+    @Autowired
+    private ITMonthlyProductionReportService tMonthlyProductionReportService;
+
+    /**
+     * 查询每月生产报告列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TMonthlyProductionReport tMonthlyProductionReport)
+    {
+        startPage();
+        List<TMonthlyProductionReport> list = tMonthlyProductionReportService.selectTMonthlyProductionReportList(tMonthlyProductionReport);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出每月生产报告列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:export')")
+    @Log(title = "每月生产报告", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TMonthlyProductionReport tMonthlyProductionReport)
+    {
+        List<TMonthlyProductionReport> list = tMonthlyProductionReportService.selectTMonthlyProductionReportList(tMonthlyProductionReport);
+        ExcelUtil<TMonthlyProductionReport> util = new ExcelUtil<TMonthlyProductionReport>(TMonthlyProductionReport.class);
+        return util.exportExcel(list, "monthly");
+    }
+
+    /**
+     * 获取每月生产报告详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tMonthlyProductionReportService.selectTMonthlyProductionReportById(id));
+    }
+
+    /**
+     * 新增每月生产报告
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:add')")
+    @Log(title = "每月生产报告", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TMonthlyProductionReport tMonthlyProductionReport)
+    {
+        return toAjax(tMonthlyProductionReportService.insertTMonthlyProductionReport(tMonthlyProductionReport));
+    }
+
+    /**
+     * 修改每月生产报告
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:edit')")
+    @Log(title = "每月生产报告", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TMonthlyProductionReport tMonthlyProductionReport)
+    {
+        return toAjax(tMonthlyProductionReportService.updateTMonthlyProductionReport(tMonthlyProductionReport));
+    }
+
+    /**
+     * 删除每月生产报告
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:remove')")
+    @Log(title = "每月生产报告", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tMonthlyProductionReportService.deleteTMonthlyProductionReportByIds(ids));
+    }
+}

+ 303 - 0
master/src/main/java/com/ruoyi/project/production/domain/TMonthlyProductionReport.java

@@ -0,0 +1,303 @@
+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_report
+ *
+ * @author ruoyi
+ * @date 2022-10-31
+ */
+public class TMonthlyProductionReport extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键id */
+    private Long id;
+
+    /** 所属月份 */
+    @Excel(name = "所属月份")
+    private Long reportMonth;
+
+    /** 所属年份 */
+    @Excel(name = "所属年份")
+    private Long reportYear;
+
+    /** Cracker Raw Material NAP */
+    @Excel(name = "Cracker Raw Material NAP")
+    private String nap;
+
+    /** Cracker Raw Material C5 */
+    @Excel(name = "Cracker Raw Material C5")
+    private String c5;
+
+    /** Cracker Raw Material NA */
+    @Excel(name = "Cracker Raw Material NA")
+    private String c6C8Na;
+
+    /** Cracker Raw Material Wison Ethane */
+    @Excel(name = "Cracker Raw Material Wison Ethane")
+    private String wisonEthane;
+
+    /** Cracker Raw Material LPG to Furnace */
+    @Excel(name = "Cracker Raw Material LPG to Furnace")
+    private String lpgToFurnace;
+
+    /** Cracker Raw Material C4 Raff3  fr bd and 2ph */
+    @Excel(name = "Cracker Raw Material C4 Raff3  fr bd and 2ph")
+    private String raff3FrBd;
+
+    /** Cracker Raw Material C2 fr LDPE */
+    @Excel(name = "Cracker Raw Material C2 fr LDPE")
+    private String raffinate2pFr2ph;
+
+    /** Cracker Raw Material C3 fr OXO */
+    @Excel(name = "Cracker Raw Material C3 fr OXO")
+    private String c2FrLdpe;
+
+    /** Cracker Raw Material Mixed C3/C4 fr BD */
+    @Excel(name = "Cracker Raw Material Mixed C3/C4 fr BD")
+    private String c3FrOxo;
+
+    /** Cracker Raw Material HC9 */
+    @Excel(name = "Cracker Raw Material HC9")
+    private String mixedC3C4;
+
+    /** Cracker Raw Material Offgas fr AEU */
+    @Excel(name = "Cracker Raw Material Offgas fr AEU")
+    private String hyC9;
+
+    /** Cracker Raw Material wash oil */
+    @Excel(name = "Cracker Raw Material wash oil")
+    private String pguOffgas;
+
+    /** Cracker Raw Material toluene */
+    @Excel(name = "Cracker Raw Material toluene")
+    private String washOil;
+
+    /** Cracker Raw Material C4 Recycle(ton) */
+    @Excel(name = "Cracker Raw Material C4 Recycle(ton)")
+    private String toluene;
+
+    /** Cracker Raw Material input total */
+    @Excel(name = "Cracker Raw Material input total")
+    private String hyC4FrR800;
+
+    /** Cracker Raw Material Total feed */
+    @Excel(name = "Cracker Raw Material Total feed")
+    private String crackerRawInput;
+
+    /** Cracker Raw Material */
+    @Excel(name = "Cracker Raw Material")
+    private String crackerRawFeed;
+
+    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 setNap(String nap)
+    {
+        this.nap = nap;
+    }
+
+    public String getNap()
+    {
+        return nap;
+    }
+    public void setC5(String c5)
+    {
+        this.c5 = c5;
+    }
+
+    public String getC5()
+    {
+        return c5;
+    }
+    public void setC6C8Na(String c6C8Na)
+    {
+        this.c6C8Na = c6C8Na;
+    }
+
+    public String getC6C8Na()
+    {
+        return c6C8Na;
+    }
+    public void setWisonEthane(String wisonEthane)
+    {
+        this.wisonEthane = wisonEthane;
+    }
+
+    public String getWisonEthane()
+    {
+        return wisonEthane;
+    }
+    public void setLpgToFurnace(String lpgToFurnace)
+    {
+        this.lpgToFurnace = lpgToFurnace;
+    }
+
+    public String getLpgToFurnace()
+    {
+        return lpgToFurnace;
+    }
+    public void setRaff3FrBd(String raff3FrBd)
+    {
+        this.raff3FrBd = raff3FrBd;
+    }
+
+    public String getRaff3FrBd()
+    {
+        return raff3FrBd;
+    }
+    public void setRaffinate2pFr2ph(String raffinate2pFr2ph)
+    {
+        this.raffinate2pFr2ph = raffinate2pFr2ph;
+    }
+
+    public String getRaffinate2pFr2ph()
+    {
+        return raffinate2pFr2ph;
+    }
+    public void setC2FrLdpe(String c2FrLdpe)
+    {
+        this.c2FrLdpe = c2FrLdpe;
+    }
+
+    public String getC2FrLdpe()
+    {
+        return c2FrLdpe;
+    }
+    public void setC3FrOxo(String c3FrOxo)
+    {
+        this.c3FrOxo = c3FrOxo;
+    }
+
+    public String getC3FrOxo()
+    {
+        return c3FrOxo;
+    }
+    public void setMixedC3C4(String mixedC3C4)
+    {
+        this.mixedC3C4 = mixedC3C4;
+    }
+
+    public String getMixedC3C4()
+    {
+        return mixedC3C4;
+    }
+    public void setHyC9(String hyC9)
+    {
+        this.hyC9 = hyC9;
+    }
+
+    public String getHyC9()
+    {
+        return hyC9;
+    }
+    public void setPguOffgas(String pguOffgas)
+    {
+        this.pguOffgas = pguOffgas;
+    }
+
+    public String getPguOffgas()
+    {
+        return pguOffgas;
+    }
+    public void setWashOil(String washOil)
+    {
+        this.washOil = washOil;
+    }
+
+    public String getWashOil()
+    {
+        return washOil;
+    }
+    public void setToluene(String toluene)
+    {
+        this.toluene = toluene;
+    }
+
+    public String getToluene()
+    {
+        return toluene;
+    }
+    public void setHyC4FrR800(String hyC4FrR800)
+    {
+        this.hyC4FrR800 = hyC4FrR800;
+    }
+
+    public String getHyC4FrR800()
+    {
+        return hyC4FrR800;
+    }
+    public void setCrackerRawInput(String crackerRawInput)
+    {
+        this.crackerRawInput = crackerRawInput;
+    }
+
+    public String getCrackerRawInput()
+    {
+        return crackerRawInput;
+    }
+    public void setCrackerRawFeed(String crackerRawFeed)
+    {
+        this.crackerRawFeed = crackerRawFeed;
+    }
+
+    public String getCrackerRawFeed()
+    {
+        return crackerRawFeed;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("reportMonth", getReportMonth())
+            .append("reportYear", getReportYear())
+            .append("nap", getNap())
+            .append("c5", getC5())
+            .append("c6C8Na", getC6C8Na())
+            .append("wisonEthane", getWisonEthane())
+            .append("lpgToFurnace", getLpgToFurnace())
+            .append("raff3FrBd", getRaff3FrBd())
+            .append("raffinate2pFr2ph", getRaffinate2pFr2ph())
+            .append("c2FrLdpe", getC2FrLdpe())
+            .append("c3FrOxo", getC3FrOxo())
+            .append("mixedC3C4", getMixedC3C4())
+            .append("hyC9", getHyC9())
+            .append("pguOffgas", getPguOffgas())
+            .append("washOil", getWashOil())
+            .append("toluene", getToluene())
+            .append("hyC4FrR800", getHyC4FrR800())
+            .append("crackerRawInput", getCrackerRawInput())
+            .append("crackerRawFeed", getCrackerRawFeed())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TMonthlyProductionReportMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TMonthlyProductionReport;
+
+/**
+ * 每月生产报告Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-10-31
+ */
+public interface TMonthlyProductionReportMapper 
+{
+    /**
+     * 查询每月生产报告
+     * 
+     * @param id 每月生产报告ID
+     * @return 每月生产报告
+     */
+    public TMonthlyProductionReport selectTMonthlyProductionReportById(Long id);
+
+    /**
+     * 查询每月生产报告列表
+     * 
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 每月生产报告集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TMonthlyProductionReport> selectTMonthlyProductionReportList(TMonthlyProductionReport tMonthlyProductionReport);
+
+    /**
+     * 新增每月生产报告
+     * 
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 结果
+     */
+    public int insertTMonthlyProductionReport(TMonthlyProductionReport tMonthlyProductionReport);
+
+    /**
+     * 修改每月生产报告
+     * 
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 结果
+     */
+    public int updateTMonthlyProductionReport(TMonthlyProductionReport tMonthlyProductionReport);
+
+    /**
+     * 删除每月生产报告
+     * 
+     * @param id 每月生产报告ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionReportById(Long id);
+
+    /**
+     * 批量删除每月生产报告
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionReportByIds(Long[] ids);
+}

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

@@ -0,0 +1,61 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TMonthlyProductionReport;
+
+/**
+ * 每月生产报告Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-10-31
+ */
+public interface ITMonthlyProductionReportService 
+{
+    /**
+     * 查询每月生产报告
+     * 
+     * @param id 每月生产报告ID
+     * @return 每月生产报告
+     */
+    public TMonthlyProductionReport selectTMonthlyProductionReportById(Long id);
+
+    /**
+     * 查询每月生产报告列表
+     * 
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 每月生产报告集合
+     */
+    public List<TMonthlyProductionReport> selectTMonthlyProductionReportList(TMonthlyProductionReport tMonthlyProductionReport);
+
+    /**
+     * 新增每月生产报告
+     * 
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 结果
+     */
+    public int insertTMonthlyProductionReport(TMonthlyProductionReport tMonthlyProductionReport);
+
+    /**
+     * 修改每月生产报告
+     * 
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 结果
+     */
+    public int updateTMonthlyProductionReport(TMonthlyProductionReport tMonthlyProductionReport);
+
+    /**
+     * 批量删除每月生产报告
+     * 
+     * @param ids 需要删除的每月生产报告ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionReportByIds(Long[] ids);
+
+    /**
+     * 删除每月生产报告信息
+     * 
+     * @param id 每月生产报告ID
+     * @return 结果
+     */
+    public int deleteTMonthlyProductionReportById(Long id);
+}

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

@@ -0,0 +1,93 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
+import com.ruoyi.project.production.domain.TMonthlyProductionReport;
+import com.ruoyi.project.production.service.ITMonthlyProductionReportService;
+
+/**
+ * 每月生产报告Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-10-31
+ */
+@Service
+public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionReportService
+{
+    @Autowired
+    private TMonthlyProductionReportMapper tMonthlyProductionReportMapper;
+
+    /**
+     * 查询每月生产报告
+     *
+     * @param id 每月生产报告ID
+     * @return 每月生产报告
+     */
+    @Override
+    public TMonthlyProductionReport selectTMonthlyProductionReportById(Long id)
+    {
+        return tMonthlyProductionReportMapper.selectTMonthlyProductionReportById(id);
+    }
+
+    /**
+     * 查询每月生产报告列表
+     *
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 每月生产报告
+     */
+    @Override
+    public List<TMonthlyProductionReport> selectTMonthlyProductionReportList(TMonthlyProductionReport tMonthlyProductionReport)
+    {
+        return tMonthlyProductionReportMapper.selectTMonthlyProductionReportList(tMonthlyProductionReport);
+    }
+
+    /**
+     * 新增每月生产报告
+     *
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 结果
+     */
+    @Override
+    public int insertTMonthlyProductionReport(TMonthlyProductionReport tMonthlyProductionReport)
+    {
+        return tMonthlyProductionReportMapper.insertTMonthlyProductionReport(tMonthlyProductionReport);
+    }
+
+    /**
+     * 修改每月生产报告
+     *
+     * @param tMonthlyProductionReport 每月生产报告
+     * @return 结果
+     */
+    @Override
+    public int updateTMonthlyProductionReport(TMonthlyProductionReport tMonthlyProductionReport)
+    {
+        return tMonthlyProductionReportMapper.updateTMonthlyProductionReport(tMonthlyProductionReport);
+    }
+
+    /**
+     * 批量删除每月生产报告
+     *
+     * @param ids 需要删除的每月生产报告ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonthlyProductionReportByIds(Long[] ids)
+    {
+        return tMonthlyProductionReportMapper.deleteTMonthlyProductionReportByIds(ids);
+    }
+
+    /**
+     * 删除每月生产报告信息
+     *
+     * @param id 每月生产报告ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonthlyProductionReportById(Long id)
+    {
+        return tMonthlyProductionReportMapper.deleteTMonthlyProductionReportById(id);
+    }
+}

+ 1 - 1
master/src/main/resources/application.yml

@@ -188,7 +188,7 @@ gen:
   # 作者
   author: ruoyi
   # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
-  packageName: com.ruoyi.project.invoice # 自动去除表前缀,默认是true
+  packageName: com.ruoyi.project.production # 自动去除表前缀,默认是true
   autoRemovePre: false
   # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
   tablePrefix: sys_

+ 154 - 0
master/src/main/resources/mybatis/production/TMonthlyProductionReportMapper.xml

@@ -0,0 +1,154 @@
+<?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.TMonthlyProductionReportMapper">
+    
+    <resultMap type="TMonthlyProductionReport" id="TMonthlyProductionReportResult">
+        <result property="id"    column="id"    />
+        <result property="reportMonth"    column="report_month"    />
+        <result property="reportYear"    column="report_year"    />
+        <result property="nap"    column="nap"    />
+        <result property="c5"    column="c5"    />
+        <result property="c6C8Na"    column="c6_c8_na"    />
+        <result property="wisonEthane"    column="wison_ethane"    />
+        <result property="lpgToFurnace"    column="lpg_to_furnace"    />
+        <result property="raff3FrBd"    column="raff3_fr_bd"    />
+        <result property="raffinate2pFr2ph"    column="raffinate2p_fr_2ph"    />
+        <result property="c2FrLdpe"    column="c2_fr_ldpe"    />
+        <result property="c3FrOxo"    column="c3_fr_oxo"    />
+        <result property="mixedC3C4"    column="mixed_c3_c4"    />
+        <result property="hyC9"    column="hy_c9"    />
+        <result property="pguOffgas"    column="pgu_offgas"    />
+        <result property="washOil"    column="wash_oil"    />
+        <result property="toluene"    column="toluene"    />
+        <result property="hyC4FrR800"    column="hy_c4_fr_r800"    />
+        <result property="crackerRawInput"    column="cracker_raw_input"    />
+        <result property="crackerRawFeed"    column="cracker_raw_feed"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTMonthlyProductionReportVo">
+        select d.id, d.report_month, d.report_year, d.nap, d.c5, d.c6_c8_na, d.wison_ethane, d.lpg_to_furnace, d.raff3_fr_bd, d.raffinate2p_fr_2ph, d.c2_fr_ldpe, d.c3_fr_oxo, d.mixed_c3_c4, d.hy_c9, d.pgu_offgas, d.wash_oil, d.toluene, d.hy_c4_fr_r800, d.cracker_raw_input, d.cracker_raw_feed ,s.dept_name from t_monthly_production_report d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTMonthlyProductionReportList" parameterType="TMonthlyProductionReport" resultMap="TMonthlyProductionReportResult">
+        <include refid="selectTMonthlyProductionReportVo"/>
+        <where>  
+            <if test="reportMonth != null "> and report_month = #{reportMonth}</if>
+            <if test="reportYear != null "> and report_year = #{reportYear}</if>
+            <if test="nap != null  and nap != ''"> and nap = #{nap}</if>
+            <if test="c5 != null  and c5 != ''"> and c5 = #{c5}</if>
+            <if test="c6C8Na != null  and c6C8Na != ''"> and c6_c8_na = #{c6C8Na}</if>
+            <if test="wisonEthane != null  and wisonEthane != ''"> and wison_ethane = #{wisonEthane}</if>
+            <if test="lpgToFurnace != null  and lpgToFurnace != ''"> and lpg_to_furnace = #{lpgToFurnace}</if>
+            <if test="raff3FrBd != null  and raff3FrBd != ''"> and raff3_fr_bd = #{raff3FrBd}</if>
+            <if test="raffinate2pFr2ph != null  and raffinate2pFr2ph != ''"> and raffinate2p_fr_2ph = #{raffinate2pFr2ph}</if>
+            <if test="c2FrLdpe != null  and c2FrLdpe != ''"> and c2_fr_ldpe = #{c2FrLdpe}</if>
+            <if test="c3FrOxo != null  and c3FrOxo != ''"> and c3_fr_oxo = #{c3FrOxo}</if>
+            <if test="mixedC3C4 != null  and mixedC3C4 != ''"> and mixed_c3_c4 = #{mixedC3C4}</if>
+            <if test="hyC9 != null  and hyC9 != ''"> and hy_c9 = #{hyC9}</if>
+            <if test="pguOffgas != null  and pguOffgas != ''"> and pgu_offgas = #{pguOffgas}</if>
+            <if test="washOil != null  and washOil != ''"> and wash_oil = #{washOil}</if>
+            <if test="toluene != null  and toluene != ''"> and toluene = #{toluene}</if>
+            <if test="hyC4FrR800 != null  and hyC4FrR800 != ''"> and hy_c4_fr_r800 = #{hyC4FrR800}</if>
+            <if test="crackerRawInput != null  and crackerRawInput != ''"> and cracker_raw_input = #{crackerRawInput}</if>
+            <if test="crackerRawFeed != null  and crackerRawFeed != ''"> and cracker_raw_feed = #{crackerRawFeed}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTMonthlyProductionReportById" parameterType="Long" resultMap="TMonthlyProductionReportResult">
+        <include refid="selectTMonthlyProductionReportVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTMonthlyProductionReport" parameterType="TMonthlyProductionReport">
+        insert into t_monthly_production_report
+        <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="nap != null">nap,</if>
+            <if test="c5 != null">c5,</if>
+            <if test="c6C8Na != null">c6_c8_na,</if>
+            <if test="wisonEthane != null">wison_ethane,</if>
+            <if test="lpgToFurnace != null">lpg_to_furnace,</if>
+            <if test="raff3FrBd != null">raff3_fr_bd,</if>
+            <if test="raffinate2pFr2ph != null">raffinate2p_fr_2ph,</if>
+            <if test="c2FrLdpe != null">c2_fr_ldpe,</if>
+            <if test="c3FrOxo != null">c3_fr_oxo,</if>
+            <if test="mixedC3C4 != null">mixed_c3_c4,</if>
+            <if test="hyC9 != null">hy_c9,</if>
+            <if test="pguOffgas != null">pgu_offgas,</if>
+            <if test="washOil != null">wash_oil,</if>
+            <if test="toluene != null">toluene,</if>
+            <if test="hyC4FrR800 != null">hy_c4_fr_r800,</if>
+            <if test="crackerRawInput != null">cracker_raw_input,</if>
+            <if test="crackerRawFeed != null">cracker_raw_feed,</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="nap != null">#{nap},</if>
+            <if test="c5 != null">#{c5},</if>
+            <if test="c6C8Na != null">#{c6C8Na},</if>
+            <if test="wisonEthane != null">#{wisonEthane},</if>
+            <if test="lpgToFurnace != null">#{lpgToFurnace},</if>
+            <if test="raff3FrBd != null">#{raff3FrBd},</if>
+            <if test="raffinate2pFr2ph != null">#{raffinate2pFr2ph},</if>
+            <if test="c2FrLdpe != null">#{c2FrLdpe},</if>
+            <if test="c3FrOxo != null">#{c3FrOxo},</if>
+            <if test="mixedC3C4 != null">#{mixedC3C4},</if>
+            <if test="hyC9 != null">#{hyC9},</if>
+            <if test="pguOffgas != null">#{pguOffgas},</if>
+            <if test="washOil != null">#{washOil},</if>
+            <if test="toluene != null">#{toluene},</if>
+            <if test="hyC4FrR800 != null">#{hyC4FrR800},</if>
+            <if test="crackerRawInput != null">#{crackerRawInput},</if>
+            <if test="crackerRawFeed != null">#{crackerRawFeed},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTMonthlyProductionReport" parameterType="TMonthlyProductionReport">
+        update t_monthly_production_report
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="reportMonth != null">report_month = #{reportMonth},</if>
+            <if test="reportYear != null">report_year = #{reportYear},</if>
+            <if test="nap != null">nap = #{nap},</if>
+            <if test="c5 != null">c5 = #{c5},</if>
+            <if test="c6C8Na != null">c6_c8_na = #{c6C8Na},</if>
+            <if test="wisonEthane != null">wison_ethane = #{wisonEthane},</if>
+            <if test="lpgToFurnace != null">lpg_to_furnace = #{lpgToFurnace},</if>
+            <if test="raff3FrBd != null">raff3_fr_bd = #{raff3FrBd},</if>
+            <if test="raffinate2pFr2ph != null">raffinate2p_fr_2ph = #{raffinate2pFr2ph},</if>
+            <if test="c2FrLdpe != null">c2_fr_ldpe = #{c2FrLdpe},</if>
+            <if test="c3FrOxo != null">c3_fr_oxo = #{c3FrOxo},</if>
+            <if test="mixedC3C4 != null">mixed_c3_c4 = #{mixedC3C4},</if>
+            <if test="hyC9 != null">hy_c9 = #{hyC9},</if>
+            <if test="pguOffgas != null">pgu_offgas = #{pguOffgas},</if>
+            <if test="washOil != null">wash_oil = #{washOil},</if>
+            <if test="toluene != null">toluene = #{toluene},</if>
+            <if test="hyC4FrR800 != null">hy_c4_fr_r800 = #{hyC4FrR800},</if>
+            <if test="crackerRawInput != null">cracker_raw_input = #{crackerRawInput},</if>
+            <if test="crackerRawFeed != null">cracker_raw_feed = #{crackerRawFeed},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTMonthlyProductionReportById" parameterType="Long">
+        update t_monthly_production_report set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTMonthlyProductionReportByIds" parameterType="String">
+        update t_monthly_production_report set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    
+</mapper>

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询每月生产报告列表
+export function listReport(query) {
+  return request({
+    url: '/production/monthly/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询每月生产报告详细
+export function getReport(id) {
+  return request({
+    url: '/production/monthly/' + id,
+    method: 'get'
+  })
+}
+
+// 新增每月生产报告
+export function addReport(data) {
+  return request({
+    url: '/production/monthly',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改每月生产报告
+export function updateReport(data) {
+  return request({
+    url: '/production/monthly',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除每月生产报告
+export function delReport(id) {
+  return request({
+    url: '/production/monthly/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出每月生产报告
+export function exportReport(query) {
+  return request({
+    url: '/production/monthly/export',
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 8
ui/src/api/production/report.js

@@ -9,14 +9,6 @@ export function getAnalysisData(query) {
   })
 }
 
-// 查询日期最新的每日生产报告详细
-export function getReportByMaxDate() {
-  return request({
-    url: '/production/report/selectTDailyProductionReportByMaxDate',
-    method: 'get'
-  })
-}
-
 // 查询每日生产报告列表
 export function listReport(query) {
   return request({
@@ -68,3 +60,11 @@ export function exportReport(query) {
     params: query
   })
 }
+
+// 查询日期最新的每日生产报告详细
+export function getReportByMaxDate() {
+  return request({
+    url: '/production/report/selectTDailyProductionReportByMaxDate',
+    method: 'get'
+  })
+}

+ 33 - 15
ui/src/views/production/monthly/index.vue

@@ -2,9 +2,14 @@
   <div class="app-container" style="overflow-x: auto;">
     <el-form :inline="true" label-width="68px">
       <el-form-item label="报告年份" prop="reportDate">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        type="year"
-                        placeholder="选择报告年份">
+        <el-date-picker
+          v-model="year"
+          @change="handleQueryYear()"
+          size="small"
+          style="width: 200px"
+          type="year"
+          placeholder="选择报告年份"
+        >
         </el-date-picker>
       </el-form-item>
       <el-form-item>
@@ -442,6 +447,10 @@
     name: "Monthly",
       data() {
         return {
+          // 年份
+          year: null,
+          // 月份的固定表示
+          monthList: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
           tableCrackerRawMaterial: [
             {title: "Cracker Raw Material"},
             {title: "NAP"},
@@ -753,24 +762,33 @@
             {item: "精制水"},
             {item: "透平凝液"},
           ],
-          year: null,
-          monthList: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
         }
       },
       created() {
-        this.initTableTitle();
+        this.year = new Date();
+        this.getMonthlyReport();
       },
-      methods: {
-        initTableTitle() {
-          this.year = new Date().getFullYear();
-          let monthListTemp = [];
-          for (let i = 0; i < this.monthList.length; i++) {
-            monthListTemp.push(this.monthList[i] + "-" + this.year);
-          }
-          this.monthList = monthListTemp;
+    methods: {
+      /** 设置表头 */
+      setTableTitle() {
+        let monthListTemp = [];
+        for (let i = 0; i < this.monthList.length; i++) {
+          // 拼接后的格式:月份-年份,如Feb-2022
+          monthListTemp.push(this.monthList[i] + "-" + this.year.getFullYear());
         }
-      }
+        this.monthList = monthListTemp;
+      },
+      /** 处理年份控件change事件 */
+      handleQueryYear() {
+        this.getMonthlyReport();
+      },
+      /** 获取月度报告 */
+      getMonthlyReport() {
+        this.setTableTitle();
+        console.log(this.year.getFullYear());
+      },
     }
+   }
 </script>
 
 <style scoped>