Browse Source

feat: 实现河北价值管理平台省内车辆费用月数据入库定时任务、河北价值管理平台北十车辆费用月数据入库定时任务

weijianghai 1 year ago
parent
commit
5e2eb9d00e

+ 20 - 0
readme.md

@@ -142,6 +142,26 @@ curl --location 'http://localhost:39110/jobs/runJob' \
 }'
 ```
 
+##### 河北价值管理平台省内车辆费用月数据入库定时任务
+
+```shell
+curl --location 'http://localhost:39110/jobs/runJob' \
+--header 'Content-Type: application/json' \
+--data '{
+    "jobName": "CAR_FEE_HB_JOB"
+}'
+```
+
+##### 河北价值管理平台北十车辆费用月数据入库定时任务
+
+```shell
+curl --location 'http://localhost:39110/jobs/runJob' \
+--header 'Content-Type: application/json' \
+--data '{
+    "jobName": "CAR_FEE_BS_JOB"
+}'
+```
+
 ##### 河北成本管理系统自有类房产维修数据入库定时任务
 
 ```shell

+ 16 - 0
src/main/java/com/nokia/finance/tasks/config/JobConfig.java

@@ -136,6 +136,22 @@ public class JobConfig {
      * 河北成本管理系统车辆其他费用数据归档路径
      */
     private String carQiTaHistoryPath;
+    /**
+     * 河北价值管理平台省内车辆费用月数据路径
+     */
+    private String carFeeHbSourcePath;
+    /**
+     * 河北价值管理平台省内车辆费用月数据归档路径
+     */
+    private String carFeeHbHistoryPath;
+    /**
+     * 河北价值管理平台北十车辆费用月数据路径
+     */
+    private String carFeeBsSourcePath;
+    /**
+     * 河北价值管理平台北十车辆费用月数据归档路径
+     */
+    private String carFeeBsHistoryPath;
     /**
      * 河北成本管理系统自有类房产维修数据路径
      */

+ 8 - 0
src/main/java/com/nokia/finance/tasks/enums/JobEnum.java

@@ -53,6 +53,14 @@ public enum JobEnum {
      * 河北成本管理系统车辆其他费用数据入库定时任务
      */
     CAR_QI_TA_JOB,
+    /**
+     * 河北价值管理平台省内车辆费用月数据入库定时任务
+     */
+    CAR_FEE_HB_JOB,
+    /**
+     * 河北价值管理平台北十车辆费用月数据入库定时任务
+     */
+    CAR_FEE_BS_JOB,
     /**
      * 河北成本管理系统自有类房产维修数据入库定时任务
      */

+ 182 - 0
src/main/java/com/nokia/finance/tasks/jobs/car/shujucangku/CarFeeBsJob.java

@@ -0,0 +1,182 @@
+package com.nokia.finance.tasks.jobs.car.shujucangku;
+
+import com.nokia.finance.tasks.common.exception.MyRuntimeException;
+import com.nokia.finance.tasks.common.utils.psql.PsqlUtil;
+import com.nokia.finance.tasks.config.JobConfig;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.commons.csv.CSVRecord;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+/**
+ * 河北价值管理平台北十车辆费用月数据入库定时任务
+ */
+@Slf4j
+@Service
+public class CarFeeBsJob {
+    private final JobConfig jobConfig;
+
+    public CarFeeBsJob(JobConfig jobConfig) {
+        this.jobConfig = jobConfig;
+    }
+
+    /**
+     * 执行任务
+     */
+    @Scheduled(cron = "0 28 6 12 * ?")
+    public void runJob() {
+        // 数据目录
+        Path dir = Paths.get(jobConfig.getCarFeeBsSourcePath());
+        try (Stream<Path> stream = Files.list(dir)) {
+            // 获取数据目录下的文件列表
+            List<Path> pathList = stream.filter(t -> !t.toString().endsWith(".MD5")).sorted().toList();
+            log.info("河北价值管理平台北十车辆费用月数据文件列表: {}", pathList);
+            if (CollectionUtils.isEmpty(pathList)) {
+                throw new MyRuntimeException("河北价值管理平台北十车辆费用月数据没有文件");
+            }
+            for (Path path : pathList) {
+                CompletableFuture.runAsync(() -> {
+                    try {
+                        singleJob(path);
+                    } catch (Exception e) {
+                        throw new MyRuntimeException(e);
+                    }
+                }).get(1, TimeUnit.MINUTES);
+            }
+        } catch (InterruptedException e) {
+            log.error("线程中断: {}", e.getMessage(), e);
+            Thread.currentThread().interrupt();
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 处理单个文件
+     *
+     * @param path 文件路径
+     */
+    public void singleJob(Path path) throws Exception {
+        List<Map<String, String>> list = readFile(path);
+        List<Map<String, String>> distinctList = dataProcessing(path, list);
+        Path csvPath = toCsv(path, distinctList);
+        copyCsv(csvPath);
+        move(path);
+    }
+
+    /**
+     * 读取文件
+     *
+     * @param path 文件路径
+     */
+    public List<Map<String, String>> readFile(Path path) throws Exception {
+        log.info("读取: {}", path);
+        List<String> headers = Stream.of("month_id", "area_no", "area_name", "kpi_id", "kpi_name", "tm_value",
+                "lm_value", "ty_value", "ly_value").toList();
+        int headerSize = headers.size();
+        char delimiter = 1;
+        try (CSVParser parser = CSVFormat.DEFAULT.builder().setDelimiter(delimiter).build()
+                .parse(new InputStreamReader(Files.newInputStream(path), StandardCharsets.UTF_8))
+        ) {
+            List<Map<String, String>> resultList = new ArrayList<>();
+            for (CSVRecord csvRecord : parser) {
+                Map<String, String> rowMap = new LinkedHashMap<>();
+                for (int i = 0; i < headerSize; i++) {
+                    String header = headers.get(i);
+                    String value = csvRecord.get(i);
+                    // 删除空白字符
+                    value = StringUtils.trimAllWhitespace(value);
+                    rowMap.put(header, value);
+                }
+                resultList.add(rowMap);
+            }
+            return resultList;
+        }
+    }
+
+    /**
+     * 数据加工
+     *
+     * @param path 文件路径
+     * @param list 数据
+     */
+    public List<Map<String, String>> dataProcessing(Path path, List<Map<String, String>> list) {
+        for (Map<String, String> map : list) {
+            map.put("source", path.getFileName().toString());
+        }
+        return list;
+    }
+
+    /**
+     * 生成csv
+     *
+     * @param path 源文件路径
+     * @param list 数据
+     */
+    public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
+        log.info("条数:{}", list.size());
+        Files.createDirectories(Paths.get(jobConfig.getCarFeeBsHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarFeeBsHistoryPath() + path.getFileName() + ".csv");
+        try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
+                StandardCharsets.UTF_8);
+             CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
+            // 添加bom头避免excel乱码
+            osw.write('\ufeff');
+            Map<String, String> header = list.get(0);
+            // 表头
+            printer.printRecord(header.keySet());
+            for (Map<String, String> map : list) {
+                printer.printRecord(map.values());
+            }
+        }
+        return csvPath;
+    }
+
+    /**
+     * 导入数据库
+     *
+     * @param path 文件路径
+     */
+    public void copyCsv(Path path) {
+        String dbTable = "car.car_fee_bs";
+        String csv = path.toString();
+        String columns = "(month_id,area_no,area_name,kpi_id,kpi_name,tm_value,lm_value,ty_value,ly_value,source)";
+        Long timeout = 60000L;
+        PsqlUtil.copyCsv(jobConfig.getCopyScriptPath(), jobConfig.getDbHost(), jobConfig.getDbPort(),
+                jobConfig.getDbUsername(), jobConfig.getDbPassword(), jobConfig.getDbName(), dbTable, csv, columns,
+                timeout, null);
+    }
+
+    /**
+     * 移动源文件到历史文件夹
+     *
+     * @param path 源文件路径
+     */
+    public void move(Path path) throws Exception {
+        Files.move(Paths.get(path + ".MD5"),
+                Paths.get(jobConfig.getCarFeeBsHistoryPath(), path.getFileName().toString() + ".MD5"),
+                StandardCopyOption.REPLACE_EXISTING);
+        Files.move(path, Paths.get(jobConfig.getCarFeeBsHistoryPath(), path.getFileName().toString()),
+                StandardCopyOption.REPLACE_EXISTING);
+    }
+}

+ 182 - 0
src/main/java/com/nokia/finance/tasks/jobs/car/shujucangku/CarFeeHbJob.java

@@ -0,0 +1,182 @@
+package com.nokia.finance.tasks.jobs.car.shujucangku;
+
+import com.nokia.finance.tasks.common.exception.MyRuntimeException;
+import com.nokia.finance.tasks.common.utils.psql.PsqlUtil;
+import com.nokia.finance.tasks.config.JobConfig;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.commons.csv.CSVRecord;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+/**
+ * 河北价值管理平台省内车辆费用月数据入库定时任务
+ */
+@Slf4j
+@Service
+public class CarFeeHbJob {
+    private final JobConfig jobConfig;
+
+    public CarFeeHbJob(JobConfig jobConfig) {
+        this.jobConfig = jobConfig;
+    }
+
+    /**
+     * 执行任务
+     */
+    @Scheduled(cron = "0 26 6 12 * ?")
+    public void runJob() {
+        // 数据目录
+        Path dir = Paths.get(jobConfig.getCarFeeHbSourcePath());
+        try (Stream<Path> stream = Files.list(dir)) {
+            // 获取数据目录下的文件列表
+            List<Path> pathList = stream.filter(t -> !t.toString().endsWith(".MD5")).sorted().toList();
+            log.info("河北价值管理平台省内车辆费用月数据文件列表: {}", pathList);
+            if (CollectionUtils.isEmpty(pathList)) {
+                throw new MyRuntimeException("河北价值管理平台省内车辆费用月数据没有文件");
+            }
+            for (Path path : pathList) {
+                CompletableFuture.runAsync(() -> {
+                    try {
+                        singleJob(path);
+                    } catch (Exception e) {
+                        throw new MyRuntimeException(e);
+                    }
+                }).get(1, TimeUnit.MINUTES);
+            }
+        } catch (InterruptedException e) {
+            log.error("线程中断: {}", e.getMessage(), e);
+            Thread.currentThread().interrupt();
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 处理单个文件
+     *
+     * @param path 文件路径
+     */
+    public void singleJob(Path path) throws Exception {
+        List<Map<String, String>> list = readFile(path);
+        List<Map<String, String>> distinctList = dataProcessing(path, list);
+        Path csvPath = toCsv(path, distinctList);
+        copyCsv(csvPath);
+        move(path);
+    }
+
+    /**
+     * 读取文件
+     *
+     * @param path 文件路径
+     */
+    public List<Map<String, String>> readFile(Path path) throws Exception {
+        log.info("读取: {}", path);
+        List<String> headers = Stream.of("month_id", "area_no", "area_name", "kpi_id", "kpi_name", "tm_value",
+                "lm_value", "ty_value", "ly_value").toList();
+        int headerSize = headers.size();
+        char delimiter = 1;
+        try (CSVParser parser = CSVFormat.DEFAULT.builder().setDelimiter(delimiter).build()
+                .parse(new InputStreamReader(Files.newInputStream(path), StandardCharsets.UTF_8))
+        ) {
+            List<Map<String, String>> resultList = new ArrayList<>();
+            for (CSVRecord csvRecord : parser) {
+                Map<String, String> rowMap = new LinkedHashMap<>();
+                for (int i = 0; i < headerSize; i++) {
+                    String header = headers.get(i);
+                    String value = csvRecord.get(i);
+                    // 删除空白字符
+                    value = StringUtils.trimAllWhitespace(value);
+                    rowMap.put(header, value);
+                }
+                resultList.add(rowMap);
+            }
+            return resultList;
+        }
+    }
+
+    /**
+     * 数据加工
+     *
+     * @param path 文件路径
+     * @param list 数据
+     */
+    public List<Map<String, String>> dataProcessing(Path path, List<Map<String, String>> list) {
+        for (Map<String, String> map : list) {
+            map.put("source", path.getFileName().toString());
+        }
+        return list;
+    }
+
+    /**
+     * 生成csv
+     *
+     * @param path 源文件路径
+     * @param list 数据
+     */
+    public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
+        log.info("条数:{}", list.size());
+        Files.createDirectories(Paths.get(jobConfig.getCarFeeHbHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarFeeHbHistoryPath() + path.getFileName() + ".csv");
+        try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
+                StandardCharsets.UTF_8);
+             CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
+            // 添加bom头避免excel乱码
+            osw.write('\ufeff');
+            Map<String, String> header = list.get(0);
+            // 表头
+            printer.printRecord(header.keySet());
+            for (Map<String, String> map : list) {
+                printer.printRecord(map.values());
+            }
+        }
+        return csvPath;
+    }
+
+    /**
+     * 导入数据库
+     *
+     * @param path 文件路径
+     */
+    public void copyCsv(Path path) {
+        String dbTable = "car.car_fee_hb";
+        String csv = path.toString();
+        String columns = "(month_id,area_no,area_name,kpi_id,kpi_name,tm_value,lm_value,ty_value,ly_value,source)";
+        Long timeout = 60000L;
+        PsqlUtil.copyCsv(jobConfig.getCopyScriptPath(), jobConfig.getDbHost(), jobConfig.getDbPort(),
+                jobConfig.getDbUsername(), jobConfig.getDbPassword(), jobConfig.getDbName(), dbTable, csv, columns,
+                timeout, null);
+    }
+
+    /**
+     * 移动源文件到历史文件夹
+     *
+     * @param path 源文件路径
+     */
+    public void move(Path path) throws Exception {
+        Files.move(Paths.get(path + ".MD5"),
+                Paths.get(jobConfig.getCarFeeHbHistoryPath(), path.getFileName().toString() + ".MD5"),
+                StandardCopyOption.REPLACE_EXISTING);
+        Files.move(path, Paths.get(jobConfig.getCarFeeHbHistoryPath(), path.getFileName().toString()),
+                StandardCopyOption.REPLACE_EXISTING);
+    }
+}

+ 10 - 4
src/main/java/com/nokia/finance/tasks/service/JobService.java

@@ -14,6 +14,7 @@ import com.nokia.finance.tasks.jobs.car.ruixing.CarLiChengMonthJob;
 import com.nokia.finance.tasks.jobs.car.ruixing.CarWuDanYongCheJob;
 import com.nokia.finance.tasks.jobs.car.ruixing.CarYongCheJob;
 import com.nokia.finance.tasks.jobs.car.ruixing.CarYueJieJob;
+import com.nokia.finance.tasks.jobs.car.shujucangku.CarFeeHbJob;
 import com.nokia.finance.tasks.jobs.house.chengben.HouseBuildingRepairMonthJob;
 import com.nokia.finance.tasks.pojo.RunJobDto;
 import org.springframework.stereotype.Service;
@@ -33,14 +34,15 @@ public class JobService {
     private final CarBaoXianJob carBaoXianJob;
     private final CarNianJianFeiJob carNianJianFeiJob;
     private final CarQiTaJob carQiTaJob;
+    private final CarFeeHbJob carFeeHbJob;
     private final HouseBuildingRepairMonthJob houseBuildingRepairMonthJob;
 
     public JobService(CarBaseDataDayJob carBaseDataDayJob, CarYueJieJob carYueJieJob, CarBaoFeiJob carBaoFeiJob,
                       CarLiChengMonthJob carLiChengMonthJob, CarWuDanYongCheJob carWuDanYongCheJob,
-                      CarYongCheJob carYongCheJob,
-                      CarRanYouJob carRanYouJob, CarDaWeiXiuJob carDaWeiXiuJob, CarWeiXiuJob carWeiXiuJob,
-                      CarLuQiaoJob carLuQiaoJob, CarBaoXianJob carBaoXianJob, CarNianJianFeiJob carNianJianFeiJob,
-                      CarQiTaJob carQiTaJob, HouseBuildingRepairMonthJob houseBuildingRepairMonthJob) {
+                      CarYongCheJob carYongCheJob, CarRanYouJob carRanYouJob, CarDaWeiXiuJob carDaWeiXiuJob,
+                      CarWeiXiuJob carWeiXiuJob, CarLuQiaoJob carLuQiaoJob, CarBaoXianJob carBaoXianJob,
+                      CarNianJianFeiJob carNianJianFeiJob, CarQiTaJob carQiTaJob, CarFeeHbJob carFeeHbJob,
+                      HouseBuildingRepairMonthJob houseBuildingRepairMonthJob) {
         this.carBaseDataDayJob = carBaseDataDayJob;
         this.carYueJieJob = carYueJieJob;
         this.carBaoFeiJob = carBaoFeiJob;
@@ -54,6 +56,7 @@ public class JobService {
         this.carBaoXianJob = carBaoXianJob;
         this.carNianJianFeiJob = carNianJianFeiJob;
         this.carQiTaJob = carQiTaJob;
+        this.carFeeHbJob = carFeeHbJob;
         this.houseBuildingRepairMonthJob = houseBuildingRepairMonthJob;
     }
 
@@ -98,6 +101,9 @@ public class JobService {
             case CAR_QI_TA_JOB:
                 carQiTaJob.runJob();
                 break;
+            case CAR_FEE_HB_JOB:
+                carFeeHbJob.runJob();
+                break;
             case HOUSE_BUILDING_REPAIR_MONTH_JOB:
                 houseBuildingRepairMonthJob.runJob();
                 break;

+ 8 - 0
src/main/resources/application-dev.yml

@@ -71,6 +71,14 @@ job:
     car-qi-ta-source-path: data/jzftp/HE_M_MTC_VEHICLE_OTHER/
     # 河北成本管理系统车辆其他费用数据归档路径
     car-qi-ta-history-path: data/history/jzftp/HE_M_MTC_VEHICLE_OTHER/
+    # 河北价值管理平台省内车辆费用月数据路径
+    car-fee-hb-source-path: data/dsjftp/hebei_province/
+    # 河北价值管理平台省内车辆费用月数据归档路径
+    car-fee-hb-history-path: data/history/dsjftp/hebei_province/
+    # 河北价值管理平台北十车辆费用月数据路径
+    car-fee-bs-source-path: data/dsjftp/ten_northern_provinces/
+    # 河北价值管理平台北十车辆费用月数据归档路径
+    car-fee-bs-history-path: data/history/dsjftp/ten_northern_provinces/
     # 河北成本管理系统自有类房产维修数据路径
     house-building-repair-month-source-path: data/jzftp/HE_M_MTC_HOUSE/
     # 河北成本管理系统自有类房产维修数据归档路径

+ 8 - 0
src/main/resources/application-prod.yml

@@ -71,6 +71,14 @@ job:
     car-qi-ta-source-path: /data/jzftp/HE_M_MTC_VEHICLE_OTHER/
     # 河北成本管理系统车辆其他费用数据归档路径
     car-qi-ta-history-path: /data/history/jzftp/HE_M_MTC_VEHICLE_OTHER/
+    # 河北价值管理平台省内车辆费用月数据路径
+    car-fee-hb-source-path: /data/dsjftp/hebei_province/
+    # 河北价值管理平台省内车辆费用月数据归档路径
+    car-fee-hb-history-path: /data/history/dsjftp/hebei_province/
+    # 河北价值管理平台北十车辆费用月数据路径
+    car-fee-bs-source-path: /data/dsjftp/ten_northern_provinces/
+    # 河北价值管理平台北十车辆费用月数据归档路径
+    car-fee-bs-history-path: /data/history/dsjftp/ten_northern_provinces/
     # 河北成本管理系统自有类房产维修数据路径
     house-building-repair-month-source-path: /data/jzftp/HE_M_MTC_HOUSE/
     # 河北成本管理系统自有类房产维修数据归档路径

+ 6 - 6
src/main/resources/logback-spring.xml

@@ -13,9 +13,9 @@
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
             <!-- rollover daily -->
             <fileNamePattern>${PATH}/trace.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
-            <maxFileSize>50MB</maxFileSize>
-            <maxHistory>60</maxHistory>
+            <!-- each file should be at most 100MB, keep 180 days worth of history, but at most 20GB -->
+            <maxFileSize>100MB</maxFileSize>
+            <maxHistory>180</maxHistory>
             <totalSizeCap>20GB</totalSizeCap>
         </rollingPolicy>
         <encoder>
@@ -28,9 +28,9 @@
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
             <!-- rollover daily -->
             <fileNamePattern>${PATH}/error.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
-            <maxFileSize>50MB</maxFileSize>
-            <maxHistory>60</maxHistory>
+            <!-- each file should be at most 100MB, keep 180 days worth of history, but at most 20GB -->
+            <maxFileSize>100MB</maxFileSize>
+            <maxHistory>180</maxHistory>
             <totalSizeCap>20GB</totalSizeCap>
         </rollingPolicy>
         <encoder>

+ 22 - 0
src/test/java/com/nokia/finance/tasks/car/shujucangku/CarFeeBsJobTests.java

@@ -0,0 +1,22 @@
+package com.nokia.finance.tasks.car.shujucangku;
+
+import com.nokia.finance.tasks.jobs.car.shujucangku.CarFeeBsJob;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+
+@Slf4j
+@SpringBootTest
+@ActiveProfiles("dev")
+class CarFeeBsJobTests {
+    @Autowired
+    CarFeeBsJob carFeeBsJob;
+
+    @Test
+    void runJobTest() {
+        carFeeBsJob.runJob();
+    }
+
+}

+ 22 - 0
src/test/java/com/nokia/finance/tasks/car/shujucangku/CarFeeHbJobTests.java

@@ -0,0 +1,22 @@
+package com.nokia.finance.tasks.car.shujucangku;
+
+import com.nokia.finance.tasks.jobs.car.shujucangku.CarFeeHbJob;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+
+@Slf4j
+@SpringBootTest
+@ActiveProfiles("dev")
+class CarFeeHbJobTests {
+    @Autowired
+    CarFeeHbJob carFeeHbJob;
+
+    @Test
+    void runJobTest() {
+        carFeeHbJob.runJob();
+    }
+
+}