Bladeren bron

王子文 月报 Product Yield

wangggziwen 2 jaren geleden
bovenliggende
commit
65a48ae462

+ 274 - 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-07
+ * @date 2022-11-08
  */
 public class TMonthlyProductionReport extends BaseEntity
 {
@@ -206,6 +206,90 @@ public class TMonthlyProductionReport extends BaseEntity
     @Excel(name = "Aromatics Output Product output total")
     private String aromaticsOutput;
 
+    /** Product Yield gaseity */
+    @Excel(name = "Product Yield gaseity")
+    private String gaseityYield;
+
+    /** Product Yield tatal */
+    @Excel(name = "Product Yield tatal")
+    private String tatalYield;
+
+    /** Product Yield C3/C2 */
+    @Excel(name = "Product Yield C3/C2")
+    private String c3C2Yield;
+
+    /** Product Yield H2 */
+    @Excel(name = "Product Yield H2")
+    private String h2Yield;
+
+    /** Product Yield ethylene */
+    @Excel(name = "Product Yield ethylene")
+    private String ethyleneYield;
+
+    /** Product Yield propylene */
+    @Excel(name = "Product Yield propylene")
+    private String propyleneYield;
+
+    /** Product Yield C3/C4 LPG */
+    @Excel(name = "Product Yield C3/C4 LPG")
+    private String c3C4LpgYield;
+
+    /** Product Yield C4S */
+    @Excel(name = "Product Yield C4S")
+    private String c4sYield;
+
+    /** Product Yield PO */
+    @Excel(name = "Product Yield PO")
+    private String poYield;
+
+    /** Product Yield Naphthalene */
+    @Excel(name = "Product Yield Naphthalene")
+    private String naphthaleneYield;
+
+    /** Product Yield EBO */
+    @Excel(name = "Product Yield EBO")
+    private String eboYield;
+
+    /** Product Yield WS */
+    @Excel(name = "Product Yield WS")
+    private String wsYield;
+
+    /** Product Yield Methane */
+    @Excel(name = "Product Yield Methane")
+    private String methaneYield;
+
+    /** Product Yield OFFAGE */
+    @Excel(name = "Product Yield OFFAGE")
+    private String offageYield;
+
+    /** Product Yield RPG */
+    @Excel(name = "Product Yield RPG")
+    private String rpgYield;
+
+    /** Product Yield Benzene */
+    @Excel(name = "Product Yield Benzene")
+    private String benzeneYield;
+
+    /** Product Yield Toluene */
+    @Excel(name = "Product Yield Toluene")
+    private String tolueneYield;
+
+    /** Product Yield Xylene */
+    @Excel(name = "Product Yield Xylene")
+    private String xyleneYield;
+
+    /** Product Yield C6-C8 NA */
+    @Excel(name = "Product Yield C6-C8 NA")
+    private String c6C8NaYield;
+
+    /** Product Yield C5 */
+    @Excel(name = "Product Yield C5")
+    private String c5Yield;
+
+    /** Product Yield C9 */
+    @Excel(name = "Product Yield C9")
+    private String c9Yield;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -639,6 +723,174 @@ public class TMonthlyProductionReport extends BaseEntity
         return aromaticsOutput;
     }
 
+    public String getGaseityYield() {
+        return gaseityYield;
+    }
+
+    public void setGaseityYield(String gaseityYield) {
+        this.gaseityYield = gaseityYield;
+    }
+
+    public String getTatalYield() {
+        return tatalYield;
+    }
+
+    public void setTatalYield(String tatalYield) {
+        this.tatalYield = tatalYield;
+    }
+
+    public String getC3C2Yield() {
+        return c3C2Yield;
+    }
+
+    public void setC3C2Yield(String c3C2Yield) {
+        this.c3C2Yield = c3C2Yield;
+    }
+
+    public String getH2Yield() {
+        return h2Yield;
+    }
+
+    public void setH2Yield(String h2Yield) {
+        this.h2Yield = h2Yield;
+    }
+
+    public String getEthyleneYield() {
+        return ethyleneYield;
+    }
+
+    public void setEthyleneYield(String ethyleneYield) {
+        this.ethyleneYield = ethyleneYield;
+    }
+
+    public String getPropyleneYield() {
+        return propyleneYield;
+    }
+
+    public void setPropyleneYield(String propyleneYield) {
+        this.propyleneYield = propyleneYield;
+    }
+
+    public String getC3C4LpgYield() {
+        return c3C4LpgYield;
+    }
+
+    public void setC3C4LpgYield(String c3C4LpgYield) {
+        this.c3C4LpgYield = c3C4LpgYield;
+    }
+
+    public String getC4sYield() {
+        return c4sYield;
+    }
+
+    public void setC4sYield(String c4sYield) {
+        this.c4sYield = c4sYield;
+    }
+
+    public String getPoYield() {
+        return poYield;
+    }
+
+    public void setPoYield(String poYield) {
+        this.poYield = poYield;
+    }
+
+    public String getNaphthaleneYield() {
+        return naphthaleneYield;
+    }
+
+    public void setNaphthaleneYield(String naphthaleneYield) {
+        this.naphthaleneYield = naphthaleneYield;
+    }
+
+    public String getEboYield() {
+        return eboYield;
+    }
+
+    public void setEboYield(String eboYield) {
+        this.eboYield = eboYield;
+    }
+
+    public String getWsYield() {
+        return wsYield;
+    }
+
+    public void setWsYield(String wsYield) {
+        this.wsYield = wsYield;
+    }
+
+    public String getMethaneYield() {
+        return methaneYield;
+    }
+
+    public void setMethaneYield(String methaneYield) {
+        this.methaneYield = methaneYield;
+    }
+
+    public String getOffageYield() {
+        return offageYield;
+    }
+
+    public void setOffageYield(String offageYield) {
+        this.offageYield = offageYield;
+    }
+
+    public String getRpgYield() {
+        return rpgYield;
+    }
+
+    public void setRpgYield(String rpgYield) {
+        this.rpgYield = rpgYield;
+    }
+
+    public String getBenzeneYield() {
+        return benzeneYield;
+    }
+
+    public void setBenzeneYield(String benzeneYield) {
+        this.benzeneYield = benzeneYield;
+    }
+
+    public String getTolueneYield() {
+        return tolueneYield;
+    }
+
+    public void setTolueneYield(String tolueneYield) {
+        this.tolueneYield = tolueneYield;
+    }
+
+    public String getXyleneYield() {
+        return xyleneYield;
+    }
+
+    public void setXyleneYield(String xyleneYield) {
+        this.xyleneYield = xyleneYield;
+    }
+
+    public String getC6C8NaYield() {
+        return c6C8NaYield;
+    }
+
+    public void setC6C8NaYield(String c6C8NaYield) {
+        this.c6C8NaYield = c6C8NaYield;
+    }
+
+    public String getC5Yield() {
+        return c5Yield;
+    }
+
+    public void setC5Yield(String c5Yield) {
+        this.c5Yield = c5Yield;
+    }
+
+    public String getC9Yield() {
+        return c9Yield;
+    }
+
+    public void setC9Yield(String c9Yield) {
+        this.c9Yield = c9Yield;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -690,6 +942,27 @@ public class TMonthlyProductionReport extends BaseEntity
             .append("pguBtxChange", getPguBtxChange())
             .append("aeuTolueneProducedMEu", getAeuTolueneProducedMEu())
             .append("aromaticsOutput", getAromaticsOutput())
+            .append("gaseityYield", getGaseityYield())
+            .append("tatalYield", getTatalYield())
+            .append("c3C2Yield", getC3C2Yield())
+            .append("h2Yield", getH2Yield())
+            .append("ethyleneYield", getEthyleneYield())
+            .append("propyleneYield", getPropyleneYield())
+            .append("c3C4LpgYield", getC3C4LpgYield())
+            .append("c4sYield", getC4sYield())
+            .append("poYield", getPoYield())
+            .append("naphthaleneYield", getNaphthaleneYield())
+            .append("eboYield", getEboYield())
+            .append("wsYield", getWsYield())
+            .append("methaneYield", getMethaneYield())
+            .append("offageYield", getOffageYield())
+            .append("rpgYield", getRpgYield())
+            .append("benzeneYield", getBenzeneYield())
+            .append("tolueneYield", getTolueneYield())
+            .append("xyleneYield", getXyleneYield())
+            .append("c6C8NaYield", getC6C8NaYield())
+            .append("c5Yield", getC5Yield())
+            .append("c9Yield", getC9Yield())
             .toString();
     }
 }

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

@@ -557,7 +557,122 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
      */
     @Override
     public List<MonthlyProductionReportVO> selectProductYieldByYear(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.selectProductYieldByYear(year);
+        // 前端月报数据集合,每个元素对应当前某个指标的title、unit、1~12月的数据以及年度汇总数据
+        List<MonthlyProductionReportVO> monthlyProductionReportVOs = new ArrayList<>();
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("gaseity_yield", "gaseity","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("tatal_yield", "tatal","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c3_c2_yield", "C3/C2","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("h2_yield", "H2","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("ethylene_yield", "ethylene","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("propylene_yield", "propylene","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c3_c4_lpg_yield", "C3/C4 LPG","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c4s_yield", "C4'S","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("po_yield", "PO","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("naphthalene_yield", "Naphthalene","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("ebo_yield", "EBO","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("ws_yield", "WS ","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("methane_yield", "Methane","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("offage_yield", "OFFAGE","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("rpg_yield", "RPG","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("benzene_yield", "Benzene","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("toluene_yield", "Toluene","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("xylene_yield", "Xylene","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c6_c8_na_yield", "C6-C8 NA","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c5_yield", "C5","%"));
+        monthlyProductionReportVOs.add(new MonthlyProductionReportVO("c9_yield", "C9","%"));
+        // 遍历从数据库中查出的月报数据集合,结果为0~12条数据不等
+        for (int i = 0; i < tMonthlyProductionReports.size(); i++) {
+            TMonthlyProductionReport tMonthlyProductionReport = tMonthlyProductionReports.get(i);
+            String gaseityYield = tMonthlyProductionReport.getGaseityYield();
+            String tatalYield = tMonthlyProductionReport.getTatalYield();
+            String c3C2Yield = tMonthlyProductionReport.getC3C2Yield();
+            String h2Yield = tMonthlyProductionReport.getH2Yield();
+            String ethyleneYield = tMonthlyProductionReport.getEthyleneYield();
+            String propyleneYield = tMonthlyProductionReport.getPropyleneYield();
+            String c3C4LpgYield = tMonthlyProductionReport.getC3C4LpgYield();
+            String c4sYield = tMonthlyProductionReport.getC4sYield();
+            String poYield = tMonthlyProductionReport.getPoYield();
+            String naphthaleneYield = tMonthlyProductionReport.getNaphthaleneYield();
+            String eboYield = tMonthlyProductionReport.getEboYield();
+            String wsYield = tMonthlyProductionReport.getWsYield();
+            String methaneYield = tMonthlyProductionReport.getMethaneYield();
+            String offageYield = tMonthlyProductionReport.getOffageYield();
+            String rpgYield = tMonthlyProductionReport.getRpgYield();
+            String benzeneYield = tMonthlyProductionReport.getBenzeneYield();
+            String tolueneYield = tMonthlyProductionReport.getTolueneYield();
+            String xyleneYield = tMonthlyProductionReport.getXyleneYield();
+            String c6C8NaYield = tMonthlyProductionReport.getC6C8NaYield();
+            String c5Yield = tMonthlyProductionReport.getC5Yield();
+            String c9Yield = tMonthlyProductionReport.getC9Yield();
+            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), gaseityYield);
+                method.invoke(monthlyProductionReportVOs.get(1), tatalYield);
+                method.invoke(monthlyProductionReportVOs.get(2), c3C2Yield);
+                method.invoke(monthlyProductionReportVOs.get(3), h2Yield);
+                method.invoke(monthlyProductionReportVOs.get(4), ethyleneYield);
+                method.invoke(monthlyProductionReportVOs.get(5), propyleneYield);
+                method.invoke(monthlyProductionReportVOs.get(6), c3C4LpgYield);
+                method.invoke(monthlyProductionReportVOs.get(7), c4sYield);
+                method.invoke(monthlyProductionReportVOs.get(8), poYield);
+                method.invoke(monthlyProductionReportVOs.get(9), naphthaleneYield);
+                method.invoke(monthlyProductionReportVOs.get(10), eboYield);
+                method.invoke(monthlyProductionReportVOs.get(11), wsYield);
+                method.invoke(monthlyProductionReportVOs.get(12), methaneYield);
+                method.invoke(monthlyProductionReportVOs.get(13), offageYield);
+                method.invoke(monthlyProductionReportVOs.get(14), rpgYield);
+                method.invoke(monthlyProductionReportVOs.get(15), benzeneYield);
+                method.invoke(monthlyProductionReportVOs.get(16), tolueneYield);
+                method.invoke(monthlyProductionReportVOs.get(17), xyleneYield);
+                method.invoke(monthlyProductionReportVOs.get(18), c6C8NaYield);
+                method.invoke(monthlyProductionReportVOs.get(19), c5Yield);
+                method.invoke(monthlyProductionReportVOs.get(20), c9Yield);
+                // 当前年份=所属年份,当前月份=所属月份
+                if (currentMonth.equals(reportMonth) && currentYear.equals(reportYear)) {
+                    monthlyProductionReportVOs.get(0).setCurrently(gaseityYield);
+                    monthlyProductionReportVOs.get(1).setCurrently(tatalYield);
+                    monthlyProductionReportVOs.get(2).setCurrently(c3C2Yield);
+                    monthlyProductionReportVOs.get(3).setCurrently(h2Yield);
+                    monthlyProductionReportVOs.get(4).setCurrently(ethyleneYield);
+                    monthlyProductionReportVOs.get(5).setCurrently(propyleneYield);
+                    monthlyProductionReportVOs.get(6).setCurrently(c3C4LpgYield);
+                    monthlyProductionReportVOs.get(7).setCurrently(c4sYield);
+                    monthlyProductionReportVOs.get(8).setCurrently(poYield);
+                    monthlyProductionReportVOs.get(9).setCurrently(naphthaleneYield);
+                    monthlyProductionReportVOs.get(10).setCurrently(eboYield);
+                    monthlyProductionReportVOs.get(11).setCurrently(wsYield);
+                    monthlyProductionReportVOs.get(12).setCurrently(methaneYield);
+                    monthlyProductionReportVOs.get(13).setCurrently(offageYield);
+                    monthlyProductionReportVOs.get(14).setCurrently(rpgYield);
+                    monthlyProductionReportVOs.get(15).setCurrently(benzeneYield);
+                    monthlyProductionReportVOs.get(16).setCurrently(tolueneYield);
+                    monthlyProductionReportVOs.get(17).setCurrently(xyleneYield);
+                    monthlyProductionReportVOs.get(18).setCurrently(c6C8NaYield);
+                    monthlyProductionReportVOs.get(19).setCurrently(c5Yield);
+                    monthlyProductionReportVOs.get(20).setCurrently(c9Yield);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        this.calcTotal(monthlyProductionReportVOs);
+        return monthlyProductionReportVOs;
     }
 
     /**

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

@@ -6,6 +6,7 @@ import com.ruoyi.project.production.mapper.TDailyProductionReportMapper;
 import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Date;
 
 /**
@@ -210,6 +211,109 @@ public class SyncMonthlyThread extends Thread {
                 .add(pguOffgasProduced).add(pguBtxChange);
         monthly.setAromaticsOutput(aromaticsOutput.toString());
 
+        BigDecimal gaseityYield = new BigDecimal("0");
+        final BigDecimal hundred = new BigDecimal("100");
+        gaseityYield = gaseityYield.add(h2Produced).add(ethylenProduced).add(propyleneProduced)
+                .add(c3LpgProduced).add(c4LpgProduced).add(methaneProduced).add(offgasProduced).multiply(hundred);
+        gaseityYield = gaseityYield.divide(crackerRawInput, 2, RoundingMode.HALF_UP);
+        BigDecimal tatalYield = new BigDecimal("0");
+        if (crackerRawInput.compareTo(BigDecimal.ZERO) != 0) {
+            tatalYield = crackerOutput.multiply(hundred).divide(crackerRawInput, 2, RoundingMode.HALF_UP);
+        }
+        BigDecimal c3C2Yield = new BigDecimal("0");
+        if (ethylenProduced.compareTo(BigDecimal.ZERO) != 0) {
+            c3C2Yield = propyleneProduced.multiply(hundred).divide(ethylenProduced, 2, RoundingMode.HALF_UP);
+        }
+        BigDecimal h2Yield = new BigDecimal("0");
+        BigDecimal ethyleneYield = new BigDecimal("0");
+        BigDecimal propyleneYield = new BigDecimal("0");
+        BigDecimal c3C4LpgYield = new BigDecimal("0");
+        BigDecimal c4sYield = new BigDecimal("0");
+        BigDecimal poYield = new BigDecimal("0");
+        BigDecimal naphthaleneYield = new BigDecimal("0");
+        BigDecimal eboYield = new BigDecimal("0");
+        BigDecimal wsYield = new BigDecimal("0");
+        BigDecimal methaneYield = new BigDecimal("0");
+        BigDecimal offageYield = new BigDecimal("0");
+        BigDecimal rpgYield = new BigDecimal("0");
+        if (crackerRawFeed.compareTo(BigDecimal.ZERO) != 0) {
+            h2Yield = h2Produced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            ethyleneYield = ethylenProduced.subtract(c2FrLdpe.multiply(new BigDecimal("0.9")));
+            ethyleneYield = ethyleneYield.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            propyleneYield = propyleneProduced.subtract(c3FrOxo.multiply(new BigDecimal("0.68")));
+            propyleneYield = propyleneYield.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            c3C4LpgYield = c3C4LpgProduced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            c4sYield = c4LpgProduced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            poYield = poFluxOilProduced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            naphthaleneYield = naphthaleneProduced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            eboYield = eboProduced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            wsYield = residueOilProduced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            methaneYield = methaneProduced.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            offageYield = offgasProduced.subtract(c2FrLdpe.multiply(new BigDecimal("0.1")))
+            .subtract(c3FrOxo.multiply(new BigDecimal("0.32"))).subtract(mixedC3C4).subtract(pguOffgas);
+            offageYield = offageYield.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            rpgYield = rpgProduced.subtract(hyC9).subtract(washOil).subtract(toluene);
+            rpgYield = rpgYield.multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+        }
+        BigDecimal benzeneYield = new BigDecimal("0");
+        BigDecimal tolueneYield = new BigDecimal("0");
+        BigDecimal xyleneYield = new BigDecimal("0");
+        BigDecimal c6C8NaYield = new BigDecimal("0");
+        if (pguRpg2.compareTo(BigDecimal.ZERO) != 0 &&
+                pguBtxToAeu.compareTo(BigDecimal.ZERO) != 0 &&
+                crackerRawFeed.compareTo(BigDecimal.ZERO) != 0) {
+            benzeneYield = aeuBenzeneProduced
+                    .multiply(rpgProduced.divide(pguRpg2, 3, RoundingMode.HALF_UP))
+                    .multiply(pguBtxProduced.divide(pguBtxToAeu, 3, RoundingMode.HALF_UP))
+                    .multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            tolueneYield = (aeuTolueneProduced.subtract(toluene))
+                    .multiply(rpgProduced.divide(pguRpg2, 3, RoundingMode.HALF_UP))
+                    .multiply(pguBtxProduced.divide(pguBtxToAeu, 3, RoundingMode.HALF_UP))
+                    .multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            xyleneYield = aeuXyleneProduced
+                    .multiply(rpgProduced.divide(pguRpg2, 3, RoundingMode.HALF_UP))
+                    .multiply(pguBtxProduced.divide(pguBtxToAeu, 3, RoundingMode.HALF_UP))
+                    .multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            c6C8NaYield = aeuC6C8NaProduced
+                    .multiply(rpgProduced.divide(pguRpg2, 3, RoundingMode.HALF_UP))
+                    .multiply(pguBtxProduced.divide(pguBtxToAeu, 3, RoundingMode.HALF_UP))
+                    .multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+        }
+        BigDecimal c5Yield = new BigDecimal("0");
+        BigDecimal c9Yield = new BigDecimal("0");
+        if (pguRpg2.compareTo(BigDecimal.ZERO) != 0 && crackerRawFeed.compareTo(BigDecimal.ZERO) != 0) {
+            c5Yield = pguC5Produced
+                    .divide(pguRpg2, 3, RoundingMode.HALF_UP)
+                    .multiply(rpgProduced)
+                    .multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+            c9Yield = (pguC9Produced
+                    .divide(pguRpg2, 3, RoundingMode.HALF_UP)
+                    .multiply(rpgProduced)
+                    .subtract(hyC9))
+                    .multiply(hundred).divide(crackerRawFeed, 2, RoundingMode.HALF_UP);
+        }
+        monthly.setGaseityYield(gaseityYield.toString());
+        monthly.setTatalYield(tatalYield.toString());
+        monthly.setC3C2Yield(c3C2Yield.toString());
+        monthly.setH2Yield(h2Yield.toString());
+        monthly.setEthyleneYield(ethyleneYield.toString());
+        monthly.setPropyleneYield(propyleneYield.toString());
+        monthly.setC3C4LpgYield(c3C4LpgYield.toString());
+        monthly.setC4sYield(c4sYield.toString());
+        monthly.setPoYield(poYield.toString());
+        monthly.setNaphthaleneYield(naphthaleneYield.toString());
+        monthly.setEboYield(eboYield.toString());
+        monthly.setWsYield(wsYield.toString());
+        monthly.setMethaneYield(methaneYield.toString());
+        monthly.setOffageYield(offageYield.toString());
+        monthly.setRpgYield(rpgYield.toString());
+        monthly.setBenzeneYield(benzeneYield.toString());
+        monthly.setTolueneYield(tolueneYield.toString());
+        monthly.setXyleneYield(xyleneYield.toString());
+        monthly.setC6C8NaYield(c6C8NaYield.toString());
+        monthly.setC5Yield(c5Yield.toString());
+        monthly.setC9Yield(c9Yield.toString());
+
         // 查询年份=reportYear,月份=reportMonth的月报数据
         int count = tMonthlyProductionReportMapper.selectTMonthlyProductionReportCountByDate(reportYear, reportMonth);
         if (count == 0) {   // 新增月报数据

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

@@ -53,6 +53,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="pguBtxChange"             column="pgu_btx_change"    />
         <result property="aeuTolueneProducedMEu"    column="aeu_toluene_produced_m_eu"    />
         <result property="aromaticsOutput"          column="aromatics_output"    />
+        <result property="gaseityYield"             column="gaseity_yield"    />
+        <result property="tatalYield"               column="tatal_yield"    />
+        <result property="c3C2Yield"                column="c3_c2_yield"    />
+        <result property="h2Yield"                  column="h2_yield"    />
+        <result property="ethyleneYield"            column="ethylene_yield"    />
+        <result property="propyleneYield"           column="propylene_yield"    />
+        <result property="c3C4LpgYield"             column="c3_c4_lpg_yield"    />
+        <result property="c4sYield"                 column="c4s_yield"    />
+        <result property="poYield"                  column="po_yield"    />
+        <result property="naphthaleneYield"         column="naphthalene_yield"    />
+        <result property="eboYield"                 column="ebo_yield"    />
+        <result property="wsYield"                  column="ws_yield"    />
+        <result property="methaneYield"             column="methane_yield"    />
+        <result property="offageYield"              column="offage_yield"    />
+        <result property="rpgYield"                 column="rpg_yield"    />
+        <result property="benzeneYield"             column="benzene_yield"    />
+        <result property="tolueneYield"             column="toluene_yield"    />
+        <result property="xyleneYield"              column="xylene_yield"    />
+        <result property="c6C8NaYield"              column="c6_c8_na_yield"    />
+        <result property="c5Yield"                  column="c5_yield"    />
+        <result property="c9Yield"                  column="c9_yield"    />
     </resultMap>
 
     <select id="selectCrackerRawMaterialByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
@@ -92,7 +113,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where d.report_year = #{year}
     </select>
     <select id="selectEligibleProductRateByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
-    <select id="selectProductYieldByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+    <select id="selectProductYieldByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
+        select
+               d.id, d.report_month, d.report_year,
+               d.gaseity_yield, d.tatal_yield, d.c3_c2_yield, d.h2_yield, d.ethylene_yield, d.propylene_yield,
+               d.c3_c4_lpg_yield, d.c4s_yield, d.po_yield, d.naphthalene_yield, d.ebo_yield, d.ws_yield,
+               d.methane_yield, d.offage_yield, d.rpg_yield, d.benzene_yield, d.toluene_yield, d.xylene_yield,
+               d.c6_c8_na_yield, d.c5_yield, d.c9_yield
+        from
+             t_monthly_production_report d
+        where d.report_year = #{year}
+    </select>
     <select id="selectCrackerUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
     <select id="selectCrackerEnergyConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
     <select id="selectAromaticsUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
@@ -169,6 +200,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pguBtxChange != null">pgu_btx_change,</if>
             <if test="aeuTolueneProducedMEu != null">aeu_toluene_produced_m_eu,</if>
             <if test="aromaticsOutput != null">aromatics_output,</if>
+            <if test="gaseityYield != null">gaseity_yield,</if>
+            <if test="tatalYield != null">tatal_yield,</if>
+            <if test="c3C2Yield != null">c3_c2_yield,</if>
+            <if test="h2Yield != null">h2_yield,</if>
+            <if test="ethyleneYield != null">ethylene_yield,</if>
+            <if test="propyleneYield != null">propylene_yield,</if>
+            <if test="c3C4LpgYield != null">c3_c4_lpg_yield,</if>
+            <if test="c4sYield != null">c4s_yield,</if>
+            <if test="poYield != null">po_yield,</if>
+            <if test="naphthaleneYield != null">naphthalene_yield,</if>
+            <if test="eboYield != null">ebo_yield,</if>
+            <if test="wsYield != null">ws_yield,</if>
+            <if test="methaneYield != null">methane_yield,</if>
+            <if test="offageYield != null">offage_yield,</if>
+            <if test="rpgYield != null">rpg_yield,</if>
+            <if test="benzeneYield != null">benzene_yield,</if>
+            <if test="tolueneYield != null">toluene_yield,</if>
+            <if test="xyleneYield != null">xylene_yield,</if>
+            <if test="c6C8NaYield != null">c6_c8_na_yield,</if>
+            <if test="c5Yield != null">c5_yield,</if>
+            <if test="c9Yield != null">c9_yield,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -219,6 +271,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pguBtxChange != null">#{pguBtxChange},</if>
             <if test="aeuTolueneProducedMEu != null">#{aeuTolueneProducedMEu},</if>
             <if test="aromaticsOutput != null">#{aromaticsOutput},</if>
+            <if test="gaseityYield != null">#{gaseityYield},</if>
+            <if test="tatalYield != null">#{tatalYield},</if>
+            <if test="c3C2Yield != null">#{c3C2Yield},</if>
+            <if test="h2Yield != null">#{h2Yield},</if>
+            <if test="ethyleneYield != null">#{ethyleneYield},</if>
+            <if test="propyleneYield != null">#{propyleneYield},</if>
+            <if test="c3C4LpgYield != null">#{c3C4LpgYield},</if>
+            <if test="c4sYield != null">#{c4sYield},</if>
+            <if test="poYield != null">#{poYield},</if>
+            <if test="naphthaleneYield != null">#{naphthaleneYield},</if>
+            <if test="eboYield != null">#{eboYield},</if>
+            <if test="wsYield != null">#{wsYield},</if>
+            <if test="methaneYield != null">#{methaneYield},</if>
+            <if test="offageYield != null">#{offageYield},</if>
+            <if test="rpgYield != null">#{rpgYield},</if>
+            <if test="benzeneYield != null">#{benzeneYield},</if>
+            <if test="tolueneYield != null">#{tolueneYield},</if>
+            <if test="xyleneYield != null">#{xyleneYield},</if>
+            <if test="c6C8NaYield != null">#{c6C8NaYield},</if>
+            <if test="c5Yield != null">#{c5Yield},</if>
+            <if test="c9Yield != null">#{c9Yield},</if>
         </trim>
     </insert>
 
@@ -270,6 +343,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pguBtxChange != null">pgu_btx_change = #{pguBtxChange},</if>
             <if test="aeuTolueneProducedMEu != null">aeu_toluene_produced_m_eu = #{aeuTolueneProducedMEu},</if>
             <if test="aromaticsOutput != null">aromatics_output = #{aromaticsOutput},</if>
+            <if test="gaseityYield != null">gaseity_yield = #{gaseityYield},</if>
+            <if test="tatalYield != null">tatal_yield = #{tatalYield},</if>
+            <if test="c3C2Yield != null">c3_c2_yield = #{c3C2Yield},</if>
+            <if test="h2Yield != null">h2_yield = #{h2Yield},</if>
+            <if test="ethyleneYield != null">ethylene_yield = #{ethyleneYield},</if>
+            <if test="propyleneYield != null">propylene_yield = #{propyleneYield},</if>
+            <if test="c3C4LpgYield != null">c3_c4_lpg_yield = #{c3C4LpgYield},</if>
+            <if test="c4sYield != null">c4s_yield = #{c4sYield},</if>
+            <if test="poYield != null">po_yield = #{poYield},</if>
+            <if test="naphthaleneYield != null">naphthalene_yield = #{naphthaleneYield},</if>
+            <if test="eboYield != null">ebo_yield = #{eboYield},</if>
+            <if test="wsYield != null">ws_yield = #{wsYield},</if>
+            <if test="methaneYield != null">methane_yield = #{methaneYield},</if>
+            <if test="offageYield != null">offage_yield = #{offageYield},</if>
+            <if test="rpgYield != null">rpg_yield = #{rpgYield},</if>
+            <if test="benzeneYield != null">benzene_yield = #{benzeneYield},</if>
+            <if test="tolueneYield != null">toluene_yield = #{tolueneYield},</if>
+            <if test="xyleneYield != null">xylene_yield = #{xyleneYield},</if>
+            <if test="c6C8NaYield != null">c6_c8_na_yield = #{c6C8NaYield},</if>
+            <if test="c5Yield != null">c5_yield = #{c5Yield},</if>
+            <if test="c9Yield != null">c9_yield = #{c9Yield},</if>
         </trim>
         where report_month = #{reportMonth} and report_year = #{reportYear}
     </update>

+ 3 - 4
ui/src/views/production/monthly/index.vue

@@ -996,7 +996,6 @@ export default {
       });
       getCrackerOutputProduct(year).then(response => {
         this.tableCrackerOutputProduct = response.data;
-        console.log(this.tableCrackerOutputProduct);
       });
       getAromaticsRawMaterial(year).then(response => {
         this.tableAromaticsRawMaterial = response.data;
@@ -1007,9 +1006,9 @@ export default {
       // getEligibleProductRate(year).then(response => {
       //   this.tableEligibleProductRate = response.data;
       // });
-      // getProductYield(year).then(response => {
-      //   this.tableProductYield = response.data;
-      // });
+      getProductYield(year).then(response => {
+        this.tableProductYield = response.data;
+      });
       // getCrackerUtilityConsumption(year).then(response => {
       //   this.tableCrackerUtilityConsumption = response.data;
       // });