浏览代码

feat: 实现睿行车辆行驶里程日数据入库定时任务

weijianghai 1 年之前
父节点
当前提交
767c4d3953

+ 18 - 0
pom.xml

@@ -87,6 +87,24 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-validation</artifactId>
         </dependency>
+        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-freemarker -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+            <version>3.2.3</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.belerweb/pinyin4j -->
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+            <version>2.5.1</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.14.0</version>
+        </dependency>
     </dependencies>
 
     <dependencyManagement>

+ 10 - 0
readme.md

@@ -171,3 +171,13 @@ curl --location 'http://localhost:39110/jobs/runJob' \
     "jobName": "HOUSE_BUILDING_REPAIR_MONTH_JOB"
 }'
 ```
+
+##### 睿行车辆行驶里程日数据入库定时任务
+
+```shell
+curl --location 'http://localhost:39110/jobs/runJob' \
+--header 'Content-Type: application/json' \
+--data '{
+    "jobName": "CAR_LI_CHENG_DAY_JOB"
+}'
+```

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

@@ -64,6 +64,14 @@ public class JobConfig {
      * 睿行车辆行驶里程月数据归档路径
      */
     private String carLiChengMonthHistoryPath;
+    /**
+     * 睿行车辆行驶里程日数据路径
+     */
+    private String carLiChengDaySourcePath;
+    /**
+     * 睿行车辆行驶里程日数据归档路径
+     */
+    private String carLiChengDayHistoryPath;
     /**
      * 睿行车辆无单用车报警月统计数据路径
      */
@@ -160,4 +168,39 @@ public class JobConfig {
      * 河北成本管理系统自有类房产维修数据归档路径
      */
     private String houseBuildingRepairMonthHistoryPath;
+    /**
+     * 违规车辆策略输出路径
+     */
+    private String carWdyjOutputPath;
+    /**
+     * 高油耗车辆策略输出路径
+     */
+    private String carHighFuelConsumptionOutputPath;
+    /**
+     * 高修理车辆策略输出路径
+     */
+    private String carHighRepairOutputPath;
+    /**
+     * 车辆低效占比策略输出路径
+     */
+    private String carInefficiencyPercentOutputPath;
+    /**
+     * 车辆低效区县策略输出路径
+     */
+    private String carInefficiencyQxOutputPath;
+    /**
+     * 租赁车辆产生维修费策略输出路径
+     */
+    private String carRentalRepairOutputPath;
+    /**
+     * 车辆违章未处理策略输出路径
+     */
+    private String carViolationUnprocessedOutputPath;
+    /**
+     * 车效大屏建设数据输出路径
+     */
+    private String carCxdpOutputPath;
+    private String houseBuildingAreaStatOutputPath;
+    private String houseBuildingLandCountOutputPath;
+    private String houseRentalIncomeOutputPath;
 }

+ 1 - 1
src/main/java/com/nokia/finance/tasks/controller/JobController.java

@@ -1,7 +1,7 @@
 package com.nokia.finance.tasks.controller;
 
 import com.nokia.finance.tasks.common.R;
-import com.nokia.finance.tasks.pojo.RunJobDto;
+import com.nokia.finance.tasks.pojo.dto.RunJobDto;
 import com.nokia.finance.tasks.service.JobService;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;

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

@@ -65,5 +65,9 @@ public enum JobEnum {
      * 河北成本管理系统自有类房产维修数据入库定时任务
      */
     HOUSE_BUILDING_REPAIR_MONTH_JOB,
+    /**
+     * 睿行车辆行驶里程日数据入库定时任务
+     */
+    CAR_LI_CHENG_DAY_JOB,
     ;
 }

+ 0 - 3
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarBaseDataDayJob.java

@@ -280,9 +280,6 @@ public class CarBaseDataDayJob {
                 }
             }
             map.put("che_ling", cheLing);
-            String cheLiangLeiXing = map.get("che_liang_lei_xing");
-            cheLiangLeiXing = carService.getCheLiangLeiXing(cheLiangLeiXing);
-            map.put("che_liang_lei_xing", cheLiangLeiXing);
             map.put("source", path.getFileName().toString());
         }
         // 去重

+ 316 - 0
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarLiChengDayJob.java

@@ -0,0 +1,316 @@
+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.LocalDate;
+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.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+
+/**
+ * 睿行车辆行驶里程日数据入库定时任务
+ */
+@Slf4j
+@Service
+public class CarLiChengDayJob {
+    private final JobConfig jobConfig;
+    private final CarService carService;
+    private final OrganizationService organizationService;
+    private final AreaService areaService;
+
+    public CarLiChengDayJob(JobConfig jobConfig, CarService carService, OrganizationService organizationService,
+                            AreaService areaService) {
+        this.jobConfig = jobConfig;
+        this.carService = carService;
+        this.organizationService = organizationService;
+        this.areaService = areaService;
+    }
+
+    /**
+     * 执行任务
+     */
+    @Scheduled(cron = "0 48 5 * * ?")
+    public void runJob() {
+        // 数据目录
+        Path dir = Paths.get(jobConfig.getCarLiChengDaySourcePath());
+        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) {
+                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> rawHeaders = Stream.of("车辆所属单位", "车牌号码", "车辆类型", "车辆来源", "车辆使用性质",
+                "行驶时长(小时)", "行驶天数", "总里程(公里)", "OBD总油耗(升)", "百公里油耗(升)", "日期").toList();
+        List<String> headers = Stream.of("che_liang_suo_shu_dan_wei", "che_pai_hao", "che_liang_lei_xing",
+                "che_liang_lai_yuan", "che_liang_shi_yong_xing_zhi", "xing_shi_shi_chang", "xing_shi_tian_shu",
+                "zong_li_cheng", "obd_you_hao", "bai_gong_li_you_hao", "data_date").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 cellValue = "";
+                    rowMap.put(headers.get(j), cellValue);
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    switch (cell.getCellType()) {
+                        case STRING:
+                            // 删除字符串空白字符
+                            cellValue = StringUtils.trimAllWhitespace(cell.getStringCellValue());
+                            break;
+                        case NUMERIC:
+                            if (DateUtil.isCellDateFormatted(cell)) {
+                                cellValue = DateUtil.getLocalDateTime(cell.getNumericCellValue())
+                                        .format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+                                break;
+                            }
+                            cellValue = String.valueOf(cell.getNumericCellValue());
+                            break;
+                        case BOOLEAN:
+                            cellValue = String.valueOf(cell.getBooleanCellValue());
+                            break;
+                        default:
+                            break;
+                    }
+                    rowMap.put(headers.get(j), 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 dataDate = map.get("data_date");
+            LocalDate localDate = LocalDate.parse(dataDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+            String yearMonth = localDate.format(DateTimeFormatter.ofPattern("yyyyMM"));
+            String year = String.valueOf(localDate.getYear());
+            String month = String.valueOf(localDate.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);
+            if ("1".equals(baoFei)) {
+                map.put("che_pai_hao", rawChePaiHao);
+            }
+            map.put("source", path.getFileName().toString());
+        }
+        // 去重
+        return list.stream().filter(distinctByKey(map -> map.get("che_pai_hao"))).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.getCarLiChengDayHistoryPath()));
+        Path csvPath = Paths.get(jobConfig.getCarLiChengDayHistoryPath() + 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_li_cheng_day";
+        String csv = path.toString();
+        String columns = "(che_liang_suo_shu_dan_wei,che_pai_hao,che_liang_lei_xing,che_liang_lai_yuan,che_liang_shi_yong_xing_zhi,xing_shi_shi_chang,xing_shi_tian_shu,zong_li_cheng,obd_you_hao,bai_gong_li_you_hao,data_date,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.getCarLiChengDayHistoryPath(), path.getFileName().toString());
+        Files.move(path, targetPath, StandardCopyOption.REPLACE_EXISTING);
+    }
+}

+ 1 - 1
src/main/java/com/nokia/finance/tasks/pojo/RunJobDto.java → src/main/java/com/nokia/finance/tasks/pojo/dto/RunJobDto.java

@@ -1,4 +1,4 @@
-package com.nokia.finance.tasks.pojo;
+package com.nokia.finance.tasks.pojo.dto;
 
 import com.nokia.finance.tasks.enums.JobEnum;
 import lombok.Data;

+ 9 - 2
src/main/java/com/nokia/finance/tasks/service/JobService.java

@@ -10,6 +10,7 @@ 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.ruixing.CarBaoFeiJob;
 import com.nokia.finance.tasks.jobs.car.ruixing.CarBaseDataDayJob;
+import com.nokia.finance.tasks.jobs.car.ruixing.CarLiChengDayJob;
 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;
@@ -17,7 +18,7 @@ import com.nokia.finance.tasks.jobs.car.ruixing.CarYueJieJob;
 import com.nokia.finance.tasks.jobs.car.shujucangku.CarFeeBsJob;
 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 com.nokia.finance.tasks.pojo.dto.RunJobDto;
 import org.springframework.stereotype.Service;
 
 @Service
@@ -38,13 +39,15 @@ public class JobService {
     private final CarFeeHbJob carFeeHbJob;
     private final CarFeeBsJob carFeeBsJob;
     private final HouseBuildingRepairMonthJob houseBuildingRepairMonthJob;
+    private final CarLiChengDayJob carLiChengDayJob;
 
     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, CarFeeHbJob carFeeHbJob,
-                      CarFeeBsJob carFeeBsJob, HouseBuildingRepairMonthJob houseBuildingRepairMonthJob) {
+                      CarFeeBsJob carFeeBsJob, HouseBuildingRepairMonthJob houseBuildingRepairMonthJob,
+                      CarLiChengDayJob carLiChengDayJob) {
         this.carBaseDataDayJob = carBaseDataDayJob;
         this.carYueJieJob = carYueJieJob;
         this.carBaoFeiJob = carBaoFeiJob;
@@ -61,6 +64,7 @@ public class JobService {
         this.carFeeHbJob = carFeeHbJob;
         this.carFeeBsJob = carFeeBsJob;
         this.houseBuildingRepairMonthJob = houseBuildingRepairMonthJob;
+        this.carLiChengDayJob = carLiChengDayJob;
     }
 
     public R<Object> runJob(RunJobDto dto) {
@@ -113,6 +117,9 @@ public class JobService {
             case HOUSE_BUILDING_REPAIR_MONTH_JOB:
                 houseBuildingRepairMonthJob.runJob();
                 break;
+            case CAR_LI_CHENG_DAY_JOB:
+                carLiChengDayJob.runJob();
+                break;
             default:
                 break;
         }

+ 9 - 14
src/main/java/com/nokia/finance/tasks/service/car/CarService.java

@@ -131,19 +131,6 @@ public class CarService {
         return "省公司本部";
     }
 
-    /**
-     * 获取车辆类型
-     */
-    public String getCheLiangLeiXing(String cheLiangLeiXing) {
-        if (!StringUtils.hasText(cheLiangLeiXing)) {
-            return "";
-        }
-        if (cheLiangLeiXing.contains("特种车")) {
-            return "特种车";
-        }
-        return cheLiangLeiXing;
-    }
-
     /**
      * 获取而二级单位
      * @param unit 单位
@@ -178,6 +165,9 @@ public class CarService {
             if (unit.contains("高开区")) {
                 return "唐山高开区";
             }
+            if (unit.contains("滦州")) {
+                return "滦县";
+            }
         }
         List<String> ejs = ER_JI_MAP.get(firstUnit);
         if (CollectionUtils.isEmpty(ejs)) {
@@ -274,12 +264,17 @@ public class CarService {
         }
         if ("秦皇岛".equals(areaName)) {
             if (unit.contains("北戴河新区")) {
-                return "D0130185";
+                return "D0130325";
             }
             if (unit.contains("北戴河")) {
                 return "D0130304";
             }
         }
+        if ("邯郸".equals(areaName)) {
+            if (unit.contains("峰峰")) {
+                return "D0130406";
+            }
+        }
         if ("省机动局".equals(areaName)) {
             if (unit.contains("沧州")) {
                 return "HECS180";

+ 22 - 3
src/main/resources/application-dev.yml

@@ -7,9 +7,13 @@ logging:
 spring:
   datasource:
     driver-class-name: org.postgresql.Driver
-    username: postgres
-    password: Test!234
-    url: jdbc:postgresql://127.0.0.1:5432/financialdb
+#    username: postgres
+#    password: Test!234
+#    url: jdbc:postgresql://127.0.0.1:5432/financialdb
+#    url: jdbc:postgresql://192.168.65.128:5432/financialdb
+    username: finance
+    password: Finance@unicom23
+    url: jdbc:postgresql://172.16.107.5:5432/financialdb
 job:
   config:
     # copy脚本路径
@@ -83,3 +87,18 @@ job:
     house-building-repair-month-source-path: data/jzftp/HE_M_MTC_HOUSE/
     # 河北成本管理系统自有类房产维修数据归档路径
     house-building-repair-month-history-path: data/history/jzftp/HE_M_MTC_HOUSE/
+    # 睿行车辆行驶里程日数据路径
+    car-li-cheng-day-source-path: data/rxftp/xslcrtj/
+    # 睿行车辆行驶里程日数据归档路径
+    car-li-cheng-day-history-path: data/history/rxftp/xslcrtj/
+    car-wdyj-output-path: data/dsjftp/car_strategy/car_wdyj/
+    car-high-fuel-consumption-output-path: data/dsjftp/car_strategy/car_high_fuel_consumption/
+    car-high-repair-output-path: data/dsjftp/car_strategy/car_high_repair/
+    car-inefficiency-percent-output-path: data/dsjftp/car_strategy/car_inefficiency_percent/
+    car-inefficiency-qx-output-path: data/dsjftp/car_strategy/car_inefficiency_qx/
+    car-rental-repair-output-path: data/dsjftp/car_strategy/car_rental_repair/
+    car-violation-unprocessed-output-path: data/dsjftp/car_strategy/car_violation_unprocessed/
+    car-cxdp-output-path: data/dsjftp/car_cxdp/
+    house-building-area-stat-output-path: data/dsjftp/fcdp/building_area_stat/
+    house-building-land-count-output-path: data/dsjftp/fcdp/building_land_count/
+    house-rental-income-output-path: data/dsjftp/fcdp/rental_income/

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

@@ -83,3 +83,15 @@ job:
     house-building-repair-month-source-path: /data/jzftp/HE_M_MTC_HOUSE/
     # 河北成本管理系统自有类房产维修数据归档路径
     house-building-repair-month-history-path: /data/history/jzftp/HE_M_MTC_HOUSE/
+    # 睿行车辆行驶里程日数据路径
+    car-li-cheng-day-source-path: /data/rxftp/xslcrtj/
+    # 睿行车辆行驶里程日数据归档路径
+    car-li-cheng-day-history-path: /data/history/rxftp/xslcrtj/
+    car-wdyj-output-path: /data/dsjftp/car_strategy/car_wdyj/
+    car-high-fuel-consumption-output-path: /data/dsjftp/car_strategy/car_high_fuel_consumption/
+    car-high-repair-output-path: /data/dsjftp/car_strategy/car_high_repair/
+    car-inefficiency-percent-output-path: /data/dsjftp/car_strategy/car_inefficiency_percent/
+    car-inefficiency-qx-output-path: /data/dsjftp/car_strategy/car_inefficiency_qx/
+    car-rental-repair-output-path: /data/dsjftp/car_strategy/car_rental_repair/
+    car-violation-unprocessed-output-path: /data/dsjftp/car_strategy/car_violation_unprocessed/
+    car-cxdp-output-path: /data/dsjftp/car_cxdp/

+ 0 - 3
src/main/resources/application.yml

@@ -1,3 +0,0 @@
-mybatis-plus:
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

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

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