Ver Fonte

- 我的学习页面添加“培训完成时间”、“签名时间”
- 学习计划管理页面添加“培训完成时间”、“签名时间”
- 学习计划管理页面导出功能添加“培训完成时间”、“签名时间”

wangggziwen há 5 meses atrás
pai
commit
28a97e5687

+ 24 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/branch/TBranchLearningController.java

@@ -182,8 +182,10 @@ public class TBranchLearningController extends BaseController
             sheet.setColumnWidth(3, 6000);
             sheet.setColumnWidth(4, 6000);
             sheet.setColumnWidth(5, 4000);
-            sheet.setColumnWidth(6, 2000);
-            sheet.setColumnWidth(7, 2000);
+            sheet.setColumnWidth(6, 3000);
+            sheet.setColumnWidth(7, 6000);
+            sheet.setColumnWidth(8, 2000);
+            sheet.setColumnWidth(9, 6000);
             // 表头
             XSSFRow row0 = sheet.createRow(0);
             XSSFCell cell0 = row0.createCell(0);
@@ -205,16 +207,22 @@ public class TBranchLearningController extends BaseController
             cell5.setCellValue("截止日期");
             cell5.setCellStyle(headerStyle);
             XSSFCell cell6 = row0.createCell(6);
-            cell6.setCellValue("进度");
+            cell6.setCellValue("进度(%)");
             cell6.setCellStyle(headerStyle);
             XSSFCell cell7 = row0.createCell(7);
-            cell7.setCellValue("签名");
+            cell7.setCellValue("培训完成时间");
             cell7.setCellStyle(headerStyle);
+            XSSFCell cell8 = row0.createCell(8);
+            cell8.setCellValue("签名");
+            cell8.setCellStyle(headerStyle);
+            XSSFCell cell9 = row0.createCell(9);
+            cell9.setCellValue("签名时间");
+            cell9.setCellStyle(headerStyle);
             // 创建行
             for (int i = 1; i < list.size() + 1; i++) {
                 XSSFRow row = sheet.createRow(i);
                 // 创建单元格
-                for (int j = 0; j < 8; j++) {
+                for (int j = 0; j < 10; j++) {
                     XSSFCell cell = row.createCell(j);
                     cell.setCellStyle(cellStyle);
                     switch (j) {
@@ -228,19 +236,23 @@ public class TBranchLearningController extends BaseController
                             cell.setCellValue(list.get(i - 1).getLearningStatus());
                             break;
                         case 3:
-                            cell.setCellValue(list.get(i - 1).getLearningTimeRequired());
+                            cell.setCellValue(list.get(i - 1).getLearningTimeRequired() + " min");
                             break;
                         case 4:
-                            cell.setCellValue(list.get(i - 1).getLearningTimeStudied());
+                            cell.setCellValue(list.get(i - 1).getLearningTimeStudied() + " min");
                             break;
                         case 5:
                             Date learningDeadline = list.get(i - 1).getLearningDeadline();
                             cell.setCellValue(learningDeadline != null ? new SimpleDateFormat("yyyy-MM-dd").format(learningDeadline) : "");
                             break;
                         case 6:
-                            cell.setCellValue(list.get(i - 1).getLearningProgress());
+                            cell.setCellValue(list.get(i - 1).getLearningProgress() + "%");
                             break;
                         case 7:
+                            Date completeTime = list.get(i - 1).getCompleteTime();
+                            cell.setCellValue(completeTime != null ? new SimpleDateFormat("yyyy-MM-dd").format(completeTime) : "");
+                            break;
+                        case 8:
                             String isSigned = list.get(i - 1).getIsSigned();
                             if (isSigned.equals("1")) {
                                 SysUser user = userService.selectUserById(list.get(i - 1).getUserId());
@@ -250,6 +262,10 @@ public class TBranchLearningController extends BaseController
                                     ExcelUtils.insertPicture(workbook, sheet, signUrl, i, 7, 1, 1);
                             }
                             break;
+                        case 9:
+                            Date signTime = list.get(i - 1).getSignTime();
+                            cell.setCellValue(signTime != null ? new SimpleDateFormat("yyyy-MM-dd").format(signTime) : "");
+                            break;
                     }
                 }
             }

+ 24 - 0
ruoyi-system/src/main/java/com/ruoyi/branch/domain/TBranchLearning.java

@@ -66,6 +66,30 @@ public class TBranchLearning extends BaseEntity
     /** 是否签名 */
     private String isSigned;
 
+    /** 培训完成时间 */
+    @Excel(name = "培训完成时间", dateFormat = "yyyy-MM-dd")
+    private Date completeTime;
+
+    /** 签名时间 */
+    @Excel(name = "签名时间", dateFormat = "yyyy-MM-dd")
+    private Date signTime;
+
+    public Date getCompleteTime() {
+        return completeTime;
+    }
+
+    public void setCompleteTime(Date completeTime) {
+        this.completeTime = completeTime;
+    }
+
+    public Date getSignTime() {
+        return signTime;
+    }
+
+    public void setSignTime(Date signTime) {
+        this.signTime = signTime;
+    }
+
     public String getIsSigned() {
         return isSigned;
     }

+ 13 - 1
ruoyi-system/src/main/resources/mapper/branch/TBranchLearningMapper.xml

@@ -23,10 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="deptId"    column="dept_id"    />
         <result property="isSigned"    column="is_signed"    />
+        <result property="completeTime"    column="complete_time"    />
+        <result property="signTime"    column="sign_time"    />
     </resultMap>
 
     <sql id="selectTBranchLearningVo">
-        select u.learning_id, u.is_signed, u.user_id, u.file_id, u.learning_status, u.learning_time_required, u.learning_time_studied, u.learning_progress, u.learning_deadline, u.del_flag, u.create_by, u.create_time, u.update_by, u.update_time, u.dept_id,
+        select u.learning_id, u.is_signed, u.user_id, u.file_id, u.learning_status, u.learning_time_required,
+        u.learning_time_studied, u.learning_progress, u.learning_deadline, u.del_flag, u.create_by, u.create_time,
+        u.update_by, u.update_time, u.dept_id, u.complete_time, u.sign_time,
         us.nick_name,
         f.name as file_name, f.url as file_url
         from t_branch_learning u
@@ -48,6 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="learningDeadline != null  and learningDeadline != ''"> and u.learning_deadline = #{learningDeadline}</if>
             <if test="deptId != null "> and u.dept_id = #{deptId}</if>
             <if test="isSigned != null "> and u.is_signed = #{isSigned}</if>
+            <if test="completeTime != null "> and u.complete_time = #{completeTime}</if>
+            <if test="signTime != null "> and u.sign_time = #{signTime}</if>
             and u.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -82,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="isSigned != null">is_signed,</if>
+            <if test="completeTime != null">complete_time,</if>
+            <if test="signTime != null">sign_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="learningId != null">#{learningId},</if>
@@ -99,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="isSigned != null">#{isSigned},</if>
+            <if test="completeTime != null">#{completeTime},</if>
+            <if test="signTime != null">#{signTime},</if>
          </trim>
     </insert>
 
@@ -119,6 +129,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="isSigned != null">is_signed = #{isSigned},</if>
+            <if test="completeTime != null">complete_time = #{completeTime},</if>
+            <if test="signTime != null">sign_time = #{signTime},</if>
         </trim>
         where learning_id = #{learningId}
     </update>

+ 17 - 3
ruoyi-ui/src/views/branch/xxyd/mystudy/index.vue

@@ -4,15 +4,19 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="课件名称" align="center" prop="fileName" />
       <el-table-column label="状态" align="center" prop="learningStatus" :formatter="learningStatusFormat" width="100" />
-      <el-table-column label="规定学习时长(min)" align="center" prop="learningTimeRequired" width="150" />
+      <el-table-column label="规定学习时长(min)" align="center" prop="learningTimeRequired" width="150">
+        <template slot-scope="scope">
+          {{ scope.row.learningTimeRequired == null ? "-" : scope.row.learningTimeRequired }} min
+        </template>
+      </el-table-column>
       <el-table-column label="累计学习时长(min)" align="center" prop="learningTimeStudied" width="150">
         <template slot-scope="scope">
-          {{ scope.row.learningTimeStudied == null ? "-" : scope.row.learningTimeStudied }}
+          {{ scope.row.learningTimeStudied == null ? "-" : scope.row.learningTimeStudied }} min
         </template>
       </el-table-column>
       <el-table-column label="进度(%)" align="center" prop="learningProgress" width="100">
         <template slot-scope="scope">
-          {{ scope.row.learningProgress == null ? "-" : scope.row.learningProgress }}
+          {{ scope.row.learningProgress == null ? "-" : scope.row.learningProgress }}%
         </template>
       </el-table-column>
       <el-table-column label="截止日期" align="center" prop="learningDeadline" width="100">
@@ -20,12 +24,22 @@
         <span>{{ parseTime(scope.row.learningDeadline, '{y}-{m}-{d}') }}</span>
       </template>
     </el-table-column>
+      <el-table-column label="培训完成时间" align="center" prop="completeTime" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.completeTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="是否签名" align="center" prop="isSigned" width="80">
         <template slot-scope="scope">
           <el-tag type="success" v-if="scope.row.isSigned == 1">已签名</el-tag>
           <el-tag type="info" v-if="scope.row.isSigned == 0">未签名</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="签名时间" align="center" prop="signTime" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.signTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
       <!--<el-table-column label="部门id" align="center" prop="deptId" />-->
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">

+ 13 - 3
ruoyi-ui/src/views/branch/xxyd/studyplan/index.vue

@@ -69,17 +69,22 @@
         <el-table-column label="规定学习时长(min)" width="150" align="center" prop="learningTimeRequired">
           <template slot-scope="scope">
             <span v-if="!scope.row.isEdit">{{scope.row.learningTimeRequired}}</span>
-            <span v-if="scope.row.isEdit"><el-input v-model="scope.row.learningTimeRequired"/></span>
+            <span v-if="scope.row.isEdit"><el-input v-model="scope.row.learningTimeRequired"/></span> min
           </template>
         </el-table-column>
         <el-table-column label="累计学习时长(min)" width="150" align="center" prop="learningTimeStudied">
           <template slot-scope="scope">
-            {{ scope.row.learningTimeStudied == null ? "-" : scope.row.learningTimeStudied }}
+            {{ scope.row.learningTimeStudied == null ? "-" : scope.row.learningTimeStudied }} min
+          </template>
+        </el-table-column>
+        <el-table-column label="培训完成时间" align="center" prop="completeTime" width="100">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.completeTime, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
         <el-table-column label="进度(%)" align="center" prop="learningProgress">
           <template slot-scope="scope">
-            {{ scope.row.learningProgress == null ? "-" : scope.row.learningProgress }}
+            {{ scope.row.learningProgress == null ? "-" : scope.row.learningProgress }}%
           </template>
         </el-table-column>
         <el-table-column label="截止日期" align="center" prop="learningDeadline" width="160">
@@ -103,6 +108,11 @@
             <el-tag type="info" v-if="scope.row.isSigned == 0">未签名</el-tag>
           </template>
         </el-table-column>
+        <el-table-column label="签名时间" align="center" prop="signTime" width="100">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.signTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button