Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-zy
This commit is contained in:
commit
b3b749ca80
10
sql/20230421-thesai-rts_alarm_tips.sql
Normal file
10
sql/20230421-thesai-rts_alarm_tips.sql
Normal file
@ -0,0 +1,10 @@
|
||||
CREATE TABLE `rts_alarm_tips` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
`alarm_type` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`alarm_level` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`tips` varchar(10000) COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`updater_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `alarm` (`alarm_type`,`alarm_level`) COMMENT '用以保证提示信息唯一'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='ATS报警信息提示';
|
@ -0,0 +1,71 @@
|
||||
package club.joylink.rtss.controller.alarm;
|
||||
|
||||
import club.joylink.rtss.entity.AlarmTips;
|
||||
import club.joylink.rtss.services.alarm.AlarmTipsService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.alarm.AlarmQueryVO;
|
||||
import club.joylink.rtss.vo.alarm.AlarmTipsCreateVO;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报警提示信息配置管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/alarm")
|
||||
public class AlarmTipsController {
|
||||
@Autowired
|
||||
private AlarmTipsService alarmTipsService;
|
||||
|
||||
/**
|
||||
* 创建提示信息
|
||||
*/
|
||||
@PostMapping("")
|
||||
public void create(@RequestBody AlarmTipsCreateVO alarmTipsCreateVO, @RequestAttribute AccountVO user) {
|
||||
alarmTipsService.create(alarmTipsCreateVO, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 单条查询
|
||||
*/
|
||||
@GetMapping("")
|
||||
public AlarmTips get(AlarmQueryVO queryVO) {
|
||||
return alarmTipsService.get(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<AlarmTips> list() {
|
||||
return alarmTipsService.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public PageVO<AlarmTips> page(PageQueryVO queryVO) {
|
||||
return alarmTipsService.page(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
public void update(@PathVariable Long id, @RequestBody AlarmTipsCreateVO createVO, @RequestAttribute AccountVO user) {
|
||||
alarmTipsService.update(id, createVO, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
alarmTipsService.delete(id);
|
||||
}
|
||||
}
|
@ -86,8 +86,8 @@ public class SimulationTrainingV2Controller {
|
||||
* 客户端步骤完成后操作回调
|
||||
*/
|
||||
@PutMapping("/{group}/completion/step/{stepId}/operation/{id}")
|
||||
public Integer completionClientStepOperation(@PathVariable String group, @PathVariable Integer stepId
|
||||
, @PathVariable Integer id, @RequestAttribute AccountVO user) {
|
||||
public Integer completionClientStepOperation(@PathVariable String group, @PathVariable Long stepId
|
||||
, @PathVariable Long id, @RequestAttribute AccountVO user) {
|
||||
return training2Service.completionClientStepOperation(group, stepId, id, user);
|
||||
}
|
||||
|
||||
|
12
src/main/java/club/joylink/rtss/dao/AlarmTipsDAO.java
Normal file
12
src/main/java/club/joylink/rtss/dao/AlarmTipsDAO.java
Normal file
@ -0,0 +1,12 @@
|
||||
package club.joylink.rtss.dao;
|
||||
|
||||
import club.joylink.rtss.entity.AlarmTips;
|
||||
import club.joylink.rtss.entity.AlarmTipsExample;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* AlarmTipsDAO继承基类
|
||||
*/
|
||||
@Repository
|
||||
public interface AlarmTipsDAO extends MyBatisBaseDao<AlarmTips, Long, AlarmTipsExample> {
|
||||
}
|
122
src/main/java/club/joylink/rtss/entity/AlarmTips.java
Normal file
122
src/main/java/club/joylink/rtss/entity/AlarmTips.java
Normal file
@ -0,0 +1,122 @@
|
||||
package club.joylink.rtss.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* ATS报警信息提示
|
||||
*/
|
||||
public class AlarmTips implements Serializable {
|
||||
private Long id;
|
||||
|
||||
private String alarmType;
|
||||
|
||||
private String alarmLevel;
|
||||
|
||||
private String tips;
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private Long updaterId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAlarmType() {
|
||||
return alarmType;
|
||||
}
|
||||
|
||||
public void setAlarmType(String alarmType) {
|
||||
this.alarmType = alarmType;
|
||||
}
|
||||
|
||||
public String getAlarmLevel() {
|
||||
return alarmLevel;
|
||||
}
|
||||
|
||||
public void setAlarmLevel(String alarmLevel) {
|
||||
this.alarmLevel = alarmLevel;
|
||||
}
|
||||
|
||||
public String getTips() {
|
||||
return tips;
|
||||
}
|
||||
|
||||
public void setTips(String tips) {
|
||||
this.tips = tips;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Long getUpdaterId() {
|
||||
return updaterId;
|
||||
}
|
||||
|
||||
public void setUpdaterId(Long updaterId) {
|
||||
this.updaterId = updaterId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AlarmTips other = (AlarmTips) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getAlarmType() == null ? other.getAlarmType() == null : this.getAlarmType().equals(other.getAlarmType()))
|
||||
&& (this.getAlarmLevel() == null ? other.getAlarmLevel() == null : this.getAlarmLevel().equals(other.getAlarmLevel()))
|
||||
&& (this.getTips() == null ? other.getTips() == null : this.getTips().equals(other.getTips()))
|
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
|
||||
&& (this.getUpdaterId() == null ? other.getUpdaterId() == null : this.getUpdaterId().equals(other.getUpdaterId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getAlarmType() == null) ? 0 : getAlarmType().hashCode());
|
||||
result = prime * result + ((getAlarmLevel() == null) ? 0 : getAlarmLevel().hashCode());
|
||||
result = prime * result + ((getTips() == null) ? 0 : getTips().hashCode());
|
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
|
||||
result = prime * result + ((getUpdaterId() == null) ? 0 : getUpdaterId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", alarmType=").append(alarmType);
|
||||
sb.append(", alarmLevel=").append(alarmLevel);
|
||||
sb.append(", tips=").append(tips);
|
||||
sb.append(", updateTime=").append(updateTime);
|
||||
sb.append(", updaterId=").append(updaterId);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
613
src/main/java/club/joylink/rtss/entity/AlarmTipsExample.java
Normal file
613
src/main/java/club/joylink/rtss/entity/AlarmTipsExample.java
Normal file
@ -0,0 +1,613 @@
|
||||
package club.joylink.rtss.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlarmTipsExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
private Integer limit;
|
||||
|
||||
private Long offset;
|
||||
|
||||
public AlarmTipsExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
public void setLimit(Integer limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public Integer getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setOffset(Long offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public Long getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeIsNull() {
|
||||
addCriterion("alarm_type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeIsNotNull() {
|
||||
addCriterion("alarm_type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeEqualTo(String value) {
|
||||
addCriterion("alarm_type =", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeNotEqualTo(String value) {
|
||||
addCriterion("alarm_type <>", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeGreaterThan(String value) {
|
||||
addCriterion("alarm_type >", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("alarm_type >=", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeLessThan(String value) {
|
||||
addCriterion("alarm_type <", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("alarm_type <=", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeLike(String value) {
|
||||
addCriterion("alarm_type like", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeNotLike(String value) {
|
||||
addCriterion("alarm_type not like", value, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeIn(List<String> values) {
|
||||
addCriterion("alarm_type in", values, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeNotIn(List<String> values) {
|
||||
addCriterion("alarm_type not in", values, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeBetween(String value1, String value2) {
|
||||
addCriterion("alarm_type between", value1, value2, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("alarm_type not between", value1, value2, "alarmType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelIsNull() {
|
||||
addCriterion("alarm_level is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelIsNotNull() {
|
||||
addCriterion("alarm_level is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelEqualTo(String value) {
|
||||
addCriterion("alarm_level =", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelNotEqualTo(String value) {
|
||||
addCriterion("alarm_level <>", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelGreaterThan(String value) {
|
||||
addCriterion("alarm_level >", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("alarm_level >=", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelLessThan(String value) {
|
||||
addCriterion("alarm_level <", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelLessThanOrEqualTo(String value) {
|
||||
addCriterion("alarm_level <=", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelLike(String value) {
|
||||
addCriterion("alarm_level like", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelNotLike(String value) {
|
||||
addCriterion("alarm_level not like", value, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelIn(List<String> values) {
|
||||
addCriterion("alarm_level in", values, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelNotIn(List<String> values) {
|
||||
addCriterion("alarm_level not in", values, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelBetween(String value1, String value2) {
|
||||
addCriterion("alarm_level between", value1, value2, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAlarmLevelNotBetween(String value1, String value2) {
|
||||
addCriterion("alarm_level not between", value1, value2, "alarmLevel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsIsNull() {
|
||||
addCriterion("tips is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsIsNotNull() {
|
||||
addCriterion("tips is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsEqualTo(String value) {
|
||||
addCriterion("tips =", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsNotEqualTo(String value) {
|
||||
addCriterion("tips <>", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsGreaterThan(String value) {
|
||||
addCriterion("tips >", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("tips >=", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsLessThan(String value) {
|
||||
addCriterion("tips <", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsLessThanOrEqualTo(String value) {
|
||||
addCriterion("tips <=", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsLike(String value) {
|
||||
addCriterion("tips like", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsNotLike(String value) {
|
||||
addCriterion("tips not like", value, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsIn(List<String> values) {
|
||||
addCriterion("tips in", values, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsNotIn(List<String> values) {
|
||||
addCriterion("tips not in", values, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsBetween(String value1, String value2) {
|
||||
addCriterion("tips between", value1, value2, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTipsNotBetween(String value1, String value2) {
|
||||
addCriterion("tips not between", value1, value2, "tips");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(LocalDateTime value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(LocalDateTime value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<LocalDateTime> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<LocalDateTime> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdIsNull() {
|
||||
addCriterion("updater_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdIsNotNull() {
|
||||
addCriterion("updater_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdEqualTo(Long value) {
|
||||
addCriterion("updater_id =", value, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdNotEqualTo(Long value) {
|
||||
addCriterion("updater_id <>", value, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdGreaterThan(Long value) {
|
||||
addCriterion("updater_id >", value, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("updater_id >=", value, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdLessThan(Long value) {
|
||||
addCriterion("updater_id <", value, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("updater_id <=", value, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdIn(List<Long> values) {
|
||||
addCriterion("updater_id in", values, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdNotIn(List<Long> values) {
|
||||
addCriterion("updater_id not in", values, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdBetween(Long value1, Long value2) {
|
||||
addCriterion("updater_id between", value1, value2, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdaterIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("updater_id not between", value1, value2, "updaterId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package club.joylink.rtss.services.alarm;
|
||||
|
||||
import club.joylink.rtss.entity.AlarmTips;
|
||||
import club.joylink.rtss.vo.alarm.AlarmQueryVO;
|
||||
import club.joylink.rtss.vo.alarm.AlarmTipsCreateVO;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AlarmTipsService {
|
||||
void create(AlarmTipsCreateVO createVO, long creatorId);
|
||||
|
||||
AlarmTips get(AlarmQueryVO queryVO);
|
||||
|
||||
void delete(long id);
|
||||
|
||||
List<AlarmTips> list();
|
||||
|
||||
PageVO<AlarmTips> page(PageQueryVO queryVO);
|
||||
|
||||
void update(long id, AlarmTipsCreateVO createVO, long updaterId);
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package club.joylink.rtss.services.alarm;
|
||||
|
||||
import club.joylink.rtss.dao.AlarmTipsDAO;
|
||||
import club.joylink.rtss.entity.AlarmTips;
|
||||
import club.joylink.rtss.entity.AlarmTipsExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.alarm.AlarmQueryVO;
|
||||
import club.joylink.rtss.vo.alarm.AlarmTipsCreateVO;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AlarmTipsServiceImpl implements AlarmTipsService {
|
||||
@Autowired
|
||||
private AlarmTipsDAO alarmTipsDAO;
|
||||
|
||||
@Override
|
||||
public void create(AlarmTipsCreateVO createVO, long creatorId) {
|
||||
checkParam(createVO);
|
||||
AlarmTips alarmTips = createVO.convert2DB();
|
||||
alarmTips.setUpdateTime(LocalDateTime.now());
|
||||
alarmTips.setUpdaterId(creatorId);
|
||||
alarmTipsDAO.insert(alarmTips);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlarmTips get(AlarmQueryVO queryVO) {
|
||||
AlarmTipsExample example = new AlarmTipsExample();
|
||||
example.createCriteria().andAlarmTypeEqualTo(queryVO.getAlarmType())
|
||||
.andAlarmLevelEqualTo(queryVO.getAlarmLevel());
|
||||
List<AlarmTips> list = alarmTipsDAO.selectByExample(example);
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(list);
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(long id) {
|
||||
alarmTipsDAO.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AlarmTips> list() {
|
||||
return alarmTipsDAO.selectByExample(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageVO<AlarmTips> page(PageQueryVO queryVO) {
|
||||
Page<AlarmTips> page = PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||
list();
|
||||
return PageVO.convert(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(long id, AlarmTipsCreateVO createVO, long updaterId) {
|
||||
checkParam(createVO);
|
||||
AlarmTips entity = getEntity(id);
|
||||
createVO.overwrite(entity);
|
||||
entity.setUpdaterId(updaterId);
|
||||
alarmTipsDAO.updateByPrimaryKey(entity);
|
||||
}
|
||||
|
||||
private void checkParam(AlarmTipsCreateVO createVO) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getAlarmType());
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(createVO.getAlarmLevel());
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(createVO.getTips());
|
||||
}
|
||||
|
||||
private AlarmTips getEntity(long id) {
|
||||
AlarmTips entity = findEntity(id);
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(entity, String.format("[id:%s]的数据不存在", id));
|
||||
return entity;
|
||||
}
|
||||
|
||||
private AlarmTips findEntity(long id) {
|
||||
return alarmTipsDAO.selectByPrimaryKey(id);
|
||||
}
|
||||
}
|
@ -333,7 +333,7 @@ public class Training2Service {
|
||||
/**
|
||||
* 完成步骤中操作
|
||||
*/
|
||||
public Integer completionClientStepOperation(String group, Integer stepId, Integer id, AccountVO user) {
|
||||
public Integer completionClientStepOperation(String group, Long stepId, Long id, AccountVO user) {
|
||||
Simulation simulation = groupSimulationCache.getSimulationByGroup(group);
|
||||
if (simulation == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Invalid_Operation, "仿真不存在");
|
||||
|
@ -29,6 +29,10 @@ public class AtsAlarm {
|
||||
* 告警级别
|
||||
*/
|
||||
private String level;
|
||||
/**
|
||||
* 报警颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 告警类型
|
||||
*/
|
||||
@ -107,4 +111,23 @@ public class AtsAlarm {
|
||||
/** 列车延误 */
|
||||
TRAIN_DELAY,
|
||||
}
|
||||
|
||||
/**
|
||||
* 西安三报警级别
|
||||
*/
|
||||
public interface Xian3Level {
|
||||
String LEVEL_1 = "I";
|
||||
String LEVEL_2 = "II";
|
||||
String LEVEL_3 = "III";
|
||||
String LEVEL_4 = "IV";
|
||||
}
|
||||
|
||||
/**
|
||||
* 西安三报警颜色
|
||||
*/
|
||||
public interface Xian3Color{
|
||||
String YELLOW = "Y";
|
||||
String ORANGE = "O";
|
||||
String RED = "R";
|
||||
}
|
||||
}
|
||||
|
@ -1631,7 +1631,7 @@ public class Operation {
|
||||
/**
|
||||
* 会话群组获取未读消息
|
||||
*/
|
||||
Conversation_Group_Get_Unread_Message(new Label[]{Label.CLIENT}, true),
|
||||
Conversation_Group_Read_Message(new Label[]{Label.CLIENT}, true),
|
||||
//---------------------------- PSL ------------------------------
|
||||
/**
|
||||
* PSL盘按下按钮
|
||||
|
@ -21,14 +21,12 @@ import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.TrainLoadParam2;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.VirtualRealityTrainVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import club.joylink.rtss.simulation.cbtc.device.virtual.VRDeviceLogicLoop;
|
||||
import club.joylink.rtss.simulation.cbtc.device.virtual.VRTrainRunningService;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationRunAsPlanEvent;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.simulation.cbtc.onboard.ATP.ATPService;
|
||||
import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -496,20 +494,6 @@ public class AtsTrainLoadService {
|
||||
}
|
||||
}
|
||||
|
||||
// private void updateTrainSpeed(Simulation simulation) {
|
||||
// for (VirtualRealityTrain train : simulation.getRepository().getOnlineTrainList()) {
|
||||
// if (train.getMa() == null)
|
||||
// continue;
|
||||
// float targetDistance = ATOService.calculateTargetRemainDistance(train, train.getMa());
|
||||
// float speedMax = Math.min(train.getAtoSpeedMax(), train.getSpeedLimit() * 0.9f);
|
||||
// SpeedCurve speedCurve = SpeedCurve
|
||||
// .buildTargetSpeedCurve(train.getHeadPosition(), train.calculateTailPosition(), train.isRight(),
|
||||
// targetDistance, train.getSpeed(), speedMax);
|
||||
// float speed = speedCurve.getSpeedOf(speedCurve.getTotalDistance());
|
||||
// train.setSpeed(speed);
|
||||
// }
|
||||
// }
|
||||
|
||||
private List<TrainInfo> trainOnlineAndBuildSupervise(Simulation simulation, List<VirtualRealityTrain> loadedList) {
|
||||
List<TrainInfo> superviseList = new ArrayList<>();
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
|
@ -32,7 +32,7 @@ public class NccAlarmService {
|
||||
|
||||
/**
|
||||
* 列车延误监测。
|
||||
* 列车在站台延误超过2/5/10分钟,分别发出蓝/黄/红色等级警报
|
||||
* 列车在站台延误超过2/10分钟,分别发出黄/橙色等级警报
|
||||
*/
|
||||
public void delayMonitoring(Simulation simulation) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
@ -55,28 +55,28 @@ public class NccAlarmService {
|
||||
continue;
|
||||
//延误监测
|
||||
if (systemTime.isAfter(stationPlan.getArriveTime())) {
|
||||
String level;
|
||||
String color;
|
||||
if (systemTime.isAfter(stationPlan.getArriveTime().plusMinutes(delay))) {
|
||||
switch (delay) {
|
||||
case 2:
|
||||
level = "蓝色";
|
||||
trainDelayMonitoring.put(groupNumber, 5);
|
||||
break;
|
||||
case 5:
|
||||
level = "黄色";
|
||||
color = AtsAlarm.Xian3Color.YELLOW;
|
||||
trainDelayMonitoring.put(groupNumber, 10);
|
||||
break;
|
||||
case 10:
|
||||
level = "红色";
|
||||
color = AtsAlarm.Xian3Color.ORANGE;
|
||||
trainDelayMonitoring.put(groupNumber, -1);
|
||||
break;
|
||||
// case 30:
|
||||
// level = AtsAlarm.Xian3Level.RED;
|
||||
// trainDelayMonitoring.put(groupNumber, -1);
|
||||
// break;
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected value: " + delay);
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
String description = String.format("列车[%s]按照计划[%s-%s]应在[%s]抵达[%s],现已晚点%s分钟",
|
||||
String description = String.format("三号线:列车[%s]按照计划[%s-%s]应在[%s]抵达[%s],现已晚点%s分钟",
|
||||
groupNumber, trainInfo.getServiceNumber(), trainInfo.getTripNumber(),
|
||||
stationPlan.getCorrectArriveTime(), stationPlan.getStation().getName(), delay);
|
||||
//记录并发送报警信息
|
||||
@ -84,14 +84,15 @@ public class NccAlarmService {
|
||||
.code(simulation.getIdGenerator().generateAlarmId())
|
||||
.time(correctSystemDateTime)
|
||||
.type(AtsAlarm.Type.TRAIN_DELAY)
|
||||
.level(level)
|
||||
.level(AtsAlarm.Xian3Level.LEVEL_1)
|
||||
.color(color)
|
||||
.deviceCode(groupNumber)
|
||||
.description(description)
|
||||
.build();
|
||||
repository.addAtsAlarm(atsAlarm);
|
||||
SocketMessageVO<Collection<AtsAlarm>> messageVO =
|
||||
SocketMessageFactory.buildAtsAlarmMessage(simulation.getId(), Collections.singletonList(atsAlarm));
|
||||
stompMessageService.send(messageVO);
|
||||
stompMessageService.sendToUser(simulation.getCreatorId(), messageVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,11 +193,6 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
|
||||
*/
|
||||
private Map<String, Boolean> routeSettingStatusMap;
|
||||
/***************************************** 关联进路信息 **********************************************/
|
||||
/**
|
||||
* 是否是数据配置生成
|
||||
*/
|
||||
private boolean isDataConfig;
|
||||
|
||||
/**
|
||||
* 默认方向
|
||||
*/
|
||||
@ -229,28 +224,6 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
|
||||
private boolean goodsTrain = true;
|
||||
|
||||
/***************************************** 车务终端管理出入口方向相关属性begin **********************************************/
|
||||
// TODO: 待数据统一之后,这个构造函数代码可删除 20220714
|
||||
public StationDirection(String code, String name, DirectionLabelEnum labelEnum) {
|
||||
this(code, name);
|
||||
this.labelEnum = labelEnum;
|
||||
this.runModel = getDefaultDirectionRunModel();
|
||||
this.runStatus = this.getDefaultReceiveAndDeliver();
|
||||
this.defaultRunStatus = this.getDefaultReceiveAndDeliver();
|
||||
this.currentRouteList = getNowRouteList();
|
||||
}
|
||||
|
||||
public StationDirection(String code, String name, DirectionLabelEnum labelEnum, IODirection ioDirection) {
|
||||
this(code, name);
|
||||
this.labelEnum = labelEnum;
|
||||
this.runModel = getDefaultDirectionRunModel();
|
||||
this.runStatus = this.getDefaultReceiveAndDeliver();
|
||||
this.defaultRunStatus = this.getDefaultReceiveAndDeliver();
|
||||
this.currentRouteList = getNowRouteList();
|
||||
this.ioDirection = ioDirection;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public StationDirection(DraftMapStationDirection draftMapStationDirection) {
|
||||
this(draftMapStationDirection.getCode(), draftMapStationDirection.getName());
|
||||
this.labelEnum = draftMapStationDirection.getLabelEnum();
|
||||
@ -258,7 +231,6 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
|
||||
this.runStatus = draftMapStationDirection.getRunStatus();
|
||||
this.defaultRunStatus = draftMapStationDirection.getRunStatus();
|
||||
this.currentRouteList = getNowRouteList();
|
||||
this.isDataConfig = true;
|
||||
this.ioDirection = draftMapStationDirection.getIoDirection();
|
||||
|
||||
}
|
||||
@ -285,7 +257,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
|
||||
public void reset() {
|
||||
this.routeSettingStatusMap.clear();
|
||||
this.setDefaultAttribute();
|
||||
this.runStatus = this.getDefaultReceiveAndDeliver();
|
||||
this.runStatus = this.defaultRunStatus;
|
||||
this.currentRouteList = getNowRouteList();
|
||||
}
|
||||
|
||||
@ -382,43 +354,6 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应的方向
|
||||
*
|
||||
* @return 对应方向
|
||||
*/
|
||||
// TODO: 数据统一之后,获取对应方向代码可删除 20220714
|
||||
public DirectionLabelEnum getRelativeDirectionLabelEnum() {
|
||||
if (this.isDataConfig) {
|
||||
return this.getRelativeStationDirection().getLabelEnum();
|
||||
}
|
||||
DirectionLabelEnum nextLabelEnum;
|
||||
switch (labelEnum) {
|
||||
case X:
|
||||
nextLabelEnum = DirectionLabelEnum.XF;
|
||||
break;
|
||||
case XF:
|
||||
nextLabelEnum = DirectionLabelEnum.X;
|
||||
break;
|
||||
case XD:
|
||||
nextLabelEnum = DirectionLabelEnum.SD;
|
||||
break;
|
||||
case S:
|
||||
nextLabelEnum = DirectionLabelEnum.SF;
|
||||
break;
|
||||
case SF:
|
||||
nextLabelEnum = DirectionLabelEnum.S;
|
||||
break;
|
||||
case SD:
|
||||
nextLabelEnum = DirectionLabelEnum.XD;
|
||||
break;
|
||||
default:
|
||||
nextLabelEnum = DirectionLabelEnum.NO;
|
||||
break;
|
||||
}
|
||||
return nextLabelEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有按钮按下
|
||||
*
|
||||
@ -518,54 +453,6 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
|
||||
this.goodsTrain = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认亮灯设置
|
||||
*/
|
||||
private ReceiveAndDeliverModel getDefaultReceiveAndDeliver() {
|
||||
if (this.isDataConfig) {
|
||||
return this.defaultRunStatus;
|
||||
// TODO: 待数据统一之后,下方代码可删除 20220714
|
||||
} else if (DirectionLabelEnum.X.equals(labelEnum) || DirectionLabelEnum.S.equals(labelEnum)) { // X、S方向为接车方向默认亮起
|
||||
return ReceiveAndDeliverModel.R;
|
||||
} else if (DirectionLabelEnum.XF.equals(labelEnum) || DirectionLabelEnum.SF.equals(labelEnum)) { // SF、XF方向默认发车灯亮起
|
||||
return ReceiveAndDeliverModel.D;
|
||||
} else { // SD、XD方向默认发车灯亮起
|
||||
return ReceiveAndDeliverModel.NO;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认运行模式
|
||||
*/
|
||||
private DirectionRunModel getDefaultDirectionRunModel() {
|
||||
if (this.isDataConfig) {
|
||||
return this.runModel;
|
||||
// TODO: 待数据统一之后,下方代码可删除 20220714
|
||||
} else if (DirectionLabelEnum.XD.equals(labelEnum) || DirectionLabelEnum.SD.equals(labelEnum)) {
|
||||
return DirectionRunModel.S;
|
||||
} else { // SD、XD
|
||||
return DirectionRunModel.A;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断信号机发车方向的三个区段是否解锁
|
||||
*
|
||||
* @param runRight 列车的运行方向
|
||||
* @return 锁闭状态
|
||||
*/
|
||||
private boolean judgeSignalLock(boolean runRight) {
|
||||
// 发车方向
|
||||
boolean deliverRight = this.deliverRouteList.stream().anyMatch(Route::isRight);
|
||||
Section section = this.getSignal().getSection();
|
||||
boolean isLock = section.isOccupied() && Objects.equals(section.isTrainRight(), runRight);
|
||||
for (int index = 0; !isLock && index < 3 && section != null; index++) {
|
||||
isLock = section.isOccupied() && Objects.equals(section.isTrainRight(), runRight);
|
||||
section = section.getNextSection(deliverRight);
|
||||
}
|
||||
return isLock;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动模式下的接发车判断
|
||||
*/
|
||||
@ -575,33 +462,6 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
|
||||
boolean routeBlock = this.currentRouteList.stream().anyMatch(Route::isLock);
|
||||
this.runStatus = routeBlock ? getNowRunStatus() : this.runStatus;
|
||||
}
|
||||
// 接车进路锁闭亮红灯、否则默认
|
||||
IndicatorStatusEnum receiveAspect = IndicatorStatusEnum.F;
|
||||
// 发车进路锁闭亮红灯、否则默认
|
||||
IndicatorStatusEnum deliverAspect = IndicatorStatusEnum.F;
|
||||
// 进路区段占用判断点灯颜色
|
||||
if (ReceiveAndDeliverModel.R.equals(this.runStatus)) {
|
||||
deliverAspect = IndicatorStatusEnum.F;
|
||||
// 运行方向
|
||||
// boolean runRight = this.receiveRouteList.stream().anyMatch(Route::isRight);
|
||||
// 接车进路锁闭
|
||||
// receiveAspect = judgeSignalLock(runRight) ? IndicatorStatusEnum.O : IndicatorStatusEnum.F;
|
||||
} else if (ReceiveAndDeliverModel.D.equals(this.runStatus)) {
|
||||
receiveAspect = IndicatorStatusEnum.F;
|
||||
// 运行方向
|
||||
// boolean runRight = this.deliverRouteList.stream().anyMatch(Route::isRight);
|
||||
// 信号机进路锁闭
|
||||
// Section section = this.getSignal().getSection().getNextSection(!runRight);
|
||||
// 发车进路锁闭
|
||||
// deliverAspect = (section.isRouteLock() && Objects.equals(section.isLockRight(), runRight))
|
||||
// || judgeSignalLock(runRight) ? IndicatorStatusEnum.O : IndicatorStatusEnum.F;
|
||||
} else {
|
||||
receiveAspect = this.receiveAspect;
|
||||
deliverAspect = this.receiveAspect;
|
||||
}
|
||||
// 赋值点灯信息
|
||||
this.deliverAspect = deliverAspect;
|
||||
this.receiveAspect = receiveAspect;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,7 +160,7 @@ public class StationDirectionService {
|
||||
/**
|
||||
* 改方按钮抬起后续操作
|
||||
*/
|
||||
private final ButtonThenInterface turnDirectionPressUpThen = (simulation, stationDirection) -> this.turnDirectionPressDownThen.doThen(simulation, stationDirection);
|
||||
private final ButtonThenInterface turnDirectionPressUpThen = this.turnDirectionPressDownThen::doThen;
|
||||
|
||||
/**
|
||||
* 总辅助后续操作
|
||||
@ -455,24 +455,6 @@ public class StationDirectionService {
|
||||
return station;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接车进路的邻站
|
||||
* 接车进路
|
||||
*
|
||||
* @param simulation 仿真实体数据
|
||||
* @param stationDirection 方向实体
|
||||
* @return 车站
|
||||
*/
|
||||
private Optional<Station> getAdjacentStationOptional(Simulation simulation, StationDirection stationDirection) {
|
||||
// 获取接进路的方向
|
||||
boolean right = stationDirection.getReceiveRouteList().stream().findAny().get().isRight();
|
||||
// 找上一个车站序号
|
||||
int index = stationDirection.getStation().getSn() + (right ? -1 : 1);
|
||||
return simulation.getRepository().getStationList().stream()
|
||||
.filter(station -> station.getSn() == index)
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前方向联锁相对的方向联锁
|
||||
*
|
||||
@ -481,21 +463,7 @@ public class StationDirectionService {
|
||||
* @return 相对方向
|
||||
*/
|
||||
private StationDirection getRelativeStationDirection(Simulation simulation, StationDirection stationDirection) {
|
||||
StationDirection relativeStationDirection = null;
|
||||
if (stationDirection.isDataConfig()) {
|
||||
relativeStationDirection = stationDirection.getRelativeStationDirection();
|
||||
} else { // TODO: 待数据统一之后,下方代码可删除 20220714
|
||||
// 获取邻站实体
|
||||
Optional<Station> adjacentStationOptional = getAdjacentStationOptional(simulation, stationDirection);
|
||||
if (adjacentStationOptional.isPresent()) {
|
||||
// 方向标签
|
||||
DirectionLabelEnum relativeDirectionLabelEnum = stationDirection.getRelativeDirectionLabelEnum();
|
||||
if (!DirectionLabelEnum.NO.equals(relativeDirectionLabelEnum)) {
|
||||
relativeStationDirection = adjacentStationOptional.get().getStationDirectionMap().get(relativeDirectionLabelEnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
return relativeStationDirection;
|
||||
return stationDirection.getRelativeStationDirection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1666,14 +1666,7 @@ public class InterlockBuilder2 {
|
||||
if (elementMap.containsKey(stationDirection.getCode())) {
|
||||
errMsgList.add("已经存在车站运行方向" + stationDirection.getCode());
|
||||
} else {
|
||||
StationDirection model;
|
||||
if (stationDirection.getRunStatus() != null) {
|
||||
model = new StationDirection(stationDirection);
|
||||
} else {
|
||||
// TODO: 待数据统一之后,下方构建代码可删除 20220714
|
||||
// model = new StationDirection(stationDirection.getCode(), stationDirection.getName(), stationDirection.getLabelEnum());
|
||||
model = new StationDirection(stationDirection.getCode(), stationDirection.getName(), stationDirection.getLabelEnum(),stationDirection.getIoDirection());
|
||||
}
|
||||
StationDirection model = new StationDirection(stationDirection);
|
||||
// 注入信号灯数据
|
||||
if (!StringUtils.isEmpty(stationDirection.getSignalCode())) {
|
||||
Signal signal = (Signal) elementMap.get(stationDirection.getSignalCode());
|
||||
|
@ -114,7 +114,7 @@ public class ConversationGroupOperateHandler {
|
||||
/**
|
||||
* 阅读群组信息
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Conversation_Group_Get_Unread_Message)
|
||||
@OperateHandlerMapping(type = Operation.Type.Conversation_Group_Read_Message)
|
||||
public List<ConversationGroupMessageVO> readConversationGroup(Simulation simulation, SimulationMember member, Long id) {
|
||||
return conversationGroupManagerService.readConversationGroup(simulation, member, id);
|
||||
}
|
||||
|
10
src/main/java/club/joylink/rtss/vo/alarm/AlarmQueryVO.java
Normal file
10
src/main/java/club/joylink/rtss/vo/alarm/AlarmQueryVO.java
Normal file
@ -0,0 +1,10 @@
|
||||
package club.joylink.rtss.vo.alarm;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AlarmQueryVO {
|
||||
private String alarmType;
|
||||
|
||||
private String alarmLevel;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package club.joylink.rtss.vo.alarm;
|
||||
|
||||
import club.joylink.rtss.entity.AlarmTips;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.data.AtsAlarm;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 报警提示信息创建
|
||||
*/
|
||||
@Data
|
||||
public class AlarmTipsCreateVO {
|
||||
/**
|
||||
* 报警类型
|
||||
*/
|
||||
private AtsAlarm.Type alarmType;
|
||||
|
||||
/**
|
||||
* 报警级别
|
||||
*/
|
||||
private String alarmLevel;
|
||||
|
||||
/**
|
||||
* 提示信息
|
||||
*/
|
||||
private String tips;
|
||||
|
||||
public AlarmTips convert2DB() {
|
||||
AlarmTips alarmTips = new AlarmTips();
|
||||
alarmTips.setAlarmType(alarmType.name());
|
||||
alarmTips.setAlarmLevel(alarmLevel);
|
||||
alarmTips.setTips(tips);
|
||||
return alarmTips;
|
||||
}
|
||||
|
||||
public void overwrite(AlarmTips entity) {
|
||||
entity.setAlarmType(alarmType.name());
|
||||
entity.setAlarmLevel(alarmLevel);
|
||||
entity.setTips(tips);
|
||||
}
|
||||
}
|
@ -479,7 +479,7 @@ public class SocketMessageFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建仿真工作参数
|
||||
* Ats报警
|
||||
*/
|
||||
public static SocketMessageVO<Collection<AtsAlarm>> buildAtsAlarmMessage(String sId, Collection<AtsAlarm> alarmList) {
|
||||
return build(WebSocketMessageType.Simulation_Alarm, sId, alarmList);
|
||||
|
228
src/main/resources/mybatis/mapper/AlarmTipsDAO.xml
Normal file
228
src/main/resources/mybatis/mapper/AlarmTipsDAO.xml
Normal file
@ -0,0 +1,228 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="club.joylink.rtss.dao.AlarmTipsDAO">
|
||||
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.AlarmTips">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="alarm_type" jdbcType="VARCHAR" property="alarmType" />
|
||||
<result column="alarm_level" jdbcType="VARCHAR" property="alarmLevel" />
|
||||
<result column="tips" jdbcType="VARCHAR" property="tips" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="updater_id" jdbcType="BIGINT" property="updaterId" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, alarm_type, alarm_level, tips, update_time, updater_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="club.joylink.rtss.entity.AlarmTipsExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from rts_alarm_tips
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limit != null">
|
||||
<if test="offset != null">
|
||||
limit ${offset}, ${limit}
|
||||
</if>
|
||||
<if test="offset == null">
|
||||
limit ${limit}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from rts_alarm_tips
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from rts_alarm_tips
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.AlarmTipsExample">
|
||||
delete from rts_alarm_tips
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.AlarmTips" useGeneratedKeys="true">
|
||||
insert into rts_alarm_tips (alarm_type, alarm_level, tips,
|
||||
update_time, updater_id)
|
||||
values (#{alarmType,jdbcType=VARCHAR}, #{alarmLevel,jdbcType=VARCHAR}, #{tips,jdbcType=VARCHAR},
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.AlarmTips" useGeneratedKeys="true">
|
||||
insert into rts_alarm_tips
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmType != null">
|
||||
alarm_type,
|
||||
</if>
|
||||
<if test="alarmLevel != null">
|
||||
alarm_level,
|
||||
</if>
|
||||
<if test="tips != null">
|
||||
tips,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="updaterId != null">
|
||||
updater_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmType != null">
|
||||
#{alarmType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alarmLevel != null">
|
||||
#{alarmLevel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tips != null">
|
||||
#{tips,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updaterId != null">
|
||||
#{updaterId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="club.joylink.rtss.entity.AlarmTipsExample" resultType="java.lang.Long">
|
||||
select count(*) from rts_alarm_tips
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update rts_alarm_tips
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.alarmType != null">
|
||||
alarm_type = #{record.alarmType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.alarmLevel != null">
|
||||
alarm_level = #{record.alarmLevel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tips != null">
|
||||
tips = #{record.tips,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updaterId != null">
|
||||
updater_id = #{record.updaterId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update rts_alarm_tips
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
alarm_type = #{record.alarmType,jdbcType=VARCHAR},
|
||||
alarm_level = #{record.alarmLevel,jdbcType=VARCHAR},
|
||||
tips = #{record.tips,jdbcType=VARCHAR},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
updater_id = #{record.updaterId,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.AlarmTips">
|
||||
update rts_alarm_tips
|
||||
<set>
|
||||
<if test="alarmType != null">
|
||||
alarm_type = #{alarmType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alarmLevel != null">
|
||||
alarm_level = #{alarmLevel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tips != null">
|
||||
tips = #{tips,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updaterId != null">
|
||||
updater_id = #{updaterId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.AlarmTips">
|
||||
update rts_alarm_tips
|
||||
set alarm_type = #{alarmType,jdbcType=VARCHAR},
|
||||
alarm_level = #{alarmLevel,jdbcType=VARCHAR},
|
||||
tips = #{tips,jdbcType=VARCHAR},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
updater_id = #{updaterId,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user