diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java index 831669fe..0c76025f 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java @@ -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(); diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/ISysDatabaseService.java b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/ISysDatabaseService.java index 38414483..7e1d9313 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/ISysDatabaseService.java +++ b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/ISysDatabaseService.java @@ -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 { List listAll(); List dbNames(String dbType); + + List dbInfo(String dbType, String dataBase); } diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java index 8e6fbbb2..1804a3cd 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java +++ b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java @@ -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 dbInfo(String dbType, String dataBase) { + List 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; + } + } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index 6afb5e18..6af9940c 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -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 vData = ReadLcScacInfo(readLines); //将数据结果赋值给 phdFile的vLc phd.setVLc(vData); + // 删除临时文件 + //file.delete(); } } catch (IOException e) { throw new RuntimeException(e);