提交 9bd7de19 authored 作者: taojinlong's avatar taojinlong

feat: 抽取 excel 数据

上级 260d09a1
...@@ -647,12 +647,14 @@ public class DataSetTableService { ...@@ -647,12 +647,14 @@ public class DataSetTableService {
private String saveFile(MultipartFile file) throws Exception { private String saveFile(MultipartFile file) throws Exception {
String filename = file.getOriginalFilename(); String filename = file.getOriginalFilename();
String suffix = filename.substring(filename.lastIndexOf(".") + 1);
filename = Md5Utils.md5(filename.substring(0, filename.length() - suffix.length()));
String dirPath = path + AuthUtils.getUser().getUsername() + "/"; String dirPath = path + AuthUtils.getUser().getUsername() + "/";
File p = new File(dirPath); File p = new File(dirPath);
if (!p.exists()) { if (!p.exists()) {
p.mkdirs(); p.mkdirs();
} }
String filePath = dirPath + filename; String filePath = dirPath + filename + "." + suffix;
File f = new File(filePath); File f = new File(filePath);
FileOutputStream fileOutputStream = new FileOutputStream(f); FileOutputStream fileOutputStream = new FileOutputStream(f);
fileOutputStream.write(file.getBytes()); fileOutputStream.write(file.getBytes());
......
...@@ -273,11 +273,11 @@ public class ExtractDataService { ...@@ -273,11 +273,11 @@ public class ExtractDataService {
jobExecutionConfiguration.setRepository(repository); jobExecutionConfiguration.setRepository(repository);
String lastCarteObjectId = Job.sendToSlaveServer(jobMeta, jobExecutionConfiguration, repository, null); String lastCarteObjectId = Job.sendToSlaveServer(jobMeta, jobExecutionConfiguration, repository, null);
SlaveServerJobStatus jobStatus = null; SlaveServerJobStatus jobStatus = null;
boolean running = true; boolean executing = true;
while(running) { while(executing) {
jobStatus = remoteSlaveServer.getJobStatus(jobMeta.getName(), lastCarteObjectId, 0); jobStatus = remoteSlaveServer.getJobStatus(jobMeta.getName(), lastCarteObjectId, 0);
running = jobStatus.isRunning(); executing = jobStatus.isRunning() || jobStatus.isWaiting();
if(!running) if(!executing)
break; break;
Thread.sleep(1000); Thread.sleep(1000);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论