Procházet zdrojové kódy

首页 - 添加学习计划未开始或未完成提醒

Wang Zi Wen před 1 rokem
rodič
revize
3235def86a

+ 19 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java

@@ -4,8 +4,10 @@ import java.util.Calendar;
 import java.util.List;
 
 import com.ruoyi.branch.domain.TBranchActivityNotice;
+import com.ruoyi.branch.domain.TBranchLearning;
 import com.ruoyi.branch.domain.TBranchPlanItem;
 import com.ruoyi.branch.service.ITBranchActivityNoticeService;
+import com.ruoyi.branch.service.ITBranchLearningService;
 import com.ruoyi.branch.service.ITBranchPlanItemService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -44,6 +46,9 @@ public class SysNoticeController extends BaseController
     @Autowired
     private ITBranchActivityNoticeService activityNoticeService;
 
+    @Autowired
+    private ITBranchLearningService learningService;
+
     /**
      * 获取通知公告列表(不分页)
      */
@@ -81,6 +86,20 @@ public class SysNoticeController extends BaseController
             }
         }
 
+        // 学习计划(未开始或未完成)
+        if (getUserId() != null) {
+            List<TBranchLearning> tBranchLearnings = learningService.selectTBranchLearningList(new TBranchLearning());
+            for (TBranchLearning tBranchLearning : tBranchLearnings) {
+                if (getUserId().equals(tBranchLearning.getUserId()) // 当前登录用户 && !已完成
+                        && !tBranchLearning.getLearningStatus().equals("2")) {
+                    SysNotice sysNotice = new SysNotice();
+                    sysNotice.setReleaseTime(tBranchLearning.getLearningDeadline());
+                    sysNotice.setNoticeTitle("学习:" + tBranchLearning.getFileName());
+                    sysNotices.add(sysNotice);
+                }
+            }
+        }
+
         return AjaxResult.success(sysNotices);
     }
 

+ 1 - 0
ruoyi-ui/src/views/branch/xxyd/mystudy/index.vue

@@ -30,6 +30,7 @@
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-if="scope.row.learningStatus != 2"
             size="mini"
             type="text"
             @click="handleStudy(scope.row)"

+ 1 - 1
ruoyi-ui/src/views/index.vue

@@ -39,7 +39,7 @@
           <div class="logo">
             <img src="../assets/logo/logo.png" alt="logo" />
           </div>
-          公示公告、工作提醒、活动预告
+          公示公告、工作提醒、活动预告、学习提醒
         </div>
         <notice-chart />
       </el-col>