feat:mysql table info

fix:上传文件使用FtpRootPath
This commit is contained in:
nieziyan 2023-11-02 15:01:55 +08:00
parent 1db5b534b0
commit b9890950b5
4 changed files with 20 additions and 1 deletions

View File

@ -25,4 +25,6 @@ public interface SysDatabaseMapper extends BaseMapper<SysDatabase> {
List<DBInfo> dbInfoOR(@Param("owner") String dataBase); List<DBInfo> dbInfoOR(@Param("owner") String dataBase);
List<DBInfo> dbIndexOR(@Param("owner") String dataBase); List<DBInfo> dbIndexOR(@Param("owner") String dataBase);
List<DBInfo> dbInfoMY(@Param("owner") String dataBase);
} }

View File

@ -84,4 +84,17 @@
a.owner = #{owner} a.owner = #{owner}
ORDER BY a.table_name ORDER BY a.table_name
</select> </select>
<select id="dbInfoMY" resultType="org.jeecg.modules.base.dto.DBInfo">
SELECT
TABLE_NAME AS tableName,
TABLE_ROWS AS numRow,
round((data_length / 1024 / 1024), 2) AS dataSize,
round((index_length / 1024 / 1024), 2) AS indexSize
FROM
information_schema.tables
WHERE
table_schema = #{owner};
ORDER BY TABLE_NAME
</select>
</mapper> </mapper>

View File

@ -255,4 +255,8 @@ public class SysDatabaseServiceImpl extends ServiceImpl<SysDatabaseMapper, SysDa
return null; return null;
} }
private List<DBInfo> dbInfoMY(String dataBase){
return baseMapper.dbInfoMY(dataBase);
}
} }

View File

@ -99,7 +99,7 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
if (!created) return Result.error(Prompt.DIR_CREATE_FAIL + filePath); if (!created) return Result.error(Prompt.DIR_CREATE_FAIL + filePath);
// 上传所有文件 // 上传所有文件
List<String> failList = new ArrayList<>(); List<String> failList = new ArrayList<>();
String rootPath = spectrumPathProperties.getRootPath(); String rootPath = ftpUtil.getFtpRootPath();
for (File oneFile : fileList) { for (File oneFile : fileList) {
String fileName = oneFile.getName(); String fileName = oneFile.getName();
// 判断能谱文件名称是否符合规则不符合则进行重命名 // 判断能谱文件名称是否符合规则不符合则进行重命名