fix:path

This commit is contained in:
nieziyan 2023-10-30 16:23:02 +08:00
parent 010f06f695
commit f7fe56ce44

View File

@ -99,6 +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);
// 上传所有文件 // 上传所有文件
System.out.println("filelist>>>>"+fileList.size()); System.out.println("filelist>>>>"+fileList.size());
String rootPath = spectrumPathProperties.getRootPath();
for (File oneFile : fileList) { for (File oneFile : fileList) {
String fileName = oneFile.getName(); String fileName = oneFile.getName();
// 判断能谱文件名称是否符合规则不符合则进行重命名 // 判断能谱文件名称是否符合规则不符合则进行重命名
@ -107,7 +108,7 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
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 = rootPath + filePath + slash + fileName;
System.out.println("fullFilePath>>>>"+fullFilePath); System.out.println("fullFilePath>>>>"+fullFilePath);
FileInputStream local = new FileInputStream(oneFile); FileInputStream local = new FileInputStream(oneFile);
ftpClient.storeFile(fullFilePath, local); ftpClient.storeFile(fullFilePath, local);