Explorar el Código

王子文 专项培训
培训计划、我的培训
1) 数据库变更:专项培训计划表(T_ST_PLAN)添加字段实际完成计划时间(DATE_OF_COMPLETION)
2) API 修改:查询功能 添加实际完成培训日期
3) 页面调整:table添加column实际完成培训日期 超时课程更改颜色凸显

wangggziwen hace 3 años
padre
commit
36d6473ea6

+ 2 - 0
master/src/main/java/com/ruoyi/project/training/spec/controller/TStPlanController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.training.spec.controller;
 
+import java.util.Date;
 import java.util.List;
 
 import com.ruoyi.project.system.domain.SysUser;
@@ -45,6 +46,7 @@ public class TStPlanController extends BaseController
     private ISysUserService sysUserService;
 
     /**
+     * 我的培训页面查询
      * 根据STAFF_ID查询培训计划列表
      *
      * @autor 王子文

+ 14 - 0
master/src/main/java/com/ruoyi/project/training/spec/domain/TStPlan.java

@@ -73,6 +73,12 @@ public class TStPlan extends BaseEntity
     @Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date endDate;
 
+    // 王子文 2022年4月22日 添加
+    /** 实际完成培训日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "实际完成培训日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date dateOfCompletion;
+
     /** 学时 */
     @Excel(name = "学时")
     private String classHour;
@@ -94,6 +100,14 @@ public class TStPlan extends BaseEntity
     /** 综合评价 */
     private String overallComment;
 
+    public Date getDateOfCompletion() {
+        return dateOfCompletion;
+    }
+
+    public void setDateOfCompletion(Date dateOfCompletion) {
+        this.dateOfCompletion = dateOfCompletion;
+    }
+
     public String getMentorStaffId() {
         return mentorStaffId;
     }

+ 1 - 0
master/src/main/java/com/ruoyi/project/training/spec/service/ITStPlanService.java

@@ -13,6 +13,7 @@ public interface ITStPlanService
 {
     /**
      * 根据STAFF_ID查询培训计划列表
+     *
      * @autor 王子文
      * @date 2022年4月20日
      * @param tStPlan 培训计划对象

+ 1 - 0
master/src/main/java/com/ruoyi/project/training/spec/service/impl/TStPlanServiceImpl.java

@@ -21,6 +21,7 @@ public class TStPlanServiceImpl implements ITStPlanService
 
     /**
      * 根据STAFF_ID查询培训计划列表
+     *
      * @autor 王子文
      * @date 2022年4月20日
      * @param tStPlan 培训计划对象

+ 12 - 3
master/src/main/resources/mybatis/training/spec/TStPlanMapper.xml

@@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="score" column="score" />
         <result property="overallComment" column="overall_comment" />
         <result property="approveStatus" column="APPROVE_STATUS" />
+        <!-- 王子文 2022年4月22日 14点20分 -->
+        <!-- 添加 映射属性 dateOfCompletion -->
+        <result property="dateOfCompletion" column="date_of_completion" />
     </resultMap>
 
     <sql id="selectTStPlanVo">
@@ -32,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <!-- 王子文 2022年4月19日 10点28分 -->
         <!-- 添加 表连接 sys_user u -->
         <!-- 添加 结果字段 u.nick_name -->
-        select suc.MENTOR_STAFF_ID, d.overall_comment, d.score, d.id, d.staff_id,d.APPROVE_STATUS, u.nick_name, d.plant_name, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.start_date, d.end_date, d.class_hour, d.class_content, d.study_state ,s.dept_name from t_st_plan d
+        select d.date_of_completion, suc.MENTOR_STAFF_ID, d.overall_comment, d.score, d.id, d.staff_id,d.APPROVE_STATUS, u.nick_name, d.plant_name, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.start_date, d.end_date, d.class_hour, d.class_content, d.study_state ,s.dept_name from t_st_plan d
         left join sys_dept s on s.dept_id = d.dept_id
         left join sys_user u on d.staff_id = u.staffid
         left join T_ST_SUCCESSOR suc on d.STAFF_ID = suc.STAFF_ID
@@ -127,9 +130,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="classHour != null">class_hour = #{classHour},</if>
             <if test="classContent != null">class_content = #{classContent},</if>
             <if test="studyState != null">study_state = #{studyState},</if>
-            <if test="score != null">score = #{score},</if>
-            <if test="overallComment != null">overall_comment = #{overallComment},</if>
+            <if test="score != null">
+                score = #{score},
+                <!-- 王子文 2022年4月22日 添加 -->
+                <!-- 导师反馈的同时更新实际完成培训日期为当前日期 -->
+                date_of_completion = SYSDATE,
+            </if>
+            <if test="overallComment != null">overall_comment = #{overallComment}</if>
             <if test="approveStatus != null">approve_status = #{approveStatus},</if>
+            <if test="dateOfCompletion != null"></if>
         </trim>
         where id = #{id}
     </update>

+ 16 - 1
ui/src/views/training/spec/myplan/index.vue

@@ -110,7 +110,7 @@
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row> -->
     <!-- 表格 -->
-    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border :row-style="tableRowStyle">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="培训员工" align="center" prop="staffName" :show-overflow-tooltip="true"/>
       <el-table-column label="培训内容" align="center" prop="plantName" :show-overflow-tooltip="true"/>
@@ -124,6 +124,11 @@
           <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="实际完成培训日期" align="center" prop="dateOfCompletion">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.dateOfCompletion, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="学时" align="center" prop="classHour" :show-overflow-tooltip="true"/>
       <el-table-column label="具体内容" align="center" prop="classContent" :show-overflow-tooltip="true"/>
       <el-table-column label="学习状态" align="center" prop="studyState" :formatter="studyStateFormat">
@@ -541,6 +546,16 @@ export default {
     this.getSuccessorOptions();
   },
   methods: {
+    /** 表格行样式 */
+    tableRowStyle({row, rowIndex}) {
+      let rowBackground = {};
+      // 实际完成培训日期超出培训结束日期
+      if (row.endDate < row.dateOfCompletion) {
+        // 修改变行背景色
+        rowBackground.background = "#FFC8C8";
+      }
+      return rowBackground;
+    },
     /** 结束学习处理 */
     handleEnd(row) {
       this.handleFeedback(row);

+ 23 - 4
ui/src/views/training/spec/plan/index.vue

@@ -120,20 +120,25 @@
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <!-- 表格 -->
-    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border :row-style="tableRowStyle">
       <el-table-column type="selection" width="55" fixed="left" align="center" />
       <el-table-column label="培训员工" align="center" fixed="left" prop="staffName" :show-overflow-tooltip="true"/>
       <el-table-column label="培训内容" align="center" fixed="left" prop="plantName" :show-overflow-tooltip="true"/>
-      <el-table-column label="开始日期" align="center" fixed="left" prop="startDate" width="100">
+      <el-table-column label="开始日期" align="center" fixed="left" prop="startDate">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="结束日期" align="center" fixed="left" prop="endDate" width="100">
+      <el-table-column label="结束日期" align="center" fixed="left" prop="endDate">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="实际完成培训日期" align="center" fixed="left" prop="dateOfCompletion">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.dateOfCompletion, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="学时" align="center" fixed="left" prop="classHour" :show-overflow-tooltip="true"/>
       <el-table-column label="具体内容" align="center" fixed="left" prop="classContent" :show-overflow-tooltip="true"/>
       <el-table-column label="学习状态" align="center" fixed="left" prop="studyState" :formatter="studyStateFormat">
@@ -144,7 +149,7 @@
       </el-table-column>
       <el-table-column :label="$t('申请状态')" align="center" fixed="left" prop="approveStatus"
                        :formatter="approveStatusFormat" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="300">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -558,8 +563,22 @@ export default {
       this.approveStatusOptions = response.data;
     });
     this.getSuccessorOptions();
+  },
+  computed: {
+    
+    
   },
   methods: {
+    /** 表格行样式 */
+    tableRowStyle({row, rowIndex}) {
+      let rowBackground = {};
+      // 实际完成培训日期超出培训结束日期
+      if (row.endDate < row.dateOfCompletion) {
+        // 修改变行背景色
+        rowBackground.background = "#FFC8C8";
+      }
+      return rowBackground;
+    },
     /** 评价提交处理 */
     handleAddComment() {
       this.commentParams.id = this.comment.id;