fix:Ftp改为本地
This commit is contained in:
parent
23ccf6bfac
commit
3a8b663833
|
@ -56,7 +56,7 @@ public class FileSourceHandleManager{
|
||||||
|
|
||||||
//初始化线程池
|
//初始化线程池
|
||||||
ThreadFactory threadFactory = new CustomizableThreadFactory("filesource-file-parsing-");
|
ThreadFactory threadFactory = new CustomizableThreadFactory("filesource-file-parsing-");
|
||||||
poolExecutor = new ThreadPoolExecutor(taskProperties.getReceiveNum(),maximumPoolSize,5, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),threadFactory);
|
poolExecutor = new ThreadPoolExecutor(taskProperties.getFilesourceDirReceiveNum(),maximumPoolSize,5, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),threadFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||||
|
import org.jeecg.modules.file.FileOperation;
|
||||||
import org.jeecg.modules.mapper.GardsSampleDataMapper;
|
import org.jeecg.modules.mapper.GardsSampleDataMapper;
|
||||||
import org.jeecg.modules.service.GardsSampleDataService;
|
import org.jeecg.modules.service.GardsSampleDataService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -42,9 +44,13 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public GardsSampleData findByInputFileName(String inputFileName) {
|
public GardsSampleData findByInputFileName(String inputFileName) {
|
||||||
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
if (StrUtil.isNotBlank(inputFileName)){
|
||||||
queryWrapper.eq(GardsSampleData::getInputFileName,inputFileName);
|
inputFileName = FileOperation.separatorConvert(inputFileName);
|
||||||
return this.getOne(queryWrapper);
|
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(GardsSampleData::getInputFileName,inputFileName);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -123,7 +123,8 @@ public class Sample_G_Analysis {
|
||||||
// 解析PHD文件
|
// 解析PHD文件
|
||||||
spectrumPathProperties = ApplicationContextUtil.getContext().getBean(SpectrumPathProperties.class);
|
spectrumPathProperties = ApplicationContextUtil.getContext().getBean(SpectrumPathProperties.class);
|
||||||
String sampleFilePath = sampleData.getInputFileName();
|
String sampleFilePath = sampleData.getInputFileName();
|
||||||
String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + sampleFilePath.substring(0, sampleFilePath.lastIndexOf(StringPool.SLASH));
|
String pathName = File.separator + spectrumPathProperties.getSaveFilePath() + File.separator +
|
||||||
|
sampleFilePath.substring(0, sampleFilePath.lastIndexOf(StringPool.SLASH));
|
||||||
String fileName = sampleFilePath.substring(sampleFilePath.lastIndexOf(StringPool.SLASH)+1);
|
String fileName = sampleFilePath.substring(sampleFilePath.lastIndexOf(StringPool.SLASH)+1);
|
||||||
boolean flag = gammaFileUtil.loadFile(pathName, fileName, phdFile, new Result());
|
boolean flag = gammaFileUtil.loadFile(pathName, fileName, phdFile, new Result());
|
||||||
// todo 测试阶段暂时注释掉,获取数据库 Gamma 默认参数
|
// todo 测试阶段暂时注释掉,获取数据库 Gamma 默认参数
|
||||||
|
|
|
@ -1369,12 +1369,13 @@ public class GammaFileUtil {
|
||||||
|
|
||||||
public boolean AnalyseSpectrum(PHDFile phd, Map<String, NuclideLines> mapLines){
|
public boolean AnalyseSpectrum(PHDFile phd, Map<String, NuclideLines> mapLines){
|
||||||
//解析获取临时文件信息
|
//解析获取临时文件信息
|
||||||
File tmpFile = analyzeFile(phd.getFilepath(), phd.getFilename());
|
File tmpFile = new File(spectrumPathProperties.getRootPath() + phd.getFilepath(), phd.getFilename());
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
try {
|
try {
|
||||||
String phdStr = mapper.writeValueAsString(phd);
|
String phdStr = mapper.writeValueAsString(phd);
|
||||||
String nuclideLinesMap = mapper.writeValueAsString(mapLines);
|
String nuclideLinesMap = mapper.writeValueAsString(mapLines);
|
||||||
String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, tmpFile.getAbsolutePath(), analysisProcess);
|
String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, tmpFile.getAbsolutePath(), null);
|
||||||
Map<String, Object> parseMap = JSON.parseObject(strValue, Map.class);
|
Map<String, Object> parseMap = JSON.parseObject(strValue, Map.class);
|
||||||
for (Map.Entry<String, Object> entry:parseMap.entrySet()) {
|
for (Map.Entry<String, Object> entry:parseMap.entrySet()) {
|
||||||
if (entry.getKey().equalsIgnoreCase("bAnalyed")) {
|
if (entry.getKey().equalsIgnoreCase("bAnalyed")) {
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im
|
||||||
checkTempStorageDirectory();
|
checkTempStorageDirectory();
|
||||||
//校验存储目录是否存在,不存在则创建,存在无操作
|
//校验存储目录是否存在,不存在则创建,存在无操作
|
||||||
checkStorageDirectory();
|
checkStorageDirectory();
|
||||||
// autoProcessManager.start(systemStartupTime);
|
// autoProcessManager.start(systemStartupTime);
|
||||||
undealHandleManager.start();
|
undealHandleManager.start();
|
||||||
fileSourceHandleManager.start();
|
fileSourceHandleManager.start();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user