Pārlūkot izejas kodu

气源添加来源企业字段
储罐运营数据增加企业信息展示,增加告警信息标红

Memory_LG 11 mēneši atpakaļ
vecāks
revīzija
1edc7ae405

+ 21 - 13
data-ui/src/views/data/housingconstruction/gassource/index.vue

@@ -87,6 +87,7 @@
     <el-table v-loading="loading" :data="gassourceList" @selection-change="handleSelectionChange">
     <el-table v-loading="loading" :data="gassourceList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="企业名称" align="center" prop="enterpriseName"/>
       <el-table-column label="企业名称" align="center" prop="enterpriseName"/>
+      <el-table-column label="来源企业" align="center" prop="sourceEnterpriseName"/>
       <el-table-column label="来源地" align="center" prop="address"/>
       <el-table-column label="来源地" align="center" prop="address"/>
       <el-table-column label="燃气成分" align="center" prop="component">
       <el-table-column label="燃气成分" align="center" prop="component">
         <template slot-scope="scope">
         <template slot-scope="scope">
@@ -135,8 +136,8 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-row :gutter="24">
         <el-row :gutter="24">
           <el-col :span="12">
           <el-col :span="12">
-            <el-form-item label="所属企业" prop="enterpriseId">
-              <el-select v-model="form.enterpriseId" placeholder="请选择所属企业" @change="handleEnterpriseChange">
+            <el-form-item label="所属厂站" prop="enterpriseId">
+              <el-select v-model="form.enterpriseId" placeholder="请选择所属厂站" @change="handleEnterpriseChange">
                 <el-option
                 <el-option
                   v-for="data in enterpriseList"
                   v-for="data in enterpriseList"
                   :key="data.id"
                   :key="data.id"
@@ -147,8 +148,8 @@
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
           <el-col :span="12">
           <el-col :span="12">
-            <el-form-item label="来源地" prop="address">
-              <el-input v-model="form.address" placeholder="请输入来源地"/>
+            <el-form-item label="来源企业" prop="sourceEnterpriseName">
+              <el-input v-model="form.sourceEnterpriseName" placeholder="请输入来源企业"/>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
         </el-row>
         </el-row>
@@ -166,13 +167,8 @@
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
           <el-col :span="12">
           <el-col :span="12">
-            <el-form-item label="入站时间" prop="joinInstationTime">
-              <el-date-picker clearable size="small"
-                              v-model="form.joinInstationTime"
-                              type="date"
-                              value-format="yyyy-MM-dd"
-                              placeholder="选择入站时间">
-              </el-date-picker>
+            <el-form-item label="来源地" prop="address">
+              <el-input v-model="form.address" placeholder="请输入来源地"/>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
         </el-row>
         </el-row>
@@ -197,6 +193,18 @@
         </el-row>
         </el-row>
         <el-row :gutter="24">
         <el-row :gutter="24">
           <el-col :span="12">
           <el-col :span="12">
+            <el-col :span="12">
+              <el-form-item label="入站时间" prop="joinInstationTime">
+                <el-date-picker clearable size="small"
+                                v-model="form.joinInstationTime"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                placeholder="选择入站时间">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="所属部门" prop="deptId">
             <el-form-item label="所属部门" prop="deptId">
               <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
               <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
                           placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
                           placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
@@ -294,8 +302,8 @@ export default {
         enterpriseId: [
         enterpriseId: [
           {required: true, message: "企业不能为空", trigger: "blur"}
           {required: true, message: "企业不能为空", trigger: "blur"}
         ],
         ],
-        address: [
-          {required: true, message: "来源不能为空", trigger: "blur"}
+        sourceEnterpriseName: [
+          {required: true, message: "来源企业不能为空", trigger: "blur"}
         ],
         ],
         component: [
         component: [
           {required: true, message: "燃气成分不能为空", trigger: "blur"}
           {required: true, message: "燃气成分不能为空", trigger: "blur"}

+ 36 - 36
data-ui/src/views/data/housingconstruction/log/index.vue

@@ -78,37 +78,34 @@
 
 
     <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
     <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="企业名称" align="center" prop="enterpriseName"/>
       <el-table-column label="储罐名称" align="center" prop="storagetankName"/>
       <el-table-column label="储罐名称" align="center" prop="storagetankName"/>
-      <el-table-column
-        label="液体液位"
-        align="center"
-        prop="level"
-        :formatter="formatLevel"
-      />
-      <el-table-column
-        label="温度"
-        align="center"
-        prop="heat"
-        :formatter="formatHeat"
-      />
-      <el-table-column
-        label="内部气压"
-        align="center"
-        prop="pressure"
-        :formatter="formatPressure"
-      />
-      <el-table-column
-        label="周边可燃性气体泄漏"
-        align="center"
-        prop="gasLeak"
-        :formatter="formatGasLeak"
-      />
+      <el-table-column label="液体液位" align="center" prop="level">
+        <template slot-scope="scope">
+          <span :class="getColumnClass(scope.row, 'level')">{{ scope.row.level }} m</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="温度" align="center" prop="heat">
+        <template slot-scope="scope">
+          <span :class="getColumnClass(scope.row, 'heat')">{{ scope.row.heat }} ℃</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="内部气压" align="center" prop="pressure">
+        <template slot-scope="scope">
+          <span :class="getColumnClass(scope.row, 'pressure')">{{ scope.row.pressure }} MPa</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="周边可燃性气体泄漏" align="center" prop="gasLeak">
+        <template slot-scope="scope">
+          <span :class="getColumnClass(scope.row, 'gasLeak')">{{ scope.row.gasLeak }} %LEL</span>
+        </template>
+      </el-table-column>
       <el-table-column label="运行状态" align="center" prop="runState">
       <el-table-column label="运行状态" align="center" prop="runState">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.yes_no" :value="scope.row.runState"/>
           <dict-tag :options="dict.type.yes_no" :value="scope.row.runState"/>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="数据创建时间" align="center" prop="createTime"/>
+      <el-table-column label="创建时间" align="center" prop="createTime"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
         <template slot-scope="scope">
 <!--          <el-button
 <!--          <el-button
@@ -387,18 +384,21 @@ export default {
         ...this.queryParams
         ...this.queryParams
       }, `储罐运营数据_${format_date(new Date())}.xlsx`)
       }, `储罐运营数据_${format_date(new Date())}.xlsx`)
     },
     },
-    formatLevel(cellValue) {
-      return `${cellValue.level} m`;
-    },
-    formatHeat(cellValue) {
-      return `${cellValue.heat} ℃`;
-    },
-    formatPressure(cellValue) {
-      return `${cellValue.pressure} MPa`;
-    },
-    formatGasLeak(cellValue){
-      return `${cellValue.gasLeak} %LEL`;
+    getColumnClass(row, columnProp) {
+      const runState = row.securityState.split(',');
+      const columnMappings = {
+        level: '1',
+        heat: '2',
+        pressure: '3',
+        gasLeak: '4'
+      };
+      return runState.includes(columnMappings[columnProp]) ? 'red-font' : '';
     }
     }
   }
   }
 };
 };
 </script>
 </script>
+<style>
+.red-font {
+  color: red;
+}
+</style>

+ 6 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/domain/CenterdataTHousingconstructionGassource.java

@@ -54,6 +54,12 @@ public class CenterdataTHousingconstructionGassource extends BaseBusinessEntity
     private String enterpriseName;
     private String enterpriseName;
 
 
     /**
     /**
+     * 来源企业
+     */
+    @Excel(name="来源企业")
+    private String sourceEnterpriseName;
+
+    /**
      * 来源地
      * 来源地
      */
      */
     @Excel(name = "来源地")
     @Excel(name = "来源地")

+ 2 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/domain/CenterdataTHousingconstructionStoragetankLog.java

@@ -80,6 +80,8 @@ public class CenterdataTHousingconstructionStoragetankLog extends BaseBusinessEn
     @Excel(name = "运行状态")
     @Excel(name = "运行状态")
     private String runState;
     private String runState;
 
 
+    private String enterpriseName;
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 6 - 1
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionGassourceMapper.xml

@@ -22,6 +22,7 @@
         <result property="weight" column="weight"/>
         <result property="weight" column="weight"/>
         <result property="carId" column="car_id"/>
         <result property="carId" column="car_id"/>
         <result property="carNumber" column="car_number"/>
         <result property="carNumber" column="car_number"/>
+        <result property="sourceEnterpriseName" column="source_enterprise_name"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectCenterdataTHousingconstructionGassourceVo">
     <sql id="selectCenterdataTHousingconstructionGassourceVo">
@@ -41,7 +42,8 @@
                a.join_instation_time,
                a.join_instation_time,
                a.weight,
                a.weight,
                a.car_id,
                a.car_id,
-               a.car_number
+               a.car_number,
+               a.source_enterprise_name
         from centerdata_t_housingconstruction_gassource a
         from centerdata_t_housingconstruction_gassource a
     </sql>
     </sql>
 
 
@@ -86,6 +88,7 @@
             <if test="weight != null">weight,</if>
             <if test="weight != null">weight,</if>
             <if test="carId != null">car_id,</if>
             <if test="carId != null">car_id,</if>
             <if test="carNumber != null">car_number,</if>
             <if test="carNumber != null">car_number,</if>
+            <if test="sourceEnterpriseName != null">source_enterprise_name,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null and id != ''">#{id},</if>
             <if test="id != null and id != ''">#{id},</if>
@@ -105,6 +108,7 @@
             <if test="weight != null">#{weight},</if>
             <if test="weight != null">#{weight},</if>
             <if test="carId != null">#{carId},</if>
             <if test="carId != null">#{carId},</if>
             <if test="carNumber != null">#{carNumber},</if>
             <if test="carNumber != null">#{carNumber},</if>
+            <if test="sourceEnterpriseName != null">#{sourceEnterpriseName},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -127,6 +131,7 @@
             <if test="weight != null">weight = #{weight},</if>
             <if test="weight != null">weight = #{weight},</if>
             <if test="carId != null">car_id = #{carId},</if>
             <if test="carId != null">car_id = #{carId},</if>
             <if test="carNumber != null">car_number = #{carNumber},</if>
             <if test="carNumber != null">car_number = #{carNumber},</if>
+            <if test="sourceEnterpriseName != null">source_enterprise_name = #{sourceEnterpriseName},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>

+ 21 - 1
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionStoragetankLogMapper.xml

@@ -23,6 +23,7 @@
         <result property="gasLeak" column="gas_leak"/>
         <result property="gasLeak" column="gas_leak"/>
         <result property="securityState" column="security_state"/>
         <result property="securityState" column="security_state"/>
         <result property="runState" column="run_state"/>
         <result property="runState" column="run_state"/>
+        <result property="enterpriseName" column="enterprise_name"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectCenterdataTHousingconstructionStoragetankLogVo">
     <sql id="selectCenterdataTHousingconstructionStoragetankLogVo">
@@ -49,8 +50,27 @@
     <select id="selectCenterdataTHousingconstructionStoragetankLogList"
     <select id="selectCenterdataTHousingconstructionStoragetankLogList"
             parameterType="CenterdataTHousingconstructionStoragetankLog"
             parameterType="CenterdataTHousingconstructionStoragetankLog"
             resultMap="CenterdataTHousingconstructionStoragetankLogResult">
             resultMap="CenterdataTHousingconstructionStoragetankLogResult">
-        <include refid="selectCenterdataTHousingconstructionStoragetankLogVo"/>
+        select a.id,
+            a.create_by,
+            a.create_name,
+            a.create_time,
+            a.update_by,
+            a.update_name,
+            a.update_time,
+            a.dept_id,
+            a.dept_name,
+            a.storagetank_id,
+            a.storagetank_name,
+            a.level,
+            a.heat,
+            a.pressure,
+            a.gas_leak,
+            a.security_state,
+            a.run_state,
+            hs.enterprise_name
+        from centerdata_t_housingconstruction_storagetank_log a
         left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
         left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+        left join centerdata_t_housingconstruction_storagetank hs on a.storagetank_id = hs.id
         <where>
         <where>
             <if test="storagetankName != null  and storagetankName != ''">and storagetank_name like concat('%',
             <if test="storagetankName != null  and storagetankName != ''">and storagetank_name like concat('%',
                 #{storagetankName}, '%')
                 #{storagetankName}, '%')