diff --git a/sql/20210416-sheng.sql b/sql/20210416-sheng.sql index 7aaeec141..a679a82c0 100644 --- a/sql/20210416-sheng.sql +++ b/sql/20210416-sheng.sql @@ -1,3 +1,9 @@ ALTER TABLE `draft_map_route` MODIFY COLUMN `end_signal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '终端信号机 编号' AFTER `start_signal_code`; +ALTER TABLE `draft_map` +ADD COLUMN `init_pos_config` text NULL COMMENT '初始位置配置' AFTER `draw_way`, +ADD COLUMN `check_config` text NULL COMMENT '数据检查配置' AFTER `init_pos_config`, +ADD COLUMN `ci_generate_config` text NULL COMMENT '联锁数据生成配置' AFTER `check_config`, +ADD COLUMN `big_screen_config` text NULL COMMENT '大屏配置' AFTER `ci_generate_config`; + diff --git a/src/main/java/club/joylink/rtss/controller/draft/DraftMapController.java b/src/main/java/club/joylink/rtss/controller/draft/DraftMapController.java index 2672bb353..ac60a489d 100644 --- a/src/main/java/club/joylink/rtss/controller/draft/DraftMapController.java +++ b/src/main/java/club/joylink/rtss/controller/draft/DraftMapController.java @@ -1,6 +1,5 @@ package club.joylink.rtss.controller.draft; -import club.joylink.rtss.vo.client.map.newmap.MapDestinationCodeDefinitionVO; import club.joylink.rtss.services.IDraftMapService; import club.joylink.rtss.services.draftData.DraftMapCiDataGenerator; import club.joylink.rtss.vo.UserVO; @@ -82,6 +81,11 @@ public class DraftMapController { return iDraftMapService.getMapShapeData(id); } + @PutMapping(path="/{id}/checkConfig") + public void updateCheckConfig(@PathVariable Long id, @RequestBody MapCheckConfig checkConfig) { + this.iDraftMapService.updateCheckConfig(id, checkConfig); + } + /** * 保存地图元素信息 */ diff --git a/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java b/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java index 760b16829..24c197479 100644 --- a/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java +++ b/src/main/java/club/joylink/rtss/controller/draft/DraftMapRouteController.java @@ -6,6 +6,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + @RestController @RequestMapping("/api/draftMap/{id}/route") @Slf4j @@ -19,4 +21,9 @@ public class DraftMapRouteController { return this.draftMapRouteService.createRailwayRoute(id, routeNewVO); } + @GetMapping("/all") + public List queryAllRoutes(@PathVariable Long id) { + return this.draftMapRouteService.queryAllRoutes(id); + } + } diff --git a/src/main/java/club/joylink/rtss/dao/DraftMapDAO.java b/src/main/java/club/joylink/rtss/dao/DraftMapDAO.java index 1cff39c45..c51740f12 100644 --- a/src/main/java/club/joylink/rtss/dao/DraftMapDAO.java +++ b/src/main/java/club/joylink/rtss/dao/DraftMapDAO.java @@ -3,10 +3,13 @@ package club.joylink.rtss.dao; import club.joylink.rtss.entity.DraftMap; import club.joylink.rtss.entity.DraftMapExample; import club.joylink.rtss.entity.DraftMapWithBLOBs; -import java.util.List; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import java.util.List; + +@Mapper @Repository public interface DraftMapDAO { long countByExample(DraftMapExample example); diff --git a/src/main/java/club/joylink/rtss/entity/DraftMap.java b/src/main/java/club/joylink/rtss/entity/DraftMap.java index e498cf36d..a5fe1005b 100644 --- a/src/main/java/club/joylink/rtss/entity/DraftMap.java +++ b/src/main/java/club/joylink/rtss/entity/DraftMap.java @@ -1,12 +1,15 @@ package club.joylink.rtss.entity; +import lombok.Data; + import java.io.Serializable; import java.time.LocalDateTime; /** - * draft_map * @author + * 地图草稿 */ +@Data public class DraftMap implements Serializable { private Long id; @@ -30,92 +33,10 @@ public class DraftMap implements Serializable { */ private String lineCode; + /** + * 图形绘制方式:0:旧;1:新方式 + */ + private Byte drawWay; + private static final long serialVersionUID = 1L; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public LocalDateTime getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(LocalDateTime updateTime) { - this.updateTime = updateTime; - } - - public Long getAuthorId() { - return authorId; - } - - public void setAuthorId(Long authorId) { - this.authorId = authorId; - } - - public String getLineCode() { - return lineCode; - } - - public void setLineCode(String lineCode) { - this.lineCode = lineCode; - } - - @Override - public boolean equals(Object that) { - if (this == that) { - return true; - } - if (that == null) { - return false; - } - if (getClass() != that.getClass()) { - return false; - } - DraftMap other = (DraftMap) that; - return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) - && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) - && (this.getAuthorId() == null ? other.getAuthorId() == null : this.getAuthorId().equals(other.getAuthorId())) - && (this.getLineCode() == null ? other.getLineCode() == null : this.getLineCode().equals(other.getLineCode())); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); - result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); - result = prime * result + ((getAuthorId() == null) ? 0 : getAuthorId().hashCode()); - result = prime * result + ((getLineCode() == null) ? 0 : getLineCode().hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(getClass().getSimpleName()); - sb.append(" ["); - sb.append("Hash = ").append(hashCode()); - sb.append(", id=").append(id); - sb.append(", name=").append(name); - sb.append(", updateTime=").append(updateTime); - sb.append(", authorId=").append(authorId); - sb.append(", lineCode=").append(lineCode); - sb.append(", serialVersionUID=").append(serialVersionUID); - sb.append("]"); - return sb.toString(); - } } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/DraftMapExample.java b/src/main/java/club/joylink/rtss/entity/DraftMapExample.java index 03cba2214..7c84d638b 100644 --- a/src/main/java/club/joylink/rtss/entity/DraftMapExample.java +++ b/src/main/java/club/joylink/rtss/entity/DraftMapExample.java @@ -444,6 +444,66 @@ public class DraftMapExample { addCriterion("line_code not between", value1, value2, "lineCode"); return (Criteria) this; } + + public Criteria andDrawWayIsNull() { + addCriterion("draw_way is null"); + return (Criteria) this; + } + + public Criteria andDrawWayIsNotNull() { + addCriterion("draw_way is not null"); + return (Criteria) this; + } + + public Criteria andDrawWayEqualTo(Byte value) { + addCriterion("draw_way =", value, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayNotEqualTo(Byte value) { + addCriterion("draw_way <>", value, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayGreaterThan(Byte value) { + addCriterion("draw_way >", value, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayGreaterThanOrEqualTo(Byte value) { + addCriterion("draw_way >=", value, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayLessThan(Byte value) { + addCriterion("draw_way <", value, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayLessThanOrEqualTo(Byte value) { + addCriterion("draw_way <=", value, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayIn(List values) { + addCriterion("draw_way in", values, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayNotIn(List values) { + addCriterion("draw_way not in", values, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayBetween(Byte value1, Byte value2) { + addCriterion("draw_way between", value1, value2, "drawWay"); + return (Criteria) this; + } + + public Criteria andDrawWayNotBetween(Byte value1, Byte value2) { + addCriterion("draw_way not between", value1, value2, "drawWay"); + return (Criteria) this; + } } /** diff --git a/src/main/java/club/joylink/rtss/entity/DraftMapWithBLOBs.java b/src/main/java/club/joylink/rtss/entity/DraftMapWithBLOBs.java index d2c6f43bb..5e15e0e46 100644 --- a/src/main/java/club/joylink/rtss/entity/DraftMapWithBLOBs.java +++ b/src/main/java/club/joylink/rtss/entity/DraftMapWithBLOBs.java @@ -1,11 +1,14 @@ package club.joylink.rtss.entity; +import lombok.Data; + import java.io.Serializable; /** - * draft_map * @author + * 地图草稿 */ +@Data public class DraftMapWithBLOBs extends DraftMap implements Serializable { /** * 图形数据 @@ -17,69 +20,25 @@ public class DraftMapWithBLOBs extends DraftMap implements Serializable { */ private String logicData; + /** + * 初始位置配置 + */ + private String initPosConfig; + + /** + * 数据检查配置 + */ + private String checkConfig; + + /** + * 联锁数据生成配置 + */ + private String ciGenerateConfig; + + /** + * 大屏配置 + */ + private String bigScreenConfig; + private static final long serialVersionUID = 1L; - - public String getGraphData() { - return graphData; - } - - public void setGraphData(String graphData) { - this.graphData = graphData; - } - - public String getLogicData() { - return logicData; - } - - public void setLogicData(String logicData) { - this.logicData = logicData; - } - - @Override - public boolean equals(Object that) { - if (this == that) { - return true; - } - if (that == null) { - return false; - } - if (getClass() != that.getClass()) { - return false; - } - DraftMapWithBLOBs other = (DraftMapWithBLOBs) that; - return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) - && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) - && (this.getAuthorId() == null ? other.getAuthorId() == null : this.getAuthorId().equals(other.getAuthorId())) - && (this.getLineCode() == null ? other.getLineCode() == null : this.getLineCode().equals(other.getLineCode())) - && (this.getGraphData() == null ? other.getGraphData() == null : this.getGraphData().equals(other.getGraphData())) - && (this.getLogicData() == null ? other.getLogicData() == null : this.getLogicData().equals(other.getLogicData())); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); - result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); - result = prime * result + ((getAuthorId() == null) ? 0 : getAuthorId().hashCode()); - result = prime * result + ((getLineCode() == null) ? 0 : getLineCode().hashCode()); - result = prime * result + ((getGraphData() == null) ? 0 : getGraphData().hashCode()); - result = prime * result + ((getLogicData() == null) ? 0 : getLogicData().hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(getClass().getSimpleName()); - sb.append(" ["); - sb.append("Hash = ").append(hashCode()); - sb.append(", graphData=").append(graphData); - sb.append(", logicData=").append(logicData); - sb.append(", serialVersionUID=").append(serialVersionUID); - sb.append("]"); - return sb.toString(); - } } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/services/DraftMapService.java b/src/main/java/club/joylink/rtss/services/DraftMapService.java index 1d3019f07..fb57a28fa 100644 --- a/src/main/java/club/joylink/rtss/services/DraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/DraftMapService.java @@ -1438,6 +1438,14 @@ public class DraftMapService implements IDraftMapService { draftMapDAO.updateByPrimaryKeyWithBLOBs(entity); } + @Override + public void updateCheckConfig(Long id, MapCheckConfig checkConfig) { + DraftMapWithBLOBs db = new DraftMapWithBLOBs(); + db.setId(id); + db.setCheckConfig(checkConfig.toJson()); + this.draftMapDAO.updateByPrimaryKeySelective(db); + } + private DraftMapWithBLOBs findEntity(Long id) { return draftMapDAO.selectByPrimaryKey(id); } diff --git a/src/main/java/club/joylink/rtss/services/IDraftMapService.java b/src/main/java/club/joylink/rtss/services/IDraftMapService.java index bea09a748..19b595985 100644 --- a/src/main/java/club/joylink/rtss/services/IDraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/IDraftMapService.java @@ -6,7 +6,6 @@ import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.TreeNode; import club.joylink.rtss.vo.client.map.*; import club.joylink.rtss.vo.client.map.newmap.*; -import club.joylink.rtss.vo.client.map.newmap.MapDestinationCodeDefinitionVO; import java.util.List; import java.util.Map; @@ -401,4 +400,6 @@ public interface IDraftMapService { * 更新目的地码定义 */ void updateOperationDefinition(Long mapId, MapDestinationCodeDefinitionVO definitionVO); + + void updateCheckConfig(Long id, MapCheckConfig checkConfig); } diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java index 90f310bad..7980f8ed6 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteService.java @@ -2,6 +2,10 @@ package club.joylink.rtss.services.draftData; import club.joylink.rtss.vo.client.map.newmap.MapRouteNewVO; +import java.util.List; + public interface DraftMapRouteService { MapRouteNewVO createRailwayRoute(Long id, MapRouteNewVO routeNewVO); + + List queryAllRoutes(Long id); } diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java index dcf9e0d62..a591410ac 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java @@ -56,4 +56,13 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { this.draftMapRouteDAO.insert(draftMapRoute); return routeNewVO; } + + @Override + public List queryAllRoutes(Long id) { + DraftMapRouteExample example = new DraftMapRouteExample(); + example.createCriteria() + .andMapIdEqualTo(id); + List routeList = this.draftMapRouteDAO.selectByExampleWithBLOBs(example); + return MapRouteNewVO.convertDraft2VOList(routeList); + } } diff --git a/src/main/java/club/joylink/rtss/services/draftData/RailwayRouteGenerator.java b/src/main/java/club/joylink/rtss/services/draftData/RailwayRouteGenerator.java index da9f4a793..142499832 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/RailwayRouteGenerator.java +++ b/src/main/java/club/joylink/rtss/services/draftData/RailwayRouteGenerator.java @@ -34,6 +34,8 @@ public class RailwayRouteGenerator { BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(routeVO.getEndSectionCode()); CommonRepository commonRepository = CommonRepositoryBuilder.buildFrom(graphDataVO); CommonSignal startSignal = commonRepository.getSignalById(routeVO.getStartSignalCode()); + BusinessExceptionAssertEnum.DATA_ERROR.assertNotNull(startSignal.getStation(), + String.format("信号机[%s]所属车站未设置", startSignal.getId())); routeVO.setStationCode(startSignal.getStation().getId()); boolean right = startSignal.isRight(); CommonSection startSection = commonRepository.getSectionById(routeVO.getStartSectionCode()); @@ -89,6 +91,11 @@ public class RailwayRouteGenerator { // 判断是道岔区段情况 if (lastSection.isSwitchSection()) { CommonSwitch belongSwitch = lastSection.getBelongSwitch(); + if (!belongSwitch.isToCross(lastSection, trackWay.isRight())) { + // 尽头道岔区段 + log.warn(String.format("[%s]路径未找到:到达尽头,查找路径为:[%s]", trackWay.debugStr(), trackWay.pathDebugStr())); + return; + } CommonSwitch linked = belongSwitch.queryLinkedSwitch(); if (belongSwitch.isA(lastSection)) { if (belongSwitch.getB().equals(trackWay.getEnd())) { diff --git a/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRepositoryBuilder.java b/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRepositoryBuilder.java index 1faa4f00a..fdaeba06e 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRepositoryBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRepositoryBuilder.java @@ -161,7 +161,14 @@ public class CommonRepositoryBuilder { commonRoute.pathElement = trackWay; commonRoute.signalAspect = routeVO.getSignalAspect(); List flsList = routeVO.getFlsList(); - + if (!CollectionUtils.isEmpty(flsList)) { + for (String code : flsList) { + CommonFls commonFls = flsMap.get(code); + BusinessExceptionAssertEnum.DATA_ERROR.assertNotNull(commonFls, + String.format("不存在id为[%s]的侧防", code)); + commonRoute.addFls(commonFls); + } + } } for (MapRouteNewVO routeVO : routeList) { CommonRoute commonRoute = routeMap.get(routeVO.getCode()); diff --git a/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRoute.java b/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRoute.java index ea21e85d7..31738b378 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRoute.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonRoute.java @@ -22,6 +22,7 @@ public class CommonRoute extends CommonDevice { int signalAspect; // 信号机显示(进路联锁规定) CommonSignal end; // 可能为null TrackWay pathElement; // 区段、道岔路径 + List flsList; // 侧防 CommonOverlap overlap; // 延续保护进路 List conflictingList; // 敌对进路 List psdList; @@ -33,6 +34,7 @@ public class CommonRoute extends CommonDevice { public CommonRoute(String id, String name) { super(id, name); + this.flsList = new ArrayList<>(); this.conflictingList = new ArrayList<>(); this.psdList = new ArrayList<>(); this.espList = new ArrayList<>(); @@ -42,4 +44,8 @@ public class CommonRoute extends CommonDevice { public void addConflict(CommonRoute conflict) { this.conflictingList.add(conflict); } + + public void addFls(CommonFls commonFls) { + this.flsList.add(commonFls); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonSwitch.java b/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonSwitch.java index fc75ecf3d..4c0234a4a 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonSwitch.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/repo/CommonSwitch.java @@ -48,4 +48,33 @@ public class CommonSwitch extends CommonDevice { } return null; } + + /** + * 是否开向岔心 + * @param section + * @param right + * @return + */ + public boolean isToCross(CommonSection section, boolean right) { + if (this.isA(section)) { + if (right && (section.getLeftSection() != null || this.b.getRightSection() != null || this.c.getRightSection() != null)) { + return true; + } else if (!right && (section.getRightSection() != null || this.b.getLeftSection() != null || this.c.getLeftSection() != null)) { + return true; + } + } else if (this.isB(section)) { + if (right && (section.getLeftSection() != null || this.c.getLeftSection() != null || this.a.getRightSection() != null)) { + return true; + } else if (!right && (section.getRightSection() != null || this.c.getRightSection() != null || this.a.getLeftSection() != null)) { + return true; + } + } else if (this.isC(section)) { + if (right && (section.getLeftSection() != null || this.b.getLeftSection() != null || this.a.getRightSection() != null)) { + return true; + } else if (!right && (section.getRightSection() != null || this.b.getRightSection() != null || this.a.getLeftSection() != null)) { + return true; + } + } + return false; + } } diff --git a/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java b/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java index 22199b7d3..ec339bce5 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/MapDataVO.java @@ -2,6 +2,7 @@ package club.joylink.rtss.vo.client.map; import club.joylink.rtss.entity.MapDataWithBLOBs; import club.joylink.rtss.util.JsonUtils; +import club.joylink.rtss.vo.client.map.newmap.MapCheckConfig; import club.joylink.rtss.vo.client.map.newmap.MapGraphDataNewVO; import club.joylink.rtss.vo.client.map.newmap.MapLogicDataNewVO; import lombok.Getter; @@ -13,6 +14,10 @@ import lombok.Setter; @NoArgsConstructor public class MapDataVO { + /** + * 地图数据检查配置 + */ + private MapCheckConfig checkConfig; private MapGraphDataNewVO shapeDataNew; private MapLogicDataNewVO logicDataNew; diff --git a/src/main/java/club/joylink/rtss/vo/client/map/MapVO.java b/src/main/java/club/joylink/rtss/vo/client/map/MapVO.java index 4e37acdb7..104c0c0f9 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/MapVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/MapVO.java @@ -17,6 +17,7 @@ import org.springframework.format.annotation.DateTimeFormat; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import javax.validation.constraints.NotBlank; import java.time.LocalDate; import java.util.ArrayList; import java.util.Comparator; @@ -79,7 +80,23 @@ public class MapVO { @ApiModelProperty(value = "定制项目编号") private String projectCode; - + /** + * 初始位置配置 + */ + private InitPositionConfig initPositionConfig; + /** + * 地图数据检查配置 + */ + private MapCheckConfig checkConfig; + /** + * 大屏配置 + */ + private BigScreenConfig bigScreenConfig; + /** + * 联锁数据生成配置 + */ + @NotBlank(message = "联锁数据生成配置不能为空") + private MapCiGenerateConfig generateConfig; private MapGraphDataNewVO graphDataNew; private MapLogicDataNewVO logicDataNew; diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/InitPositionConfig.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/InitPositionConfig.java new file mode 100644 index 000000000..7c67cce2e --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/InitPositionConfig.java @@ -0,0 +1,21 @@ +package club.joylink.rtss.vo.client.map.newmap; + +import club.joylink.rtss.vo.client.Point; +import lombok.Getter; +import lombok.Setter; + +/** + * 初始位置配置 + */ +@Getter +@Setter +public class InitPositionConfig { + /** + * 默认位置偏移量 + */ + private Point origin; + /** + * 缩放比例 + */ + private Float scaling; +} diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapCheckConfig.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapCheckConfig.java new file mode 100644 index 000000000..21edf0f0a --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapCheckConfig.java @@ -0,0 +1,18 @@ +package club.joylink.rtss.vo.client.map.newmap; + +import club.joylink.rtss.util.JsonUtils; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class MapCheckConfig { + /** + * 是否检查 + */ + private boolean check = true; + + public String toJson() { + return JsonUtils.writeValueAsString(this); + } +} diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java index 424160aa4..d48b9a635 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapGraphDataNewVO.java @@ -18,22 +18,32 @@ import java.util.List; @Setter public class MapGraphDataNewVO { - @ApiModelProperty(value = "皮肤") + /** + * 皮肤 + */ @Valid private RealLineVO skinVO; - - @ApiModelProperty(value = "默认位置偏移量") + /** + * 默认位置偏移量 + */ @NotNull(message = "默认位置偏移量不能为空") private Point origin; - - @ApiModelProperty(value = "缩放比例") + /** + * 缩放比例 + */ @NotBlank(message = "缩放比例不能为空") private String scaling; - - @ApiModelProperty(value = "大屏配置") + /** + * 地图数据检查配置 + */ + private MapCheckConfig checkConfig; + /** + * 大屏配置 + */ private BigScreenConfig bigScreenConfig; - - @ApiModelProperty(value = "联锁数据生成配置") + /** + * 联锁数据生成配置 + */ @NotBlank(message = "联锁数据生成配置不能为空") private MapCiGenerateConfig generateConfig; diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRouteNewVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRouteNewVO.java index 7195cab99..c9b2e0ba0 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRouteNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRouteNewVO.java @@ -247,6 +247,10 @@ public class MapRouteNewVO { return vo; } + public static List convertDraft2VOList(List routeList) { + return routeList.stream().map(MapRouteNewVO::convert2VO).collect(Collectors.toList()); + } + public DraftMapRoute convert2Draft() { DraftMapRoute route = new DraftMapRoute(); route.setId(getId()); diff --git a/src/main/resources/mybatis/mapper/DraftMapDAO.xml b/src/main/resources/mybatis/mapper/DraftMapDAO.xml index d92fe192f..1135d9f1a 100644 --- a/src/main/resources/mybatis/mapper/DraftMapDAO.xml +++ b/src/main/resources/mybatis/mapper/DraftMapDAO.xml @@ -7,10 +7,15 @@ + + + + + @@ -71,10 +76,10 @@ - id, `name`, update_time, author_id, line_code + id, `name`, update_time, author_id, line_code, draw_way - graph_data, logic_data + graph_data, logic_data, init_pos_config, check_config, ci_generate_config, big_screen_config @@ -215,12 +254,27 @@ line_code = #{record.lineCode,jdbcType=VARCHAR}, + + draw_way = #{record.drawWay,jdbcType=TINYINT}, + graph_data = #{record.graphData,jdbcType=LONGVARCHAR}, logic_data = #{record.logicData,jdbcType=LONGVARCHAR}, + + init_pos_config = #{record.initPosConfig,jdbcType=LONGVARCHAR}, + + + check_config = #{record.checkConfig,jdbcType=LONGVARCHAR}, + + + ci_generate_config = #{record.ciGenerateConfig,jdbcType=LONGVARCHAR}, + + + big_screen_config = #{record.bigScreenConfig,jdbcType=LONGVARCHAR}, + @@ -233,8 +287,13 @@ update_time = #{record.updateTime,jdbcType=TIMESTAMP}, author_id = #{record.authorId,jdbcType=BIGINT}, line_code = #{record.lineCode,jdbcType=VARCHAR}, + draw_way = #{record.drawWay,jdbcType=TINYINT}, graph_data = #{record.graphData,jdbcType=LONGVARCHAR}, - logic_data = #{record.logicData,jdbcType=LONGVARCHAR} + logic_data = #{record.logicData,jdbcType=LONGVARCHAR}, + init_pos_config = #{record.initPosConfig,jdbcType=LONGVARCHAR}, + check_config = #{record.checkConfig,jdbcType=LONGVARCHAR}, + ci_generate_config = #{record.ciGenerateConfig,jdbcType=LONGVARCHAR}, + big_screen_config = #{record.bigScreenConfig,jdbcType=LONGVARCHAR} @@ -245,7 +304,8 @@ `name` = #{record.name,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, author_id = #{record.authorId,jdbcType=BIGINT}, - line_code = #{record.lineCode,jdbcType=VARCHAR} + line_code = #{record.lineCode,jdbcType=VARCHAR}, + draw_way = #{record.drawWay,jdbcType=TINYINT} @@ -265,12 +325,27 @@ line_code = #{lineCode,jdbcType=VARCHAR}, + + draw_way = #{drawWay,jdbcType=TINYINT}, + graph_data = #{graphData,jdbcType=LONGVARCHAR}, logic_data = #{logicData,jdbcType=LONGVARCHAR}, + + init_pos_config = #{initPosConfig,jdbcType=LONGVARCHAR}, + + + check_config = #{checkConfig,jdbcType=LONGVARCHAR}, + + + ci_generate_config = #{ciGenerateConfig,jdbcType=LONGVARCHAR}, + + + big_screen_config = #{bigScreenConfig,jdbcType=LONGVARCHAR}, + where id = #{id,jdbcType=BIGINT} @@ -280,8 +355,13 @@ update_time = #{updateTime,jdbcType=TIMESTAMP}, author_id = #{authorId,jdbcType=BIGINT}, line_code = #{lineCode,jdbcType=VARCHAR}, + draw_way = #{drawWay,jdbcType=TINYINT}, graph_data = #{graphData,jdbcType=LONGVARCHAR}, - logic_data = #{logicData,jdbcType=LONGVARCHAR} + logic_data = #{logicData,jdbcType=LONGVARCHAR}, + init_pos_config = #{initPosConfig,jdbcType=LONGVARCHAR}, + check_config = #{checkConfig,jdbcType=LONGVARCHAR}, + ci_generate_config = #{ciGenerateConfig,jdbcType=LONGVARCHAR}, + big_screen_config = #{bigScreenConfig,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=BIGINT} @@ -289,7 +369,8 @@ set `name` = #{name,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}, author_id = #{authorId,jdbcType=BIGINT}, - line_code = #{lineCode,jdbcType=VARCHAR} + line_code = #{lineCode,jdbcType=VARCHAR}, + draw_way = #{drawWay,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file