Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f122544455 | ||
![]() |
812c734d1b | ||
![]() |
6824b1e2d8 | ||
![]() |
a2980c0289 | ||
![]() |
9bafcef57b | ||
![]() |
0eb8df84c8 | ||
![]() |
f6b963145f | ||
![]() |
8b40646076 | ||
![]() |
cf0751109d | ||
![]() |
64a98bd4ea | ||
![]() |
f1410028fa | ||
![]() |
86968e383b | ||
![]() |
9fffd2436c | ||
![]() |
2407b65a06 | ||
![]() |
6c5a0bf546 | ||
![]() |
caf47a58d5 | ||
![]() |
18b495d1d0 | ||
![]() |
6335a3f588 |
|
@ -1,8 +1,6 @@
|
||||||
package org.jeecg.common.email;
|
package org.jeecg.common.email;
|
||||||
|
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.sun.mail.imap.IMAPStore;
|
import com.sun.mail.imap.IMAPStore;
|
||||||
|
@ -32,7 +30,6 @@ import java.io.*;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -127,7 +124,7 @@ public class EmailServiceManager {
|
||||||
/**
|
/**
|
||||||
* 接收邮件
|
* 接收邮件
|
||||||
*/
|
*/
|
||||||
public Message[] receiveMail() throws MessagingException {
|
public Message[] receiveMail() throws Exception {
|
||||||
String status = EmailLogManager.STATUS_SUCCESS;
|
String status = EmailLogManager.STATUS_SUCCESS;
|
||||||
try{
|
try{
|
||||||
//配置邮件服务属性
|
//配置邮件服务属性
|
||||||
|
@ -135,6 +132,8 @@ public class EmailServiceManager {
|
||||||
properties.put("mail.store.protocol", "imap");
|
properties.put("mail.store.protocol", "imap");
|
||||||
properties.put("mail.imap.host", email.getEmailServerAddress());
|
properties.put("mail.imap.host", email.getEmailServerAddress());
|
||||||
properties.put("mail.imap.port",email.getPort());
|
properties.put("mail.imap.port",email.getPort());
|
||||||
|
properties.put("mail.imap.connectiontimeout", "3000"); // 设置连接超时时间为3秒
|
||||||
|
properties.put("mail.imap.timeout", "3000"); // 设置读取超时时间为3秒
|
||||||
if (email.getIsQiye() == 1) {
|
if (email.getIsQiye() == 1) {
|
||||||
properties.put("mail.imap.ssl.enable", "true");
|
properties.put("mail.imap.ssl.enable", "true");
|
||||||
} else {
|
} else {
|
||||||
|
@ -177,6 +176,7 @@ public class EmailServiceManager {
|
||||||
return o1.getReceivedDate().compareTo(o2.getReceivedDate());
|
return o1.getReceivedDate().compareTo(o2.getReceivedDate());
|
||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
@ -186,7 +186,7 @@ public class EmailServiceManager {
|
||||||
return Arrays.copyOfRange(messages,0,this.receiveNum-1);
|
return Arrays.copyOfRange(messages,0,this.receiveNum-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (MessagingException e){
|
} catch (Exception e){
|
||||||
status = EmailLogManager.STATUS_ERROR;
|
status = EmailLogManager.STATUS_ERROR;
|
||||||
log.error("Email connection is abnormal, account is {}, service is {},the reason is {}.",email.getName(),email.getEmailServerAddress(),e.getMessage());
|
log.error("Email connection is abnormal, account is {}, service is {},the reason is {}.",email.getName(),email.getEmailServerAddress(),e.getMessage());
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -727,6 +727,7 @@ public class EmailServiceManager {
|
||||||
status = EmailLogManager.STATUS_ERROR;
|
status = EmailLogManager.STATUS_ERROR;
|
||||||
log.error("Email deletion failed, the subject of the email is :{}, the reason is :{}.",subject,e.getMessage());
|
log.error("Email deletion failed, the subject of the email is :{}, the reason is :{}.",subject,e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}finally {
|
}finally {
|
||||||
EmailLogEvent removeEvent = new EmailLogEvent(batchesCounter,Thread.currentThread().getId(),EmailLogManager.GS_TYPE_GET,status,EmailLogManager.DELETEID,subject,DateUtils.formatDate(receivedDate,"yyyy-MM-dd HH:mm:ss:SSS"));
|
EmailLogEvent removeEvent = new EmailLogEvent(batchesCounter,Thread.currentThread().getId(),EmailLogManager.GS_TYPE_GET,status,EmailLogManager.DELETEID,subject,DateUtils.formatDate(receivedDate,"yyyy-MM-dd HH:mm:ss:SSS"));
|
||||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),removeEvent);
|
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),removeEvent);
|
||||||
|
@ -748,7 +749,7 @@ public class EmailServiceManager {
|
||||||
if(null != store){
|
if(null != store){
|
||||||
store.close();
|
store.close();
|
||||||
}
|
}
|
||||||
log.info("EmailServiceManage资源关闭完成.");
|
log.info(Thread.currentThread().getName() + ",EmailServiceManage资源关闭完成.");
|
||||||
// for(String messageId : messageIds){
|
// for(String messageId : messageIds){
|
||||||
// String key = RedisConstant.EMAIL_MSG_ID+StringConstant.COLON+messageId;
|
// String key = RedisConstant.EMAIL_MSG_ID+StringConstant.COLON+messageId;
|
||||||
// redisUtil.del(key);
|
// redisUtil.del(key);
|
||||||
|
@ -756,6 +757,7 @@ public class EmailServiceManager {
|
||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
log.error("Email closure failed, email address is: {}, reason is: {}",email.getUsername(),e.getMessage());
|
log.error("Email closure failed, email address is: {}, reason is: {}",email.getUsername(),e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,15 @@ public class NumUtil {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String keep6ScienceStr(Double value){
|
||||||
|
if (ObjectUtil.isNull(value))
|
||||||
|
return null;
|
||||||
|
String result = NumberUtil.decimalFormat("0.######E00", value);
|
||||||
|
if (!StrUtil.contains(result, "E-"))
|
||||||
|
return StrUtil.replace(result, "E", "E+");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public static Double keep(Double value, int scale){
|
public static Double keep(Double value, int scale){
|
||||||
if (ObjectUtil.isNull(value))
|
if (ObjectUtil.isNull(value))
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
package org.jeecg.modules.entity.vo;
|
package org.jeecg.modules.entity.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.util.NumUtil;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.NumberFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ -48,4 +52,39 @@ public class CalMDCInfo implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Double yield;
|
private Double yield;
|
||||||
|
|
||||||
|
private Double mda;
|
||||||
|
|
||||||
|
private String halfLifeStr = "";
|
||||||
|
|
||||||
|
private String mdcStr = "";
|
||||||
|
|
||||||
|
private String mdaStr = "";
|
||||||
|
|
||||||
|
public void format(){
|
||||||
|
if (ObjectUtil.isNotNull(halflife))
|
||||||
|
halfLifeStr = halfLifeStr(halflife);
|
||||||
|
if (ObjectUtil.isNotNull(mdc))
|
||||||
|
mdcStr = NumUtil.keep6ScienceStr(mdc);
|
||||||
|
if (ObjectUtil.isNotNull(mda))
|
||||||
|
mdaStr = NumUtil.keep6ScienceStr(mda);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String halfLifeStr(Double halflife){
|
||||||
|
String units = "D";
|
||||||
|
if (halflife >= 1000) {
|
||||||
|
halflife = halflife / 365.25;
|
||||||
|
units = "A";
|
||||||
|
} else if (halflife < 0.1 && halflife >= 1.0 / 1440.0) {
|
||||||
|
halflife = halflife * 1440.0;
|
||||||
|
units = "M";
|
||||||
|
} else if (halflife <= 1.0 / 1440.0 && halflife > 0.0) {
|
||||||
|
halflife = halflife * 86400.0;
|
||||||
|
units = "S";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (halflife < 1000)
|
||||||
|
return String.format("%.3f", halflife) + units;
|
||||||
|
NumberFormat numberFormat = new DecimalFormat("0.###E0");
|
||||||
|
return numberFormat.format(halflife) + units;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,7 @@ package org.jeecg.modules.entity.vo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class GStoreMiddleProcessData implements Serializable {
|
public class GStoreMiddleProcessData implements Serializable {
|
||||||
|
@ -231,6 +228,8 @@ public class GStoreMiddleProcessData implements Serializable {
|
||||||
//SpecSetup
|
//SpecSetup
|
||||||
public SpecSetup setting_specSetup;
|
public SpecSetup setting_specSetup;
|
||||||
|
|
||||||
|
public List<CalMDCInfo> mdcInfos;
|
||||||
|
|
||||||
public GStoreMiddleProcessData(){
|
public GStoreMiddleProcessData(){
|
||||||
dbWriteFlag = false;
|
dbWriteFlag = false;
|
||||||
dbWriteStatusFlag = "";
|
dbWriteStatusFlag = "";
|
||||||
|
@ -419,6 +418,7 @@ public class GStoreMiddleProcessData implements Serializable {
|
||||||
Collection_Station_Comments = "";
|
Collection_Station_Comments = "";
|
||||||
NDC_Analysis_General_Comments = "";
|
NDC_Analysis_General_Comments = "";
|
||||||
setting_specSetup = new SpecSetup();
|
setting_specSetup = new SpecSetup();
|
||||||
|
mdcInfos = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.jeecg.modules;
|
package org.jeecg.modules;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.constant.RedisConstant;
|
import org.jeecg.common.constant.RedisConstant;
|
||||||
|
@ -120,6 +119,7 @@ public class AutoProcessManager{
|
||||||
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,6 +169,7 @@ public class AutoProcessManager{
|
||||||
//捕获异常不处理保障线程异常不退出
|
//捕获异常不处理保障线程异常不退出
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
long sleepTime = taskProperties.getMonitoringMailCommStatusCycle() - (end-start);
|
long sleepTime = taskProperties.getMonitoringMailCommStatusCycle() - (end-start);
|
||||||
|
@ -178,6 +179,7 @@ public class AutoProcessManager{
|
||||||
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,6 +253,7 @@ public class AutoProcessManager{
|
||||||
//捕获异常不处理保障线程异常不退出
|
//捕获异常不处理保障线程异常不退出
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
long sleepTime = taskProperties.getMonitoringMailDataCycle() - (end-start);
|
long sleepTime = taskProperties.getMonitoringMailDataCycle() - (end-start);
|
||||||
|
@ -260,6 +263,7 @@ public class AutoProcessManager{
|
||||||
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,6 +308,7 @@ public class AutoProcessManager{
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}finally {
|
}finally {
|
||||||
if(emailExecThread.getState() != State.TERMINATED && emailExecThread.isStop()){
|
if(emailExecThread.getState() != State.TERMINATED && emailExecThread.isStop()){
|
||||||
final long nowTime = System.currentTimeMillis();
|
final long nowTime = System.currentTimeMillis();
|
||||||
|
@ -325,6 +330,7 @@ public class AutoProcessManager{
|
||||||
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,8 +86,8 @@ public class EmailParsingActuator extends Thread{
|
||||||
List<String> messageIds = new ArrayList<>();
|
List<String> messageIds = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
Message[] messages = emailServiceManager.receiveMail();
|
Message[] messages = emailServiceManager.receiveMail();
|
||||||
|
log.info("EmailParsingActuator本次{}获取邮件数量为:{}", Thread.currentThread().getName(), ArrayUtils.isEmpty(messages) ? 0 : messages.length);
|
||||||
if(ArrayUtils.isNotEmpty(messages)){
|
if(ArrayUtils.isNotEmpty(messages)){
|
||||||
log.info("EmailParsingActuator本次{}获取邮件数量为:{}", Thread.currentThread().getName(), messages.length);
|
|
||||||
//检验获取的邮件是否在之前删除失败列表中,若在直接调用邮件API删除,并且此次数组里元素也删除
|
//检验获取的邮件是否在之前删除失败列表中,若在直接调用邮件API删除,并且此次数组里元素也删除
|
||||||
for(int i=messages.length-1;i>=0;i--){
|
for(int i=messages.length-1;i>=0;i--){
|
||||||
if (null == messages[i].getHeader("Message-ID")) {
|
if (null == messages[i].getHeader("Message-ID")) {
|
||||||
|
@ -122,6 +122,7 @@ public class EmailParsingActuator extends Thread{
|
||||||
log.error("EmailParsingActuator has exception: {}", e.getMessage());
|
log.error("EmailParsingActuator has exception: {}", e.getMessage());
|
||||||
log.info("Mail-Parsing线程池资源关闭...");
|
log.info("Mail-Parsing线程池资源关闭...");
|
||||||
closeResource();
|
closeResource();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} finally {
|
} finally {
|
||||||
//清除本批次邮件日志缓存
|
//清除本批次邮件日志缓存
|
||||||
|
@ -142,6 +143,8 @@ public class EmailParsingActuator extends Thread{
|
||||||
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
TimeUnit.MILLISECONDS.sleep(sleepTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
throw new RuntimeException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,7 @@ public abstract class AbstractSpectrumHandler extends AbstractChain {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
} else if(SpectrumSource.FROM_FILE_SOURCE.getSourceType().equals(spectrumSource) && (e instanceof FileRepeatException)){
|
} else if(SpectrumSource.FROM_FILE_SOURCE.getSourceType().equals(spectrumSource) && (e instanceof FileRepeatException)){
|
||||||
this.spectrumFile.delete(); // TODO 删除原始谱文件
|
//this.spectrumFile.delete(); // TODO 删除原始谱文件
|
||||||
} else if (SpectrumSource.FORM_FILE_UNDEL.getSourceType().equals(spectrumSource) && !(e instanceof FileRepeatException)) {
|
} else if (SpectrumSource.FORM_FILE_UNDEL.getSourceType().equals(spectrumSource) && !(e instanceof FileRepeatException)) {
|
||||||
try {
|
try {
|
||||||
if (isDateFormatErr) {
|
if (isDateFormatErr) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.jeecg.common.util;
|
package org.jeecg.common.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
@ -2809,6 +2811,24 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
strBuffer.append(System.lineSeparator());
|
strBuffer.append(System.lineSeparator());
|
||||||
//换行
|
//换行
|
||||||
strBuffer.append(System.lineSeparator());
|
strBuffer.append(System.lineSeparator());
|
||||||
|
strBuffer.append("#MINIMUM DETECTABLE CONCENTRATION FOR KEY NUCLIDES");
|
||||||
|
strBuffer.append(System.lineSeparator());
|
||||||
|
List<CalMDCInfo> mdcInfos = middleData.mdcInfos;
|
||||||
|
String mdcTitle = "%-15s%-18s%-15s%-15s";
|
||||||
|
String[] mdcData = new String[]{" Nuclide", "Halflife", "MDC", "MDA(Bq)"};
|
||||||
|
strBuffer.append(rowFormat(mdcTitle, mdcData));
|
||||||
|
strBuffer.append(System.lineSeparator());
|
||||||
|
for (CalMDCInfo mdcDto : mdcInfos) {
|
||||||
|
mdcDto.format();
|
||||||
|
strBuffer.append(rowFormat(mdcTitle, StringPool.SPACE + mdcDto.getNuclideName(),
|
||||||
|
mdcDto.getHalfLifeStr(), mdcDto.getMdcStr(), mdcDto.getMdaStr()));
|
||||||
|
//换行
|
||||||
|
strBuffer.append(System.lineSeparator());
|
||||||
|
}
|
||||||
|
//换行
|
||||||
|
strBuffer.append(System.lineSeparator());
|
||||||
|
//换行
|
||||||
|
strBuffer.append(System.lineSeparator());
|
||||||
strBuffer.append("#PEAK SEARCH RESULTS");
|
strBuffer.append("#PEAK SEARCH RESULTS");
|
||||||
//换行
|
//换行
|
||||||
strBuffer.append(System.lineSeparator());
|
strBuffer.append(System.lineSeparator());
|
||||||
|
@ -3177,6 +3197,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
public boolean GetMiddleData(PHDFile fileAnlyse, String userName,Map<String, NuclideLines> nucline,GStoreMiddleProcessData middleData, String type, String flag) throws ParseException {
|
public boolean GetMiddleData(PHDFile fileAnlyse, String userName,Map<String, NuclideLines> nucline,GStoreMiddleProcessData middleData, String type, String flag) throws ParseException {
|
||||||
boolean bRet=true;
|
boolean bRet=true;
|
||||||
//标准名称规范化
|
//标准名称规范化
|
||||||
|
middleData.mdcInfos = ListUtil.toList(fileAnlyse.getMdcInfoMap().values());
|
||||||
String dataType = fileAnlyse.getMsgInfo().getData_type();
|
String dataType = fileAnlyse.getMsgInfo().getData_type();
|
||||||
String subDirSavePath = "";
|
String subDirSavePath = "";
|
||||||
subDirSavePath+=nameStandUtil.GetSysTemSubdir(fileAnlyse.getHeader().getSystem_type());
|
subDirSavePath+=nameStandUtil.GetSysTemSubdir(fileAnlyse.getHeader().getSystem_type());
|
||||||
|
|
|
@ -41,6 +41,8 @@ public class BetaDataFile implements Serializable {
|
||||||
|
|
||||||
private String stationId;
|
private String stationId;
|
||||||
|
|
||||||
|
private String detectorId;
|
||||||
|
|
||||||
private boolean bProcessed;
|
private boolean bProcessed;
|
||||||
|
|
||||||
private boolean saveAnalysisResult;
|
private boolean saveAnalysisResult;
|
||||||
|
|
|
@ -3,5 +3,8 @@ package org.jeecg.modules.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.jeecg.modules.base.entity.rnman.GardsMDC;
|
import org.jeecg.modules.base.entity.rnman.GardsMDC;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsMDCSpectrumMapper extends BaseMapper<GardsMDC> {
|
public interface GardsMDCSpectrumMapper extends BaseMapper<GardsMDC> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.mapper.GardsMDCSpectrumMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -4,8 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.jeecg.modules.base.entity.rnman.GardsMDC;
|
import org.jeecg.modules.base.entity.rnman.GardsMDC;
|
||||||
import org.jeecg.modules.entity.vo.PHDFile;
|
import org.jeecg.modules.entity.vo.PHDFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface IGardsMDCSpectrumService extends IService<GardsMDC> {
|
public interface IGardsMDCSpectrumService extends IService<GardsMDC> {
|
||||||
|
|
||||||
int saveMDCGamma(PHDFile phd, String idAnalysis);
|
int saveMDCGamma(PHDFile phd, String idAnalysis);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,6 +194,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
return result;
|
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数据
|
// 加载phd数据所需的lc,scac,baseline数据
|
||||||
if (dbName.equals("auto")) {
|
if (dbName.equals("auto")) {
|
||||||
gammaFileUtil.SetBaseInfo(phd, "RNAUTO");
|
gammaFileUtil.SetBaseInfo(phd, "RNAUTO");
|
||||||
|
@ -609,6 +613,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
if (!bRet) {
|
if (!bRet) {
|
||||||
return result;
|
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")) {
|
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");
|
Map<String, NuclideLines> allNuclideMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
||||||
|
|
|
@ -46,5 +46,4 @@ public class GardsMDCSpectrumServiceImpl extends ServiceImpl<GardsMDCSpectrumMap
|
||||||
}
|
}
|
||||||
return mdcList.size();
|
return mdcList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4319,13 +4319,12 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
String logFileName = betaDataFile.getSampleFileName().replace("PHD", "log");
|
String logFileName = betaDataFile.getSampleFileName().replace("PHD", "log");
|
||||||
//获取日志的文件存放路径
|
//获取日志的文件存放路径
|
||||||
String logFilePath = parameterProperties.getLogFilePath() + File.separator + DateUtils.formatDate(new Date(), "yyyy-MM-dd");
|
String logFilePath = parameterProperties.getLogFilePath() + File.separator + DateUtils.formatDate(new Date(), "yyyy-MM-dd");
|
||||||
String localLogName = betaDataFile.getSampleFileName().replace("PHD", "log");
|
|
||||||
//判断文件路径是否存在
|
//判断文件路径是否存在
|
||||||
File logPath = new File(logFilePath);
|
File logPath = new File(logFilePath);
|
||||||
if (!logPath.exists()) {
|
if (!logPath.exists()) {
|
||||||
logPath.mkdirs();
|
logPath.mkdirs();
|
||||||
}
|
}
|
||||||
File logFile = new File(logFilePath + File.separator +localLogName);
|
File logFile = new File(logFilePath + File.separator +logFileName);
|
||||||
try {
|
try {
|
||||||
//判断日志文件是否存在 如果不存在创建一个空的文件 上传到ftp
|
//判断日志文件是否存在 如果不存在创建一个空的文件 上传到ftp
|
||||||
if (!logFile.exists()) {
|
if (!logFile.exists()) {
|
||||||
|
@ -4419,6 +4418,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
String error = "get station_id or detect_id error";
|
String error = "get station_id or detect_id error";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
betaDataFile.setDetectorId(detectorId.toString());
|
||||||
//新增Gards_Sample_Data表数据
|
//新增Gards_Sample_Data表数据
|
||||||
sampleDataSpectrumService.saveSampleData(sourceData, stationId, detectorId, filePathName, readLines);
|
sampleDataSpectrumService.saveSampleData(sourceData, stationId, detectorId, filePathName, readLines);
|
||||||
//获取sampleId
|
//获取sampleId
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
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.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
||||||
|
import com.google.common.io.Files;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.api.QueryRequest;
|
import org.jeecg.common.api.QueryRequest;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
@ -49,9 +52,6 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private FTPUtil ftpUtil;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SpectrumPathProperties pathProperties;
|
private SpectrumPathProperties pathProperties;
|
||||||
|
|
||||||
|
@ -112,9 +112,9 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
TransactionDefinition txDef = new DefaultTransactionDefinition();
|
TransactionDefinition txDef = new DefaultTransactionDefinition();
|
||||||
final TransactionStatus txStatus = transactionManager.getTransaction(txDef);
|
final TransactionStatus txStatus = transactionManager.getTransaction(txDef);
|
||||||
try {
|
try {
|
||||||
String ftpRootPath = ftpUtil.getFtpRootPath();
|
String rootPath = pathProperties.getRootPath();
|
||||||
String savePath = ftpRootPath + pathProperties.getSaveFilePath() + StrUtil.SLASH;
|
String savePath = rootPath + pathProperties.getSaveFilePath() + StrUtil.SLASH;
|
||||||
String logPath = ftpRootPath + pathProperties.getLogPath() + StrUtil.SLASH;
|
String logPath = rootPath + pathProperties.getLogPath() + StrUtil.SLASH;
|
||||||
/* 删除数据库数据 */
|
/* 删除数据库数据 */
|
||||||
// 过滤掉多余的表
|
// 过滤掉多余的表
|
||||||
String ORIGINAL = "ORIGINAL";String RNAUTO = "RNAUTO";String RNMAN = "RNMAN";
|
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());
|
needDel = needDel.stream().filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||||
if (CollUtil.isEmpty(needDel))
|
if (CollUtil.isEmpty(needDel))
|
||||||
return Result.OK("Data cleaning is complete. No files need to be cleaned!");
|
return Result.OK("Data cleaning is complete. No files need to be cleaned!");
|
||||||
// 删除FTP文件
|
// 删除本地文件
|
||||||
List<String> failList = new ArrayList<>();
|
List<String> fails = new ArrayList<>();
|
||||||
for (String path : needDel) {
|
for (String path : needDel) {
|
||||||
boolean success = ftpUtil.removeFiles(path);
|
boolean success = FileUtil.del(path);
|
||||||
if (!success) {
|
if (!success) fails.add(path);
|
||||||
failList.add(path);
|
|
||||||
}
|
}
|
||||||
}
|
if (CollUtil.isNotEmpty(fails))
|
||||||
if (CollUtil.isNotEmpty(failList))
|
return Result.error("Data clearing is complete, but file clearing fails!", fails);
|
||||||
return Result.error("Data clearing is complete, but file clearing fails!", failList);
|
|
||||||
return Result.OK("Data and file cleanup complete!");
|
return Result.OK("Data and file cleanup complete!");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
transactionManager.rollback(txStatus);
|
transactionManager.rollback(txStatus);
|
||||||
|
@ -226,7 +224,6 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
Integer sampleId, String owner){
|
Integer sampleId, String owner){
|
||||||
List<String> fileList = new ArrayList<>();
|
List<String> fileList = new ArrayList<>();
|
||||||
List<AnalysesDto> AnalysesDtoList = baseMapper.getAnalysis(owner, sampleId);
|
List<AnalysesDto> AnalysesDtoList = baseMapper.getAnalysis(owner, sampleId);
|
||||||
if (CollectionUtils.isNotEmpty(AnalysesDtoList)) {
|
|
||||||
for (AnalysesDto AnalysesDto:AnalysesDtoList) {
|
for (AnalysesDto AnalysesDto:AnalysesDtoList) {
|
||||||
String baselinePath = AnalysesDto.getBaselinePath();
|
String baselinePath = AnalysesDto.getBaselinePath();
|
||||||
if (StrUtil.isNotBlank(baselinePath)) {
|
if (StrUtil.isNotBlank(baselinePath)) {
|
||||||
|
@ -248,7 +245,6 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
fileList.add(savePath + reportPath + FileTypeEnum.txt.getType());
|
fileList.add(savePath + reportPath + FileTypeEnum.txt.getType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return fileList;
|
return fileList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,19 @@ public class JeecgAbnormalAlarmApplication extends SpringBootServletInitializer
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws UnknownHostException {
|
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();
|
Environment env = application.getEnvironment();
|
||||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String port = env.getProperty("server.port");
|
String port = env.getProperty("server.port");
|
||||||
|
|
|
@ -53,7 +53,19 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws UnknownHostException {
|
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();
|
Environment env = application.getEnvironment();
|
||||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String port = env.getProperty("server.port");
|
String port = env.getProperty("server.port");
|
||||||
|
|
|
@ -27,7 +27,19 @@ public class JeecgLogManageApplication extends SpringBootServletInitializer impl
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws UnknownHostException {
|
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();
|
Environment env = application.getEnvironment();
|
||||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String port = env.getProperty("server.port");
|
String port = env.getProperty("server.port");
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.jeecg;
|
package org.jeecg;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.cache.BetaCache;
|
import org.jeecg.common.cache.BetaCache;
|
||||||
import org.jeecg.common.cache.LocalCache;
|
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.IGammaService;
|
||||||
import org.jeecg.modules.service.IGardsNuclCoincidenceSumSpectrumService;
|
import org.jeecg.modules.service.IGardsNuclCoincidenceSumSpectrumService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
@ -40,6 +42,9 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDataService dataService;
|
private IDataService dataService;
|
||||||
|
|
||||||
|
@Value("${isOpen}")
|
||||||
|
private Boolean isOpen;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
@ -47,7 +52,19 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws UnknownHostException {
|
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();
|
Environment env = application.getEnvironment();
|
||||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String port = env.getProperty("server.port");
|
String port = env.getProperty("server.port");
|
||||||
|
@ -78,6 +95,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
||||||
gammaService.readMDCParameter();
|
gammaService.readMDCParameter();
|
||||||
nuclLibService.getNuclideMap();
|
nuclLibService.getNuclideMap();
|
||||||
nuclCoincidenceSumSpectrumService.getNuclCoincidenceMap();
|
nuclCoincidenceSumSpectrumService.getNuclCoincidenceMap();
|
||||||
|
if (ObjectUtil.isNotNull(isOpen) && isOpen)
|
||||||
dataService.viewStations();
|
dataService.viewStations();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.jeecg.modules.service.ISysUserFocusStationService;
|
import org.jeecg.modules.service.ISysUserFocusStationService;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
|
import org.springframework.boot.ExitCodeGenerator;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
@ -35,7 +36,19 @@ public class JeecgStationOperationApplication extends SpringBootServletInitializ
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws UnknownHostException {
|
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();
|
Environment env = application.getEnvironment();
|
||||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String port = env.getProperty("server.port");
|
String port = env.getProperty("server.port");
|
||||||
|
|
|
@ -52,7 +52,18 @@ public class JeecgSystemCloudApplication extends SpringBootServletInitializer im
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws UnknownHostException {
|
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();
|
Environment env = application.getEnvironment();
|
||||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String port = env.getProperty("server.port");
|
String port = env.getProperty("server.port");
|
||||||
|
|
|
@ -26,7 +26,19 @@ public class JeecgWebStatisticsApplication extends SpringBootServletInitializer
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws UnknownHostException {
|
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();
|
Environment env = application.getEnvironment();
|
||||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String port = env.getProperty("server.port");
|
String port = env.getProperty("server.port");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user