From f4c3fa55a7093cb394cfb9fd2db384c098abfa8d Mon Sep 17 00:00:00 2001
From: panbaolin <13071138970@163.com>
Date: Tue, 20 May 2025 16:40:58 +0800
Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=AE=9E=E4=BD=93=E7=B1=BB?=
=?UTF-8?q?=E4=B8=BB=E9=94=AE=EF=BC=8C=E9=80=82=E9=85=8Dpostgresql=202.?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86=E5=B7=A5?=
=?UTF-8?q?=E7=A8=8B=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=A7=A3=E6=9E=90=E6=8E=A2?=
=?UTF-8?q?=E6=B5=8B=E7=B3=BB=E7=BB=9F=E5=8F=91=E6=9D=A5=E7=9A=84=E5=8E=8B?=
=?UTF-8?q?=E7=BC=A9=E5=B9=B6=E7=BC=96=E7=A0=81=E5=90=8E=E7=9A=84=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=203.=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8=E5=A4=84?=
=?UTF-8?q?=E7=90=86=E5=B7=A5=E7=A8=8B=EF=BC=8C=E6=A0=B9=E6=8D=AE=E8=A6=81?=
=?UTF-8?q?=E6=B1=82=E4=BF=AE=E6=94=B9dos=E8=B0=B1=E5=A4=84=E7=90=86?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E8=A7=A3=E6=9E=90=E5=90=8E=E5=A4=8D?=
=?UTF-8?q?=E5=88=B6=E4=B8=80=E4=BB=BD=E5=88=B0=E6=8C=87=E5=AE=9A=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE=E7=BB=99=E8=A5=BF=E5=AE=89=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../properties/SpectrumPathProperties.java | 5 +
.../entity/configuration/GardsDetectors.java | 3 +-
.../base/entity/original/GardsAlertData.java | 2 +-
.../base/entity/original/GardsGPSData.java | 4 +-
.../base/entity/original/GardsMetData.java | 2 +-
.../base/entity/original/GardsSampleData.java | 2 +-
.../base/entity/original/GardsSohData.java | 2 +-
.../base/entity/rnauto/GardsAnalyses.java | 2 +-
.../base/entity/rnman/GardsAnalyses.java | 4 +-
.../jeecg/modules/common/SpectrumUtils.java | 107 ++++++++++++++++++
.../spectrum/AbstractSpectrumHandler.java | 7 +-
.../jeecg/modules/spectrum/DOSSpectrum.java | 28 +++++
.../spectrum/SpectrumParsingActuator.java | 57 ++++------
.../jeecg/JeecgAutoProcessApplication.java | 2 +-
.../src/main/resources/application.yml | 2 +-
.../JeecgSpectrumAnalysisApplication.java | 2 +-
pom.xml | 4 +-
17 files changed, 183 insertions(+), 52 deletions(-)
create mode 100644 jeecg-module-auto-process/src/main/java/org/jeecg/modules/common/SpectrumUtils.java
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/SpectrumPathProperties.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/SpectrumPathProperties.java
index ce6d5e35..1a7d314a 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/SpectrumPathProperties.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/SpectrumPathProperties.java
@@ -74,6 +74,11 @@ public class SpectrumPathProperties implements Serializable {
*/
private String errorFilePath;
+ /**
+ * dos谱外放目录(西安那边从外放目录拿取dos谱)
+ */
+ private String dosExternalDirectory;
+
/**
* 能谱文件存储路径以能谱系统类型/能谱类型为key,以存储路径为value
*/
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsDetectors.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsDetectors.java
index 32d317ed..808a742c 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsDetectors.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsDetectors.java
@@ -1,5 +1,6 @@
package org.jeecg.modules.base.entity.configuration;
+import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@@ -22,7 +23,7 @@ public class GardsDetectors implements Serializable {
/**
* 探测器id
*/
- @TableId(value = "DETECTOR_ID")
+ @TableId(type = IdType.INPUT)
private Integer detectorId;
/**
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsAlertData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsAlertData.java
index c6b4bd04..6e9f2ac7 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsAlertData.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsAlertData.java
@@ -22,7 +22,7 @@ public class GardsAlertData implements Serializable {
@TableField(value = "STATION_CODE")
private String stationCode;
- @TableId(value = "ALERT_ID",type = IdType.AUTO)
+ @TableId(type = IdType.AUTO)
private Integer alertId;
@TableField(value = "TIME")
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsGPSData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsGPSData.java
index 9d791634..1dc30618 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsGPSData.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsGPSData.java
@@ -1,6 +1,8 @@
package org.jeecg.modules.base.entity.original;
+import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@@ -19,7 +21,7 @@ public class GardsGPSData implements Serializable {
@TableField(value = "STATION_CODE")
private String stationCode;
- @TableField(value = "GPS_ID")
+ @TableId(type = IdType.AUTO)
private Integer gpsId;
@TableField(value = "LON")
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsMetData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsMetData.java
index 18db6daf..7b43eb29 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsMetData.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsMetData.java
@@ -31,7 +31,7 @@ public class GardsMetData implements Serializable {
/**
* 气象数据id
*/
- @TableId(value = "MET_ID",type = IdType.AUTO)
+ @TableId(type = IdType.AUTO)
private Integer metId;
/**
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSampleData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSampleData.java
index 9f58693d..3fcf91b7 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSampleData.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSampleData.java
@@ -27,7 +27,7 @@ public class GardsSampleData implements Serializable {
* 样品id
*/
- @TableId(value = "SAMPLE_ID",type = IdType.AUTO)
+ @TableId(type = IdType.AUTO)
private Integer sampleId;
/**
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSohData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSohData.java
index c5747b8d..5ea7f678 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSohData.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsSohData.java
@@ -31,7 +31,7 @@ public class GardsSohData implements Serializable {
/**
* 报警ID号
*/
- @TableId(value = "SOH_ID",type = IdType.AUTO)
+ @TableId(type = IdType.AUTO)
@Excel(name = "SID",orderNum = "5")
private Integer sohId;
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnauto/GardsAnalyses.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnauto/GardsAnalyses.java
index 025d2fcf..c2e3b102 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnauto/GardsAnalyses.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnauto/GardsAnalyses.java
@@ -21,7 +21,7 @@ public class GardsAnalyses implements Serializable {
/**
* 分析ID号
*/
- @TableId(value = "IDANALYSIS",type = IdType.AUTO)
+ @TableId(value = "idanalysis",type = IdType.AUTO)
private Integer idAnalysis;
/**
* 样品id
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnman/GardsAnalyses.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnman/GardsAnalyses.java
index 3bd28574..9fef1880 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnman/GardsAnalyses.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/rnman/GardsAnalyses.java
@@ -1,6 +1,8 @@
package org.jeecg.modules.base.entity.rnman;
+import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@@ -20,7 +22,7 @@ public class GardsAnalyses implements Serializable {
/**
* 分析ID号
*/
- @TableField(value = "IDANALYSIS")
+ @TableId(value = "idanalysis",type = IdType.AUTO)
private Integer idAnalysis;
/**
* 样品id
diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/common/SpectrumUtils.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/common/SpectrumUtils.java
new file mode 100644
index 00000000..815aafcd
--- /dev/null
+++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/common/SpectrumUtils.java
@@ -0,0 +1,107 @@
+package org.jeecg.modules.common;
+
+import cn.hutool.core.io.FileUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.LineIterator;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.common.util.Md5Util;
+import org.jeecg.modules.enums.SpectrumSource;
+import org.springframework.util.Base64Utils;
+import java.io.*;
+import java.util.Objects;
+import java.util.zip.InflaterInputStream;
+
+@Slf4j
+public class SpectrumUtils {
+
+ /**
+ * IMS2.0格式邮件判断条件
+ */
+ private final static String EMAIL_BEGIN = "BEGIN IMS2.0";
+ private final static String MSG_TYPE = "MSG_TYPE DATA";
+ private final static String EMAIL_STOP = "STOP";
+
+ /**
+ * 校验邮件内容完整性
+ * @param mailContent
+ * @param name 如果文件是.eml文件,则名称是邮件主题;如果文件是.phd文件,则名称是phd文件名称
+ * @param file 如果spectrumSource值为0,则file是.eml文件,如果值为1,则file是phd文件
+ * @param spectrumSource 0能谱来源于邮箱,1能谱来源于filesource目录
+ * @return
+ */
+ public static boolean checkMailContent(StringBuilder mailContent, String name, File file,Integer spectrumSource){
+ if (Objects.isNull(file) || !file.exists()){
+ return false;
+ }
+ boolean flag = false;
+ //获取邮件内容
+ mailContent.append(FileUtil.readUtf8String(file));
+
+ //如果内容是普通文本
+ if(StringUtils.isNotBlank(mailContent) && mailContent.indexOf(EMAIL_BEGIN) != -1 &&
+ mailContent.indexOf(MSG_TYPE) != -1 && mailContent.indexOf(EMAIL_STOP) != -1){
+ if(!StringUtils.startsWith(mailContent,EMAIL_BEGIN)){
+ mailContent.delete(0,mailContent.indexOf(EMAIL_BEGIN));
+ }
+ if(!StringUtils.endsWith(mailContent,EMAIL_STOP)){
+ mailContent.delete(mailContent.indexOf(EMAIL_STOP)+EMAIL_STOP.length(),mailContent.length());
+ }
+ flag = true;
+ }else {
+ //如果内容经过压缩
+ LineIterator it = IOUtils.lineIterator(new StringReader(mailContent.toString()));
+ while (it.hasNext()) {
+ String line = it.nextLine();
+ //如果某行,包含3个|字符说明此行是邮件正文
+ //邮件内容压缩格式
+ //1.md5|压缩前字节|压缩后字节|内容(Base64)
+ //2.md5由(压缩前字节|压缩后字节|内容(Base64) )生成
+ //3.内容(Base64)由 邮件内容压缩后,转Base64
+ if(StringUtils.countMatches(line, "|") == 3){
+ String[] contentArr = line.split("\\|");
+ String checkStr = contentArr[1]+"|"+contentArr[2]+"|"+contentArr[3];
+ String checkStrMd5 = Md5Util.md5Encode(checkStr, "utf-8");
+ if(checkStrMd5.equals(contentArr[0])){
+ byte[] bytes = Base64Utils.decodeFromString(contentArr[3]);
+ mailContent.setLength(0);
+ mailContent.append(decompressStream(bytes));
+ //如果文件来自于fileSource,且内容是编码的,则把未解码内容替换为解码后内容
+ if(SpectrumSource.FROM_FILE_SOURCE.getSourceType().equals(spectrumSource)){
+ FileUtil.writeUtf8String(mailContent.toString(),file);
+ }
+ flag = true;
+ }
+ break;
+ }
+ }
+ }
+ if (flag){
+ log.info("{}邮件校验成功,符合IMS2.0格式",name);
+ }else {
+ log.warn("{}邮件校验成功,此邮件不符合IMS2.0格式",name);
+ }
+ return flag;
+ }
+
+ /**
+ * 解压缩字节
+ * @param zipBytes
+ * @throws IOException
+ */
+ private static String decompressStream(byte[] zipBytes){
+ try (InflaterInputStream iis = new InflaterInputStream(new ByteArrayInputStream(zipBytes));
+ ByteArrayOutputStream output = new ByteArrayOutputStream();) {
+ byte[] buffer = new byte[1024];
+ int len;
+ while ((len = iis.read(buffer)) > 0) {
+ output.write(buffer, 0, len);
+ }
+ return output.toString("UTF-8").trim();
+ }catch (Exception e){
+ log.error("解压缩邮件失败");
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java
index d824459e..fe8af9b1 100644
--- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java
+++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java
@@ -12,6 +12,7 @@ import org.jeecg.common.email.EmailLogManager;
import org.jeecg.common.properties.SpectrumPathProperties;
import org.jeecg.modules.ErrorLogManager;
import org.jeecg.modules.base.enums.DataType;
+import org.jeecg.modules.common.SpectrumUtils;
import org.jeecg.modules.eneity.event.FormatErrorEvent;
import org.jeecg.modules.eneity.event.SpectrumErrorEvent;
import org.jeecg.modules.eneity.event.SpectrumLog;
@@ -104,8 +105,12 @@ public abstract class AbstractSpectrumHandler extends AbstractChain {
this.spectrumServiceQuotes = spectrumServiceQuotes;
this.returnFileName = returnFileName;
this.spectrumSource = spectrumSource;
+ if(SpectrumSource.FROM_FILE_SOURCE.getSourceType().equals(spectrumSource)){
+ StringBuilder mailContent = new StringBuilder();
+ SpectrumUtils.checkMailContent(mailContent,phdFile.getName(),phdFile,SpectrumSource.FROM_FILE_SOURCE.getSourceType());
+ this.mailContent = mailContent.toString();
+ }
this.spectrumFile = phdFile;
- this.mailContent = FileUtils.readFileToString(spectrumFile,"UTF-8");
this.sourceFilePath = spectrumFile.getAbsolutePath();
}
diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DOSSpectrum.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DOSSpectrum.java
index ef8b5428..a6cd2626 100644
--- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DOSSpectrum.java
+++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/DOSSpectrum.java
@@ -1,5 +1,6 @@
package org.jeecg.modules.spectrum;
+import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.constant.StringConstant;
@@ -92,6 +93,8 @@ public class DOSSpectrum extends AbstractSpectrumHandler{
this.updateSpectrumFileName();
//保存PHD文件到savefile
super.saveFileToSavefile();
+ //把dos谱文件放到扩展目录给西安用
+ this.expandedStorage();
//结构体数据入库
this.handlerOriginalData();
//把流程日志保存到日志目录
@@ -230,4 +233,29 @@ public class DOSSpectrum extends AbstractSpectrumHandler{
super.sendSpectrumLogToQueue(finalPath,logContent.toString());
}
+
+ /**
+ * 把dos谱放一份到扩展目录给西安用
+ * @throws IOException
+ */
+ private void expandedStorage() throws IOException {
+ final SpectrumPathProperties properties = this.spectrumServiceQuotes.getSpectrumPathProperties();
+ //把dos谱外放一份到指定位置给西安用
+ File dosExtDir = new File(properties.getDosExternalDirectory());
+ if(dosExtDir.exists() && dosExtDir.isDirectory()){
+ LocalDate currentDate = LocalDate.now();
+ StringBuilder storagePath = new StringBuilder();
+ storagePath.append(dosExtDir.getAbsolutePath());
+ storagePath.append(File.separator);
+ storagePath.append(currentDate.getYear());
+ storagePath.append(File.separator);
+ storagePath.append(currentDate.getMonthValue());
+ if(!FileUtil.exist(storagePath.toString())){
+ FileUtil.mkdir(storagePath.toString());
+ }
+ storagePath.append(File.separator);
+ storagePath.append(this.spectrumFile.getName());
+ FileOperation.copyFile(this.spectrumFile,storagePath.toString(),true);
+ }
+ }
}
diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java
index 49fe15ca..992b11f8 100644
--- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java
+++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java
@@ -7,6 +7,8 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.LineIterator;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.constant.RedisConstant;
import org.jeecg.common.constant.StringConstant;
@@ -15,18 +17,23 @@ import org.jeecg.common.email.EmailLogManager;
import org.jeecg.common.email.EmailServiceManager;
import org.jeecg.common.exception.DownloadEmailException;
import org.jeecg.common.util.DateUtils;
+import org.jeecg.common.util.Md5Util;
+import org.jeecg.modules.common.SpectrumUtils;
import org.jeecg.modules.email.EmailProperties;
import org.jeecg.modules.enums.SpectrumSource;
import org.jeecg.modules.exception.AnalySpectrumException;
import org.jeecg.modules.file.FileOperation;
+import org.springframework.util.Base64Utils;
import javax.mail.Message;
import javax.mail.MessagingException;
+import javax.mail.Session;
import javax.mail.internet.MimeMessage;
-import java.io.File;
-import java.io.IOException;
+import java.io.*;
import java.nio.file.Files;
+import java.util.Base64;
import java.util.Objects;
+import java.util.Properties;
import java.util.concurrent.CountDownLatch;
/**
@@ -34,12 +41,6 @@ import java.util.concurrent.CountDownLatch;
*/
@Slf4j
public class SpectrumParsingActuator implements Runnable{
- /**
- * IMS2.0格式邮件判断条件
- */
- private final static String EMAIL_BEGIN = "BEGIN IMS2.0";
- private final static String MSG_TYPE = "MSG_TYPE DATA";
- private final static String EMAIL_STOP = "STOP";
/**
* 邮件对象
@@ -114,15 +115,12 @@ public class SpectrumParsingActuator implements Runnable{
//保存邮件日志到PG数据库
this.spectrumServiceQuotes.getMailLogService().create(message,emailProperties);
- //获取邮件内容
+ //封装邮件内容
StringBuilder mailContent = new StringBuilder();
- if(Objects.nonNull(emlFile) && emlFile.length() > 0){
- mailContent.append(FileUtil.readUtf8String(emlFile));
- }
- //判断是否是IMS2.0协议文件
+ //校验邮件是否是IMS2.0协议文件,如果是设置邮件内容到mailContent变量
// 如果邮件内容校验成功 将文件保存到eml目录 并删除邮件对象
- if(checkMailContent(mailContent,subject)){
+ if(checkMailContent(mailContent,subject,emlFile)){
AbstractSpectrumHandler spectrumHandler = new SamplephdSpectrum();
spectrumHandler.init(mailContent.toString(),emlFile.getName(),spectrumServiceQuotes,new StringBuilder(),SpectrumSource.FORM_EMAIL_SERVICE.getSourceType(),batchesCounter);
final boolean matchResult = spectrumHandler.saveEmailToLocal();
@@ -179,33 +177,16 @@ public class SpectrumParsingActuator implements Runnable{
}
/**
- * 校验邮件内容完整性
- * 1.虽然包含BEGIN IMS2.0,但是有些邮件的第一行不是BEGIN IMS2.0,而是Mime-Version: 1.0 ,Content-Type: multipart/signed;等信息
- * 2.所以若是IMS2.0协议邮件但是头部包含Mime-Version等信息了要删除
- * 具体解释如下:
- * 1.邮件包含附件或特殊内容类型:当邮件包含附件、HTML 内容、图像或其他非纯文本内容时,通常会采用 MIME 格式来处理和传输这些内容。
- * 因此,这样的邮件可能会在头部中指定 Mime-Version 和适当的 Content-Type。
- * 2.邮件需要进行签名或加密:如果邮件需要进行数字签名、加密或其他安全操作,通常会使用 multipart/signed 或其他相关的 Content-Type。
- * 这些类型的邮件在头部中会指定相应的内容类型和协议信息。
- * 3.简单纯文本邮件:另一方面,简单的纯文本邮件没有特殊的附件或内容类型要求,因此可能不需要使用 MIME 格式。
- * 这种情况下,邮件文本中可能不包含 Mime-Version: 1.0 和 Content-Type: multipart/signed;。
+ * 校验邮件内容是否符合IMS2.0格式
* @param mailContent
+ * @param subject
+ * @param emlFile
* @return
+ * @throws IOException
+ * @throws MessagingException
*/
- private boolean checkMailContent(StringBuilder mailContent,String subject){
- if(StringUtils.isNotBlank(mailContent) && mailContent.indexOf(EMAIL_BEGIN) != -1 &&
- mailContent.indexOf(MSG_TYPE) != -1 && mailContent.indexOf(EMAIL_STOP) != -1){
- if(!StringUtils.startsWith(mailContent,EMAIL_BEGIN)){
- mailContent.delete(0,mailContent.indexOf(EMAIL_BEGIN));
- }
- if(!StringUtils.endsWith(mailContent,EMAIL_STOP)){
- mailContent.delete(mailContent.indexOf(EMAIL_STOP)+EMAIL_STOP.length(),mailContent.length());
- }
- log.info("{}邮件校验成功,符合IMS2.0格式",subject);
- return true;
- }
- log.warn("{}邮件校验成功,此邮件不符合IMS2.0格式",subject);
- return false;
+ private boolean checkMailContent(StringBuilder mailContent,String subject,File emlFile) throws IOException, MessagingException {
+ return SpectrumUtils.checkMailContent(mailContent,subject,emlFile,SpectrumSource.FORM_EMAIL_SERVICE.getSourceType());
}
private void moveEmail(File emlFile, String key) throws IOException {
diff --git a/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java b/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java
index f1883692..40d7b86d 100644
--- a/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java
+++ b/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java
@@ -88,7 +88,7 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im
} else {
//Linux版本加载dll工具库
System.load("/usr/local/jdk/lib/libReadPHDFile.so");
- System.load("/usr/local/jdk/lib/libGammaAnalyALG.so");
+ System.load("/usr/local/jdk/lib/libGammaAnaly.so");
}
nuclLibService.getNuclideMap();
//根据配置文件配置邮件获取策略定义时间条件,默认EmailReceivePolicy.HISTORY_ORDER_RECEIVE.getPolicy()
diff --git a/jeecg-server-cloud/armd-cloud-gateway/src/main/resources/application.yml b/jeecg-server-cloud/armd-cloud-gateway/src/main/resources/application.yml
index d2dc6114..fa790345 100644
--- a/jeecg-server-cloud/armd-cloud-gateway/src/main/resources/application.yml
+++ b/jeecg-server-cloud/armd-cloud-gateway/src/main/resources/application.yml
@@ -32,7 +32,7 @@ spring:
#Sentinel配置
sentinel:
transport:
- dashboard: jeecg-boot-sentinel:9000
+ dashboard: armd-nacos:9000
# 支持链路限流
web-context-unify: false
filter:
diff --git a/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java b/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java
index b56896b1..4c3f1f8c 100644
--- a/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java
+++ b/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java
@@ -90,7 +90,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
} else {
//Linux版本加载dll工具库
System.load("/usr/local/jdk/lib/libReadPHDFile.so");
- System.load("/usr/local/jdk/lib/libGammaAnalyALG.so");
+ System.load("/usr/local/jdk/lib/libGammaAnaly.so");
}
//创建缓存
betaCache.initCache();
diff --git a/pom.xml b/pom.xml
index 1e8a9549..5e7bba0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -476,7 +476,7 @@
dev
- jeecg-boot-nacos:8848
+ armd-nacos:8848
@@ -490,7 +490,7 @@
test
- jeecg-boot-nacos:8848
+ armd-nacos:8848