|  | @@ -1,407 +1,407 @@
 | 
											
												
													
														|  | -package com.nokia.finance.tasks.car;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -import com.nokia.finance.tasks.common.exception.MyRuntimeException;
 |  | 
 | 
											
												
													
														|  | -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.Data;
 |  | 
 | 
											
												
													
														|  | -import lombok.NoArgsConstructor;
 |  | 
 | 
											
												
													
														|  | -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.junit.jupiter.api.Test;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.beans.factory.annotation.Autowired;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.boot.test.context.SpringBootTest;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.test.context.ActiveProfiles;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.util.CollectionUtils;
 |  | 
 | 
											
												
													
														|  | -import org.springframework.util.StringUtils;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -import java.io.InputStream;
 |  | 
 | 
											
												
													
														|  | -import java.io.OutputStreamWriter;
 |  | 
 | 
											
												
													
														|  | -import java.math.BigDecimal;
 |  | 
 | 
											
												
													
														|  | -import java.nio.charset.StandardCharsets;
 |  | 
 | 
											
												
													
														|  | -import java.nio.file.Files;
 |  | 
 | 
											
												
													
														|  | -import java.nio.file.Path;
 |  | 
 | 
											
												
													
														|  | -import java.nio.file.Paths;
 |  | 
 | 
											
												
													
														|  | -import java.time.Duration;
 |  | 
 | 
											
												
													
														|  | -import java.time.LocalDateTime;
 |  | 
 | 
											
												
													
														|  | -import java.time.format.DateTimeFormatter;
 |  | 
 | 
											
												
													
														|  | -import java.util.ArrayList;
 |  | 
 | 
											
												
													
														|  | -import java.util.Comparator;
 |  | 
 | 
											
												
													
														|  | -import java.util.HashMap;
 |  | 
 | 
											
												
													
														|  | -import java.util.LinkedHashMap;
 |  | 
 | 
											
												
													
														|  | -import java.util.List;
 |  | 
 | 
											
												
													
														|  | -import java.util.Map;
 |  | 
 | 
											
												
													
														|  | -import java.util.Objects;
 |  | 
 | 
											
												
													
														|  | -import java.util.stream.Stream;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -@Slf4j
 |  | 
 | 
											
												
													
														|  | -@SpringBootTest
 |  | 
 | 
											
												
													
														|  | -@ActiveProfiles("dev")
 |  | 
 | 
											
												
													
														|  | -class CarLianXuJiaYouTests {
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | -    CarService carService;
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | -    OrganizationService organizationService;
 |  | 
 | 
											
												
													
														|  | -    @Autowired
 |  | 
 | 
											
												
													
														|  | -    AreaService areaService;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    /**
 |  | 
 | 
											
												
													
														|  | -     * 执行任务
 |  | 
 | 
											
												
													
														|  | -     */
 |  | 
 | 
											
												
													
														|  | -    @Test
 |  | 
 | 
											
												
													
														|  | -    void runJob() {
 |  | 
 | 
											
												
													
														|  | -        // 数据目录
 |  | 
 | 
											
												
													
														|  | -        Path dir = Paths.get("test/data/lian-xu-jia-you");
 |  | 
 | 
											
												
													
														|  | -        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.toString(), 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);
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    /**
 |  | 
 | 
											
												
													
														|  | -     * 读取文件
 |  | 
 | 
											
												
													
														|  | -     *
 |  | 
 | 
											
												
													
														|  | -     * @param path 文件路径
 |  | 
 | 
											
												
													
														|  | -     */
 |  | 
 | 
											
												
													
														|  | -    public List<Map<String, String>> readFile(Path path) throws Exception {
 |  | 
 | 
											
												
													
														|  | -        log.info("读取: {}", path);
 |  | 
 | 
											
												
													
														|  | -        List<String> headers = Stream.of("shen_qing_dan_hao", "shen_qing_dan_ming_cheng", "bao_zhang_shi_jian",
 |  | 
 | 
											
												
													
														|  | -                "di_shi", "shen_qing_ren", "ka_hao", "che_pai_hao", "jiao_yi_shi_jian", "bu_han_shui_jin_e", "shui_lv",
 |  | 
 | 
											
												
													
														|  | -                "shui_e", "jia_shui_he_ji_jin_e", "che_liang_suo_shu_dan_wei", "di_dian").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);
 |  | 
 | 
											
												
													
														|  | -            // 最后行数
 |  | 
 | 
											
												
													
														|  | -            int lastRowNum = sheet.getLastRowNum();
 |  | 
 | 
											
												
													
														|  | -            log.info("lastRowNum: {}", lastRowNum);
 |  | 
 | 
											
												
													
														|  | -            if (lastRowNum == 0) {
 |  | 
 | 
											
												
													
														|  | -                throw new MyRuntimeException(path.getFileName() + " 数据0条");
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            // 遍历行
 |  | 
 | 
											
												
													
														|  | -            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 = "bao_zhang_shi_jian".equals(header) || "jiao_yi_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(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);
 |  | 
 | 
											
												
													
														|  | -        // 按车牌号分组
 |  | 
 | 
											
												
													
														|  | -        Map<String, List<CarLianXuJiaYouBo>> carLianXuJiaYouMap = new HashMap<>();
 |  | 
 | 
											
												
													
														|  | -        for (Map<String, String> map : list) {
 |  | 
 | 
											
												
													
														|  | -            String jiaoYiShiJian = map.get("jiao_yi_shi_jian");
 |  | 
 | 
											
												
													
														|  | -            LocalDateTime localDateTime = LocalDateTime.parse(jiaoYiShiJian, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
 |  | 
 | 
											
												
													
														|  | -            String jiaoYiDate = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
 |  | 
 | 
											
												
													
														|  | -            String yearMonth = localDateTime.format(DateTimeFormatter.ofPattern("yyyyMM"));
 |  | 
 | 
											
												
													
														|  | -            String year = String.valueOf(localDateTime.getYear());
 |  | 
 | 
											
												
													
														|  | -            String month = String.valueOf(localDateTime.getMonthValue());
 |  | 
 | 
											
												
													
														|  | -            map.put("jiao_yi_date", jiaoYiDate);
 |  | 
 | 
											
												
													
														|  | -            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);
 |  | 
 | 
											
												
													
														|  | -            map.put("source", path.getFileName().toString());
 |  | 
 | 
											
												
													
														|  | -            carLianXuJiaYouMap.putIfAbsent(chePaiHao, new ArrayList<>());
 |  | 
 | 
											
												
													
														|  | -            List<CarLianXuJiaYouBo> carLianXuJiaYouBoList = carLianXuJiaYouMap.get(chePaiHao);
 |  | 
 | 
											
												
													
														|  | -            carLianXuJiaYouBoList.add(new CarLianXuJiaYouBo(map, localDateTime));
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        List<CarLianXuJiaYouBo> result = new ArrayList<>();
 |  | 
 | 
											
												
													
														|  | -        for (List<CarLianXuJiaYouBo> l1 : carLianXuJiaYouMap.values()) {
 |  | 
 | 
											
												
													
														|  | -            List<CarLianXuJiaYouBo> l2 = l1.stream()
 |  | 
 | 
											
												
													
														|  | -                    .sorted(Comparator.comparing(CarLianXuJiaYouBo::getLocalDateTime)).toList();
 |  | 
 | 
											
												
													
														|  | -            result.addAll(l2);
 |  | 
 | 
											
												
													
														|  | -            int size = l2.size() - 1;
 |  | 
 | 
											
												
													
														|  | -            for (int i = 0; i < size; i++) {
 |  | 
 | 
											
												
													
														|  | -                CarLianXuJiaYouBo t1 = l2.get(i);
 |  | 
 | 
											
												
													
														|  | -                CarLianXuJiaYouBo t2 = l2.get(i + 1);
 |  | 
 | 
											
												
													
														|  | -                Duration duration = Duration.between(t1.getLocalDateTime(), t2.getLocalDateTime());
 |  | 
 | 
											
												
													
														|  | -                long hours = duration.toHours();
 |  | 
 | 
											
												
													
														|  | -                if (hours <= 48) {
 |  | 
 | 
											
												
													
														|  | -                    t1.setNextJiaoYiShiJian(t2.getJiaoYiShiJian());
 |  | 
 | 
											
												
													
														|  | -                    t1.setNextJiaoYiDate(t2.getJiaoYiDate());
 |  | 
 | 
											
												
													
														|  | -                    t1.setNextBuHanShuiJinE(t2.getBuHanShuiJinE());
 |  | 
 | 
											
												
													
														|  | -                    long seconds = duration.toSeconds();
 |  | 
 | 
											
												
													
														|  | -                    t1.setTimeInterval(String.valueOf(seconds));
 |  | 
 | 
											
												
													
														|  | -                    BigDecimal n1 = new BigDecimal(Objects.requireNonNull(t1.getBuHanShuiJinE(), "0"));
 |  | 
 | 
											
												
													
														|  | -                    BigDecimal n2 = new BigDecimal(Objects.requireNonNull(t2.getBuHanShuiJinE(), "0"));
 |  | 
 | 
											
												
													
														|  | -                    t1.setBuHanShuiJinESum(n1.add(n2).toString());
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        return result.stream().map(CarLianXuJiaYouBo::toMap).toList();
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    /**
 |  | 
 | 
											
												
													
														|  | -     * 生成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("test/history/"));
 |  | 
 | 
											
												
													
														|  | -        Path csvPath = Paths.get("test/history/" + 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;
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    @NoArgsConstructor
 |  | 
 | 
											
												
													
														|  | -    @Data
 |  | 
 | 
											
												
													
														|  | -    static class CarLianXuJiaYouBo {
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        private String shenQingDanHao;
 |  | 
 | 
											
												
													
														|  | -        private String shenQingDanMingCheng;
 |  | 
 | 
											
												
													
														|  | -        private String baoZhangShiJian;
 |  | 
 | 
											
												
													
														|  | -        private String diShi;
 |  | 
 | 
											
												
													
														|  | -        private String shenQingRen;
 |  | 
 | 
											
												
													
														|  | -        private String kaHao;
 |  | 
 | 
											
												
													
														|  | -        private String chePaiHao;
 |  | 
 | 
											
												
													
														|  | -        private String jiaoYiShiJian;
 |  | 
 | 
											
												
													
														|  | -        private String buHanShuiJinE;
 |  | 
 | 
											
												
													
														|  | -        private String shuiLv;
 |  | 
 | 
											
												
													
														|  | -        private String shuiE;
 |  | 
 | 
											
												
													
														|  | -        private String jiaShuiHeJiJinE;
 |  | 
 | 
											
												
													
														|  | -        private String cheLiangSuoShuDanWei;
 |  | 
 | 
											
												
													
														|  | -        private String diDian;
 |  | 
 | 
											
												
													
														|  | -        private String jiaoYiDate;
 |  | 
 | 
											
												
													
														|  | -        private String yearMonth;
 |  | 
 | 
											
												
													
														|  | -        private String yearNo;
 |  | 
 | 
											
												
													
														|  | -        private String monthNo;
 |  | 
 | 
											
												
													
														|  | -        private String rawChePaiHao;
 |  | 
 | 
											
												
													
														|  | -        private String chePaiFail;
 |  | 
 | 
											
												
													
														|  | -        private String firstUnit;
 |  | 
 | 
											
												
													
														|  | -        private String secondUnit;
 |  | 
 | 
											
												
													
														|  | -        private String thirdUnit;
 |  | 
 | 
											
												
													
														|  | -        private String areaNo;
 |  | 
 | 
											
												
													
														|  | -        private String areaName;
 |  | 
 | 
											
												
													
														|  | -        private String cityNo;
 |  | 
 | 
											
												
													
														|  | -        private String cityName;
 |  | 
 | 
											
												
													
														|  | -        private String areaNo2;
 |  | 
 | 
											
												
													
														|  | -        private String areaName2;
 |  | 
 | 
											
												
													
														|  | -        private String cityId;
 |  | 
 | 
											
												
													
														|  | -        private String city;
 |  | 
 | 
											
												
													
														|  | -        private String districtId;
 |  | 
 | 
											
												
													
														|  | -        private String district;
 |  | 
 | 
											
												
													
														|  | -        private String source;
 |  | 
 | 
											
												
													
														|  | -        private LocalDateTime localDateTime;
 |  | 
 | 
											
												
													
														|  | -        private String nextJiaoYiShiJian;
 |  | 
 | 
											
												
													
														|  | -        private String nextJiaoYiDate;
 |  | 
 | 
											
												
													
														|  | -        private String nextBuHanShuiJinE;
 |  | 
 | 
											
												
													
														|  | -        private String timeInterval;
 |  | 
 | 
											
												
													
														|  | -        private String buHanShuiJinESum;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        public CarLianXuJiaYouBo(Map<String, String> map, LocalDateTime localDateTime) {
 |  | 
 | 
											
												
													
														|  | -            this.shenQingDanHao = map.get("shen_qing_dan_hao");
 |  | 
 | 
											
												
													
														|  | -            this.shenQingDanMingCheng = map.get("shen_qing_dan_ming_cheng");
 |  | 
 | 
											
												
													
														|  | -            this.baoZhangShiJian = map.get("bao_zhang_shi_jian");
 |  | 
 | 
											
												
													
														|  | -            this.diShi = map.get("di_shi");
 |  | 
 | 
											
												
													
														|  | -            this.shenQingRen = map.get("shen_qing_ren");
 |  | 
 | 
											
												
													
														|  | -            this.kaHao = map.get("ka_hao");
 |  | 
 | 
											
												
													
														|  | -            this.chePaiHao = map.get("che_pai_hao");
 |  | 
 | 
											
												
													
														|  | -            this.jiaoYiShiJian = map.get("jiao_yi_shi_jian");
 |  | 
 | 
											
												
													
														|  | -            this.buHanShuiJinE = map.get("bu_han_shui_jin_e");
 |  | 
 | 
											
												
													
														|  | -            this.shuiLv = map.get("shui_lv");
 |  | 
 | 
											
												
													
														|  | -            this.shuiE = map.get("shui_e");
 |  | 
 | 
											
												
													
														|  | -            this.jiaShuiHeJiJinE =map.get("jia_shui_he_ji_jin_e");
 |  | 
 | 
											
												
													
														|  | -            this.cheLiangSuoShuDanWei = map.get("che_liang_suo_shu_dan_wei");
 |  | 
 | 
											
												
													
														|  | -            this.diDian = map.get("di_dian");
 |  | 
 | 
											
												
													
														|  | -            this.jiaoYiDate = map.get("jiao_yi_date");
 |  | 
 | 
											
												
													
														|  | -            this.yearMonth = map.get("year_month");
 |  | 
 | 
											
												
													
														|  | -            this.yearNo = map.get("year_no");
 |  | 
 | 
											
												
													
														|  | -            this.monthNo = map.get("month_no");
 |  | 
 | 
											
												
													
														|  | -            this.rawChePaiHao = map.get("raw_che_pai_hao");
 |  | 
 | 
											
												
													
														|  | -            this.chePaiFail = map.get("che_pai_fail");
 |  | 
 | 
											
												
													
														|  | -            this.firstUnit = map.get("first_unit");
 |  | 
 | 
											
												
													
														|  | -            this.secondUnit = map.get("second_unit");
 |  | 
 | 
											
												
													
														|  | -            this.thirdUnit = map.get("third_unit");
 |  | 
 | 
											
												
													
														|  | -            this.areaNo = map.get("area_no");
 |  | 
 | 
											
												
													
														|  | -            this.areaName = map.get("area_name");
 |  | 
 | 
											
												
													
														|  | -            this.cityNo = map.get("city_no");
 |  | 
 | 
											
												
													
														|  | -            this.cityName = map.get("city_name");
 |  | 
 | 
											
												
													
														|  | -            this.areaNo2 = map.get("area_no2");
 |  | 
 | 
											
												
													
														|  | -            this.areaName2 = map.get("area_name2");
 |  | 
 | 
											
												
													
														|  | -            this.cityId = map.get("city_id");
 |  | 
 | 
											
												
													
														|  | -            this.city = map.get("city");
 |  | 
 | 
											
												
													
														|  | -            this.districtId = map.get("district_id");
 |  | 
 | 
											
												
													
														|  | -            this.district = map.get("district");
 |  | 
 | 
											
												
													
														|  | -            this.source = map.get("source");
 |  | 
 | 
											
												
													
														|  | -            this.localDateTime = localDateTime;
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        public Map<String, String> toMap() {
 |  | 
 | 
											
												
													
														|  | -            LinkedHashMap<String, String> map = new LinkedHashMap<>();
 |  | 
 | 
											
												
													
														|  | -            map.put("shen_qing_dan_hao", shenQingDanHao);
 |  | 
 | 
											
												
													
														|  | -            map.put("shen_qing_dan_ming_cheng", shenQingDanMingCheng);
 |  | 
 | 
											
												
													
														|  | -            map.put("bao_zhang_shi_jian", baoZhangShiJian);
 |  | 
 | 
											
												
													
														|  | -            map.put("di_shi", diShi);
 |  | 
 | 
											
												
													
														|  | -            map.put("shen_qing_ren", shenQingRen);
 |  | 
 | 
											
												
													
														|  | -            map.put("ka_hao", kaHao);
 |  | 
 | 
											
												
													
														|  | -            map.put("che_pai_hao", chePaiHao);
 |  | 
 | 
											
												
													
														|  | -            map.put("jiao_yi_shi_jian", jiaoYiShiJian);
 |  | 
 | 
											
												
													
														|  | -            map.put("bu_han_shui_jin_e", buHanShuiJinE);
 |  | 
 | 
											
												
													
														|  | -            map.put("shui_lv", shuiLv);
 |  | 
 | 
											
												
													
														|  | -            map.put("shui_e", shuiE);
 |  | 
 | 
											
												
													
														|  | -            map.put("jia_shui_he_ji_jin_e", jiaShuiHeJiJinE);
 |  | 
 | 
											
												
													
														|  | -            map.put("che_liang_suo_shu_dan_wei", cheLiangSuoShuDanWei);
 |  | 
 | 
											
												
													
														|  | -            map.put("di_dian", diDian);
 |  | 
 | 
											
												
													
														|  | -            map.put("jiao_yi_date", jiaoYiDate);
 |  | 
 | 
											
												
													
														|  | -            map.put("year_month", yearMonth);
 |  | 
 | 
											
												
													
														|  | -            map.put("year_no", yearNo);
 |  | 
 | 
											
												
													
														|  | -            map.put("month_no", monthNo);
 |  | 
 | 
											
												
													
														|  | -            map.put("raw_che_pai_hao", rawChePaiHao);
 |  | 
 | 
											
												
													
														|  | -            map.put("che_pai_fail", chePaiFail);
 |  | 
 | 
											
												
													
														|  | -            map.put("first_unit", firstUnit);
 |  | 
 | 
											
												
													
														|  | -            map.put("second_unit", secondUnit);
 |  | 
 | 
											
												
													
														|  | -            map.put("third_unit", thirdUnit);
 |  | 
 | 
											
												
													
														|  | -            map.put("area_no", areaNo);
 |  | 
 | 
											
												
													
														|  | -            map.put("area_name", areaName);
 |  | 
 | 
											
												
													
														|  | -            map.put("city_no", cityNo);
 |  | 
 | 
											
												
													
														|  | -            map.put("city_name", cityName);
 |  | 
 | 
											
												
													
														|  | -            map.put("area_no2", areaNo2);
 |  | 
 | 
											
												
													
														|  | -            map.put("area_name2", areaName2);
 |  | 
 | 
											
												
													
														|  | -            map.put("city_id", cityId);
 |  | 
 | 
											
												
													
														|  | -            map.put("city", city);
 |  | 
 | 
											
												
													
														|  | -            map.put("district_id", districtId);
 |  | 
 | 
											
												
													
														|  | -            map.put("district", district);
 |  | 
 | 
											
												
													
														|  | -            map.put("source", source);
 |  | 
 | 
											
												
													
														|  | -            map.put("next_jiao_yi_shi_jian", nextJiaoYiShiJian);
 |  | 
 | 
											
												
													
														|  | -            map.put("next_jiao_yi_date", nextJiaoYiDate);
 |  | 
 | 
											
												
													
														|  | -            map.put("next_bu_han_shui_jin_e", nextBuHanShuiJinE);
 |  | 
 | 
											
												
													
														|  | -            map.put("time_interval", timeInterval);
 |  | 
 | 
											
												
													
														|  | -            map.put("bu_han_shui_jin_e_sum", buHanShuiJinESum);
 |  | 
 | 
											
												
													
														|  | -            return map;
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -}
 |  | 
 | 
											
												
													
														|  | 
 |  | +//package com.nokia.finance.tasks.car;
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//import com.nokia.finance.tasks.common.exception.MyRuntimeException;
 | 
											
												
													
														|  | 
 |  | +//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.Data;
 | 
											
												
													
														|  | 
 |  | +//import lombok.NoArgsConstructor;
 | 
											
												
													
														|  | 
 |  | +//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.junit.jupiter.api.Test;
 | 
											
												
													
														|  | 
 |  | +//import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  | 
 |  | +//import org.springframework.boot.test.context.SpringBootTest;
 | 
											
												
													
														|  | 
 |  | +//import org.springframework.test.context.ActiveProfiles;
 | 
											
												
													
														|  | 
 |  | +//import org.springframework.util.CollectionUtils;
 | 
											
												
													
														|  | 
 |  | +//import org.springframework.util.StringUtils;
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//import java.io.InputStream;
 | 
											
												
													
														|  | 
 |  | +//import java.io.OutputStreamWriter;
 | 
											
												
													
														|  | 
 |  | +//import java.math.BigDecimal;
 | 
											
												
													
														|  | 
 |  | +//import java.nio.charset.StandardCharsets;
 | 
											
												
													
														|  | 
 |  | +//import java.nio.file.Files;
 | 
											
												
													
														|  | 
 |  | +//import java.nio.file.Path;
 | 
											
												
													
														|  | 
 |  | +//import java.nio.file.Paths;
 | 
											
												
													
														|  | 
 |  | +//import java.time.Duration;
 | 
											
												
													
														|  | 
 |  | +//import java.time.LocalDateTime;
 | 
											
												
													
														|  | 
 |  | +//import java.time.format.DateTimeFormatter;
 | 
											
												
													
														|  | 
 |  | +//import java.util.ArrayList;
 | 
											
												
													
														|  | 
 |  | +//import java.util.Comparator;
 | 
											
												
													
														|  | 
 |  | +//import java.util.HashMap;
 | 
											
												
													
														|  | 
 |  | +//import java.util.LinkedHashMap;
 | 
											
												
													
														|  | 
 |  | +//import java.util.List;
 | 
											
												
													
														|  | 
 |  | +//import java.util.Map;
 | 
											
												
													
														|  | 
 |  | +//import java.util.Objects;
 | 
											
												
													
														|  | 
 |  | +//import java.util.stream.Stream;
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//@Slf4j
 | 
											
												
													
														|  | 
 |  | +//@SpringBootTest
 | 
											
												
													
														|  | 
 |  | +//@ActiveProfiles("dev")
 | 
											
												
													
														|  | 
 |  | +//class CarLianXuJiaYouTests {
 | 
											
												
													
														|  | 
 |  | +//    @Autowired
 | 
											
												
													
														|  | 
 |  | +//    CarService carService;
 | 
											
												
													
														|  | 
 |  | +//    @Autowired
 | 
											
												
													
														|  | 
 |  | +//    OrganizationService organizationService;
 | 
											
												
													
														|  | 
 |  | +//    @Autowired
 | 
											
												
													
														|  | 
 |  | +//    AreaService areaService;
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//    /**
 | 
											
												
													
														|  | 
 |  | +//     * 执行任务
 | 
											
												
													
														|  | 
 |  | +//     */
 | 
											
												
													
														|  | 
 |  | +//    @Test
 | 
											
												
													
														|  | 
 |  | +//    void runJob() {
 | 
											
												
													
														|  | 
 |  | +//        // 数据目录
 | 
											
												
													
														|  | 
 |  | +//        Path dir = Paths.get("test/data/lian-xu-jia-you");
 | 
											
												
													
														|  | 
 |  | +//        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.toString(), 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);
 | 
											
												
													
														|  | 
 |  | +//    }
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//    /**
 | 
											
												
													
														|  | 
 |  | +//     * 读取文件
 | 
											
												
													
														|  | 
 |  | +//     *
 | 
											
												
													
														|  | 
 |  | +//     * @param path 文件路径
 | 
											
												
													
														|  | 
 |  | +//     */
 | 
											
												
													
														|  | 
 |  | +//    public List<Map<String, String>> readFile(Path path) throws Exception {
 | 
											
												
													
														|  | 
 |  | +//        log.info("读取: {}", path);
 | 
											
												
													
														|  | 
 |  | +//        List<String> headers = Stream.of("shen_qing_dan_hao", "shen_qing_dan_ming_cheng", "bao_zhang_shi_jian",
 | 
											
												
													
														|  | 
 |  | +//                "di_shi", "shen_qing_ren", "ka_hao", "che_pai_hao", "jiao_yi_shi_jian", "bu_han_shui_jin_e", "shui_lv",
 | 
											
												
													
														|  | 
 |  | +//                "shui_e", "jia_shui_he_ji_jin_e", "che_liang_suo_shu_dan_wei", "di_dian").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);
 | 
											
												
													
														|  | 
 |  | +//            // 最后行数
 | 
											
												
													
														|  | 
 |  | +//            int lastRowNum = sheet.getLastRowNum();
 | 
											
												
													
														|  | 
 |  | +//            log.info("lastRowNum: {}", lastRowNum);
 | 
											
												
													
														|  | 
 |  | +//            if (lastRowNum == 0) {
 | 
											
												
													
														|  | 
 |  | +//                throw new MyRuntimeException(path.getFileName() + " 数据0条");
 | 
											
												
													
														|  | 
 |  | +//            }
 | 
											
												
													
														|  | 
 |  | +//            // 遍历行
 | 
											
												
													
														|  | 
 |  | +//            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 = "bao_zhang_shi_jian".equals(header) || "jiao_yi_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(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);
 | 
											
												
													
														|  | 
 |  | +//        // 按车牌号分组
 | 
											
												
													
														|  | 
 |  | +//        Map<String, List<CarLianXuJiaYouBo>> carLianXuJiaYouMap = new HashMap<>();
 | 
											
												
													
														|  | 
 |  | +//        for (Map<String, String> map : list) {
 | 
											
												
													
														|  | 
 |  | +//            String jiaoYiShiJian = map.get("jiao_yi_shi_jian");
 | 
											
												
													
														|  | 
 |  | +//            LocalDateTime localDateTime = LocalDateTime.parse(jiaoYiShiJian, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
 | 
											
												
													
														|  | 
 |  | +//            String jiaoYiDate = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
 | 
											
												
													
														|  | 
 |  | +//            String yearMonth = localDateTime.format(DateTimeFormatter.ofPattern("yyyyMM"));
 | 
											
												
													
														|  | 
 |  | +//            String year = String.valueOf(localDateTime.getYear());
 | 
											
												
													
														|  | 
 |  | +//            String month = String.valueOf(localDateTime.getMonthValue());
 | 
											
												
													
														|  | 
 |  | +//            map.put("jiao_yi_date", jiaoYiDate);
 | 
											
												
													
														|  | 
 |  | +//            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);
 | 
											
												
													
														|  | 
 |  | +//            map.put("source", path.getFileName().toString());
 | 
											
												
													
														|  | 
 |  | +//            carLianXuJiaYouMap.putIfAbsent(chePaiHao, new ArrayList<>());
 | 
											
												
													
														|  | 
 |  | +//            List<CarLianXuJiaYouBo> carLianXuJiaYouBoList = carLianXuJiaYouMap.get(chePaiHao);
 | 
											
												
													
														|  | 
 |  | +//            carLianXuJiaYouBoList.add(new CarLianXuJiaYouBo(map, localDateTime));
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//        List<CarLianXuJiaYouBo> result = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +//        for (List<CarLianXuJiaYouBo> l1 : carLianXuJiaYouMap.values()) {
 | 
											
												
													
														|  | 
 |  | +//            List<CarLianXuJiaYouBo> l2 = l1.stream()
 | 
											
												
													
														|  | 
 |  | +//                    .sorted(Comparator.comparing(CarLianXuJiaYouBo::getLocalDateTime)).toList();
 | 
											
												
													
														|  | 
 |  | +//            result.addAll(l2);
 | 
											
												
													
														|  | 
 |  | +//            int size = l2.size() - 1;
 | 
											
												
													
														|  | 
 |  | +//            for (int i = 0; i < size; i++) {
 | 
											
												
													
														|  | 
 |  | +//                CarLianXuJiaYouBo t1 = l2.get(i);
 | 
											
												
													
														|  | 
 |  | +//                CarLianXuJiaYouBo t2 = l2.get(i + 1);
 | 
											
												
													
														|  | 
 |  | +//                Duration duration = Duration.between(t1.getLocalDateTime(), t2.getLocalDateTime());
 | 
											
												
													
														|  | 
 |  | +//                long hours = duration.toHours();
 | 
											
												
													
														|  | 
 |  | +//                if (hours <= 48) {
 | 
											
												
													
														|  | 
 |  | +//                    t1.setNextJiaoYiShiJian(t2.getJiaoYiShiJian());
 | 
											
												
													
														|  | 
 |  | +//                    t1.setNextJiaoYiDate(t2.getJiaoYiDate());
 | 
											
												
													
														|  | 
 |  | +//                    t1.setNextBuHanShuiJinE(t2.getBuHanShuiJinE());
 | 
											
												
													
														|  | 
 |  | +//                    long seconds = duration.toSeconds();
 | 
											
												
													
														|  | 
 |  | +//                    t1.setTimeInterval(String.valueOf(seconds));
 | 
											
												
													
														|  | 
 |  | +//                    BigDecimal n1 = new BigDecimal(Objects.requireNonNull(t1.getBuHanShuiJinE(), "0"));
 | 
											
												
													
														|  | 
 |  | +//                    BigDecimal n2 = new BigDecimal(Objects.requireNonNull(t2.getBuHanShuiJinE(), "0"));
 | 
											
												
													
														|  | 
 |  | +//                    t1.setBuHanShuiJinESum(n1.add(n2).toString());
 | 
											
												
													
														|  | 
 |  | +//                }
 | 
											
												
													
														|  | 
 |  | +//            }
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//        return result.stream().map(CarLianXuJiaYouBo::toMap).toList();
 | 
											
												
													
														|  | 
 |  | +//    }
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//    /**
 | 
											
												
													
														|  | 
 |  | +//     * 生成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("test/history/"));
 | 
											
												
													
														|  | 
 |  | +//        Path csvPath = Paths.get("test/history/" + 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;
 | 
											
												
													
														|  | 
 |  | +//    }
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//    @NoArgsConstructor
 | 
											
												
													
														|  | 
 |  | +//    @Data
 | 
											
												
													
														|  | 
 |  | +//    static class CarLianXuJiaYouBo {
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//        private String shenQingDanHao;
 | 
											
												
													
														|  | 
 |  | +//        private String shenQingDanMingCheng;
 | 
											
												
													
														|  | 
 |  | +//        private String baoZhangShiJian;
 | 
											
												
													
														|  | 
 |  | +//        private String diShi;
 | 
											
												
													
														|  | 
 |  | +//        private String shenQingRen;
 | 
											
												
													
														|  | 
 |  | +//        private String kaHao;
 | 
											
												
													
														|  | 
 |  | +//        private String chePaiHao;
 | 
											
												
													
														|  | 
 |  | +//        private String jiaoYiShiJian;
 | 
											
												
													
														|  | 
 |  | +//        private String buHanShuiJinE;
 | 
											
												
													
														|  | 
 |  | +//        private String shuiLv;
 | 
											
												
													
														|  | 
 |  | +//        private String shuiE;
 | 
											
												
													
														|  | 
 |  | +//        private String jiaShuiHeJiJinE;
 | 
											
												
													
														|  | 
 |  | +//        private String cheLiangSuoShuDanWei;
 | 
											
												
													
														|  | 
 |  | +//        private String diDian;
 | 
											
												
													
														|  | 
 |  | +//        private String jiaoYiDate;
 | 
											
												
													
														|  | 
 |  | +//        private String yearMonth;
 | 
											
												
													
														|  | 
 |  | +//        private String yearNo;
 | 
											
												
													
														|  | 
 |  | +//        private String monthNo;
 | 
											
												
													
														|  | 
 |  | +//        private String rawChePaiHao;
 | 
											
												
													
														|  | 
 |  | +//        private String chePaiFail;
 | 
											
												
													
														|  | 
 |  | +//        private String firstUnit;
 | 
											
												
													
														|  | 
 |  | +//        private String secondUnit;
 | 
											
												
													
														|  | 
 |  | +//        private String thirdUnit;
 | 
											
												
													
														|  | 
 |  | +//        private String areaNo;
 | 
											
												
													
														|  | 
 |  | +//        private String areaName;
 | 
											
												
													
														|  | 
 |  | +//        private String cityNo;
 | 
											
												
													
														|  | 
 |  | +//        private String cityName;
 | 
											
												
													
														|  | 
 |  | +//        private String areaNo2;
 | 
											
												
													
														|  | 
 |  | +//        private String areaName2;
 | 
											
												
													
														|  | 
 |  | +//        private String cityId;
 | 
											
												
													
														|  | 
 |  | +//        private String city;
 | 
											
												
													
														|  | 
 |  | +//        private String districtId;
 | 
											
												
													
														|  | 
 |  | +//        private String district;
 | 
											
												
													
														|  | 
 |  | +//        private String source;
 | 
											
												
													
														|  | 
 |  | +//        private LocalDateTime localDateTime;
 | 
											
												
													
														|  | 
 |  | +//        private String nextJiaoYiShiJian;
 | 
											
												
													
														|  | 
 |  | +//        private String nextJiaoYiDate;
 | 
											
												
													
														|  | 
 |  | +//        private String nextBuHanShuiJinE;
 | 
											
												
													
														|  | 
 |  | +//        private String timeInterval;
 | 
											
												
													
														|  | 
 |  | +//        private String buHanShuiJinESum;
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//        public CarLianXuJiaYouBo(Map<String, String> map, LocalDateTime localDateTime) {
 | 
											
												
													
														|  | 
 |  | +//            this.shenQingDanHao = map.get("shen_qing_dan_hao");
 | 
											
												
													
														|  | 
 |  | +//            this.shenQingDanMingCheng = map.get("shen_qing_dan_ming_cheng");
 | 
											
												
													
														|  | 
 |  | +//            this.baoZhangShiJian = map.get("bao_zhang_shi_jian");
 | 
											
												
													
														|  | 
 |  | +//            this.diShi = map.get("di_shi");
 | 
											
												
													
														|  | 
 |  | +//            this.shenQingRen = map.get("shen_qing_ren");
 | 
											
												
													
														|  | 
 |  | +//            this.kaHao = map.get("ka_hao");
 | 
											
												
													
														|  | 
 |  | +//            this.chePaiHao = map.get("che_pai_hao");
 | 
											
												
													
														|  | 
 |  | +//            this.jiaoYiShiJian = map.get("jiao_yi_shi_jian");
 | 
											
												
													
														|  | 
 |  | +//            this.buHanShuiJinE = map.get("bu_han_shui_jin_e");
 | 
											
												
													
														|  | 
 |  | +//            this.shuiLv = map.get("shui_lv");
 | 
											
												
													
														|  | 
 |  | +//            this.shuiE = map.get("shui_e");
 | 
											
												
													
														|  | 
 |  | +//            this.jiaShuiHeJiJinE =map.get("jia_shui_he_ji_jin_e");
 | 
											
												
													
														|  | 
 |  | +//            this.cheLiangSuoShuDanWei = map.get("che_liang_suo_shu_dan_wei");
 | 
											
												
													
														|  | 
 |  | +//            this.diDian = map.get("di_dian");
 | 
											
												
													
														|  | 
 |  | +//            this.jiaoYiDate = map.get("jiao_yi_date");
 | 
											
												
													
														|  | 
 |  | +//            this.yearMonth = map.get("year_month");
 | 
											
												
													
														|  | 
 |  | +//            this.yearNo = map.get("year_no");
 | 
											
												
													
														|  | 
 |  | +//            this.monthNo = map.get("month_no");
 | 
											
												
													
														|  | 
 |  | +//            this.rawChePaiHao = map.get("raw_che_pai_hao");
 | 
											
												
													
														|  | 
 |  | +//            this.chePaiFail = map.get("che_pai_fail");
 | 
											
												
													
														|  | 
 |  | +//            this.firstUnit = map.get("first_unit");
 | 
											
												
													
														|  | 
 |  | +//            this.secondUnit = map.get("second_unit");
 | 
											
												
													
														|  | 
 |  | +//            this.thirdUnit = map.get("third_unit");
 | 
											
												
													
														|  | 
 |  | +//            this.areaNo = map.get("area_no");
 | 
											
												
													
														|  | 
 |  | +//            this.areaName = map.get("area_name");
 | 
											
												
													
														|  | 
 |  | +//            this.cityNo = map.get("city_no");
 | 
											
												
													
														|  | 
 |  | +//            this.cityName = map.get("city_name");
 | 
											
												
													
														|  | 
 |  | +//            this.areaNo2 = map.get("area_no2");
 | 
											
												
													
														|  | 
 |  | +//            this.areaName2 = map.get("area_name2");
 | 
											
												
													
														|  | 
 |  | +//            this.cityId = map.get("city_id");
 | 
											
												
													
														|  | 
 |  | +//            this.city = map.get("city");
 | 
											
												
													
														|  | 
 |  | +//            this.districtId = map.get("district_id");
 | 
											
												
													
														|  | 
 |  | +//            this.district = map.get("district");
 | 
											
												
													
														|  | 
 |  | +//            this.source = map.get("source");
 | 
											
												
													
														|  | 
 |  | +//            this.localDateTime = localDateTime;
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//        public Map<String, String> toMap() {
 | 
											
												
													
														|  | 
 |  | +//            LinkedHashMap<String, String> map = new LinkedHashMap<>();
 | 
											
												
													
														|  | 
 |  | +//            map.put("shen_qing_dan_hao", shenQingDanHao);
 | 
											
												
													
														|  | 
 |  | +//            map.put("shen_qing_dan_ming_cheng", shenQingDanMingCheng);
 | 
											
												
													
														|  | 
 |  | +//            map.put("bao_zhang_shi_jian", baoZhangShiJian);
 | 
											
												
													
														|  | 
 |  | +//            map.put("di_shi", diShi);
 | 
											
												
													
														|  | 
 |  | +//            map.put("shen_qing_ren", shenQingRen);
 | 
											
												
													
														|  | 
 |  | +//            map.put("ka_hao", kaHao);
 | 
											
												
													
														|  | 
 |  | +//            map.put("che_pai_hao", chePaiHao);
 | 
											
												
													
														|  | 
 |  | +//            map.put("jiao_yi_shi_jian", jiaoYiShiJian);
 | 
											
												
													
														|  | 
 |  | +//            map.put("bu_han_shui_jin_e", buHanShuiJinE);
 | 
											
												
													
														|  | 
 |  | +//            map.put("shui_lv", shuiLv);
 | 
											
												
													
														|  | 
 |  | +//            map.put("shui_e", shuiE);
 | 
											
												
													
														|  | 
 |  | +//            map.put("jia_shui_he_ji_jin_e", jiaShuiHeJiJinE);
 | 
											
												
													
														|  | 
 |  | +//            map.put("che_liang_suo_shu_dan_wei", cheLiangSuoShuDanWei);
 | 
											
												
													
														|  | 
 |  | +//            map.put("di_dian", diDian);
 | 
											
												
													
														|  | 
 |  | +//            map.put("jiao_yi_date", jiaoYiDate);
 | 
											
												
													
														|  | 
 |  | +//            map.put("year_month", yearMonth);
 | 
											
												
													
														|  | 
 |  | +//            map.put("year_no", yearNo);
 | 
											
												
													
														|  | 
 |  | +//            map.put("month_no", monthNo);
 | 
											
												
													
														|  | 
 |  | +//            map.put("raw_che_pai_hao", rawChePaiHao);
 | 
											
												
													
														|  | 
 |  | +//            map.put("che_pai_fail", chePaiFail);
 | 
											
												
													
														|  | 
 |  | +//            map.put("first_unit", firstUnit);
 | 
											
												
													
														|  | 
 |  | +//            map.put("second_unit", secondUnit);
 | 
											
												
													
														|  | 
 |  | +//            map.put("third_unit", thirdUnit);
 | 
											
												
													
														|  | 
 |  | +//            map.put("area_no", areaNo);
 | 
											
												
													
														|  | 
 |  | +//            map.put("area_name", areaName);
 | 
											
												
													
														|  | 
 |  | +//            map.put("city_no", cityNo);
 | 
											
												
													
														|  | 
 |  | +//            map.put("city_name", cityName);
 | 
											
												
													
														|  | 
 |  | +//            map.put("area_no2", areaNo2);
 | 
											
												
													
														|  | 
 |  | +//            map.put("area_name2", areaName2);
 | 
											
												
													
														|  | 
 |  | +//            map.put("city_id", cityId);
 | 
											
												
													
														|  | 
 |  | +//            map.put("city", city);
 | 
											
												
													
														|  | 
 |  | +//            map.put("district_id", districtId);
 | 
											
												
													
														|  | 
 |  | +//            map.put("district", district);
 | 
											
												
													
														|  | 
 |  | +//            map.put("source", source);
 | 
											
												
													
														|  | 
 |  | +//            map.put("next_jiao_yi_shi_jian", nextJiaoYiShiJian);
 | 
											
												
													
														|  | 
 |  | +//            map.put("next_jiao_yi_date", nextJiaoYiDate);
 | 
											
												
													
														|  | 
 |  | +//            map.put("next_bu_han_shui_jin_e", nextBuHanShuiJinE);
 | 
											
												
													
														|  | 
 |  | +//            map.put("time_interval", timeInterval);
 | 
											
												
													
														|  | 
 |  | +//            map.put("bu_han_shui_jin_e_sum", buHanShuiJinESum);
 | 
											
												
													
														|  | 
 |  | +//            return map;
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//    }
 | 
											
												
													
														|  | 
 |  | +//}
 |