【列车运行方向逻辑重构】
This commit is contained in:
parent
5b6f5ab8df
commit
ad19c56331
@ -1,37 +0,0 @@
|
||||
package club.joylink.rtss.constants;
|
||||
|
||||
/**
|
||||
* 按钮类型枚举
|
||||
*/
|
||||
public enum ButtonTypeEnum {
|
||||
// 总辅助
|
||||
MAIN_ASSIST,
|
||||
// 接辅助
|
||||
RECEIVE_ASSIST,
|
||||
// 发辅助
|
||||
DELIVER_ASSIST,
|
||||
// 改方
|
||||
CHANGE_DIRECTION,
|
||||
NO;
|
||||
|
||||
/**
|
||||
* 获取枚举信息
|
||||
*
|
||||
* @param type 类型
|
||||
* @return 枚举
|
||||
*/
|
||||
public static ButtonTypeEnum getType(String type) {
|
||||
switch (type) {
|
||||
case "main_assist":
|
||||
return ButtonTypeEnum.MAIN_ASSIST;
|
||||
case "deliver_assist":
|
||||
return ButtonTypeEnum.DELIVER_ASSIST;
|
||||
case "receive_assist":
|
||||
return ButtonTypeEnum.RECEIVE_ASSIST;
|
||||
case "change_direction":
|
||||
return ButtonTypeEnum.CHANGE_DIRECTION;
|
||||
default:
|
||||
return ButtonTypeEnum.NO;
|
||||
}
|
||||
}
|
||||
}
|
@ -9,5 +9,25 @@ public enum DirectionLabelEnum {
|
||||
XD,
|
||||
S,
|
||||
SF,
|
||||
SD
|
||||
SD,
|
||||
NO;
|
||||
|
||||
public static DirectionLabelEnum getLabel(String label) {
|
||||
switch (label) {
|
||||
case "X":
|
||||
return DirectionLabelEnum.X;
|
||||
case "XF":
|
||||
return DirectionLabelEnum.XF;
|
||||
case "XD":
|
||||
return DirectionLabelEnum.XD;
|
||||
case "S":
|
||||
return DirectionLabelEnum.S;
|
||||
case "SF":
|
||||
return DirectionLabelEnum.SF;
|
||||
case "SD":
|
||||
return DirectionLabelEnum.SD;
|
||||
default:
|
||||
return DirectionLabelEnum.NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
package club.joylink.rtss.constants;
|
||||
|
||||
/**
|
||||
* 信号灯类型
|
||||
*/
|
||||
public enum IndicatorTypeEnum {
|
||||
// 接
|
||||
RECEIVE,
|
||||
// 发
|
||||
DELIVER,
|
||||
// 区间
|
||||
SECTION,
|
||||
// 辅助
|
||||
ASSIST,
|
||||
// 无类型
|
||||
NO;
|
||||
|
||||
public static IndicatorTypeEnum getType(String type) {
|
||||
switch (type) {
|
||||
case "receive":
|
||||
return IndicatorTypeEnum.RECEIVE;
|
||||
case "deliver":
|
||||
return IndicatorTypeEnum.DELIVER;
|
||||
case "section":
|
||||
return IndicatorTypeEnum.SECTION;
|
||||
case "assist":
|
||||
return IndicatorTypeEnum.ASSIST;
|
||||
default:
|
||||
return IndicatorTypeEnum.NO;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
package club.joylink.rtss.controller;
|
||||
|
||||
import club.joylink.rtss.entity.IndicatorButton;
|
||||
import club.joylink.rtss.services.IAssistButtonIndicatorService;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 地图草稿数据管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/assist")
|
||||
@Slf4j
|
||||
public class AssistController {
|
||||
@Autowired
|
||||
private IAssistButtonIndicatorService assistButtonIndicatorService;
|
||||
|
||||
/**
|
||||
* 查询地图下所有的指示灯、区间、进路等关系列表
|
||||
*
|
||||
* @param mapId 地图ID
|
||||
* @param standCode 站台
|
||||
* @param indicatorCode 指示灯ID
|
||||
* @param routeCode 进路编码
|
||||
* @return 关系列表
|
||||
*/
|
||||
@GetMapping(path = "/indicator/section/list/{mapId}")
|
||||
public PageVO<IndicatorButton> indicatorSectionList(@PathVariable Long mapId, String standCode, String indicatorCode
|
||||
, String routeCode, PageQueryVO queryVO) {
|
||||
return assistButtonIndicatorService.indicatorSectionList(mapId, standCode, indicatorCode, routeCode, queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询单个指示灯、区间、进路等关系
|
||||
*
|
||||
* @param id 关系Id
|
||||
* @return 关系实体
|
||||
*/
|
||||
@GetMapping(path = "/indicator/section/{id}")
|
||||
public IndicatorButton queryIndicatorSection(@PathVariable Long id) {
|
||||
return assistButtonIndicatorService.queryIndicatorSection(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存关联关系信息
|
||||
*
|
||||
* @param mapId 地图信息
|
||||
* @param vo 关联关系
|
||||
* @return 处理结果
|
||||
*/
|
||||
@PostMapping(path = "/indicator/section/save/{mapId}")
|
||||
public String saveIndicatorSection(@PathVariable Long mapId, @RequestBody IndicatorButton vo) {
|
||||
return assistButtonIndicatorService.saveIndicatorSection(mapId, vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指示灯与区段关联关系
|
||||
*
|
||||
* @param id 主键
|
||||
* @param user 用户
|
||||
*/
|
||||
@DeleteMapping(path = "/indicator/section/delete/{id}")
|
||||
public void deleteIndicatorSection(@PathVariable Long id) {
|
||||
assistButtonIndicatorService.deleteIndicatorSection(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.services.draftData.IDraftMapStationDirectionService;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 车站
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/station/direction")
|
||||
@Slf4j
|
||||
public class DraftMapStationDirectionController {
|
||||
@Autowired
|
||||
private IDraftMapStationDirectionService draftMapStationDirectionLabelService;
|
||||
|
||||
/**
|
||||
* 查询地图下车站 方向的逻辑数据列表
|
||||
*
|
||||
* @param mapId 地图ID
|
||||
* @param code Code
|
||||
* @param labelEnum 方向类型
|
||||
* @return 数据列表
|
||||
*/
|
||||
@GetMapping(path = "/list/{mapId}")
|
||||
public PageVO<DraftMapStationDirection> stationLabelList(@PathVariable Long mapId, String code
|
||||
, String labelEnum, PageQueryVO queryVO) {
|
||||
return draftMapStationDirectionLabelService.stationLabelList(mapId, code, labelEnum, queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询地图下车站 方向的逻辑数据
|
||||
*
|
||||
* @param id 关系Id
|
||||
* @return 关系实体
|
||||
*/
|
||||
@GetMapping(path = "/{id}")
|
||||
public DraftMapStationDirection queryStationLabel(@PathVariable Long id) {
|
||||
return draftMapStationDirectionLabelService.queryStationLabel(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存关联关系信息
|
||||
*
|
||||
* @param mapId 地图信息
|
||||
* @param vo 关联关系
|
||||
* @return 处理结果
|
||||
*/
|
||||
@PostMapping(path = "/save/{mapId}")
|
||||
public String saveStationLabel(@PathVariable Long mapId, @RequestBody DraftMapStationDirection vo) {
|
||||
return draftMapStationDirectionLabelService.saveStationLabel(mapId, vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车站 方向的逻辑数据
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@DeleteMapping(path = "/delete/{id}")
|
||||
public void deleteStationLabel(@PathVariable Long id) {
|
||||
draftMapStationDirectionLabelService.deleteStationLabel(id);
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package club.joylink.rtss.dao;
|
||||
|
||||
import club.joylink.rtss.entity.IndicatorButton;
|
||||
import club.joylink.rtss.entity.IndicatorButtonExample;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* AssistButtonDAO继承基类
|
||||
*/
|
||||
@Repository
|
||||
public interface AssistIndicatorButtonDAO extends MyBatisBaseDao<IndicatorButton, Long, IndicatorButtonExample> {
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package club.joylink.rtss.dao;
|
||||
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.entity.DraftMapStationDirectionExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AssistButtonDAO继承基类
|
||||
*/
|
||||
@Repository
|
||||
public interface DraftMapStationDirectionDAO extends MyBatisBaseDao<DraftMapStationDirection, Long, DraftMapStationDirectionExample> {
|
||||
|
||||
/**
|
||||
* 多数据保存
|
||||
*
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
int insertList(@Param("list") List<DraftMapStationDirection> records);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package club.joylink.rtss.entity;
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Getter;
|
||||
@ -16,7 +17,7 @@ import java.util.List;
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class IndicatorButton {
|
||||
public class DraftMapStationDirection {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@ -27,11 +28,16 @@ public class IndicatorButton {
|
||||
private Long mapId;
|
||||
|
||||
/**
|
||||
* 指示灯
|
||||
* 生成的编码
|
||||
*/
|
||||
@NotBlank(message = "编号不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 车站
|
||||
*/
|
||||
@NotBlank(message = "车站编号不能为空")
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
* 区间列表
|
||||
*/
|
||||
@ -43,24 +49,14 @@ public class IndicatorButton {
|
||||
private String sectionsCode;
|
||||
|
||||
/**
|
||||
* 所处站台
|
||||
* 方向枚举
|
||||
*/
|
||||
private String standCode;
|
||||
private DirectionLabelEnum labelEnum;
|
||||
|
||||
/**
|
||||
* 进路Code
|
||||
* 信号机Code
|
||||
*/
|
||||
private String routeCode;
|
||||
|
||||
/**
|
||||
* 关联实体类型
|
||||
*/
|
||||
private String modelType;
|
||||
|
||||
/**
|
||||
* 灯类型
|
||||
*/
|
||||
private String type;
|
||||
private String signalCode;
|
||||
|
||||
public void generateSectionList() {
|
||||
if (StringUtils.isEmpty(sectionsCode)) {
|
@ -3,7 +3,7 @@ package club.joylink.rtss.entity;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class IndicatorButtonExample {
|
||||
public class DraftMapStationDirectionExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
@ -14,7 +14,7 @@ public class IndicatorButtonExample {
|
||||
|
||||
private Long offset;
|
||||
|
||||
public IndicatorButtonExample() {
|
||||
public DraftMapStationDirectionExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ public class IndicatorButtonExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIndicatorCodeEqualTo(String value) {
|
||||
public Criteria andCodeEqualTo(String value) {
|
||||
addCriterion("code =", value, "code");
|
||||
return (Criteria) this;
|
||||
}
|
||||
@ -279,84 +279,78 @@ public class IndicatorButtonExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeIsNull() {
|
||||
addCriterion("stand_code is null");
|
||||
public Criteria andStationCodeIsNull() {
|
||||
addCriterion("station_code is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeIsNotNull() {
|
||||
addCriterion("stand_code is not null");
|
||||
public Criteria andStationCodeIsNotNull() {
|
||||
addCriterion("station_code is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeEqualTo(String value) {
|
||||
addCriterion("stand_code =", value, "standCode");
|
||||
public Criteria andStationCodeEqualTo(String value) {
|
||||
addCriterion("station_code =", value, "stationCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeNotEqualTo(String value) {
|
||||
addCriterion("stand_code <>", value, "standCode");
|
||||
public Criteria andStationCodeLike(String value) {
|
||||
addCriterion("station_code like", value, "stationCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeLike(String value) {
|
||||
addCriterion("stand_code like", value, "standCode");
|
||||
public Criteria andStationCodeNotLike(String value) {
|
||||
addCriterion("station_code not like", value, "stationCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeNotLike(String value) {
|
||||
addCriterion("stand_code not like", value, "standCode");
|
||||
public Criteria andStationCodeIn(List<String> values) {
|
||||
addCriterion("station_code in", values, "stationCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeIn(List<String> values) {
|
||||
addCriterion("stand_code in", values, "standCode");
|
||||
public Criteria andStationCodeNotIn(List<String> values) {
|
||||
addCriterion("station_code not in", values, "stationCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStandCodeNotIn(List<String> values) {
|
||||
addCriterion("stand_code not in", values, "standCode");
|
||||
public Criteria andLabelEnumIsNull() {
|
||||
addCriterion("label_enum is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
||||
public Criteria andRouteCodeIsNull() {
|
||||
addCriterion("route_code is null");
|
||||
public Criteria andLabelEnumIsNotNull() {
|
||||
addCriterion("label_enum is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRouteCodeIsNotNull() {
|
||||
addCriterion("route_code is not null");
|
||||
public Criteria andLabelEnumEqualTo(String value) {
|
||||
addCriterion("label_enum =", value, "labelEnum");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRouteCodeEqualTo(String value) {
|
||||
addCriterion("route_code =", value, "routeCode");
|
||||
public Criteria andLabelEnumNotEqualTo(String value) {
|
||||
addCriterion("label_enum <>", value, "labelEnum");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRouteCodeNotEqualTo(String value) {
|
||||
addCriterion("route_code <>", value, "routeCode");
|
||||
public Criteria andLabelEnumLike(String value) {
|
||||
addCriterion("label_enum like", value, "labelEnum");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRouteCodeLike(String value) {
|
||||
addCriterion("route_code like", value, "routeCode");
|
||||
public Criteria andLabelEnumNotLike(String value) {
|
||||
addCriterion("label_enum not like", value, "labelEnum");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRouteCodeNotLike(String value) {
|
||||
addCriterion("route_code not like", value, "routeCode");
|
||||
public Criteria andLabelEnumIn(List<String> values) {
|
||||
addCriterion("label_enum in", values, "labelEnum");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRouteCodeIn(List<String> values) {
|
||||
addCriterion("route_code in", values, "routeCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRouteCodeNotIn(List<String> values) {
|
||||
addCriterion("route_code not in", values, "routeCode");
|
||||
public Criteria andLabelEnumNotIn(List<String> values) {
|
||||
addCriterion("label_enum not in", values, "labelEnum");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package club.joylink.rtss.services;
|
||||
|
||||
import club.joylink.rtss.dao.AssistIndicatorButtonDAO;
|
||||
import club.joylink.rtss.entity.IndicatorButton;
|
||||
import club.joylink.rtss.entity.IndicatorButtonExample;
|
||||
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 org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AssistButtonIndicatorService implements IAssistButtonIndicatorService {
|
||||
@Autowired
|
||||
private AssistIndicatorButtonDAO assistIndicatorButtonDAO;
|
||||
|
||||
@Override
|
||||
public PageVO<IndicatorButton> indicatorSectionList(Long mapId, String standCode, String indicatorCode
|
||||
, String routeCode, PageQueryVO queryVO) {
|
||||
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||
IndicatorButtonExample indicatorButtonExample = new IndicatorButtonExample();
|
||||
IndicatorButtonExample.Criteria criteria = indicatorButtonExample.createCriteria();
|
||||
criteria.andMapIdEqualTo(mapId);
|
||||
// 站台
|
||||
if (!StringUtils.isEmpty(standCode)) {
|
||||
criteria.andStandCodeEqualTo(standCode);
|
||||
}
|
||||
// 指示灯
|
||||
if (!StringUtils.isEmpty(indicatorCode)) {
|
||||
criteria.andIndicatorCodeEqualTo(indicatorCode);
|
||||
}
|
||||
// 进路
|
||||
if (!StringUtils.isEmpty(routeCode)) {
|
||||
criteria.andRouteCodeEqualTo(routeCode);
|
||||
}
|
||||
Page<IndicatorButton> page = (Page<IndicatorButton>) assistIndicatorButtonDAO.selectByExample(indicatorButtonExample);
|
||||
page.getResult().forEach(IndicatorButton::generateSectionList);
|
||||
return PageVO.convert(page, page.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndicatorButton queryIndicatorSection(Long id) {
|
||||
return assistIndicatorButtonDAO.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveIndicatorSection(Long mapId, IndicatorButton vo) {
|
||||
vo.setMapId(mapId);
|
||||
if (!CollectionUtils.isEmpty(vo.getSectionList())) {
|
||||
vo.setSectionsCode(String.join(",", vo.getSectionList()));
|
||||
}
|
||||
int line;
|
||||
if (vo.getId() != null) {
|
||||
line = assistIndicatorButtonDAO.updateByPrimaryKey(vo);
|
||||
} else {
|
||||
line = assistIndicatorButtonDAO.insert(vo);
|
||||
}
|
||||
return line != 0 ? "保存成功" : "保存失败";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteIndicatorSection(Long id) {
|
||||
assistIndicatorButtonDAO.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IndicatorButton> queryAllIndicatorSectionByMapId(Long mapId) {
|
||||
IndicatorButtonExample indicatorButtonExample = new IndicatorButtonExample();
|
||||
IndicatorButtonExample.Criteria criteria = indicatorButtonExample.createCriteria();
|
||||
criteria.andMapIdEqualTo(mapId);
|
||||
List<IndicatorButton> list = assistIndicatorButtonDAO.selectByExample(indicatorButtonExample);
|
||||
list.forEach(IndicatorButton::generateSectionList);
|
||||
return list;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import club.joylink.rtss.entity.*;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.draftData.DraftMapOverrunService;
|
||||
import club.joylink.rtss.services.draftData.DraftMapRouteService;
|
||||
import club.joylink.rtss.services.draftData.IDraftMapStationDirectionService;
|
||||
import club.joylink.rtss.services.draftData.RailwayRouteGenerator;
|
||||
import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
|
||||
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
||||
@ -98,7 +99,10 @@ public class DraftMapService implements IDraftMapService {
|
||||
private DraftMapRouteService draftMapRouteService;
|
||||
|
||||
@Autowired
|
||||
private IAssistButtonIndicatorService assistButtonIndicatorService;
|
||||
private IDraftMapStationDirectionService draftMapStationDirectionLabelService;
|
||||
|
||||
@Autowired
|
||||
private DraftMapStationDirectionDAO draftMapStationDirectionDAO;
|
||||
|
||||
@Override
|
||||
public List<DraftMapVO> list(AccountVO accountVO) {
|
||||
@ -510,7 +514,7 @@ public class DraftMapService implements IDraftMapService {
|
||||
logicDataVO.setFlankProtectionList(MapRouteFlankProtectionNewVO.convert2VOList(draftMapRouteFlankProtections));
|
||||
|
||||
// 获取指示灯、按钮等关联关系
|
||||
logicDataVO.setIndicatorButtonVOList(assistButtonIndicatorService.queryAllIndicatorSectionByMapId(id));
|
||||
logicDataVO.setDraftMapStationDirectionList(draftMapStationDirectionLabelService.queryAllStationLabelByMapId(id));
|
||||
return logicDataVO;
|
||||
}
|
||||
|
||||
@ -593,6 +597,11 @@ public class DraftMapService implements IDraftMapService {
|
||||
this.draftMapRouteFlankProtectionDAO.insert(entity);
|
||||
});
|
||||
}
|
||||
|
||||
// 车站 方向的逻辑数据数据
|
||||
if (!CollectionUtils.isEmpty(logicDataVO.getDraftMapStationDirectionList())) {
|
||||
draftMapStationDirectionDAO.insertList(logicDataVO.getDraftMapStationDirectionList());
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteMapLogicData(Long id) {
|
||||
|
@ -1,56 +0,0 @@
|
||||
package club.joylink.rtss.services;
|
||||
|
||||
import club.joylink.rtss.entity.IndicatorButton;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IAssistButtonIndicatorService {
|
||||
|
||||
/**
|
||||
* 查找该地图下的指示灯、区间、站台、进路关系信息列表
|
||||
*
|
||||
* @param mapId 地图ID
|
||||
* @param standCode 站台
|
||||
* @param indicatorCode 指示灯ID
|
||||
* @param routeCode 进路编码
|
||||
* @return 关系列表
|
||||
*/
|
||||
PageVO<IndicatorButton> indicatorSectionList(Long mapId, String standCode, String indicatorCode, String routeCode, PageQueryVO queryVO);
|
||||
|
||||
|
||||
/**
|
||||
* 查找该地图下的指示灯、区间、站台、进路关系信息
|
||||
*
|
||||
* @param id 关系ID
|
||||
* @return 关系信息
|
||||
*/
|
||||
IndicatorButton queryIndicatorSection(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 保存指示灯关系数据
|
||||
*
|
||||
* @param mapId 地图ID
|
||||
* @param vo 实体类
|
||||
* @return 保存结果
|
||||
*/
|
||||
String saveIndicatorSection(Long mapId, IndicatorButton vo);
|
||||
|
||||
|
||||
/**
|
||||
* 删除指示灯关系数据
|
||||
*
|
||||
* @param id 关系ID
|
||||
*/
|
||||
void deleteIndicatorSection(Long id);
|
||||
|
||||
/**
|
||||
* 查找该地图下的指示灯、区间、站台、进路关系信息列表
|
||||
*
|
||||
* @param mapId 地图Id
|
||||
* @return 关系列表
|
||||
*/
|
||||
List<IndicatorButton> queryAllIndicatorSectionByMapId(Long mapId);
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.dao.DraftMapStationDirectionDAO;
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.entity.DraftMapStationDirectionExample;
|
||||
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 org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DraftMapStationDirectionServiceImpl implements IDraftMapStationDirectionService {
|
||||
@Autowired
|
||||
private DraftMapStationDirectionDAO draftMapStationDirectionDAO;
|
||||
|
||||
@Override
|
||||
public PageVO<DraftMapStationDirection> stationLabelList(Long mapId, String code
|
||||
, String labelEnum, PageQueryVO queryVO) {
|
||||
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||
DraftMapStationDirectionExample draftMapStationDirectionExample = new DraftMapStationDirectionExample();
|
||||
DraftMapStationDirectionExample.Criteria criteria = draftMapStationDirectionExample.createCriteria();
|
||||
criteria.andMapIdEqualTo(mapId);
|
||||
// code
|
||||
if (!StringUtils.isEmpty(code)) {
|
||||
criteria.andCodeEqualTo(code);
|
||||
}
|
||||
// 指示灯
|
||||
if (!StringUtils.isEmpty(labelEnum)) {
|
||||
criteria.andLabelEnumEqualTo(labelEnum);
|
||||
}
|
||||
Page<DraftMapStationDirection> page = (Page<DraftMapStationDirection>) draftMapStationDirectionDAO.selectByExample(draftMapStationDirectionExample);
|
||||
page.getResult().forEach(DraftMapStationDirection::generateSectionList);
|
||||
return PageVO.convert(page, page.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public DraftMapStationDirection queryStationLabel(Long id) {
|
||||
return draftMapStationDirectionDAO.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveStationLabel(Long mapId, DraftMapStationDirection vo) {
|
||||
vo.setMapId(mapId);
|
||||
if (!CollectionUtils.isEmpty(vo.getSectionList())) {
|
||||
vo.setSectionsCode(String.join(",", vo.getSectionList()));
|
||||
}
|
||||
int line;
|
||||
if (vo.getId() != null) {
|
||||
line = draftMapStationDirectionDAO.updateByPrimaryKey(vo);
|
||||
} else {
|
||||
// 手动拼接Code
|
||||
vo.setCode(vo.getStationCode() + "_" + vo.getLabelEnum());
|
||||
line = draftMapStationDirectionDAO.insert(vo);
|
||||
}
|
||||
return line != 0 ? "保存成功" : "保存失败";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStationLabel(Long id) {
|
||||
draftMapStationDirectionDAO.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DraftMapStationDirection> queryAllStationLabelByMapId(Long mapId) {
|
||||
DraftMapStationDirectionExample draftMapStationDirectionExample = new DraftMapStationDirectionExample();
|
||||
DraftMapStationDirectionExample.Criteria criteria = draftMapStationDirectionExample.createCriteria();
|
||||
criteria.andMapIdEqualTo(mapId);
|
||||
List<DraftMapStationDirection> list = draftMapStationDirectionDAO.selectByExample(draftMapStationDirectionExample);
|
||||
list.forEach(DraftMapStationDirection::generateSectionList);
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IDraftMapStationDirectionService {
|
||||
|
||||
/**
|
||||
* 查询地图下车站 方向下的逻辑数据列表
|
||||
*
|
||||
* @param mapId 地图ID
|
||||
* @param code Code
|
||||
* @param labelEnum 方向类型
|
||||
* @return 数据列表
|
||||
*/
|
||||
PageVO<DraftMapStationDirection> stationLabelList(Long mapId, String code, String labelEnum, PageQueryVO queryVO);
|
||||
|
||||
/**
|
||||
* 查找该地图下的指示灯、区间、站台、进路关系信息
|
||||
*
|
||||
* @param id 关系ID
|
||||
* @return 关系信息
|
||||
*/
|
||||
DraftMapStationDirection queryStationLabel(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 保存指示灯关系数据
|
||||
*
|
||||
* @param mapId 地图ID
|
||||
* @param vo 实体类
|
||||
* @return 保存结果
|
||||
*/
|
||||
String saveStationLabel(Long mapId, DraftMapStationDirection vo);
|
||||
|
||||
|
||||
/**
|
||||
* 删除指示灯关系数据
|
||||
*
|
||||
* @param id 关系ID
|
||||
*/
|
||||
void deleteStationLabel(Long id);
|
||||
|
||||
/**
|
||||
* 查找该地图下的指示灯、区间、站台、进路关系信息列表
|
||||
*
|
||||
* @param mapId 地图Id
|
||||
* @return 关系列表
|
||||
*/
|
||||
List<DraftMapStationDirection> queryAllStationLabelByMapId(Long mapId);
|
||||
}
|
@ -195,11 +195,9 @@ public class ATSMessageCollectAndDispatcher {
|
||||
case CATENARY:
|
||||
status = new CatenaryStatus((Catenary) device);
|
||||
break;
|
||||
case INDICATOR:
|
||||
status = new IndicatorStatus((Indicator) device);
|
||||
break;
|
||||
case BUTTON:
|
||||
status = new ButtonStatus((Button) device);
|
||||
|
||||
case STATION_DIRECTION:
|
||||
status = new StationDirectionStatus((StationDirection) device);
|
||||
break;
|
||||
}
|
||||
return status;
|
||||
@ -246,11 +244,8 @@ public class ATSMessageCollectAndDispatcher {
|
||||
status = new CatenaryStatusVO((Catenary) device);
|
||||
break;
|
||||
|
||||
case INDICATOR:
|
||||
status = new IndicatorStatusVO((Indicator) device);
|
||||
break;
|
||||
case BUTTON:
|
||||
status = new ButtonStatusVO((Button) device);
|
||||
case STATION_DIRECTION:
|
||||
status = new StationDirectionStatusVO((StationDirection) device);
|
||||
break;
|
||||
}
|
||||
return status;
|
||||
|
@ -1,21 +1,21 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.operation.handler;
|
||||
|
||||
import club.joylink.rtss.constants.ButtonTypeEnum;
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandlerMapping;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.assist.AssistService;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.assist.StationDirectionService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Button;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@OperateHandler
|
||||
public class AssistOperateHandler {
|
||||
public class StationDirectionOperateHandler {
|
||||
@Autowired
|
||||
private AssistService assistService;
|
||||
private StationDirectionService stationDirectionService;
|
||||
|
||||
/**
|
||||
* 改方按钮按下操作
|
||||
@ -26,9 +26,8 @@ public class AssistOperateHandler {
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_DOWN_TURN_DIRECTION)
|
||||
public void pressDownTurnDirection(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum) {
|
||||
assistService.changeButtonAspect(simulation,
|
||||
stationCode, labelEnum, ButtonTypeEnum.CHANGE_DIRECTION, Boolean.TRUE
|
||||
, assistService.turnDirectionPressDownValid
|
||||
, assistService.turnDirectionPressDownDo);
|
||||
stationDirectionService.changeButtonAspect(simulation,
|
||||
stationCode, labelEnum, Button.ButtonTypeEnum.CHANGE_DIRECTION, Boolean.TRUE
|
||||
, stationDirectionService.turnDirectionPressDownValid, null);
|
||||
}
|
||||
}
|
@ -1,297 +0,0 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.service.assist;
|
||||
|
||||
import club.joylink.rtss.constants.ButtonTypeEnum;
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import club.joylink.rtss.constants.IndicatorTypeEnum;
|
||||
import club.joylink.rtss.entity.IndicatorButton;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiRouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Button;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Indicator;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import club.joylink.rtss.simulation.cbtc.onboard.ATP.ATPService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
/**
|
||||
* 工具箱操作service
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AssistService {
|
||||
@Autowired
|
||||
private ATPService atpService;
|
||||
|
||||
@Autowired
|
||||
private CiRouteService routeService;
|
||||
|
||||
/**
|
||||
* 修改按钮状态信息
|
||||
*
|
||||
* @param simulation 仿真数据
|
||||
* @param stationCode 车站编码
|
||||
* @param label 按钮类型
|
||||
* @param type 类型
|
||||
* @param pressDown true:按下,false:抬起
|
||||
* @param validMethod 操作检验
|
||||
* @param buttonDoMethod 操作后触发动作
|
||||
*/
|
||||
public void changeButtonAspect(Simulation simulation, String stationCode,
|
||||
DirectionLabelEnum label, ButtonTypeEnum type, boolean pressDown,
|
||||
ButtonValidInterface validMethod, ButtonThenInterface buttonDoMethod) {
|
||||
Station curStation = getStationByCode(simulation, stationCode);
|
||||
Button curButton = getStationButtonByType(curStation, label, type);
|
||||
// 检验操作
|
||||
if (validMethod != null) {
|
||||
validMethod.valid(simulation, curButton);
|
||||
}
|
||||
// 修改状态
|
||||
curButton.setPressDown(pressDown);
|
||||
// 后续动作
|
||||
if (buttonDoMethod != null) {
|
||||
buttonDoMethod.doThen(simulation, curButton);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新区间灯状态
|
||||
*/
|
||||
public void refreshSectionLightStatus(Simulation simulation, IndicatorButton indicatorButton) {
|
||||
Indicator indicator = simulation.getRepository().getByCode(indicatorButton.getCode(), Indicator.class);
|
||||
if (indicator == null || CollectionUtils.isEmpty(indicator.getSectionList())) {
|
||||
return;
|
||||
}
|
||||
// 是否被占用,TRUE 未占用,FALSE 占用
|
||||
boolean isNotOccupied = indicator.getSectionList()
|
||||
.stream()
|
||||
.filter(section -> section.isOccupied()).findAny().isEmpty();
|
||||
// 占用为红色
|
||||
IndicatorStatusEnum statusEnum = isNotOccupied ? IndicatorStatusEnum.No : IndicatorStatusEnum.R;
|
||||
// 占用点亮时,灭掉改方按钮
|
||||
if (IndicatorStatusEnum.R.equals(statusEnum)) {
|
||||
indicator.getStation().getButtonsList()
|
||||
.stream()
|
||||
.filter(button -> indicator.getLabel().equals(button.getLabel()) && ButtonTypeEnum.CHANGE_DIRECTION.equals(button.getType()))
|
||||
.forEach(button -> button.setPressDown(false));
|
||||
}
|
||||
|
||||
indicator.setAspect(statusEnum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 各方向接、发车电灯状态刷新
|
||||
*
|
||||
* @param curStation 当前站
|
||||
* @param labelEnum 方向标签
|
||||
*/
|
||||
public void refreshReceiveAndDeliverLightStatus(Station curStation, DirectionLabelEnum labelEnum) {
|
||||
// 获取接车指示灯
|
||||
Indicator receiveIndicator = getStationIndicatorByType(curStation, labelEnum, IndicatorTypeEnum.RECEIVE);
|
||||
// 获取发车指示灯
|
||||
Indicator deliverIndicator = getStationIndicatorByType(curStation, labelEnum, IndicatorTypeEnum.DELIVER);
|
||||
// 如果都没有亮
|
||||
if (deliverIndicator != null && receiveIndicator != null && !deliverIndicator.isOn() && !receiveIndicator.isOn()) {
|
||||
// X、S方向为接车方向默认亮起
|
||||
if (DirectionLabelEnum.X.equals(labelEnum) || DirectionLabelEnum.S.equals(labelEnum)) {
|
||||
receiveIndicator.setOn(true);
|
||||
} else { // 其他方向默认发车灯亮起
|
||||
deliverIndicator.setOn(true);
|
||||
}
|
||||
}
|
||||
IndicatorStatusEnum receiveStatus = getRDIndicatorStatusEnum(receiveIndicator, deliverIndicator);
|
||||
IndicatorStatusEnum deliverStatus = getRDIndicatorStatusEnum(deliverIndicator, receiveIndicator);
|
||||
if (receiveIndicator != null) {
|
||||
receiveIndicator.setAspect(receiveStatus);
|
||||
}
|
||||
if (deliverIndicator != null) {
|
||||
deliverIndicator.setAspect(deliverStatus);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 改方按钮按下校验
|
||||
*/
|
||||
public ButtonValidInterface turnDirectionPressDownValid = (simulation, button) -> {
|
||||
if (button == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:按钮不存在");
|
||||
}
|
||||
if (button.getStand() == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:按钮未绑定站台");
|
||||
}
|
||||
// 由数据控制,不做逻辑判断
|
||||
// List<Station> stationList = simulation.getRepository().getStationList();
|
||||
// // 当前站位置
|
||||
// int index = stationList.indexOf(button.getStation());
|
||||
// // 检查是否是首站
|
||||
// if (index == 0 || index == stationList.size() - 1) {
|
||||
// throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:首站不可改方");
|
||||
// }
|
||||
// 获取区间指示灯
|
||||
Indicator sectionIndicator = getStationIndicatorByType(button.getStation(), button.getLabel(), IndicatorTypeEnum.SECTION);
|
||||
// 获取区间路径,判断本站台与相邻站台是否空闲
|
||||
if (sectionIndicator != null && IndicatorStatusEnum.R.equals(sectionIndicator.getAspect())) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:区段非空闲");
|
||||
}
|
||||
// 判断接车灯进路是否办理
|
||||
Indicator receiveIndicator = getStationIndicatorByType(button.getStation(), button.getLabel(), IndicatorTypeEnum.RECEIVE);
|
||||
if (receiveIndicator != null && receiveIndicator.getRoute() != null && receiveIndicator.getRoute().isLock()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:进路冲突");
|
||||
}
|
||||
// 获取靠停列车
|
||||
VirtualRealityTrain train = getSandStopTrain(simulation, button.getStand().getSection().getCode());
|
||||
if (train == null || !train.isStop()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:未停靠列车");
|
||||
}
|
||||
// 判断本站台是否是接车站台,这里不做判断,在改方实际操作时,判断列车
|
||||
// boolean isReceive = button.getStand().isRight() == train.isRight();
|
||||
// if (!isReceive) {
|
||||
// throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:非接车方向");
|
||||
// }
|
||||
};
|
||||
|
||||
/**
|
||||
* 改方按钮后续操作
|
||||
*/
|
||||
public ButtonThenInterface turnDirectionPressDownDo = (simulation, button) -> {
|
||||
if (button == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:按钮不存在");
|
||||
}
|
||||
// 相邻站台是否也为接车状态,如果是要做辅助操作(目前不做)
|
||||
// 获取靠停列车
|
||||
VirtualRealityTrain train = getSandStopTrain(simulation, button.getStand().getSection().getCode());
|
||||
if (train == null || !train.isStop()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:未停靠列车");
|
||||
}
|
||||
// 判断列车是否要执行换端
|
||||
if (button.getStand().isRight() == train.isRight()) {
|
||||
// 列车换端
|
||||
atpService.turnDirectionImmediately(train);
|
||||
}
|
||||
// 获取发车指示灯
|
||||
Indicator deliverIndicator = getStationIndicatorByType(button.getStation(), button.getLabel(), IndicatorTypeEnum.DELIVER);
|
||||
// 办进路
|
||||
routeService.setRoute(simulation, deliverIndicator.getRoute());
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前车站实体
|
||||
*
|
||||
* @param simulation 仿真实体数据
|
||||
* @param stationCode 车站编码
|
||||
* @return 车站实体
|
||||
*/
|
||||
private Station getStationByCode(Simulation simulation, String stationCode) {
|
||||
Optional<Station> stationOptional = simulation.getRepository().getStationList()
|
||||
.stream()
|
||||
.filter(station -> stationCode.equals(station.getCode()))
|
||||
.findFirst();
|
||||
// 当前所在车站
|
||||
Station station;
|
||||
if (stationOptional.isPresent()) {
|
||||
station = stationOptional.get();
|
||||
} else {
|
||||
throw new SimulationException(SimulationExceptionType.System_Fault, "操作异常:车站不存在");
|
||||
}
|
||||
return station;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前按钮实体
|
||||
*
|
||||
* @param station 车站编码
|
||||
* @param label 按钮类型
|
||||
* @param type 类型
|
||||
* @return 操作按钮实体
|
||||
*/
|
||||
private Button getStationButtonByType(Station station, DirectionLabelEnum label, ButtonTypeEnum type) {
|
||||
Optional<Button> buttonOptional = station.getButtonsList()
|
||||
.stream()
|
||||
.filter(button -> label.equals(button.getLabel()) && type.equals(button.getType()))
|
||||
.findAny();
|
||||
// 获取操作按钮
|
||||
Button button;
|
||||
if (buttonOptional.isPresent()) {
|
||||
button = buttonOptional.get();
|
||||
} else {
|
||||
button = null;
|
||||
}
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前指示灯实体
|
||||
*
|
||||
* @param station 车站编码
|
||||
* @param label 按钮类型
|
||||
* @param type 类型
|
||||
* @return 指示灯
|
||||
*/
|
||||
private Indicator getStationIndicatorByType(Station station, DirectionLabelEnum label, IndicatorTypeEnum type) {
|
||||
Optional<Indicator> indicatorOptional = station.getIndicatorList()
|
||||
.stream()
|
||||
.filter(indicator -> label.equals(indicator.getLabel()) && type.equals(indicator.getType()))
|
||||
.findAny();
|
||||
// 获取操作按钮
|
||||
Indicator indicator;
|
||||
if (indicatorOptional.isPresent()) {
|
||||
indicator = indicatorOptional.get();
|
||||
} else {
|
||||
indicator = null;
|
||||
}
|
||||
return indicator;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取停靠列车
|
||||
*
|
||||
* @param simulation 仿真对象
|
||||
* @param sectionCode 区段编码
|
||||
* @return 列车数据
|
||||
*/
|
||||
private VirtualRealityTrain getSandStopTrain(Simulation simulation, String sectionCode) {
|
||||
Optional<VirtualRealityTrain> trainOptional = simulation.getRepository().getOnlineTrainList()
|
||||
.stream()
|
||||
.filter(trainInfo -> trainInfo != null && sectionCode.equals(trainInfo.getHeadPosition().getSection().getCode()))
|
||||
.findAny();
|
||||
VirtualRealityTrain train;
|
||||
if (trainOptional.isPresent()) {
|
||||
train = trainOptional.get();
|
||||
} else {
|
||||
train = null;
|
||||
}
|
||||
return train;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接发车指示灯状态
|
||||
*
|
||||
* @param indicator 指示灯
|
||||
* @param mutexIndicator 同组指示灯,接-发
|
||||
* @return 点灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum getRDIndicatorStatusEnum(Indicator indicator, Indicator mutexIndicator) {
|
||||
if (indicator == null) {
|
||||
return IndicatorStatusEnum.No;
|
||||
}
|
||||
boolean isLock = indicator.getRoute() != null && indicator.getRoute().isLock();
|
||||
if (isLock) {
|
||||
indicator.setOn(true);
|
||||
if (mutexIndicator != null) {
|
||||
mutexIndicator.setOn(false);
|
||||
}
|
||||
}
|
||||
IndicatorStatusEnum statusEnum = indicator.isOn() ?
|
||||
(isLock ? IndicatorStatusEnum.R : indicator.getDefaultStatus())
|
||||
: IndicatorStatusEnum.No;
|
||||
return statusEnum;
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.service.assist;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Button;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.StationDirection;
|
||||
|
||||
/**
|
||||
* 按钮操作后续操作
|
||||
@ -12,7 +12,7 @@ public interface ButtonThenInterface {
|
||||
* 按钮状态改变的后续操作
|
||||
*
|
||||
* @param simulation 仿真实体
|
||||
* @param curButton 按钮实体
|
||||
* @param stationDirection 按钮实体
|
||||
*/
|
||||
void doThen(Simulation simulation, Button curButton);
|
||||
void doThen(Simulation simulation, StationDirection stationDirection);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.service.assist;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Button;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.StationDirection;
|
||||
|
||||
/**
|
||||
* 检验按钮是否可以操作
|
||||
@ -12,7 +12,7 @@ public interface ButtonValidInterface {
|
||||
* 验证按钮是否可以操作
|
||||
*
|
||||
* @param simulation 仿真数据
|
||||
* @param curButton 当前按钮
|
||||
* @param stationDirection 关联数据
|
||||
*/
|
||||
void valid(Simulation simulation, Button curButton);
|
||||
void valid(Simulation simulation, StationDirection stationDirection);
|
||||
}
|
||||
|
@ -0,0 +1,133 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.service.assist;
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 车站行驶方向
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class StationDirectionService {
|
||||
/**
|
||||
* 修改按钮状态信息
|
||||
*
|
||||
* @param simulation 仿真数据
|
||||
* @param stationCode 车站编码
|
||||
* @param label 按钮类型
|
||||
* @param type 类型
|
||||
* @param pressDown true:按下,false:抬起
|
||||
* @param validMethod 操作检验
|
||||
* @param buttonDoMethod 操作后触发动作
|
||||
*/
|
||||
public void changeButtonAspect(Simulation simulation, String stationCode, DirectionLabelEnum label, Button.ButtonTypeEnum type,
|
||||
boolean pressDown, ButtonValidInterface validMethod, ButtonThenInterface buttonDoMethod) {
|
||||
Station curStation = getStationByCode(simulation, stationCode);
|
||||
StationDirection stationDirection = curStation.getStationDirectionMap().get(label);
|
||||
// 检验操作
|
||||
if (validMethod != null) {
|
||||
validMethod.valid(simulation, stationDirection);
|
||||
}
|
||||
// 修改状态
|
||||
stationDirection.modifyButtonStatus(type, pressDown);
|
||||
// 后续动作
|
||||
if (buttonDoMethod != null) {
|
||||
buttonDoMethod.doThen(simulation, stationDirection);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新区间灯状态
|
||||
*/
|
||||
public void refreshSectionLightStatus(Simulation simulation, DraftMapStationDirection draftMapStationDirection) {
|
||||
Station station = getStationByCode(simulation, draftMapStationDirection.getStationCode());
|
||||
StationDirection stationDirection = station.getStationDirectionMap().get(draftMapStationDirection.getLabelEnum());
|
||||
if (stationDirection == null) {
|
||||
return;
|
||||
}
|
||||
// 刷新接发车状态
|
||||
stationDirection.refreshReceiveAndDeliverStatus();
|
||||
// 刷新接发车点灯状态
|
||||
stationDirection.refreshAspectStatus();
|
||||
// 刷新区段占用状态
|
||||
stationDirection.refreshSectionStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
* 改方按钮按下校验
|
||||
*/
|
||||
public ButtonValidInterface turnDirectionPressDownValid = (simulation, stationLabelEnum) -> {
|
||||
boolean isExist = stationLabelEnum.getButtonList()
|
||||
.stream()
|
||||
.anyMatch(button -> Button.ButtonTypeEnum.CHANGE_DIRECTION.equals(button.getType()));
|
||||
if (!isExist) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:按钮不存在");
|
||||
}
|
||||
// 区间是否空闲
|
||||
if (IndicatorStatusEnum.R.equals(stationLabelEnum.getSectionAspect())) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:区段非空闲");
|
||||
}
|
||||
// 接车进路有锁闭,有车进入
|
||||
boolean isReceiveConflict = stationLabelEnum.getReceiveRouteList().stream().anyMatch(Route::isLock);
|
||||
if (isReceiveConflict) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:存在接车进路冲突");
|
||||
}
|
||||
// 查找发车进路方向的站台上是否有停靠列车
|
||||
Optional<Route> routeOptional = stationLabelEnum.getReceiveRouteList().stream().findAny();
|
||||
if (routeOptional.isEmpty()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:没有接车进路");
|
||||
}
|
||||
Route route = routeOptional.get();
|
||||
List<Stand> standList;
|
||||
if (route.isRight()) {
|
||||
standList = stationLabelEnum.getStation().getRdStandList();
|
||||
} else {
|
||||
standList = stationLabelEnum.getStation().getLdStandList();
|
||||
}
|
||||
// 获取靠停列车
|
||||
List<String> sectionCodeList = simulation.getRepository().getOnlineTrainList()
|
||||
.stream()
|
||||
.filter(VirtualRealityTrain::isStop)
|
||||
.map(trainInfo -> trainInfo.getHeadPosition().getSection().getCode())
|
||||
.collect(Collectors.toList());
|
||||
boolean isStopTrain = standList.stream().anyMatch(stand -> sectionCodeList.contains(stand.getSection().getCode()));
|
||||
if (!isStopTrain) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:未停靠列车");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前车站实体
|
||||
*
|
||||
* @param simulation 仿真实体数据
|
||||
* @param stationCode 车站编码
|
||||
* @return 车站实体
|
||||
*/
|
||||
private Station getStationByCode(Simulation simulation, String stationCode) {
|
||||
Optional<Station> stationOptional = simulation.getRepository().getStationList()
|
||||
.stream()
|
||||
.filter(station -> stationCode.equals(station.getCode()))
|
||||
.findFirst();
|
||||
// 当前所在车站
|
||||
Station station;
|
||||
if (stationOptional.isPresent()) {
|
||||
station = stationOptional.get();
|
||||
} else {
|
||||
throw new SimulationException(SimulationExceptionType.System_Fault, "操作异常:车站不存在");
|
||||
}
|
||||
return station;
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package club.joylink.rtss.simulation.cbtc.CI;
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.assist.AssistService;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.assist.StationDirectionService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiDeviceStatusCollector;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiRouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiService;
|
||||
@ -14,10 +13,8 @@ import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@ -31,7 +28,7 @@ public class CiLogic {
|
||||
@Autowired
|
||||
private CiService ciService;
|
||||
@Autowired
|
||||
private AssistService assistService;
|
||||
private StationDirectionService stationDirectionService;
|
||||
|
||||
public void run(Simulation simulation) {
|
||||
// 采集真实设备状态
|
||||
@ -53,20 +50,24 @@ public class CiLogic {
|
||||
|
||||
// 区间灯点灯逻辑
|
||||
if (simulation.getRepository().getConfig().isHasCTC()) {
|
||||
// 区间灯点灯
|
||||
simulation.getBuildParams().getMap().getLogicDataNew().getIndicatorButtonVOList()
|
||||
// 联锁数据检查
|
||||
simulation.getBuildParams().getMap().getLogicDataNew().getDraftMapStationDirectionList()
|
||||
.stream()
|
||||
.filter(indicatorButton -> "indicator".equals(indicatorButton.getModelType()) && "section".equals(indicatorButton.getType()))
|
||||
.forEach(indicatorSectionVO -> assistService.refreshSectionLightStatus(simulation, indicatorSectionVO));
|
||||
|
||||
// 接发车点灯
|
||||
simulation.getRepository().getStationList()
|
||||
.stream()
|
||||
.filter(station -> !CollectionUtils.isEmpty(station.getIndicatorList()))
|
||||
.forEach(station -> {
|
||||
Stream.of(DirectionLabelEnum.values())
|
||||
.forEach(label -> assistService.refreshReceiveAndDeliverLightStatus(station, label));
|
||||
});
|
||||
.forEach(stationDirectionLabel -> stationDirectionService.refreshSectionLightStatus(simulation, stationDirectionLabel));
|
||||
// // 区间灯点灯
|
||||
// simulation.getBuildParams().getMap().getLogicDataNew().getDraftMapStationDirectionLabelVOList()
|
||||
// .stream()
|
||||
// .filter(indicatorButton -> "indicator".equals(indicatorButton.getModelType()) && "section".equals(indicatorButton.getType()))
|
||||
// .forEach(indicatorSectionVO -> assistService.refreshSectionLightStatus(simulation, indicatorSectionVO));
|
||||
//
|
||||
// // 接发车点灯
|
||||
// simulation.getRepository().getStationList()
|
||||
// .stream()
|
||||
// .filter(station -> !CollectionUtils.isEmpty(station.getIndicatorList()))
|
||||
// .forEach(station -> {
|
||||
// Stream.of(DirectionLabelEnum.values())
|
||||
// .forEach(label -> assistService.refreshReceiveAndDeliverLightStatus(station, label));
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package club.joylink.rtss.simulation.cbtc;
|
||||
|
||||
import club.joylink.rtss.entity.Ibp;
|
||||
import club.joylink.rtss.services.IAssistButtonIndicatorService;
|
||||
import club.joylink.rtss.services.IVirtualRealityIbpService;
|
||||
import club.joylink.rtss.services.IVoiceCommandService;
|
||||
import club.joylink.rtss.services.draftData.IDraftMapStationDirectionService;
|
||||
import club.joylink.rtss.services.iscs.IscsDeviceService;
|
||||
import club.joylink.rtss.services.iscs.IscsSystemResourcesService;
|
||||
import club.joylink.rtss.services.psl.IVirtualRealityPslService;
|
||||
@ -133,7 +133,7 @@ public class SimulationLifeCycleServiceImpl implements SimulationLifeCycleServic
|
||||
private CTCLogicLoop ctcLogicLoop;
|
||||
|
||||
@Autowired
|
||||
private IAssistButtonIndicatorService assistButtonIndicatorService;
|
||||
private IDraftMapStationDirectionService assistButtonIndicatorService;
|
||||
|
||||
@Override
|
||||
public Simulation create(SimulationBuildParams params, String group) {
|
||||
|
@ -1,8 +1,6 @@
|
||||
package club.joylink.rtss.simulation.cbtc.build;
|
||||
|
||||
import club.joylink.rtss.constants.ButtonTypeEnum;
|
||||
import club.joylink.rtss.constants.IndicatorTypeEnum;
|
||||
import club.joylink.rtss.entity.IndicatorButton;
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.draftData.RoutingGenerator;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
|
||||
@ -245,7 +243,7 @@ public class InterlockBuilder2 {
|
||||
// ------------目的地码end-------------
|
||||
|
||||
// 处理指示灯、按钮逻辑信息
|
||||
InterlockBuilder2.buildAssistIndicatorAndButtonLogic(elementMap, errMsgList, logicData.getIndicatorButtonVOList());
|
||||
InterlockBuilder2.buildStationDirectionLabelLogic(elementMap, errMsgList, logicData.getDraftMapStationDirectionList());
|
||||
|
||||
// 根据站间运行等级数据构建路径单元
|
||||
// if (!errMsgList.isEmpty()) {
|
||||
@ -1551,83 +1549,72 @@ public class InterlockBuilder2 {
|
||||
InterlockBuilder2.log.debug("构建自动折返进路耗时:" + (System.currentTimeMillis() - start));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建指示灯、按钮的逻辑信息
|
||||
* 构建车站 方向联锁数据
|
||||
*
|
||||
* @param elementMap 设备信息
|
||||
* @param errMsgList 错误信息
|
||||
* @param indicatorButtonVOList 逻辑关联关系
|
||||
*/
|
||||
private static void buildAssistIndicatorAndButtonLogic(Map<String, MapElement> elementMap, List<String> errMsgList, List<IndicatorButton> indicatorButtonVOList) {
|
||||
if (!CollectionUtils.isEmpty(indicatorButtonVOList)) {
|
||||
indicatorButtonVOList.stream().forEach(indicatorButton -> {
|
||||
if ("indicator".equals(indicatorButton.getModelType())) {
|
||||
InterlockBuilder2.buildAssistIndicatorLogic(elementMap, elementMap.get(indicatorButton.getCode()), indicatorButton);
|
||||
} else {
|
||||
InterlockBuilder2.buildAssistButtonLogic(elementMap, elementMap.get(indicatorButton.getCode()), indicatorButton);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建指示灯的逻辑信息
|
||||
*
|
||||
* @param stationDirectionList 逻辑关联关系
|
||||
* @param elementMap 设备信息
|
||||
* @param element 实体
|
||||
* @param indicatorButton 逻辑关联关系
|
||||
*/
|
||||
private static void buildAssistIndicatorLogic(Map<String, MapElement> elementMap, MapElement element, IndicatorButton indicatorButton) {
|
||||
if (element == null) {
|
||||
return;
|
||||
}
|
||||
// 获取指示灯
|
||||
Indicator indicator = (Indicator) element;
|
||||
// 有关联的区间信息
|
||||
if (!CollectionUtils.isEmpty(indicatorButton.getSectionList())) {
|
||||
List<Section> sectionList = indicatorButton.getSectionList()
|
||||
private static void buildStationDirectionLabelLogic(Map<String, MapElement> elementMap, List<String> errMsgList, List<DraftMapStationDirection> stationDirectionList) {
|
||||
if (!CollectionUtils.isEmpty(stationDirectionList)) {
|
||||
List<Route> routeList = elementMap.values().stream()
|
||||
.filter(element -> MapElement.DeviceType.ROUTE.equals(element.getDeviceType()))
|
||||
.map(element -> (Route) element)
|
||||
.collect(Collectors.toList());
|
||||
// 首端信号机
|
||||
Map<String, List<String>> startMap =
|
||||
routeList.stream().collect(
|
||||
Collectors.groupingBy((route) -> route.getStart().getCode(),
|
||||
Collectors.mapping(route -> route.getCode(), Collectors.toList())));
|
||||
// 末端信号机
|
||||
Map<String, List<String>> endMap =
|
||||
routeList.stream().collect(
|
||||
Collectors.groupingBy((route) -> route.getDestination().getCode(),
|
||||
Collectors.mapping(route -> route.getCode(), Collectors.toList())));
|
||||
// 循环设置信息
|
||||
stationDirectionList.stream().forEach(stationDirection -> {
|
||||
if (elementMap.containsKey(stationDirection.getCode())) {
|
||||
errMsgList.add("已经存在车站运行方向" + stationDirection.getCode());
|
||||
} else {
|
||||
StationDirection model = new StationDirection(stationDirection.getCode(), stationDirection.getCode(), stationDirection.getLabelEnum());
|
||||
Station station = (Station) elementMap.get(stationDirection.getStationCode());
|
||||
model.setStation(station);
|
||||
// 注入区间数据
|
||||
if (!CollectionUtils.isEmpty(stationDirection.getSectionList())) {
|
||||
List<Section> sectionList = stationDirection.getSectionList()
|
||||
.stream()
|
||||
.map(sectionCode -> (Section) elementMap.get(sectionCode))
|
||||
.collect(Collectors.toList());
|
||||
indicator.setSectionList(sectionList);
|
||||
model.setSectionList(sectionList);
|
||||
}
|
||||
// 获取站台信息
|
||||
if (!StringUtils.isEmpty(indicatorButton.getStandCode())) {
|
||||
Stand stand = (Stand) elementMap.get(indicatorButton.getStandCode());
|
||||
indicator.setStand(stand);
|
||||
}
|
||||
// 获取进路信息
|
||||
if (!StringUtils.isEmpty(indicatorButton.getRouteCode())) {
|
||||
Route route = (Route) elementMap.get(indicatorButton.getRouteCode());
|
||||
indicator.setRoute(route);
|
||||
}
|
||||
// 指示灯类型
|
||||
indicator.setType(IndicatorTypeEnum.getType(indicatorButton.getType()));
|
||||
indicator.reset();
|
||||
// 注入信号灯数据
|
||||
if (!StringUtils.isEmpty(stationDirection.getSignalCode())) {
|
||||
Signal signal = (Signal) elementMap.get(stationDirection.getSignalCode());
|
||||
model.setSignal(signal);
|
||||
// 以方向信号机为首的进路,接车进路
|
||||
startMap.getOrDefault(signal.getCode(), new ArrayList<>(0)).forEach(code -> {
|
||||
model.getReceiveRouteList().add((Route) elementMap.get(code));
|
||||
});
|
||||
// 以方向信号机为尾的进路,发车进路
|
||||
endMap.getOrDefault(signal.getCode(), new ArrayList<>(0)).forEach(code -> {
|
||||
model.getDeliverRouteList().add((Route) elementMap.get(code));
|
||||
});
|
||||
}
|
||||
// 放入按钮数据
|
||||
station.getButtonList().stream()
|
||||
.filter(button -> model.getLabelEnum().equals(button.getLabel()))
|
||||
.forEach(button -> model.getButtonList().add(button));
|
||||
|
||||
/**
|
||||
* 构建按钮的逻辑信息
|
||||
*
|
||||
* @param elementMap 设备信息
|
||||
* @param element 实体
|
||||
* @param indicatorButton 逻辑关联关系
|
||||
*/
|
||||
private static void buildAssistButtonLogic(Map<String, MapElement> elementMap, MapElement element, IndicatorButton indicatorButton) {
|
||||
// 获取指示灯
|
||||
if (element == null) {
|
||||
return;
|
||||
// 放入指示灯数据
|
||||
station.getIndicatorList().stream()
|
||||
.filter(indicator -> model.getLabelEnum().equals(indicator.getLabel()))
|
||||
.forEach(indicator -> model.getIndicatorList().add(indicator));
|
||||
|
||||
station.getStationDirectionMap().put(model.getLabelEnum(), model);
|
||||
elementMap.put(model.getCode(), model);
|
||||
}
|
||||
Button button = (Button) element;
|
||||
// 获取站台信息
|
||||
if (!StringUtils.isEmpty(indicatorButton.getStandCode())) {
|
||||
Stand stand = (Stand) elementMap.get(indicatorButton.getStandCode());
|
||||
button.setStand(stand);
|
||||
});
|
||||
}
|
||||
// 指示灯类型
|
||||
button.setType(ButtonTypeEnum.getType(indicatorButton.getType()));
|
||||
button.reset();
|
||||
}
|
||||
}
|
||||
|
@ -701,10 +701,9 @@ public class MapDeviceBuilder {
|
||||
}
|
||||
|
||||
// 构建接、发、区间、辅助指示灯
|
||||
MapDeviceBuilder.buildAssistIndicator(elementMap, errMsgList, graphData.getIndicatorLightList());
|
||||
|
||||
MapDeviceBuilder.buildIndicatorList(elementMap, errMsgList, graphData.getIndicatorLightList());
|
||||
// 构建辅助、改方按钮
|
||||
MapDeviceBuilder.buildAssistButton(elementMap, errMsgList, graphData.getSignalButtonList());
|
||||
MapDeviceBuilder.buildButtonList(elementMap, errMsgList, graphData.getSignalButtonList());
|
||||
}
|
||||
|
||||
private static List<MapStationStandNewVO> buildStand(MapGraphDataNewVO graphData, Map<String, MapElement> elementMap, List<String> errMsgList) {
|
||||
@ -1511,29 +1510,29 @@ public class MapDeviceBuilder {
|
||||
* 构建指示灯
|
||||
*
|
||||
* @param elementMap 资源map
|
||||
* @param errMsgList 错误提示
|
||||
* @param indicatorList 指示灯信息
|
||||
*/
|
||||
private static void buildAssistIndicator(Map<String, MapElement> elementMap
|
||||
, List<String> errMsgList, List<MapIndicatorLightVO> indicatorList) {
|
||||
// 区间占用\辅助状态\总辅助\发车辅助\接车辅助\接发车箭头\复原\事故\闭塞
|
||||
private static void buildIndicatorList(Map<String, MapElement> elementMap, List<String> errMsgList
|
||||
, List<MapIndicatorLightVO> indicatorList) {
|
||||
// 区间占用\辅助状态\总辅助\发车辅助\接车辅助\接\发车箭头\复原\事故\闭塞
|
||||
List<String> indicatorTypeList = Arrays.asList(
|
||||
"SectionOccupied", "AssistStatus", "TotalAssist", "DepartAssist", "PickAssist", "PickOrDepartArrow",
|
||||
"Recovery", "Accident", "Occlusion"
|
||||
"SectionOccupied", "AssistStatus", "TotalAssist", "DepartAssist", "PickAssist",
|
||||
"PickArrow", "DepartArrow", "Recovery", "Accident", "Occlusion"
|
||||
);
|
||||
indicatorList
|
||||
.stream()
|
||||
.filter(mapIndicatorLightVO -> indicatorTypeList.contains(mapIndicatorLightVO.getType()))
|
||||
.forEach(mapSignalButtonVO -> {
|
||||
if (elementMap.containsKey(mapSignalButtonVO.getCode())) {
|
||||
errMsgList.add(String.format("指示灯[%s]必须唯一", mapSignalButtonVO.getCode()));
|
||||
errMsgList.add("已存在指示灯 " + mapSignalButtonVO.getStationCode());
|
||||
} else {
|
||||
Indicator indicator = new Indicator(mapSignalButtonVO.getCode(), mapSignalButtonVO.getName());
|
||||
indicator.setLabel(mapSignalButtonVO.getLabelEnum());
|
||||
indicator.setTypeStr(mapSignalButtonVO.getType());
|
||||
Station station = (Station) elementMap.get(mapSignalButtonVO.getStationCode());
|
||||
indicator.setStation(station);
|
||||
station.getIndicatorList().add(indicator);
|
||||
elementMap.put(indicator.getCode(), indicator);
|
||||
elementMap.put(mapSignalButtonVO.getCode(), indicator);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1542,11 +1541,11 @@ public class MapDeviceBuilder {
|
||||
* 构建按钮设备
|
||||
*
|
||||
* @param elementMap 设备Map
|
||||
* @param errMsgList 错误列表
|
||||
* @param errMsgList 错误日志
|
||||
* @param signalButtonList 按钮列表
|
||||
*/
|
||||
private static void buildAssistButton(Map<String, MapElement> elementMap
|
||||
, List<String> errMsgList, List<MapSignalButtonVO> signalButtonList) {
|
||||
private static void buildButtonList(Map<String, MapElement> elementMap, List<String> errMsgList
|
||||
, List<MapSignalButtonVO> signalButtonList) {
|
||||
// 总、接、发、改方
|
||||
List<MapSignalButtonVO.Type> buttonTypeList = Arrays.asList(
|
||||
MapSignalButtonVO.Type.ASSIST,
|
||||
@ -1559,14 +1558,15 @@ public class MapDeviceBuilder {
|
||||
.filter(mapSignalButtonVO -> buttonTypeList.contains(mapSignalButtonVO.getType()))
|
||||
.forEach(mapSignalButtonVO -> {
|
||||
if (elementMap.containsKey(mapSignalButtonVO.getCode())) {
|
||||
errMsgList.add(String.format("按钮[%s]必须唯一", mapSignalButtonVO.getCode()));
|
||||
errMsgList.add("已存在按钮 " + mapSignalButtonVO.getStationCode());
|
||||
} else {
|
||||
Button button = new Button(mapSignalButtonVO.getCode(), mapSignalButtonVO.getName());
|
||||
button.setLabel(mapSignalButtonVO.getLabelEnum());
|
||||
Station station = (Station) elementMap.get(mapSignalButtonVO.getStationCode());
|
||||
button.setStation(station);
|
||||
station.getButtonsList().add(button);
|
||||
elementMap.put(button.getCode(), button);
|
||||
button.setTypeStr(mapSignalButtonVO.getType());
|
||||
station.getButtonList().add(button);
|
||||
elementMap.put(mapSignalButtonVO.getCode(), button);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.map;
|
||||
|
||||
import club.joylink.rtss.constants.ButtonTypeEnum;
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.vo.map.graph.MapSignalButtonVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@ -16,11 +16,6 @@ public class Button extends MapNamedElement {
|
||||
*/
|
||||
private Station station;
|
||||
|
||||
/**
|
||||
* 站台
|
||||
*/
|
||||
private Stand stand;
|
||||
|
||||
/**
|
||||
* 当前信号显示
|
||||
*/
|
||||
@ -49,4 +44,41 @@ public class Button extends MapNamedElement {
|
||||
public void reset() {
|
||||
isPressDown = Boolean.FALSE;
|
||||
}
|
||||
|
||||
public void setTypeStr(MapSignalButtonVO.Type typeStr) {
|
||||
this.type = getType(typeStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取枚举信息
|
||||
*
|
||||
* @param type 类型
|
||||
* @return 枚举
|
||||
*/
|
||||
public static ButtonTypeEnum getType(MapSignalButtonVO.Type type) {
|
||||
switch (type) {
|
||||
case ASSIST:
|
||||
return ButtonTypeEnum.MAIN_ASSIST;
|
||||
case PICK_ASSIST:
|
||||
return ButtonTypeEnum.DELIVER_ASSIST;
|
||||
case DEPART_ASSIST:
|
||||
return ButtonTypeEnum.RECEIVE_ASSIST;
|
||||
case CHANGE_DIRECTION:
|
||||
return ButtonTypeEnum.CHANGE_DIRECTION;
|
||||
default:
|
||||
return ButtonTypeEnum.NO;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ButtonTypeEnum {
|
||||
// 总辅助
|
||||
MAIN_ASSIST,
|
||||
// 接辅助
|
||||
RECEIVE_ASSIST,
|
||||
// 发辅助
|
||||
DELIVER_ASSIST,
|
||||
// 改方
|
||||
CHANGE_DIRECTION,
|
||||
NO;
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,9 @@ package club.joylink.rtss.simulation.cbtc.data.map;
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import club.joylink.rtss.constants.IndicatorTypeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 指示灯设备
|
||||
*/
|
||||
@ -35,21 +32,6 @@ public class Indicator extends MapNamedElement {
|
||||
*/
|
||||
private boolean on;
|
||||
|
||||
/**
|
||||
* 区段信息
|
||||
*/
|
||||
private List<Section> sectionList;
|
||||
|
||||
/**
|
||||
* 站台
|
||||
*/
|
||||
private Stand stand;
|
||||
|
||||
/**
|
||||
* 进路
|
||||
*/
|
||||
private Route route;
|
||||
|
||||
/**
|
||||
* 灯类型
|
||||
*/
|
||||
@ -60,16 +42,13 @@ public class Indicator extends MapNamedElement {
|
||||
on = false;
|
||||
}
|
||||
|
||||
protected Indicator(String code, String name, DeviceType deviceType) {
|
||||
super(code, name, deviceType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
on = false;
|
||||
aspect = getDefaultStatus();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取默认状态
|
||||
*
|
||||
@ -86,4 +65,69 @@ public class Indicator extends MapNamedElement {
|
||||
return IndicatorStatusEnum.No;
|
||||
}
|
||||
}
|
||||
|
||||
public void setTypeStr(String type) {
|
||||
this.type = getType(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 枚举对应
|
||||
*
|
||||
* @param type 前端类型
|
||||
* @return 枚举值
|
||||
*/
|
||||
public static IndicatorTypeEnum getType(String type) {
|
||||
switch (type) {
|
||||
// 接
|
||||
case "receive":
|
||||
case "PickArrow":
|
||||
return IndicatorTypeEnum.RECEIVE;
|
||||
// 发
|
||||
case "deliver":
|
||||
case "DepartArrow":
|
||||
return IndicatorTypeEnum.DELIVER;
|
||||
// 区间
|
||||
case "section":
|
||||
case "SectionOccupied":
|
||||
return IndicatorTypeEnum.SECTION;
|
||||
//辅助
|
||||
case "assist":
|
||||
case "AssistStatus":
|
||||
case "TotalAssist":
|
||||
case "DepartAssist":
|
||||
case "PickAssist":
|
||||
return IndicatorTypeEnum.ASSIST;
|
||||
//复原
|
||||
case "Recovery":
|
||||
return IndicatorTypeEnum.RECOVERY;
|
||||
//事故
|
||||
case "Accident":
|
||||
return IndicatorTypeEnum.ACCIDENT;
|
||||
//闭塞
|
||||
case "Occlusion":
|
||||
return IndicatorTypeEnum.OCCLUSION;
|
||||
default:
|
||||
return IndicatorTypeEnum.NO;
|
||||
}
|
||||
}
|
||||
|
||||
public enum IndicatorTypeEnum {
|
||||
// 接
|
||||
RECEIVE,
|
||||
// 发
|
||||
DELIVER,
|
||||
// 区间
|
||||
SECTION,
|
||||
// 辅助
|
||||
ASSIST,
|
||||
// 恢复
|
||||
RECOVERY,
|
||||
// 事故
|
||||
ACCIDENT,
|
||||
// 闭塞
|
||||
OCCLUSION,
|
||||
// 无类型
|
||||
NO;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,11 @@ public abstract class MapElement {
|
||||
/**
|
||||
* 操作按钮
|
||||
*/
|
||||
BUTTON
|
||||
BUTTON,
|
||||
/**
|
||||
* 车站_运行_方向
|
||||
*/
|
||||
STATION_DIRECTION
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.map;
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.TurnBackStrategyType;
|
||||
@ -28,6 +29,9 @@ public class Station extends MayOutOfOrderDevice {
|
||||
rdStandList = new ArrayList<>();
|
||||
ldStandList = new ArrayList<>();
|
||||
controlMode = ControlMode.Center;
|
||||
stationDirectionMap = new HashMap<>();
|
||||
buttonList = new ArrayList<>();
|
||||
indicatorList = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -180,15 +184,20 @@ public class Station extends MayOutOfOrderDevice {
|
||||
*/
|
||||
private AtomicInteger preResetValidDuration = new AtomicInteger(0);
|
||||
|
||||
/**
|
||||
* 车站4个方向的联锁数据
|
||||
*/
|
||||
private Map<DirectionLabelEnum, StationDirection> stationDirectionMap;
|
||||
|
||||
/**
|
||||
* 按钮列表
|
||||
*/
|
||||
private List<Button> buttonsList = new ArrayList<>();
|
||||
private List<Button> buttonList;
|
||||
|
||||
/**
|
||||
* 指示灯列表
|
||||
*/
|
||||
private List<Indicator> indicatorList = new ArrayList<>();
|
||||
private List<Indicator> indicatorList;
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
|
@ -0,0 +1,240 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.map;
|
||||
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 指示灯设备
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@Slf4j
|
||||
public class StationDirection extends MapNamedElement {
|
||||
/**
|
||||
* 车站
|
||||
*/
|
||||
private Station station;
|
||||
|
||||
/**
|
||||
* 方向标签
|
||||
*/
|
||||
private DirectionLabelEnum labelEnum;
|
||||
|
||||
/**
|
||||
* 指示灯实体
|
||||
*/
|
||||
private Signal signal;
|
||||
|
||||
/**
|
||||
* 处于接、发状态
|
||||
*/
|
||||
private ReceiveAndDeliverModel receiveAndDeliver;
|
||||
|
||||
/**
|
||||
* 接车灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum receiveAspect;
|
||||
|
||||
/**
|
||||
* 发车灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum deliverAspect;
|
||||
|
||||
/**
|
||||
* 区间灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum sectionAspect;
|
||||
|
||||
/**
|
||||
* 辅助灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum assistAspect;
|
||||
|
||||
/**
|
||||
* 改方按钮状态
|
||||
*/
|
||||
private boolean changeDirectionStatus;
|
||||
|
||||
/**
|
||||
* 总辅助
|
||||
*/
|
||||
private boolean mainAssistStatus;
|
||||
|
||||
/**
|
||||
* 接辅助
|
||||
*/
|
||||
private boolean receiveAssistStatus;
|
||||
|
||||
/**
|
||||
* 发辅助
|
||||
*/
|
||||
private boolean deliverAssistStatus;
|
||||
|
||||
/**
|
||||
* 接车进路,以指示灯为起点的进路
|
||||
*/
|
||||
private List<Route> receiveRouteList;
|
||||
|
||||
/**
|
||||
* 发车进路,以指示灯为终点的进路
|
||||
*/
|
||||
private List<Route> deliverRouteList;
|
||||
|
||||
/**
|
||||
* 区段信息
|
||||
*/
|
||||
private List<Section> sectionList;
|
||||
|
||||
/**
|
||||
* 按钮集合
|
||||
*/
|
||||
private List<Button> buttonList;
|
||||
|
||||
/**
|
||||
* 指示灯集合
|
||||
*/
|
||||
private List<Indicator> indicatorList;
|
||||
|
||||
public StationDirection(String code, String name, DirectionLabelEnum labelEnum) {
|
||||
this(code, name);
|
||||
this.labelEnum = labelEnum;
|
||||
this.getDefaultReceiveAndDeliver();
|
||||
}
|
||||
|
||||
public StationDirection(String code, String name) {
|
||||
super(code, name, DeviceType.STATION_DIRECTION);
|
||||
setDefaultAttribute();
|
||||
this.sectionList = new ArrayList<>();
|
||||
this.receiveRouteList = new ArrayList<>();
|
||||
this.deliverRouteList = new ArrayList<>();
|
||||
this.buttonList = new ArrayList<>();
|
||||
this.indicatorList = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
this.setDefaultAttribute();
|
||||
this.getDefaultReceiveAndDeliver();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认属性
|
||||
*/
|
||||
private void setDefaultAttribute() {
|
||||
this.changeDirectionStatus = false;
|
||||
this.mainAssistStatus = false;
|
||||
this.receiveAssistStatus = false;
|
||||
this.deliverAssistStatus = false;
|
||||
this.receiveAspect = IndicatorStatusEnum.No;
|
||||
this.deliverAspect = IndicatorStatusEnum.No;
|
||||
this.sectionAspect = IndicatorStatusEnum.No;
|
||||
this.assistAspect = IndicatorStatusEnum.No;
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认亮灯设置
|
||||
*/
|
||||
private void getDefaultReceiveAndDeliver() {
|
||||
// X、S方向为接车方向默认亮起
|
||||
if (DirectionLabelEnum.X.equals(labelEnum) || DirectionLabelEnum.S.equals(labelEnum)) {
|
||||
this.receiveAndDeliver = ReceiveAndDeliverModel.RECEIVE;
|
||||
} else { // 其他方向默认发车灯亮起
|
||||
this.receiveAndDeliver = ReceiveAndDeliverModel.DELIVER;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新接发车状态
|
||||
*/
|
||||
public void refreshReceiveAndDeliverStatus() {
|
||||
boolean receiveFlag = this.receiveRouteList.stream().anyMatch(Route::isLock);
|
||||
boolean deliverFlag = this.deliverRouteList.stream().anyMatch(Route::isLock);
|
||||
if (receiveFlag) {
|
||||
this.receiveAndDeliver = ReceiveAndDeliverModel.RECEIVE;
|
||||
} else if (deliverFlag) {
|
||||
this.receiveAndDeliver = ReceiveAndDeliverModel.DELIVER;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新接、发车灯颜色
|
||||
*/
|
||||
public void refreshAspectStatus() {
|
||||
if (ReceiveAndDeliverModel.RECEIVE.equals(this.receiveAndDeliver)) {
|
||||
this.deliverAspect = IndicatorStatusEnum.No;
|
||||
boolean isBlock = this.receiveRouteList
|
||||
.stream()
|
||||
.anyMatch(route -> route.getSectionList().stream().anyMatch(Section::isRouteLock));
|
||||
if (isBlock) {
|
||||
this.receiveAspect = IndicatorStatusEnum.R;
|
||||
} else {
|
||||
this.receiveAspect = IndicatorStatusEnum.Y;
|
||||
}
|
||||
} else if (ReceiveAndDeliverModel.DELIVER.equals(this.receiveAndDeliver)) {
|
||||
this.receiveAspect = IndicatorStatusEnum.No;
|
||||
boolean isBlock = this.deliverRouteList
|
||||
.stream()
|
||||
.anyMatch(route -> route.getSectionList().stream().anyMatch(Section::isRouteLock));
|
||||
if (isBlock) {
|
||||
this.deliverAspect = IndicatorStatusEnum.R;
|
||||
} else {
|
||||
this.deliverAspect = IndicatorStatusEnum.G;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 区间灯状态
|
||||
*/
|
||||
public void refreshSectionStatus() {
|
||||
if (CollectionUtils.isEmpty(sectionList)) {
|
||||
return;
|
||||
}
|
||||
// 是否被占用,TRUE 未占用,FALSE 占用
|
||||
boolean isNotOccupied = this.sectionList.stream().anyMatch(Section::isOccupied);
|
||||
// 占用为红色
|
||||
this.sectionAspect = isNotOccupied ? IndicatorStatusEnum.R : IndicatorStatusEnum.No;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改按钮状态
|
||||
*
|
||||
* @param type 按钮类型
|
||||
* @param pressDown 按钮按下抬起
|
||||
*/
|
||||
public void modifyButtonStatus(Button.ButtonTypeEnum type, boolean pressDown) {
|
||||
switch (type) {
|
||||
case CHANGE_DIRECTION:
|
||||
this.changeDirectionStatus = pressDown;
|
||||
break;
|
||||
case RECEIVE_ASSIST:
|
||||
this.receiveAssistStatus = pressDown;
|
||||
break;
|
||||
case DELIVER_ASSIST:
|
||||
this.deliverAssistStatus = pressDown;
|
||||
break;
|
||||
case MAIN_ASSIST:
|
||||
this.mainAssistStatus = pressDown;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ReceiveAndDeliverModel {
|
||||
// 接
|
||||
RECEIVE,
|
||||
// 发
|
||||
DELIVER,
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.status;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Button;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.ButtonStatusVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.DeviceStatusVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 按钮设备状态信息
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class ButtonStatus extends DeviceStatus {
|
||||
|
||||
private boolean pressDown;
|
||||
|
||||
public ButtonStatus(Button button) {
|
||||
super(button.getCode(), button.getDeviceType());
|
||||
pressDown = button.isPressDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean compareAndChange(MapElement device, DeviceStatusVO statusVO) {
|
||||
Button button = (Button) device;
|
||||
ButtonStatusVO status = (ButtonStatusVO) statusVO;
|
||||
boolean change = Boolean.FALSE;
|
||||
if (!Objects.equals(pressDown, button.isPressDown())) {
|
||||
change = Boolean.TRUE;
|
||||
pressDown = button.isPressDown();
|
||||
status.setPressDown(pressDown);
|
||||
}
|
||||
return change;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceStatusVO convert2VO(MapElement device) {
|
||||
ButtonStatusVO statusVO = new ButtonStatusVO((Button) device);
|
||||
statusVO.setPressDown(pressDown);
|
||||
return statusVO;
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.status;
|
||||
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Indicator;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.DeviceStatusVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.IndicatorStatusVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 指示灯设备状态信息
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class IndicatorStatus extends DeviceStatus {
|
||||
|
||||
/**
|
||||
* 当前信号显示
|
||||
*/
|
||||
private IndicatorStatusEnum aspect;
|
||||
|
||||
public IndicatorStatus(Indicator indicator) {
|
||||
super(indicator.getCode(), indicator.getDeviceType());
|
||||
aspect = indicator.getAspect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean compareAndChange(MapElement device, DeviceStatusVO statusVO) {
|
||||
Indicator indicator = (Indicator) device;
|
||||
IndicatorStatusVO status = (IndicatorStatusVO) statusVO;
|
||||
boolean change = Boolean.FALSE;
|
||||
if (!indicator.getAspect().equals(aspect)) {
|
||||
change = Boolean.TRUE;
|
||||
aspect = indicator.getAspect();
|
||||
status.setAspect(aspect);
|
||||
}
|
||||
return change;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceStatusVO convert2VO(MapElement device) {
|
||||
IndicatorStatusVO statusVO = new IndicatorStatusVO((Indicator) device);
|
||||
statusVO.setAspect(aspect);
|
||||
return statusVO;
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.status;
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.StationDirection;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.DeviceStatusVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.StationDirectionStatusVO;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 车站状态
|
||||
*/
|
||||
@Getter
|
||||
public class StationDirectionStatus extends DeviceStatus {
|
||||
private String stationCode;
|
||||
|
||||
private DirectionLabelEnum labelEnum;
|
||||
|
||||
/**
|
||||
* 接车灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum receiveAspect;
|
||||
|
||||
/**
|
||||
* 发车灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum deliverAspect;
|
||||
|
||||
/**
|
||||
* 区间灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum sectionAspect;
|
||||
|
||||
/**
|
||||
* 辅助灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum assistAspect;
|
||||
|
||||
/**
|
||||
* 改方按钮状态
|
||||
*/
|
||||
private boolean changeDirectionStatus;
|
||||
|
||||
/**
|
||||
* 总辅助
|
||||
*/
|
||||
private boolean mainAssistStatus;
|
||||
|
||||
/**
|
||||
* 接辅助
|
||||
*/
|
||||
private boolean receiveAssistStatus;
|
||||
|
||||
/**
|
||||
* 发辅助
|
||||
*/
|
||||
private boolean deliverAssistStatus;
|
||||
|
||||
public StationDirectionStatus(StationDirection stationDirection) {
|
||||
super(stationDirection.getCode(), stationDirection.getDeviceType());
|
||||
this.stationCode = stationDirection.getStation().getCode();
|
||||
this.labelEnum = stationDirection.getLabelEnum();
|
||||
this.receiveAspect = stationDirection.getReceiveAspect();
|
||||
this.deliverAspect = stationDirection.getDeliverAspect();
|
||||
this.sectionAspect = stationDirection.getSectionAspect();
|
||||
this.assistAspect = stationDirection.getAssistAspect();
|
||||
this.changeDirectionStatus = stationDirection.isChangeDirectionStatus();
|
||||
this.mainAssistStatus = stationDirection.isMainAssistStatus();
|
||||
this.receiveAssistStatus = stationDirection.isReceiveAssistStatus();
|
||||
this.deliverAssistStatus = stationDirection.isDeliverAssistStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean compareAndChange(MapElement device, DeviceStatusVO statusVO) {
|
||||
StationDirection labelEnum = (StationDirection) device;
|
||||
StationDirectionStatusVO status = (StationDirectionStatusVO) statusVO;
|
||||
boolean change = false;
|
||||
// 接车
|
||||
if (!Objects.equals(labelEnum.getReceiveAspect(), receiveAspect)) {
|
||||
this.receiveAspect = labelEnum.getReceiveAspect();
|
||||
status.setReceiveAspect(receiveAspect);
|
||||
change = true;
|
||||
}
|
||||
// 接车
|
||||
if (!Objects.equals(labelEnum.getDeliverAspect(), deliverAspect)) {
|
||||
this.deliverAspect = labelEnum.getDeliverAspect();
|
||||
status.setDeliverAspect(deliverAspect);
|
||||
change = true;
|
||||
}
|
||||
// 区间
|
||||
if (!Objects.equals(labelEnum.getSectionAspect(), sectionAspect)) {
|
||||
this.sectionAspect = labelEnum.getSectionAspect();
|
||||
status.setSectionAspect(sectionAspect);
|
||||
change = true;
|
||||
}
|
||||
// 辅助灯
|
||||
if (!Objects.equals(labelEnum.getAssistAspect(), assistAspect)) {
|
||||
this.assistAspect = labelEnum.getAssistAspect();
|
||||
status.setAssistAspect(assistAspect);
|
||||
change = true;
|
||||
}
|
||||
// 改方按钮
|
||||
if (!Objects.equals(labelEnum.isChangeDirectionStatus(), changeDirectionStatus)) {
|
||||
this.changeDirectionStatus = labelEnum.isChangeDirectionStatus();
|
||||
status.setChangeDirectionStatus(changeDirectionStatus);
|
||||
change = true;
|
||||
}
|
||||
// 总辅助按钮
|
||||
if (!Objects.equals(labelEnum.isMainAssistStatus(), mainAssistStatus)) {
|
||||
this.mainAssistStatus = labelEnum.isMainAssistStatus();
|
||||
status.setMainAssistStatus(mainAssistStatus);
|
||||
change = true;
|
||||
}
|
||||
|
||||
// 接辅助按钮
|
||||
if (!Objects.equals(labelEnum.isReceiveAssistStatus(), receiveAssistStatus)) {
|
||||
this.receiveAssistStatus = labelEnum.isReceiveAssistStatus();
|
||||
status.setReceiveAssistStatus(receiveAssistStatus);
|
||||
change = true;
|
||||
}
|
||||
|
||||
// 发辅助按钮
|
||||
if (!Objects.equals(labelEnum.isDeliverAssistStatus(), deliverAssistStatus)) {
|
||||
this.deliverAssistStatus = labelEnum.isDeliverAssistStatus();
|
||||
status.setDeliverAssistStatus(deliverAssistStatus);
|
||||
change = true;
|
||||
}
|
||||
if (change) {
|
||||
status.setStationCode(labelEnum.getStation().getCode());
|
||||
status.setLabelEnum(labelEnum.getLabelEnum());
|
||||
}
|
||||
return change;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceStatusVO convert2VO(MapElement device) {
|
||||
StationDirectionStatusVO statusVO = new StationDirectionStatusVO((StationDirection) device);
|
||||
statusVO.setStationCode(stationCode);
|
||||
statusVO.setLabelEnum(labelEnum);
|
||||
statusVO.setReceiveAspect(receiveAspect);
|
||||
statusVO.setDeliverAspect(deliverAspect);
|
||||
statusVO.setSectionAspect(sectionAspect);
|
||||
statusVO.setAssistAspect(assistAspect);
|
||||
statusVO.setChangeDirectionStatus(changeDirectionStatus);
|
||||
statusVO.setMainAssistStatus(mainAssistStatus);
|
||||
statusVO.setReceiveAssistStatus(receiveAssistStatus);
|
||||
statusVO.setDeliverAssistStatus(deliverAssistStatus);
|
||||
return statusVO;
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.vo;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Button;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 按钮状态
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class ButtonStatusVO extends DeviceStatusVO {
|
||||
|
||||
private Boolean pressDown;
|
||||
|
||||
public ButtonStatusVO(Button button) {
|
||||
super(button.getCode(), button.getDeviceType());
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.vo;
|
||||
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Indicator;
|
||||
import club.joylink.rtss.simulation.cbtc.data.status.IndicatorStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 按钮状态
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class IndicatorStatusVO extends DeviceStatusVO {
|
||||
|
||||
/**
|
||||
* 当前信号显示
|
||||
*/
|
||||
private IndicatorStatusEnum aspect;
|
||||
|
||||
public IndicatorStatusVO(IndicatorStatus indicatorStatus) {
|
||||
super(indicatorStatus.getCode(), indicatorStatus.getDeviceType());
|
||||
}
|
||||
|
||||
public IndicatorStatusVO(Indicator indicator) {
|
||||
super(indicator.getCode(), indicator.getDeviceType());
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.vo;
|
||||
|
||||
import club.joylink.rtss.constants.DirectionLabelEnum;
|
||||
import club.joylink.rtss.constants.IndicatorStatusEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.StationDirection;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 按钮状态
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class StationDirectionStatusVO extends DeviceStatusVO {
|
||||
|
||||
private String stationCode;
|
||||
|
||||
private DirectionLabelEnum labelEnum;
|
||||
|
||||
/**
|
||||
* 接车灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum receiveAspect;
|
||||
|
||||
/**
|
||||
* 发车灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum deliverAspect;
|
||||
|
||||
/**
|
||||
* 区间灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum sectionAspect;
|
||||
|
||||
/**
|
||||
* 辅助灯状态
|
||||
*/
|
||||
private IndicatorStatusEnum assistAspect;
|
||||
|
||||
/**
|
||||
* 改方按钮状态
|
||||
*/
|
||||
private Boolean changeDirectionStatus;
|
||||
|
||||
/**
|
||||
* 总辅助
|
||||
*/
|
||||
private Boolean mainAssistStatus;
|
||||
|
||||
/**
|
||||
* 接辅助
|
||||
*/
|
||||
private Boolean receiveAssistStatus;
|
||||
|
||||
/**
|
||||
* 发辅助
|
||||
*/
|
||||
private Boolean deliverAssistStatus;
|
||||
|
||||
public StationDirectionStatusVO(StationDirection stationDirection) {
|
||||
super(stationDirection.getCode(), stationDirection.getDeviceType());
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package club.joylink.rtss.vo.map;
|
||||
|
||||
import club.joylink.rtss.entity.IndicatorButton;
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.map.logic.*;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
@ -74,7 +74,7 @@ public class MapLogicDataNewVO {
|
||||
/**
|
||||
* 信号灯、站台、进路关联的区段信息
|
||||
*/
|
||||
private List<IndicatorButton> indicatorButtonVOList;
|
||||
private List<DraftMapStationDirection> draftMapStationDirectionList;
|
||||
|
||||
public MapLogicDataNewVO() {
|
||||
routeList = new ArrayList<>();
|
||||
@ -88,7 +88,7 @@ public class MapLogicDataNewVO {
|
||||
overlapList = new ArrayList<>();
|
||||
overrunList = new ArrayList<>();
|
||||
autoReentryList = new ArrayList<>();
|
||||
indicatorButtonVOList = new ArrayList<>();
|
||||
draftMapStationDirectionList = new ArrayList<>();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
|
@ -1,15 +1,14 @@
|
||||
<?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.AssistIndicatorButtonDAO">
|
||||
<resultMap id="IndicatorBaseResultMap" type="club.joylink.rtss.entity.IndicatorButton">
|
||||
<mapper namespace="club.joylink.rtss.dao.DraftMapStationDirectionDAO">
|
||||
<resultMap id="IndicatorBaseResultMap" type="club.joylink.rtss.entity.DraftMapStationDirection">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="map_id" jdbcType="BIGINT" property="mapId"/>
|
||||
<result column="code" jdbcType="VARCHAR" property="code"/>
|
||||
<result column="station_code" jdbcType="VARCHAR" property="stationCode"/>
|
||||
<result column="sections_code" jdbcType="VARCHAR" property="sectionsCode"/>
|
||||
<result column="stand_code" jdbcType="VARCHAR" property="standCode"/>
|
||||
<result column="model_type" jdbcType="VARCHAR" property="modelType"/>
|
||||
<result column="route_code" jdbcType="VARCHAR" property="routeCode"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="label_enum" jdbcType="VARCHAR" property="labelEnum"/>
|
||||
<result column="signal_code" jdbcType="VARCHAR" property="signalCode"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Example_Where_Clause">
|
||||
@ -75,17 +74,17 @@
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, map_id, code, sections_code, stand_code, model_type, route_code, type
|
||||
id, map_id, code, station_code, sections_code, label_enum, signal_code
|
||||
</sql>
|
||||
|
||||
<select id="selectByExample" parameterType="club.joylink.rtss.entity.IndicatorButtonExample"
|
||||
<select id="selectByExample" parameterType="club.joylink.rtss.entity.DraftMapStationDirectionExample"
|
||||
resultMap="IndicatorBaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from indicator_button_section_stand_route
|
||||
from draft_map_station_direction_label
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
@ -105,67 +104,81 @@
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="IndicatorBaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from indicator_button_section_stand_route
|
||||
from draft_map_station_direction_label
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from indicator_button_section_stand_route where id = #{id,jdbcType=BIGINT}
|
||||
delete from draft_map_station_direction_label where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.IndicatorButtonExample">
|
||||
delete from indicator_button_section_stand_route
|
||||
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.DraftMapStationDirectionExample">
|
||||
delete from draft_map_station_direction_label
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.IndicatorButton"
|
||||
<insert id="insert" keyColumn="id" keyProperty="id"
|
||||
parameterType="club.joylink.rtss.entity.DraftMapStationDirection"
|
||||
useGeneratedKeys="true">
|
||||
insert into indicator_button_section_stand_route (
|
||||
map_id, code, sections_code, stand_code, model_type, route_code,type
|
||||
insert into draft_map_station_direction_label (
|
||||
map_id, code, station_code, sections_code, label_enum, signal_code
|
||||
)
|
||||
values (
|
||||
#{mapId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{sectionsCode,jdbcType=VARCHAR},
|
||||
#{standCode,jdbcType=VARCHAR},#{modelType,jdbcType=VARCHAR},
|
||||
#{routeCode,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR}
|
||||
#{mapId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR},
|
||||
#{sectionsCode,jdbcType=VARCHAR},
|
||||
#{labelEnum,jdbcType=VARCHAR},#{signalCode,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertList">
|
||||
insert into draft_map_station_direction_label (
|
||||
map_id, code, station_code, sections_code, label_enum, signal_code
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="recode" separator=",">
|
||||
(
|
||||
#{record.mapId,jdbcType=BIGINT}, #{record.code,jdbcType=VARCHAR}, #{record.stationCode,jdbcType=VARCHAR},
|
||||
#{record.sectionsCode,jdbcType=VARCHAR}, #{record.labelEnum,jdbcType=VARCHAR},
|
||||
#{record.signalCode,jdbcType=VARCHAR}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id"
|
||||
parameterType="club.joylink.rtss.entity.IndicatorButton"
|
||||
parameterType="club.joylink.rtss.entity.DraftMapStationDirection"
|
||||
useGeneratedKeys="true">
|
||||
insert into indicator_button_section_stand_route
|
||||
insert into draft_map_station_direction_label
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mapId != null">map_id,</if>
|
||||
<if test="code != null">code,</if>
|
||||
<if test="stationCode != null">station_code,</if>
|
||||
<if test="sectionsCode != null">sections_code,</if>
|
||||
<if test="standCode != null">stand_code,</if>
|
||||
<if test="modelType != null">model_type,</if>
|
||||
<if test="routeCode != null">route_code,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="labelEnum != null">label_enum,</if>
|
||||
<if test="signalCode != null">signal_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mapId != null">#{mapId,jdbcType=BIGINT},</if>
|
||||
<if test="code != null">#{code,jdbcType=VARCHAR},</if>
|
||||
<if test="stationCode != null">#{record.stationCode,jdbcType=VARCHAR},</if>
|
||||
<if test="sectionsCode != null">#{sectionsCode,jdbcType=VARCHAR},</if>
|
||||
<if test="standCode != null">#{standCode,jdbcType=VARCHAR},</if>
|
||||
<if test="modelType != null">#{modelType,jdbcType=VARCHAR},</if>
|
||||
<if test="routeCode != null">#{routeCode,jdbcType=VARCHAR},</if>
|
||||
<if test="type != null">#{type,jdbcType=VARCHAR},</if>
|
||||
<if test="labelEnum != null">#{labelEnum,jdbcType=VARCHAR},</if>
|
||||
<if test="signalCode != null">#{signalCode,jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="countByExample" parameterType="club.joylink.rtss.entity.IndicatorButtonExample"
|
||||
<select id="countByExample" parameterType="club.joylink.rtss.entity.DraftMapStationDirectionExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from indicator_button_section_stand_route
|
||||
select count(*) from draft_map_station_direction_label
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update indicator_button_section_stand_route
|
||||
update draft_map_station_direction_label
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
@ -176,17 +189,17 @@
|
||||
<if test="record.code != null">
|
||||
code = #{record.code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.stationCode != null">
|
||||
station_code = #{record.stationCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.sectionsCode != null">
|
||||
sections_code = #{record.sectionsCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.standCode != null">
|
||||
stand_code = #{record.standCode,jdbcType=VARCHAR},
|
||||
<if test="record.labelEnum != null">
|
||||
label_enum = #{record.labelEnum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.modelType != null">
|
||||
model_type = #{record.modelType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.routeCode != null">
|
||||
route_code = #{record.routeCode,jdbcType=VARCHAR},
|
||||
<if test="record.signalCode != null">
|
||||
signal_code = #{record.signalCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
@ -195,22 +208,21 @@
|
||||
</update>
|
||||
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update indicator_button_section_stand_route
|
||||
update draft_map_station_direction_label
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
map_id = #{record.mapId,jdbcType=BIGINT},
|
||||
code = #{record.code,jdbcType=VARCHAR},
|
||||
station_code = #{record.stationCode,jdbcType=VARCHAR},
|
||||
sections_code = #{record.sectionsCode,jdbcType=VARCHAR},
|
||||
stand_code = #{record.standCode,jdbcType=VARCHAR},
|
||||
model_type = #{record.modelType,jdbcType=VARCHAR},
|
||||
route_code = #{record.routeCode,jdbcType=VARCHAR},
|
||||
type = #{record.type,jdbcType=VARCHAR}
|
||||
label_enum = #{record.labelEnum,jdbcType=VARCHAR},
|
||||
signal_code = #{record.signalCode,jdbcType=VARCHAR},
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.IndicatorButton">
|
||||
update indicator_button_section_stand_route
|
||||
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.DraftMapStationDirection">
|
||||
update draft_map_station_direction_label
|
||||
<set>
|
||||
<if test="mapId != null">
|
||||
map_id = #{mapId,jdbcType=BIGINT},
|
||||
@ -218,35 +230,31 @@
|
||||
<if test="code != null">
|
||||
code = #{code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="stationCode != null">
|
||||
station_code = #{stationCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sectionsCode != null">
|
||||
sections_code = #{sectionsCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="standCode != null">
|
||||
stand_code = #{standCode,jdbcType=VARCHAR},
|
||||
<if test="labelEnum != null">
|
||||
label_enum = #{labelEnum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="modelType != null">
|
||||
model_type = #{modelType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="routeCode != null">
|
||||
route_code = #{routeCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
<if test="signalCode != null">
|
||||
signal_code = #{signalCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.IndicatorButton">
|
||||
update indicator_button_section_stand_route
|
||||
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.DraftMapStationDirection">
|
||||
update draft_map_station_direction_label
|
||||
set
|
||||
map_id = #{mapId,jdbcType=BIGINT},
|
||||
code = #{code,jdbcType=VARCHAR},
|
||||
station_code = #{stationCode,jdbcType=VARCHAR},
|
||||
sections_code = #{sectionsCode,jdbcType=VARCHAR},
|
||||
stand_code = #{standCode,jdbcType=VARCHAR},
|
||||
model_type = #{modelType,jdbcType=VARCHAR},
|
||||
route_code = #{routeCode,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR}
|
||||
label_enum = #{labelEnum,jdbcType=VARCHAR},
|
||||
signal_code = #{signalCode,jdbcType=VARCHAR},
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user