From a22241b357b2e8841514632385dd26302d53b947 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期五, 23 五月 2025 09:55:31 +0800
Subject: [PATCH] 接口文档更新
---
src/main/java/com/zy/asrs/task/TaskLogScheduler.java | 50 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/zy/asrs/task/TaskLogScheduler.java b/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
index 27bac8f..cf1083a 100644
--- a/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
+++ b/src/main/java/com/zy/asrs/task/TaskLogScheduler.java
@@ -1,15 +1,19 @@
package com.zy.asrs.task;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.zy.asrs.entity.CommandInfo;
+import com.core.exception.CoolException;
import com.zy.asrs.entity.TaskWrk;
-import com.zy.asrs.entity.WaitPakin;
-import com.zy.asrs.service.CommandInfoService;
+import com.zy.asrs.entity.TaskWrkLog;
+import com.zy.asrs.entity.TaskWrkReport;
+import com.zy.asrs.service.TaskWrkReportService;
import com.zy.asrs.service.TaskWrkService;
+import com.zy.asrs.service.impl.TaskWrkLogServiceImpl;
+import com.zy.common.utils.Synchro;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
+
+import java.io.IOException;
/**
* 瀹氭椂灏嗕换鍔�(瀹屾垚銆佸彇娑�)杞垚鏃ュ織
@@ -20,20 +24,36 @@
@Autowired
private TaskWrkService taskWrkService;
+
@Autowired
- private CommandInfoService commandInfoService;
+ private TaskWrkLogServiceImpl wrkLogService;
- @Scheduled(cron = "0/3 * * * * ? ")
- public void execute() {
+
+ @Autowired
+ private TaskWrkReportService taskWrkReportService;
+
+
+ @Scheduled(cron = "0/5 * * * * ? ")
+ public synchronized void execute() throws IOException {
for (TaskWrk taskWrk : taskWrkService.selectToBeHistoryData()) {
- if (taskWrkService.saveToHistory(taskWrk.getTaskNo()) > 0) {
- //浠诲姟宸茬粡杞棩蹇楋紝灏嗚浠诲姟涓嬮潰鐨勬寚浠よ浆鏃ュ織
- commandInfoService.saveToHistory(taskWrk.getTaskNo());
-
- //鍒犻櫎浠诲姟
- taskWrkService.delete(new EntityWrapper<TaskWrk>().eq("task_no", taskWrk.getTaskNo()));
- //鍒犻櫎鎸囦护
- commandInfoService.delete(new EntityWrapper<CommandInfo>().eq("task_no", taskWrk.getTaskNo()));
+ switch (taskWrk.getStatus()) {
+ case 4:
+ break;
+ case 5:
+ break;
+ }
+ TaskWrkReport taskWrkReport = new TaskWrkReport();
+ TaskWrkLog taskWrkLog = new TaskWrkLog();
+ Synchro.Copy(taskWrk, taskWrkReport);
+ Synchro.Copy(taskWrk, taskWrkLog);
+ if (!taskWrkReportService.insert(taskWrkReport)) {
+ throw new CoolException("杞Щ鑷充笂鎶ヨ〃" + taskWrk);
+ }
+ if (!wrkLogService.insert(taskWrkLog)) {
+ throw new CoolException("杞巻鍙叉。澶辫触" + taskWrk);
+ }
+ if (!taskWrkService.deleteById(taskWrk)) {
+ throw new CoolException("浠诲姟妗e垹闄ゅけ璐�" + taskWrk);
}
}
}
--
Gitblit v1.9.1