Browse Source

feat: 实现睿行车辆无单用车报警月统计数据入库定时任务

weijianghai 1 year ago
parent
commit
265c3f571a
25 changed files with 475 additions and 109 deletions
  1. 14 4
      readme.md
  2. 16 8
      src/main/java/com/nokia/finance/tasks/config/JobConfig.java
  3. 8 4
      src/main/java/com/nokia/finance/tasks/enums/JobEnum.java
  4. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarBaoXianJob.java
  5. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarDaWeiXiuJob.java
  6. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarLuQiaoJob.java
  7. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarNianJianFeiJob.java
  8. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarQiTaJob.java
  9. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarRanYouJob.java
  10. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarWeiXiuJob.java
  11. 8 8
      src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarBaoFeiJob.java
  12. 7 7
      src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarBaseDataDayJob.java
  13. 8 8
      src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarLiChengMonthJob.java
  14. 307 0
      src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarWuDanYongCheJob.java
  15. 7 7
      src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarYueJieJob.java
  16. 1 1
      src/main/java/com/nokia/finance/tasks/jobs/house/chengben/HouseBuildingRepairMonthJob.java
  17. 28 21
      src/main/java/com/nokia/finance/tasks/service/JobService.java
  18. 12 8
      src/main/resources/application-dev.yml
  19. 12 8
      src/main/resources/application-prod.yml
  20. 2 2
      src/main/resources/logback-spring.xml
  21. 4 4
      src/test/java/com/nokia/finance/tasks/car/ruixing/CarBaoFeiJobTests.java
  22. 4 4
      src/test/java/com/nokia/finance/tasks/car/ruixing/CarBaseDataDayJobTests.java
  23. 4 4
      src/test/java/com/nokia/finance/tasks/car/ruixing/CarLiChengMonthJobTests.java
  24. 22 0
      src/test/java/com/nokia/finance/tasks/car/ruixing/CarWuDanYongCheJobTests.java
  25. 4 4
      src/test/java/com/nokia/finance/tasks/car/ruixing/CarYueJieJobTests.java

+ 14 - 4
readme.md

@@ -16,7 +16,7 @@
 curl --location 'http://localhost:39110/jobs/runJob' \
 curl --location 'http://localhost:39110/jobs/runJob' \
 --header 'Content-Type: application/json' \
 --header 'Content-Type: application/json' \
 --data '{
 --data '{
-    "jobName": "CLJBXX_JOB"
+    "jobName": "CAR_BASE_DATA_DAY_JOB"
 }'
 }'
 ```
 ```
 
 
@@ -26,7 +26,7 @@ curl --location 'http://localhost:39110/jobs/runJob' \
 curl --location 'http://localhost:39110/jobs/runJob' \
 curl --location 'http://localhost:39110/jobs/runJob' \
 --header 'Content-Type: application/json' \
 --header 'Content-Type: application/json' \
 --data '{
 --data '{
-    "jobName": "YJBJRTJ_JOB"
+    "jobName": "CAR_YUE_JIE_JOB"
 }'
 }'
 ```
 ```
 
 
@@ -36,7 +36,7 @@ curl --location 'http://localhost:39110/jobs/runJob' \
 curl --location 'http://localhost:39110/jobs/runJob' \
 curl --location 'http://localhost:39110/jobs/runJob' \
 --header 'Content-Type: application/json' \
 --header 'Content-Type: application/json' \
 --data '{
 --data '{
-    "jobName": "CLBF_JOB"
+    "jobName": "CAR_BAO_FEI_JOB"
 }'
 }'
 ```
 ```
 
 
@@ -46,7 +46,17 @@ curl --location 'http://localhost:39110/jobs/runJob' \
 curl --location 'http://localhost:39110/jobs/runJob' \
 curl --location 'http://localhost:39110/jobs/runJob' \
 --header 'Content-Type: application/json' \
 --header 'Content-Type: application/json' \
 --data '{
 --data '{
-    "jobName": "XSLCYTJ_JOB"
+    "jobName": "CAR_LI_CHENG_MONTH_JOB"
+}'
+```
+
+##### 睿行车辆无单用车报警月统计数据入库定时任务
+
+```shell
+curl --location 'http://localhost:39110/jobs/runJob' \
+--header 'Content-Type: application/json' \
+--data '{
+    "jobName": "CAR_WU_DAN_YONG_CHE_JOB"
 }'
 }'
 ```
 ```
 
 

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

@@ -35,35 +35,43 @@ public class JobConfig {
     /**
     /**
      * 睿行车辆基本信息日数据路径
      * 睿行车辆基本信息日数据路径
      */
      */
-    private String cljbxxSourcePath;
+    private String carBaseDataDaySourcePath;
     /**
     /**
      * 睿行车辆基本信息日数据归档路径
      * 睿行车辆基本信息日数据归档路径
      */
      */
-    private String cljbxxHistoryPath;
+    private String carBaseDataDayHistoryPath;
     /**
     /**
      * 睿行车辆越界报警日数据路径
      * 睿行车辆越界报警日数据路径
      */
      */
-    private String yjbjrtjSourcePath;
+    private String carYueJieSourcePath;
     /**
     /**
      * 睿行车辆越界报警日数据归档路径
      * 睿行车辆越界报警日数据归档路径
      */
      */
-    private String yjbjrtjHistoryPath;
+    private String carYueJieHistoryPath;
     /**
     /**
      * 睿行车辆报废月数据路径
      * 睿行车辆报废月数据路径
      */
      */
-    private String clbfSourcePath;
+    private String carBaoFeiSourcePath;
     /**
     /**
      * 睿行车辆报废月数据归档路径
      * 睿行车辆报废月数据归档路径
      */
      */
-    private String clbfHistoryPath;
+    private String carBaoFeiHistoryPath;
     /**
     /**
      * 睿行车辆行驶里程月数据路径
      * 睿行车辆行驶里程月数据路径
      */
      */
-    private String xslcytjSourcePath;
+    private String carLiChengMonthSourcePath;
     /**
     /**
      * 睿行车辆行驶里程月数据归档路径
      * 睿行车辆行驶里程月数据归档路径
      */
      */
-    private String xslcytjHistoryPath;
+    private String carLiChengMonthHistoryPath;
+    /**
+     * 睿行车辆无单用车报警月统计数据路径
+     */
+    private String carWuDanYongCheSourcePath;
+    /**
+     * 睿行车辆无单用车报警月统计数据归档路径
+     */
+    private String carWuDanYongCheHistoryPath;
     /**
     /**
      * 河北成本管理系统车辆燃油数据路径
      * 河北成本管理系统车辆燃油数据路径
      */
      */

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

@@ -4,19 +4,23 @@ public enum JobEnum {
     /**
     /**
      * 睿行车辆基本信息日数据入库定时任务
      * 睿行车辆基本信息日数据入库定时任务
      */
      */
-    CLJBXX_JOB,
+    CAR_BASE_DATA_DAY_JOB,
     /**
     /**
      * 睿行车辆越界报警日数据入库定时任务
      * 睿行车辆越界报警日数据入库定时任务
      */
      */
-    YJBJRTJ_JOB,
+    CAR_YUE_JIE_JOB,
     /**
     /**
      * 睿行车辆报废月数据入库定时任务
      * 睿行车辆报废月数据入库定时任务
      */
      */
-    CLBF_JOB,
+    CAR_BAO_FEI_JOB,
     /**
     /**
      * 睿行车辆行驶里程月数据入库定时任务
      * 睿行车辆行驶里程月数据入库定时任务
      */
      */
-    XSLCYTJ_JOB,
+    CAR_LI_CHENG_MONTH_JOB,
+    /**
+     * 睿行车辆无单用车报警月统计数据入库定时任务
+     */
+    CAR_WU_DAN_YONG_CHE_JOB,
     /**
     /**
      * 河北成本管理系统车辆燃油数据入库定时任务
      * 河北成本管理系统车辆燃油数据入库定时任务
      */
      */

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarBaoXianJob.java

@@ -55,7 +55,7 @@ public class CarBaoXianJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 2 23 12 * ?")
+    @Scheduled(cron = "0 10 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getCarBaoXianSourcePath());
         Path dir = Paths.get(jobConfig.getCarBaoXianSourcePath());

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarDaWeiXiuJob.java

@@ -55,7 +55,7 @@ public class CarDaWeiXiuJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 4 23 12 * ?")
+    @Scheduled(cron = "0 12 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getCarDaWeiXiuSourcePath());
         Path dir = Paths.get(jobConfig.getCarDaWeiXiuSourcePath());

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarLuQiaoJob.java

@@ -55,7 +55,7 @@ public class CarLuQiaoJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 6 23 12 * ?")
+    @Scheduled(cron = "0 14 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getCarLuQiaoSourcePath());
         Path dir = Paths.get(jobConfig.getCarLuQiaoSourcePath());

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarNianJianFeiJob.java

@@ -55,7 +55,7 @@ public class CarNianJianFeiJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 8 23 12 * ?")
+    @Scheduled(cron = "0 16 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getCarNianJianFeiSourcePath());
         Path dir = Paths.get(jobConfig.getCarNianJianFeiSourcePath());

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarQiTaJob.java

@@ -55,7 +55,7 @@ public class CarQiTaJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 10 23 12 * ?")
+    @Scheduled(cron = "0 18 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getCarQiTaSourcePath());
         Path dir = Paths.get(jobConfig.getCarQiTaSourcePath());

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarRanYouJob.java

@@ -55,7 +55,7 @@ public class CarRanYouJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 12 23 12 * ?")
+    @Scheduled(cron = "0 20 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getCarRanYouSourcePath());
         Path dir = Paths.get(jobConfig.getCarRanYouSourcePath());

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/car/chengben/CarWeiXiuJob.java

@@ -55,7 +55,7 @@ public class CarWeiXiuJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 14 23 1 * ?")
+    @Scheduled(cron = "0 22 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getCarWeiXiuSourcePath());
         Path dir = Paths.get(jobConfig.getCarWeiXiuSourcePath());

+ 8 - 8
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/ClbfJob.java → src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarBaoFeiJob.java

@@ -46,14 +46,14 @@ import java.util.stream.Stream;
  */
  */
 @Slf4j
 @Slf4j
 @Service
 @Service
-public class ClbfJob {
+public class CarBaoFeiJob {
     private final JobConfig jobConfig;
     private final JobConfig jobConfig;
     private final CarService carService;
     private final CarService carService;
     private final OrganizationService organizationService;
     private final OrganizationService organizationService;
     private final AreaService areaService;
     private final AreaService areaService;
 
 
-    public ClbfJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
-                   AreaService areaService) {
+    public CarBaoFeiJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
+                        AreaService areaService) {
         this.jobConfig = jobConfig;
         this.jobConfig = jobConfig;
         this.carService = carService;
         this.carService = carService;
         this.organizationService = organizationService;
         this.organizationService = organizationService;
@@ -63,10 +63,10 @@ public class ClbfJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 52 23 1 * ?")
+    @Scheduled(cron = "0 0 5 1 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
-        Path dir = Paths.get(jobConfig.getClbfSourcePath());
+        Path dir = Paths.get(jobConfig.getCarBaoFeiSourcePath());
         try (Stream<Path> stream = Files.list(dir)) {
         try (Stream<Path> stream = Files.list(dir)) {
             // 获取数据目录下的文件列表
             // 获取数据目录下的文件列表
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
@@ -258,8 +258,8 @@ public class ClbfJob {
      */
      */
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
         log.info("去重后条数:{}", list.size());
         log.info("去重后条数:{}", list.size());
-        Files.createDirectories(Paths.get(jobConfig.getClbfHistoryPath()));
-        Path csvPath = Paths.get(jobConfig.getClbfHistoryPath() + path.getFileName() + ".csv");
+        Files.createDirectories(Paths.get(jobConfig.getCarBaoFeiHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarBaoFeiHistoryPath() + path.getFileName() + ".csv");
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
                 StandardCharsets.UTF_8);
                 StandardCharsets.UTF_8);
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
@@ -296,7 +296,7 @@ public class ClbfJob {
      * @param path 源文件路径
      * @param path 源文件路径
      */
      */
     public void move(Path path) throws Exception {
     public void move(Path path) throws Exception {
-        Path targetPath = Paths.get(jobConfig.getClbfHistoryPath(), path.getFileName().toString());
+        Path targetPath = Paths.get(jobConfig.getCarBaoFeiHistoryPath(), path.getFileName().toString());
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
     }
     }
 }
 }

+ 7 - 7
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CljbxxJob.java → src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarBaseDataDayJob.java

@@ -51,14 +51,14 @@ import java.util.stream.Stream;
  */
  */
 @Slf4j
 @Slf4j
 @Service
 @Service
-public class CljbxxJob {
+public class CarBaseDataDayJob {
     private final JobConfig jobConfig;
     private final JobConfig jobConfig;
     private final CarService carService;
     private final CarService carService;
     private final OrganizationService organizationService;
     private final OrganizationService organizationService;
     private final AreaService areaService;
     private final AreaService areaService;
 
 
-    public CljbxxJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
-                     AreaService areaService) {
+    public CarBaseDataDayJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
+                             AreaService areaService) {
         this.jobConfig = jobConfig;
         this.jobConfig = jobConfig;
         this.carService = carService;
         this.carService = carService;
         this.organizationService = organizationService;
         this.organizationService = organizationService;
@@ -71,7 +71,7 @@ public class CljbxxJob {
     @Scheduled(cron = "0 56 23 * * ?")
     @Scheduled(cron = "0 56 23 * * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
-        Path dir = Paths.get(jobConfig.getCljbxxSourcePath());
+        Path dir = Paths.get(jobConfig.getCarBaseDataDaySourcePath());
         try (Stream<Path> stream = Files.list(dir)) {
         try (Stream<Path> stream = Files.list(dir)) {
             // 获取数据目录下的文件列表
             // 获取数据目录下的文件列表
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
@@ -294,8 +294,8 @@ public class CljbxxJob {
      */
      */
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
         log.info("去重后条数:{}", list.size());
         log.info("去重后条数:{}", list.size());
-        Files.createDirectories(Paths.get(jobConfig.getCljbxxHistoryPath()));
-        Path csvPath = Paths.get(jobConfig.getCljbxxHistoryPath() + path.getFileName() + ".csv");
+        Files.createDirectories(Paths.get(jobConfig.getCarBaseDataDayHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarBaseDataDayHistoryPath() + path.getFileName() + ".csv");
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
                 StandardCharsets.UTF_8);
                 StandardCharsets.UTF_8);
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
@@ -330,7 +330,7 @@ public class CljbxxJob {
      * @param path 源文件路径
      * @param path 源文件路径
      */
      */
     public void move(Path path) throws Exception {
     public void move(Path path) throws Exception {
-        Path targetPath = Paths.get(jobConfig.getCljbxxHistoryPath(), path.getFileName().toString());
+        Path targetPath = Paths.get(jobConfig.getCarBaseDataDayHistoryPath(), path.getFileName().toString());
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
     }
     }
 }
 }

+ 8 - 8
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/XslcytjJob.java → src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarLiChengMonthJob.java

@@ -48,14 +48,14 @@ import java.util.stream.Stream;
  */
  */
 @Slf4j
 @Slf4j
 @Service
 @Service
-public class XslcytjJob {
+public class CarLiChengMonthJob {
     private final JobConfig jobConfig;
     private final JobConfig jobConfig;
     private final CarService carService;
     private final CarService carService;
     private final OrganizationService organizationService;
     private final OrganizationService organizationService;
     private final AreaService areaService;
     private final AreaService areaService;
 
 
-    public XslcytjJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
-                      AreaService areaService) {
+    public CarLiChengMonthJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
+                              AreaService areaService) {
         this.jobConfig = jobConfig;
         this.jobConfig = jobConfig;
         this.carService = carService;
         this.carService = carService;
         this.organizationService = organizationService;
         this.organizationService = organizationService;
@@ -65,10 +65,10 @@ public class XslcytjJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 54 23 1 * ?")
+    @Scheduled(cron = "0 30 5 1 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
-        Path dir = Paths.get(jobConfig.getXslcytjSourcePath());
+        Path dir = Paths.get(jobConfig.getCarLiChengMonthSourcePath());
         try (Stream<Path> stream = Files.list(dir)) {
         try (Stream<Path> stream = Files.list(dir)) {
             // 获取数据目录下的文件列表
             // 获取数据目录下的文件列表
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
@@ -280,8 +280,8 @@ public class XslcytjJob {
      */
      */
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
         log.info("去重后条数:{}", list.size());
         log.info("去重后条数:{}", list.size());
-        Files.createDirectories(Paths.get(jobConfig.getXslcytjHistoryPath()));
-        Path csvPath = Paths.get(jobConfig.getXslcytjHistoryPath() + path.getFileName() + ".csv");
+        Files.createDirectories(Paths.get(jobConfig.getCarLiChengMonthHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarLiChengMonthHistoryPath() + path.getFileName() + ".csv");
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
                 StandardCharsets.UTF_8);
                 StandardCharsets.UTF_8);
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
@@ -318,7 +318,7 @@ public class XslcytjJob {
      * @param path 源文件路径
      * @param path 源文件路径
      */
      */
     public void move(Path path) throws Exception {
     public void move(Path path) throws Exception {
-        Path targetPath = Paths.get(jobConfig.getXslcytjHistoryPath(), path.getFileName().toString());
+        Path targetPath = Paths.get(jobConfig.getCarLiChengMonthHistoryPath(), path.getFileName().toString());
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
     }
     }
 }
 }

+ 307 - 0
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarWuDanYongCheJob.java

@@ -0,0 +1,307 @@
+package com.nokia.finance.tasks.jobs.car.ruixing;
+
+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 com.nokia.finance.tasks.pojo.po.common.AreaPo;
+import com.nokia.finance.tasks.pojo.po.common.OrganizationPo;
+import com.nokia.finance.tasks.service.car.CarService;
+import com.nokia.finance.tasks.service.common.AreaService;
+import com.nokia.finance.tasks.service.common.OrganizationService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.DateUtil;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.io.InputStream;
+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.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+
+/**
+ * 睿行车辆无单用车报警月统计数据入库定时任务
+ */
+@Slf4j
+@Service
+public class CarWuDanYongCheJob {
+    private final JobConfig jobConfig;
+    private final CarService carService;
+    private final OrganizationService organizationService;
+    private final AreaService areaService;
+
+    public CarWuDanYongCheJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
+                              AreaService areaService) {
+        this.jobConfig = jobConfig;
+        this.carService = carService;
+        this.organizationService = organizationService;
+        this.areaService = areaService;
+    }
+
+    /**
+     * 执行任务
+     */
+    @Scheduled(cron = "0 50 23 * * ?")
+    public void runJob() {
+        // 数据目录
+        Path dir = Paths.get(jobConfig.getCarWuDanYongCheSourcePath());
+        try (Stream<Path> stream = Files.list(dir)) {
+            // 获取数据目录下的文件列表
+            List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
+            log.info("睿行车辆无单用车报警月统计数据数据文件列表: {}", pathList);
+            if (CollectionUtils.isEmpty(pathList)) {
+                throw new MyRuntimeException("睿行车辆无单用车报警月统计数据没有文件");
+            }
+            for (Path path : pathList) {
+                singleJob(path);
+            }
+        } 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> rawHeaders = Stream.of("车辆所属单位", "车牌号码", "违规开始时间", "违规结束时间",
+                "违规持续时间(分)").toList();
+        List<String> headers = Stream.of("che_liang_suo_shu_dan_wei", "che_pai_hao", "wei_gui_kai_shi_shi_jian",
+                "wei_gui_jie_shu_shi_jian", "wei_gui_chi_xu_shi_jian").toList();
+        try (InputStream inputStream = Files.newInputStream(path);
+             Workbook workbook = new XSSFWorkbook(inputStream)
+        ) {
+            List<Map<String, String>> resultList = new ArrayList<>();
+            // 读取第一个工作表
+            Sheet sheet = workbook.getSheetAt(0);
+            // 表头行
+            Row headerRow = sheet.getRow(0);
+            // 列数
+            int columnCount = headerRow.getPhysicalNumberOfCells();
+            log.info("columnCount: {}", columnCount);
+            // 检查表头
+            if (headers.size() != columnCount) {
+                throw new MyRuntimeException(path.getFileName() + "列数错误");
+            }
+            for (int i = 0; i < columnCount; i++) {
+                Cell cell = headerRow.getCell(i);
+                if (cell == null || !rawHeaders.get(i).equals(cell.getStringCellValue())) {
+                    throw new MyRuntimeException(path.getFileName() + " 表头错误");
+                }
+            }
+            // 最后行数
+            int lastRowNum = sheet.getLastRowNum();
+            log.info("lastRowNum: {}", lastRowNum);
+            if (lastRowNum == 0) {
+                throw new MyRuntimeException(path.getFileName() + " 为空");
+            }
+            // 遍历行
+            for (int i = 1; i <= lastRowNum; i++) {
+                Row row = sheet.getRow(i);
+                if (row == null) {
+                    continue;
+                }
+                Map<String, String> rowMap = new LinkedHashMap<>();
+                // 遍历列
+                for (int j = 0; j < columnCount; j++) {
+                    String header = headers.get(j);
+                    String cellValue = "";
+                    rowMap.put(header, cellValue);
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    switch (cell.getCellType()) {
+                        case STRING:
+                            boolean skipTrim = "wei_gui_kai_shi_shi_jian".equals(header)
+                                    || "wei_gui_jie_shu_shi_jian".equals(header);
+                            // 删除字符串空白字符
+                            cellValue = skipTrim ? cell.getStringCellValue()
+                                    : StringUtils.trimAllWhitespace(cell.getStringCellValue());
+                            break;
+                        case NUMERIC:
+                            if (DateUtil.isCellDateFormatted(cell)) {
+                                cellValue = DateUtil.getLocalDateTime(cell.getNumericCellValue())
+                                        .format(DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss"));
+                                break;
+                            }
+                            cellValue = String.valueOf(cell.getNumericCellValue());
+                            break;
+                        case BOOLEAN:
+                            cellValue = String.valueOf(cell.getBooleanCellValue());
+                            break;
+                        default:
+                            break;
+                    }
+                    rowMap.put(header, cellValue);
+                }
+                resultList.add(rowMap);
+            }
+            return resultList;
+        }
+    }
+
+    /**
+     * 数据加工
+     *
+     * @param path 文件路径
+     * @param list 数据
+     */
+    public List<Map<String, String>> dataProcessing(Path path, List<Map<String, String>> list) {
+        List<OrganizationPo> secondOrgs = organizationService.getSecondOrgs();
+        List<OrganizationPo> thirdOrgs = organizationService.getThirdOrgs();
+        Map<String, OrganizationPo> orgMap = organizationService.getOrgMap(secondOrgs, thirdOrgs);
+        Map<String, List<OrganizationPo>> thirdOrganizationListMap =
+                organizationService.getThirdOrganizationListMap(secondOrgs, thirdOrgs);
+        List<AreaPo> cities = areaService.getCities();
+        List<AreaPo> districts = areaService.getDistricts();
+        Map<String, AreaPo> areaMap = areaService.getAreaMap(cities, districts);
+        Map<String, List<AreaPo>> districtListMap = areaService.getDistrictListMap(cities, districts);
+        for (Map<String, String> map : list) {
+            String weiGuiKaiShiShiJian = map.get("wei_gui_kai_shi_shi_jian");
+            LocalDateTime localDateTime = LocalDateTime.parse(weiGuiKaiShiShiJian,
+                    DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+            String yearMonth = localDateTime.format(DateTimeFormatter.ofPattern("yyyyMM"));
+            String year = String.valueOf(localDateTime.getYear());
+            String month = String.valueOf(localDateTime.getMonthValue());
+            map.put("year_month", yearMonth);
+            map.put("year_no", year);
+            map.put("month_no", month);
+            String rawChePaiHao = map.get("che_pai_hao");
+            map.put("raw_che_pai_hao", rawChePaiHao);
+            String chePaiHao = carService.getChePai(rawChePaiHao);
+            map.put("che_pai_hao", chePaiHao);
+            String chePaiFail = carService.chePaiFail(rawChePaiHao);
+            map.put("che_pai_fail", chePaiFail);
+            String cheLiangSuoShuDanWei = map.get("che_liang_suo_shu_dan_wei");
+            String firstUnit = carService.getFirstUnit(cheLiangSuoShuDanWei);
+            map.put("first_unit", firstUnit);
+            String secondUnit = carService.getSecondUnit(cheLiangSuoShuDanWei, firstUnit);
+            map.put("second_unit", secondUnit);
+            String thirdUnit = carService.getThirdUnit(cheLiangSuoShuDanWei, secondUnit);
+            map.put("third_unit", thirdUnit);
+            String areaNo = carService.getAreaNo(secondOrgs, cheLiangSuoShuDanWei);
+            map.put("area_no", areaNo);
+            String areaName = carService.getOrgName(orgMap, areaNo);
+            map.put("area_name", areaName);
+            String cityNo = carService.getCityNo(thirdOrganizationListMap, areaNo, areaName, cheLiangSuoShuDanWei);
+            map.put("city_no", cityNo);
+            String cityName = carService.getOrgName(orgMap, cityNo);
+            map.put("city_name", cityName);
+            String areaNo2 = carService.getAreaNo2(areaName, cityName);
+            map.put("area_no2", areaNo2);
+            String areaName2 = carService.getOrgName(orgMap, areaNo2);
+            map.put("area_name2", areaName2);
+            String cityId = carService.getCityId(cities, cheLiangSuoShuDanWei);
+            map.put("city_id", cityId);
+            String city = carService.getAreaName(areaMap, cityId);
+            map.put("city", city);
+            String districtId = carService.getDistrictId(districtListMap, cityId, cityName, cheLiangSuoShuDanWei);
+            map.put("district_id", districtId);
+            String district = carService.getAreaName(areaMap, districtId);
+            map.put("district", district);
+            String baoFei = carService.baoFei(rawChePaiHao);
+            map.put("bao_fei", baoFei);
+            map.put("source", path.getFileName().toString());
+        }
+        // 去重
+        return list.stream().filter(distinctByKey(map -> map.get("che_pai_hao")
+                + map.get("wei_gui_kai_shi_shi_jian"))).toList();
+    }
+
+    /**
+     * 去重
+     */
+    private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
+        Set<Object> set = ConcurrentHashMap.newKeySet();
+        return t -> set.add(keyExtractor.apply(t));
+    }
+
+    /**
+     * 生成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.getCarWuDanYongCheHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarWuDanYongCheHistoryPath() + 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_wu_dan_yong_che";
+        String csv = path.toString();
+        String columns = "(che_liang_suo_shu_dan_wei,che_pai_hao,wei_gui_kai_shi_shi_jian,wei_gui_jie_shu_shi_jian,wei_gui_chi_xu_shi_jian,year_month,year_no,month_no,raw_che_pai_hao,che_pai_fail,first_unit,second_unit,third_unit,area_no,area_name,city_no,city_name,area_no2,area_name2,city_id,city,district_id,district,bao_fei,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 {
+        Path targetPath = Paths.get(jobConfig.getCarWuDanYongCheHistoryPath(), path.getFileName().toString());
+        Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
+    }
+}

+ 7 - 7
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/YjbjrtjJob.java → src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarYueJieJob.java

@@ -46,14 +46,14 @@ import java.util.stream.Stream;
  */
  */
 @Slf4j
 @Slf4j
 @Service
 @Service
-public class YjbjrtjJob {
+public class CarYueJieJob {
     private final JobConfig jobConfig;
     private final JobConfig jobConfig;
     private final CarService carService;
     private final CarService carService;
     private final OrganizationService organizationService;
     private final OrganizationService organizationService;
     private final AreaService areaService;
     private final AreaService areaService;
 
 
-    public YjbjrtjJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
-                      AreaService areaService) {
+    public CarYueJieJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
+                        AreaService areaService) {
         this.jobConfig = jobConfig;
         this.jobConfig = jobConfig;
         this.carService = carService;
         this.carService = carService;
         this.organizationService = organizationService;
         this.organizationService = organizationService;
@@ -66,7 +66,7 @@ public class YjbjrtjJob {
     @Scheduled(cron = "0 58 23 * * ?")
     @Scheduled(cron = "0 58 23 * * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
-        Path dir = Paths.get(jobConfig.getYjbjrtjSourcePath());
+        Path dir = Paths.get(jobConfig.getCarYueJieSourcePath());
         try (Stream<Path> stream = Files.list(dir)) {
         try (Stream<Path> stream = Files.list(dir)) {
             // 获取数据目录下的文件列表
             // 获取数据目录下的文件列表
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
             List<Path> pathList = stream.filter(t -> t.toString().endsWith(".xlsx")).sorted().toList();
@@ -264,8 +264,8 @@ public class YjbjrtjJob {
      */
      */
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
     public Path toCsv(Path path, List<Map<String, String>> list) throws Exception {
         log.info("去重后条数:{}", list.size());
         log.info("去重后条数:{}", list.size());
-        Files.createDirectories(Paths.get(jobConfig.getYjbjrtjHistoryPath()));
-        Path csvPath = Paths.get(jobConfig.getYjbjrtjHistoryPath() + path.getFileName() + ".csv");
+        Files.createDirectories(Paths.get(jobConfig.getCarYueJieHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarYueJieHistoryPath() + path.getFileName() + ".csv");
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
         try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(csvPath),
                 StandardCharsets.UTF_8);
                 StandardCharsets.UTF_8);
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
              CSVPrinter printer = new CSVPrinter(osw, CSVFormat.DEFAULT)) {
@@ -302,7 +302,7 @@ public class YjbjrtjJob {
      * @param path 源文件路径
      * @param path 源文件路径
      */
      */
     public void move(Path path) throws Exception {
     public void move(Path path) throws Exception {
-        Path targetPath = Paths.get(jobConfig.getYjbjrtjHistoryPath(), path.getFileName().toString());
+        Path targetPath = Paths.get(jobConfig.getCarYueJieHistoryPath(), path.getFileName().toString());
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
         Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
     }
     }
 }
 }

+ 1 - 1
src/main/java/com/nokia/finance/tasks/jobs/house/chengben/HouseBuildingRepairMonthJob.java

@@ -43,7 +43,7 @@ public class HouseBuildingRepairMonthJob {
     /**
     /**
      * 执行任务
      * 执行任务
      */
      */
-    @Scheduled(cron = "0 0 23 12 * ?")
+    @Scheduled(cron = "0 24 6 12 * ?")
     public void runJob() {
     public void runJob() {
         // 数据目录
         // 数据目录
         Path dir = Paths.get(jobConfig.getHouseBuildingRepairMonthSourcePath());
         Path dir = Paths.get(jobConfig.getHouseBuildingRepairMonthSourcePath());

+ 28 - 21
src/main/java/com/nokia/finance/tasks/service/JobService.java

@@ -8,20 +8,22 @@ import com.nokia.finance.tasks.jobs.car.chengben.CarNianJianFeiJob;
 import com.nokia.finance.tasks.jobs.car.chengben.CarQiTaJob;
 import com.nokia.finance.tasks.jobs.car.chengben.CarQiTaJob;
 import com.nokia.finance.tasks.jobs.car.chengben.CarRanYouJob;
 import com.nokia.finance.tasks.jobs.car.chengben.CarRanYouJob;
 import com.nokia.finance.tasks.jobs.car.chengben.CarWeiXiuJob;
 import com.nokia.finance.tasks.jobs.car.chengben.CarWeiXiuJob;
-import com.nokia.finance.tasks.jobs.car.ruixing.ClbfJob;
-import com.nokia.finance.tasks.jobs.car.ruixing.CljbxxJob;
-import com.nokia.finance.tasks.jobs.car.ruixing.XslcytjJob;
-import com.nokia.finance.tasks.jobs.car.ruixing.YjbjrtjJob;
+import com.nokia.finance.tasks.jobs.car.ruixing.CarBaoFeiJob;
+import com.nokia.finance.tasks.jobs.car.ruixing.CarBaseDataDayJob;
+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.CarYueJieJob;
 import com.nokia.finance.tasks.jobs.house.chengben.HouseBuildingRepairMonthJob;
 import com.nokia.finance.tasks.jobs.house.chengben.HouseBuildingRepairMonthJob;
 import com.nokia.finance.tasks.pojo.RunJobDto;
 import com.nokia.finance.tasks.pojo.RunJobDto;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 @Service
 @Service
 public class JobService {
 public class JobService {
-    private final CljbxxJob cljbxxJob;
-    private final YjbjrtjJob yjbjrtjJob;
-    private final ClbfJob clbfJob;
-    private final XslcytjJob xslcytjJob;
+    private final CarBaseDataDayJob carBaseDataDayJob;
+    private final CarYueJieJob carYueJieJob;
+    private final CarBaoFeiJob carBaoFeiJob;
+    private final CarLiChengMonthJob carLiChengMonthJob;
+    private final CarWuDanYongCheJob carWuDanYongCheJob;
     private final CarRanYouJob carRanYouJob;
     private final CarRanYouJob carRanYouJob;
     private final CarDaWeiXiuJob carDaWeiXiuJob;
     private final CarDaWeiXiuJob carDaWeiXiuJob;
     private final CarWeiXiuJob carWeiXiuJob;
     private final CarWeiXiuJob carWeiXiuJob;
@@ -31,14 +33,16 @@ public class JobService {
     private final CarQiTaJob carQiTaJob;
     private final CarQiTaJob carQiTaJob;
     private final HouseBuildingRepairMonthJob houseBuildingRepairMonthJob;
     private final HouseBuildingRepairMonthJob houseBuildingRepairMonthJob;
 
 
-    public JobService(CljbxxJob cljbxxJob, YjbjrtjJob yjbjrtjJob, ClbfJob clbfJob, XslcytjJob xslcytjJob,
+    public JobService(CarBaseDataDayJob carBaseDataDayJob, CarYueJieJob carYueJieJob, CarBaoFeiJob carBaoFeiJob,
+                      CarLiChengMonthJob carLiChengMonthJob, CarWuDanYongCheJob carWuDanYongCheJob,
                       CarRanYouJob carRanYouJob, CarDaWeiXiuJob carDaWeiXiuJob, CarWeiXiuJob carWeiXiuJob,
                       CarRanYouJob carRanYouJob, CarDaWeiXiuJob carDaWeiXiuJob, CarWeiXiuJob carWeiXiuJob,
                       CarLuQiaoJob carLuQiaoJob, CarBaoXianJob carBaoXianJob, CarNianJianFeiJob carNianJianFeiJob,
                       CarLuQiaoJob carLuQiaoJob, CarBaoXianJob carBaoXianJob, CarNianJianFeiJob carNianJianFeiJob,
                       CarQiTaJob carQiTaJob, HouseBuildingRepairMonthJob houseBuildingRepairMonthJob) {
                       CarQiTaJob carQiTaJob, HouseBuildingRepairMonthJob houseBuildingRepairMonthJob) {
-        this.cljbxxJob = cljbxxJob;
-        this.yjbjrtjJob = yjbjrtjJob;
-        this.clbfJob = clbfJob;
-        this.xslcytjJob = xslcytjJob;
+        this.carBaseDataDayJob = carBaseDataDayJob;
+        this.carYueJieJob = carYueJieJob;
+        this.carBaoFeiJob = carBaoFeiJob;
+        this.carLiChengMonthJob = carLiChengMonthJob;
+        this.carWuDanYongCheJob = carWuDanYongCheJob;
         this.carRanYouJob = carRanYouJob;
         this.carRanYouJob = carRanYouJob;
         this.carDaWeiXiuJob = carDaWeiXiuJob;
         this.carDaWeiXiuJob = carDaWeiXiuJob;
         this.carWeiXiuJob = carWeiXiuJob;
         this.carWeiXiuJob = carWeiXiuJob;
@@ -51,17 +55,20 @@ public class JobService {
 
 
     public R<Object> runJob(RunJobDto dto) {
     public R<Object> runJob(RunJobDto dto) {
         switch (dto.getJobName()) {
         switch (dto.getJobName()) {
-            case CLJBXX_JOB:
-                cljbxxJob.runJob();
+            case CAR_BASE_DATA_DAY_JOB:
+                carBaseDataDayJob.runJob();
                 break;
                 break;
-            case YJBJRTJ_JOB:
-                yjbjrtjJob.runJob();
+            case CAR_YUE_JIE_JOB:
+                carYueJieJob.runJob();
                 break;
                 break;
-            case CLBF_JOB:
-                clbfJob.runJob();
+            case CAR_BAO_FEI_JOB:
+                carBaoFeiJob.runJob();
                 break;
                 break;
-            case XSLCYTJ_JOB:
-                xslcytjJob.runJob();
+            case CAR_LI_CHENG_MONTH_JOB:
+                carLiChengMonthJob.runJob();
+                break;
+            case CAR_WU_DAN_YONG_CHE_JOB:
+                carWuDanYongCheJob.runJob();
                 break;
                 break;
             case CAR_RAN_YOU_JOB:
             case CAR_RAN_YOU_JOB:
                 carRanYouJob.runJob();
                 carRanYouJob.runJob();

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

@@ -20,21 +20,25 @@ job:
     db-password: Test!234
     db-password: Test!234
     db-name: financialdb
     db-name: financialdb
     # 睿行车辆基本信息日数据路径
     # 睿行车辆基本信息日数据路径
-    cljbxx-source-path: data/rxftp/cljbxx/
+    car-base-data-day-source-path: data/rxftp/cljbxx/
     # 睿行车辆基本信息日数据归档路径
     # 睿行车辆基本信息日数据归档路径
-    cljbxx-history-path: data/history/rxftp/cljbxx/
+    car-base-data-day-history-path: data/history/rxftp/cljbxx/
     # 睿行车辆越界报警日数据路径
     # 睿行车辆越界报警日数据路径
-    yjbjrtj-source-path: data/rxftp/yjbjrtj/
+    car-yue-jie-source-path: data/rxftp/yjbjrtj/
     # 睿行车辆越界报警日数据归档路径
     # 睿行车辆越界报警日数据归档路径
-    yjbjrtj-history-path: data/history/rxftp/yjbjrtj/
+    car-yue-jie-history-path: data/history/rxftp/yjbjrtj/
     # 睿行车辆报废月数据路径
     # 睿行车辆报废月数据路径
-    clbf-source-path: data/rxftp/clbf/
+    car-bao-fei-source-path: data/rxftp/clbf/
     # 睿行车辆报废月数据归档路径
     # 睿行车辆报废月数据归档路径
-    clbf-history-path: data/history/rxftp/clbf/
+    car-bao-fei-history-path: data/history/rxftp/clbf/
     # 睿行车辆行驶里程月数据路径
     # 睿行车辆行驶里程月数据路径
-    xslcytj-source-path: data/rxftp/xslcytj/
+    car-li-cheng-month-source-path: data/rxftp/xslcytj/
     # 睿行车辆行驶里程月数据归档路径
     # 睿行车辆行驶里程月数据归档路径
-    xslcytj-history-path: data/history/rxftp/xslcytj/
+    car-li-cheng-month-history-path: data/history/rxftp/xslcytj/
+    # 睿行车辆无单用车报警月统计数据路径
+    car-wu-dan-yong-che-source-path: data/rxftp/wdycbjytjbjcs/
+    # 睿行车辆无单用车报警月统计数据归档路径
+    car-wu-dan-yong-che-history-path: data/history/rxftp/wdycbjytjbjcs/
     # 河北成本管理系统车辆燃油数据路径
     # 河北成本管理系统车辆燃油数据路径
     car-ran-you-source-path: data/jzftp/HE_M_MTC_VEHICLE_OIL/
     car-ran-you-source-path: data/jzftp/HE_M_MTC_VEHICLE_OIL/
     # 河北成本管理系统车辆燃油数据归档路径
     # 河北成本管理系统车辆燃油数据归档路径

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

@@ -20,21 +20,25 @@ job:
     db-password: Finance@unicom23
     db-password: Finance@unicom23
     db-name: financialdb
     db-name: financialdb
     # 睿行车辆基本信息日数据路径
     # 睿行车辆基本信息日数据路径
-    cljbxx-source-path: /data/rxftp/cljbxx/
+    car-base-data-day-source-path: /data/rxftp/cljbxx/
     # 睿行车辆基本信息日数据归档路径
     # 睿行车辆基本信息日数据归档路径
-    cljbxx-history-path: /data/history/rxftp/cljbxx/
+    car-base-data-day-history-path: /data/history/rxftp/cljbxx/
     # 睿行车辆越界报警日数据路径
     # 睿行车辆越界报警日数据路径
-    yjbjrtj-source-path: /data/rxftp/yjbjrtj/
+    car-yue-jie-source-path: /data/rxftp/yjbjrtj/
     # 睿行车辆越界报警日数据归档路径
     # 睿行车辆越界报警日数据归档路径
-    yjbjrtj-history-path: /data/history/rxftp/yjbjrtj/
+    car-yue-jie-history-path: /data/history/rxftp/yjbjrtj/
     # 睿行车辆报废月数据路径
     # 睿行车辆报废月数据路径
-    clbf-source-path: /data/rxftp/clbf/
+    car-bao-fei-source-path: /data/rxftp/clbf/
     # 睿行车辆报废月数据归档路径
     # 睿行车辆报废月数据归档路径
-    clbf-history-path: /data/history/rxftp/clbf/
+    car-bao-fei-history-path: /data/history/rxftp/clbf/
     # 睿行车辆行驶里程月数据路径
     # 睿行车辆行驶里程月数据路径
-    xslcytj-source-path: /data/rxftp/xslcytj/
+    car-li-cheng-month-source-path: /data/rxftp/xslcytj/
     # 睿行车辆行驶里程月数据归档路径
     # 睿行车辆行驶里程月数据归档路径
-    xslcytj-history-path: /data/history/rxftp/xslcytj/
+    car-li-cheng-month-history-path: /data/history/rxftp/xslcytj/
+    # 睿行车辆无单用车报警月统计数据路径
+    car-wu-dan-yong-che-source-path: /data/rxftp/wdycbjytjbjcs/
+    # 睿行车辆无单用车报警月统计数据归档路径
+    car-wu-dan-yong-che-history-path: /data/history/rxftp/wdycbjytjbjcs/
     # 河北成本管理系统车辆燃油数据路径
     # 河北成本管理系统车辆燃油数据路径
     car-ran-you-source-path: /data/jzftp/HE_M_MTC_VEHICLE_OIL/
     car-ran-you-source-path: /data/jzftp/HE_M_MTC_VEHICLE_OIL/
     # 河北成本管理系统车辆燃油数据归档路径
     # 河北成本管理系统车辆燃油数据归档路径

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

@@ -12,7 +12,7 @@
         <file>${PATH}/trace.log</file>
         <file>${PATH}/trace.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
             <!-- rollover daily -->
             <!-- rollover daily -->
-            <fileNamePattern>${PATH}/trace.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+            <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 -->
             <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
             <maxFileSize>50MB</maxFileSize>
             <maxFileSize>50MB</maxFileSize>
             <maxHistory>60</maxHistory>
             <maxHistory>60</maxHistory>
@@ -27,7 +27,7 @@
         <file>${PATH}/error.log</file>
         <file>${PATH}/error.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
             <!-- rollover daily -->
             <!-- rollover daily -->
-            <fileNamePattern>${PATH}/error.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+            <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 -->
             <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
             <maxFileSize>50MB</maxFileSize>
             <maxFileSize>50MB</maxFileSize>
             <maxHistory>60</maxHistory>
             <maxHistory>60</maxHistory>

+ 4 - 4
src/test/java/com/nokia/finance/tasks/car/ruixing/ClbfJobTests.java → src/test/java/com/nokia/finance/tasks/car/ruixing/CarBaoFeiJobTests.java

@@ -1,6 +1,6 @@
 package com.nokia.finance.tasks.car.ruixing;
 package com.nokia.finance.tasks.car.ruixing;
 
 
-import com.nokia.finance.tasks.jobs.car.ruixing.ClbfJob;
+import com.nokia.finance.tasks.jobs.car.ruixing.CarBaoFeiJob;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,13 +10,13 @@ import org.springframework.test.context.ActiveProfiles;
 @Slf4j
 @Slf4j
 @SpringBootTest
 @SpringBootTest
 @ActiveProfiles("dev")
 @ActiveProfiles("dev")
-class ClbfJobTests {
+class CarBaoFeiJobTests {
     @Autowired
     @Autowired
-    ClbfJob clbfJob;
+    CarBaoFeiJob carBaoFeiJob;
 
 
     @Test
     @Test
     void runJobTest() {
     void runJobTest() {
-        clbfJob.runJob();
+        carBaoFeiJob.runJob();
     }
     }
 
 
 }
 }

+ 4 - 4
src/test/java/com/nokia/finance/tasks/car/ruixing/XslcytjJobTests.java → src/test/java/com/nokia/finance/tasks/car/ruixing/CarBaseDataDayJobTests.java

@@ -1,6 +1,6 @@
 package com.nokia.finance.tasks.car.ruixing;
 package com.nokia.finance.tasks.car.ruixing;
 
 
-import com.nokia.finance.tasks.jobs.car.ruixing.XslcytjJob;
+import com.nokia.finance.tasks.jobs.car.ruixing.CarBaseDataDayJob;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,13 +10,13 @@ import org.springframework.test.context.ActiveProfiles;
 @Slf4j
 @Slf4j
 @SpringBootTest
 @SpringBootTest
 @ActiveProfiles("dev")
 @ActiveProfiles("dev")
-class XslcytjJobTests {
+class CarBaseDataDayJobTests {
     @Autowired
     @Autowired
-    XslcytjJob xslcytjJob;
+    CarBaseDataDayJob carBaseDataDayJob;
 
 
     @Test
     @Test
     void runJobTest() {
     void runJobTest() {
-        xslcytjJob.runJob();
+        carBaseDataDayJob.runJob();
     }
     }
 
 
 }
 }

+ 4 - 4
src/test/java/com/nokia/finance/tasks/car/ruixing/YjbjrtjJobTests.java → src/test/java/com/nokia/finance/tasks/car/ruixing/CarLiChengMonthJobTests.java

@@ -1,6 +1,6 @@
 package com.nokia.finance.tasks.car.ruixing;
 package com.nokia.finance.tasks.car.ruixing;
 
 
-import com.nokia.finance.tasks.jobs.car.ruixing.YjbjrtjJob;
+import com.nokia.finance.tasks.jobs.car.ruixing.CarLiChengMonthJob;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,13 +10,13 @@ import org.springframework.test.context.ActiveProfiles;
 @Slf4j
 @Slf4j
 @SpringBootTest
 @SpringBootTest
 @ActiveProfiles("dev")
 @ActiveProfiles("dev")
-class YjbjrtjJobTests {
+class CarLiChengMonthJobTests {
     @Autowired
     @Autowired
-    YjbjrtjJob yjbjrtjJob;
+    CarLiChengMonthJob carLiChengMonthJob;
 
 
     @Test
     @Test
     void runJobTest() {
     void runJobTest() {
-        yjbjrtjJob.runJob();
+        carLiChengMonthJob.runJob();
     }
     }
 
 
 }
 }

+ 22 - 0
src/test/java/com/nokia/finance/tasks/car/ruixing/CarWuDanYongCheJobTests.java

@@ -0,0 +1,22 @@
+package com.nokia.finance.tasks.car.ruixing;
+
+import com.nokia.finance.tasks.jobs.car.ruixing.CarWuDanYongCheJob;
+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 CarWuDanYongCheJobTests {
+    @Autowired
+    CarWuDanYongCheJob carWuDanYongCheJob;
+
+    @Test
+    void runJobTest() {
+        carWuDanYongCheJob.runJob();
+    }
+
+}

+ 4 - 4
src/test/java/com/nokia/finance/tasks/car/ruixing/CljbxxJobTests.java → src/test/java/com/nokia/finance/tasks/car/ruixing/CarYueJieJobTests.java

@@ -1,6 +1,6 @@
 package com.nokia.finance.tasks.car.ruixing;
 package com.nokia.finance.tasks.car.ruixing;
 
 
-import com.nokia.finance.tasks.jobs.car.ruixing.CljbxxJob;
+import com.nokia.finance.tasks.jobs.car.ruixing.CarYueJieJob;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,13 +10,13 @@ import org.springframework.test.context.ActiveProfiles;
 @Slf4j
 @Slf4j
 @SpringBootTest
 @SpringBootTest
 @ActiveProfiles("dev")
 @ActiveProfiles("dev")
-class CljbxxJobTests {
+class CarYueJieJobTests {
     @Autowired
     @Autowired
-    CljbxxJob cljbxxJob;
+    CarYueJieJob carYueJieJob;
 
 
     @Test
     @Test
     void runJobTest() {
     void runJobTest() {
-        cljbxxJob.runJob();
+        carYueJieJob.runJob();
     }
     }
 
 
 }
 }