Commit 529ebae2 by 王衍超

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

parent 252ef90a
......@@ -121,11 +121,13 @@ public class BaseBusinessWarn {
if(!isWarning) return false;//1.1 没有触发预警, 则不做任何操作;
//1.2 新增预警执行信息
warnExeRecord = createWarnExeRecord(warnSetting);
warnExeRecord.setActualValue(warningCalculate.getActualValue());
warningSettingService.insertWarnExe(warnExeRecord);
}else {
//2.当前存在执行中的预警记录,则修改预警执行信息
Date currentTime = new Date();
warnExeRecord.setRecentlyTime(currentTime);
warnExeRecord.setActualValue(warningCalculate.getActualValue());
if(!isWarning) {//2.1 如果没有触发预警,则结束该预警记录
//如果预警已经结束,则不修改
if((WarnStateEnum.OVER.getValue()+"").equals(warnExeRecord.getWarnState())){
......
......@@ -7,10 +7,25 @@ package com.xyst.dinas.biz.warn;
*/
public interface IWarningCalculate {
/**
* 计算是否预警
* @param warnSetting
* @return
*/
boolean isWarning(WarnSetting warnSetting);
/**
* 预警消息
* @return
*/
String warnMessage();
/**
* 实际值
* @return
*/
String getActualValue();
//boolean isRepeat();重复执行
......
......@@ -24,11 +24,18 @@ public class WarnExeRecord {
private String target;
private String max;
private String min;
private String actualValue;
private String message;
private String memo;
public String getActualValue() {
return actualValue;
}
public void setActualValue(String actualValue) {
this.actualValue = actualValue;
}
public Long getVersion() {
return version;
}
......
......@@ -46,6 +46,9 @@
<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>
</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'>
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='1000'></annotation>
</attribute>
......
......@@ -258,6 +258,29 @@
<m:annotations>
<m:annotation>
<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:annotation>
<m:annotation>
......
......@@ -47,6 +47,9 @@
<property name="min" type="nstring" not-null="false">
<column name="min" length="100"></column>
</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">
<column name="discard"></column>
</property>
......
......@@ -53,4 +53,10 @@ public class DinasCountWarningCalculate implements IWarningCalculate{
public String warnMessage() {
return warnMessage;
}
@Override
public String getActualValue() {
return dinsaCount+"";
}
}
......@@ -77,7 +77,7 @@
</ref>
<description></description>
</field>
<field title='实际值'>
<field title='预警值'>
<name>min</name>
<type>string</type>
<ref>
......@@ -86,6 +86,15 @@
</ref>
<description></description>
</field>
<field title='实际值'>
<name>actualValue</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='创建时间'>
<name>createTime</name>
<type>datetime</type>
......
......@@ -91,6 +91,16 @@
</m:field>
<m:field>
<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:type>string</m:type>
<m:ref>
......
......@@ -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