Compare commits

..

No commits in common. "3761c0debaecb588e18d71d553e47ad5ce91c981" and "8768a2b566cbd41d82e3f33ce1c3c760ec0c285f" have entirely different histories.

8 changed files with 133 additions and 195 deletions

View File

@ -88,7 +88,6 @@ public class AlarmAnalysisRule extends JeecgEntity {
private Integer days; private Integer days;
@TableField(value = "identify_nuclides", updateStrategy = FieldStrategy.IGNORED)
private String identifyNuclides; private String identifyNuclides;
/** 备注 */ /** 备注 */
private String remark; private String remark;

View File

@ -15,7 +15,6 @@ public class NucliedAvgJob implements Job{
@Override @Override
@Scheduled(cron = "${task.period-avg:0 2 0 * * ?}") @Scheduled(cron = "${task.period-avg:0 2 0 * * ?}")
// @Scheduled(cron = "${task.period-avg:0/59 0/1 * * * ? }")
public void execute() { public void execute() {
calculateConcService.calcAndSave(); calculateConcService.calcAndSave();
} }

View File

@ -12,7 +12,7 @@
INNER JOIN RNAUTO.GARDS_ANALYSES ana ON ana.IDANALYSIS = nucl.IDANALYSIS 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 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 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') ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
AND to_date(#{endDate},'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.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
@ -24,37 +24,31 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="(colTime != null and colTime.size() > 0) || (acqTime != null and acqTime.size() > 0) || <if test="colTime != null and colTime.size() > 0">
airFlow != null || decayTime != null || sampVol != null || be7FWHM != null || ba140MDC != null || xe133MDC != null"> AND (qc.qc_name = 'col_time' and qc.qc_value between #{colTime[0]} and #{colTime[1]} )
<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> </if>
<if test="acqTime != null and acqTime.size() > 0">
</trim> AND (qc.qc_name = 'acq_time' and qc.qc_value between #{acqTime[0]} and #{acqTime[1]} )
</if>
<if test="airFlow != null">
AND (qc.qc_name = 'air_flow' and qc.qc_value &lt; #{airFlow} )
</if>
<if test="decayTime != nul">
AND (qc.qc_name = 'decay_time' and qc.qc_value &lt; #{decayTime} )
</if>
<if test="sampVol != null">
AND (qc.qc_name = 'samp_vol' and qc.qc_value &lt; #{sampVol} )
</if>
<if test="be7FWHM != null">
AND (qc.qc_name = 'Be7-FWHM' and qc.qc_value &lt; #{be7FWHM} )
</if>
<if test="ba140MDC != null">
AND (qc.qc_name = 'Ba140-MDC' and qc.qc_value &lt; #{ba140MDC} )
</if>
<if test="xe133MDC != null">
AND (qc.qc_name = 'Xe133-MDC' and qc.qc_value &lt; #{xe133MDC} )
</if>
</where>
</select> </select>
<select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl"> <select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl">
SELECT SELECT

View File

@ -24,34 +24,29 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="(colTime != null and colTime.size() > 0) || (acqTime != null and acqTime.size() > 0) || <if test="colTime != null and colTime.size() > 0">
airFlow != null || decayTime != null || sampVol != null || be7FWHM != null || ba140MDC != null || xe133MDC != null"> AND (qc.qc_name = 'col_time' and qc.qc_value between #{colTime[0]} and #{colTime[1]} )
<trim prefix="and(" suffixOverrides="or" suffix=")"> </if>
<if test="colTime != null and colTime.size() > 0"> <if test="acqTime != null and acqTime.size() > 0">
(qc.qc_name = 'col_time' and qc.qc_value between #{colTime[0]} and #{colTime[1]} ) or AND (qc.qc_name = 'acq_time' and qc.qc_value between #{acqTime[0]} and #{acqTime[1]} )
</if> </if>
<if test="acqTime != null and acqTime.size() > 0"> <if test="airFlow != null">
(qc.qc_name = 'acq_time' and qc.qc_value = #{acqTime[0]}) or AND (qc.qc_name = 'air_flow' and qc.qc_value &lt; #{airFlow} )
</if> </if>
<if test="airFlow != null"> <if test="decayTime != nul">
(qc.qc_name = 'airFlow' and qc.qc_value &lt; #{airFlow} ) or AND (qc.qc_name = 'decay_time' and qc.qc_value &lt; #{decayTime} )
</if> </if>
<if test="decayTime != null"> <if test="sampVol != null">
(qc.qc_name = 'decay_time' and qc.qc_value &lt; #{decayTime} ) or AND (qc.qc_name = 'samp_vol' and qc.qc_value &lt; #{sampVol} )
</if> </if>
<if test="sampVol != null"> <if test="be7FWHM != null">
(qc.qc_name = 'samp_vol' and qc.qc_value &lt; #{sampVol} ) or AND (qc.qc_name = 'Be7-FWHM' and qc.qc_value &lt; #{be7FWHM} )
</if> </if>
<if test="be7FWHM != null"> <if test="ba140MDC != null">
(qc.qc_name = 'Be7-FWHM' and qc.qc_value &lt; #{be7FWHM} ) or AND (qc.qc_name = 'Ba140-MDC' and qc.qc_value &lt; #{ba140MDC} )
</if> </if>
<if test="ba140MDC != null"> <if test="xe133MDC != null">
(qc.qc_name = 'Ba140-MDC' and qc.qc_value &lt; #{ba140MDC} ) or AND (qc.qc_name = 'Xe133-MDC' and qc.qc_value &lt; #{xe133MDC} )
</if>
<if test="xe133MDC != null">
(qc.qc_name = 'Xe133-MDC' and qc.qc_value &lt; #{xe133MDC} ) or
</if>
</trim>
</if> </if>
</where> </where>
</select> </select>

View File

@ -2,78 +2,53 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <mapper namespace="org.jeecg.modules.mapper.GardsXeResultsAutoMapper">
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe"> <select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe">
SELECT * FROM ( SELECT
SELECT DISTINCT samp.SAMPLE_ID,
samp.SAMPLE_ID,
xe.NUCLIDE_NAME, xe.NUCLIDE_NAME,
xe.CONC, xe.CONC,
ana.ANALYSISBEGIN, ana.ANALYSISBEGIN
xe.NID_FLAG FROM
FROM
RNAUTO.GARDS_XE_RESULTS xe RNAUTO.GARDS_XE_RESULTS xe
INNER JOIN RNAUTO.GARDS_ANALYSES ana ON ana.IDANALYSIS = xe.IDANALYSIS 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_DATA samp ON samp.SAMPLE_ID = xe.SAMPLE_ID
INNER JOIN ORIGINAL.GARDS_SAMPLE_AUX aux ON samp.SAMPLE_ID = aux.SAMPLE_ID INNER JOIN ORIGINAL.GARDS_SAMPLE_AUX aux ON samp.SAMPLE_ID = aux.SAMPLE_ID
<where> <where>
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss') ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
AND to_date(#{endDate},'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.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
AND samp.STATION_ID = #{stationId} AND samp.STATION_ID = #{stationId}
AND samp.SPECTRAL_QUALIFIE = 'FULL' AND samp.SPECTRAL_QUALIFIE = 'FULL'
<if test="nuclideName != null and nuclideName.size() > 0"> <if test="nuclideName != null and nuclideName.size() > 0">
AND xe.NUCLIDE_NAME IN AND xe.NUCLIDE_NAME IN
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=","> <foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="colTime != null and colTime.size() > 0"> <if test="colTime != null and colTime.size() > 0">
and ((TO_NUMBER(samp.COLLECT_STOP - samp.COLLECT_START) * 24) between #{colTime[0]} and #{colTime[1]} ) and ((TO_NUMBER(samp.COLLECT_STOP - samp.COLLECT_START) * 24) between #{colTime[0]} and #{colTime[1]} )
</if> </if>
<if test="acqTime != null and acqTime.size() > 0"> <if test="acqTime != null and acqTime.size() > 0">
and (samp.ACQUISITION_LIVE_SEC / 3600 between #{colTime[0]} and #{colTime[1]} ) and (samp.ACQUISITION_LIVE_SEC / 3600 between #{colTime[0]} and #{colTime[1]} )
</if> </if>
<if test="XeVol != null"> <if test="XeVol != null">
AND (aux.XE_VOLUME &gt; #{XeVol} ) AND (aux.XE_VOLUME &gt; #{XeVol} )
</if> </if>
<if test="Xe133MDC != null and Xe133MDC.size() > 0"> <if test="Xe133MDC != null and Xe133MDC.size() > 0">
AND (xe.NUCLIDE_NAME = 'Xe133m' AND MDC between #{Xe133MDC[0]} AND #{Xe133MDC[1]} ) AND (xe.NUCLIDE_NAME = 'Xe133m' AND MDC between #{Xe133MDC[0]} AND #{Xe133MDC[1]} )
</if> </if>
</where> <if test="Xe133mFlag != null">
) a AND (xe.NUCLIDE_NAME = 'Xe133m' AND xe.NID_FLAG = 1 )
<trim prefix="where" suffixOverrides="or"> </if>
<choose> <if test="Xe133Flag != null">
<when test="Xe133mFlag != null"> AND (xe.NUCLIDE_NAME = 'Xe133' AND xe.NID_FLAG = 1 )
(a.NUCLIDE_NAME = 'Xe133m' AND a.NID_FLAG = 1 ) or </if>
</when> <if test="Xe131mFlag != null">
<otherwise> AND (xe.NUCLIDE_NAME = 'Xe131m' AND xe.NID_FLAG = 1 )
(a.NUCLIDE_NAME = 'Xe133m' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or </if>
</otherwise> <if test="Xe135Flag != null ">
</choose> AND (xe.NUCLIDE_NAME = 'Xe135' AND xe.NID_FLAG = 1 )
<choose> </if>
<when test="Xe133Flag != null"> </where>
(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>
<select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl"> <select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl">
SELECT SELECT

View File

@ -2,66 +2,41 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <mapper namespace="org.jeecg.modules.mapper.GardsXeResultsManMapper">
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe"> <select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe">
SELECT * FROM ( SELECT
SELECT DISTINCT samp.SAMPLE_ID,
samp.SAMPLE_ID,
xe.NUCLIDE_NAME, xe.NUCLIDE_NAME,
xe.CONC, xe.CONC,
ana.ANALYSISBEGIN, ana.ANALYSISBEGIN
xe.NID_FLAG FROM
FROM
RNMAN.GARDS_XE_RESULTS xe RNMAN.GARDS_XE_RESULTS xe
INNER JOIN RNMAN.GARDS_ANALYSES ana ON ana.IDANALYSIS = xe.IDANALYSIS 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_DATA samp ON samp.SAMPLE_ID = xe.SAMPLE_ID
INNER JOIN ORIGINAL.GARDS_SAMPLE_AUX aux ON samp.SAMPLE_ID = aux.SAMPLE_ID INNER JOIN ORIGINAL.GARDS_SAMPLE_AUX aux ON samp.SAMPLE_ID = aux.SAMPLE_ID
<where> <where>
ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss') ana.ANALYSISBEGIN BETWEEN to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
AND to_date(#{endDate},'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.DATA_TYPE = 'S' AND samp.STATUS IN ('P', 'R')
AND samp.STATION_ID = #{stationId} AND samp.STATION_ID = #{stationId}
AND samp.SPECTRAL_QUALIFIE = 'FULL' AND samp.SPECTRAL_QUALIFIE = 'FULL'
<if test="nuclideName != null and nuclideName.size() > 0"> <if test="nuclideName != null and nuclideName.size() > 0">
AND xe.NUCLIDE_NAME IN AND xe.NUCLIDE_NAME IN
<foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=","> <foreach collection="nuclideName" open="(" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where> <if test="colTime != null and colTime.size() > 0">
)a and ((TO_NUMBER(samp.COLLECT_STOP - samp.COLLECT_START) * 24) between #{colTime[0]} and #{colTime[1]} )
<trim prefix="where" suffixOverrides="or"> </if>
<choose> <if test="acqTime != null and acqTime.size() > 0">
<when test="Xe133mFlag != null"> and (samp.ACQUISITION_LIVE_SEC / 3600 between #{colTime[0]} and #{colTime[1]} )
(a.NUCLIDE_NAME = 'Xe133m' AND a.NID_FLAG = 1 ) or </if>
</when> <if test="XeVol != null">
<otherwise> AND (aux.XE_VOLUME &gt; #{XeVol} )
(a.NUCLIDE_NAME = 'Xe133m' AND (a.NID_FLAG = 1 AND a.NID_FLAG = 0) ) or </if>
</otherwise> <if test="Xe133MDC != null and Xe133MDC.size() > 0">
</choose> AND (xe.NUCLIDE_NAME = 'Xe133m' AND MDC between #{Xe133MDC[0]} AND #{Xe133MDC[1]} )
<choose> </if>
<when test="Xe133Flag != null"> </where>
(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>
<select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl"> <select id="sampNucl" resultType="org.jeecg.modules.base.dto.SampNucl">
SELECT SELECT

View File

@ -92,7 +92,7 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
redisStreamUtil.del(streamKey, recordId.getValue()); redisStreamUtil.del(streamKey, recordId.getValue());
} }
}catch (Exception e){ }catch (Exception e){
log.error("AnalysisConsumer消费异常: ", e); log.error("AnalysisConsumer消费异常: {}", e.getMessage());
}finally { }finally {
destroy(); destroy();
} }
@ -145,11 +145,9 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
info.setRuleId(rule.getId()); info.setRuleId(rule.getId());
info.setGroupId(rule.getContactGroup()); info.setGroupId(rule.getContactGroup());
info.setConditions(rule.getConditions()); info.setConditions(rule.getConditions());
if (null != rule.getIdentifyNuclides()) { String[] inSplit = rule.getIdentifyNuclides().split(",");
String[] inSplit = rule.getIdentifyNuclides().split(","); if (inSplit.length > 1) {
if (inSplit.length >= 1) { info.setIdentifyNuclideSet(Arrays.stream(inSplit).map(f->f.replace("M", "m")).collect(Collectors.toSet()));
info.setIdentifyNuclideSet(Arrays.stream(inSplit).map(f->f.replace("M", "m")).collect(Collectors.toSet()));
}
} }
judge(info, nuclidesCross); judge(info, nuclidesCross);
} }
@ -184,6 +182,9 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
moreThanAvg = this.moreThanAvg(datasource, stationId, collDate, nuclidesCross); moreThanAvg = this.moreThanAvg(datasource, stationId, collDate, nuclidesCross);
break; break;
case MEANWHILE: // 同时出现两种及以上核素 case MEANWHILE: // 同时出现两种及以上核素
for (String nuclideName : nuclideNames) {
nuclideNames.add(nuclideName.replace("m","M"));
}
meanWhile = this.meanWhile(betaOrGamma, datasource, sampleId, nuclideNames); meanWhile = this.meanWhile(betaOrGamma, datasource, sampleId, nuclideNames);
if (meanWhile.size() < 2) meanWhile = ListUtil.empty(); if (meanWhile.size() < 2) meanWhile = ListUtil.empty();
break; break;

View File

@ -153,9 +153,9 @@ public class AlarmAnalysisRuleServiceImpl extends ServiceImpl<AlarmAnalysisRuleM
String id = alarmAnalysisRule.getId(); String id = alarmAnalysisRule.getId();
String name = alarmAnalysisRule.getName(); String name = alarmAnalysisRule.getName();
String original = getById(id).getName(); String original = getById(id).getName();
if (null != alarmAnalysisRule.getIdentifyNuclides() && !alarmAnalysisRule.getConditions().contains("4")) { if (null != alarmAnalysisRule.getIdentifyNuclides()) {
alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions() + ",4"); alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions() + ",4");
} else if(null == alarmAnalysisRule.getIdentifyNuclides() && !alarmAnalysisRule.getConditions().contains("4")) { } else {
alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions().replace("4", "")); alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions().replace("4", ""));
} }
if (!StrUtil.equalsIgnoreCase(name,original)){ if (!StrUtil.equalsIgnoreCase(name,original)){