浏览代码

质量月报
- 循环丙烷关键含量指标
- S5001新增字段丁烯
- S5001查询和导入等功能相应修改
- S5001导入模板修改

wangggziwen 1 年之前
父节点
当前提交
0987de8be1

+ 2 - 0
master/src/main/java/com/ruoyi/project/production/controller/TMonthlyQualityReportController.java

@@ -921,6 +921,8 @@ public class TMonthlyQualityReportController extends BaseController
                         entity.setPropadiene(cellValue);
                     } else if (j == 14) {
                         entity.setMethylacetylene(cellValue);
+                    } else if (j == 18) {
+                        entity.setButene(cellValue);
                     }
                 }
                 tMonthlyQualityReportS5001Service.insertTMonthlyQualityReportS5001(entity);

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

@@ -1,5 +1,6 @@
 package com.ruoyi.project.production.controller;
 
+import java.math.BigDecimal;
 import java.util.List;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,7 +41,16 @@ public class TMonthlyQualityReportS5001Controller extends BaseController
     @GetMapping("/list")
     public AjaxResult list(TMonthlyQualityReportS5001 tMonthlyQualityReportS5001)
     {
-        return AjaxResult.success(tMonthlyQualityReportS5001Service.selectTMonthlyQualityReportS5001List(tMonthlyQualityReportS5001));
+        List<TMonthlyQualityReportS5001> tMonthlyQualityReportS5001s = tMonthlyQualityReportS5001Service.selectTMonthlyQualityReportS5001List(tMonthlyQualityReportS5001);
+        for (TMonthlyQualityReportS5001 monthlyQualityReportS5001 : tMonthlyQualityReportS5001s) {
+            String propadieneStr = monthlyQualityReportS5001.getPropadiene();
+            String methylacetyleneStr = monthlyQualityReportS5001.getMethylacetylene();
+            BigDecimal propadiene = new BigDecimal(propadieneStr == null ? "0" : propadieneStr);
+            BigDecimal methylacetylene = new BigDecimal(methylacetyleneStr == null ? "0" : methylacetyleneStr);
+            BigDecimal mapd = propadiene.add(methylacetylene);
+            monthlyQualityReportS5001.setMapd(mapd.toString());
+        }
+        return AjaxResult.success(tMonthlyQualityReportS5001s);
     }
 
     /**

+ 22 - 0
master/src/main/java/com/ruoyi/project/production/domain/TMonthlyQualityReportS5001.java

@@ -74,6 +74,28 @@ public class TMonthlyQualityReportS5001 extends BaseEntity
 
     private String deptName;
 
+    /** 丁烯 */
+    private String butene;
+
+    /** MAPD==丙二烯+甲基乙炔 */
+    private String mapd;
+
+    public String getMapd() {
+        return mapd;
+    }
+
+    public void setMapd(String mapd) {
+        this.mapd = mapd;
+    }
+
+    public String getButene() {
+        return butene;
+    }
+
+    public void setButene(String butene) {
+        this.butene = butene;
+    }
+
     public String getDeptName() {
         return deptName;
     }

+ 6 - 1
master/src/main/resources/mybatis/production/TMonthlyQualityReportS5001Mapper.xml

@@ -24,10 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptName" column="dept_name" />
         <result property="startDate" column="start_date" />
         <result property="endDate" column="end_date" />
+        <result property="butene" column="butene" />
     </resultMap>
 
     <sql id="selectTMonthlyQualityReportS5001Vo">
-        select d.id, d.location_name, d.sample_point, d.sample_date, d.sample_name, d.propane, d.cyc_propane, d.propylene, d.propadiene, d.methylacetylene, d.dept_id, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time ,s.dept_name from t_monthly_quality_report_s5001 d
+        select d.id, d.butene, d.location_name, d.sample_point, d.sample_date, d.sample_name, d.propane, d.cyc_propane, d.propylene, d.propadiene, d.methylacetylene, d.dept_id, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time ,s.dept_name from t_monthly_quality_report_s5001 d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -46,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="propadiene != null  and propadiene != ''"> and propadiene = #{propadiene}</if>
             <if test="methylacetylene != null  and methylacetylene != ''"> and methylacetylene = #{methylacetylene}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="butene != null "> and dept_id = #{butene}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -79,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="butene != null">butene,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -97,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="butene != null">#{butene},</if>
          </trim>
     </insert>
 
@@ -118,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="butene != null">butene = #{butene},</if>
         </trim>
         where id = #{id}
     </update>

二进制
master/src/main/resources/static/template/production/quality.xlsx


+ 82 - 1
ui/src/views/production/quality/index.vue

@@ -618,6 +618,7 @@
       <el-table-column label="丙烯" align="center" prop="propylene" :show-overflow-tooltip="true"/>
       <el-table-column label="丙二烯" align="center" prop="propadiene" :show-overflow-tooltip="true"/>
       <el-table-column label="甲基乙炔" align="center" prop="methylacetylene" :show-overflow-tooltip="true"/>
+      <el-table-column label="丁烯" align="center" prop="butene" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -3982,9 +3983,89 @@ export default {
           });
           break;
         case "9":
+          this.disposeChart();
           listS5001(this.analysisQueryParams).then(response => {
             let data = response.data;
-            console.log(data)
+            let buteneArray = [];
+            let propyleneArray = [];
+            let sampleDateArray = [];
+            let mapdArray = [];
+            for(let i = 0 ; i < data.length; i++){
+              buteneArray.push(data[i].butene);
+              propyleneArray.push(data[i].propylene);
+              mapdArray.push(data[i].mapd);
+              sampleDateArray.push(data[i].sampleDate);
+            }
+            let option = {
+              title: {
+                text: dictLabel,
+                left: 'center',
+                textStyle: {
+                  fontSize: 16
+                }
+              },
+              tooltip: {
+                trigger: 'axis'
+              },
+              legend: {
+                x: 'center',
+                y: 'bottom',
+                data: ['丁烯', '丙烯', "MAPD"]
+              },
+              grid: {
+                top: '10%',
+                left: '3%',
+                right: '4%',
+                bottom: '10%',
+                containLabel: true
+              },
+              toolbox: {
+                feature: {
+                  saveAsImage: {}
+                }
+              },
+              xAxis: {
+                type: 'category',
+                boundaryGap: false,
+                data: sampleDateArray,
+                axisLabel: {
+                  interval: 0,
+                  rotate: 45
+                }
+              },
+              yAxis: [
+                {
+                  type: 'value',
+                  position: 'left'
+                },
+                {
+                  type: 'value',
+                  position: 'right'
+                }
+              ],
+              series: [
+                {
+                  name: '丁烯',
+                  type: 'line',
+                  data: buteneArray,
+                  yAxisIndex: 0
+                },
+                {
+                  name: '丙烯',
+                  type: 'line',
+                  data: propyleneArray,
+                  yAxisIndex: 0
+                },
+                {
+                  name: 'MAPD',
+                  type: 'line',
+                  data: mapdArray,
+                  yAxisIndex: 1
+                }
+              ]
+            };
+            this.chart = this.echarts.init(document.getElementById('chart'));
+            this.chart.setOption(option);
           });
           break;
         case "10":