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<SourceDto> pageAll(String itemName);
|
||||||
|
|
||||||
List<AlarmInfo> alarmInfo(String sourceId);
|
List<AlarmInfo> alarmInfo(String sourceId);
|
||||||
|
|
||||||
|
List<String> dbNamesPG();
|
||||||
|
|
||||||
|
List<String> dbNamesMY();
|
||||||
|
|
||||||
|
List<String> dbNamesOR();
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,14 @@
|
||||||
WHERE r.source_id = #{sourceId}
|
WHERE r.source_id = #{sourceId}
|
||||||
ORDER BY l.alarm_start_date DESC
|
ORDER BY l.alarm_start_date DESC
|
||||||
</select>
|
</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>
|
</mapper>
|
|
@ -33,4 +33,6 @@ public interface ISysServerService extends IService<SysServer> {
|
||||||
Result<?> details_BasicInfo(String hostId);
|
Result<?> details_BasicInfo(String hostId);
|
||||||
|
|
||||||
Result<?> details_AlarmInfo(String sourceId, Integer pageNo, Integer pageSize);
|
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);
|
page.setRecords(records);
|
||||||
return Result.OK(page);
|
return Result.OK(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> dbNames() {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,9 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
|
||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
ZipInputStream zipInputStream = null;
|
ZipInputStream zipInputStream = null;
|
||||||
String slash = SymbolConstant.SINGLE_SLASH;
|
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;
|
String tempFilePath = System.getProperty("java.io.tmpdir") + username + slash;
|
||||||
List<String> fileNames = new ArrayList<>();
|
List<String> fileNames = new ArrayList<>();
|
||||||
List<File> fileList = new ArrayList<>();
|
List<File> fileList = new ArrayList<>();
|
||||||
|
@ -96,14 +98,17 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
|
||||||
boolean created = FTPUtil.createDirs(ftpClient, filePath);
|
boolean created = FTPUtil.createDirs(ftpClient, filePath);
|
||||||
if (!created) return Result.error(Prompt.DIR_CREATE_FAIL + filePath);
|
if (!created) return Result.error(Prompt.DIR_CREATE_FAIL + filePath);
|
||||||
// 上传所有文件
|
// 上传所有文件
|
||||||
|
System.out.println("filelist>>>>"+fileList.size());
|
||||||
for (File oneFile : fileList) {
|
for (File oneFile : fileList) {
|
||||||
String fileName = oneFile.getName();
|
String fileName = oneFile.getName();
|
||||||
|
// 判断能谱文件名称是否符合规则,不符合则进行重命名
|
||||||
if (!regexPattern.matcher(fileName).find() && !regexPattern1.matcher(fileName).find()) {
|
if (!regexPattern.matcher(fileName).find() && !regexPattern1.matcher(fileName).find()) {
|
||||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(oneFile);
|
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(oneFile);
|
||||||
String suffix = nameStandUtil.GetSuffix(struct.data_type, struct.spectrum_quantity, String.valueOf(struct.acquisition_live_time));
|
String suffix = nameStandUtil.GetSuffix(struct.data_type, struct.spectrum_quantity, String.valueOf(struct.acquisition_live_time));
|
||||||
fileName = oneFile.getName().substring(0, 23)+suffix;
|
fileName = oneFile.getName().substring(0, 23)+suffix;
|
||||||
}
|
}
|
||||||
String fullFilePath = filePath + slash + fileName;
|
String fullFilePath = filePath + slash + fileName;
|
||||||
|
System.out.println("fullFilePath>>>>"+fullFilePath);
|
||||||
FileInputStream local = new FileInputStream(oneFile);
|
FileInputStream local = new FileInputStream(oneFile);
|
||||||
ftpClient.storeFile(fullFilePath, local);
|
ftpClient.storeFile(fullFilePath, local);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user