forked from github/dataease
feat: 抽取 excel 数据
This commit is contained in:
parent
260d09a1a0
commit
9bd7de1934
@ -647,12 +647,14 @@ public class DataSetTableService {
|
||||
|
||||
private String saveFile(MultipartFile file) throws Exception {
|
||||
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() + "/";
|
||||
File p = new File(dirPath);
|
||||
if (!p.exists()) {
|
||||
p.mkdirs();
|
||||
}
|
||||
String filePath = dirPath + filename;
|
||||
String filePath = dirPath + filename + "." + suffix;
|
||||
File f = new File(filePath);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(f);
|
||||
fileOutputStream.write(file.getBytes());
|
||||
|
@ -273,11 +273,11 @@ public class ExtractDataService {
|
||||
jobExecutionConfiguration.setRepository(repository);
|
||||
String lastCarteObjectId = Job.sendToSlaveServer(jobMeta, jobExecutionConfiguration, repository, null);
|
||||
SlaveServerJobStatus jobStatus = null;
|
||||
boolean running = true;
|
||||
while(running) {
|
||||
boolean executing = true;
|
||||
while(executing) {
|
||||
jobStatus = remoteSlaveServer.getJobStatus(jobMeta.getName(), lastCarteObjectId, 0);
|
||||
running = jobStatus.isRunning();
|
||||
if(!running)
|
||||
executing = jobStatus.isRunning() || jobStatus.isWaiting();
|
||||
if(!executing)
|
||||
break;
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user