1完成酸轧轧辊调整
2完成双机架工艺规格串联 3完成双机架计划串联 4完成双机架wip快捷录入检索 5完成双机架实绩串联
This commit is contained in:
33
klp-wms/src/main/java/com/klp/task/DrMigrationRunner.java
Normal file
33
klp-wms/src/main/java/com/klp/task/DrMigrationRunner.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.klp.task;
|
||||
|
||||
import com.klp.service.impl.DrMigrationService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 应用启动后自动执行双机架历史道次版本迁移。
|
||||
* 逻辑幂等:若已迁移完毕则无任何 DB 写操作,仅打印一条 info 日志。
|
||||
*/
|
||||
@Slf4j
|
||||
@Order(100)
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DrMigrationRunner implements ApplicationRunner {
|
||||
|
||||
private final DrMigrationService migrationService;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
log.info("[DR迁移] 开始检查历史道次版本迁移...");
|
||||
try {
|
||||
migrationService.migrateOrphanPassesToV1();
|
||||
} catch (Exception e) {
|
||||
// 迁移失败不阻断服务启动,只记录错误
|
||||
log.error("[DR迁移] 执行异常,请人工检查 mill_process_pass 表", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user