fix:路径分隔符修改
This commit is contained in:
parent
f4cdad297e
commit
cbd4df77f8
|
@ -307,7 +307,7 @@ public class FTPUtil {
|
|||
return true;
|
||||
}
|
||||
|
||||
public File fTPFile(String fromPath, String toPath) {
|
||||
public File downloadFile(String fromPath, String toPath) {
|
||||
FTPClient ftpClient = null;
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
|
@ -339,7 +339,7 @@ public class FTPUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public InputStream fTPFileStream(String fromPath) {
|
||||
public InputStream downloadFileStream(String fromPath) {
|
||||
FTPClient ftpClient = null;
|
||||
try {
|
||||
ftpClient = LoginFTP();
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.base.dto.DBInfo;
|
||||
import org.jeecg.modules.base.dto.SourceDto;
|
||||
import org.jeecg.modules.base.entity.postgre.SysDatabase;
|
||||
import org.jeecg.modules.base.bizVo.SourceVo;
|
||||
|
@ -26,4 +27,6 @@ public interface ISysDatabaseService extends IService<SysDatabase> {
|
|||
List<SourceDto> listAll();
|
||||
|
||||
List<String> dbNames(String dbType);
|
||||
|
||||
List<DBInfo> dbInfo(String dbType, String dataBase);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.jeecg.common.constant.DictConstant;
|
|||
import org.jeecg.common.constant.Prompt;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.jeecg.config.mybatis.DSSwitcher;
|
||||
import org.jeecg.modules.base.dto.DBInfo;
|
||||
import org.jeecg.modules.base.dto.DatabaseDto;
|
||||
import org.jeecg.modules.base.dto.SourceDto;
|
||||
import org.jeecg.modules.base.entity.postgre.SysDatabase;
|
||||
|
@ -201,4 +202,25 @@ public class SysDatabaseServiceImpl extends ServiceImpl<SysDatabaseMapper, SysDa
|
|||
return dbNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DBInfo> dbInfo(String dbType, String dataBase) {
|
||||
List<DBInfo> dbInfos = new ArrayList<>();
|
||||
switch (dbType){
|
||||
case DataBaseConstant.DB_TYPE_ORACLE:
|
||||
DSSwitcher.switchToOracle();
|
||||
|
||||
DSSwitcher.clear();
|
||||
break;
|
||||
case DataBaseConstant.DB_TYPE_POSTGRESQL:
|
||||
|
||||
break;
|
||||
case DataBaseConstant.DB_TYPE_MYSQL:
|
||||
// ...
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return dbInfos;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -60,8 +60,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
public boolean loadFile(String pathName, String fileName, PHDFile phd, Result result) {
|
||||
phd.setFilepath(pathName);
|
||||
phd.setFilename(fileName);
|
||||
String fromPath = pathName + File.separator + fileName;
|
||||
File file = ftpUtil.fTPFile(fromPath, "betaGamma");
|
||||
String fromPath = pathName + StringPool.SLASH + fileName;
|
||||
File file = ftpUtil.downloadFile(fromPath, "betaGamma");
|
||||
try {
|
||||
//读取文件信息
|
||||
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
|
@ -241,6 +241,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
//文件名称需要加上自动处理的前缀以及修改不同的文件后缀名
|
||||
String subFileName = fileName.substring(0, fileName.lastIndexOf(StringPool.DOT));
|
||||
if(StringUtils.isNotBlank(subFileName)){
|
||||
|
||||
//连接ftp
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
if (Objects.isNull(ftpClient)){
|
||||
|
@ -269,6 +270,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
List<Double> vData = ReadLcScacInfo(readLines);
|
||||
//将数据结果赋值给 phdFile的vLc
|
||||
phd.setVLc(vData);
|
||||
// 删除临时文件
|
||||
//file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
Loading…
Reference in New Issue
Block a user