zhizhijie
2026-10-20 b61e35eb8675a3716585d90a571fc2b0183b6a58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.trafficaudit.energy.service;
 
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/** 启动时确保 H204 单耗阈值表存在并有种子数据(幂等) */
@Component
@Order(120)
public class EnergyThresholdInitializer implements ApplicationRunner {
 
    @Resource
    private EnergyThresholdService thresholdService;
 
    @Override
    public void run(ApplicationArguments args) {
        thresholdService.seedIfNeeded();
    }
}