Quellcode durchsuchen

2441 减员查询模块没有减员记录,需增加减员记录。人员备注不回填任何信息(安迪说这个解决了,需要再确认下)

andy.wu vor 11 Monaten
Ursprung
Commit
da6fbba0b8

+ 2 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMessageController.java

@@ -93,8 +93,9 @@ public class SysMessageController {
     @ResponseBody
     public String push(){
         try {
+            long current = System.currentTimeMillis();
             List<Message> messageList = messageService.pushMsg();
-            List<Message> messages = messageList.stream().filter(message -> "0".equals(message.getTypeFlag())).collect(Collectors.toList());
+            List<Message> messages = messageList.stream().filter(message -> "0".equals(message.getTypeFlag()) && current>=message.getMessageExecutionTime().getTime()).collect(Collectors.toList());
             if (messages.size()>0){
                 Message message = messages.get(0);
                 Date messageEndTime = message.getMessageEndTime();

+ 8 - 8
ruoyi-admin/src/main/resources/templates/index.html

@@ -787,14 +787,14 @@
 
 
     // 实时刷新走马灯
-    // window.setInterval(function (){
-    //     var item = window.localStorage.getItem("message");
-    //     if (!$.common.isEmpty(item)){
-    //         $("marquee").text(item);
-    //     }else {
-    //         $("marquee").text('');
-    //     }
-    // },1000);
+    window.setInterval(function (){
+        var item = JSON.parse(window.localStorage.getItem("messageStr"))
+        if (!$.common.isEmpty(item)){
+            $("marquee").text(item[0].messageContent);
+        }else {
+            $("marquee").text('');
+        }
+    },5000);
     //
     // // 关闭走马灯的播放
     // function pauseNotice(){

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MessageServiceImpl.java

@@ -58,7 +58,7 @@ public class MessageServiceImpl implements MessageService{
     public List<Message> pushMsg(){
         Object[] array =  redisCache.getZSet("messages").stream().toArray();
         List<Object> messages = Arrays.asList(array);
-        long currentTimeMillis = System.currentTimeMillis();
+//        long currentTimeMillis = System.currentTimeMillis();
         List<Message> messageList=new ArrayList<>();
         messages.forEach(message -> {
             String str = message.toString();