Merge remote-tracking branch 'refs/remotes/origin/noFtp' into mdc-merge
# Conflicts: # jeecg-module-auto-process/src/main/java/org/jeecg/modules/AutoProcessManager.java # jeecg-module-auto-process/src/main/java/org/jeecg/modules/EmailParsingActuator.java
This commit is contained in:
commit
0eb8df84c8
|
@ -8,6 +8,8 @@ import com.google.common.collect.Lists;
|
|||
import com.sun.mail.imap.IMAPStore;
|
||||
import com.sun.mail.smtp.SMTPAddressFailedException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.api.dto.message.MessageDTO;
|
||||
import org.jeecg.common.constant.RedisConstant;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.jeecg.modules;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.RedisConstant;
|
||||
|
@ -235,7 +234,7 @@ public class AutoProcessManager{
|
|||
if(testFlag){
|
||||
if (emailExecThreadMap.containsKey(databaseEmail.getId())) {
|
||||
EmailParsingActuator actuator = emailExecThreadMap.get(databaseEmail.getId());
|
||||
actuator.setThreadSleep(false);
|
||||
actuator.setStop(false);
|
||||
log.info("{}邮箱重新加入监测队列",databaseEmail.getUsername());
|
||||
} else {
|
||||
databaseEmail.setNewEmailFlag(true);
|
||||
|
|
|
@ -91,11 +91,13 @@ public class EmailParsingActuator extends Thread{
|
|||
//检验获取的邮件是否在之前删除失败列表中,若在直接调用邮件API删除,并且此次数组里元素也删除
|
||||
for(int i=messages.length-1;i>=0;i--){
|
||||
if (null == messages[i].getHeader("Message-ID")) {
|
||||
System.out.println("Message ID是空值信息!!!!!!!");
|
||||
messages = ArrayUtils.remove(messages, i);
|
||||
continue;
|
||||
}
|
||||
if (!messages[i].isExpunged()){
|
||||
String messageId = ((MimeMessage) messages[i]).getMessageID();
|
||||
System.out.println("正常获取到的Message ID是:"+messageId);
|
||||
final boolean exist = emailServiceManager.check(messages[i],messageId);
|
||||
messageIds.add(messageId);
|
||||
if(exist){
|
||||
|
|
|
@ -41,6 +41,8 @@ public class BetaDataFile implements Serializable {
|
|||
|
||||
private String stationId;
|
||||
|
||||
private String detectorId;
|
||||
|
||||
private boolean bProcessed;
|
||||
|
||||
private boolean saveAnalysisResult;
|
||||
|
|
|
@ -194,6 +194,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (!flag) {
|
||||
return result;
|
||||
}
|
||||
if (Objects.nonNull(phd) && !phd.isValid()) {
|
||||
result.error500("This Spectrum is invalid! it's counts are all zero");
|
||||
return result;
|
||||
}
|
||||
// 加载phd数据所需的lc,scac,baseline数据
|
||||
if (dbName.equals("auto")) {
|
||||
gammaFileUtil.SetBaseInfo(phd, "RNAUTO");
|
||||
|
@ -609,6 +613,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (!bRet) {
|
||||
return result;
|
||||
}
|
||||
if (Objects.nonNull(phd) && !phd.isValid()) {
|
||||
result.error500("This Spectrum is invalid! it's counts are all zero");
|
||||
return result;
|
||||
}
|
||||
if (!redisUtil.hasKey(userName+StringPool.DASH+phd.getHeader().getSystem_type()) || !redisUtil.hasKey(userName+StringPool.DASH+phd.getHeader().getSystem_type()+"-list")) {
|
||||
//读取缓存的全部核素信息
|
||||
Map<String, NuclideLines> allNuclideMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
||||
|
|
|
@ -4419,6 +4419,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
String error = "get station_id or detect_id error";
|
||||
return false;
|
||||
}
|
||||
betaDataFile.setDetectorId(detectorId.toString());
|
||||
//新增Gards_Sample_Data表数据
|
||||
sampleDataSpectrumService.saveSampleData(sourceData, stationId, detectorId, filePathName, readLines);
|
||||
//获取sampleId
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
@ -14,6 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
||||
import com.google.common.io.Files;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
@ -49,9 +52,6 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired
|
||||
private FTPUtil ftpUtil;
|
||||
|
||||
@Autowired
|
||||
private SpectrumPathProperties pathProperties;
|
||||
|
||||
|
@ -112,9 +112,9 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
TransactionDefinition txDef = new DefaultTransactionDefinition();
|
||||
final TransactionStatus txStatus = transactionManager.getTransaction(txDef);
|
||||
try {
|
||||
String ftpRootPath = ftpUtil.getFtpRootPath();
|
||||
String savePath = ftpRootPath + pathProperties.getSaveFilePath() + StrUtil.SLASH;
|
||||
String logPath = ftpRootPath + pathProperties.getLogPath() + StrUtil.SLASH;
|
||||
String rootPath = pathProperties.getRootPath();
|
||||
String savePath = rootPath + pathProperties.getSaveFilePath() + StrUtil.SLASH;
|
||||
String logPath = rootPath + pathProperties.getLogPath() + StrUtil.SLASH;
|
||||
/* 删除数据库数据 */
|
||||
// 过滤掉多余的表
|
||||
String ORIGINAL = "ORIGINAL";String RNAUTO = "RNAUTO";String RNMAN = "RNMAN";
|
||||
|
@ -172,16 +172,14 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
needDel = needDel.stream().filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(needDel))
|
||||
return Result.OK("Data cleaning is complete. No files need to be cleaned!");
|
||||
// 删除FTP文件
|
||||
List<String> failList = new ArrayList<>();
|
||||
for (String path:needDel) {
|
||||
boolean success = ftpUtil.removeFiles(path);
|
||||
if (!success) {
|
||||
failList.add(path);
|
||||
}
|
||||
// 删除本地文件
|
||||
List<String> fails = new ArrayList<>();
|
||||
for (String path : needDel) {
|
||||
boolean success = FileUtil.del(path);
|
||||
if (!success) fails.add(path);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(failList))
|
||||
return Result.error("Data clearing is complete, but file clearing fails!", failList);
|
||||
if (CollUtil.isNotEmpty(fails))
|
||||
return Result.error("Data clearing is complete, but file clearing fails!", fails);
|
||||
return Result.OK("Data and file cleanup complete!");
|
||||
}catch (Exception e){
|
||||
transactionManager.rollback(txStatus);
|
||||
|
@ -226,27 +224,25 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
Integer sampleId, String owner){
|
||||
List<String> fileList = new ArrayList<>();
|
||||
List<AnalysesDto> AnalysesDtoList = baseMapper.getAnalysis(owner, sampleId);
|
||||
if (CollectionUtils.isNotEmpty(AnalysesDtoList)) {
|
||||
for (AnalysesDto AnalysesDto:AnalysesDtoList) {
|
||||
String baselinePath = AnalysesDto.getBaselinePath();
|
||||
if (StrUtil.isNotBlank(baselinePath)) {
|
||||
fileList.add(savePath + baselinePath);
|
||||
}
|
||||
String lcPath = AnalysesDto.getLcPath();
|
||||
if (StrUtil.isNotBlank(lcPath)) {
|
||||
fileList.add(savePath + lcPath);
|
||||
}
|
||||
String scacPath = AnalysesDto.getScacPath();
|
||||
if (StrUtil.isNotBlank(scacPath)) {
|
||||
fileList.add(savePath + scacPath);
|
||||
}
|
||||
if (StrUtil.isNotBlank(AnalysesDto.getLogPath())) {
|
||||
fileList.add(logPath + AnalysesDto.getLogPath());
|
||||
}
|
||||
String reportPath = AnalysesDto.getReportPath();
|
||||
if (StrUtil.isNotBlank(reportPath)) {
|
||||
fileList.add(savePath + reportPath + FileTypeEnum.txt.getType());
|
||||
}
|
||||
for (AnalysesDto AnalysesDto:AnalysesDtoList) {
|
||||
String baselinePath = AnalysesDto.getBaselinePath();
|
||||
if (StrUtil.isNotBlank(baselinePath)) {
|
||||
fileList.add(savePath + baselinePath);
|
||||
}
|
||||
String lcPath = AnalysesDto.getLcPath();
|
||||
if (StrUtil.isNotBlank(lcPath)) {
|
||||
fileList.add(savePath + lcPath);
|
||||
}
|
||||
String scacPath = AnalysesDto.getScacPath();
|
||||
if (StrUtil.isNotBlank(scacPath)) {
|
||||
fileList.add(savePath + scacPath);
|
||||
}
|
||||
if (StrUtil.isNotBlank(AnalysesDto.getLogPath())) {
|
||||
fileList.add(logPath + AnalysesDto.getLogPath());
|
||||
}
|
||||
String reportPath = AnalysesDto.getReportPath();
|
||||
if (StrUtil.isNotBlank(reportPath)) {
|
||||
fileList.add(savePath + reportPath + FileTypeEnum.txt.getType());
|
||||
}
|
||||
}
|
||||
return fileList;
|
||||
|
|
|
@ -31,7 +31,19 @@ public class JeecgAbnormalAlarmApplication extends SpringBootServletInitializer
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgAbnormalAlarmApplication.class, args);
|
||||
int exitCode = 1;
|
||||
ConfigurableApplicationContext application = null;
|
||||
try {
|
||||
application = SpringApplication.run(JeecgAbnormalAlarmApplication.class, args);
|
||||
} catch (Exception e) {
|
||||
if (null != application) {
|
||||
application.close();
|
||||
exitCode = SpringApplication.exit(application, () -> 0);
|
||||
}
|
||||
System.exit(exitCode);
|
||||
}
|
||||
|
||||
// ConfigurableApplicationContext application = SpringApplication.run(JeecgAbnormalAlarmApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
|
|
|
@ -53,7 +53,19 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgAutoProcessApplication.class, args);
|
||||
int exitCode = 1;
|
||||
ConfigurableApplicationContext application = null;
|
||||
try {
|
||||
application = SpringApplication.run(JeecgAutoProcessApplication.class, args);
|
||||
} catch (Exception e) {
|
||||
if (null != application) {
|
||||
application.close();
|
||||
exitCode = SpringApplication.exit(application, () -> 0);
|
||||
}
|
||||
System.exit(exitCode);
|
||||
}
|
||||
|
||||
// ConfigurableApplicationContext application = SpringApplication.run(JeecgAutoProcessApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
|
|
|
@ -27,7 +27,19 @@ public class JeecgLogManageApplication extends SpringBootServletInitializer impl
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgLogManageApplication.class, args);
|
||||
int exitCode = 1;
|
||||
ConfigurableApplicationContext application = null;
|
||||
try {
|
||||
application = SpringApplication.run(JeecgLogManageApplication.class, args);
|
||||
} catch (Exception e) {
|
||||
if (null != application) {
|
||||
application.close();
|
||||
exitCode = SpringApplication.exit(application, () -> 0);
|
||||
}
|
||||
System.exit(exitCode);
|
||||
}
|
||||
|
||||
// ConfigurableApplicationContext application = SpringApplication.run(JeecgLogManageApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.cache.BetaCache;
|
||||
import org.jeecg.common.cache.LocalCache;
|
||||
|
@ -9,6 +10,7 @@ import org.jeecg.modules.service.IDataService;
|
|||
import org.jeecg.modules.service.IGammaService;
|
||||
import org.jeecg.modules.service.IGardsNuclCoincidenceSumSpectrumService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
@ -40,6 +42,9 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
|||
@Autowired
|
||||
private IDataService dataService;
|
||||
|
||||
@Value("${isOpen}")
|
||||
private Boolean isOpen;
|
||||
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
|
@ -47,7 +52,19 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgSpectrumAnalysisApplication.class, args);
|
||||
int exitCode = 1;
|
||||
ConfigurableApplicationContext application = null;
|
||||
try {
|
||||
application = SpringApplication.run(JeecgSpectrumAnalysisApplication.class, args);
|
||||
} catch (Exception e) {
|
||||
if (null != application) {
|
||||
application.close();
|
||||
exitCode = SpringApplication.exit(application, () -> 0);
|
||||
}
|
||||
System.exit(exitCode);
|
||||
}
|
||||
|
||||
// ConfigurableApplicationContext application = SpringApplication.run(JeecgSpectrumAnalysisApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
|
@ -78,6 +95,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
|||
gammaService.readMDCParameter();
|
||||
nuclLibService.getNuclideMap();
|
||||
nuclCoincidenceSumSpectrumService.getNuclCoincidenceMap();
|
||||
dataService.viewStations();
|
||||
if (ObjectUtil.isNotNull(isOpen) && isOpen)
|
||||
dataService.viewStations();
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.service.ISysUserFocusStationService;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.ExitCodeGenerator;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
|
@ -35,7 +36,19 @@ public class JeecgStationOperationApplication extends SpringBootServletInitializ
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgStationOperationApplication.class, args);
|
||||
int exitCode = 1;
|
||||
ConfigurableApplicationContext application = null;
|
||||
try {
|
||||
application = SpringApplication.run(JeecgStationOperationApplication.class, args);
|
||||
} catch (Exception e) {
|
||||
if (null != application) {
|
||||
application.close();
|
||||
exitCode = SpringApplication.exit(application, () -> 0);
|
||||
}
|
||||
System.exit(exitCode);
|
||||
}
|
||||
|
||||
//ConfigurableApplicationContext application = SpringApplication.run(JeecgStationOperationApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
|
|
|
@ -52,7 +52,18 @@ public class JeecgSystemCloudApplication extends SpringBootServletInitializer im
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgSystemCloudApplication.class, args);
|
||||
int exitCode = 1;
|
||||
ConfigurableApplicationContext application = null;
|
||||
try {
|
||||
application = SpringApplication.run(JeecgSystemCloudApplication.class, args);
|
||||
} catch (Exception e) {
|
||||
if (null != application) {
|
||||
application.close();
|
||||
exitCode = SpringApplication.exit(application, () -> 0);
|
||||
}
|
||||
System.exit(exitCode);
|
||||
}
|
||||
// ConfigurableApplicationContext application = SpringApplication.run(JeecgSystemCloudApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
|
|
|
@ -26,7 +26,19 @@ public class JeecgWebStatisticsApplication extends SpringBootServletInitializer
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(JeecgWebStatisticsApplication.class, args);
|
||||
int exitCode = 1;
|
||||
ConfigurableApplicationContext application = null;
|
||||
try {
|
||||
application = SpringApplication.run(JeecgWebStatisticsApplication.class, args);
|
||||
} catch (Exception e) {
|
||||
if (null != application) {
|
||||
application.close();
|
||||
exitCode = SpringApplication.exit(application, () -> 0);
|
||||
}
|
||||
System.exit(exitCode);
|
||||
}
|
||||
|
||||
// ConfigurableApplicationContext application = SpringApplication.run(JeecgWebStatisticsApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
|
|
Loading…
Reference in New Issue
Block a user