设备报警 mes端完成

yun-zuoyi
wynne1005 5 years ago
parent 8129ca5bee
commit 814d22fe09

@ -47,4 +47,12 @@ public class MesTaktAlarmContinuousConfig extends BaseBean implements Serializab
@ApiParam("发生次数")
private Integer continuousCount;
@Column(name = "IS_STOP_LINE")
@ApiParam("是否停线")
private Integer isStopLine;
@Column(name = "IS_TRIGGER_ANDON")
@ApiParam("是否触发安灯")
private Integer isTriggerAndon;
}

@ -49,7 +49,11 @@ public class MesTaktAlarmRecord extends BaseBean implements Serializable {
@ApiParam("节拍 秒数")
private Integer taktSecond;
@Column(name = "IS_ABNORMAL")
@ApiParam("是否异常")
private Integer isAbnormal = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@Column(name = "LEVEL_CODE")
@ApiParam("异常等级")
private String levelCode;
@Column(name = "IS_PROCESSED")
@ApiParam("异常等级")
private Integer isProcessed = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
}

@ -0,0 +1,41 @@
package cn.estsh.i3plus.pojo.mes.model;
import cn.estsh.i3plus.pojo.mes.bean.MesTaktAlarmRecord;
import lombok.Data;
import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
/**
* @author Wynne.Lu
* @date 2020/9/28 13:26
* @desc
*/
@Data
public class AlarmMessage implements Delayed {
private MesTaktAlarmRecord taktAlarmRecord;
private long time;
public AlarmMessage(MesTaktAlarmRecord taktAlarmRecord, long time, TimeUnit unit) {
this.taktAlarmRecord = taktAlarmRecord;
this.time = System.currentTimeMillis() + (time > 0 ? unit.toMillis(time) : 0);
}
@Override
public long getDelay(TimeUnit unit) {
return time - System.currentTimeMillis();
}
@Override
public int compareTo(Delayed o) {
AlarmMessage alarmMessage = (AlarmMessage) o;
long diff = this.time - alarmMessage.time;
if (diff <= 0) {
return -1;
} else {
return 1;
}
}
}
Loading…
Cancel
Save