Compare commits

..

184 Commits

Author SHA1 Message Date
xiaoguangbin
5719c210ca fix:自建台站beta分析 2024-08-22 11:19:29 +08:00
xiaoguangbin
356bd94a26 fix:修复新beta的保存接口执行非常慢的问题 2024-08-20 18:25:05 +08:00
nieziyan
af71f40b1c fix:格式化 2024-08-19 14:51:37 +08:00
nieziyan
0718701788 fix:分析工具核素弹窗 2024-08-15 14:18:24 +08:00
nieziyan
2693294331 fix:bug 2024-08-15 09:36:25 +08:00
nieziyan
6d2ec53b4c feat:comment接口 loadFromDB 2024-08-14 15:15:50 +08:00
xiaoguangbin
c0ba24aae4 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-08-09 15:54:58 +08:00
xiaoguangbin
a2e48e5b84 fix:修复新beta的保存接口执行非常慢的问题 2024-08-09 15:54:47 +08:00
nieziyan
8aeebe3047 feat:自建台站pekaInfomation 2024-08-09 09:17:55 +08:00
nieziyan
56e7c6adc5 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-08-08 09:41:19 +08:00
nieziyan
02083f93f5 feat:自建台站自动处理完善 2024-08-08 09:41:12 +08:00
xiaoguangbin
e266148da1 fix:修复新beta的分析接口,增加对roiParams的处理 2024-08-07 17:24:37 +08:00
xiaoguangbin
cd3d19db70 fix:修复新beta的分析接口,增加对roiParams的处理 2024-08-07 11:56:08 +08:00
xiaoguangbin
9a7cdbe1ed fix:修复新beta 保存到数据库失败问题 2024-08-06 18:46:46 +08:00
nieziyan
979f24a10c feat:自建台站view log 2024-08-06 18:23:21 +08:00
nieziyan
4ddf2f2b46 fix:自建台站viewRRR 2024-08-06 09:16:53 +08:00
nieziyan
f214f9fc97 fix:自建台站viewRRR 2024-08-06 09:11:31 +08:00
nieziyan
b7ae380fb1 fix:自建台站saveToDB报错 2024-08-05 09:25:01 +08:00
nieziyan
219b644669 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-08-02 16:36:09 +08:00
xiaoguangbin
aef513794b fix:修复新beta 保存到数据库失败问题 2024-08-02 16:35:25 +08:00
nieziyan
bead8100e7 Merge remote-tracking branch 'origin/SelfStation' into SelfStation
# Conflicts:
#	jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java
2024-08-02 15:43:42 +08:00
nieziyan
69e668a9a7 feat:自建台站报告 2024-08-02 15:37:30 +08:00
xiaoguangbin
441a4ee6f6 fix:修改 updateROI 更改其他谱失败问题 2024-08-01 19:02:58 +08:00
xiaoguangbin
8cac8a6099 feat:完善新beta savetodb接口 2024-08-01 17:34:33 +08:00
nieziyan
0aeb76d959 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-08-01 14:44:05 +08:00
nieziyan
ba17537b44 fix:betaEnergyData null 2024-08-01 14:43:57 +08:00
xiaoguangbin
135f4ebd21 fix: 新beta谱 savetodb接口修改返回结果 2024-08-01 11:04:41 +08:00
nieziyan
dc3375a5ab Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-08-01 10:41:40 +08:00
nieziyan
6f9e33e48b feat:自建台站saveToDB 2024-08-01 10:41:31 +08:00
xiaoguangbin
ddbb632492 fix: 新beta谱 savetodb接口修改返回结果 2024-07-31 18:54:54 +08:00
nieziyan
164e44d086 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-31 18:23:38 +08:00
nieziyan
b48cf5a991 feat:自建台站loadFromDB 2024-07-31 18:23:32 +08:00
xiaoguangbin
19c9bae348 feat:补充beta 分析部分接口 2024-07-31 17:29:39 +08:00
nieziyan
40e94299a7 fix:自建台站saveToDB 2024-07-31 10:38:20 +08:00
nieziyan
b19f5087ed Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-30 13:58:33 +08:00
nieziyan
6bb4cb67a1 fix:自建台站分析参数 2024-07-30 13:58:16 +08:00
xiaoguangbin
c6ea38f2d3 feat:viewBeta calibration补充gamma energy 转化 channel公式 2024-07-30 10:44:29 +08:00
xiaoguangbin
7c5ffb4cf2 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-29 19:34:44 +08:00
xiaoguangbin
f905f9951d feat:beta energy calibration通过b_energy数据重新拟合一条初始beta曲线 2024-07-29 19:34:25 +08:00
nieziyan
bc74b2e32e feat:自建台站SaveToDB 2024-07-29 19:30:17 +08:00
nieziyan
48fc1b30e5 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-26 19:16:00 +08:00
nieziyan
01ea4f8c63 feat:自建台站交互分析 2024-07-26 19:15:46 +08:00
xiaoguangbin
cf369218da fix: self:1.nuclideReview弹窗多个接口;2.解决分析之后 gamma三个calibration弹窗无数据问题 2024-07-26 10:49:18 +08:00
xiaoguangbin
0cd2e0f29c Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-25 17:06:44 +08:00
xiaoguangbin
c83aff08bd feat:selfStationController 增加 replotBaseLine、acceptBaseLine 接口 2024-07-25 17:06:23 +08:00
xiaoguangbin
da269b1da1 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-25 17:05:40 +08:00
xiaoguangbin
9726c51710 feat:selfStationController 增加 replotBaseLine、acceptBaseLine 接口 2024-07-25 17:05:14 +08:00
xiaoguangbin
71411c8d4c Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-25 14:35:52 +08:00
xiaoguangbin
511afb8677 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-25 14:35:13 +08:00
xiaoguangbin
50c70d7026 feat:selfStationController 增加 resetButton 接口 2024-07-25 14:34:44 +08:00
nieziyan
82ebe1009e Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-25 14:28:59 +08:00
nieziyan
2e0814fa14 feat:自建台站自动处理分析结果存库 2024-07-25 14:28:50 +08:00
xiaoguangbin
e11eee19f7 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-25 14:26:28 +08:00
xiaoguangbin
566657c339 fix:beta calibration table数据 2024-07-25 14:24:51 +08:00
xiaoguangbin
2e08948302 fix:如何初始时获取beta calibration table数据 2024-07-25 11:13:29 +08:00
xiaoguangbin
79063e235a Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-24 17:16:24 +08:00
xiaoguangbin
d64a0be200 fix:修改updateROI接口参数 2024-07-24 17:15:56 +08:00
xiaoguangbin
9f7295673d Revert "fix:修改updateROI接口参数"
This reverts commit aa99d7214b.
2024-07-24 17:13:16 +08:00
xiaoguangbin
aa99d7214b fix:修改updateROI接口参数 2024-07-24 17:12:44 +08:00
xiaoguangbin
73286710e0 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-24 16:47:04 +08:00
xiaoguangbin
1f94e14a70 fix:修改updateROI接口参数;2 增加/selfStation/getGammaGated接口 2024-07-24 16:46:44 +08:00
xiaoguangbin
48a03b6d6f fix:修改updateROI接口参数;2 增加/selfStation/getGammaGated接口 2024-07-24 16:46:30 +08:00
xiaoguangbin
f4aef9bdee Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-24 15:42:21 +08:00
nieziyan
970d4f3027 feat:自建台站谱解析 2024-07-23 16:49:11 +08:00
xiaoguangbin
8869735270 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-23 09:33:30 +08:00
nieziyan
dee89d28b5 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-23 09:17:06 +08:00
xiaoguangbin
1e830b0392 fix:修改updateROI接口参数 2024-07-23 08:45:32 +08:00
nieziyan
61ecc0ea5c Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-22 19:09:17 +08:00
nieziyan
95116338ad feat:自建台站谱解析类 2024-07-22 19:09:04 +08:00
xiaoguangbin
755f36d012 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-22 18:37:39 +08:00
xiaoguangbin
0af17e0601 fix:修改updateROI接口参数 2024-07-22 18:36:05 +08:00
nieziyan
7cd16a77c2 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-22 15:59:11 +08:00
nieziyan
7daebd98b8 feat:自建台站谱解析类 2024-07-22 15:59:04 +08:00
xiaoguangbin
567b64a34e fix:增加mdcInfoMap-C 2024-07-22 15:56:38 +08:00
xiaoguangbin
793d767313 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-22 14:10:01 +08:00
xiaoguangbin
cb74fb5a9e Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-19 17:15:00 +08:00
xiaoguangbin
2a6a38c286 fix:修改新beta谱的gamma reprocessing接口 2024-07-19 17:14:47 +08:00
nieziyan
108f2db587 feat:自建台站AUX表增加GPS信息 2024-07-19 16:11:10 +08:00
xiaoguangbin
90ecbfe99b Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-19 15:34:23 +08:00
nieziyan
55b14e66b6 feat:自建台站新增viewSpectrum接口 2024-07-19 11:21:32 +08:00
xiaoguangbin
fa79e380dd Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-19 09:44:11 +08:00
xiaoguangbin
f2d211b2b2 fix:beta energy calibration 中qc谱散点数据调整 2024-07-19 09:20:32 +08:00
nieziyan
5849612a3b feat:bgSpectrum数据 2024-07-18 19:43:26 +08:00
xiaoguangbin
3d97ffb539 fix:增加interactive弹窗内的接口 2024-07-18 18:45:05 +08:00
nieziyan
b5d4b23f3c feat:自建台站增加Configure接口 2024-07-18 18:16:59 +08:00
nieziyan
3c02c89ae5 feat:自建台站增加用户核素库配置接口 2024-07-18 09:06:49 +08:00
xiaoguangbin
16a1407216 fix:新beta 增加fitting接口 2024-07-17 14:33:04 +08:00
xiaoguangbin
143e1b1092 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-17 10:32:22 +08:00
xiaoguangbin
5b94121112 fix: 2024-07-17 10:31:58 +08:00
xiaoguangbin
5c0f09c616 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-07-17 10:28:59 +08:00
xiaoguangbin
03d92b7889 fix:1。增加qc文件;2.增加交互分析(gamma) 2024-07-17 09:53:43 +08:00
xiaoguangbin
9bbdd5eb5d fix:FileNameByStandardForm使用ftp改为本地目录 2024-07-17 09:49:56 +08:00
xiaoguangbin
277485ddda Merge remote-tracking branch 'origin/SelfStation' into SelfStation
# Conflicts:
#	jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java
2024-07-16 14:35:57 +08:00
xiaoguangbin
2e10465bfe fix:1.修改roi卡gamma数据代码,改为两个x点卡数据;
2.点击分析按钮根据卡出来的数据生成gammaPHD文件
2024-07-16 14:34:34 +08:00
xiaoguangbin
5a8f20362a fix:from file 读取ftp功能改为直接访问ftp文件夹目录获取文件 2024-07-16 14:30:36 +08:00
xiaoguangbin
c64079e1f1 Merge remote-tracking branch 'origin/noFtp-seflStation' into SelfStation
# Conflicts:
#	jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java
2024-07-16 12:02:26 +08:00
xiaoguangbin
f4b05e2da1 fix:修改ftp切换的目录 2024-07-16 11:55:10 +08:00
nieziyan
3f22b0edba fix:Bugs 2024-07-08 10:03:25 +08:00
xiaoguangbin
ebdf8d863a fix:增加海水系统和自建台站beta的系统类型 2024-06-26 15:42:08 +08:00
xiaoguangbin
80985a74d7 Merge remote-tracking branch 'refs/remotes/origin/SelfStation' into noFtp-seflStation
# Conflicts:
#	jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/DictConstant.java
#	jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java
#	jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/controller/CalculateConcController.java
#	jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/redisStream/AnalysisConsumer.java
#	jeecg-module-auto-process/src/main/java/org/jeecg/modules/AutoProcessManager.java
#	jeecg-module-auto-process/src/main/java/org/jeecg/modules/EmailParsingActuator.java
#	jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/AbstractSpectrumHandler.java
#	jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java
#	jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java
#	jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java
#	jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java
#	jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumFileServiceImpl.java
#	jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java
#	jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/GardsSampleDataServiceImpl.java
2024-06-26 10:43:45 +08:00
xiaoguangbin
0a560452bf Merge remote-tracking branch 'refs/remotes/origin/sleepDownload' into noFtp-seflStation
# Conflicts:
#	jeecg-boot-base-core/src/main/java/org/jeecg/common/email/EmailServiceManager.java
#	jeecg-module-auto-process/src/main/java/org/jeecg/modules/AutoProcessManager.java
#	jeecg-module-auto-process/src/main/java/org/jeecg/modules/EmailParsingActuator.java
2024-06-26 10:06:41 +08:00
xiaoguangbin
f6b963145f fix:增加catch中exception写入log日志 2024-06-25 11:03:09 +08:00
nieziyan
8b40646076 feat:Application异常结束退出 2024-06-19 16:33:55 +08:00
nieziyan
cf0751109d feat:添加IDC数据源控制访问 2024-06-18 14:52:44 +08:00
nieziyan
64a98bd4ea fix:邮件接收超时时间 2024-06-12 15:33:23 +08:00
nieziyan
f1410028fa fix:不删除saveFile下谱文件 2024-06-06 16:51:24 +08:00
nieziyan
d5dce1c3fc feat:探测器报警信息 2024-06-04 09:52:58 +08:00
nieziyan
e83c1d6199 feat:探测器报警信息 2024-06-04 09:47:58 +08:00
nieziyan
86968e383b fix:删除多余文件 2024-05-13 14:58:41 +08:00
qiaoqinzheng
9fffd2436c 自动处理模块模块同步代码 2024-05-13 14:14:01 +08:00
qiaoqinzheng
2407b65a06 自动处理模块下载邮件代码修改 2024-05-13 14:09:42 +08:00
qiaoqinzheng
6c5a0bf546 人工交互模块BetaDataFile实体类增加detectorId字段用于报警使用 2024-05-13 09:24:25 +08:00
qiaoqinzheng
caf47a58d5 人工交互模块增加判断如果不是正常谱提示异常信息内容 2024-05-10 16:12:26 +08:00
qiaoqinzheng
600c5235ec 自建台站分支同步代码 2024-04-30 11:51:54 +08:00
qiaoqinzheng
3a1567f853 自建台站分支初始化数据返回值关键字改为void 2024-04-26 11:25:27 +08:00
nieziyan
18b495d1d0 Merge remote-tracking branch 'origin/noFtp' into noFtp 2024-04-25 15:05:45 +08:00
nieziyan
6335a3f588 fix:修改FTP为本地文件 2024-04-24 09:34:59 +08:00
nieziyan
d5b18e57b5 fix:增加排序 2024-04-11 14:51:57 +08:00
nieziyan
14e64306b2 Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-04-10 19:10:14 +08:00
nieziyan
0c8019ad15 feat:修改是否对文件内容解码逻辑 2024-04-10 19:09:32 +08:00
qiaoqinzheng
d92d55befc 自动处理模块GPS谱流程代码修改 2024-04-10 12:40:14 +08:00
qiaoqinzheng
fc4623e584 自动处理模块GPS谱流程代码修改 2024-04-10 11:31:27 +08:00
qiaoqinzheng
8d3b380837 自动处理模块service配置类增加GPS基础数据相关service实体 2024-04-10 09:13:56 +08:00
nieziyan
eedcd67113 feat:报警编码内容替换 2024-04-09 18:19:37 +08:00
nieziyan
4c16d4527d feat:报警编码信息管理 2024-04-08 18:35:24 +08:00
nieziyan
2d840bcd8b feat:解码Base64邮件内容保存为可处理.eml文件 2024-04-03 16:46:34 +08:00
qiaoqinzheng
5c181d60b1 同步mdc分支代码 2024-03-21 10:29:47 +08:00
qiaoqinzheng
bde5eed237 同步mdc分支代码 2024-03-21 10:28:04 +08:00
qiaoqinzheng
1c34f3dde1 app端代码同步 2024-02-29 10:50:41 +08:00
qiaoqinzheng
8b9882842f 人工交互模块beta存储公式参数问题修改 2024-02-02 17:04:58 +08:00
qiaoqinzheng
19b0366ace 存储谱数据到数据库时,生成的临时日志,报告文件进行删除 2024-02-02 09:31:01 +08:00
qiaoqinzheng
b6bad77274 消息推送OPPO,VIVO增加厂商配置参数 2024-01-31 17:51:11 +08:00
qiaoqinzheng
c892a339e0 增加客户绑定的客户端id去重,避免同一个用户发送多条的情况 2024-01-31 16:00:28 +08:00
qiaoqinzheng
9e8935c9d4 新增推送通知基础配置类MyApiHelper
新增推送通知工具类PushAppUtil
增加在线,离线推送消息相关方法
消息推送根据报警规则组id,获取绑定用户id,根据用户id查询绑定的客户端id推送消息
新增表绑定用户以及客户端信息
app登陆增加新的redisKey存储当前用户名对应的token信息,在别处登陆时清除上一个登陆token退出用户登陆
新增接口用户在app端登陆时,新增或修改当前用户id绑定的客户端id
定时任务增加推送通知工具类声明
分析结果消费者代码增加推送通知工具类
2024-01-31 15:25:15 +08:00
nieziyan
9107cdf13e Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-01-30 11:52:16 +08:00
nieziyan
01eb8d22c2 fix:send message 2024-01-30 11:51:34 +08:00
qiaoqinzheng
412d7e74d9 拼接文件路径,在ftp目录路径及ftp文件夹路径间多拼接路径符号问题修改
同步mdc修改
2024-01-29 14:21:21 +08:00
qiaoqinzheng
6a65d9cdd6 上传文件重命名内容修改 2024-01-29 13:41:28 +08:00
nieziyan
7af7fafc86 Merge branch 'mdc' into SelfStation
# Conflicts:
#	jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumServiceQuotes.java
#	jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLibMapper.java
#	jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java
#	jeecg-module-station-operation/src/main/java/org/jeecg/DataReceivingStatusManager.java
2024-01-26 17:00:07 +08:00
qiaoqinzheng
dac0736e72 查询统计核素信息接口增加对数据是inf,nan的数据赋值空值处理 2024-01-26 16:48:46 +08:00
qiaoqinzheng
c62b55913a 数据库加载增加判断analysisId条件 2024-01-26 15:27:10 +08:00
qiaoqinzheng
071e9690c6 自建台站新增initValue方法
自建台站新增暂时数据库加载数据方法
2024-01-26 15:21:34 +08:00
qiaoqinzheng
a730178204 新增加GPS谱数据的内容解析及保存 2024-01-26 10:39:59 +08:00
qiaoqinzheng
cf2fe9dd8e 自动处理错误谱文件修改名称方法内容修改 2024-01-26 10:38:55 +08:00
qiaoqinzheng
39348f16f3 自动处理文件名称重命名错误问题修改 2024-01-25 14:15:04 +08:00
qiaoqinzheng
8c5f85b499 查询统计核素方法新增标识判断是否已经存储过当前日期
查询统计核素方法返回内容移除全日期数据
2024-01-24 18:06:02 +08:00
qiaoqinzheng
e3e8a52344 台站运行管理台站接收状态线程台站id数组获取内容修改 2024-01-24 16:45:08 +08:00
qiaoqinzheng
a2ff824fc7 台站运行管理启动时增加查询所有用户最大缓存时间的方法
台站运行管理查询台站的运行状态接口根据用户设置的缓存时间进行结果切割返回
系统启动类新增加缓存台站id及台站id关联的探测器数组方法
台站运行管理数据状态线程向redis缓存过于频繁导致触发redis序列化错误问题修改
2024-01-24 14:12:14 +08:00
qiaoqinzheng
1aa68d4974 采集时间日期截取下标位置错误导致匹配失败问题修改 2024-01-23 19:42:56 +08:00
qiaoqinzheng
a6deb7c53f 新增获取时间范围内年月日小时的方法
统计横坐标根据时间范围内的年月日小时填充数据并回显
2024-01-23 19:24:23 +08:00
qiaoqinzheng
229d1980dd 台站运行管理初始化台站运行状态,台站运行效率新增过滤台站状态条件 2024-01-23 15:33:41 +08:00
qiaoqinzheng
f7677e56e2 同步mdc 2024-01-23 15:13:57 +08:00
qiaoqinzheng
35ac1ebf0c Merge remote-tracking branch 'origin/SelfStation' into SelfStation 2024-01-23 15:03:29 +08:00
qiaoqinzheng
5498e0e433 同步mdc 2024-01-23 15:03:21 +08:00
nieziyan
cc3c056bcf fix:findAutoPage增加参数sampleType 2024-01-23 14:20:45 +08:00
qiaoqinzheng
630bc4ee4f 探测器状态判断改为调用枚举类内容 2024-01-23 09:02:26 +08:00
qiaoqinzheng
d611bf1ff1 人工交互beta,gamma上传文件后删除本地文件操作移除 2024-01-23 08:55:08 +08:00
qiaoqinzheng
49dee87eed 同步mdc 2024-01-22 14:08:37 +08:00
qiaoqinzheng
d8e980fdb2 统计分析导出核素对比统计数据功能实现 2024-01-22 13:47:12 +08:00
qiaoqinzheng
680c263033 人工交互分析gamma部分baseline,lc,scac文件上传到ftp代码实现 2024-01-18 18:58:00 +08:00
qiaoqinzheng
90684089a1 人工交互存储gamma分析结果mdc数据如果已经存在数据需要删除对应的mdc结果后重新插入 2024-01-18 18:37:39 +08:00
qiaoqinzheng
df15a907e9 同步分支mdc 2024-01-18 17:50:52 +08:00
qiaoqinzheng
2f1f658d33 新增动态生成excel内容方法 2024-01-18 17:44:43 +08:00
qiaoqinzheng
b7c0553239 人工交互分析报告存放地址改为Rrr文件夹与Arr区分开 2024-01-18 14:06:19 +08:00
qiaoqinzheng
0d4deaf403 人工交互分析beta日志文件没有创建导致无法上传的问题修改 2024-01-18 11:43:23 +08:00
qiaoqinzheng
e159740d76 人工交互模块增加beta部分日志文件的存在情况判断,上传后的日志文件不进行删除 2024-01-18 10:35:56 +08:00
qiaoqinzheng
82713a8795 自建台站新增实体类存储公用的数据内容
自建台站返回内容增加det相关数据
web模块增加查询系统类型对应的配置核素信息
web模块增加查询系统类型对应的核素统计信息
人工交互模块增加beta部分日志文件的存在情况判断,上传后的日志文件不进行删除
2024-01-18 10:33:07 +08:00
qiaoqinzheng
ee2dd272d1 自建台站折线图ROI范围计算结果取值下标计算公式参数问题修改 2024-01-17 16:24:17 +08:00
qiaoqinzheng
9f8e79226e 台站运行管理查询台站,核设施列表排序问题修改,台站内容放置在核设施前并分别排序 2024-01-17 14:02:09 +08:00
qiaoqinzheng
1452be8f31 MDC分析结果存储改为字符串格式与数据库格式匹配 2024-01-16 19:01:08 +08:00
qiaoqinzheng
e33fc8df83 自建台站修改ROI返回接口改为put请求
自建台站实体类去掉多余参数
2024-01-16 17:08:50 +08:00
qiaoqinzheng
d1de32433e 自建台站已经加载过的数据再次加载页面数据丢失问题修改
人工交互beta保存日志路径,报告路径sql代码
2024-01-16 09:35:30 +08:00
qiaoqinzheng
eb3605d9e8 名称格式化文件增加beta使用的名称格式化方法 2024-01-15 19:32:39 +08:00
qiaoqinzheng
55f9cd49e1 人工交互beta,gamma存储并上传日志,报告文件 2024-01-15 19:30:07 +08:00
qiaoqinzheng
76acc20a7d 新增加自建台站系统类型判断,根据sample文件名称可以通过系统类型查询到关联的det文件类型
新增加查询台站运行轨迹方法
2024-01-15 19:23:43 +08:00
qiaoqinzheng
84d6c4a5a2 自动处理SOH,MET文件存储内容中如果是占位数据-999999存储时数据内容超出精度范围问题修改 2024-01-15 10:44:03 +08:00
qiaoqinzheng
16f59f0273 人工交互,自动处理启动时查询全核素信息方法修改 2024-01-12 15:56:16 +08:00
qiaoqinzheng
63576edde8 探测器新增代码同步 2024-01-11 18:26:12 +08:00
qiaoqinzheng
03955c3691 自建台站散点图G,B横纵坐标取值修改 2024-01-11 09:34:58 +08:00
qiaoqinzheng
8faa97d8f1 gamma分析部分生成报告内容中关于version描述区分颗粒物和气体
增加人工交互,自动处理启动时加载全核素信息方法
人工交互,自动处理启动时加载全核素信息方法调用接口类方法修改
2024-01-11 09:00:48 +08:00
qiaoqinzheng
3c4aae44e0 散点图B,G位置颠倒问题修改 2024-01-10 18:30:24 +08:00
qiaoqinzheng
ee3a04af2f 新增删除自建台站缓存接口 2024-01-10 15:47:15 +08:00
qiaoqinzheng
941c6c0685 ftp路径前多拼接了/导致文件找不到 2024-01-10 15:32:16 +08:00
qiaoqinzheng
cadbdb3ba9 人工交互新增自建台站相关实体类对象
人工交互新增自建台站管理代码
人工交互新增自建台站数据缓存对象
人工交互新增自建台站工具类
2024-01-10 11:40:50 +08:00
393 changed files with 18889 additions and 22018 deletions

View File

@ -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>

View File

@ -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";
}

View File

@ -41,4 +41,6 @@ public interface RedisConstant {
String EMAIL_MSG_ID = "email_msg_id";
String UNDEAL_FILE = "Undeal:";
String SELF_PARAMETER = "self_parameter";
}

View File

@ -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";
}

View File

@ -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组成例如nameversionvendorsupport-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;

View File

@ -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;
}
}

View File

@ -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);
}
}
}

View File

@ -26,4 +26,12 @@ public class ParameterProperties implements Serializable {
*/
private String dbPath;
private String SelfParameterFile;
private String MDCParameterFile;
private String SystemManagerFile;
private String parameterFile;
}

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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");
}

View File

@ -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)) {

View File

@ -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="";

View File

@ -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;

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -36,6 +36,4 @@ public class EmailDto implements Serializable {
private String username; // 邮箱用户名
private Integer isQiye; // 是否企业邮箱
private Integer emailServerType;
}

View File

@ -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;
}

View File

@ -0,0 +1,12 @@
package org.jeecg.modules.base.dto;
import lombok.Data;
@Data
public class RoiDto {
private Integer roiNum;
private String phdPath;
}

View File

@ -1,11 +0,0 @@
package org.jeecg.modules.base.dto;
import lombok.Data;
@Data
public class SampNucl {
private String sampleId;
private String nuclideName;
}

View File

@ -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(); }
}

View File

@ -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;
/**

View File

@ -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;
}

View File

@ -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")

View File

@ -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")

View File

@ -31,7 +31,7 @@ public class GardsMetData implements Serializable {
/**
* 气象数据id
*/
@TableId(type = IdType.AUTO)
@TableId(value = "MET_ID",type = IdType.AUTO)
private Integer metId;
/**

View File

@ -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;
}

View File

@ -27,7 +27,7 @@ public class GardsSampleData implements Serializable {
* 样品id
*/
@TableId(type = IdType.AUTO)
@TableId(value = "SAMPLE_ID",type = IdType.AUTO)
private Integer sampleId;
/**

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -94,6 +94,4 @@ public class SysEmail implements Serializable {
*/
@TableField(value = "update_by")
private String updateBy;
@TableField(value = "email_server_type")
private Integer emailServerType;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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;
/**
* Ggamma探测器的数据#g_Bbeta探测器的数据,#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;
}

View File

@ -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;
/**
* Ggamma探测器的数据#g_Bbeta探测器的数据,#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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
/**
* 主射线标识01
*/
@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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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;
/**
* Ggamma探测器的数据#g_Bbeta探测器的数据,#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;
}

View File

@ -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;
/**
* Ggamma探测器的数据#g_Bbeta探测器的数据,#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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
/**
* 主射线标识01
*/
@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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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()) {

View File

@ -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;

View File

@ -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))

View File

@ -13,7 +13,15 @@ public enum SystemType {
/**
* γ
*/
GAMMA("G");
GAMMA("G"),
/**
* 自建台站 β-γ
*/
SELFSTATION("C"),
/**
* 海水系统 γ
*/
WATER("W");
private String type;

View File

@ -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;
}
}

View File

@ -9,6 +9,6 @@ public class CommentData implements Serializable {
private String analyst;
private String comment;
private String comments;
}

View File

@ -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<>();
}
}

View File

@ -181,6 +181,8 @@ public class PHDFile implements Serializable {
private Map<String, NuclideLines> phdNuclideMap;
private String roiSuffix;
public PHDFile() {
userId = "";
xmlFilePath = "";

View File

@ -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<>();
}
}

View File

@ -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;
}

View File

@ -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<>();
}
}

View File

@ -10,5 +10,4 @@ public class SeriseData implements Serializable {
private double x;
private double y;
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 &lt; #{airFlow} ) or
</if>
<if test="decayTime != null">
(qc.qc_name = 'decay_time' and qc.qc_value &lt; #{decayTime} ) or
</if>
<if test="sampVol != null">
(qc.qc_name = 'samp_vol' and qc.qc_value &lt; #{sampVol} ) or
</if>
<if test="be7FWHM != null">
(qc.qc_name = 'Be7-FWHM' and qc.qc_value &lt; #{be7FWHM} ) or
</if>
<if test="ba140MDC != null">
(qc.qc_name = 'Ba140-MDC' and qc.qc_value &lt; #{ba140MDC} ) or
</if>
<if test="xe133MDC != null">
(qc.qc_name = 'Xe133-MDC' and qc.qc_value &lt; #{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 &gt; n.MDC
GROUP BY
NUCLIDENAME
</select>
</mapper>

View File

@ -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 &lt; #{airFlow} ) or
</if>
<if test="decayTime != null">
(qc.qc_name = 'decay_time' and qc.qc_value &lt; #{decayTime} ) or
</if>
<if test="sampVol != null">
(qc.qc_name = 'samp_vol' and qc.qc_value &lt; #{sampVol} ) or
</if>
<if test="be7FWHM != null">
(qc.qc_name = 'Be7-FWHM' and qc.qc_value &lt; #{be7FWHM} ) or
</if>
<if test="ba140MDC != null">
(qc.qc_name = 'Ba140-MDC' and qc.qc_value &lt; #{ba140MDC} ) or
</if>
<if test="xe133MDC != null">
(qc.qc_name = 'Xe133-MDC' and qc.qc_value &lt; #{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 &gt; n.MDC
GROUP BY
NUCLIDENAME
</select>
</mapper>

View File

@ -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 &gt; #{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>

View File

@ -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>

View File

@ -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

View File

@ -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(){

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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>

View File

@ -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);

View File

@ -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();
}
}
}

View File

@ -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);
}
}

View File

@ -0,0 +1,12 @@
package org.jeecg.modules.exception;
/*
GPS文件读取失败时抛出异常
*/
public class GPSFileReadException extends RuntimeException{
public GPSFileReadException(String message) {
super(message);
}
}

View File

@ -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