Compare commits
184 Commits
mdc
...
SelfStatio
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5719c210ca | ||
![]() |
356bd94a26 | ||
![]() |
af71f40b1c | ||
![]() |
0718701788 | ||
![]() |
2693294331 | ||
![]() |
6d2ec53b4c | ||
![]() |
c0ba24aae4 | ||
![]() |
a2e48e5b84 | ||
![]() |
8aeebe3047 | ||
![]() |
56e7c6adc5 | ||
![]() |
02083f93f5 | ||
![]() |
e266148da1 | ||
![]() |
cd3d19db70 | ||
![]() |
9a7cdbe1ed | ||
![]() |
979f24a10c | ||
![]() |
4ddf2f2b46 | ||
![]() |
f214f9fc97 | ||
![]() |
b7ae380fb1 | ||
![]() |
219b644669 | ||
![]() |
aef513794b | ||
![]() |
bead8100e7 | ||
![]() |
69e668a9a7 | ||
![]() |
441a4ee6f6 | ||
![]() |
8cac8a6099 | ||
![]() |
0aeb76d959 | ||
![]() |
ba17537b44 | ||
![]() |
135f4ebd21 | ||
![]() |
dc3375a5ab | ||
![]() |
6f9e33e48b | ||
![]() |
ddbb632492 | ||
![]() |
164e44d086 | ||
![]() |
b48cf5a991 | ||
![]() |
19c9bae348 | ||
![]() |
40e94299a7 | ||
![]() |
b19f5087ed | ||
![]() |
6bb4cb67a1 | ||
![]() |
c6ea38f2d3 | ||
![]() |
7c5ffb4cf2 | ||
![]() |
f905f9951d | ||
![]() |
bc74b2e32e | ||
![]() |
48fc1b30e5 | ||
![]() |
01ea4f8c63 | ||
![]() |
cf369218da | ||
![]() |
0cd2e0f29c | ||
![]() |
c83aff08bd | ||
![]() |
da269b1da1 | ||
![]() |
9726c51710 | ||
![]() |
71411c8d4c | ||
![]() |
511afb8677 | ||
![]() |
50c70d7026 | ||
![]() |
82ebe1009e | ||
![]() |
2e0814fa14 | ||
![]() |
e11eee19f7 | ||
![]() |
566657c339 | ||
![]() |
2e08948302 | ||
![]() |
79063e235a | ||
![]() |
d64a0be200 | ||
![]() |
9f7295673d | ||
![]() |
aa99d7214b | ||
![]() |
73286710e0 | ||
![]() |
1f94e14a70 | ||
![]() |
48a03b6d6f | ||
![]() |
f4aef9bdee | ||
![]() |
970d4f3027 | ||
![]() |
8869735270 | ||
![]() |
dee89d28b5 | ||
![]() |
1e830b0392 | ||
![]() |
61ecc0ea5c | ||
![]() |
95116338ad | ||
![]() |
755f36d012 | ||
![]() |
0af17e0601 | ||
![]() |
7cd16a77c2 | ||
![]() |
7daebd98b8 | ||
![]() |
567b64a34e | ||
![]() |
793d767313 | ||
![]() |
cb74fb5a9e | ||
![]() |
2a6a38c286 | ||
![]() |
108f2db587 | ||
![]() |
90ecbfe99b | ||
![]() |
55b14e66b6 | ||
![]() |
fa79e380dd | ||
![]() |
f2d211b2b2 | ||
![]() |
5849612a3b | ||
![]() |
3d97ffb539 | ||
![]() |
b5d4b23f3c | ||
![]() |
3c02c89ae5 | ||
![]() |
16a1407216 | ||
![]() |
143e1b1092 | ||
![]() |
5b94121112 | ||
![]() |
5c0f09c616 | ||
![]() |
03d92b7889 | ||
![]() |
9bbdd5eb5d | ||
![]() |
277485ddda | ||
![]() |
2e10465bfe | ||
![]() |
5a8f20362a | ||
![]() |
c64079e1f1 | ||
![]() |
f4b05e2da1 | ||
![]() |
3f22b0edba | ||
![]() |
ebdf8d863a | ||
![]() |
80985a74d7 | ||
![]() |
0a560452bf | ||
![]() |
f6b963145f | ||
![]() |
8b40646076 | ||
![]() |
cf0751109d | ||
![]() |
64a98bd4ea | ||
![]() |
f1410028fa | ||
![]() |
d5dce1c3fc | ||
![]() |
e83c1d6199 | ||
![]() |
86968e383b | ||
![]() |
9fffd2436c | ||
![]() |
2407b65a06 | ||
![]() |
6c5a0bf546 | ||
![]() |
caf47a58d5 | ||
![]() |
600c5235ec | ||
![]() |
3a1567f853 | ||
![]() |
18b495d1d0 | ||
![]() |
6335a3f588 | ||
![]() |
d5b18e57b5 | ||
![]() |
14e64306b2 | ||
![]() |
0c8019ad15 | ||
![]() |
d92d55befc | ||
![]() |
fc4623e584 | ||
![]() |
8d3b380837 | ||
![]() |
eedcd67113 | ||
![]() |
4c16d4527d | ||
![]() |
2d840bcd8b | ||
![]() |
5c181d60b1 | ||
![]() |
bde5eed237 | ||
![]() |
1c34f3dde1 | ||
![]() |
8b9882842f | ||
![]() |
19b0366ace | ||
![]() |
b6bad77274 | ||
![]() |
c892a339e0 | ||
![]() |
9e8935c9d4 | ||
![]() |
9107cdf13e | ||
![]() |
01eb8d22c2 | ||
![]() |
412d7e74d9 | ||
![]() |
6a65d9cdd6 | ||
![]() |
7af7fafc86 | ||
![]() |
dac0736e72 | ||
![]() |
c62b55913a | ||
![]() |
071e9690c6 | ||
![]() |
a730178204 | ||
![]() |
cf2fe9dd8e | ||
![]() |
39348f16f3 | ||
![]() |
8c5f85b499 | ||
![]() |
e3e8a52344 | ||
![]() |
a2ff824fc7 | ||
![]() |
1aa68d4974 | ||
![]() |
a6deb7c53f | ||
![]() |
229d1980dd | ||
![]() |
f7677e56e2 | ||
![]() |
35ac1ebf0c | ||
![]() |
5498e0e433 | ||
![]() |
cc3c056bcf | ||
![]() |
630bc4ee4f | ||
![]() |
d611bf1ff1 | ||
![]() |
49dee87eed | ||
![]() |
d8e980fdb2 | ||
![]() |
680c263033 | ||
![]() |
90684089a1 | ||
![]() |
df15a907e9 | ||
![]() |
2f1f658d33 | ||
![]() |
b7c0553239 | ||
![]() |
0d4deaf403 | ||
![]() |
e159740d76 | ||
![]() |
82713a8795 | ||
![]() |
ee2dd272d1 | ||
![]() |
9f8e79226e | ||
![]() |
1452be8f31 | ||
![]() |
e33fc8df83 | ||
![]() |
d1de32433e | ||
![]() |
eb3605d9e8 | ||
![]() |
55f9cd49e1 | ||
![]() |
76acc20a7d | ||
![]() |
84d6c4a5a2 | ||
![]() |
16f59f0273 | ||
![]() |
63576edde8 | ||
![]() |
03955c3691 | ||
![]() |
8faa97d8f1 | ||
![]() |
3c4aae44e0 | ||
![]() |
ee3a04af2f | ||
![]() |
941c6c0685 | ||
![]() |
cadbdb3ba9 |
|
@ -124,6 +124,13 @@
|
|||
<version>${mysql-connector-java.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- sqlserver-->
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>sqljdbc4</artifactId>
|
||||
<version>${sqljdbc4.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- oracle驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
|
|
|
@ -13,4 +13,7 @@ public interface DictConstant {
|
|||
String NOBLE_GAS_BETAGAMMA = "Noble Gas Beta-Gamma";
|
||||
|
||||
String NOBLE_GAS_HPGE = "Noble Gas HPGe";
|
||||
// todo 补充
|
||||
String ALERT_SYSTEM_CODE = "Noble Gas HPGe";
|
||||
|
||||
}
|
||||
|
|
|
@ -41,4 +41,6 @@ public interface RedisConstant {
|
|||
String EMAIL_MSG_ID = "email_msg_id";
|
||||
|
||||
String UNDEAL_FILE = "Undeal:";
|
||||
|
||||
String SELF_PARAMETER = "self_parameter";
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package org.jeecg.common.constant;
|
||||
|
||||
public class SelfStationConstant {
|
||||
public static final String ROI1 = "ROI1";
|
||||
public static final String ROI2 = "ROI2";
|
||||
public static final String ROI3 = "ROI3";
|
||||
public static final String ROI4 = "ROI4";
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
package org.jeecg.common.email;
|
||||
|
||||
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 com.google.common.collect.Lists;
|
||||
import com.sun.mail.imap.IMAPStore;
|
||||
|
@ -21,7 +19,6 @@ import org.jeecg.common.util.DateUtils;
|
|||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.base.entity.postgre.SysEmail;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.mail.*;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
@ -33,7 +30,6 @@ import java.io.*;
|
|||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -57,21 +53,13 @@ public class EmailServiceManager {
|
|||
* 系统启动时间
|
||||
*/
|
||||
private Date systemStartupTime;
|
||||
/**
|
||||
* 邮件接收数量
|
||||
*/
|
||||
/** 邮件接收数量 */
|
||||
private Integer receiveNum;
|
||||
/**
|
||||
* smtp协议的存储对象
|
||||
*/
|
||||
/** smtp协议的存储对象 */
|
||||
private IMAPStore store = null;
|
||||
/**
|
||||
* 邮件附件临时存储路径
|
||||
*/
|
||||
/** 邮件附件临时存储路径 */
|
||||
private String temporaryStoragePath;
|
||||
/**
|
||||
* 收件箱
|
||||
*/
|
||||
/** 收件箱 */
|
||||
private Folder folder = null;
|
||||
|
||||
private RedisUtil redisUtil;
|
||||
|
@ -81,27 +69,25 @@ public class EmailServiceManager {
|
|||
private final ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
@NotNull
|
||||
public static EmailServiceManager getInstance() {
|
||||
public static EmailServiceManager getInstance(){
|
||||
return new EmailServiceManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化邮件服务管理器
|
||||
*
|
||||
* @param email 邮件属性
|
||||
*/
|
||||
public void init(SysEmail email) {
|
||||
public void init(SysEmail email){
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化邮件服务管理器
|
||||
*
|
||||
* @param email 邮件属性
|
||||
*/
|
||||
public void init(SysEmail email, Integer receiveNum, String temporaryStoragePath,
|
||||
Date systemStartupTime, SpectrumPathProperties pathProperties, TaskProperties taskProperties,
|
||||
RedisUtil redisUtil) {
|
||||
Date systemStartupTime, SpectrumPathProperties pathProperties,TaskProperties taskProperties,
|
||||
RedisUtil redisUtil){
|
||||
this.email = email;
|
||||
this.receiveNum = receiveNum;
|
||||
this.temporaryStoragePath = temporaryStoragePath;
|
||||
|
@ -114,18 +100,18 @@ public class EmailServiceManager {
|
|||
/**
|
||||
* 测试邮件服务连通性
|
||||
*/
|
||||
public boolean testConnectEmailServer() {
|
||||
public boolean testConnectEmailServer(){
|
||||
Socket socket = new Socket();
|
||||
boolean flag = false;
|
||||
try {
|
||||
socket.connect(new InetSocketAddress(email.getEmailServerAddress(), email.getPort()), 3000);
|
||||
log.info("{}邮件服务连接测试成功", email.getName());
|
||||
socket.connect(new InetSocketAddress(email.getEmailServerAddress(),email.getPort()),3000);
|
||||
log.info("{}邮件服务连接测试成功",email.getName());
|
||||
flag = true;
|
||||
} catch (IOException e) {
|
||||
log.error("{}邮件服务连接测试失败,请检查邮件服务属性配置是否正确或邮件服务未开启,原因: ", email.getName(), e);
|
||||
} finally {
|
||||
log.error("{}邮件服务连接测试失败,请检查邮件服务属性配置是否正确或邮件服务未开启,原因{}",email.getName(),e.getMessage());
|
||||
}finally {
|
||||
try {
|
||||
if (null != socket) {
|
||||
if(null != socket){
|
||||
socket.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -140,14 +126,14 @@ public class EmailServiceManager {
|
|||
*/
|
||||
public Message[] receiveMail() throws Exception {
|
||||
String status = EmailLogManager.STATUS_SUCCESS;
|
||||
try {
|
||||
try{
|
||||
//配置邮件服务属性
|
||||
Properties properties = new Properties();
|
||||
properties.put("mail.store.protocol", "imap");
|
||||
properties.put("mail.imap.host", email.getEmailServerAddress());
|
||||
properties.put("mail.imap.port", email.getPort());
|
||||
properties.put("mail.imap.connectiontimeout", "3000");
|
||||
properties.put("mail.imap.timeout", "3000");
|
||||
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) {
|
||||
properties.put("mail.imap.ssl.enable", "true");
|
||||
} else {
|
||||
|
@ -156,10 +142,10 @@ public class EmailServiceManager {
|
|||
|
||||
HashMap IAM = new HashMap();
|
||||
//带上IMAP ID信息,由key和value组成,例如name,version,vendor,support-email等。
|
||||
IAM.put("name", "myname");
|
||||
IAM.put("version", "1.0.0");
|
||||
IAM.put("vendor", "myclient");
|
||||
IAM.put("support-email", "testmail@test.com");
|
||||
IAM.put("name","myname");
|
||||
IAM.put("version","1.0.0");
|
||||
IAM.put("vendor","myclient");
|
||||
IAM.put("support-email","testmail@test.com");
|
||||
|
||||
//获取邮件回话
|
||||
final Session session = Session.getDefaultInstance(properties);
|
||||
|
@ -168,26 +154,22 @@ public class EmailServiceManager {
|
|||
//获取smtp协议的存储对象
|
||||
store = (IMAPStore) session.getStore();
|
||||
//连接
|
||||
store.connect(email.getUsername(), email.getPassword());
|
||||
if (email.getEmailServerType()==1) {
|
||||
|
||||
// 解决163普通邮箱无法建立连接问题
|
||||
store.id(IAM);
|
||||
}
|
||||
|
||||
store.connect(email.getUsername(),email.getPassword());
|
||||
// 解决163普通邮箱无法建立连接问题
|
||||
store.id(IAM);
|
||||
//获取收件箱
|
||||
folder = store.getFolder("INBOX");//INBOX
|
||||
folder.open(Folder.READ_WRITE);
|
||||
//如果邮箱邮件数量 > 0
|
||||
final int messageCount = folder.getMessageCount();
|
||||
if (messageCount > 0) {
|
||||
if(messageCount > 0){
|
||||
Message[] messages = null;
|
||||
if (Objects.isNull(this.systemStartupTime)) {
|
||||
int finalNum = messageCount > this.receiveNum ? this.receiveNum : messageCount;
|
||||
if(Objects.isNull(this.systemStartupTime)){
|
||||
int finalNum = messageCount > this.receiveNum?this.receiveNum:messageCount;
|
||||
//邮箱邮件下标是从1开始的
|
||||
return folder.getMessages(1, finalNum);
|
||||
return folder.getMessages(1,finalNum);
|
||||
}
|
||||
SearchTerm searchTerm = new ReceivedDateTerm(ComparisonTerm.GE, this.systemStartupTime);
|
||||
SearchTerm searchTerm = new ReceivedDateTerm(ComparisonTerm.GE,this.systemStartupTime);
|
||||
messages = folder.search(searchTerm);
|
||||
Arrays.sort(messages, (o1, o2) -> {
|
||||
try {
|
||||
|
@ -198,21 +180,21 @@ public class EmailServiceManager {
|
|||
}
|
||||
return 0;
|
||||
});
|
||||
if (this.receiveNum >= messages.length) {
|
||||
if(this.receiveNum >= messages.length){
|
||||
return messages;
|
||||
} else {
|
||||
return Arrays.copyOfRange(messages, 0, this.receiveNum - 1);
|
||||
}else{
|
||||
return Arrays.copyOfRange(messages,0,this.receiveNum-1);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e){
|
||||
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;
|
||||
} finally {
|
||||
EmailLogEvent connectEvent = new EmailLogEvent(EmailLogManager.GS_TYPE_GET, email, status, EmailLogManager.CONNECT);
|
||||
EmailLogEvent connectEvent = new EmailLogEvent(EmailLogManager.GS_TYPE_GET,email,status,EmailLogManager.CONNECT);
|
||||
EmailLogManager.getInstance().setConnectLogEvent(connectEvent);
|
||||
//GetAllId C++原业务是把远程邮箱邮件同步到C++,本次java编写没有这一步,所以和Connect绑定,若Connect成功则GetAllId成功
|
||||
EmailLogEvent getAllEvent = new EmailLogEvent(EmailLogManager.GS_TYPE_GET, status, EmailLogManager.GETALLID);
|
||||
EmailLogEvent getAllEvent = new EmailLogEvent(EmailLogManager.GS_TYPE_GET,status,EmailLogManager.GETALLID);
|
||||
EmailLogManager.getInstance().setGetAllIdLogEvent(getAllEvent);
|
||||
}
|
||||
return null;
|
||||
|
@ -221,14 +203,14 @@ public class EmailServiceManager {
|
|||
/*
|
||||
* 测试收件邮箱账号是否可以正常使用
|
||||
* */
|
||||
public boolean canReceive() {
|
||||
public boolean canReceive(){
|
||||
Integer port = email.getPort();
|
||||
String username = email.getUsername();
|
||||
String password = email.getPassword();
|
||||
String host = email.getEmailServerAddress();
|
||||
|
||||
Properties props = new Properties();
|
||||
props.put("mail.store.protocol", "imap");
|
||||
props.put("mail.store.protocol","imap");
|
||||
props.put("mail.imap.host", host);
|
||||
props.put("mail.imap.port", port);
|
||||
|
||||
|
@ -239,26 +221,26 @@ public class EmailServiceManager {
|
|||
}
|
||||
});
|
||||
|
||||
try (Store store = session.getStore()) {
|
||||
try(Store store = session.getStore()) {
|
||||
store.connect(host, username, password);
|
||||
return store.isConnected();
|
||||
} catch (Exception e) {
|
||||
log.error("收件邮箱服务[Host: {}, Port: {}, Username: {}]连接异常: {}", host, port, username, e.getMessage());
|
||||
log.error("收件邮箱服务[Host: {}, Port: {}, Username: {}]连接异常: {}",host, port, username, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 测试收件邮箱账号是否可以正常使用(开启了SSL安全验证的邮箱)
|
||||
* */
|
||||
public boolean canReceiveSSL() {
|
||||
* 测试收件邮箱账号是否可以正常使用(开启了SSL安全验证的邮箱)
|
||||
* */
|
||||
public boolean canReceiveSSL(){
|
||||
Integer port = email.getPort();
|
||||
String username = email.getUsername();
|
||||
String password = email.getPassword();
|
||||
String host = email.getEmailServerAddress();
|
||||
|
||||
Properties props = new Properties();
|
||||
props.put("mail.store.protocol", "imap");
|
||||
props.put("mail.store.protocol","imap");
|
||||
props.put("mail.imap.host", host);
|
||||
props.put("mail.imap.port", port);
|
||||
props.put("mail.imap.auth", "true");
|
||||
|
@ -272,19 +254,19 @@ public class EmailServiceManager {
|
|||
}
|
||||
});
|
||||
|
||||
try (Store store = session.getStore()) {
|
||||
try(Store store = session.getStore()) {
|
||||
store.connect(host, username, password);
|
||||
return store.isConnected();
|
||||
} catch (Exception e) {
|
||||
log.error("收件邮箱服务SSL[Host: {}, Port: {}, Username: {}]连接异常: {}", host, port, username, e.getMessage());
|
||||
log.error("收件邮箱服务SSL[Host: {}, Port: {}, Username: {}]连接异常: {}",host, port, username, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 测试发件邮箱账号是否可以正常使用
|
||||
* */
|
||||
public boolean canSend() {
|
||||
* 测试发件邮箱账号是否可以正常使用
|
||||
* */
|
||||
public boolean canSend(){
|
||||
Integer port = email.getPort();
|
||||
String username = email.getUsername();
|
||||
String password = email.getPassword();
|
||||
|
@ -303,19 +285,19 @@ public class EmailServiceManager {
|
|||
}
|
||||
});
|
||||
|
||||
try (Transport transport = session.getTransport()) {
|
||||
try (Transport transport = session.getTransport()){
|
||||
transport.connect(host, username, password);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("发件邮箱服务[Host: {}, Port: {}, Username: {}]连接异常: {}", host, port, username, e.getMessage());
|
||||
log.error("发件邮箱服务[Host: {}, Port: {}, Username: {}]连接异常: {}",host, port, username, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 测试发件邮箱账号是否可以正常使用(开启了SSL安全验证的邮箱)
|
||||
* */
|
||||
public boolean canSendSSL() {
|
||||
* 测试发件邮箱账号是否可以正常使用(开启了SSL安全验证的邮箱)
|
||||
* */
|
||||
public boolean canSendSSL(){
|
||||
Integer port = email.getPort();
|
||||
String username = email.getUsername();
|
||||
String password = email.getPassword();
|
||||
|
@ -336,11 +318,11 @@ public class EmailServiceManager {
|
|||
}
|
||||
});
|
||||
|
||||
try (Transport transport = session.getTransport()) {
|
||||
try (Transport transport = session.getTransport()){
|
||||
transport.connect(host, username, password);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("发件邮箱服务SSL[Host: {}, Port: {}, Username: {}]连接异常: {}", host, port, username, e.getMessage());
|
||||
log.error("发件邮箱服务SSL[Host: {}, Port: {}, Username: {}]连接异常: {}",host, port, username, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -376,7 +358,7 @@ public class EmailServiceManager {
|
|||
|
||||
// 发送邮件
|
||||
Transport transport = session.getTransport();
|
||||
transport.connect(email.getUsername(), email.getPassword());
|
||||
transport.connect(email.getUsername(),email.getPassword());
|
||||
transport.sendMessage(message, message.getAllRecipients());
|
||||
|
||||
// 关闭资源
|
||||
|
@ -386,7 +368,7 @@ public class EmailServiceManager {
|
|||
/**
|
||||
* 发送邮件 群发
|
||||
*/
|
||||
public void sendMail(MessageDTO messageDTO) {
|
||||
public void sendMail(MessageDTO messageDTO){
|
||||
// 邮箱连接属性
|
||||
Properties props = new Properties();
|
||||
props.put("mail.transport.protocol", "smtp");
|
||||
|
@ -411,24 +393,24 @@ public class EmailServiceManager {
|
|||
InternetAddress.parse(messageDTO.getToUser()));
|
||||
// 发送邮件
|
||||
transport = session.getTransport();
|
||||
transport.connect(email.getUsername(), email.getPassword());
|
||||
transport.sendMessage(message, message.getAllRecipients());
|
||||
transport.connect(email.getUsername(),email.getPassword());
|
||||
transport.sendMessage(message,message.getAllRecipients());
|
||||
} catch (MessagingException e) {
|
||||
// 无效的电子邮箱导致群发失败,剔除无效邮箱然后重新发送
|
||||
Address[] invalid;
|
||||
if (e instanceof SMTPAddressFailedException) {
|
||||
invalid = ((SMTPAddressFailedException) e).getInvalidAddresses();
|
||||
reSendMail(invalid, messageDTO);
|
||||
reSendMail(invalid,messageDTO);
|
||||
} else if (e instanceof SendFailedException) {
|
||||
invalid = ((SendFailedException) e).getInvalidAddresses();
|
||||
reSendMail(invalid, messageDTO);
|
||||
reSendMail(invalid,messageDTO);
|
||||
}
|
||||
} finally {
|
||||
if (transport != null) {
|
||||
}finally {
|
||||
if (transport != null){
|
||||
try {
|
||||
transport.close();
|
||||
} catch (MessagingException e) {
|
||||
log.error("Transport关闭失败,{}", e);
|
||||
log.error("Transport关闭失败,{}",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -440,20 +422,20 @@ public class EmailServiceManager {
|
|||
* @param invalid 无效电子邮箱列表
|
||||
* @param messageDTO 消息dto
|
||||
*/
|
||||
private void reSendMail(Address[] invalid, MessageDTO messageDTO) {
|
||||
private void reSendMail(Address[] invalid,MessageDTO messageDTO){
|
||||
List<String> invalidEmails = Arrays.stream(invalid)
|
||||
.map(address -> address.toString())
|
||||
.collect(Collectors.toList());
|
||||
log.warn("部分或者全部邮件发送失败,无效的电子邮箱:{}", invalidEmails);
|
||||
log.warn("部分或者全部邮件发送失败,无效的电子邮箱:{}",invalidEmails);
|
||||
String[] allEmails = messageDTO.getToUser().split(SymbolConstant.COMMA);
|
||||
String[] emails = new String[]{};
|
||||
for (String address : invalidEmails) {
|
||||
emails = ArrayUtil.removeEle(allEmails, address);
|
||||
emails = ArrayUtil.removeEle(allEmails,address);
|
||||
}
|
||||
// 如果移除无效电子邮箱后,待发送邮箱不为空
|
||||
String toUser = Arrays.stream(emails)
|
||||
.collect(Collectors.joining(SymbolConstant.COMMA));
|
||||
if (StrUtil.isNotBlank(toUser)) {
|
||||
if (StrUtil.isNotBlank(toUser)){
|
||||
messageDTO.setToUser(toUser);
|
||||
sendMail(messageDTO);
|
||||
}
|
||||
|
@ -461,11 +443,10 @@ public class EmailServiceManager {
|
|||
|
||||
/**
|
||||
* 获取邮件主题
|
||||
*
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
public String getMailSubject(@NotNull Message message, Integer batchesCounter) throws MessagingException {
|
||||
public String getMailSubject(@NotNull Message message,Integer batchesCounter) throws MessagingException {
|
||||
String subject = "";
|
||||
String status = EmailLogManager.STATUS_SUCCESS;
|
||||
try {
|
||||
|
@ -475,36 +456,34 @@ public class EmailServiceManager {
|
|||
} catch (MessagingException e) {
|
||||
status = EmailLogManager.STATUS_ERROR;
|
||||
throw e;
|
||||
} finally {
|
||||
EmailLogEvent event = new EmailLogEvent(batchesCounter, Thread.currentThread().getId(), EmailLogManager.GS_TYPE_GET, status, EmailLogManager.GETIDHEADER);
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(), event);
|
||||
}finally {
|
||||
EmailLogEvent event = new EmailLogEvent(batchesCounter,Thread.currentThread().getId(),EmailLogManager.GS_TYPE_GET,status,EmailLogManager.GETIDHEADER);
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),event);
|
||||
}
|
||||
return subject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邮件内容
|
||||
*
|
||||
* @param part
|
||||
* @return
|
||||
* @throws MessagingException
|
||||
* @throws IOException
|
||||
*/
|
||||
public void getMailContent(@NotNull Part part, StringBuilder content) throws MessagingException, IOException {
|
||||
if (part.isMimeType(MailContentType.PLAIN.getContentType())) {
|
||||
if(part.isMimeType(MailContentType.PLAIN.getContentType())){
|
||||
content.append(part.getContent());
|
||||
} else if (part.isMimeType("multipart/*")) {
|
||||
}else if(part.isMimeType("multipart/*")){
|
||||
Multipart multipart = (Multipart) part.getContent();
|
||||
for (int i = 0; i < multipart.getCount(); i++) {
|
||||
for(int i=0;i<multipart.getCount();i++) {
|
||||
final Part bodyPart = multipart.getBodyPart(i);
|
||||
getMailContent(bodyPart, content);
|
||||
getMailContent(bodyPart,content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存邮件附件
|
||||
*
|
||||
* @param part
|
||||
* @throws MessagingException
|
||||
* @throws IOException
|
||||
|
@ -512,27 +491,27 @@ public class EmailServiceManager {
|
|||
public List<String> saveAttachment(@NotNull Part part) throws MessagingException, IOException {
|
||||
List<String> filePathList = Lists.newArrayList();
|
||||
Multipart multipart = (Multipart) part.getContent();
|
||||
for (int i = 0; i < multipart.getCount(); i++) {
|
||||
for(int i=0;i<multipart.getCount();i++){
|
||||
final BodyPart bodyPart = multipart.getBodyPart(i);
|
||||
if (Part.ATTACHMENT.equalsIgnoreCase(bodyPart.getDisposition())) {
|
||||
if(Part.ATTACHMENT.equalsIgnoreCase(bodyPart.getDisposition())){
|
||||
BufferedInputStream bis = null;
|
||||
BufferedOutputStream bos = null;
|
||||
try {
|
||||
try{
|
||||
final String fileName = MimeUtility.decodeText(bodyPart.getFileName());
|
||||
bis = new BufferedInputStream(bodyPart.getInputStream());
|
||||
File file = new File(this.temporaryStoragePath + File.separator + fileName);
|
||||
File file = new File(this.temporaryStoragePath+File.separator+fileName);
|
||||
bos = new BufferedOutputStream(new FileOutputStream(file));
|
||||
byte[] buf = new byte[4096];
|
||||
int len;
|
||||
while (-1 != (len = bis.read(buf, 0, buf.length))) {
|
||||
bos.write(buf, 0, buf.length);
|
||||
while(-1 != (len = bis.read(buf,0,buf.length))){
|
||||
bos.write(buf,0,buf.length);
|
||||
}
|
||||
filePathList.add(file.getAbsolutePath());
|
||||
} finally {
|
||||
if (null != bis) {
|
||||
}finally {
|
||||
if(null != bis){
|
||||
bis.close();
|
||||
}
|
||||
if (null != bos) {
|
||||
if(null != bos){
|
||||
bos.flush();
|
||||
bos.close();
|
||||
}
|
||||
|
@ -549,7 +528,7 @@ public class EmailServiceManager {
|
|||
* 新格式为:发件人_主题_年月日_时分秒毫秒_receive_年月日_时分秒毫秒_计数(0-10000)
|
||||
* 当计数大于10000后从0开始,服务重启后也从0开始
|
||||
*/
|
||||
public File downloadEmailToEmlDir(@NotNull Message message, Integer emailCounter, Integer batchesCounter) throws MessagingException {
|
||||
public File downloadEmailToEmlDir(@NotNull Message message,Integer emailCounter,Integer batchesCounter) throws MessagingException {
|
||||
synchronized (downloadEmlLocal) {
|
||||
String subject = "";
|
||||
File emlFile = null;
|
||||
|
@ -560,14 +539,14 @@ public class EmailServiceManager {
|
|||
try {
|
||||
//获取发件人
|
||||
final String address = ((InternetAddress) message.getFrom()[0]).getAddress();
|
||||
final String from = address.substring(0, address.indexOf(StringConstant.AT));
|
||||
final String from = address.substring(0,address.indexOf(StringConstant.AT));
|
||||
//获取主题
|
||||
subject = MimeUtility.decodeText(message.getSubject());
|
||||
if (subject.indexOf(StringConstant.SLASH) != -1) {
|
||||
subject = StringUtils.replace(subject, StringConstant.SLASH, "");
|
||||
if(subject.indexOf(StringConstant.SLASH) != -1){
|
||||
subject = StringUtils.replace(subject,StringConstant.SLASH,"");
|
||||
}
|
||||
if (subject.indexOf(StringConstant.COLON) != -1) {
|
||||
subject = StringUtils.replace(subject, StringConstant.COLON, "");
|
||||
if(subject.indexOf(StringConstant.COLON) != -1){
|
||||
subject = StringUtils.replace(subject,StringConstant.COLON,"");
|
||||
}
|
||||
receivedDate = message.getReceivedDate();
|
||||
StringBuilder fileName = new StringBuilder();
|
||||
|
@ -575,21 +554,21 @@ public class EmailServiceManager {
|
|||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(subject);
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(new Date(), "YYMMdd"));
|
||||
fileName.append(DateUtils.formatDate(new Date(),"YYMMdd"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(new Date(), "HHmmssSSS"));
|
||||
fileName.append(DateUtils.formatDate(new Date(),"HHmmssSSS"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append("receive");
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(receivedDate, "YYMMdd"));
|
||||
fileName.append(DateUtils.formatDate(receivedDate,"YYMMdd"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(receivedDate, "HHmmssSSS"));
|
||||
fileName.append(DateUtils.formatDate(receivedDate,"HHmmssSSS"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(emailCounter);
|
||||
fileName.append(SAVE_EML_SUFFIX);
|
||||
final String rootPath = spectrumPathProperties.getRootPath();
|
||||
final String emlPath = spectrumPathProperties.getEmlPath();
|
||||
emlFile = new File(rootPath + emlPath + File.separator + fileName);
|
||||
emlFile = new File(rootPath+emlPath+File.separator+fileName);
|
||||
// outputStream = new FileOutputStream(emlFile);
|
||||
// message.writeTo(outputStream);
|
||||
|
||||
|
@ -609,13 +588,12 @@ public class EmailServiceManager {
|
|||
String errorMsg = StrUtil.format("The email download failed, the subject of the email is {}, the reason is {}.", subject, e.getMessage());
|
||||
log.error(errorMsg);
|
||||
throw new DownloadEmailException(errorMsg);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
EmailLogEvent event = new EmailLogEvent(batchesCounter, Thread.currentThread().getId(), EmailLogManager.GS_TYPE_GET, status, EmailLogManager.GETIDEML, subject, DateUtils.formatDate(receivedDate, "yyyy-MM-dd HH:mm:ss:SSS"),
|
||||
(Objects.isNull(emlFile) ? " " : emlFile.getAbsolutePath()));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(), event);
|
||||
}catch (Exception e) {
|
||||
log.error("",e);
|
||||
}finally {
|
||||
EmailLogEvent event = new EmailLogEvent(batchesCounter,Thread.currentThread().getId(),EmailLogManager.GS_TYPE_GET,status,EmailLogManager.GETIDEML,subject,DateUtils.formatDate(receivedDate,"yyyy-MM-dd HH:mm:ss:SSS"),
|
||||
(Objects.isNull(emlFile)?" ":emlFile.getAbsolutePath()));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),event);
|
||||
try {
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
|
@ -666,7 +644,7 @@ public class EmailServiceManager {
|
|||
throw new RuntimeException("下载 eml 执行超时");
|
||||
}
|
||||
}*/
|
||||
public File executeWithLock(Message message, Integer emailCounter, Integer batchesCounter) throws MessagingException {
|
||||
public File executeWithLock(Message message,Integer emailCounter,Integer batchesCounter) throws MessagingException {
|
||||
|
||||
String subject = "";
|
||||
File emlFile = null;
|
||||
|
@ -676,14 +654,14 @@ public class EmailServiceManager {
|
|||
// 获取锁 设置超时
|
||||
//获取发件人
|
||||
final String address = ((InternetAddress) message.getFrom()[0]).getAddress();
|
||||
final String from = address.substring(0, address.indexOf(StringConstant.AT));
|
||||
final String from = address.substring(0,address.indexOf(StringConstant.AT));
|
||||
//获取主题
|
||||
subject = MimeUtility.decodeText(message.getSubject());
|
||||
if (subject.contains(StringConstant.SLASH)) {
|
||||
subject = StringUtils.replace(subject, StringConstant.SLASH, "");
|
||||
if(subject.contains(StringConstant.SLASH)){
|
||||
subject = StringUtils.replace(subject,StringConstant.SLASH,"");
|
||||
}
|
||||
if (subject.contains(StringConstant.COLON)) {
|
||||
subject = StringUtils.replace(subject, StringConstant.COLON, "");
|
||||
if(subject.contains(StringConstant.COLON)){
|
||||
subject = StringUtils.replace(subject,StringConstant.COLON,"");
|
||||
}
|
||||
receivedDate = message.getReceivedDate();
|
||||
StringBuilder fileName = new StringBuilder();
|
||||
|
@ -691,21 +669,21 @@ public class EmailServiceManager {
|
|||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(subject);
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(new Date(), "YYMMdd"));
|
||||
fileName.append(DateUtils.formatDate(new Date(),"YYMMdd"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(new Date(), "HHmmssSSS"));
|
||||
fileName.append(DateUtils.formatDate(new Date(),"HHmmssSSS"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append("receive");
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(receivedDate, "YYMMdd"));
|
||||
fileName.append(DateUtils.formatDate(receivedDate,"YYMMdd"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(DateUtils.formatDate(receivedDate, "HHmmssSSS"));
|
||||
fileName.append(DateUtils.formatDate(receivedDate,"HHmmssSSS"));
|
||||
fileName.append(StringConstant.UNDER_LINE);
|
||||
fileName.append(emailCounter);
|
||||
fileName.append(SAVE_EML_SUFFIX);
|
||||
final String rootPath = spectrumPathProperties.getRootPath();
|
||||
final String emlPath = spectrumPathProperties.getEmlPath();
|
||||
emlFile = new File(rootPath + emlPath + File.separator + fileName);
|
||||
emlFile = new File(rootPath+emlPath+File.separator+fileName);
|
||||
// Thread.sleep(6000l);
|
||||
// try(FileOutputStream outputStream = new FileOutputStream(emlFile)) {
|
||||
// message.writeTo(outputStream);
|
||||
|
@ -718,12 +696,12 @@ public class EmailServiceManager {
|
|||
String errorMsg = StrUtil.format("The email download failed, the subject of the email is {}, the reason is {}.", subject, e.getMessage());
|
||||
log.error(errorMsg);
|
||||
throw new DownloadEmailException(errorMsg);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
} catch (Exception e) {
|
||||
log.error("",e);
|
||||
} finally {
|
||||
EmailLogEvent event = new EmailLogEvent(batchesCounter, Thread.currentThread().getId(), EmailLogManager.GS_TYPE_GET, status, EmailLogManager.GETIDEML, subject, DateUtils.formatDate(receivedDate, "yyyy-MM-dd HH:mm:ss:SSS"),
|
||||
(Objects.isNull(emlFile) ? " " : emlFile.getAbsolutePath()));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(), event);
|
||||
EmailLogEvent event = new EmailLogEvent(batchesCounter,Thread.currentThread().getId(),EmailLogManager.GS_TYPE_GET,status,EmailLogManager.GETIDEML,subject,DateUtils.formatDate(receivedDate,"yyyy-MM-dd HH:mm:ss:SSS"),
|
||||
(Objects.isNull(emlFile)?" ":emlFile.getAbsolutePath()));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),event);
|
||||
}
|
||||
return emlFile;
|
||||
}
|
||||
|
@ -731,76 +709,73 @@ public class EmailServiceManager {
|
|||
public void a(AtomicReference<FileOutputStream> outputStream, Message message) throws MessagingException, IOException {
|
||||
message.writeTo(outputStream.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除邮件
|
||||
*
|
||||
* @param message
|
||||
* @throws MessagingException
|
||||
*/
|
||||
public void removeMail(@NotNull Message message, Integer batchesCounter) {
|
||||
public void removeMail(@NotNull Message message,Integer batchesCounter){
|
||||
String status = EmailLogManager.STATUS_SUCCESS;
|
||||
String subject = "";
|
||||
Date receivedDate = null;
|
||||
try {
|
||||
subject = MimeUtility.decodeText(message.getSubject());
|
||||
receivedDate = message.getReceivedDate();
|
||||
message.setFlag(Flags.Flag.DELETED, true);
|
||||
message.setFlag(Flags.Flag.DELETED,true);
|
||||
// log.info("EmailServiceManager: Remove Email:{},receiveTime:{}",message.getSubject(), DateUtils.formatDate(message.getReceivedDate(),"yyyy-MM-dd HH:mm:ss"));
|
||||
} catch (MessagingException | UnsupportedEncodingException e) {
|
||||
status = EmailLogManager.STATUS_ERROR;
|
||||
log.error("Email deletion failed, the subject of the email is :{}, the reason is :", subject, e);
|
||||
log.error("Email deletion failed, the subject of the email is :{}, the reason is :{}.",subject,e.getMessage());
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
} 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"));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(), removeEvent);
|
||||
}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"));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),removeEvent);
|
||||
//这里删除和彻底删除一起写入日志,java和C++处理有差异,java是在连接关闭时彻底删除的
|
||||
EmailLogEvent expungeEvent = new EmailLogEvent(batchesCounter, Thread.currentThread().getId(), EmailLogManager.GS_TYPE_GET, status, EmailLogManager.EXPUNGE, subject, DateUtils.formatDate(receivedDate, "yyyy-MM-dd HH:mm:ss:SSS"));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(), expungeEvent);
|
||||
EmailLogEvent expungeEvent = new EmailLogEvent(batchesCounter,Thread.currentThread().getId(),EmailLogManager.GS_TYPE_GET,status,EmailLogManager.EXPUNGE,subject,DateUtils.formatDate(receivedDate,"yyyy-MM-dd HH:mm:ss:SSS"));
|
||||
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),expungeEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭邮件服务连接资源
|
||||
*/
|
||||
public void close(List<String> messageIds) {
|
||||
public void close(List<String> messageIds){
|
||||
try {
|
||||
if (null != folder) {
|
||||
if(null != folder){
|
||||
folder.expunge();
|
||||
folder.close();
|
||||
}
|
||||
if (null != store) {
|
||||
if(null != store){
|
||||
store.close();
|
||||
}
|
||||
log.info("{}: EmailServiceManage资源关闭完成.", Thread.currentThread().getName());
|
||||
log.info(Thread.currentThread().getName() + ",EmailServiceManage资源关闭完成.");
|
||||
// for(String messageId : messageIds){
|
||||
// String key = RedisConstant.EMAIL_MSG_ID+StringConstant.COLON+messageId;
|
||||
// redisUtil.del(key);
|
||||
// }
|
||||
} catch (MessagingException e) {
|
||||
log.error("Email closure failed, email address is: {}, reason is: {}", email.getUsername(), e);
|
||||
log.error("Email closure failed, email address is: {}, reason is: {}",email.getUsername(),e.getMessage());
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验邮件
|
||||
* 若此次获取的邮件是上次删除失败的邮件直接删除
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
public boolean check(Message message, String messageId) {
|
||||
public boolean check(Message message,String messageId){
|
||||
boolean exist = false;
|
||||
try {
|
||||
String key = RedisConstant.EMAIL_MSG_ID + StringConstant.COLON + messageId;
|
||||
int numberKey = redisUtil.get(key) != null ? (int) redisUtil.get(key) : 0;
|
||||
String key = RedisConstant.EMAIL_MSG_ID+StringConstant.COLON+messageId;
|
||||
int numberKey = redisUtil.get(key) != null? (int) redisUtil.get(key):0;
|
||||
// exist = redisUtil.hasKey(key);
|
||||
if (numberKey >= taskProperties.getForceDeletedNumber()) {
|
||||
if(numberKey >= taskProperties.getForceDeletedNumber()){
|
||||
exist = true;
|
||||
log.info("Check: Remove Email:{},receiveTime:{}", message.getSubject(), DateUtils.formatDate(message.getReceivedDate(), "yyyy-MM-dd HH:mm:ss"));
|
||||
message.setFlag(Flags.Flag.DELETED, true);
|
||||
log.info("Check: Remove Email:{},receiveTime:{}",message.getSubject(), DateUtils.formatDate(message.getReceivedDate(),"yyyy-MM-dd HH:mm:ss"));
|
||||
message.setFlag(Flags.Flag.DELETED,true);
|
||||
redisUtil.del(key);
|
||||
}
|
||||
return exist;
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
package org.jeecg.common.handler;
|
||||
|
||||
import org.apache.ibatis.type.BaseTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MybatisTypeHandler extends BaseTypeHandler<Boolean> {
|
||||
/**
|
||||
* 功能描述: <br>
|
||||
* <>
|
||||
* @param: [ps, i, parameter, jdbcType]
|
||||
* i:Jdbc预编译时设置参数的索引值
|
||||
* parameter:要插入的参数值 true 或者false
|
||||
* jdbcType:要插入JDBC的类型
|
||||
* 里面的业务逻辑要根据实际开发场景来写 我这里就写的简单一点比较好理解一下
|
||||
* @return:
|
||||
* @author: wlt
|
||||
* @date: 2022/3/22 21:25
|
||||
**/
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement ps, int i, Boolean parameter, JdbcType jdbcType) throws SQLException {
|
||||
if (parameter){
|
||||
ps.setInt(i,1);
|
||||
}else ps.setInt(i,0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
int man = rs.getInt(columnName);
|
||||
return man == 1 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
int man = rs.getInt(columnIndex);
|
||||
return man == 1 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
int man = cs.getInt(columnIndex);
|
||||
return man == 1 ? true : false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
package org.jeecg.common.parameter;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import org.jeecg.common.constant.RedisConstant;
|
||||
import org.jeecg.common.properties.ParameterProperties;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.entity.vo.NuclideLine;
|
||||
import org.jeecg.modules.entity.vo.SelfParameter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.w3c.dom.*;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
@Configuration
|
||||
public class SelfParameterInit {
|
||||
|
||||
@Autowired
|
||||
private ParameterProperties parameterProperties;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Bean
|
||||
public void readSelfMDCParameter() {
|
||||
//配置文件路径
|
||||
String filePath = parameterProperties.getFilePath()+ File.separator + parameterProperties.getSelfParameterFile();
|
||||
SelfParameter selfParameter = new SelfParameter();
|
||||
try {
|
||||
//创建一个文档解析器工厂
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
//创建文档解析器
|
||||
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
|
||||
//读取xml文件生成一个文档
|
||||
Document document = documentBuilder.parse(filePath);
|
||||
if (Objects.nonNull(document)){
|
||||
//获取文档的根元素
|
||||
Element element = document.getDocumentElement();
|
||||
//获取根元素的子节点
|
||||
NodeList docChildNodes = element.getChildNodes();
|
||||
//判断文件内的节点是否大于0
|
||||
if (Objects.nonNull(docChildNodes) && docChildNodes.getLength() > 0) {
|
||||
//遍历文件节点读取内容
|
||||
for (int i=0; i<docChildNodes.getLength(); i++) {
|
||||
//获取节点信息
|
||||
Node node = docChildNodes.item(i);
|
||||
//判断节点名称是否是 P
|
||||
if (node.getNodeName().equalsIgnoreCase("nuclide")) {
|
||||
//获取节点下的子节点信息
|
||||
NodeList childNodes = node.getChildNodes();
|
||||
//如果子节点不为空
|
||||
if (Objects.nonNull(childNodes) && childNodes.getLength() > 0) {
|
||||
//遍历子节点信息 将核素信息封存到缓存中
|
||||
for (int j=0; j<childNodes.getLength(); j++) {
|
||||
Node childNode = childNodes.item(j);
|
||||
//获取节点属性信息
|
||||
NamedNodeMap attributes = childNode.getAttributes();
|
||||
//判断节点属性信息是否为空
|
||||
if (Objects.nonNull(attributes)) {
|
||||
NuclideLine nuclide = new NuclideLine();
|
||||
//遍历属性信息
|
||||
for (int k=0; k<attributes.getLength(); k++) {
|
||||
//根据顺序读取属性
|
||||
Node attribute = attributes.item(k);
|
||||
if (attribute.getNodeName().equalsIgnoreCase("nuclide_name")) {
|
||||
nuclide.setName(attribute.getNodeValue());
|
||||
} else if (attribute.getNodeName().equalsIgnoreCase("yield")) {
|
||||
nuclide.setYield(Double.valueOf(attribute.getNodeValue()));
|
||||
} else if (attribute.getNodeName().equalsIgnoreCase("energy")) {
|
||||
nuclide.setEnergy(Double.valueOf(attribute.getNodeValue()));
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(nuclide.getName()) && Objects.nonNull(nuclide.getEnergy())) {
|
||||
selfParameter.getNuclideMap().put(nuclide.getName(), nuclide);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
redisUtil.set(RedisConstant.SELF_PARAMETER, selfParameter);
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (SAXException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,4 +26,12 @@ public class ParameterProperties implements Serializable {
|
|||
*/
|
||||
private String dbPath;
|
||||
|
||||
private String SelfParameterFile;
|
||||
|
||||
private String MDCParameterFile;
|
||||
|
||||
private String SystemManagerFile;
|
||||
|
||||
private String parameterFile;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DataTool {
|
||||
|
||||
private int counter = 1;
|
||||
|
||||
private final Map<String, Object> data = new LinkedHashMap<>();
|
||||
private final Map<String, Object> data = new HashMap<>();
|
||||
|
||||
public DataTool put(Object value) {
|
||||
data.put(String.format("p%d", counter), value);
|
||||
|
|
|
@ -206,29 +206,6 @@ public class DateUtils extends PropertyEditorSupport {
|
|||
return sformat.format(nowDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间字符串格式转换
|
||||
* @param date 时间字符串
|
||||
* @param sourceFormat 字符串原有格式
|
||||
* @param targetFormat 需要转换成的格式
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String dateformat(String date,String sourceFormat,String targetFormat)
|
||||
{
|
||||
SimpleDateFormat sformat = new SimpleDateFormat(sourceFormat);
|
||||
Date nowDate = null;
|
||||
try {
|
||||
nowDate = sformat.parse(date);
|
||||
sformat=new SimpleDateFormat(targetFormat);
|
||||
} catch (ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sformat.format(nowDate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 日期转换为字符串
|
||||
*
|
||||
|
@ -828,4 +805,51 @@ public class DateUtils extends PropertyEditorSupport {
|
|||
return days;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开始时间和结束时间之间的全部小时信息
|
||||
* @param beginDay
|
||||
* @param endDay
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getAllDayTime(String beginDay, String endDay){
|
||||
List<String> dayTimes = new ArrayList<>();
|
||||
try {
|
||||
//开始日期
|
||||
Calendar begin = Calendar.getInstance();
|
||||
begin.setTime(DateUtils.parseDate(beginDay, "yyyy-MM-dd"));
|
||||
//将开始日期的24个小时放入集合中
|
||||
for (int i=0; i< 24; i++) {
|
||||
String dayTime = beginDay;
|
||||
if (i < 10) {
|
||||
dayTime+=" 0"+i;
|
||||
} else {
|
||||
dayTime+=" "+i;
|
||||
}
|
||||
dayTime+=":00:00";
|
||||
dayTimes.add(dayTime);
|
||||
}
|
||||
//结束日期
|
||||
Calendar end = Calendar.getInstance();
|
||||
end.setTime(DateUtils.parseDate(endDay, "yyyy-MM-dd"));
|
||||
//判断 如果结束日期的时间在开始日期的时间之后
|
||||
while(end.getTime().after(begin.getTime())){
|
||||
//开始日期需要+1天
|
||||
begin.add(Calendar.DAY_OF_MONTH, 1);
|
||||
for (int i=0; i< 24; i++) {
|
||||
String dayTime = DateUtils.formatDate(begin.getTime(),"yyyy-MM-dd");
|
||||
if (i < 10) {
|
||||
dayTime+=" 0"+i;
|
||||
} else {
|
||||
dayTime+=" "+i;
|
||||
}
|
||||
dayTime+=":00:00";
|
||||
dayTimes.add(dayTime);
|
||||
}
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return dayTimes;
|
||||
}
|
||||
|
||||
}
|
|
@ -13,6 +13,7 @@ import org.apache.poi.ss.usermodel.Workbook;
|
|||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.DefaultResourceLoader;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
@ -104,6 +105,29 @@ public class ExportUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static <T> void exportXls(HttpServletResponse response, List<Map<String, Object>> dataList, String fileName){
|
||||
Workbook workbook = null;
|
||||
OutputStream outputStream = null;
|
||||
try {
|
||||
// 设置文件名、Excel类型(xls|xlsx)
|
||||
outputStream = ExportUtil.xls(response,fileName);
|
||||
workbook = ExcelExportUtil.
|
||||
exportExcel(dataList, ExcelType.HSSF);
|
||||
workbook.write(outputStream);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
try {
|
||||
if (ObjectUtil.isNotNull(outputStream))
|
||||
outputStream.close();
|
||||
if (ObjectUtil.isNotNull(workbook))
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> void exportXls(HttpServletResponse response, Class<T> target, List<T> data){
|
||||
exportXls(response, target, data, "file.xls");
|
||||
}
|
||||
|
|
|
@ -74,6 +74,27 @@ public class FTPUtil {
|
|||
return this.ftpRootPath;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
FTPClient ftp = new FTPClient();
|
||||
//连接
|
||||
ftp.connect("172.21.170.122", 21);
|
||||
//登录
|
||||
ftp.login("rmsops", "cnndc010");
|
||||
// 切换为本地被动模式,可以解决FTP上传后文件为空的问题,但需要服务器将FTP服务添加至防火墙白名单
|
||||
ftp.enterLocalPassiveMode();
|
||||
//切换工作路径
|
||||
ftp.changeWorkingDirectory("/SpectrumFile/admin");
|
||||
//判断是否连接成功
|
||||
int reply = ftp.getReplyCode();
|
||||
if (!FTPReply.isPositiveCompletion(reply)) {
|
||||
ftp.disconnect();
|
||||
System.out.printf(reply+"");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 登录ftp
|
||||
* @return
|
||||
|
@ -89,7 +110,7 @@ public class FTPUtil {
|
|||
// 切换为本地被动模式,可以解决FTP上传后文件为空的问题,但需要服务器将FTP服务添加至防火墙白名单
|
||||
ftp.enterLocalPassiveMode();
|
||||
//切换工作路径
|
||||
ftp.changeWorkingDirectory(ftpRootPath);
|
||||
ftp.changeWorkingDirectory("/");
|
||||
//判断是否连接成功
|
||||
int reply = ftp.getReplyCode();
|
||||
if (!FTPReply.isPositiveCompletion(reply)) {
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import org.jeecg.common.properties.SpectrumPathProperties;
|
||||
import org.jeecg.modules.base.enums.DataType;
|
||||
import org.jeecg.modules.base.enums.SystemType;
|
||||
import org.jeecg.modules.entity.vo.PHDFile;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -18,21 +21,24 @@ import java.util.Map;
|
|||
@Component
|
||||
public class NameStandUtil {
|
||||
|
||||
@Autowired
|
||||
private SpectrumPathProperties pathProperties;
|
||||
|
||||
public String GetSysTemSubdir(String systemType) {
|
||||
StringBuffer path = new StringBuffer();
|
||||
String path = null;
|
||||
Map<String, String> pathMap = pathProperties.getFilePathMap();
|
||||
if(systemType.contains(SystemType.BETA.getType())) {
|
||||
path.append("Spectrum");
|
||||
path.append(StringPool.SLASH+"Xenon");
|
||||
path.append(StringPool.SLASH+"Sauna");
|
||||
path = pathMap.getOrDefault(SystemType.BETA.getType(), "Spectrum/Xenon/Sauna");
|
||||
} else if(systemType.contains(SystemType.GAMMA.getType())) {
|
||||
path.append("Spectrum");
|
||||
path.append(StringPool.SLASH+"Xenon");
|
||||
path.append(StringPool.SLASH+"Spalax");
|
||||
path = pathMap.getOrDefault(SystemType.GAMMA.getType(), "Spectrum/Xenon/Spalax");
|
||||
} else if(systemType.contains(SystemType.PARTICULATE.getType())) {
|
||||
path.append("Spectrum");
|
||||
path.append(StringPool.SLASH+"Particulates");
|
||||
path = pathMap.getOrDefault(SystemType.PARTICULATE.getType(), "Spectrum/Particulates");
|
||||
} else if(systemType.contains(SystemType.WATER.getType())) {
|
||||
path = pathMap.getOrDefault(SystemType.WATER.getType(), "Spectrum/Water");
|
||||
} else if (systemType.contains(SystemType.SELFSTATION.getType())) {
|
||||
path = pathMap.getOrDefault(SystemType.SELFSTATION.getType(), "Spectrum/Xenon/Self");
|
||||
}
|
||||
return path.toString();
|
||||
return path;
|
||||
}
|
||||
|
||||
public String GetDateTypeSubdir(String dataType){
|
||||
|
@ -81,14 +87,15 @@ public class NameStandUtil {
|
|||
|
||||
public Map<String, String> NameStandard(String dataType, String spectrumQuantity, Double acqusitionLiveTime, String sampleFileName, String measurementId) {
|
||||
String suffix = GetSuffix(dataType, spectrumQuantity,String.valueOf(acqusitionLiveTime));
|
||||
Map<String, String> fileNames = NameStandardByName(sampleFileName, measurementId,suffix);
|
||||
return fileNames;
|
||||
return NameStandardByName(sampleFileName, measurementId,suffix);
|
||||
}
|
||||
|
||||
public Map<String, String> NameStandard(PHDFile fileAnlyse) {
|
||||
String suffix = GetSuffix(fileAnlyse.getMsgInfo().getData_type(), fileAnlyse.getHeader().getSpectrum_quantity(),String.valueOf(fileAnlyse.getAcq().getAcquisition_live_time()));
|
||||
Map<String, String> fileNames = NameStandardByName(fileAnlyse.getFilename(), fileAnlyse.getHeader().getMeasurement_id(),suffix);
|
||||
return fileNames;
|
||||
String suffix = GetSuffix(fileAnlyse.getMsgInfo().getData_type(),
|
||||
fileAnlyse.getHeader().getSpectrum_quantity(),
|
||||
String.valueOf(fileAnlyse.getAcq().getAcquisition_live_time()),
|
||||
fileAnlyse.getRoiSuffix());
|
||||
return NameStandardByName(fileAnlyse.getFilename(), fileAnlyse.getHeader().getMeasurement_id(),suffix);
|
||||
}
|
||||
|
||||
public String GetSuffix(String dataType, String Fulltype, String LT) {
|
||||
|
@ -114,6 +121,33 @@ public class NameStandUtil {
|
|||
return rData;
|
||||
}
|
||||
|
||||
public String GetSuffix(String dataType, String Fulltype, String LT, String roiSuffix) {
|
||||
String rData = "";
|
||||
DecimalFormat df = new DecimalFormat("#.##########");
|
||||
//AUX09_003-20151226_1855 _S_FULL_40184.8.PHD
|
||||
//将acquisition_live_time保留六位有效数字 如果保留一位小数后小数点后的值是0则四舍五入保留整数,否则按正常条件四舍五入保留小数位
|
||||
String numberCal = NumberFormatUtil.numberCal(LT);
|
||||
numberCal = df.format(Double.valueOf(numberCal));
|
||||
// 谱类型增加 SPHDF 和 SPHDP
|
||||
if(dataType.contains(DataType.SAMPLEPHD.getType()) ||
|
||||
dataType.contains(DataType.SPHDF.getType()) ||
|
||||
dataType.contains(DataType.SPHDP.getType())) {
|
||||
|
||||
rData = StrUtil.isBlank(roiSuffix) ? "_S_"+Fulltype+"_"+numberCal+".PHD"
|
||||
: "_S_"+Fulltype+"_"+numberCal+roiSuffix+".PHD";
|
||||
} else if(dataType.contains(DataType.GASBKPHD.getType())) {
|
||||
rData = StrUtil.isBlank(roiSuffix) ? "_G_"+Fulltype+"_"+numberCal+".PHD"
|
||||
: "_G_"+Fulltype+"_"+numberCal+roiSuffix+".PHD";
|
||||
} else if(dataType.contains(DataType.DETBKPHD.getType())) {
|
||||
rData = StrUtil.isBlank(roiSuffix) ? "_D_"+Fulltype+"_"+numberCal+".PHD"
|
||||
: "_D_"+Fulltype+"_"+numberCal+roiSuffix+".PHD";
|
||||
} else if(dataType.contains(DataType.QCPHD.getType())) {
|
||||
rData = StrUtil.isBlank(roiSuffix) ? "_Q_"+Fulltype+"_"+numberCal+".PHD"
|
||||
: "_Q_"+Fulltype+"_"+numberCal+roiSuffix+".PHD";
|
||||
}
|
||||
return rData;
|
||||
}
|
||||
|
||||
public Map<String, String> NameStandardByName(String fileName, String dateTimeFormat, String suffix) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
String StandardFileName="";
|
||||
|
|
|
@ -55,15 +55,6 @@ public class NumUtil {
|
|||
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){
|
||||
if (ObjectUtil.isNull(value))
|
||||
return null;
|
||||
|
|
|
@ -61,42 +61,13 @@ public class TemplateUtil {
|
|||
for (String key : keys) {
|
||||
contents.add(ReUtil.getGroup1(StrUtil.format(pattern, key), templateContent));
|
||||
}
|
||||
String join = StrUtil.SPACE+ "#"+StrUtil.SPACE;
|
||||
templateContent = CollUtil.join(contents, join);
|
||||
templateContent = CollUtil.join(contents, "#");
|
||||
String content = FreemarkerParseFactory
|
||||
.parseTemplateContent(templateContent, data, true);
|
||||
messageDTO.setContent(content);
|
||||
String title = FreemarkerParseFactory.parseTemplateContent(templateName,data);
|
||||
messageDTO.setTitle(title);
|
||||
return messageDTO;
|
||||
}
|
||||
|
||||
public static MessageDTO parse1(String code, Map<String, Object> data,Map<String,Object> stationData){
|
||||
MessageDTO messageDTO = new MessageDTO();
|
||||
SysMessageTemplate template = templateService.getOne(code);
|
||||
// 如果没有消息模板
|
||||
if(ObjectUtil.isNull(template))
|
||||
return messageDTO;
|
||||
String templateName = template.getTemplateName();
|
||||
String templateContent = template.getTemplateContent();
|
||||
if (MapUtil.isEmpty(data))
|
||||
return messageDTO;
|
||||
Set<String> keys = data.keySet();
|
||||
String pattern = "\\<([^<>]*{}[^<>]*)\\>";
|
||||
List<String> contents = new ArrayList<>();
|
||||
for (String key : keys) {
|
||||
contents.add(ReUtil.getGroup1(StrUtil.format(pattern, key), templateContent));
|
||||
}
|
||||
String replaceStr=System.lineSeparator();
|
||||
String join = replaceStr+ "#";
|
||||
templateContent = CollUtil.join(contents, join);
|
||||
String content = FreemarkerParseFactory
|
||||
.parseTemplateContent(templateContent, data, true);
|
||||
messageDTO.setContent(content.replace(":",":"+replaceStr+StrUtil.SPACE));
|
||||
String title = FreemarkerParseFactory.parseTemplateContent(templateName,stationData);
|
||||
messageDTO.setTitle(title);
|
||||
return messageDTO;
|
||||
}
|
||||
public static MessageDTO parse(String title, String code, Map<String, Object> data) {
|
||||
MessageDTO messageDTO = new MessageDTO();
|
||||
SysMessageTemplate template = templateService.getOne(code);
|
||||
|
@ -131,8 +102,7 @@ public class TemplateUtil {
|
|||
for (String key : keys) {
|
||||
contents.add(ReUtil.getGroup1(StrUtil.format(pattern, key), templateContent));
|
||||
}
|
||||
String join = StrUtil.SPACE + "#" + StrUtil.SPACE;
|
||||
templateContent = CollUtil.join(contents, join);
|
||||
templateContent = CollUtil.join(contents, "#");
|
||||
String content = FreemarkerParseFactory
|
||||
.parseTemplateContent(templateContent, data, true);
|
||||
messageDTO.setContent(content);
|
||||
|
|
|
@ -164,8 +164,8 @@ public class TokenUtils {
|
|||
String secret = CommonConstant.TEMP_TOKEN_SECRET;
|
||||
// 模拟登录生成Token
|
||||
String token = JwtUtil.sign(username, secret);
|
||||
// 设置Token缓存有效时间为 60 秒
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token, 60);
|
||||
// 设置Token缓存有效时间为 3 分钟
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token, 3 * 60);
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package org.jeecg.modules.base.bizVo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
@Data
|
||||
public class AlertSystemVo extends QueryRequest {
|
||||
|
||||
private String code;
|
||||
|
||||
private String content;
|
||||
}
|
|
@ -27,42 +27,4 @@ public class AlarmAnalysisRuleInfo implements Serializable {
|
|||
private String contactGroup;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String sample;
|
||||
|
||||
private String sampleType;
|
||||
|
||||
private Integer coefficient;
|
||||
|
||||
private List<String> colTime;
|
||||
|
||||
private List<String> acqTime;
|
||||
|
||||
private Double airFlow;
|
||||
|
||||
private Double decayTime;
|
||||
|
||||
private Double sampVol;
|
||||
|
||||
private Double ba140MDC;
|
||||
|
||||
private Double be7FWHM;
|
||||
|
||||
private List<String> xe133MDC;
|
||||
|
||||
private Double xeVol;
|
||||
|
||||
private Integer xe131mFlag;
|
||||
|
||||
private Integer xe133mFlag;
|
||||
|
||||
private Integer xe133Flag;
|
||||
|
||||
private Integer xe135Flag;
|
||||
|
||||
private Integer days;
|
||||
|
||||
private String identifyNuclides;
|
||||
|
||||
private List<String> identifyNuclidesChecked;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,4 @@ public class EmailDto implements Serializable {
|
|||
private String username; // 邮箱用户名
|
||||
|
||||
private Integer isQiye; // 是否企业邮箱
|
||||
|
||||
private Integer emailServerType;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.jeecg.modules.base.enums.SourceType;
|
|||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
@ -49,6 +48,4 @@ public class Info implements Serializable{
|
|||
private String groupId;
|
||||
|
||||
private String conditions;
|
||||
|
||||
private Set<String> identifyNuclideSet;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package org.jeecg.modules.base.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoiDto {
|
||||
|
||||
private Integer roiNum;
|
||||
|
||||
private String phdPath;
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.jeecg.modules.base.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SampNucl {
|
||||
|
||||
private String sampleId;
|
||||
|
||||
private String nuclideName;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
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;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("CONFIGURATION.GARDS_ALERT_SYSTEM")
|
||||
public class GardsAlertSystem implements Serializable {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
private String type;
|
||||
|
||||
private String code;
|
||||
|
||||
private String content;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String typeStr;
|
||||
|
||||
public GardsAlertSystem(){ moddate = new Date(); }
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
@ -23,7 +22,7 @@ public class GardsDetectors implements Serializable {
|
|||
/**
|
||||
* 探测器id
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@TableId(value = "DETECTOR_ID")
|
||||
private Integer detectorId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
@ -20,57 +19,57 @@ import java.util.Date;
|
|||
public class GardsStations implements Serializable {
|
||||
|
||||
/**
|
||||
* 台站id
|
||||
* 台站id
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@TableId("STATION_ID")
|
||||
@NotNull(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private Integer stationId;
|
||||
|
||||
/**
|
||||
* 台站编码
|
||||
* 台站编码
|
||||
*/
|
||||
@TableField(value = "STATION_CODE")
|
||||
@NotBlank(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
* 城市编码
|
||||
*/
|
||||
@TableField(value = "COUNTRY_CODE")
|
||||
private String countryCode;
|
||||
|
||||
/**
|
||||
* 台站类型
|
||||
* 台站类型
|
||||
*/
|
||||
@TableField(value = "TYPE")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
* 经度
|
||||
*/
|
||||
@TableField(value = "LON")
|
||||
private Double lon;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
* 纬度
|
||||
*/
|
||||
@TableField(value = "LAT")
|
||||
private Double lat;
|
||||
|
||||
/**
|
||||
* 海拔
|
||||
* 海拔
|
||||
*/
|
||||
@TableField(value = "ELEVATION")
|
||||
private Double elevation;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* 描述
|
||||
*/
|
||||
@TableField(value = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 开始运行日期
|
||||
* 开始运行日期
|
||||
*/
|
||||
@TableField(value = "DATE_BEGIN")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
|
@ -86,13 +85,13 @@ public class GardsStations implements Serializable {
|
|||
private Date dateEnd;
|
||||
|
||||
/**
|
||||
* 运行状态
|
||||
* 运行状态
|
||||
*/
|
||||
@TableField(value = "STATUS")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
* 操作时间
|
||||
*/
|
||||
@TableField(value = "MODDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -101,9 +100,5 @@ public class GardsStations implements Serializable {
|
|||
|
||||
@TableField(value = "CATEGORY")
|
||||
private Integer category;
|
||||
/**
|
||||
* 有效率计算类型
|
||||
*/
|
||||
@TableField(value = "EFFIC_CALCUL_TYPE")
|
||||
private String efficCalculType;
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class GardsAlertData implements Serializable {
|
|||
@TableField(value = "STATION_CODE")
|
||||
private String stationCode;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "ALERT_ID",type = IdType.AUTO)
|
||||
private Integer alertId;
|
||||
|
||||
@TableField(value = "TIME")
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
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;
|
||||
|
@ -21,7 +19,7 @@ public class GardsGPSData implements Serializable {
|
|||
@TableField(value = "STATION_CODE")
|
||||
private String stationCode;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableField(value = "GPS_ID")
|
||||
private Integer gpsId;
|
||||
|
||||
@TableField(value = "LON")
|
||||
|
|
|
@ -31,7 +31,7 @@ public class GardsMetData implements Serializable {
|
|||
/**
|
||||
* 气象数据id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "MET_ID",type = IdType.AUTO)
|
||||
private Integer metId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -97,4 +97,10 @@ public class GardsSampleAux implements Serializable {
|
|||
*/
|
||||
@TableField(value = "XE_COLLECTION_YIED_UNCER")
|
||||
private Double xeCollectionYiedUncer;
|
||||
|
||||
@TableField("LON")
|
||||
private Double lon;
|
||||
|
||||
@TableField("LAT")
|
||||
private Double lat;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class GardsSampleData implements Serializable {
|
|||
* 样品id
|
||||
*/
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "SAMPLE_ID",type = IdType.AUTO)
|
||||
private Integer sampleId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@ public class GardsSohData implements Serializable {
|
|||
/**
|
||||
* 报警ID号
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "SOH_ID",type = IdType.AUTO)
|
||||
@Excel(name = "SID",orderNum = "5")
|
||||
private Integer sohId;
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
package org.jeecg.modules.base.entity.original;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("ORIGINAL.SAMPLE_WATER_RESULT")
|
||||
public class SampleWaterResult implements Serializable {
|
||||
|
||||
@TableField(value = "SAMPLE_RESULT_ID")
|
||||
private Integer sampleResultId;
|
||||
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "NUCLIDE_NAME")
|
||||
private String nuclideName;
|
||||
|
||||
@TableField(value = "ENERGY")
|
||||
private Double energy;
|
||||
|
||||
@TableField(value = "CSC_RATIO")
|
||||
private Double cscRatio;
|
||||
|
||||
@TableField(value = "HALF_LIFE")
|
||||
private Double halfLife;
|
||||
|
||||
@TableField(value = "MDA")
|
||||
private Double mda;
|
||||
|
||||
@TableField(value = "ACTIVITY")
|
||||
private Double activity;
|
||||
|
||||
@TableField(value = "SPEC_ACTIVITY")
|
||||
private Double specActivity;
|
||||
|
||||
@TableField(value = "NID_FLAG")
|
||||
private Integer nidFlag;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -1,12 +1,21 @@
|
|||
package org.jeecg.modules.base.entity.postgre;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
@Data
|
||||
@TableName("alarm_analysis_rule")
|
||||
|
@ -14,9 +23,6 @@ import java.math.BigDecimal;
|
|||
@Accessors(chain = true)
|
||||
public class AlarmAnalysisRule extends JeecgEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/** 规则名称 */
|
||||
private String name;
|
||||
|
||||
|
@ -41,55 +47,6 @@ public class AlarmAnalysisRule extends JeecgEntity {
|
|||
/** 联系人组id */
|
||||
private String contactGroup;
|
||||
|
||||
private String sample;
|
||||
|
||||
private String sampleType;
|
||||
|
||||
private BigDecimal coefficient;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String colTime;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String acqTime;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Double airFlow;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Double decayTime;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Double sampVol;
|
||||
|
||||
@TableField(value = "ba140_mdc", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Double ba140MDC;
|
||||
|
||||
@TableField(value = "be7_fwhm", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Double be7FWHM;
|
||||
|
||||
@TableField(value = "xe133_mdc", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String xe133MDC;
|
||||
|
||||
@TableField(value = "xe_vol", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Double xeVol;
|
||||
|
||||
@TableField(value = "xe131m_flag", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer xe131mFlag;
|
||||
|
||||
@TableField(value = "xe133m_flag", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer xe133mFlag;
|
||||
|
||||
@TableField(value = "xe133_flag", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer xe133Flag;
|
||||
|
||||
@TableField(value = "xe135_flag", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer xe135Flag;
|
||||
|
||||
private Integer days;
|
||||
|
||||
@TableField(value = "identify_nuclides", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String identifyNuclides;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
@ -94,6 +94,4 @@ public class SysEmail implements Serializable {
|
|||
*/
|
||||
@TableField(value = "update_by")
|
||||
private String updateBy;
|
||||
@TableField(value = "email_server_type")
|
||||
private Integer emailServerType;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_ANALYSIS_ROI")
|
||||
@Accessors(chain = true)
|
||||
public class GardsAnalysisRoi {
|
||||
|
||||
@TableField("IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
private Integer sampleId;
|
||||
|
||||
private Integer roiId;
|
||||
|
||||
private Integer roiNum;
|
||||
|
||||
private Double minX;
|
||||
|
||||
private Double maxX;
|
||||
|
||||
private Double minY;
|
||||
|
||||
private Double maxY;
|
||||
|
||||
private String phdPath;
|
||||
|
||||
private String baselinePath;
|
||||
|
||||
private String lcPath;
|
||||
|
||||
private String scacPath;
|
||||
|
||||
private String logPath;
|
||||
|
||||
private String reportPath;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储数据分析过程中能量、分辨率和效率刻度实际使用的刻度点数据。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_CALIBRATION_PAIRS_ROI")
|
||||
public class GardsCalibrationPairsRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* G:gamma探测器的数据,#g_;B:beta探测器的数据,#b_
|
||||
*/
|
||||
@TableField(value = "SAMPLE_TYPE")
|
||||
private String sampleType;
|
||||
/**
|
||||
* energy:能量刻度;
|
||||
* efficiency:效率刻度;
|
||||
* Resolution:分辨率刻度
|
||||
*/
|
||||
@TableField(value = "CALTYPE")
|
||||
private String caltype;
|
||||
/**
|
||||
* PHD:代表数据来自PHD文件;External:代表数据来自外部,如刻度工具、其它文件等
|
||||
*/
|
||||
@TableField(value = "INPUT")
|
||||
private String input;
|
||||
/**
|
||||
* 刻度点ID号
|
||||
*/
|
||||
@TableField(value = "IDCALPOINT")
|
||||
private Integer idCalPoint;
|
||||
|
||||
@TableField(value = "XVALUE")
|
||||
private Double xValue;
|
||||
|
||||
@TableField(value = "YVALUE")
|
||||
private Double yValue;
|
||||
|
||||
@TableField(value = "DECAY_MODE")
|
||||
private String decayMode;
|
||||
/**
|
||||
* y值不确定度
|
||||
*/
|
||||
@TableField(value = "UNCYVALUE")
|
||||
private Double uncYValue;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储数据分析过程中能量、分辨率和效率刻度的拟合结果。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_CALIBRATION_ROI")
|
||||
public class GardsCalibrationRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* G:gamma探测器的数据,#g_;B:beta探测器的数据,#b_
|
||||
*/
|
||||
@TableField(value = "SAMPLE_TYPE")
|
||||
private String sampleType;
|
||||
/**
|
||||
* energy:能量刻度;
|
||||
* efficiency:效率刻度;
|
||||
* Resolution:分辨率刻度
|
||||
*/
|
||||
@TableField(value = "CALTYPE")
|
||||
private String calType;
|
||||
/**
|
||||
* 拟合方程ID号(统一定义)
|
||||
*/
|
||||
@TableField(value = "FUNCTION")
|
||||
private Integer function;
|
||||
/**
|
||||
* 拟合方程描述
|
||||
*/
|
||||
@TableField(value = "FUNCTIONDEF")
|
||||
private String functionDef;
|
||||
/**
|
||||
* 拟合的起始值
|
||||
*/
|
||||
@TableField(value = "STARTOFRANGE")
|
||||
private Integer startOfRange;
|
||||
/**
|
||||
* 拟合的结束值
|
||||
*/
|
||||
@TableField(value = "ENDOFRANGE")
|
||||
private Integer endOfRange;
|
||||
/**
|
||||
* 拟合系数1
|
||||
*/
|
||||
@TableField(value = "COEFF1")
|
||||
private Double coeff1;
|
||||
/**
|
||||
* 拟合系数2
|
||||
*/
|
||||
@TableField(value = "COEFF2")
|
||||
private Double coeff2;
|
||||
/**
|
||||
* 拟合系数3
|
||||
*/
|
||||
@TableField(value = "COEFF3")
|
||||
private Double coeff3;
|
||||
/**
|
||||
* 拟合系数4
|
||||
*/
|
||||
@TableField(value = "COEFF4")
|
||||
private Double coeff4;
|
||||
/**
|
||||
* 拟合系数5
|
||||
*/
|
||||
@TableField(value = "COEFF5")
|
||||
private Double coeff5;
|
||||
/**
|
||||
* 拟合系数6
|
||||
*/
|
||||
@TableField(value = "COEFF6")
|
||||
private Double coeff6;
|
||||
/**
|
||||
* 拟合系数7
|
||||
*/
|
||||
@TableField(value = "COEFF7")
|
||||
private Double coeff7;
|
||||
/**
|
||||
* 拟合系数8
|
||||
*/
|
||||
@TableField(value = "COEFF8")
|
||||
private Double coeff8;
|
||||
/**
|
||||
* 拟合系数9
|
||||
*/
|
||||
@TableField(value = "COEFF9")
|
||||
private Double coeff9;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(value = "COEFF_STRING")
|
||||
private String coeffString;
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_MDC_ROI")
|
||||
public class GardsMDCRoi implements Serializable {
|
||||
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
@TableField(value = "NUCLIDENAME")
|
||||
private String nuclideName;
|
||||
|
||||
@TableField(value = "ENERGY")
|
||||
private Double energy;
|
||||
|
||||
@TableField(value = "YIELD")
|
||||
private Double yield;
|
||||
|
||||
@TableField(value = "EFFICIENCY")
|
||||
private Double efficiency;
|
||||
|
||||
@TableField(value = "MDC")
|
||||
private String mdc;
|
||||
|
||||
@TableField(value = "MDC_ERR")
|
||||
private String mdcErr;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储gamma谱中识别到的核素计算结果。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_NUCL_IDED_ROI")
|
||||
public class GardsNuclIdedRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* 核素名称
|
||||
*/
|
||||
@TableField(value = "NUCLIDENAME")
|
||||
private String nuclideName;
|
||||
/**
|
||||
* 核素类型
|
||||
*/
|
||||
@TableField(value = "TYPE")
|
||||
private String type;
|
||||
/**
|
||||
* 核素半衰期
|
||||
*/
|
||||
@TableField(value = "HALFLIFE")
|
||||
private String halflife;
|
||||
/**
|
||||
* 平均活度值
|
||||
*/
|
||||
@TableField(value = "AVE_ACTIV")
|
||||
private String aveActiv;
|
||||
/**
|
||||
* 平均活度值不确定度
|
||||
*/
|
||||
@TableField(value = "AVE_ACTIV_ERR")
|
||||
private Double aveActivErr;
|
||||
/**
|
||||
* 主射线活度值
|
||||
*/
|
||||
@TableField(value = "ACTIV_KEY")
|
||||
private Double activKey;
|
||||
/**
|
||||
* 主射线活度值不确定度
|
||||
*/
|
||||
@TableField(value = "ACTIV_KEY_ERR")
|
||||
private Double activKeyErr;
|
||||
/**
|
||||
* 核素的最小可探测活度
|
||||
*/
|
||||
@TableField(value = "MDA")
|
||||
private String mda;
|
||||
/**
|
||||
* 核素的最小可探测活度不确定度
|
||||
*/
|
||||
@TableField(value = "MDA_ERR")
|
||||
private Double mdaErr;
|
||||
/**
|
||||
* 核素识别标志
|
||||
*/
|
||||
@TableField(value = "NID_FLAG")
|
||||
private Integer nidFlag;
|
||||
|
||||
@TableField(value = "ACTIV_DECAY")
|
||||
private Double activDecay;
|
||||
|
||||
@TableField(value = "ACTIV_DECAY_ERR")
|
||||
private Double activDecayErr;
|
||||
/**
|
||||
* 符合相加校正因子(无设为1)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO")
|
||||
private Double cscRatio;
|
||||
/**
|
||||
* 符合相加校正因子不确定度(无设为0)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO_ERR")
|
||||
private Double cscRatioErr;
|
||||
/**
|
||||
* 活度是否经过符合相加校正
|
||||
*/
|
||||
@TableField(value = "CSC_MOD_FLAG")
|
||||
private Integer cscModFlag;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(value = "MDC")
|
||||
private String mdc;
|
||||
|
||||
@TableField(value = "CONCENTRATION")
|
||||
private String concentration;
|
||||
|
||||
@TableField(value = "KEY_ENERGY")
|
||||
private String keyEnergy;
|
||||
|
||||
@TableField(value = "KEY_YIELD")
|
||||
private String keyYield;
|
||||
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储gamma谱中识别到的峰计算结果。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_NUCL_LINES_IDED_ROI")
|
||||
public class GardsNuclLinesIdedRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* 峰序号
|
||||
*/
|
||||
@TableField(value = "IDPEAK")
|
||||
private Integer idPeak;
|
||||
|
||||
/**
|
||||
* 核素名称
|
||||
*/
|
||||
@TableField(value = "NUCLIDENAME")
|
||||
private String nuclideName;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
/**
|
||||
* 核素库中核素对应峰的能量(keV)
|
||||
*/
|
||||
@TableField(value = "ENERGY")
|
||||
private Double energy;
|
||||
/**
|
||||
* 核素库中核素对应峰的能量不确定度(keV)
|
||||
*/
|
||||
@TableField(value = "UNCENERGY")
|
||||
private Double uncEnergy;
|
||||
/**
|
||||
* 核素库中核素对应峰的发射几率
|
||||
*/
|
||||
@TableField(value = "ABUNDANCE")
|
||||
private Double abundance;
|
||||
/**
|
||||
* 核素库中核素对应峰的发射几率不确定度
|
||||
*/
|
||||
@TableField(value = "UNCABUNDANCE")
|
||||
private Double uncAbundance;
|
||||
/**
|
||||
* 利用该峰计算得到的活度
|
||||
*/
|
||||
@TableField(value = "ACTIVITY")
|
||||
private String activity;
|
||||
/**
|
||||
* 利用该峰计算得到的活度不确定度
|
||||
*/
|
||||
@TableField(value = "UNCACTIVITY")
|
||||
private Double uncActivity;
|
||||
/**
|
||||
* 该峰处的探测效率
|
||||
*/
|
||||
@TableField(value = "EFFIC")
|
||||
private Double effic;
|
||||
/**
|
||||
* 该峰处的探测效率不确定度
|
||||
*/
|
||||
@TableField(value = "UNEFFIC")
|
||||
private Double unEffic;
|
||||
/**
|
||||
* 利用该峰计算得到的最小可探测活度
|
||||
*/
|
||||
@TableField(value = "MDA")
|
||||
private Double mda;
|
||||
/**
|
||||
* 主射线标识:0-否;1-是
|
||||
*/
|
||||
@TableField(value = "KEY_FLAG")
|
||||
private Double keyFlag;
|
||||
/**
|
||||
* 符合相加校正因子(无设为1)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO")
|
||||
private Double cscRatio;
|
||||
/**
|
||||
* 符合相加校正因子不确定度(无设为0)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO_ERR")
|
||||
private Double cscRatioErr;
|
||||
/**
|
||||
* 活度是否经过符合相加校正
|
||||
*/
|
||||
@TableField(value = "CSC_MOD_FLAG")
|
||||
private Double cscModFlag;
|
||||
|
||||
@TableField(value = "NUCLIDEFULLNAME")
|
||||
private String nuclidefullname;
|
||||
|
||||
@TableField(value = "MDC")
|
||||
private String mdc;
|
||||
|
||||
@TableField(value = "CONCENTRATION")
|
||||
private String concentration;
|
||||
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储gamma谱的寻峰结果
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_PEAKS_ROI")
|
||||
public class GardsPeaksRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 峰序号
|
||||
*/
|
||||
@TableField(value = "IDPEAK")
|
||||
private Integer idPeak;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
/**
|
||||
* 峰中心道(道址)
|
||||
*/
|
||||
@TableField(value = "CENTROIDCHANNEL")
|
||||
private Double centroidChannel;
|
||||
/**
|
||||
* 峰中心道不确定度(道址)
|
||||
*/
|
||||
@TableField(value = "UNCCENTROIDCHANNEL")
|
||||
private Double uncCentroidChannel;
|
||||
/**
|
||||
* 峰中心道能量(keV)
|
||||
*/
|
||||
@TableField(value = "ENERGY")
|
||||
private Double energy;
|
||||
/**
|
||||
* 峰中心道能量不确定度(keV)
|
||||
*/
|
||||
@TableField(value = "UNCENERGY")
|
||||
private Double uncEnergy;
|
||||
/**
|
||||
* 峰面积(计数)。已扣除基线面积,但未扣除空白样品计数和探测器本底计数
|
||||
*/
|
||||
@TableField(value = "AREA")
|
||||
private Double area;
|
||||
/**
|
||||
* 峰面积不确定度(计数)
|
||||
*/
|
||||
@TableField(value = "UNCAREA")
|
||||
private Double uncArea;
|
||||
/**
|
||||
* 峰的净计数率(1/s)=峰面积/活时间
|
||||
*/
|
||||
@TableField(value = "NETCOUNTRATE")
|
||||
private Double netCountRate;
|
||||
/**
|
||||
* 峰的净计数率的不确定度(1/s)
|
||||
*/
|
||||
@TableField(value = "UNCNETCOUNTRATE")
|
||||
private Double uncNetCountRate;
|
||||
/**
|
||||
* 测量系统在峰能量处的绝对效率
|
||||
*/
|
||||
@TableField(value = "EFFICIENCY")
|
||||
private Double efficiency;
|
||||
/**
|
||||
* 测量系统在峰能量处的绝对效率的不确定度
|
||||
*/
|
||||
@TableField(value = "UNCEFFICIENCY")
|
||||
private Double uncefficiency;
|
||||
/**
|
||||
* 峰的半高宽(道)
|
||||
*/
|
||||
@TableField(value = "FWHM")
|
||||
private Double fwhm;
|
||||
/**
|
||||
* 峰的十分之一高宽(道)
|
||||
*/
|
||||
@TableField(value = "FWTM")
|
||||
private Double fwtm;
|
||||
/**
|
||||
* 峰的重要性因子
|
||||
*/
|
||||
@TableField(value = "SIGNIFICANCE")
|
||||
private Double significance;
|
||||
/**
|
||||
* 峰的可探测线Lc
|
||||
*/
|
||||
@TableField(value = "LC")
|
||||
private Double lc;
|
||||
/**
|
||||
* 峰的感兴趣区的起始道
|
||||
*/
|
||||
@TableField(value = "ROISTART")
|
||||
private Double roiStart;
|
||||
/**
|
||||
* 峰的感兴趣区的结束道
|
||||
*/
|
||||
@TableField(value = "ROIEND")
|
||||
private Double roiEnd;
|
||||
|
||||
@TableField(value = "MULTIINDEX")
|
||||
private Double mulitiIndex;
|
||||
|
||||
@TableField(value = "TAIL")
|
||||
private Double tail;
|
||||
|
||||
@TableField(value = "TAILALPHA")
|
||||
private Double tailAlpha;
|
||||
|
||||
@TableField(value = "UPPERTAIL")
|
||||
private Double upperTail;
|
||||
|
||||
@TableField(value = "UPPERTAILALPHA")
|
||||
private Double upperTailAlpha;
|
||||
|
||||
@TableField(value = "BWWIDTHCHAN")
|
||||
private Double bwwidthchan;
|
||||
|
||||
@TableField(value = "RECOILDELTACHAN")
|
||||
private Double recoildeltachan;
|
||||
|
||||
@TableField(value = "STEPRAIO")
|
||||
private Double stepraio;
|
||||
|
||||
@TableField(value = "LD")
|
||||
private Double ld;
|
||||
|
||||
@TableField(value = "SENSITIVITY")
|
||||
private Double sensitivity;
|
||||
|
||||
@TableField(value = "BACKGROUNDAREA")
|
||||
private Double backgroundarea;
|
||||
|
||||
@TableField(value = "MEANBACKCOUNT")
|
||||
private Double meanbackcount;
|
||||
|
||||
@TableField(value = "RECOILBETACHAN")
|
||||
private Double recoilbetachan;
|
||||
|
||||
@TableField(value = "PEAKCOMMENTS")
|
||||
private String peakcomments;
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName(value = "RNAUTO.GARDS_QC_CHECK_ROI")
|
||||
public class GardsQcCheckRoi implements Serializable {
|
||||
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
@TableField(value = "QC_NAME")
|
||||
private String qcName;
|
||||
|
||||
@TableField(value = "QC_VALUE")
|
||||
private Double qcValue;
|
||||
|
||||
@TableField(value = "QC_STANDARD")
|
||||
private String qcStandard;
|
||||
|
||||
@TableField(value = "QC_RESULT")
|
||||
private Integer qcResult;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName(value = "RNMAN.GARDS_ANALY_SETTING_ROI")
|
||||
public class GardsAnalySettingRoi implements Serializable {
|
||||
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idanalysis;
|
||||
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
private Integer roiId;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(value = "ECUTANALYSIS_LOW")
|
||||
private Double ecutanalysisLow;
|
||||
|
||||
@TableField(value = "ECUTANALYSIS_HIGH")
|
||||
private Double ecutanalysisHigh;
|
||||
|
||||
@TableField(value = "ENERGYTOLERANCE")
|
||||
private Double energytolerance;
|
||||
|
||||
@TableField(value = "CALIBRATIONPSS_HIGH")
|
||||
private Double calibrationpssHigh;
|
||||
|
||||
@TableField(value = "CALIBRATIONPSS_LOW")
|
||||
private Double calibrationpssLow;
|
||||
|
||||
@TableField(value = "BASEIMPROVEPSS")
|
||||
private Double baseimprovepss;
|
||||
|
||||
@TableField(value = "PSS_LOW")
|
||||
private Double pssLow;
|
||||
|
||||
@TableField(value = "K_BACK")
|
||||
private Double KBack;
|
||||
|
||||
@TableField(value = "K_ALPHA")
|
||||
private Double KAlpha;
|
||||
|
||||
@TableField(value = "K_BETA")
|
||||
private Double KBeta;
|
||||
|
||||
@TableField(value = "RISKLEVELK")
|
||||
private Double risklevelk;
|
||||
|
||||
@TableField(value = "BUPDATECAL")
|
||||
private Integer bupdatecal;
|
||||
|
||||
@TableField(value = "KEEPCALPEAKSERCHPEAKS")
|
||||
private Integer keepcalpeakserchpeaks;
|
||||
|
||||
@TableField(value = "REFTIME_ACT")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date reftimeAct;
|
||||
|
||||
@TableField(value = "REFTIME_CONC")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date reftimeConc;
|
||||
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
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;
|
||||
|
@ -22,7 +20,7 @@ public class GardsAnalyses implements Serializable {
|
|||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableId(value = "idanalysis",type = IdType.AUTO)
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
/**
|
||||
* 样品id
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@TableName("RNMAN.GARDS_ANALYSIS_ROI")
|
||||
@Accessors(chain = true)
|
||||
public class GardsAnalysisRoi {
|
||||
|
||||
@TableField("IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
private Integer sampleId;
|
||||
|
||||
private Integer roiId;
|
||||
|
||||
private Integer roiNum;
|
||||
|
||||
private Double minX;
|
||||
|
||||
private Double maxX;
|
||||
|
||||
private Double minY;
|
||||
|
||||
private Double maxY;
|
||||
|
||||
private String phdPath;
|
||||
|
||||
private String baselinePath;
|
||||
|
||||
private String lcPath;
|
||||
|
||||
private String scacPath;
|
||||
|
||||
private String logPath;
|
||||
|
||||
private String reportPath;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储数据分析过程中能量、分辨率和效率刻度实际使用的刻度点数据。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNMAN.GARDS_CALIBRATION_PAIRS_ROI")
|
||||
public class GardsCalibrationPairsRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* G:gamma探测器的数据,#g_;B:beta探测器的数据,#b_
|
||||
*/
|
||||
@TableField(value = "SAMPLE_TYPE")
|
||||
private String sampleType;
|
||||
/**
|
||||
* energy:能量刻度;
|
||||
* efficiency:效率刻度;
|
||||
* Resolution:分辨率刻度
|
||||
*/
|
||||
@TableField(value = "CALTYPE")
|
||||
private String caltype;
|
||||
/**
|
||||
* PHD:代表数据来自PHD文件;External:代表数据来自外部,如刻度工具、其它文件等
|
||||
*/
|
||||
@TableField(value = "INPUT")
|
||||
private String input;
|
||||
/**
|
||||
* 刻度点ID号
|
||||
*/
|
||||
@TableField(value = "IDCALPOINT")
|
||||
private Integer idCalPoint;
|
||||
|
||||
@TableField(value = "XVALUE")
|
||||
private Double xValue;
|
||||
|
||||
@TableField(value = "YVALUE")
|
||||
private Double yValue;
|
||||
|
||||
@TableField(value = "DECAY_MODE")
|
||||
private String decayMode;
|
||||
/**
|
||||
* y值不确定度
|
||||
*/
|
||||
@TableField(value = "UNCYVALUE")
|
||||
private Double uncYValue;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储数据分析过程中能量、分辨率和效率刻度的拟合结果。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNMAN.GARDS_CALIBRATION_ROI")
|
||||
public class GardsCalibrationRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* G:gamma探测器的数据,#g_;B:beta探测器的数据,#b_
|
||||
*/
|
||||
@TableField(value = "SAMPLE_TYPE")
|
||||
private String sampleType;
|
||||
/**
|
||||
* energy:能量刻度;
|
||||
* efficiency:效率刻度;
|
||||
* Resolution:分辨率刻度
|
||||
*/
|
||||
@TableField(value = "CALTYPE")
|
||||
private String calType;
|
||||
/**
|
||||
* 拟合方程ID号(统一定义)
|
||||
*/
|
||||
@TableField(value = "FUNCTION")
|
||||
private Integer function;
|
||||
/**
|
||||
* 拟合方程描述
|
||||
*/
|
||||
@TableField(value = "FUNCTIONDEF")
|
||||
private String functionDef;
|
||||
/**
|
||||
* 拟合的起始值
|
||||
*/
|
||||
@TableField(value = "STARTOFRANGE")
|
||||
private Integer startOfRange;
|
||||
/**
|
||||
* 拟合的结束值
|
||||
*/
|
||||
@TableField(value = "ENDOFRANGE")
|
||||
private Integer endOfRange;
|
||||
/**
|
||||
* 拟合系数1
|
||||
*/
|
||||
@TableField(value = "COEFF1")
|
||||
private Double coeff1;
|
||||
/**
|
||||
* 拟合系数2
|
||||
*/
|
||||
@TableField(value = "COEFF2")
|
||||
private Double coeff2;
|
||||
/**
|
||||
* 拟合系数3
|
||||
*/
|
||||
@TableField(value = "COEFF3")
|
||||
private Double coeff3;
|
||||
/**
|
||||
* 拟合系数4
|
||||
*/
|
||||
@TableField(value = "COEFF4")
|
||||
private Double coeff4;
|
||||
/**
|
||||
* 拟合系数5
|
||||
*/
|
||||
@TableField(value = "COEFF5")
|
||||
private Double coeff5;
|
||||
/**
|
||||
* 拟合系数6
|
||||
*/
|
||||
@TableField(value = "COEFF6")
|
||||
private Double coeff6;
|
||||
/**
|
||||
* 拟合系数7
|
||||
*/
|
||||
@TableField(value = "COEFF7")
|
||||
private Double coeff7;
|
||||
/**
|
||||
* 拟合系数8
|
||||
*/
|
||||
@TableField(value = "COEFF8")
|
||||
private Double coeff8;
|
||||
/**
|
||||
* 拟合系数9
|
||||
*/
|
||||
@TableField(value = "COEFF9")
|
||||
private Double coeff9;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(value = "COEFF_STRING")
|
||||
private String coeffString;
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("RNMAN.GARDS_MDC_ROI")
|
||||
public class GardsMDCRoi implements Serializable {
|
||||
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
@TableField(value = "NUCLIDENAME")
|
||||
private String nuclideName;
|
||||
|
||||
@TableField(value = "ENERGY")
|
||||
private Double energy;
|
||||
|
||||
@TableField(value = "YIELD")
|
||||
private Double yield;
|
||||
|
||||
@TableField(value = "EFFICIENCY")
|
||||
private Double efficiency;
|
||||
|
||||
@TableField(value = "MDC")
|
||||
private String mdc;
|
||||
|
||||
@TableField(value = "MDC_ERR")
|
||||
private String mdcErr;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储gamma谱中识别到的核素计算结果。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNMAN.GARDS_NUCL_IDED_ROI")
|
||||
public class GardsNuclIdedRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* 核素名称
|
||||
*/
|
||||
@TableField(value = "NUCLIDENAME")
|
||||
private String nuclideName;
|
||||
/**
|
||||
* 核素类型
|
||||
*/
|
||||
@TableField(value = "TYPE")
|
||||
private String type;
|
||||
/**
|
||||
* 核素半衰期
|
||||
*/
|
||||
@TableField(value = "HALFLIFE")
|
||||
private String halflife;
|
||||
/**
|
||||
* 平均活度值
|
||||
*/
|
||||
@TableField(value = "AVE_ACTIV")
|
||||
private String aveActiv;
|
||||
/**
|
||||
* 平均活度值不确定度
|
||||
*/
|
||||
@TableField(value = "AVE_ACTIV_ERR")
|
||||
private Double aveActivErr;
|
||||
/**
|
||||
* 主射线活度值
|
||||
*/
|
||||
@TableField(value = "ACTIV_KEY")
|
||||
private Double activKey;
|
||||
/**
|
||||
* 主射线活度值不确定度
|
||||
*/
|
||||
@TableField(value = "ACTIV_KEY_ERR")
|
||||
private Double activKeyErr;
|
||||
/**
|
||||
* 核素的最小可探测活度
|
||||
*/
|
||||
@TableField(value = "MDA")
|
||||
private String mda;
|
||||
/**
|
||||
* 核素的最小可探测活度不确定度
|
||||
*/
|
||||
@TableField(value = "MDA_ERR")
|
||||
private Double mdaErr;
|
||||
/**
|
||||
* 核素识别标志
|
||||
*/
|
||||
@TableField(value = "NID_FLAG")
|
||||
private Integer nidFlag;
|
||||
|
||||
@TableField(value = "ACTIV_DECAY")
|
||||
private Double activDecay;
|
||||
|
||||
@TableField(value = "ACTIV_DECAY_ERR")
|
||||
private Double activDecayErr;
|
||||
/**
|
||||
* 符合相加校正因子(无设为1)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO")
|
||||
private Double cscRatio;
|
||||
/**
|
||||
* 符合相加校正因子不确定度(无设为0)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO_ERR")
|
||||
private Double cscRatioErr;
|
||||
/**
|
||||
* 活度是否经过符合相加校正
|
||||
*/
|
||||
@TableField(value = "CSC_MOD_FLAG")
|
||||
private Integer cscModFlag;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(value = "MDC")
|
||||
private String mdc;
|
||||
|
||||
@TableField(value = "CONCENTRATION")
|
||||
private String concentration;
|
||||
|
||||
@TableField(value = "KEY_ENERGY")
|
||||
private String keyEnergy;
|
||||
|
||||
@TableField(value = "KEY_YIELD")
|
||||
private String keyYield;
|
||||
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储gamma谱中识别到的峰计算结果。
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNMAN.GARDS_NUCL_LINES_IDED_ROI")
|
||||
public class GardsNuclLinesIdedRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* 峰序号
|
||||
*/
|
||||
@TableField(value = "IDPEAK")
|
||||
private Integer idPeak;
|
||||
|
||||
/**
|
||||
* 核素名称
|
||||
*/
|
||||
@TableField(value = "NUCLIDENAME")
|
||||
private String nuclideName;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
/**
|
||||
* 核素库中核素对应峰的能量(keV)
|
||||
*/
|
||||
@TableField(value = "ENERGY")
|
||||
private Double energy;
|
||||
/**
|
||||
* 核素库中核素对应峰的能量不确定度(keV)
|
||||
*/
|
||||
@TableField(value = "UNCENERGY")
|
||||
private Double uncEnergy;
|
||||
/**
|
||||
* 核素库中核素对应峰的发射几率
|
||||
*/
|
||||
@TableField(value = "ABUNDANCE")
|
||||
private Double abundance;
|
||||
/**
|
||||
* 核素库中核素对应峰的发射几率不确定度
|
||||
*/
|
||||
@TableField(value = "UNCABUNDANCE")
|
||||
private Double uncAbundance;
|
||||
/**
|
||||
* 利用该峰计算得到的活度
|
||||
*/
|
||||
@TableField(value = "ACTIVITY")
|
||||
private String activity;
|
||||
/**
|
||||
* 利用该峰计算得到的活度不确定度
|
||||
*/
|
||||
@TableField(value = "UNCACTIVITY")
|
||||
private Double uncActivity;
|
||||
/**
|
||||
* 该峰处的探测效率
|
||||
*/
|
||||
@TableField(value = "EFFIC")
|
||||
private Double effic;
|
||||
/**
|
||||
* 该峰处的探测效率不确定度
|
||||
*/
|
||||
@TableField(value = "UNEFFIC")
|
||||
private Double unEffic;
|
||||
/**
|
||||
* 利用该峰计算得到的最小可探测活度
|
||||
*/
|
||||
@TableField(value = "MDA")
|
||||
private Double mda;
|
||||
/**
|
||||
* 主射线标识:0-否;1-是
|
||||
*/
|
||||
@TableField(value = "KEY_FLAG")
|
||||
private Double keyFlag;
|
||||
/**
|
||||
* 符合相加校正因子(无设为1)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO")
|
||||
private Double cscRatio;
|
||||
/**
|
||||
* 符合相加校正因子不确定度(无设为0)
|
||||
*/
|
||||
@TableField(value = "CSC_RATIO_ERR")
|
||||
private Double cscRatioErr;
|
||||
/**
|
||||
* 活度是否经过符合相加校正
|
||||
*/
|
||||
@TableField(value = "CSC_MOD_FLAG")
|
||||
private Double cscModFlag;
|
||||
|
||||
@TableField(value = "NUCLIDEFULLNAME")
|
||||
private String nuclidefullname;
|
||||
|
||||
@TableField(value = "MDC")
|
||||
private String mdc;
|
||||
|
||||
@TableField(value = "CONCENTRATION")
|
||||
private String concentration;
|
||||
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 存储gamma谱的寻峰结果
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNMAN.GARDS_PEAKS_ROI")
|
||||
public class GardsPeaksRoi implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 峰序号
|
||||
*/
|
||||
@TableField(value = "IDPEAK")
|
||||
private Integer idPeak;
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
/**
|
||||
* 峰中心道(道址)
|
||||
*/
|
||||
@TableField(value = "CENTROIDCHANNEL")
|
||||
private Double centroidChannel;
|
||||
/**
|
||||
* 峰中心道不确定度(道址)
|
||||
*/
|
||||
@TableField(value = "UNCCENTROIDCHANNEL")
|
||||
private Double uncCentroidChannel;
|
||||
/**
|
||||
* 峰中心道能量(keV)
|
||||
*/
|
||||
@TableField(value = "ENERGY")
|
||||
private Double energy;
|
||||
/**
|
||||
* 峰中心道能量不确定度(keV)
|
||||
*/
|
||||
@TableField(value = "UNCENERGY")
|
||||
private Double uncEnergy;
|
||||
/**
|
||||
* 峰面积(计数)。已扣除基线面积,但未扣除空白样品计数和探测器本底计数
|
||||
*/
|
||||
@TableField(value = "AREA")
|
||||
private Double area;
|
||||
/**
|
||||
* 峰面积不确定度(计数)
|
||||
*/
|
||||
@TableField(value = "UNCAREA")
|
||||
private Double uncArea;
|
||||
/**
|
||||
* 峰的净计数率(1/s)=峰面积/活时间
|
||||
*/
|
||||
@TableField(value = "NETCOUNTRATE")
|
||||
private Double netCountRate;
|
||||
/**
|
||||
* 峰的净计数率的不确定度(1/s)
|
||||
*/
|
||||
@TableField(value = "UNCNETCOUNTRATE")
|
||||
private Double uncNetCountRate;
|
||||
/**
|
||||
* 测量系统在峰能量处的绝对效率
|
||||
*/
|
||||
@TableField(value = "EFFICIENCY")
|
||||
private Double efficiency;
|
||||
/**
|
||||
* 测量系统在峰能量处的绝对效率的不确定度
|
||||
*/
|
||||
@TableField(value = "UNCEFFICIENCY")
|
||||
private Double uncefficiency;
|
||||
/**
|
||||
* 峰的半高宽(道)
|
||||
*/
|
||||
@TableField(value = "FWHM")
|
||||
private Double fwhm;
|
||||
/**
|
||||
* 峰的十分之一高宽(道)
|
||||
*/
|
||||
@TableField(value = "FWTM")
|
||||
private Double fwtm;
|
||||
/**
|
||||
* 峰的重要性因子
|
||||
*/
|
||||
@TableField(value = "SIGNIFICANCE")
|
||||
private Double significance;
|
||||
/**
|
||||
* 峰的可探测线Lc
|
||||
*/
|
||||
@TableField(value = "LC")
|
||||
private Double lc;
|
||||
/**
|
||||
* 峰的感兴趣区的起始道
|
||||
*/
|
||||
@TableField(value = "ROISTART")
|
||||
private Double roiStart;
|
||||
/**
|
||||
* 峰的感兴趣区的结束道
|
||||
*/
|
||||
@TableField(value = "ROIEND")
|
||||
private Double roiEnd;
|
||||
|
||||
@TableField(value = "MULTIINDEX")
|
||||
private Double mulitiIndex;
|
||||
|
||||
@TableField(value = "TAIL")
|
||||
private Double tail;
|
||||
|
||||
@TableField(value = "TAILALPHA")
|
||||
private Double tailAlpha;
|
||||
|
||||
@TableField(value = "UPPERTAIL")
|
||||
private Double upperTail;
|
||||
|
||||
@TableField(value = "UPPERTAILALPHA")
|
||||
private Double upperTailAlpha;
|
||||
|
||||
@TableField(value = "BWWIDTHCHAN")
|
||||
private Double bwwidthchan;
|
||||
|
||||
@TableField(value = "RECOILDELTACHAN")
|
||||
private Double recoildeltachan;
|
||||
|
||||
@TableField(value = "STEPRAIO")
|
||||
private Double stepraio;
|
||||
|
||||
@TableField(value = "LD")
|
||||
private Double ld;
|
||||
|
||||
@TableField(value = "SENSITIVITY")
|
||||
private Double sensitivity;
|
||||
|
||||
@TableField(value = "BACKGROUNDAREA")
|
||||
private Double backgroundarea;
|
||||
|
||||
@TableField(value = "MEANBACKCOUNT")
|
||||
private Double meanbackcount;
|
||||
|
||||
@TableField(value = "RECOILBETACHAN")
|
||||
private Double recoilbetachan;
|
||||
|
||||
@TableField(value = "PEAKCOMMENTS")
|
||||
private String peakcomments;
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.jeecg.modules.base.entity.rnman;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName(value = "RNMAN.GARDS_QC_CHECK_ROI")
|
||||
public class GardsQcCheckRoi implements Serializable {
|
||||
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "IDANALYSIS")
|
||||
private Integer idAnalysis;
|
||||
|
||||
@TableField(value = "ROI_ID")
|
||||
private Integer roiId;
|
||||
|
||||
@TableField(value = "QC_NAME")
|
||||
private String qcName;
|
||||
|
||||
@TableField(value = "QC_VALUE")
|
||||
private Double qcValue;
|
||||
|
||||
@TableField(value = "QC_STANDARD")
|
||||
private String qcStandard;
|
||||
|
||||
@TableField(value = "QC_RESULT")
|
||||
private Integer qcResult;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -7,22 +7,7 @@ import lombok.Getter;
|
|||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum Condition {
|
||||
/**
|
||||
* 首次发现核素
|
||||
*/
|
||||
FIRST_FOUND("1"),
|
||||
/**
|
||||
* 核素conc超过平均值
|
||||
*/
|
||||
ABOVE_AVERAGE("2"),
|
||||
/**
|
||||
* 同时识别到多个核素
|
||||
*/
|
||||
MEANWHILE("3"),
|
||||
/**
|
||||
* 识别到某个核素
|
||||
*/
|
||||
IDENTIFY_NUCLIDES("4");
|
||||
FIRST_FOUND("1"), ABOVE_AVERAGE("2"), MEANWHILE("3");
|
||||
|
||||
private final String value;
|
||||
|
||||
|
|
|
@ -50,7 +50,11 @@ public enum DataType {
|
|||
*/
|
||||
GASBKPHD("GASBKPHD",".PHD"),
|
||||
SPHDP("SPHDP", ".PHD"),
|
||||
SPHDF("SPHDF", ".PHD");
|
||||
SPHDF("SPHDF", ".PHD"),
|
||||
|
||||
GPS("RMSGPS", ".gps"),
|
||||
|
||||
RESULT("HRULT", ".result");
|
||||
|
||||
private String type;
|
||||
|
||||
|
|
|
@ -7,13 +7,12 @@ import lombok.Getter;
|
|||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum Item {
|
||||
EMAIL_CONN("1", "Email Connection Status"),
|
||||
TABLESPACE_USAGE("2", "TableSpace Usage"),
|
||||
EMAIL_UNPROCESSED("3", "Email Unprocessed");
|
||||
EMAIL_CONN("1", "Connection Status"),
|
||||
TABLESPACE_USAGE("2", "TableSpace Usage");
|
||||
|
||||
private final String value;
|
||||
private String value;
|
||||
|
||||
private final String name;
|
||||
private String name;
|
||||
|
||||
public static Item of(String value){
|
||||
for (Item item : Item.values()) {
|
||||
|
|
|
@ -4,10 +4,30 @@ import org.apache.commons.lang3.StringUtils;
|
|||
|
||||
public enum SampleFileHeader {
|
||||
|
||||
HEADER(0,"#Header"),COMMENT(1,"#Comment"),COLLECTION(2,"#Collection"),ACQUISITION(3,"#Acquisition"),PROCESSING(4,"#Processing"),SAMPLE(5,"#Sample"),
|
||||
GENERGY(6,"#g_Energy"),BENERGY(7,"#b_Energy"),GRESOLUTION(8,"#g_Resolution"),BRESOLUTION(9,"#b_Resolution"),GEFFICIENCY(10,"#g_Efficiency"),
|
||||
ROILIMITS(11,"#ROI_Limits"),BGEFFICIENCY(12,"#b-gEfficiency"),TOTALEFF(13,"#TotalEff"),RATIOS(14,"#Ratios"),GSPECTRUM(15,"#g_Spectrum"),BSPECTRUM(16,"#b_Spectrum"),
|
||||
HISTOGRAM(17,"#Histogram"),CALIBRATION(18,"#Calibration"),CERTIFICATE(19,"#Certificate"),STOP(20,"STOP"),BEGIN(21,"BEGIN"),SPECTRUM(22,"#Spectrum");
|
||||
HEADER(0,"#Header"),
|
||||
COMMENT(1,"#Comment"),
|
||||
COLLECTION(2,"#Collection"),
|
||||
ACQUISITION(3,"#Acquisition"),
|
||||
PROCESSING(4,"#Processing"),
|
||||
SAMPLE(5,"#Sample"),
|
||||
GENERGY(6,"#g_Energy"),
|
||||
BENERGY(7,"#b_Energy"),
|
||||
GRESOLUTION(8,"#g_Resolution"),
|
||||
BRESOLUTION(9,"#b_Resolution"),
|
||||
GEFFICIENCY(10,"#g_Efficiency"),
|
||||
BEFFICIENCY(23,"#b_Efficiency"), // 20240801 自建台站增加
|
||||
ROILIMITS(11,"#ROI_Limits"),
|
||||
BGEFFICIENCY(12,"#b-gEfficiency"),
|
||||
TOTALEFF(13,"#TotalEff"),
|
||||
RATIOS(14,"#Ratios"),
|
||||
GSPECTRUM(15,"#g_Spectrum"),
|
||||
BSPECTRUM(16,"#b_Spectrum"),
|
||||
HISTOGRAM(17,"#Histogram"),
|
||||
CALIBRATION(18,"#Calibration"),
|
||||
CERTIFICATE(19,"#Certificate"),
|
||||
STOP(20,"STOP"),
|
||||
BEGIN(21,"BEGIN"),
|
||||
SPECTRUM(22,"#Spectrum");
|
||||
|
||||
private Integer code;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.jeecg.modules.base.enums;
|
|||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
|
@ -10,19 +9,22 @@ import lombok.Getter;
|
|||
* @author nieziyan
|
||||
* @date 2023-06-30
|
||||
*/
|
||||
@Getter
|
||||
public enum SourceType {
|
||||
|
||||
EMAIL("Email"),
|
||||
DATABASE("Database"),
|
||||
SERVER("Server");
|
||||
|
||||
private final String type;
|
||||
private String type;
|
||||
|
||||
SourceType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static SourceType typeOf(String type){
|
||||
for (SourceType sourceType : SourceType.values()) {
|
||||
if (StrUtil.equals(sourceType.getType(),type))
|
||||
|
|
|
@ -13,7 +13,15 @@ public enum SystemType {
|
|||
/**
|
||||
* γ
|
||||
*/
|
||||
GAMMA("G");
|
||||
GAMMA("G"),
|
||||
/**
|
||||
* 自建台站 β-γ
|
||||
*/
|
||||
SELFSTATION("C"),
|
||||
/**
|
||||
* 海水系统 γ
|
||||
*/
|
||||
WATER("W");
|
||||
|
||||
private String type;
|
||||
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package org.jeecg.modules.entity.vo;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.util.NumUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
|
@ -17,6 +13,8 @@ public class CalMDCInfo implements Serializable {
|
|||
*/
|
||||
private String nuclideName;
|
||||
|
||||
private Integer roiId;
|
||||
|
||||
/**
|
||||
* 核素能量
|
||||
*/
|
||||
|
@ -52,39 +50,4 @@ public class CalMDCInfo implements Serializable {
|
|||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,6 @@ public class CommentData implements Serializable {
|
|||
|
||||
private String analyst;
|
||||
|
||||
private String comment;
|
||||
private String comments;
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,10 @@ package org.jeecg.modules.entity.vo;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class GStoreMiddleProcessData implements Serializable {
|
||||
|
@ -228,8 +231,6 @@ public class GStoreMiddleProcessData implements Serializable {
|
|||
//SpecSetup
|
||||
public SpecSetup setting_specSetup;
|
||||
|
||||
public List<CalMDCInfo> mdcInfos;
|
||||
|
||||
public GStoreMiddleProcessData(){
|
||||
dbWriteFlag = false;
|
||||
dbWriteStatusFlag = "";
|
||||
|
@ -418,7 +419,6 @@ public class GStoreMiddleProcessData implements Serializable {
|
|||
Collection_Station_Comments = "";
|
||||
NDC_Analysis_General_Comments = "";
|
||||
setting_specSetup = new SpecSetup();
|
||||
mdcInfos = new ArrayList<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -181,6 +181,8 @@ public class PHDFile implements Serializable {
|
|||
|
||||
private Map<String, NuclideLines> phdNuclideMap;
|
||||
|
||||
private String roiSuffix;
|
||||
|
||||
public PHDFile() {
|
||||
userId = "";
|
||||
xmlFilePath = "";
|
||||
|
|
|
@ -2,10 +2,8 @@ package org.jeecg.modules.entity.vo;
|
|||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PeakInfo implements Serializable {
|
||||
|
||||
|
@ -63,17 +61,11 @@ public class PeakInfo implements Serializable {
|
|||
|
||||
public List<String> nuclides;
|
||||
|
||||
/**
|
||||
* 记录peak中被删除的核素(interactiveTool)
|
||||
*/
|
||||
public Map<Double, List<String>> deletedNuclideMap;
|
||||
|
||||
public PeakInfo(){
|
||||
nuclides = new LinkedList<>();
|
||||
comments = "";
|
||||
recoilBetaChan = "nan";
|
||||
recoilDeltaChan = "nan";
|
||||
deletedNuclideMap = new HashMap<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package org.jeecg.modules.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ResultNuclide implements Serializable {
|
||||
|
||||
private String nuclideName;
|
||||
|
||||
private Double energy;
|
||||
|
||||
private Double cscRatio;
|
||||
|
||||
private String halfLife;
|
||||
|
||||
private Double mda;
|
||||
|
||||
private Double activity;
|
||||
|
||||
private Double specActivity;
|
||||
|
||||
private String nidFlag;
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.modules.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.modules.base.dto.NuclideInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Data
|
||||
public class SelfParameter implements Serializable {
|
||||
// 存储核素信息
|
||||
private HashMap<String, NuclideLine> nuclideMap;
|
||||
|
||||
public SelfParameter(){
|
||||
nuclideMap = new HashMap<>();
|
||||
}
|
||||
}
|
|
@ -10,5 +10,4 @@ public class SeriseData implements Serializable {
|
|||
private double x;
|
||||
|
||||
private double y;
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
|
@ -64,13 +63,8 @@ public class SysEmailLogController {
|
|||
@GetMapping("analysis")
|
||||
@ApiOperation("根据日期统计-折线图")
|
||||
public Result<?> analysis(@RequestParam("emailId") String emailId,
|
||||
@RequestParam("startDate") String startDate,
|
||||
@RequestParam("endDate") String endDate){
|
||||
@RequestParam("startDate") String startDate,
|
||||
@RequestParam("endDate") String endDate){
|
||||
return sysEmailLogService.analysis(emailId, startDate, endDate);
|
||||
}
|
||||
|
||||
@GetMapping("getMinus")
|
||||
public Integer getMinus(@RequestParam("emailId") String emailId){
|
||||
return sysEmailLogService.getMinus(emailId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,5 @@ public interface SystemClient {
|
|||
@PostMapping("/sys/appMessage/pushMessageToSingle")
|
||||
void pushMessageToSingle(@RequestBody MessageDTO messageDTO, @RequestParam String groupId);
|
||||
|
||||
/* GardsSampleDataController下相关接口 */
|
||||
@GetMapping("/gardsSampleData/getDetectorId")
|
||||
String getDetectorId(@RequestParam String sampleId);
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ public class NucliedAvgJob implements Job{
|
|||
|
||||
@Override
|
||||
@Scheduled(cron = "${task.period-avg:0 2 0 * * ?}")
|
||||
// @Scheduled(cron = "${task.period-avg:0/59 0/1 * * * ? }")
|
||||
public void execute() {
|
||||
calculateConcService.calcAndSave();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsNuclIded;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -16,5 +15,5 @@ public interface GardsNuclIdedAutoMapper extends BaseMapper<GardsNuclIded> {
|
|||
|
||||
List<ConcDto> getConc(Map<String,Object> param);
|
||||
|
||||
List<SampNucl> sampNucl(String stationId, String detectorId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.jeecg.modules.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsNuclIded;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -13,7 +12,7 @@ import java.util.Set;
|
|||
@Mapper
|
||||
public interface GardsNuclIdedManMapper extends BaseMapper<GardsNuclIded> {
|
||||
|
||||
List<ConcDto> getConc(Map<String, Object> param);
|
||||
List<ConcDto> getConc(Map<String,Object> param);
|
||||
|
||||
List<SampNucl> sampNucl(String stationId, String detectorId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -16,5 +15,5 @@ public interface GardsXeResultsAutoMapper extends BaseMapper<GardsXeResults> {
|
|||
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
||||
|
||||
List<SampNucl> sampNucl(String stationId, String detectorId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -16,5 +15,5 @@ public interface GardsXeResultsManMapper extends BaseMapper<GardsXeResults> {
|
|||
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
||||
|
||||
List<SampNucl> sampNucl(String stationId, String detectorId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<mapper namespace="org.jeecg.modules.mapper.GardsNuclIdedAutoMapper">
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDto">
|
||||
SELECT
|
||||
DISTINCT samp.SAMPLE_ID,
|
||||
nucl.NUCLIDENAME,
|
||||
nucl.CONCENTRATION AS CONC,
|
||||
ana.ANALYSISBEGIN
|
||||
|
@ -11,65 +10,31 @@
|
|||
RNAUTO.GARDS_NUCL_IDED nucl
|
||||
INNER JOIN RNAUTO.GARDS_ANALYSES ana ON ana.IDANALYSIS = nucl.IDANALYSIS
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_DATA samp ON samp.SAMPLE_ID = nucl.SAMPLE_ID
|
||||
INNER JOIN RNAUTO.GARDS_QC_CHECK qc ON samp.SAMPLE_ID = qc.SAMPLE_ID
|
||||
<trim prefix="where" suffixOverrides="or">
|
||||
<where>
|
||||
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND samp.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
|
||||
AND samp.STATION_ID = #{stationId}
|
||||
AND samp.SPECTRAL_QUALIFIE = 'FULL'
|
||||
<if test="nuclideName != null and nuclideName.size() > 0">
|
||||
AND nucl.NUCLIDENAME IN
|
||||
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="(colTime != null and colTime.size() > 0) || (acqTime != null and acqTime.size() > 0) ||
|
||||
airFlow != null || decayTime != null || sampVol != null || be7FWHM != null || ba140MDC != null || xe133MDC != null">
|
||||
<trim prefix="and(" suffixOverrides="or" suffix=")">
|
||||
<if test="colTime != null and colTime.size() > 0">
|
||||
(qc.qc_name = 'col_time' and qc.qc_value between #{colTime[0]} and #{colTime[1]} ) or
|
||||
</if>
|
||||
<if test="acqTime != null and acqTime.size() > 0">
|
||||
(qc.qc_name = 'acq_time' and qc.qc_value = #{acqTime[0]}) or
|
||||
</if>
|
||||
<if test="airFlow != null">
|
||||
(qc.qc_name = 'airFlow' and qc.qc_value < #{airFlow} ) or
|
||||
</if>
|
||||
<if test="decayTime != null">
|
||||
(qc.qc_name = 'decay_time' and qc.qc_value < #{decayTime} ) or
|
||||
</if>
|
||||
<if test="sampVol != null">
|
||||
(qc.qc_name = 'samp_vol' and qc.qc_value < #{sampVol} ) or
|
||||
</if>
|
||||
<if test="be7FWHM != null">
|
||||
(qc.qc_name = 'Be7-FWHM' and qc.qc_value < #{be7FWHM} ) or
|
||||
</if>
|
||||
<if test="ba140MDC != null">
|
||||
(qc.qc_name = 'Ba140-MDC' and qc.qc_value < #{ba140MDC} ) or
|
||||
</if>
|
||||
<if test="xe133MDC != null">
|
||||
(qc.qc_name = 'Xe133-MDC' and qc.qc_value < #{xe133MDC} ) or
|
||||
</if>
|
||||
</trim>
|
||||
</if>
|
||||
|
||||
</trim>
|
||||
</where>
|
||||
</select>
|
||||
<select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl">
|
||||
|
||||
<select id="nuclideNames" resultType="java.lang.String">
|
||||
SELECT
|
||||
n.SAMPLE_ID,
|
||||
n.NUCLIDENAME AS nuclideName
|
||||
NUCLIDENAME
|
||||
FROM
|
||||
ORIGINAL.GARDS_SAMPLE_DATA s
|
||||
INNER JOIN RNAUTO.GARDS_NUCL_IDED n ON s.SAMPLE_ID = n.SAMPLE_ID
|
||||
WHERE s.STATION_ID = #{stationId} AND s.DETECTOR_ID = #{detectorId}
|
||||
<if test="nuclideNames != null and nuclideNames.size() > 0">
|
||||
AND n.NUCLIDENAME IN
|
||||
<foreach collection="nuclideNames" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
RNAUTO.GARDS_NUCL_IDED
|
||||
WHERE
|
||||
NUCLIDENAME IN
|
||||
<foreach collection="nuclideNames" separator="," item="nuclideName" index="index" open="(" close=")">
|
||||
#{nuclideName}
|
||||
</foreach>
|
||||
</if>
|
||||
AND n.CONCENTRATION > n.MDC
|
||||
GROUP BY
|
||||
NUCLIDENAME
|
||||
</select>
|
||||
</mapper>
|
|
@ -3,72 +3,38 @@
|
|||
<mapper namespace="org.jeecg.modules.mapper.GardsNuclIdedManMapper">
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDto">
|
||||
SELECT
|
||||
DISTINCT samp.SAMPLE_ID,
|
||||
nucl.NUCLIDENAME,
|
||||
nucl.CONCENTRATION AS CONC,
|
||||
ana.ANALYSISBEGIN
|
||||
FROM
|
||||
RNMAN.GARDS_NUCL_IDED nucl
|
||||
RNMAN.GARDS_NUCL_IDED nucl
|
||||
INNER JOIN RNMAN.GARDS_ANALYSES ana ON ana.IDANALYSIS = nucl.IDANALYSIS
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_DATA samp ON samp.SAMPLE_ID = nucl.SAMPLE_ID
|
||||
INNER JOIN RNMAN.GARDS_QC_CHECK qc ON samp.SAMPLE_ID = qc.SAMPLE_ID
|
||||
<where>
|
||||
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND samp.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
|
||||
AND samp.STATION_ID = #{stationId}
|
||||
AND samp.SPECTRAL_QUALIFIE = 'FULL'
|
||||
<if test="nuclideName != null and nuclideName.size() > 0">
|
||||
AND nucl.NUCLIDENAME IN
|
||||
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="(colTime != null and colTime.size() > 0) || (acqTime != null and acqTime.size() > 0) ||
|
||||
airFlow != null || decayTime != null || sampVol != null || be7FWHM != null || ba140MDC != null || xe133MDC != null">
|
||||
<trim prefix="and(" suffixOverrides="or" suffix=")">
|
||||
<if test="colTime != null and colTime.size() > 0">
|
||||
(qc.qc_name = 'col_time' and qc.qc_value between #{colTime[0]} and #{colTime[1]} ) or
|
||||
</if>
|
||||
<if test="acqTime != null and acqTime.size() > 0">
|
||||
(qc.qc_name = 'acq_time' and qc.qc_value = #{acqTime[0]}) or
|
||||
</if>
|
||||
<if test="airFlow != null">
|
||||
(qc.qc_name = 'airFlow' and qc.qc_value < #{airFlow} ) or
|
||||
</if>
|
||||
<if test="decayTime != null">
|
||||
(qc.qc_name = 'decay_time' and qc.qc_value < #{decayTime} ) or
|
||||
</if>
|
||||
<if test="sampVol != null">
|
||||
(qc.qc_name = 'samp_vol' and qc.qc_value < #{sampVol} ) or
|
||||
</if>
|
||||
<if test="be7FWHM != null">
|
||||
(qc.qc_name = 'Be7-FWHM' and qc.qc_value < #{be7FWHM} ) or
|
||||
</if>
|
||||
<if test="ba140MDC != null">
|
||||
(qc.qc_name = 'Ba140-MDC' and qc.qc_value < #{ba140MDC} ) or
|
||||
</if>
|
||||
<if test="xe133MDC != null">
|
||||
(qc.qc_name = 'Xe133-MDC' and qc.qc_value < #{xe133MDC} ) or
|
||||
</if>
|
||||
</trim>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl">
|
||||
|
||||
<select id="nuclideNames" resultType="java.lang.String">
|
||||
SELECT
|
||||
n.SAMPLE_ID,
|
||||
n.NUCLIDENAME AS nuclideName
|
||||
NUCLIDENAME
|
||||
FROM
|
||||
ORIGINAL.GARDS_SAMPLE_DATA s
|
||||
INNER JOIN RNMAN.GARDS_NUCL_IDED n ON s.SAMPLE_ID = n.SAMPLE_ID
|
||||
WHERE s.STATION_ID = #{stationId} AND s.DETECTOR_ID = #{detectorId}
|
||||
<if test="nuclideNames != null and nuclideNames.size() > 0">
|
||||
AND n.NUCLIDENAME IN
|
||||
<foreach collection="nuclideNames" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
RNMAN.GARDS_NUCL_IDED
|
||||
WHERE
|
||||
NUCLIDENAME IN
|
||||
<foreach collection="nuclideNames" separator="," item="nuclideName" index="index" open="(" close=")">
|
||||
#{nuclideName}
|
||||
</foreach>
|
||||
</if>
|
||||
AND n.CONCENTRATION > n.MDC
|
||||
GROUP BY
|
||||
NUCLIDENAME
|
||||
</select>
|
||||
</mapper>
|
|
@ -2,93 +2,39 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.mapper.GardsXeResultsAutoMapper">
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe">
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
samp.SAMPLE_ID,
|
||||
SELECT
|
||||
xe.NUCLIDE_NAME,
|
||||
xe.CONC,
|
||||
ana.ANALYSISBEGIN,
|
||||
xe.NID_FLAG
|
||||
FROM
|
||||
RNAUTO.GARDS_XE_RESULTS xe
|
||||
INNER JOIN RNAUTO.GARDS_ANALYSES ana ON ana.IDANALYSIS = xe.IDANALYSIS
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_DATA samp ON samp.SAMPLE_ID = xe.SAMPLE_ID
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_AUX aux ON samp.SAMPLE_ID = aux.SAMPLE_ID
|
||||
<where>
|
||||
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND samp.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
|
||||
AND samp.STATION_ID = #{stationId}
|
||||
AND samp.SPECTRAL_QUALIFIE = 'FULL'
|
||||
<if test="nuclideName != null and nuclideName.size() > 0">
|
||||
AND xe.NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="colTime != null and colTime.size() > 0">
|
||||
and ((TO_NUMBER(samp.COLLECT_STOP - samp.COLLECT_START) * 24) between #{colTime[0]} and #{colTime[1]} )
|
||||
</if>
|
||||
<if test="acqTime != null and acqTime.size() > 0">
|
||||
and (samp.ACQUISITION_LIVE_SEC / 3600 between #{colTime[0]} and #{colTime[1]} )
|
||||
</if>
|
||||
<if test="XeVol != null">
|
||||
AND (aux.XE_VOLUME > #{XeVol} )
|
||||
</if>
|
||||
<if test="Xe133MDC != null and Xe133MDC.size() > 0">
|
||||
AND (xe.NUCLIDE_NAME = 'Xe133m' AND MDC between #{Xe133MDC[0]} AND #{Xe133MDC[1]} )
|
||||
</if>
|
||||
</where>
|
||||
) a
|
||||
<trim prefix="where" suffixOverrides="or">
|
||||
<choose>
|
||||
<when test="Xe133mFlag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe133m' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe133m' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="Xe133Flag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe133' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe133' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="Xe131mFlag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe131m' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe131m' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="Xe135Flag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe135' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe135' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
</trim>
|
||||
</select>
|
||||
<select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl">
|
||||
SELECT
|
||||
n.SAMPLE_ID,
|
||||
n.NUCLIDE_NAME
|
||||
ana.ANALYSISBEGIN
|
||||
FROM
|
||||
ORIGINAL.GARDS_SAMPLE_DATA s
|
||||
INNER JOIN RNAUTO.GARDS_XE_RESULTS n ON s.SAMPLE_ID = n.SAMPLE_ID
|
||||
WHERE s.STATION_ID = #{stationId} AND s.DETECTOR_ID = #{detectorId}
|
||||
<if test="nuclideNames != null and nuclideNames.size() > 0">
|
||||
AND n.NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideNames" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
AND n.NID_FLAG = 1
|
||||
RNAUTO.GARDS_XE_RESULTS xe
|
||||
INNER JOIN RNAUTO.GARDS_ANALYSES ana ON ana.IDANALYSIS = xe.IDANALYSIS
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_DATA samp ON samp.SAMPLE_ID = xe.SAMPLE_ID
|
||||
<where>
|
||||
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND samp.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
|
||||
AND samp.STATION_ID = #{stationId}
|
||||
<if test="nuclideName != null and nuclideName.size() > 0">
|
||||
AND xe.NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="nuclideNames" resultType="java.lang.String">
|
||||
SELECT
|
||||
NUCLIDE_NAME
|
||||
FROM
|
||||
RNAUTO.GARDS_XE_RESULTS
|
||||
WHERE
|
||||
NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideNames" separator="," item="nuclideName" index="index" open="(" close=")">
|
||||
#{nuclideName}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
NUCLIDE_NAME
|
||||
</select>
|
||||
</mapper>
|
|
@ -2,81 +2,39 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.mapper.GardsXeResultsManMapper">
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe">
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
samp.SAMPLE_ID,
|
||||
SELECT
|
||||
xe.NUCLIDE_NAME,
|
||||
xe.CONC,
|
||||
ana.ANALYSISBEGIN,
|
||||
xe.NID_FLAG
|
||||
FROM
|
||||
RNMAN.GARDS_XE_RESULTS xe
|
||||
INNER JOIN RNMAN.GARDS_ANALYSES ana ON ana.IDANALYSIS = xe.IDANALYSIS
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_DATA samp ON samp.SAMPLE_ID = xe.SAMPLE_ID
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_AUX aux ON samp.SAMPLE_ID = aux.SAMPLE_ID
|
||||
<where>
|
||||
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND samp.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
|
||||
AND samp.STATION_ID = #{stationId}
|
||||
AND samp.SPECTRAL_QUALIFIE = 'FULL'
|
||||
<if test="nuclideName != null and nuclideName.size() > 0">
|
||||
AND xe.NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)a
|
||||
<trim prefix="where" suffixOverrides="or">
|
||||
<choose>
|
||||
<when test="Xe133mFlag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe133m' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe133m' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="Xe133Flag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe133' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe133' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="Xe131mFlag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe131m' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe131m' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="Xe135Flag != null">
|
||||
(a.NUCLIDE_NAME = 'Xe135' AND a.NID_FLAG = 1 ) or
|
||||
</when>
|
||||
<otherwise>
|
||||
(a.NUCLIDE_NAME = 'Xe135' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or
|
||||
</otherwise>
|
||||
</choose>
|
||||
</trim>
|
||||
</select>
|
||||
<select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl">
|
||||
SELECT
|
||||
n.SAMPLE_ID,
|
||||
n.NUCLIDE_NAME
|
||||
ana.ANALYSISBEGIN
|
||||
FROM
|
||||
ORIGINAL.GARDS_SAMPLE_DATA s
|
||||
INNER JOIN RNMAN.GARDS_XE_RESULTS n ON s.SAMPLE_ID = n.SAMPLE_ID
|
||||
WHERE s.STATION_ID = #{stationId} AND s.DETECTOR_ID = #{detectorId}
|
||||
<if test="nuclideNames != null and nuclideNames.size() > 0">
|
||||
AND n.NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideNames" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
RNMAN.GARDS_XE_RESULTS xe
|
||||
INNER JOIN RNMAN.GARDS_ANALYSES ana ON ana.IDANALYSIS = xe.IDANALYSIS
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_DATA samp ON samp.SAMPLE_ID = xe.SAMPLE_ID
|
||||
<where>
|
||||
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
|
||||
AND samp.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
|
||||
AND samp.STATION_ID = #{stationId}
|
||||
<if test="nuclideName != null and nuclideName.size() > 0">
|
||||
AND xe.NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="nuclideNames" resultType="java.lang.String">
|
||||
SELECT
|
||||
NUCLIDE_NAME
|
||||
FROM
|
||||
RNMAN.GARDS_XE_RESULTS
|
||||
WHERE
|
||||
NUCLIDE_NAME IN
|
||||
<foreach collection="nuclideNames" separator="," item="nuclideName" index="index" open="(" close=")">
|
||||
#{nuclideName}
|
||||
</foreach>
|
||||
</if>
|
||||
AND n.NID_FLAG = 1
|
||||
GROUP BY
|
||||
NUCLIDE_NAME
|
||||
</select>
|
||||
</mapper>
|
|
@ -36,7 +36,6 @@
|
|||
e.is_qiye,
|
||||
e.enabled,
|
||||
e.email_server_address,
|
||||
e.email_server_type,
|
||||
COUNT (l.id) AS alarms
|
||||
FROM
|
||||
sys_email e
|
||||
|
|
|
@ -5,20 +5,21 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.text.StrBuilder;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.jeecg.common.api.dto.message.MessageDTO;
|
||||
import org.jeecg.common.config.mqtoken.UserTokenContext;
|
||||
import org.jeecg.common.constant.RedisConstant;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.constant.enums.SampleType;
|
||||
import org.jeecg.common.util.*;
|
||||
import org.jeecg.common.util.dynamic.db.FreemarkerParseFactory;
|
||||
import org.jeecg.modules.base.dto.NuclideInfo;
|
||||
import org.jeecg.modules.base.dto.Info;
|
||||
import org.jeecg.modules.base.entity.postgre.AlarmAnalysisLog;
|
||||
|
@ -38,11 +39,14 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import static org.jeecg.common.constant.enums.MessageTypeEnum.*;
|
||||
import static org.jeecg.common.util.TokenUtils.getTempToken;
|
||||
import static org.jeecg.modules.base.enums.Template.ANALYSIS_NUCLIDE;
|
||||
import static org.jeecg.modules.base.enums.Template.ANALYSIS_NUCLIDE;
|
||||
import static org.jeecg.modules.base.enums.Template.MONITOR_EMAIL;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
|
@ -61,7 +65,6 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
private IAlarmAnalysisRuleService ruleService;
|
||||
private AnalysisResultService analysisResultService;
|
||||
private IAlarmAnalysisNuclideAvgService nuclideAvgService;
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
private final String COMMA = SymbolConstant.COMMA;
|
||||
|
||||
|
@ -95,7 +98,7 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
redisStreamUtil.del(streamKey, recordId.getValue());
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("AnalysisConsumer消费异常: ", e);
|
||||
log.error("AnalysisConsumer消费异常: {}", e.getMessage());
|
||||
}finally {
|
||||
destroy();
|
||||
}
|
||||
|
@ -106,11 +109,10 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
String sampleId = info.getSampleId();
|
||||
String fullOrPrel = info.getFullOrPrel();
|
||||
String datasource = info.getDatasource();
|
||||
Map<String, String> infoNuclideMap = info.getNuclides();
|
||||
Map<String, String> nuclides = info.getNuclides();
|
||||
if (StrUtil.isBlank(stationId)) return;
|
||||
if (StrUtil.isBlank(sampleId)) return;
|
||||
if (MapUtil.isEmpty(infoNuclideMap)) return;
|
||||
|
||||
if (MapUtil.isEmpty(nuclides)) return;
|
||||
List<AlarmAnalysisRule> rules = ruleService.allAnalysisRule();
|
||||
for (AlarmAnalysisRule rule : rules) {
|
||||
// 当前规则是否有报警条件
|
||||
|
@ -132,36 +134,18 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
// 是否有当前规则关注的核素
|
||||
String nuclidesStr = rule.getNuclides();
|
||||
if (StrUtil.isBlank(nuclidesStr)) continue;
|
||||
Set<String> names = infoNuclideMap.keySet();
|
||||
Set<String> names = nuclides.keySet();
|
||||
List<String> follow = ListUtil.toList(nuclidesStr.split(COMMA));
|
||||
// 因数据库 Xe核素名称 M大小写不统一,先统一大小写再进行比较
|
||||
Collection<String> follows = follow.stream().map(f -> {
|
||||
if(f.toLowerCase().contains("xe")){
|
||||
return f.replace("M", "m");
|
||||
}
|
||||
return f;
|
||||
}).collect(Collectors.toList());
|
||||
// 推送过来的核素集合与所关注核素集合取交集
|
||||
Collection<String> cross = CollectionUtil.intersection(names, follows);
|
||||
Collection<String> cross = CollectionUtil.intersection(names, follow);
|
||||
if (CollUtil.isEmpty(cross)) continue;
|
||||
Map<String, String> nuclidesCross = infoNuclideMap.entrySet().stream()
|
||||
Map<String, String> nuclidesCross = nuclides.entrySet().stream()
|
||||
.filter(entry -> cross.contains(entry.getKey()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
// 开始对交集中的核素进行条件判断
|
||||
info.setRuleId(rule.getId());
|
||||
info.setGroupId(rule.getContactGroup());
|
||||
info.setConditions(rule.getConditions());
|
||||
if (null != rule.getIdentifyNuclides()) {
|
||||
String[] inSplit = rule.getIdentifyNuclides().split(",");
|
||||
if (inSplit.length >= 1) {
|
||||
info.setIdentifyNuclideSet(Arrays.stream(inSplit).map(f -> {
|
||||
if(f.toLowerCase().contains("xe")){
|
||||
return f.replace("M", "m");
|
||||
}
|
||||
return f;
|
||||
}).collect(Collectors.toSet()));
|
||||
}
|
||||
}
|
||||
judge(info, nuclidesCross);
|
||||
}
|
||||
}
|
||||
|
@ -172,37 +156,27 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
String betaOrGamma = info.getBetaOrGamma();
|
||||
String datasource = info.getDatasource();
|
||||
String stationId = info.getStationId();
|
||||
String stationCode="";
|
||||
HashMap<String, Object> stationMap = (HashMap<String, Object>)redisUtil.get(RedisConstant.STATION_CODE_MAP);
|
||||
String sampleId = info.getSampleId();
|
||||
String sampleName = info.getSampleName();
|
||||
Set<String> identifyNuclideSet = info.getIdentifyNuclideSet();
|
||||
// 获取谱文件采样日期 如果为null 则默认为LocalDate.now()
|
||||
LocalDate collDate = ObjectUtil.isNull(info.getCollectionDate()) ? LocalDate.now() :
|
||||
info.getCollectionDate().toLocalDate();
|
||||
|
||||
List<String> conditions = ListUtil.toList(conditionStr.split(COMMA));
|
||||
List<NuclideInfo> firstDetected = new ArrayList<>(); // 首次发现
|
||||
List<String> firstDetected = new ArrayList<>(); // 首次发现
|
||||
List<NuclideInfo> moreThanAvg = new ArrayList<>(); // 超浓度均值
|
||||
List<NuclideInfo> meanWhile = new ArrayList<>(); // 同时出现两种及以上核素
|
||||
Map<String, NuclideInfo> nuclideInfoMap = Maps.newHashMap();
|
||||
List<NuclideInfo> identifyNuclideResult = new ArrayList<>();
|
||||
List<String> meanwhile = new ArrayList<>(); // 同时出现两种及以上核素
|
||||
for (String con : conditions) {
|
||||
Condition condition = Condition.valueOf1(con);
|
||||
if (ObjectUtil.isNull(condition)) continue;
|
||||
switch (condition){
|
||||
case FIRST_FOUND: // 首次发现该元素
|
||||
firstDetected = this.firstDetected(betaOrGamma, datasource, stationId, sampleId, nuclidesCross);
|
||||
firstDetected = firstDetected(betaOrGamma, datasource, nuclideNames);
|
||||
break;
|
||||
case ABOVE_AVERAGE: // 元素浓度高于均值
|
||||
moreThanAvg = this.moreThanAvg(datasource, stationId, collDate, nuclidesCross);
|
||||
moreThanAvg = moreThanAvg(datasource, stationId, collDate, nuclidesCross);
|
||||
break;
|
||||
case MEANWHILE: // 同时出现两种及以上核素
|
||||
meanWhile = this.meanWhile(betaOrGamma, datasource, sampleId, nuclidesCross);
|
||||
if (meanWhile.size() < 2) meanWhile = ListUtil.empty();
|
||||
break;
|
||||
case IDENTIFY_NUCLIDES: // 识别到某个核素
|
||||
identifyNuclideResult = this.meanWhile(info.getNuclides(), datasource, identifyNuclideSet);
|
||||
if (CollUtil.isNotEmpty(nuclideNames) && nuclideNames.size() >= 2)
|
||||
meanwhile.addAll(nuclideNames);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -210,54 +184,19 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
}
|
||||
// 构建预警信息
|
||||
DataTool dataTool = DataTool.getInstance();
|
||||
if (CollUtil.isNotEmpty(firstDetected)) {
|
||||
String above = firstDetected.stream()
|
||||
.map(NuclideInfo::getNuclide)
|
||||
.collect(Collectors.joining(StrUtil.COMMA + StrUtil.SPACE));
|
||||
dataTool.put("firstDetected", above);
|
||||
for (NuclideInfo nuclideInfo : firstDetected) {
|
||||
nuclideInfoMap.put(nuclideInfo.getNuclide(), nuclideInfo);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(meanWhile)){
|
||||
String above = meanWhile.stream()
|
||||
.map(NuclideInfo::getNuclide)
|
||||
.collect(Collectors.joining(StrUtil.COMMA + StrUtil.SPACE));
|
||||
dataTool.put("meanwhile", above);
|
||||
for (NuclideInfo nuclideInfo : meanWhile) {
|
||||
nuclideInfoMap.put(nuclideInfo.getNuclide(), nuclideInfo);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(identifyNuclideResult)){
|
||||
String above = identifyNuclideResult.stream()
|
||||
.map(NuclideInfo::getNuclide)
|
||||
.collect(Collectors.joining(StrUtil.COMMA + StrUtil.SPACE));
|
||||
dataTool.put("identifyNuclide", above);
|
||||
for (NuclideInfo nuclideInfo : identifyNuclideResult) {
|
||||
nuclideInfoMap.put(nuclideInfo.getNuclide(), nuclideInfo);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(firstDetected))
|
||||
dataTool.put("firstDetected", CollUtil.join(firstDetected, StrUtil.COMMA + StrUtil.SPACE));
|
||||
if (CollUtil.isNotEmpty(moreThanAvg)){
|
||||
String above = moreThanAvg.stream()
|
||||
.map(item -> item.getNuclide() + "(" + item.getValue() + ")" + " > " + item.getThreshold())
|
||||
.collect(Collectors.joining(StrUtil.COMMA + StrUtil.SPACE));
|
||||
dataTool.put("moreThanAvg", above);
|
||||
for (NuclideInfo nuclideInfo : moreThanAvg) {
|
||||
nuclideInfoMap.put(nuclideInfo.getNuclide(), nuclideInfo);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(meanwhile))
|
||||
dataTool.put("meanwhile", CollUtil.join(meanwhile, StrUtil.COMMA + StrUtil.SPACE));
|
||||
// 如果报警数据为空 则不需要发送报警信息和生成报警日志
|
||||
if (MapUtil.isEmpty(dataTool.get())) return;
|
||||
// 产生报警信息的Sample信息
|
||||
if (CollUtil.isNotEmpty(stationMap))
|
||||
{
|
||||
stationCode=stationMap.get(stationId).toString();
|
||||
}
|
||||
dataTool.put("sampleId", sampleId).put("sampleName", sampleName);
|
||||
DataTool titleData = DataTool.getInstance();
|
||||
titleData.put("stationCode",stationCode);
|
||||
// 构建预警信息实例 准备发送预警信息,20250327--修改模版
|
||||
MessageDTO messageDTO = TemplateUtil.parse1(ANALYSIS_NUCLIDE.getCode(), dataTool.get(),titleData.get());
|
||||
MessageDTO messageDTO = TemplateUtil.parse1(ANALYSIS_NUCLIDE.getCode(), dataTool.get());
|
||||
// 保存报警日志
|
||||
AlarmAnalysisLog logInfo = new AlarmAnalysisLog();
|
||||
BeanUtil.copyProperties(info, logInfo);
|
||||
|
@ -265,13 +204,8 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
if (ObjectUtil.isNotNull(sampleType))
|
||||
logInfo.setSampleType(sampleType.getValue());
|
||||
logInfo.setAlarmInfo(messageDTO.getContent());
|
||||
|
||||
// 报警信息中核素列表
|
||||
if (MapUtil.isNotEmpty(nuclideInfoMap)) {
|
||||
List<NuclideInfo> nuclideInfoList = Lists.newArrayList();
|
||||
nuclideInfoMap.forEach((key, value) -> nuclideInfoList.add(nuclideInfoMap.get(key)));
|
||||
logInfo.setNuclideInfoList(nuclideInfoList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(moreThanAvg))
|
||||
logInfo.setNuclideInfoList(moreThanAvg);
|
||||
logService.saveLog(logInfo);
|
||||
// 发送报警信息
|
||||
String groupId = info.getGroupId();
|
||||
|
@ -282,32 +216,13 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
/**
|
||||
* 首次发现该核素
|
||||
*/
|
||||
private List<NuclideInfo> firstDetected(String betaOrGamma, String dataSourceType,
|
||||
String stationId, String sampleId, Map<String,String> nuclidesCross){
|
||||
List<NuclideInfo> result = Lists.newArrayList();
|
||||
/* 查询用户关注的核素是否存在 如果不存在则为首次发现该核素
|
||||
判断核素是否存在的条件: 该核素的Conc值是否大于MDC值
|
||||
*/
|
||||
String detectorId = systemClient.getDetectorId(sampleId);
|
||||
if (StrUtil.isBlank(detectorId)) {
|
||||
throw new RuntimeException("detectorId is null or empty");
|
||||
}
|
||||
Set<String> nuclideNames = nuclidesCross.keySet();
|
||||
List<String> list = analysisResultService.nuclideFirst(betaOrGamma, dataSourceType, stationId,
|
||||
detectorId, sampleId, nuclideNames);
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
for (Map.Entry<String, String> f : nuclidesCross.entrySet()) {
|
||||
if(list.contains(f.getKey())){
|
||||
NuclideInfo nuclideInfo = new NuclideInfo();
|
||||
nuclideInfo.setNuclide(f.getKey());
|
||||
nuclideInfo.setDatasource(DSType.typeOf(dataSourceType));
|
||||
// 对浓度值保留五位小数
|
||||
nuclideInfo.setValue(NumUtil.keepStr(f.getValue(), 5));
|
||||
result.add(nuclideInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
private List<String> firstDetected(String betaOrGamma,
|
||||
String dataSourceType,
|
||||
Set<String> nuclideNames){
|
||||
List<String> existNames = analysisResultService
|
||||
.nuclideNames(betaOrGamma, dataSourceType, nuclideNames);
|
||||
// 两个集合元素相减
|
||||
return CollUtil.subtractToList(nuclideNames, existNames);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -325,6 +240,8 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
String nuclideName = nuclide.getKey();
|
||||
String concValue = nuclide.getValue();// 浓度值
|
||||
String avgValue = nuclideAvgs.get(nuclideName);// 浓度均值
|
||||
if (StrUtil.isBlank(concValue) || StrUtil.isBlank(avgValue))
|
||||
continue;
|
||||
if (!NumberUtil.isNumber(concValue) || !NumberUtil.isNumber(avgValue))
|
||||
continue;
|
||||
BigDecimal conc = new BigDecimal(concValue);
|
||||
|
@ -343,52 +260,6 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
return nuclideInfos;
|
||||
}
|
||||
|
||||
/*
|
||||
* 是否同时存在两种及以上核素
|
||||
* */
|
||||
private List<NuclideInfo> meanWhile(String betaOrGamma, String dataSourceType,
|
||||
String sampleId, Map<String,String> nuclidesCross){
|
||||
List<NuclideInfo> result = Lists.newArrayList();
|
||||
/* 查询用户关注的核素中 该谱中是否存在两种及以上核素
|
||||
判断核素是否存在的条件: 该核素的Conc值是否大于MDC值
|
||||
*/
|
||||
Set<String> nuclideNames = nuclidesCross.keySet();
|
||||
List<String> list = analysisResultService.nuclideExist(betaOrGamma, dataSourceType, sampleId, nuclideNames);
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
for (Map.Entry<String, String> f : nuclidesCross.entrySet()) {
|
||||
if(list.contains(f.getKey())){
|
||||
NuclideInfo nuclideInfo = new NuclideInfo();
|
||||
nuclideInfo.setNuclide(f.getKey());
|
||||
nuclideInfo.setDatasource(DSType.typeOf(dataSourceType));
|
||||
// 对浓度值保留五位小数
|
||||
nuclideInfo.setValue(NumUtil.keepStr(f.getValue(), 5));
|
||||
result.add(nuclideInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/*
|
||||
* 是否同时存在两种及以上核素
|
||||
* */
|
||||
private List<NuclideInfo> meanWhile(Map<String,String> nuclideMap, String dataSourceType, Set<String> nuclideNames){
|
||||
List<NuclideInfo> result = Lists.newArrayList();
|
||||
/* 查询用户关注的核素中 该谱中是否存在两种及以上核素
|
||||
判断核素是否存在的条件: 该核素的Conc值是否大于MDC值
|
||||
*/
|
||||
for (String name : nuclideNames) {
|
||||
if(nuclideMap.containsKey(name)){
|
||||
NuclideInfo nuclideInfo = new NuclideInfo();
|
||||
nuclideInfo.setNuclide(name);
|
||||
nuclideInfo.setDatasource(DSType.typeOf(dataSourceType));
|
||||
// 对浓度值保留五位小数
|
||||
nuclideInfo.setValue(NumUtil.keepStr(nuclideMap.get(name), 5));
|
||||
result.add(nuclideInfo);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
// start 生成临时Token到线程中
|
||||
UserTokenContext.setToken(getTempToken());
|
||||
|
@ -398,7 +269,6 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
ruleService = SpringContextUtils.getBean(IAlarmAnalysisRuleService.class);
|
||||
analysisResultService = SpringContextUtils.getBean(AnalysisResultService.class);
|
||||
nuclideAvgService = SpringContextUtils.getBean(IAlarmAnalysisNuclideAvgService.class);
|
||||
redisUtil = SpringContextUtils.getBean(RedisUtil.class);
|
||||
}
|
||||
|
||||
private void destroy(){
|
||||
|
|
|
@ -5,10 +5,7 @@ import java.util.Set;
|
|||
|
||||
public interface AnalysisResultService {
|
||||
|
||||
List<String> nuclideExist(String betaOrGamma, String dataSourceType,
|
||||
String sampleId, Set<String> nuclideNames);
|
||||
|
||||
List<String> nuclideFirst(String betaOrGamma, String dataSourceType,
|
||||
String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(String betaOrGamma,
|
||||
String dataSourceType,
|
||||
Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsNuclIded;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -12,8 +13,5 @@ public interface IGardsNuclIdedAutoService extends IService<GardsNuclIded> {
|
|||
|
||||
List<ConcDto> getConc(Map<String,Object> params);
|
||||
|
||||
List<String> nuclideExist(String sampleId, Set<String> nuclideNames);
|
||||
|
||||
List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -10,10 +10,7 @@ import java.util.Set;
|
|||
|
||||
public interface IGardsNuclIdedManService extends IService<GardsNuclIded> {
|
||||
|
||||
List<ConcDto> getConc(Map<String, Object> params);
|
||||
List<ConcDto> getConc(Map<String,Object> params);
|
||||
|
||||
List<String> nuclideExist(String sampleId, Set<String> nuclideNames);
|
||||
|
||||
List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
|
||||
|
@ -12,8 +13,5 @@ public interface IGardsXeResultsAutoService extends IService<GardsXeResults> {
|
|||
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params, Set<String> nuclides);
|
||||
|
||||
List<String> nuclideExist(String sampleId, Set<String> nuclideNames);
|
||||
|
||||
List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
|
||||
|
||||
|
@ -12,8 +13,5 @@ public interface IGardsXeResultsManService extends IService<GardsXeResults> {
|
|||
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params, Set<String> nuclides);
|
||||
|
||||
List<String> nuclideExist(String sampleId, Set<String> nuclideNames);
|
||||
|
||||
List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames);
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.base.entity.postgre.SysEmailLog;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISysEmailLogService extends IService<SysEmailLog> {
|
||||
|
@ -17,6 +16,4 @@ public interface ISysEmailLogService extends IService<SysEmailLog> {
|
|||
Result<?> todayMin(String emailId);
|
||||
|
||||
Result<?> analysis(String emailId, String startDate, String endDate);
|
||||
|
||||
Integer getMinus(String emailId);
|
||||
}
|
||||
|
|
|
@ -135,9 +135,6 @@ public class AlarmAnalysisRuleServiceImpl extends ServiceImpl<AlarmAnalysisRuleM
|
|||
@Override
|
||||
public Result add(AlarmAnalysisRule alarmAnalysisRule) {
|
||||
String name = alarmAnalysisRule.getName();
|
||||
if (null != alarmAnalysisRule.getIdentifyNuclides()) {
|
||||
alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions() + ",4");
|
||||
}
|
||||
if (ObjectUtil.isNotNull(getByName(name)))
|
||||
return Result.error("Rule Name" + Prompt.NOT_REPEAT);
|
||||
boolean success = save(alarmAnalysisRule);
|
||||
|
@ -153,11 +150,6 @@ public class AlarmAnalysisRuleServiceImpl extends ServiceImpl<AlarmAnalysisRuleM
|
|||
String id = alarmAnalysisRule.getId();
|
||||
String name = alarmAnalysisRule.getName();
|
||||
String original = getById(id).getName();
|
||||
if (null != alarmAnalysisRule.getIdentifyNuclides() && !alarmAnalysisRule.getConditions().contains("4")) {
|
||||
alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions() + ",4");
|
||||
} else if(null == alarmAnalysisRule.getIdentifyNuclides() && alarmAnalysisRule.getConditions().contains("4")) {
|
||||
alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions().replace("4", ""));
|
||||
}
|
||||
if (!StrUtil.equalsIgnoreCase(name,original)){
|
||||
if (ObjectUtil.isNotNull(getByName(name)))
|
||||
return Result.error("Rule Name" + Prompt.NOT_REPEAT);
|
||||
|
@ -191,30 +183,6 @@ public class AlarmAnalysisRuleServiceImpl extends ServiceImpl<AlarmAnalysisRuleM
|
|||
List<String> conditionChecked = ListUtil
|
||||
.toList(analysisRule.getConditions().split(comma));
|
||||
analysisRuleInfo.setConditionChecked(conditionChecked);
|
||||
|
||||
if (null != analysisRule.getColTime()) {
|
||||
List<String> colTimes = ListUtil
|
||||
.toList(analysisRule.getColTime().split(comma));
|
||||
analysisRuleInfo.setColTime(colTimes);
|
||||
}
|
||||
|
||||
if (null != analysisRule.getAcqTime()) {
|
||||
List<String> acqTimes = ListUtil
|
||||
.toList(analysisRule.getAcqTime().split(comma));
|
||||
analysisRuleInfo.setAcqTime(acqTimes);
|
||||
}
|
||||
|
||||
if (null != analysisRule.getXe133MDC()) {
|
||||
List<String> xe133MDC = ListUtil
|
||||
.toList(analysisRule.getXe133MDC().split(comma));
|
||||
analysisRuleInfo.setXe133MDC(xe133MDC);
|
||||
}
|
||||
|
||||
if (null != analysisRule.getIdentifyNuclides()) {
|
||||
List<String> inList = ListUtil
|
||||
.toList(analysisRule.getIdentifyNuclides().split(comma));
|
||||
analysisRuleInfo.setIdentifyNuclidesChecked(inList);
|
||||
}
|
||||
return Result.OK(analysisRuleInfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.jeecg.modules.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.modules.feignclient.SystemClient;
|
||||
import org.jeecg.modules.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -27,51 +26,25 @@ public class AnalysisResultServiceImpl implements AnalysisResultService {
|
|||
|
||||
|
||||
@Override
|
||||
public List<String> nuclideExist(String betaOrGamma, String dataSourceType,
|
||||
String sampleId, Set<String> nuclideNames) {
|
||||
public List<String> nuclideNames(String betaOrGamma, String dataSourceType, Set<String> nuclideNames) {
|
||||
if (CommonConstant.ARMDARR.equals(dataSourceType)){
|
||||
if (CommonConstant.BETA.equals(betaOrGamma)){
|
||||
return xeResultsAutoService.nuclideExist(sampleId, nuclideNames);
|
||||
return xeResultsAutoService.nuclideNames(nuclideNames);
|
||||
}else if (CommonConstant.GAMMA.equals(betaOrGamma)){
|
||||
return nuclIdedAutoService.nuclideExist(sampleId, nuclideNames);
|
||||
return nuclIdedAutoService.nuclideNames(nuclideNames);
|
||||
}else {
|
||||
return ListUtil.empty();
|
||||
return ListUtil.toList(nuclideNames);
|
||||
}
|
||||
} else if (CommonConstant.ARMDRRR.equals(dataSourceType)) {
|
||||
if (CommonConstant.BETA.equals(betaOrGamma)){
|
||||
return xeResultsManService.nuclideExist(sampleId, nuclideNames);
|
||||
return xeResultsManService.nuclideNames(nuclideNames);
|
||||
}else if (CommonConstant.GAMMA.equals(betaOrGamma)){
|
||||
return nuclIdedManService.nuclideExist(sampleId, nuclideNames);
|
||||
return nuclIdedManService.nuclideNames(nuclideNames);
|
||||
}else {
|
||||
return ListUtil.empty();
|
||||
return ListUtil.toList(nuclideNames);
|
||||
}
|
||||
}else {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideFirst(String betaOrGamma, String dataSourceType,
|
||||
String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames) {
|
||||
if (CommonConstant.ARMDARR.equals(dataSourceType)){
|
||||
if (CommonConstant.BETA.equals(betaOrGamma)){
|
||||
return xeResultsAutoService.nuclideFirst(stationId, detectorId, sampleId, nuclideNames);
|
||||
}else if (CommonConstant.GAMMA.equals(betaOrGamma)){
|
||||
return nuclIdedAutoService.nuclideFirst(stationId, detectorId, sampleId, nuclideNames);
|
||||
}else {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
} else if (CommonConstant.ARMDRRR.equals(dataSourceType)) {
|
||||
if (CommonConstant.BETA.equals(betaOrGamma)){
|
||||
return xeResultsManService.nuclideFirst(stationId, detectorId, sampleId, nuclideNames);
|
||||
}else if (CommonConstant.GAMMA.equals(betaOrGamma)){
|
||||
return nuclIdedManService.nuclideFirst(stationId, detectorId, sampleId, nuclideNames);
|
||||
}else {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
}else {
|
||||
return ListUtil.empty();
|
||||
return ListUtil.toList(nuclideNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.jeecg.modules.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
@ -29,6 +28,7 @@ import org.springframework.stereotype.Service;
|
|||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -76,33 +76,11 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
String comma = SymbolConstant.COMMA;
|
||||
// 获取所有生效的报警规则
|
||||
List<AlarmAnalysisRule> analysisRules = analysisRuleService.allAnalysisRule();
|
||||
List<AlarmAnalysisNuclideAvg> autoAvgs = new ArrayList<>(); // Auto
|
||||
List<AlarmAnalysisNuclideAvg> manAvgs = new ArrayList<>(); // Man
|
||||
// 初始化台站类型
|
||||
init();
|
||||
|
||||
// 对所有报警规则的关注台站和关注核素进行统计
|
||||
Map<String, Set<String>> nuclideMap = new HashMap<>(); // key:台站code value:核素列表
|
||||
for (AlarmAnalysisRule analysisRule : analysisRules) {
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
|
||||
BigDecimal coefficient = analysisRule.getCoefficient();
|
||||
// 获取平均值计算的日期区间、系数
|
||||
Integer days = analysisRule.getDays();
|
||||
LocalDate dayAgo = LocalDate.now().minusDays(1);
|
||||
LocalDate daysAgo = dayAgo.minusDays(days);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DateConstant.DATE);
|
||||
String startDate = daysAgo.format(formatter);
|
||||
String endDate = dayAgo.format(formatter);
|
||||
params.put("startDate",startDate + DateConstant.TIME_START);
|
||||
params.put("endDate",endDate + DateConstant.TIME_END);
|
||||
|
||||
String stationStr = analysisRule.getStations();
|
||||
String nuclideStr = analysisRule.getNuclides();
|
||||
|
||||
// QC Flags
|
||||
params.putAll(this.getRuleQcFlagParams(analysisRule));
|
||||
|
||||
// 获取关注台站
|
||||
List<String> stations = ListUtil.toList(StrUtil.split(stationStr, comma));
|
||||
// 获取关注核素
|
||||
|
@ -115,75 +93,89 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
}else {
|
||||
nuclideMap.put(station, nuclides);
|
||||
}
|
||||
|
||||
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
||||
params.put("stationId", station);
|
||||
// 获取台站类型
|
||||
StationType stationType = stationType(station);
|
||||
List<ConcDtoXe> xeConcAuto = new ArrayList<>();
|
||||
List<ConcDtoXe> xeConcMan = new ArrayList<>();
|
||||
List<ConcDto> nuclConcAuto = new ArrayList<>();
|
||||
List<ConcDto> nuclConcMan = new ArrayList<>();
|
||||
switch (stationType){
|
||||
case BETA:
|
||||
if (analysisRule.getSource().contains("1")) {
|
||||
xeConcAuto = xeResultsAutoService.getConc(params, nuclides); // beta-gamma Auto
|
||||
}
|
||||
if(analysisRule.getSource().contains("2")){
|
||||
xeConcMan = xeResultsManService.getConc(params, nuclides); // beta-gamma Man
|
||||
}
|
||||
break;
|
||||
case GAMMA:
|
||||
params.put("nuclideName", nuclides);
|
||||
if (analysisRule.getSource().contains("1")) {
|
||||
nuclConcAuto = nuclIdedAutoService.getConc(params); // gamma Auto
|
||||
}
|
||||
if(analysisRule.getSource().contains("2")){
|
||||
nuclConcMan = nuclIdedManService.getConc(params); // gamma Man
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Auto
|
||||
Map<String, String> autoResult = new HashMap<>();
|
||||
autoResult.putAll(calculate(concDto(xeConcAuto), coefficient));
|
||||
autoResult.putAll(calculate(nuclConcAuto, coefficient));
|
||||
for (String nuclide : nuclides) {
|
||||
String val = autoResult.get(nuclide);
|
||||
if(StrUtil.isBlank(val)) continue;
|
||||
AlarmAnalysisNuclideAvg analysisNuclideAvg = new AlarmAnalysisNuclideAvg(station, nuclide, val);
|
||||
analysisNuclideAvg.setDataSourceType(CommonConstant.ARMDARR);
|
||||
autoAvgs.add(analysisNuclideAvg);
|
||||
}
|
||||
// Man
|
||||
Map<String,String> manResult = new HashMap<>();
|
||||
manResult.putAll(calculate(concDto(xeConcMan), coefficient));
|
||||
manResult.putAll(calculate(nuclConcMan, coefficient));
|
||||
for (String nuclide : nuclides) {
|
||||
String val = manResult.get(nuclide);
|
||||
if(StrUtil.isBlank(val)) continue;
|
||||
AlarmAnalysisNuclideAvg analysisNuclideAvg = new AlarmAnalysisNuclideAvg(station, nuclide, val);
|
||||
analysisNuclideAvg.setDataSourceType(CommonConstant.ARMDRRR);
|
||||
manAvgs.add(analysisNuclideAvg);
|
||||
}
|
||||
}
|
||||
// 自动处理和人工交互库的台站核素浓度均值结果合并
|
||||
List<AlarmAnalysisNuclideAvg> allAvgs = new ArrayList<>();
|
||||
allAvgs.addAll(autoAvgs);
|
||||
allAvgs.addAll(manAvgs);
|
||||
|
||||
// 计算周期和计算日期
|
||||
String cycle = startDate + SymbolConstant.WELL_NUMBER + endDate;
|
||||
allAvgs.forEach(item -> item.setCycle(cycle).setCaclDate(dayAgo));
|
||||
nuclideAvgService.saveBatch(allAvgs);
|
||||
// 记录日志
|
||||
log.info(log(allAvgs));
|
||||
}
|
||||
// 核素浓度值查询参数准备
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
AlarmAnalysisNuclideParam paramLatest = nuclideParamService.getLatest();
|
||||
BigDecimal index = paramLatest.getIndex();
|
||||
Integer days = paramLatest.getDays();
|
||||
LocalDate dayAgo = LocalDate.now().minusDays(1);
|
||||
LocalDate daysAgo = dayAgo.minusDays(days);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DateConstant.DATE);
|
||||
String startDate = daysAgo.format(formatter);
|
||||
String endDate = dayAgo.format(formatter);
|
||||
params.put("startDate",startDate + DateConstant.TIME_START);
|
||||
params.put("endDate",endDate + DateConstant.TIME_END);
|
||||
|
||||
List<AlarmAnalysisNuclideAvg> autoAvgs = new ArrayList<>(); // Auto
|
||||
List<AlarmAnalysisNuclideAvg> manAvgs = new ArrayList<>(); // Man
|
||||
// 遍历所有台站 计算每个台站的所有核素浓度均值
|
||||
init();
|
||||
for (Map.Entry<String, Set<String>> entry : nuclideMap.entrySet()) {
|
||||
String station = entry.getKey();
|
||||
Set<String> nuclides = entry.getValue();
|
||||
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
||||
params.put("stationId", station);
|
||||
StationType stationType = stationType(station);
|
||||
List<ConcDtoXe> xeConcAuto = new ArrayList<>();
|
||||
List<ConcDtoXe> xeConcMan = new ArrayList<>();
|
||||
List<ConcDto> nuclConcAuto = new ArrayList<>();
|
||||
List<ConcDto> nuclConcMan = new ArrayList<>();
|
||||
switch (stationType){
|
||||
case BETA:
|
||||
xeConcAuto = xeResultsAutoService.getConc(params, nuclides); // beta-gamma Auto
|
||||
xeConcMan = xeResultsManService.getConc(params, nuclides); // beta-gamma Man
|
||||
break;
|
||||
case GAMMA:
|
||||
params.put("nuclideName", nuclides);
|
||||
nuclConcAuto = nuclIdedAutoService.getConc(params); // gamma Auto
|
||||
nuclConcMan = nuclIdedManService.getConc(params); // gamma Man
|
||||
break;
|
||||
case NULL:
|
||||
xeConcAuto = xeResultsAutoService.getConc(params, nuclides); // beta-gamma Auto
|
||||
xeConcMan = xeResultsManService.getConc(params, nuclides); // beta-gamma Man
|
||||
params.put("nuclideName", nuclides);
|
||||
nuclConcAuto = nuclIdedAutoService.getConc(params); // gamma Auto
|
||||
nuclConcMan = nuclIdedManService.getConc(params); // gamma Man
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Auto
|
||||
Map<String, String> autoResult = new HashMap<>();
|
||||
autoResult.putAll(calculate(concDto(xeConcAuto), index));
|
||||
autoResult.putAll(calculate(nuclConcAuto, index));
|
||||
for (String nuclide : nuclides) {
|
||||
String val = autoResult.get(nuclide);
|
||||
AlarmAnalysisNuclideAvg analysisNuclideAvg = new AlarmAnalysisNuclideAvg(station, nuclide, val);
|
||||
analysisNuclideAvg.setDataSourceType(CommonConstant.ARMDARR);
|
||||
autoAvgs.add(analysisNuclideAvg);
|
||||
}
|
||||
// Man
|
||||
Map<String,String> manResult = new HashMap<>();
|
||||
manResult.putAll(calculate(concDto(xeConcMan), index));
|
||||
manResult.putAll(calculate(nuclConcMan, index));
|
||||
for (String nuclide : nuclides) {
|
||||
String val = manResult.get(nuclide);
|
||||
AlarmAnalysisNuclideAvg analysisNuclideAvg = new AlarmAnalysisNuclideAvg(station, nuclide, val);
|
||||
analysisNuclideAvg.setDataSourceType(CommonConstant.ARMDRRR);
|
||||
manAvgs.add(analysisNuclideAvg);
|
||||
}
|
||||
}
|
||||
// 自动处理和人工交互库的台站核素浓度均值结果合并
|
||||
List<AlarmAnalysisNuclideAvg> allAvgs = new ArrayList<>();
|
||||
allAvgs.addAll(autoAvgs);
|
||||
allAvgs.addAll(manAvgs);
|
||||
|
||||
// 计算周期和计算日期
|
||||
String cycle = startDate + SymbolConstant.WELL_NUMBER + endDate;
|
||||
allAvgs.forEach(item -> item.setCycle(cycle).setCaclDate(dayAgo));
|
||||
nuclideAvgService.saveBatch(allAvgs);
|
||||
// 记录日志
|
||||
log.info(log(allAvgs));
|
||||
}catch (Exception e){
|
||||
log.error("NucliedAvgJob执行异常: ", e);
|
||||
log.error("NucliedAvgJob执行异常: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,24 +194,15 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
.sorted(Comparator.comparing(ConcDto::getAnalysisBegin))
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(values)) continue;
|
||||
/**int baseLine = values.size();
|
||||
int baseLine = values.size();
|
||||
BigDecimal line = new BigDecimal(baseLine);
|
||||
int i = line.multiply(index).setScale(0, RoundingMode.HALF_UP).intValue();
|
||||
int j = Math.max(i - 1, 0);
|
||||
result.put(nuclide, values.get(j).getConc());**/
|
||||
|
||||
// 改为求conc平均值 fix: 20250102 xiao
|
||||
double sum = 0;
|
||||
for (ConcDto dto : values) {
|
||||
sum += Double.valueOf(dto.getConc());
|
||||
}
|
||||
BigDecimal avg = index.multiply(new BigDecimal(sum / values.size()));
|
||||
result.put(nuclide, String.valueOf(avg.setScale(5, RoundingMode.HALF_UP).doubleValue()));
|
||||
result.put(nuclide, values.get(j).getConc());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private List<ConcDto> concDto(List<ConcDtoXe> concDtoXes){
|
||||
List<ConcDto> concDtos = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(concDtoXes)) return concDtos;
|
||||
|
@ -265,44 +248,4 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
return StationType.BETA;
|
||||
return StationType.GAMMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报警规则中QC质量筛选参数
|
||||
* @param analysisRule
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> getRuleQcFlagParams(AlarmAnalysisRule analysisRule){
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
|
||||
List<String> colTime = StrUtil.isNotBlank(analysisRule.getColTime())
|
||||
? ListUtil.toList(StrUtil.split(analysisRule.getColTime(), SymbolConstant.COMMA)) : null;
|
||||
if(null != colTime) {
|
||||
params.put("colTime", colTime);
|
||||
}
|
||||
|
||||
List<String> acqTime = StrUtil.isNotBlank(analysisRule.getAcqTime())
|
||||
? ListUtil.toList(StrUtil.split(analysisRule.getAcqTime(), SymbolConstant.COMMA)) : null;
|
||||
if(null != acqTime) {
|
||||
params.put("acqTime", acqTime);
|
||||
}
|
||||
|
||||
List<String> xe133MDC = StrUtil.isNotBlank(analysisRule.getXe133MDC())
|
||||
? ListUtil.toList(StrUtil.split(analysisRule.getXe133MDC(), SymbolConstant.COMMA)) : null;
|
||||
if(null != xe133MDC) {
|
||||
params.put("Xe133MDC", xe133MDC);
|
||||
}
|
||||
|
||||
if(null != analysisRule.getAirFlow()) params.put("airFlow", analysisRule.getAirFlow());
|
||||
if(null != analysisRule.getDecayTime()) params.put("decayTime", analysisRule.getDecayTime());
|
||||
if(null != analysisRule.getSampVol()) params.put("sampVol", analysisRule.getSampVol());
|
||||
if(null != analysisRule.getBa140MDC()) params.put("Ba140MDC", analysisRule.getBa140MDC());
|
||||
if(null != analysisRule.getBe7FWHM()) params.put("Be7FWHM", analysisRule.getBe7FWHM());
|
||||
if(null != analysisRule.getXeVol()) params.put("XeVol", analysisRule.getXeVol());
|
||||
if(null != analysisRule.getXe131mFlag()) params.put("Xe131mFlag", analysisRule.getXe131mFlag());
|
||||
if(null != analysisRule.getXe133mFlag()) params.put("Xe133mFlag", analysisRule.getXe133mFlag());
|
||||
if(null != analysisRule.getXe133Flag()) params.put("Xe133Flag", analysisRule.getXe133Flag());
|
||||
if(null != analysisRule.getXe135Flag()) params.put("Xe135Flag", analysisRule.getXe135Flag());
|
||||
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsNuclIded;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
import org.jeecg.modules.mapper.GardsNuclIdedAutoMapper;
|
||||
|
@ -18,7 +13,6 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
@ -36,34 +30,7 @@ public class GardsNuclIdedAutoServiceImpl extends ServiceImpl<GardsNuclIdedAutoM
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideExist(String sampleId, Set<String> nuclideNames) {
|
||||
LambdaQueryWrapper<GardsNuclIded> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(GardsNuclIded::getSampleId, sampleId);
|
||||
wrapper.in(GardsNuclIded::getNuclideName, nuclideNames);
|
||||
List<GardsNuclIded> nuclIdeds = this.list(wrapper);
|
||||
// 判断核素是否存在的条件: 该核素Conc值是否大于MDC值
|
||||
Set<String> existNuclides = nuclIdeds.stream()
|
||||
.filter(item -> NumberUtil.isNumber(item.getConcentration()))
|
||||
.filter(item -> NumberUtil.isNumber(item.getMdc()))
|
||||
.filter(item -> NumberUtil.isGreater(new BigDecimal(item.getConcentration()), new BigDecimal(item.getMdc())))
|
||||
.map(GardsNuclIded::getNuclideName)
|
||||
.collect(Collectors.toSet());
|
||||
return ListUtil.toList(existNuclides);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames) {
|
||||
List<SampNucl> sampNucls = this.baseMapper.sampNucl(stationId, detectorId, nuclideNames);
|
||||
// 获取除了当前谱的所有存在的核素
|
||||
Set<String> notCurrent = sampNucls.stream()
|
||||
.filter(item -> !StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 获取当前谱的所有存在的核素
|
||||
Set<String> current = sampNucls.stream()
|
||||
.filter(item -> StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 两集合相减即为当前谱中的首次在当前台站当前探测器中出现的核素
|
||||
return CollUtil.subtractToList(current, notCurrent);
|
||||
public List<String> nuclideNames(Set<String> nuclideNames) {
|
||||
return baseMapper.nuclideNames(nuclideNames);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,16 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsNuclIded;
|
||||
import org.jeecg.modules.mapper.GardsNuclIdedManMapper;
|
||||
import org.jeecg.modules.service.IGardsNuclIdedManService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
@ -33,34 +28,7 @@ public class GardsNuclIdedManServiceImpl extends ServiceImpl<GardsNuclIdedManMap
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideExist(String sampleId, Set<String> nuclideNames) {
|
||||
LambdaQueryWrapper<GardsNuclIded> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(GardsNuclIded::getSampleId, sampleId);
|
||||
wrapper.in(GardsNuclIded::getNuclideName, nuclideNames);
|
||||
List<GardsNuclIded> nuclIdeds = this.list(wrapper);
|
||||
// 判断核素是否存在的条件: 该核素Conc值是否大于MDC值
|
||||
Set<String> existNuclides = nuclIdeds.stream()
|
||||
.filter(item -> NumberUtil.isNumber(item.getConcentration()))
|
||||
.filter(item -> NumberUtil.isNumber(item.getMdc()))
|
||||
.filter(item -> NumberUtil.isGreater(new BigDecimal(item.getConcentration()), new BigDecimal(item.getMdc())))
|
||||
.map(GardsNuclIded::getNuclideName)
|
||||
.collect(Collectors.toSet());
|
||||
return ListUtil.toList(existNuclides);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames) {
|
||||
List<SampNucl> sampNucls = this.baseMapper.sampNucl(stationId, detectorId, nuclideNames);
|
||||
// 获取除了当前谱的所有存在的核素
|
||||
Set<String> notCurrent = sampNucls.stream()
|
||||
.filter(item -> !StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 获取当前谱的所有存在的核素
|
||||
Set<String> current = sampNucls.stream()
|
||||
.filter(item -> StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 两集合相减即为当前谱中的首次在当前台站当前探测器中出现的核素
|
||||
return CollUtil.subtractToList(current, notCurrent);
|
||||
public List<String> nuclideNames(Set<String> nuclideNames) {
|
||||
return baseMapper.nuclideNames(nuclideNames);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,12 @@ package org.jeecg.modules.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
import org.jeecg.modules.mapper.GardsXeResultsAutoMapper;
|
||||
import org.jeecg.modules.service.IGardsXeResultsAutoService;
|
||||
|
@ -53,33 +51,7 @@ public class GardsXeResultsAutoServiceImpl extends ServiceImpl<GardsXeResultsAut
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideExist(String sampleId, Set<String> nuclideNames) {
|
||||
LambdaQueryWrapper<GardsXeResults> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(GardsXeResults::getSampleId, sampleId);
|
||||
wrapper.in(GardsXeResults::getNuclideName, nuclideNames);
|
||||
List<GardsXeResults> xeResults = this.list(wrapper);
|
||||
// 判断核素是否存在的条件: 该核素NidFlag值是否为1
|
||||
Set<String> existNuclides = xeResults.stream()
|
||||
.filter(item -> ObjectUtil.isNotNull(item.getNidFlag()))
|
||||
.filter(item -> item.getNidFlag() == 1)
|
||||
.map(GardsXeResults::getNuclideName)
|
||||
.collect(Collectors.toSet());
|
||||
return ListUtil.toList(existNuclides);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames) {
|
||||
List<SampNucl> sampNucls = this.baseMapper.sampNucl(stationId, detectorId, nuclideNames);
|
||||
// 获取除了当前谱的所有存在的核素
|
||||
Set<String> notCurrent = sampNucls.stream()
|
||||
.filter(item -> !StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 获取当前谱的所有存在的核素
|
||||
Set<String> current = sampNucls.stream()
|
||||
.filter(item -> StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 两集合相减即为当前谱中的首次在当前台站当前探测器中出现的核素
|
||||
return CollUtil.subtractToList(current, notCurrent);
|
||||
public List<String> nuclideNames(Set<String> nuclideNames) {
|
||||
return baseMapper.nuclideNames(nuclideNames);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.jeecg.modules.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
@ -10,7 +9,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.dto.SampNucl;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
|
||||
import org.jeecg.modules.mapper.GardsXeResultsManMapper;
|
||||
import org.jeecg.modules.service.IGardsXeResultsManService;
|
||||
|
@ -53,33 +51,7 @@ public class GardsXeResultsManServiceImpl extends ServiceImpl<GardsXeResultsManM
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideExist(String sampleId, Set<String> nuclideNames) {
|
||||
LambdaQueryWrapper<GardsXeResults> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(GardsXeResults::getSampleId, sampleId);
|
||||
wrapper.in(GardsXeResults::getNuclideName, nuclideNames);
|
||||
List<GardsXeResults> xeResults = this.list(wrapper);
|
||||
// 判断核素是否存在的条件: 该核素NidFlag值是否为1
|
||||
Set<String> existNuclides = xeResults.stream()
|
||||
.filter(item -> ObjectUtil.isNotNull(item.getNidFlag()))
|
||||
.filter(item -> item.getNidFlag() == 1)
|
||||
.map(GardsXeResults::getNuclideName)
|
||||
.collect(Collectors.toSet());
|
||||
return ListUtil.toList(existNuclides);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> nuclideFirst(String stationId, String detectorId,
|
||||
String sampleId, Set<String> nuclideNames) {
|
||||
List<SampNucl> sampNucls = this.baseMapper.sampNucl(stationId, detectorId, nuclideNames);
|
||||
// 获取除了当前谱的所有存在的核素
|
||||
Set<String> notCurrent = sampNucls.stream()
|
||||
.filter(item -> !StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 获取当前谱的所有存在的核素
|
||||
Set<String> current = sampNucls.stream()
|
||||
.filter(item -> StrUtil.equals(item.getSampleId(), sampleId))
|
||||
.map(SampNucl::getNuclideName).collect(Collectors.toSet());
|
||||
// 两集合相减即为当前谱中的首次在当前台站当前探测器中出现的核素
|
||||
return CollUtil.subtractToList(current, notCurrent);
|
||||
public List<String> nuclideNames(Set<String> nuclideNames) {
|
||||
return baseMapper.nuclideNames(nuclideNames);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
@ -230,20 +227,4 @@ public class SysEmailLogServiceImpl extends ServiceImpl<SysEmailLogMapper, SysEm
|
|||
result.put("yData",yData);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getMinus(String emailId) {
|
||||
LambdaQueryWrapper<SysEmailLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SysEmailLog::getEmailId, emailId);
|
||||
wrapper.orderByDesc(SysEmailLog::getCreateTime);
|
||||
wrapper.last("limit 1");
|
||||
SysEmailLog emailLog = getOne(wrapper, false);
|
||||
if (ObjectUtil.isNull(emailLog))
|
||||
return -1;
|
||||
Date createTime = emailLog.getCreateTime();
|
||||
if (ObjectUtil.isNull(createTime))
|
||||
return -1;
|
||||
// 获取最新一条数据和当前时间所间隔的分钟数
|
||||
return Math.toIntExact(DateUtil.between(createTime, new Date(), DateUnit.MINUTE));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,20 +30,5 @@
|
|||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.james</groupId>
|
||||
<artifactId>apache-mime4j-core</artifactId>
|
||||
<version>0.8.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.james</groupId>
|
||||
<artifactId>apache-mime4j-dom</artifactId>
|
||||
<version>0.8.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version> <!-- 使用最新稳定版 -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -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;
|
||||
|
@ -17,7 +16,6 @@ import org.springframework.stereotype.Component;
|
|||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
@ -41,12 +39,12 @@ public class AutoProcessManager{
|
|||
/**
|
||||
* 以邮件Id为key,邮件信息为value
|
||||
*/
|
||||
private Map<String,EmailProperties> emailMap = new ConcurrentHashMap<>();
|
||||
private Map<String,EmailProperties> emailMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 以邮件id为key,以邮件执行线程为value
|
||||
*/
|
||||
private Map<String,EmailParsingActuator> emailExecThreadMap = new ConcurrentHashMap<>();
|
||||
private Map<String,EmailParsingActuator> emailExecThreadMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 启动自动处理
|
||||
|
@ -83,39 +81,34 @@ public class AutoProcessManager{
|
|||
public void run() {
|
||||
for(;;){
|
||||
long start = System.currentTimeMillis();
|
||||
try {
|
||||
if(!CollectionUtils.isEmpty(emailMap)){
|
||||
synchronized (lock){
|
||||
Iterator<EmailProperties> iterator = emailMap.values().iterator();
|
||||
while(iterator.hasNext()){
|
||||
EmailProperties next = iterator.next();
|
||||
if (next.isResetFlag()) {
|
||||
EmailParsingActuator actuator = emailExecThreadMap.get(next.getId());
|
||||
actuator.updateEmail(next);
|
||||
next.setResetFlag(false);
|
||||
}
|
||||
if(next.isNewEmailFlag()){
|
||||
// 网络正常之后才允许创建新的实例
|
||||
final EmailServiceManager emailServiceManager = EmailServiceManager.getInstance();
|
||||
emailServiceManager.init(next);
|
||||
boolean testFlag = emailServiceManager.testConnectEmailServer();
|
||||
if(testFlag){
|
||||
EmailParsingActuator emailParsingActuator = new EmailParsingActuator();
|
||||
emailParsingActuator.init(next,spectrumServiceQuotes,emailCounter,systemStartupTime);
|
||||
emailParsingActuator.setName(next.getUsername()+"-email-monitor");
|
||||
emailParsingActuator.start();
|
||||
//把邮件监测执行线程加入管理队列
|
||||
emailExecThreadMap.put(next.getId(),emailParsingActuator);
|
||||
//新邮件监测监测线程已启动则修改新邮件标记为false
|
||||
next.setNewEmailFlag(false);
|
||||
}
|
||||
if(!CollectionUtils.isEmpty(emailMap)){
|
||||
synchronized (lock){
|
||||
Iterator<EmailProperties> iterator = emailMap.values().iterator();
|
||||
while(iterator.hasNext()){
|
||||
EmailProperties next = iterator.next();
|
||||
if (next.isResetFlag()) {
|
||||
EmailParsingActuator actuator = emailExecThreadMap.get(next.getId());
|
||||
actuator.updateEmail(next);
|
||||
next.setResetFlag(false);
|
||||
}
|
||||
if(next.isNewEmailFlag()){
|
||||
// 网络正常之后才允许创建新的实例
|
||||
final EmailServiceManager emailServiceManager = EmailServiceManager.getInstance();
|
||||
emailServiceManager.init(next);
|
||||
boolean testFlag = emailServiceManager.testConnectEmailServer();
|
||||
if(testFlag){
|
||||
EmailParsingActuator emailParsingActuator = new EmailParsingActuator();
|
||||
emailParsingActuator.init(next,spectrumServiceQuotes,emailCounter,systemStartupTime);
|
||||
emailParsingActuator.setName(next.getUsername()+"-email-monitor");
|
||||
emailParsingActuator.start();
|
||||
//把邮件监测执行线程加入管理队列
|
||||
emailExecThreadMap.put(next.getId(),emailParsingActuator);
|
||||
//新邮件监测监测线程已启动则修改新邮件标记为false
|
||||
next.setNewEmailFlag(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
long sleepTime = taskProperties.getMonitoringMailDataCycle() - (end-start);
|
||||
|
@ -288,52 +281,46 @@ public class AutoProcessManager{
|
|||
public void run() {
|
||||
for(;;){
|
||||
long start = System.currentTimeMillis();
|
||||
try {
|
||||
if(!CollectionUtils.isEmpty(emailExecThreadMap)){
|
||||
//遍历邮箱执行线程,如果状态为已停止则删除
|
||||
final Iterator<Map.Entry<String, EmailParsingActuator>> checkStopThreads = emailExecThreadMap.entrySet().iterator();
|
||||
while (checkStopThreads.hasNext()){
|
||||
final Map.Entry<String, EmailParsingActuator> next = checkStopThreads.next();
|
||||
if(next.getValue().getState() == State.TERMINATED){
|
||||
log.info("{}邮箱执行线程已停止,emailExecThreadMap删除此邮箱数据",next.getValue().getEmailProperties().getUsername());
|
||||
checkStopThreads.remove();
|
||||
emailMap.remove(next.getKey());
|
||||
if(!CollectionUtils.isEmpty(emailExecThreadMap)){
|
||||
//遍历邮箱执行线程,如果状态为已停止则删除
|
||||
final Iterator<Map.Entry<String, EmailParsingActuator>> checkStopThreads = emailExecThreadMap.entrySet().iterator();
|
||||
while (checkStopThreads.hasNext()){
|
||||
final Map.Entry<String, EmailParsingActuator> next = checkStopThreads.next();
|
||||
if(next.getValue().getState() == State.TERMINATED){
|
||||
log.info("{}邮箱执行线程已停止,emailExecThreadMap删除此邮箱数据",next.getValue().getEmailProperties().getUsername());
|
||||
checkStopThreads.remove();
|
||||
emailMap.remove(next.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
//遍历邮箱执行线程,如果邮箱执行线程stop属性已被设置为true则关闭资源停止线程
|
||||
final Iterator<Map.Entry<String, EmailParsingActuator>> iterator = emailExecThreadMap.entrySet().iterator();
|
||||
emailExecThreadMap.forEach((emailId,emailExecThread)->{
|
||||
try{
|
||||
if(emailExecThread.getState() != State.TERMINATED && emailExecThread.isStop()){
|
||||
final long nowTime = System.currentTimeMillis();
|
||||
final long setStoptime = emailExecThread.getStopTime().getTime();
|
||||
final long val = nowTime - setStoptime;
|
||||
if(val >= taskProperties.getForceDeletedTime()){
|
||||
log.info("关闭{}邮箱线程内部线程池资源",emailExecThread.getEmailProperties().getUsername());
|
||||
emailExecThread.closeResource();
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
}finally {
|
||||
if(emailExecThread.getState() != State.TERMINATED && emailExecThread.isStop()){
|
||||
final long nowTime = System.currentTimeMillis();
|
||||
final long setStoptime = emailExecThread.getStopTime().getTime();
|
||||
final long val = nowTime - setStoptime;
|
||||
if(val >= taskProperties.getForceDeletedTime()){
|
||||
log.info("强制停止{}邮箱线程",emailExecThread.getEmailProperties().getUsername());
|
||||
emailExecThread.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//遍历邮箱执行线程,如果邮箱执行线程stop属性已被设置为true则关闭资源停止线程
|
||||
final Iterator<Map.Entry<String, EmailParsingActuator>> iterator = emailExecThreadMap.entrySet().iterator();
|
||||
emailExecThreadMap.forEach((emailId,emailExecThread)->{
|
||||
try{
|
||||
log.info("当前线程状态:{}", emailExecThread.getState());
|
||||
if(emailExecThread.getState() != State.TERMINATED && emailExecThread.isStop()){
|
||||
final long nowTime = System.currentTimeMillis();
|
||||
final long setStoptime = emailExecThread.getStopTime().getTime();
|
||||
final long val = nowTime - setStoptime;
|
||||
if(val >= taskProperties.getForceDeletedTime()){
|
||||
log.info("关闭{}邮箱线程内部线程池资源",emailExecThread.getEmailProperties().getUsername());
|
||||
emailExecThread.closeResource();
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
}finally {
|
||||
if(emailExecThread.getState() != State.TERMINATED && emailExecThread.isStop()){
|
||||
final long nowTime = System.currentTimeMillis();
|
||||
final long setStoptime = emailExecThread.getStopTime().getTime();
|
||||
final long val = nowTime - setStoptime;
|
||||
if(val >= taskProperties.getForceDeletedTime()){
|
||||
log.info("强制停止{}邮箱线程",emailExecThread.getEmailProperties().getUsername());
|
||||
emailExecThread.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
});
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
long sleepTime = taskProperties.getDeletedMailThreadExecCycle() - (end-start);
|
||||
|
|
|
@ -119,9 +119,10 @@ public class EmailParsingActuator extends Thread{
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("EmailParsingActuator has exception: ", e);
|
||||
log.error("EmailParsingActuator has exception: {}", e.getMessage());
|
||||
log.info("Mail-Parsing线程池资源关闭...");
|
||||
closeResource();
|
||||
log.error(e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
//清除本批次邮件日志缓存
|
||||
|
@ -143,7 +144,7 @@ public class EmailParsingActuator extends Thread{
|
|||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package org.jeecg.modules.exception;
|
||||
|
||||
/**
|
||||
* C谱分析异常
|
||||
*/
|
||||
public class CAnalyseException extends AnalyseException{
|
||||
|
||||
/**
|
||||
* Constructs a new exception with the specified detail message. The
|
||||
* cause is not initialized, and may subsequently be initialized by
|
||||
* a call to {@link #initCause}.
|
||||
*
|
||||
* @param message the detail message. The detail message is saved for
|
||||
* later retrieval by the {@link #getMessage()} method.
|
||||
*/
|
||||
public CAnalyseException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public CAnalyseException(String message, boolean isDuplicateKeyException) {
|
||||
super(message,isDuplicateKeyException);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package org.jeecg.modules.exception;
|
||||
|
||||
/*
|
||||
GPS文件读取失败时抛出异常
|
||||
*/
|
||||
public class GPSFileReadException extends RuntimeException{
|
||||
|
||||
public GPSFileReadException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.base.entity.original.GardsGPSData;
|
||||
|
||||
public interface GardsGPSDataMapper extends BaseMapper<GardsGPSData> {
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user