qfrjava
2025-04-18 e6569847e43bc666e53d5373d9bbe9a4410e4ba1
refactor(SMTAIServer): 重新启用定时任务并优化状态更新逻辑

- 重新启用 checkForTicketStatusChanges.java 中的定时任务
- 在 SMTJavaAIControl.java 中将状态更新前的值从 String 改为 Integer
已修改2个文件
7 ■■■■■ 文件已修改
JAVA/SMTAIServer/src/main/java/com/smtaiserver/smtaiserver/control/SMTJavaAIControl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
JAVA/SMTAIServer/src/main/java/com/smtaiserver/smtaiserver/scheduledTasks/checkForTicketStatusChanges.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JAVA/SMTAIServer/src/main/java/com/smtaiserver/smtaiserver/control/SMTJavaAIControl.java
@@ -397,7 +397,7 @@
    SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
    try {
        DBRecords dbRecords = db.querySQL("select * from work_order_list where order_id = ?", new Object[]{id});
        String statusBeforeModification = dbRecords.getRecords().get(0).getString("stepstatus");
        Integer statusBeforeModification = dbRecords.getRecords().get(0).getInteger("stepstatus");
        db.executeSQL(
          "UPDATE work_order_list SET stepstatus = ? , status_update_time = ? , is_notify = 'N' WHERE order_id = ?",
          new Object[] {stepstatus,  new Date(),id});
JAVA/SMTAIServer/src/main/java/com/smtaiserver/smtaiserver/scheduledTasks/checkForTicketStatusChanges.java
@@ -11,6 +11,7 @@
import lombok.extern.log4j.Log4j2;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
@@ -30,7 +31,7 @@
   *
   * @throws Exception
   */
  //  @Scheduled(cron = "0/10 * * * * ?")
    @Scheduled(cron = "0/10 * * * * ?")
  public void execCheckForTicketStatusChangesByOrdersTaken() throws Exception {
    _logger.info("start checkForTicketStatusChanges task");
    SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
@@ -74,7 +75,7 @@
   *
   * @throws Exception
   */
  //  @Scheduled(cron = "0/10 * * * * ?")
    @Scheduled(cron = "0/10 * * * * ?")
  public void execCheckForTicketStatusChangesByFinish() throws Exception {
    _logger.info("start checkForTicketStatusChanges task");
    SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();