网站外包建设,婴幼儿网站模板,定制网站成本多少,上海百度地图1.描述 对于常规的Excel列表#xff08;二维表格#xff09;的入库处理#xff0c;一般的mysql连接工具#xff0c;例如Navicat就支持。但是#xff0c;因为业务需要#xff0c;不想每次都去手动导入#xff0c;所以这里采用编码且定时任务的形式来实现。
2.Excel常规列…1.描述 对于常规的Excel列表二维表格的入库处理一般的mysql连接工具例如Navicat就支持。但是因为业务需要不想每次都去手动导入所以这里采用编码且定时任务的形式来实现。
2.Excel常规列表处理
2.1 常规的二维表格示例 2.2 编码
2.2.1 实体
package com.chinaunicom.medical.business.cdm.dao.cdm.entity;import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;import java.time.LocalDateTime;/*** Description * Author ZhaoShuhao* Date: 2024-11-01 09:58:18*/Data
NoArgsConstructor
AllArgsConstructor
Accessors(chain true)
Schema(name ods_resident_record_excel_data , description 原始居民建档记录Excel表 )
TableName(value ods_resident_record_excel_data,autoResultMap true)
public class OdsResidentRecordExcelData {Schema(nameid,description主键id)private Long id;Schema(namemyNumber,description个人编号-档案编号)private String myNumber;Schema(nameresponsibleDoctor,description*责任医生)private String responsibleDoctor;Schema(namearchiveModifier,description档案修改人)private String archiveModifier;Schema(namehypertension,description高血压)private String hypertension;Schema(nameoldPeople,description老年人)private String oldPeople;Schema(namecoronaryHeartDisease,description冠心病)private String coronaryHeartDisease;Schema(namesignTime,description签约日期)private String signTime;Schema(namediabetes,description糖尿病)private String diabetes;Schema(namestroke,description脑卒中)private String stroke;Schema(namedisabledPerson,description残疾人)private String disabledPerson;Schema(nametumor,description肿瘤)private String tumor;Schema(nameidCard,description身份证号)private String idCard;Schema(nameinternalFileNumber,description内部档案号)private String internalFileNumber;Schema(namename,description姓名)private String name;Schema(nameotherName,description联系人姓名)private String otherName;Schema(namegender,description性别)private String gender;Schema(namepermanentAddressDetail,description*户籍详细地址)private String permanentAddressDetail;Schema(nameresidentialAddressStreet,description居住地址街道)private String residentialAddressStreet;Schema(nameresidentialAddressDetail,description居住地址详细)private String residentialAddressDetail;Schema(namebirthday,description出生日期)private String birthday;Schema(namefilingDoctor,description*建档医生)private String filingDoctor;Schema(namefilingTime,description*建档日期)private String filingTime;Schema(nameotherPhone,description联系人电话)private String otherPhone;Schema(nameresidentialAddressVillage,description居住地址村)private String residentialAddressVillage;Schema(namementalDisease,description精神病)private String mentalDisease;Schema(namemyPhone,description本人电话)private String myPhone;Schema(nameinputTime,description入选日期)private String inputTime;Schema(namehealthcareWorker,description是否家庭保健员)private String healthcareWorker;Schema(namemanageInfo,description管理情况)private String manageInfo;Schema(namestatus,description状态)private long status;Schema(nameextend,description扩展字段)private String extend;Schema(namecreate_time,description创建时间)private LocalDateTime createTime;Schema(namesyncStatus,description同步状态)private Integer syncStatus;
}2.2.2 mapper
package com.chinaunicom.medical.business.cdm.dao.cdm.mapper;import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chinaunicom.medical.business.cdm.dao.cdm.entity.OdsResidentRecordExcelData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;import java.time.LocalDateTime;
import java.util.Collection;/*** author ZhaoShuhao* description 针对表【ods_resident_record_excel_data(原始居民建档记录Excel表)】的数据库操作Mapper* createDate 2024-11-01 09:58:59* Entity mybatisxTest.model.OdsResidentRecordExcelData*/
Mapper
public interface OdsResidentRecordExcelDataMapper extends BaseMapperOdsResidentRecordExcelData {Select(select min(create_time) from ods_resident_record_excel_data where sync_status 0)LocalDateTime getMinUnSyncDataTime();Select({script,update ods_resident_record_excel_data set sync_status sync_status 1,where id in,foreach collectionpatientIds itempatient_id open( separator, close),#{patient_id},/foreach,/script})void batchSetSynced(Param(patientIds) CollectionLong patientIds);}
2.2.3 业务类
package com.chinaunicom.medical.business.cdm.analysis.excel.residentrecord;import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaunicom.medical.business.cdm.dao.cdm.entity.OdsResidentRecordExcelData;
import com.chinaunicom.medical.business.cdm.dao.cdm.mapper.OdsResidentRecordExcelDataMapper;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;/*** 居民健康档案(建档记录)列表记录Excel解析*/
Service
Slf4j
public class OdsResidentRecordExcelDataAnalysis extends ServiceImplOdsResidentRecordExcelDataMapper, OdsResidentRecordExcelData {private final AtomicInteger threadTaskCount new AtomicInteger(0);private final ThreadPoolExecutor executor new ThreadPoolExecutor(20,20,5, TimeUnit.SECONDS,new LinkedBlockingDeque());private final ListOdsResidentRecordExcelData dataList new CopyOnWriteArrayList();private final ListString successFileList Collections.synchronizedList(new ArrayList());private final ListString failFileList Collections.synchronizedList(new ArrayList());/*** C:\Users\KeepHappy\Desktop\清华长庚-慢病-数据采集\数据采集列表-与详情关联\居民建档记录列表*/SneakyThrowspublic void analysis(String fileAnalysisDirPath,String successFileDirPath,String failFileDirPath) {String fileDirPath StrUtil.removeSuffix(fileAnalysisDirPath, File.separator);if(!FileUtil.exist(fileDirPath)){log.info({}文件夹不存在,退出解析,fileDirPath);return;}ListString fileNameList FileUtil.listFileNames(fileDirPath);if(CollUtil.isNotEmpty(fileNameList)){new ArrayList(fileNameList).stream().forEach(baseInfoFileName -{//解析 基本信息executor.execute(()-analysisBaseInfoExcel(fileDirPathFile.separatorbaseInfoFileName));});CountDownLatch countDownLatch new CountDownLatch(1);new Thread(()-{try {ThreadUtil.sleep(3000);while (threadTaskCount.get()0){ThreadUtil.sleep(1000);}executor.shutdownNow();log.info(解析成功{}, JSONUtil.toJsonStr(dataList));if(CollUtil.isNotEmpty(dataList)){saveBatch(dataList);}//解析后移动文件String successFilePath StrUtil.removeSuffix(successFileDirPath, File.separator);String failFilePath StrUtil.removeSuffix(failFileDirPath, File.separator);//移动文件FileUtil.mkdir(successFilePath);FileUtil.mkdir(failFilePath);successFileList.forEach(filePath -{String fileName FileUtil.getName(filePath);FileUtil.move(new File(filePath),new File(successFileDirPathFile.separatorfileName),true);});failFileList.forEach(filePath -{String fileName FileUtil.getName(filePath);FileUtil.move(new File(filePath),new File(failFileDirPathFile.separatorfileName),true);});} catch (Throwable e) {log.error(发生异常,e);}countDownLatch.countDown();}).start();countDownLatch.await();}}/*** 解析基本信息*/private void analysisBaseInfoExcel(String filePath){if(!FileUtil.exist(filePath)){log.info(文件不存在{},filePath);return;}boolean success false;ExcelReader reader null;try {threadTaskCount.incrementAndGet();reader ExcelUtil.getReader(FileUtil.getInputStream(filePath),true);ListListObject excelDataList reader.read(1);for (ListObject data : excelDataList) {OdsResidentRecordExcelData odsResidentRecordExcelData new OdsResidentRecordExcelData();odsResidentRecordExcelData.setFilingDoctor(StrUtil.replace(StrUtil.toString(CollUtil.get(data,0)),null,));odsResidentRecordExcelData.setFilingTime(StrUtil.replace(StrUtil.toString(CollUtil.get(data,1)),null,));odsResidentRecordExcelData.setName(StrUtil.replace(StrUtil.toString(CollUtil.get(data,2)),null,));odsResidentRecordExcelData.setMyPhone(StrUtil.replace(StrUtil.toString(CollUtil.get(data,3)),null,));odsResidentRecordExcelData.setCoronaryHeartDisease(StrUtil.replace(StrUtil.toString(CollUtil.get(data,4)),null,));odsResidentRecordExcelData.setHypertension(StrUtil.replace(StrUtil.toString(CollUtil.get(data,5)),null,));odsResidentRecordExcelData.setDiabetes(StrUtil.replace(StrUtil.toString(CollUtil.get(data,6)),null,));odsResidentRecordExcelData.setStroke(StrUtil.replace(StrUtil.toString(CollUtil.get(data,7)),null,));odsResidentRecordExcelData.setTumor(StrUtil.replace(StrUtil.toString(CollUtil.get(data,8)),null,));odsResidentRecordExcelData.setArchiveModifier(StrUtil.replace(StrUtil.toString(CollUtil.get(data,9)),null,));odsResidentRecordExcelData.setSignTime(StrUtil.replace(StrUtil.toString(CollUtil.get(data,10)),null,));odsResidentRecordExcelData.setResidentialAddressDetail(StrUtil.replace(StrUtil.toString(CollUtil.get(data,11)),null,));odsResidentRecordExcelData.setBirthday(StrUtil.replace(StrUtil.toString(CollUtil.get(data,12)),null,));odsResidentRecordExcelData.setPermanentAddressDetail(StrUtil.replace(StrUtil.toString(CollUtil.get(data,13)),null,));odsResidentRecordExcelData.setResidentialAddressStreet(StrUtil.replace(StrUtil.toString(CollUtil.get(data,14)),null,));odsResidentRecordExcelData.setResidentialAddressVillage(StrUtil.replace(StrUtil.toString(CollUtil.get(data,15)),null,));odsResidentRecordExcelData.setOtherPhone(StrUtil.replace(StrUtil.toString(CollUtil.get(data,16)),null,));odsResidentRecordExcelData.setOtherName(StrUtil.replace(StrUtil.toString(CollUtil.get(data,17)),null,));odsResidentRecordExcelData.setIdCard(StrUtil.replace(StrUtil.toString(CollUtil.get(data,18)),null,));odsResidentRecordExcelData.setGender(StrUtil.replace(StrUtil.toString(CollUtil.get(data,19)),null,));odsResidentRecordExcelData.setHealthcareWorker(StrUtil.replace(StrUtil.toString(CollUtil.get(data,20)),null,));odsResidentRecordExcelData.setMyNumber(StrUtil.replace(StrUtil.toString(CollUtil.get(data,21)),null,));odsResidentRecordExcelData.setDisabledPerson(StrUtil.replace(StrUtil.toString(CollUtil.get(data,22)),null,));odsResidentRecordExcelData.setResponsibleDoctor(StrUtil.replace(StrUtil.toString(CollUtil.get(data,23)),null,));odsResidentRecordExcelData.setOldPeople(StrUtil.replace(StrUtil.toString(CollUtil.get(data,24)),null,));odsResidentRecordExcelData.setMentalDisease(StrUtil.replace(StrUtil.toString(CollUtil.get(data,25)),null,));odsResidentRecordExcelData.setInputTime(StrUtil.replace(StrUtil.toString(CollUtil.get(data,26)),null,));odsResidentRecordExcelData.setManageInfo(StrUtil.replace(StrUtil.toString(CollUtil.get(data,27)),null,));odsResidentRecordExcelData.setInternalFileNumber(StrUtil.replace(StrUtil.toString(CollUtil.get(data,28)),null,));odsResidentRecordExcelData.setSyncStatus(0);dataList.add(odsResidentRecordExcelData);}success true;} catch (Exception e) {log.error(解析基本信息异常,当前文件{},filePath,e);}finally {threadTaskCount.decrementAndGet();IoUtil.close(reader);ListString destList success ? successFileList : failFileList;destList.add(filePath);}}
}2.2.4 定时任务
package com.chinaunicom.medical.business.cdm.schedule;import com.alibaba.nacos.common.executor.ExecutorFactory;
import com.chinaunicom.medical.business.cdm.analysis.excel.diabetes.OdsDiabetesFileInfoAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.diabetes.OdsDiabetesFileRecordsAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.diabetes.OdsDiabetesFollowAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.diabetes.OdsDiabetesFollowRecordsAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.hypertension.OdsHypertensionArchiveDetailExcelDataAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.hypertension.OdsHypertensionArchiveExcelDataAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.hypertension.OdsHypertensionFollowDetailExcelDataAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.hypertension.OdsHypertensionFollowExcelDataAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.medicalexamination.OdsMedicalExaminationDetailExcelAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.residentrecord.OdsResidentRecordDetailExcelAnalysis;
import com.chinaunicom.medical.business.cdm.analysis.excel.residentrecord.OdsResidentRecordExcelDataAnalysis;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;import javax.annotation.Resource;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;Component
public class ExcelDataScheduler {//居民健康档案建档列表记录Value(${ods.resident.record.source:数据采集列表-与详情关联/居民建档记录列表})private String odsResidentRecordSourcePath;Value(${ods.resident.record.success:数据采集列表-与详情关联/居民建档记录列表/success})private String odsResidentRecordSuccessPath;Value(${ods.resident.record.fail:数据采集列表-与详情关联/居民建档记录列表/fail})private String odsResidentRecordFailPath;Resourceprivate OdsResidentRecordExcelDataAnalysis odsResidentRecordExcelDataAnalysis;private final ExecutorService executorService ExecutorFactory.newFixedExecutorService(1);Scheduled(cron 0 0/30 * * * ?)public void load() {//添加异步任务记得调整executorService的构造参数executorService.submit(() - odsResidentRecordExcelDataAnalysis.analysis(odsResidentRecordSourcePath,odsResidentRecordSuccessPath,odsResidentRecordFailPath));}
}2.3 代码解析
2.3.1主要成员变量
threadTaskCountAtomicInteger用于记录当前正在处理的任务数
private final AtomicInteger threadTaskCount new AtomicInteger(0);
executorThreadPoolExecutor用于并发处理文件解析任务
private final ThreadPoolExecutor executor new ThreadPoolExecutor(20, 20, 5, TimeUnit.SECONDS, new LinkedBlockingDeque());
dataListCopyOnWriteArrayList用于存储解析后的数据对象
private final ListOdsResidentRecordExcelData dataList new CopyOnWriteArrayList();
successFileList 和 failFileListsynchronizedList用于存储成功和失败的文件路径。
private final ListString successFileList Collections.synchronizedList(new ArrayList());
private final ListString failFileList Collections.synchronizedList(new ArrayList());
2.3.2 主要方法
1analysis
方法签名 public void analysis(String fileAnalysisDirPath, String successFileDirPath, String failFileDirPath) 参数 fileAnalysisDirPath需要解析的Excel文件所在目录。successFileDirPath解析成功后文件的存放目录。failFileDirPath解析失败后文件的存放目录。
检查文件夹存在检查指定的文件夹是否存在如果不存在则记录日志并退出解析。
String fileDirPath StrUtil.removeSuffix(fileAnalysisDirPath, File.separator);
if (!FileUtil.exist(fileDirPath)) {log.info({}文件夹不存在,退出解析, fileDirPath);return;
}
列出文件名获取指定目录下的所有文件名。
ListString fileNameList FileUtil.listFileNames(fileDirPath);
并发解析基本信息对每个文件创建一个解析任务使用线程池并发执行。
if (CollUtil.isNotEmpty(fileNameList)) {new ArrayList(fileNameList).stream().forEach(baseInfoFileName - {executor.execute(() - analysisBaseInfoExcel(fileDirPath File.separator baseInfoFileName));});
}
等待任务完成使用CountDownLatch等待所有解析任务完成然后关闭线程池。
CountDownLatch countDownLatch new CountDownLatch(1);
new Thread(() - {try {ThreadUtil.sleep(3000);while (threadTaskCount.get() 0) {ThreadUtil.sleep(1000);}executor.shutdownNow();log.info(解析成功{}, JSONUtil.toJsonStr(dataList));if (CollUtil.isNotEmpty(dataList)) {saveBatch(dataList);}// 移动文件String successFilePath StrUtil.removeSuffix(successFileDirPath, File.separator);String failFilePath StrUtil.removeSuffix(failFileDirPath, File.separator);FileUtil.mkdir(successFilePath);FileUtil.mkdir(failFilePath);successFileList.forEach(filePath - {String fileName FileUtil.getName(filePath);FileUtil.move(new File(filePath), new File(successFilePath File.separator fileName), true);});failFileList.forEach(filePath - {String fileName FileUtil.getName(filePath);FileUtil.move(new File(filePath), new File(failFilePath File.separator fileName), true);});} catch (Throwable e) {log.error(发生异常, e);} finally {countDownLatch.countDown();}
}).start();
countDownLatch.await();
2analysisBaseInfoExcel
方法签名
private void analysisBaseInfoExcel(String filePath)
参数
filePath需要解析的Excel文件路径。
功能
检查文件存在检查文件是否存在如果不存在则记录日志并返回。
if (!FileUtil.exist(filePath)) {log.info(文件不存在{}, filePath);return;
}
读取Excel文件使用ExcelUtil读取Excel文件解析基本信息并填充到OdsResidentRecordExcelData对象中。
boolean success false;
ExcelReader reader null;
try {threadTaskCount.incrementAndGet();reader ExcelUtil.getReader(FileUtil.getInputStream(filePath), true);ListListObject excelDataList reader.read(1);for (ListObject data : excelDataList) {OdsResidentRecordExcelData odsResidentRecordExcelData new OdsResidentRecordExcelData();odsResidentRecordExcelData.setFilingDoctor(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 0)), null, ));odsResidentRecordExcelData.setFilingTime(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 1)), null, ));odsResidentRecordExcelData.setName(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 2)), null, ));odsResidentRecordExcelData.setMyPhone(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 3)), null, ));odsResidentRecordExcelData.setCoronaryHeartDisease(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 4)), null, ));odsResidentRecordExcelData.setHypertension(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 5)), null, ));odsResidentRecordExcelData.setDiabetes(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 6)), null, ));odsResidentRecordExcelData.setStroke(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 7)), null, ));odsResidentRecordExcelData.setTumor(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 8)), null, ));odsResidentRecordExcelData.setArchiveModifier(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 9)), null, ));odsResidentRecordExcelData.setSignTime(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 10)), null, ));odsResidentRecordExcelData.setResidentialAddressDetail(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 11)), null, ));odsResidentRecordExcelData.setBirthday(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 12)), null, ));odsResidentRecordExcelData.setPermanentAddressDetail(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 13)), null, ));odsResidentRecordExcelData.setResidentialAddressStreet(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 14)), null, ));odsResidentRecordExcelData.setResidentialAddressVillage(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 15)), null, ));odsResidentRecordExcelData.setOtherPhone(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 16)), null, ));odsResidentRecordExcelData.setOtherName(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 17)), null, ));odsResidentRecordExcelData.setIdCard(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 18)), null, ));odsResidentRecordExcelData.setGender(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 19)), null, ));odsResidentRecordExcelData.setHealthcareWorker(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 20)), null, ));odsResidentRecordExcelData.setMyNumber(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 21)), null, ));odsResidentRecordExcelData.setDisabledPerson(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 22)), null, ));odsResidentRecordExcelData.setResponsibleDoctor(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 23)), null, ));odsResidentRecordExcelData.setOldPeople(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 24)), null, ));odsResidentRecordExcelData.setMentalDisease(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 25)), null, ));odsResidentRecordExcelData.setInputTime(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 26)), null, ));odsResidentRecordExcelData.setManageInfo(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 27)), null, ));odsResidentRecordExcelData.setInternalFileNumber(StrUtil.replace(StrUtil.toString(CollUtil.get(data, 28)), null, ));odsResidentRecordExcelData.setSyncStatus(0);dataList.add(odsResidentRecordExcelData);}success true;
} catch (Exception e) {log.error(解析基本信息异常,当前文件{}, filePath, e);
} finally {threadTaskCount.decrementAndGet();IoUtil.close(reader);ListString destList success ? successFileList : failFileList;destList.add(filePath);
}
2.3.3 多线程处理
线程池使用ThreadPoolExecutor创建固定大小的线程池确保并发解析文件时不会消耗过多资源。 private final ThreadPoolExecutor executor new ThreadPoolExecutor(20, 20, 5, TimeUnit.SECONDS, new LinkedBlockingDeque()); 计数器使用AtomicInteger记录正在处理的任务数确保所有任务完成后才进行后续操作。 private final AtomicInteger threadTaskCount new AtomicInteger(0); 同步列表使用Collections.synchronizedList创建线程安全的列表用于存储成功和失败的文件路径。 private final ListString successFileList Collections.synchronizedList(new ArrayList());
private final ListString failFileList Collections.synchronizedList(new ArrayList());
2.3.4 文件管理
文件移动解析完成后根据解析结果将文件移动到不同的目录便于后续管理和审计。 FileUtil.move(new File(filePath), new File(successFilePath File.separator fileName), true);
FileUtil.move(new File(filePath), new File(failFilePath File.separator fileName), true);