feat:文件上传失败列表
This commit is contained in:
parent
96df7732d0
commit
970446059b
|
@ -63,9 +63,9 @@
|
|||
SELECT
|
||||
a.table_name AS tableName,
|
||||
a.num_rows AS numRow,
|
||||
ROUND((d.bytes / (1024 * 1024)), 2) AS dataSize,
|
||||
ROUND((d.bytes / (1024 * 1024)), 2) AS indexSize,
|
||||
ROUND((d.bytes / d.max_size) * 100, 3) AS used
|
||||
COALESCE(ROUND((d.bytes / (1024 * 1024)), 2), 0) AS dataSize,
|
||||
COALESCE(ROUND((d.bytes / (1024 * 1024)), 2), 0) AS indexSize,
|
||||
COALESCE(ROUND((d.bytes / d.max_size) * 100, 3), 0) AS used
|
||||
FROM
|
||||
all_tables a
|
||||
LEFT JOIN dba_segments d ON a.owner = d.owner AND a.table_name = d.segment_name AND d.segment_type = 'TABLE'
|
||||
|
@ -76,7 +76,7 @@
|
|||
<select id="dbIndexOR" resultType="org.jeecg.modules.base.dto.DBInfo">
|
||||
SELECT
|
||||
a.table_name AS tableName,
|
||||
ROUND((d.bytes / (1024 * 1024)), 2) AS indexSize
|
||||
COALESCE(ROUND((d.bytes / (1024 * 1024)), 2), 0) AS indexSize
|
||||
FROM
|
||||
all_tables a
|
||||
LEFT JOIN dba_segments d ON a.owner = d.owner AND a.table_name = d.segment_name AND d.segment_type = 'INDEX'
|
||||
|
|
|
@ -186,12 +186,10 @@ public class SysDatabaseServiceImpl extends ServiceImpl<SysDatabaseMapper, SysDa
|
|||
List<String> dbNames = new ArrayList<>();
|
||||
switch (dbType){
|
||||
case DataBaseConstant.DB_TYPE_ORACLE:
|
||||
DSSwitcher.switchToOracle();
|
||||
dbNames = baseMapper.dbNamesOR();
|
||||
DSSwitcher.clear();
|
||||
dbNames = dbNamesOR();
|
||||
break;
|
||||
case DataBaseConstant.DB_TYPE_POSTGRESQL:
|
||||
dbNames = baseMapper.dbNamesPG();
|
||||
dbNames = dbNamesPG();
|
||||
break;
|
||||
case DataBaseConstant.DB_TYPE_MYSQL:
|
||||
// ...
|
||||
|
@ -221,6 +219,25 @@ public class SysDatabaseServiceImpl extends ServiceImpl<SysDatabaseMapper, SysDa
|
|||
return dbInfos;
|
||||
}
|
||||
|
||||
private List<String> dbNamesOR(){
|
||||
DSSwitcher.switchToOracle();
|
||||
List<String> dbNames = baseMapper.dbNamesOR();
|
||||
DSSwitcher.clear();
|
||||
return dbNames;
|
||||
}
|
||||
|
||||
private List<String> dbNamesPG(){
|
||||
return baseMapper.dbNamesPG();
|
||||
}
|
||||
|
||||
private List<String> dbNamesMY(){
|
||||
// 切换数据源
|
||||
|
||||
return baseMapper.dbNamesMY();
|
||||
// 清除数据源
|
||||
|
||||
}
|
||||
|
||||
private List<DBInfo> dbInfoOR(String dataBase){
|
||||
DSSwitcher.switchToOracle();
|
||||
List<DBInfo> dbInfos = baseMapper.dbInfoOR(dataBase);
|
||||
|
@ -233,4 +250,9 @@ public class SysDatabaseServiceImpl extends ServiceImpl<SysDatabaseMapper, SysDa
|
|||
DSSwitcher.clear();
|
||||
return dbInfos;
|
||||
}
|
||||
|
||||
private List<DBInfo> dbInfoPG(String dataBase){
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
|
|||
boolean created = FTPUtil.createDirs(ftpClient, filePath);
|
||||
if (!created) return Result.error(Prompt.DIR_CREATE_FAIL + filePath);
|
||||
// 上传所有文件
|
||||
System.out.println("filelist>>>>"+fileList.size());
|
||||
List<String> failList = new ArrayList<>();
|
||||
String rootPath = spectrumPathProperties.getRootPath();
|
||||
for (File oneFile : fileList) {
|
||||
String fileName = oneFile.getName();
|
||||
|
@ -109,10 +109,12 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
|
|||
fileName = oneFile.getName().substring(0, 23)+suffix;
|
||||
}
|
||||
String fullFilePath = rootPath + filePath + slash + fileName;
|
||||
System.out.println("fullFilePath>>>>"+fullFilePath);
|
||||
FileInputStream local = new FileInputStream(oneFile);
|
||||
ftpClient.storeFile(fullFilePath, local);
|
||||
boolean success = ftpClient.storeFile(fullFilePath, local);
|
||||
if (!success) failList.add(fullFilePath);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(failList))
|
||||
return Result.error(Prompt.UPLOAD_ERR, failList);
|
||||
return Result.OK(Prompt.UPLOAD_SUCC);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
|
Loading…
Reference in New Issue
Block a user