From 151ba81e92c3c60888cbc04b1a4f3276b8111ac6 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 05 七月 2025 09:03:09 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/task/NotifyScheduler.java |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/NotifyScheduler.java b/src/main/java/com/zy/asrs/task/NotifyScheduler.java
index 0c786e3..675e9ce 100644
--- a/src/main/java/com/zy/asrs/task/NotifyScheduler.java
+++ b/src/main/java/com/zy/asrs/task/NotifyScheduler.java
@@ -18,6 +18,7 @@
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
 import java.util.List;
 
 @Component
@@ -45,6 +46,11 @@
         for (ForkLiftSlave slave : slaveProperties.getForkLift()) {
             notifyMsg(String.valueOf(SlaveType.ForkLift), slave.getId());
         }
+    }
+
+    @Scheduled(cron = "0/3 * * * * ? ")
+    public synchronized void notifyTask(){
+        notifyMsg("task", 1);
     }
 
     private synchronized void notifyMsg(String notifyType, Integer device) {
@@ -89,6 +95,11 @@
                 continue;
             }
 
+//            HttpRequestLog httpRequestLog = new HttpRequestLog();
+//            httpRequestLog.setName(notifyUri + notifyUriPath);
+//            httpRequestLog.setRequest(JSON.toJSONString(notifyDto));
+//            httpRequestLog.setCreateTime(new Date());
+
             try {
                 //瑙﹀彂閫氱煡
                 String response = new HttpHandler.Builder()
@@ -97,15 +108,21 @@
                         .setJson(JSON.toJSONString(notifyDto))
                         .build()
                         .doPost();
+//                httpRequestLog.setResponse(response);
+
                 JSONObject jsonObject = JSON.parseObject(response);
                 Integer code = jsonObject.getInteger("code");
                 if(code == 200){
                     //閫氱煡鎴愬姛
                     redisUtil.del(key);
+
                     continue;
                 }
             }catch (Exception e){
                 e.printStackTrace();
+            }finally {
+                //淇濆瓨璁板綍
+//                httpRequestLogService.insert(httpRequestLog);
             }
 
             //閫氱煡澶辫触

--
Gitblit v1.9.1