Commit 529ebae2 by 王衍超

预警执行记录增加实际值字段;

parent 252ef90a
...@@ -121,11 +121,13 @@ public class BaseBusinessWarn { ...@@ -121,11 +121,13 @@ public class BaseBusinessWarn {
if(!isWarning) return false;//1.1 没有触发预警, 则不做任何操作; if(!isWarning) return false;//1.1 没有触发预警, 则不做任何操作;
//1.2 新增预警执行信息 //1.2 新增预警执行信息
warnExeRecord = createWarnExeRecord(warnSetting); warnExeRecord = createWarnExeRecord(warnSetting);
warnExeRecord.setActualValue(warningCalculate.getActualValue());
warningSettingService.insertWarnExe(warnExeRecord); warningSettingService.insertWarnExe(warnExeRecord);
}else { }else {
//2.当前存在执行中的预警记录,则修改预警执行信息 //2.当前存在执行中的预警记录,则修改预警执行信息
Date currentTime = new Date(); Date currentTime = new Date();
warnExeRecord.setRecentlyTime(currentTime); warnExeRecord.setRecentlyTime(currentTime);
warnExeRecord.setActualValue(warningCalculate.getActualValue());
if(!isWarning) {//2.1 如果没有触发预警,则结束该预警记录 if(!isWarning) {//2.1 如果没有触发预警,则结束该预警记录
//如果预警已经结束,则不修改 //如果预警已经结束,则不修改
if((WarnStateEnum.OVER.getValue()+"").equals(warnExeRecord.getWarnState())){ if((WarnStateEnum.OVER.getValue()+"").equals(warnExeRecord.getWarnState())){
......
...@@ -7,10 +7,25 @@ package com.xyst.dinas.biz.warn; ...@@ -7,10 +7,25 @@ package com.xyst.dinas.biz.warn;
*/ */
public interface IWarningCalculate { public interface IWarningCalculate {
/**
* 计算是否预警
* @param warnSetting
* @return
*/
boolean isWarning(WarnSetting warnSetting); boolean isWarning(WarnSetting warnSetting);
/**
* 预警消息
* @return
*/
String warnMessage(); String warnMessage();
/**
* 实际值
* @return
*/
String getActualValue();
//boolean isRepeat();重复执行 //boolean isRepeat();重复执行
......
...@@ -24,11 +24,18 @@ public class WarnExeRecord { ...@@ -24,11 +24,18 @@ public class WarnExeRecord {
private String target; private String target;
private String max; private String max;
private String min; private String min;
private String actualValue;
private String message; private String message;
private String memo; private String memo;
public String getActualValue() {
return actualValue;
}
public void setActualValue(String actualValue) {
this.actualValue = actualValue;
}
public Long getVersion() { public Long getVersion() {
return version; return version;
} }
......
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
<attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='min' columnName='min' title='指标下限' type='string' default='' precision='' isArray='false'> <attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='min' columnName='min' title='指标下限' type='string' default='' precision='' isArray='false'>
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='100'></annotation> <annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='100'></annotation>
</attribute> </attribute>
<attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='actualValue' columnName='actual_value' title='实际值' type='string' default='' precision='' isArray='false'>
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='100'></annotation>
</attribute>
<attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='memo' columnName='memo' title='备注' type='string' default='' precision='' isArray='false'> <attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='memo' columnName='memo' title='备注' type='string' default='' precision='' isArray='false'>
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='1000'></annotation> <annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='1000'></annotation>
</attribute> </attribute>
......
...@@ -258,6 +258,29 @@ ...@@ -258,6 +258,29 @@
<m:annotations> <m:annotations>
<m:annotation> <m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type> <m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>actual_value</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>cbb5b983-299b-4259-97d9-6470651bb18b</m:id>
<m:name>actualValue</m:name>
<m:title>实际值</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>1000</m:value> <m:value>1000</m:value>
</m:annotation> </m:annotation>
<m:annotation> <m:annotation>
......
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
<property name="min" type="nstring" not-null="false"> <property name="min" type="nstring" not-null="false">
<column name="min" length="100"></column> <column name="min" length="100"></column>
</property> </property>
<property name="actualValue" type="nstring" not-null="false">
<column name="actual_value" length="100"></column>
</property>
<property name="discard" type="boolean" not-null="false"> <property name="discard" type="boolean" not-null="false">
<column name="discard"></column> <column name="discard"></column>
</property> </property>
......
...@@ -53,4 +53,10 @@ public class DinasCountWarningCalculate implements IWarningCalculate{ ...@@ -53,4 +53,10 @@ public class DinasCountWarningCalculate implements IWarningCalculate{
public String warnMessage() { public String warnMessage() {
return warnMessage; return warnMessage;
} }
@Override
public String getActualValue() {
return dinsaCount+"";
}
} }
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</ref> </ref>
<description></description> <description></description>
</field> </field>
<field title='实际值'> <field title='预警值'>
<name>min</name> <name>min</name>
<type>string</type> <type>string</type>
<ref> <ref>
...@@ -86,6 +86,15 @@ ...@@ -86,6 +86,15 @@
</ref> </ref>
<description></description> <description></description>
</field> </field>
<field title='实际值'>
<name>actualValue</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='创建时间'> <field title='创建时间'>
<name>createTime</name> <name>createTime</name>
<type>datetime</type> <type>datetime</type>
......
...@@ -91,6 +91,16 @@ ...@@ -91,6 +91,16 @@
</m:field> </m:field>
<m:field> <m:field>
<m:name>min</m:name> <m:name>min</m:name>
<m:title>预警值</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>actualValue</m:name>
<m:title>实际值</m:title> <m:title>实际值</m:title>
<m:type>string</m:type> <m:type>string</m:type>
<m:ref> <m:ref>
......
...@@ -61,4 +61,10 @@ public class SandAreaDinasCountWarningCalculate implements IWarningCalculate{ ...@@ -61,4 +61,10 @@ public class SandAreaDinasCountWarningCalculate implements IWarningCalculate{
} }
@Override
public String getActualValue() {
return dischargingWeight+"";
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment