Ver código fonte

上岗证/作业证书一览表 - 岗位/作业证书矩阵校验

wangggziwen 1 ano atrás
pai
commit
1cca7651a6

+ 43 - 0
master/src/main/java/com/ruoyi/project/training/controller/TWorklicenseCertificateController.java

@@ -42,6 +42,49 @@ public class TWorklicenseCertificateController extends BaseController
     {
         startPage();
         List<TWorklicenseCertificate> list = tWorklicenseCertificateService.selectTWorklicenseCertificateList(tWorklicenseCertificate);
+        for (TWorklicenseCertificate worklicenseCertificate : list) {
+            String cracking = worklicenseCertificate.getCracking();
+            String hotarea = worklicenseCertificate.getHotarea();
+            String coldarea = worklicenseCertificate.getColdarea();
+            String aromatic = worklicenseCertificate.getAromatic();
+            // 是否高亮
+            worklicenseCertificate.setIsHighlight(0);
+            // 岗位-作业证书矩阵
+            // 裂解(裂解/SUB)岗位:特种设备管理(压力容器/管道操作证书);危险化学品作业-裂解(裂化)工艺;锅炉操作证。
+            // 热区(压缩)岗位:特种设备管理(压力容器/管道操作证书);危险化学品作业-加氢工艺。
+            // 冷区(分离)岗位:特种设备管理(压力容器/管道操作证书);危险化学品作业-加氢工艺;特种作业-制冷与空调(指定人员)。
+            // 芳烃(PGU&AEU)岗位:特种设备管理(压力容器/管道操作证书);危险化学品作业-加氢工艺。
+            if ("1".equals(cracking)) {
+                if (worklicenseCertificate.getContainer() == null
+                        || worklicenseCertificate.getPipe() == null
+                        || worklicenseCertificate.getCrackingid() == null
+                        || worklicenseCertificate.getBoilerid() == null) {
+                    worklicenseCertificate.setIsHighlight(1);
+                }
+            }
+            if ("1".equals(hotarea)) {
+                if (worklicenseCertificate.getContainer() == null
+                        || worklicenseCertificate.getPipe() == null
+                        || worklicenseCertificate.getCrackingid() == null) {
+                    worklicenseCertificate.setIsHighlight(1);
+                }
+            }
+            if ("1".equals(coldarea)) {
+                if (worklicenseCertificate.getContainer() == null
+                        || worklicenseCertificate.getPipe() == null
+                        || worklicenseCertificate.getCrackingid() == null
+                        || worklicenseCertificate.getRefrigeration() == null) {
+                    worklicenseCertificate.setIsHighlight(1);
+                }
+            }
+            if ("1".equals(aromatic)) {
+                if (worklicenseCertificate.getContainer() == null
+                        || worklicenseCertificate.getPipe() == null
+                        || worklicenseCertificate.getCrackingid() == null) {
+                    worklicenseCertificate.setIsHighlight(1);
+                }
+            }
+        }
         return getDataTable(list);
     }
 

+ 12 - 0
master/src/main/java/com/ruoyi/project/training/domain/TWorklicenseCertificate.java

@@ -20,6 +20,9 @@ public class TWorklicenseCertificate extends BaseEntity
     /** 唯一标识ID */
     private Long id;
 
+    /** 是否高亮 */
+    private int isHighlight;
+
     /** 姓名 */
     @Excel(name = "姓名")
     private String name;
@@ -215,6 +218,15 @@ public class TWorklicenseCertificate extends BaseEntity
     {
         return id;
     }
+
+    public int getIsHighlight() {
+        return isHighlight;
+    }
+
+    public void setIsHighlight(int isHighlight) {
+        this.isHighlight = isHighlight;
+    }
+
     public void setName(String name)
     {
         this.name = name;

+ 1 - 0
master/src/main/resources/mybatis/training/TWorklicenseCertificateMapper.xml

@@ -104,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by d.id asc
     </select>
     
     <select id="selectTWorklicenseCertificateById" parameterType="Long" resultMap="TWorklicenseCertificateResult">

+ 8 - 1
ui/src/views/training/worklicensecertificate/index.vue

@@ -409,7 +409,8 @@
     </el-row>
 
     <el-table v-loading="loading" :data="worklicensecertificateList" @selection-change="handleSelectionChange" :height="clientHeight" border
-              :header-cell-style="{'text-align':'center'}">
+              :header-cell-style="{'text-align':'center'}"
+              :cell-style="tableCellStyle">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true"/>
       <el-table-column label="员工号" align="center" prop="employeeid" :show-overflow-tooltip="true"/>
@@ -1209,6 +1210,12 @@ export default {
     this.getTreeselect();
   },
   methods: {
+    // 单元格样式
+    tableCellStyle( {row, column, rowIndex, columnIndex} ) {
+      if (row.isHighlight == 1) {
+        return "color: red;";
+      }
+    },
     openStaffResume(row){
       this.staffResumeVisible = true
       this.$nextTick(() => {