feat:database details
This commit is contained in:
parent
f9d780379f
commit
3c7280d516
|
@ -18,4 +18,10 @@ public interface SysServerMapper extends BaseMapper<SysServer> {
|
|||
List<SourceDto> pageAll(String itemName);
|
||||
|
||||
List<AlarmInfo> alarmInfo(String sourceId);
|
||||
|
||||
List<String> dbNamesPG();
|
||||
|
||||
List<String> dbNamesMY();
|
||||
|
||||
List<String> dbNamesOR();
|
||||
}
|
||||
|
|
|
@ -72,4 +72,14 @@
|
|||
WHERE r.source_id = #{sourceId}
|
||||
ORDER BY l.alarm_start_date DESC
|
||||
</select>
|
||||
<select id="dbNamesPG" resultType="java.lang.String">
|
||||
SELECT datname FROM pg_database WHERE datistemplate = false;
|
||||
</select>
|
||||
<select id="dbNamesMY" resultType="java.lang.String">
|
||||
SHOW DATABASES;
|
||||
</select>
|
||||
<select id="dbNamesOR" resultType="java.lang.String">
|
||||
SELECT username FROM all_users;
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -33,4 +33,6 @@ public interface ISysServerService extends IService<SysServer> {
|
|||
Result<?> details_BasicInfo(String hostId);
|
||||
|
||||
Result<?> details_AlarmInfo(String sourceId, Integer pageNo, Integer pageSize);
|
||||
|
||||
List<String> dbNames();
|
||||
}
|
||||
|
|
|
@ -304,4 +304,10 @@ public class SysServerServiceImpl extends ServiceImpl<SysServerMapper, SysServer
|
|||
page.setRecords(records);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> dbNames() {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,9 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
|
|||
FileOutputStream fos = null;
|
||||
ZipInputStream zipInputStream = null;
|
||||
String slash = SymbolConstant.SINGLE_SLASH;
|
||||
String filePath = slash + spectrumPathProperties.getUploadPath() + slash + username;
|
||||
|
||||
String filePath = slash + spectrumPathProperties.getUploadPath()
|
||||
+ slash + username;
|
||||
String tempFilePath = System.getProperty("java.io.tmpdir") + username + slash;
|
||||
List<String> fileNames = new ArrayList<>();
|
||||
List<File> fileList = new ArrayList<>();
|
||||
|
@ -96,14 +98,17 @@ 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());
|
||||
for (File oneFile : fileList) {
|
||||
String fileName = oneFile.getName();
|
||||
// 判断能谱文件名称是否符合规则,不符合则进行重命名
|
||||
if (!regexPattern.matcher(fileName).find() && !regexPattern1.matcher(fileName).find()) {
|
||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(oneFile);
|
||||
String suffix = nameStandUtil.GetSuffix(struct.data_type, struct.spectrum_quantity, String.valueOf(struct.acquisition_live_time));
|
||||
fileName = oneFile.getName().substring(0, 23)+suffix;
|
||||
}
|
||||
String fullFilePath = filePath + slash + fileName;
|
||||
System.out.println("fullFilePath>>>>"+fullFilePath);
|
||||
FileInputStream local = new FileInputStream(oneFile);
|
||||
ftpClient.storeFile(fullFilePath, local);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user