From 79dca6bd8d373f0549c568322aa15a7f04fe7cc2 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Mon, 24 May 2021 10:43:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E9=97=B4=E8=BF=90=E8=A1=8C=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E5=92=8C=E5=81=9C=E7=AB=99=E6=97=B6=E9=97=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=9B=E5=BB=BA=E3=80=81=E4=BF=AE=E6=94=B9=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20210520-sheng.sql | 3 + .../draft/DraftMapParkTimeController.java | 34 +++++ .../draft/DraftMapRunLevelController.java | 34 +++++ .../runplan/RunPlanDraftController.java | 8 -- .../rtss/dao/DraftMapParkingTimeDAO.java | 35 +---- .../rtss/entity/DraftMapParkingTime.java | 9 +- .../entity/DraftMapParkingTimeExample.java | 130 ++++++++++++++++++ .../rtss/services/DraftMapService.java | 12 +- .../rtss/services/IRunPlanDraftService.java | 5 - .../rtss/services/RunPlanDraftService.java | 16 +-- .../DraftMapCiDataGeneratorImpl.java | 107 +++----------- .../services/draftData/DraftMapService.java | 13 +- .../draftData/DraftMapServiceImpl.java | 77 +++++++++-- .../services/draftData/ParkTimeService.java | 67 +++++++++ .../services/draftData/RunLevelService.java | 107 ++++++++++++++ .../cbtc/ATS/operation/Operation.java | 6 + .../handler/RunPlanOperateHandler.java | 24 ++++ .../cbtc/build/SimulationBuilder.java | 4 +- .../cbtc/build/UserConfigDataBuilder.java | 34 ++++- .../simulation/cbtc/data/map/SectionPath.java | 5 + .../cbtc/data/map/StationParkTime.java | 11 ++ .../cbtc/data/map/StationRunLevel.java | 4 + .../client/map/newmap/CiGenerateResultVO.java | 2 + .../map/newmap/MapCiGenerateConfig.java | 10 +- .../client/map/newmap/MapLogicDataNewVO.java | 7 - .../client/map/newmap/MapRoutingDataVO.java | 12 +- .../map/newmap/MapStationParkingTimeVO.java | 31 +++-- .../map/newmap/MapStationRunLevelVO.java | 18 +++ .../map/newmap/SectionParkingTimeVO.java | 26 ---- .../runplan/user/RunPlanParkingTimeVO.java | 8 ++ .../runplan/user/RunPlanRunlevelVO.java | 15 ++ .../mybatis/mapper/DraftMapParkingTimeDAO.xml | 99 +++++-------- 32 files changed, 684 insertions(+), 289 deletions(-) create mode 100644 sql/20210520-sheng.sql create mode 100644 src/main/java/club/joylink/rtss/controller/draft/DraftMapParkTimeController.java create mode 100644 src/main/java/club/joylink/rtss/controller/draft/DraftMapRunLevelController.java create mode 100644 src/main/java/club/joylink/rtss/services/draftData/ParkTimeService.java create mode 100644 src/main/java/club/joylink/rtss/services/draftData/RunLevelService.java create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/RunPlanOperateHandler.java delete mode 100644 src/main/java/club/joylink/rtss/vo/client/map/newmap/SectionParkingTimeVO.java diff --git a/sql/20210520-sheng.sql b/sql/20210520-sheng.sql new file mode 100644 index 000000000..912071354 --- /dev/null +++ b/sql/20210520-sheng.sql @@ -0,0 +1,3 @@ +ALTER TABLE `draft_map_parking_time` +CHANGE COLUMN `section_parking_time` `section_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '区段code' AFTER `station_code`, +ADD COLUMN `parking_time` int NOT NULL COMMENT '停站时间' AFTER `section_code`; diff --git a/src/main/java/club/joylink/rtss/controller/draft/DraftMapParkTimeController.java b/src/main/java/club/joylink/rtss/controller/draft/DraftMapParkTimeController.java new file mode 100644 index 000000000..237d4c235 --- /dev/null +++ b/src/main/java/club/joylink/rtss/controller/draft/DraftMapParkTimeController.java @@ -0,0 +1,34 @@ +package club.joylink.rtss.controller.draft; + +import club.joylink.rtss.services.draftData.ParkTimeService; +import club.joylink.rtss.vo.client.map.newmap.MapStationParkingTimeVO; +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/{mapId}/parkTime") +@Slf4j +public class DraftMapParkTimeController { + + @Autowired + private ParkTimeService parkTimeService; + + @PostMapping("/generate") + public List generate(@PathVariable Long mapId) { + return this.parkTimeService.generate(mapId); + } + + @GetMapping("/all") + public List queryAll(@PathVariable Long mapId) { + return this.parkTimeService.queryAll(mapId); + } + + @PutMapping("/{id}") + public void update(@PathVariable Long mapId, @PathVariable Long id, @RequestBody MapStationParkingTimeVO parkingTimeVO) { + this.parkTimeService.update(mapId, id, parkingTimeVO); + } + +} diff --git a/src/main/java/club/joylink/rtss/controller/draft/DraftMapRunLevelController.java b/src/main/java/club/joylink/rtss/controller/draft/DraftMapRunLevelController.java new file mode 100644 index 000000000..ff70cf047 --- /dev/null +++ b/src/main/java/club/joylink/rtss/controller/draft/DraftMapRunLevelController.java @@ -0,0 +1,34 @@ +package club.joylink.rtss.controller.draft; + +import club.joylink.rtss.services.draftData.RunLevelService; +import club.joylink.rtss.vo.client.map.newmap.MapStationRunLevelVO; +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/{mapId}/runLevel") +@Slf4j +public class DraftMapRunLevelController { + + @Autowired + private RunLevelService runLevelService; + + @PostMapping("/generate") + public List generate(@PathVariable Long mapId) { + return this.runLevelService.generate(mapId); + } + + @GetMapping("/all") + public List queryAll(@PathVariable Long mapId) { + return this.runLevelService.queryAll(mapId); + } + + @PutMapping("/{id}") + public void update(@PathVariable Long mapId, @PathVariable Long id, @RequestBody MapStationRunLevelVO runLevelVO) { + this.runLevelService.update(mapId, id, runLevelVO); + } + +} diff --git a/src/main/java/club/joylink/rtss/controller/runplan/RunPlanDraftController.java b/src/main/java/club/joylink/rtss/controller/runplan/RunPlanDraftController.java index 433dddafa..cdaa7c530 100644 --- a/src/main/java/club/joylink/rtss/controller/runplan/RunPlanDraftController.java +++ b/src/main/java/club/joylink/rtss/controller/runplan/RunPlanDraftController.java @@ -7,7 +7,6 @@ import club.joylink.rtss.services.IRunPlanDraftService; import club.joylink.rtss.services.runplan.IRunPlanRoutingService; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.UserVO; -import club.joylink.rtss.vo.client.map.newmap.MapStationParkingTimeVO; import club.joylink.rtss.vo.client.map.newmap.MapStationRunLevelVO; import club.joylink.rtss.vo.client.runplan.*; import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingSection; @@ -15,7 +14,6 @@ import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO; import club.joylink.rtss.vo.client.validGroup.RunPlanCreateCheck; import club.joylink.rtss.vo.client.validGroup.RunPlanNameCheck; import club.joylink.rtss.vo.client.validGroup.ValidList; -import club.joylink.rtss.vo.runplan.RunPlanInput; import club.joylink.rtss.vo.runplan.RunPlanInputData; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -127,12 +125,6 @@ public class RunPlanDraftController { return this.iRunPlanDraftService.getStationRunLevel(mapId); } - @ApiOperation(value = "获取地图原始车站停站时间") - @GetMapping(path = "/{mapId}/stationParkingTime") - public List getStationParkingTimes(@PathVariable Long mapId) { - return this.iRunPlanDraftService.getStationParkingTimeList(mapId); - } - @ApiOperation(value = "查询运行图服务号是否存在") @GetMapping(path = "/{planId}/{serviceNumber}/service") public boolean ifServerExists(@PathVariable Long planId, @PathVariable String serviceNumber) { diff --git a/src/main/java/club/joylink/rtss/dao/DraftMapParkingTimeDAO.java b/src/main/java/club/joylink/rtss/dao/DraftMapParkingTimeDAO.java index 98f8f0bde..aa39bf4db 100644 --- a/src/main/java/club/joylink/rtss/dao/DraftMapParkingTimeDAO.java +++ b/src/main/java/club/joylink/rtss/dao/DraftMapParkingTimeDAO.java @@ -3,39 +3,12 @@ package club.joylink.rtss.dao; import club.joylink.rtss.entity.DraftMapParkingTime; import club.joylink.rtss.entity.DraftMapParkingTimeExample; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; -import java.util.List; - +/** + * DraftMapParkingTimeDAO继承基类 + */ @Mapper @Repository -public interface DraftMapParkingTimeDAO { - long countByExample(DraftMapParkingTimeExample example); - - int deleteByExample(DraftMapParkingTimeExample example); - - int deleteByPrimaryKey(Long id); - - int insert(DraftMapParkingTime record); - - int insertSelective(DraftMapParkingTime record); - - List selectByExampleWithBLOBs(DraftMapParkingTimeExample example); - - List selectByExample(DraftMapParkingTimeExample example); - - DraftMapParkingTime selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") DraftMapParkingTime record, @Param("example") DraftMapParkingTimeExample example); - - int updateByExampleWithBLOBs(@Param("record") DraftMapParkingTime record, @Param("example") DraftMapParkingTimeExample example); - - int updateByExample(@Param("record") DraftMapParkingTime record, @Param("example") DraftMapParkingTimeExample example); - - int updateByPrimaryKeySelective(DraftMapParkingTime record); - - int updateByPrimaryKeyWithBLOBs(DraftMapParkingTime record); - - int updateByPrimaryKey(DraftMapParkingTime record); +public interface DraftMapParkingTimeDAO extends MyBatisBaseDao { } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/DraftMapParkingTime.java b/src/main/java/club/joylink/rtss/entity/DraftMapParkingTime.java index 6907a2e68..bb54ea690 100644 --- a/src/main/java/club/joylink/rtss/entity/DraftMapParkingTime.java +++ b/src/main/java/club/joylink/rtss/entity/DraftMapParkingTime.java @@ -23,9 +23,14 @@ public class DraftMapParkingTime implements Serializable { private String stationCode; /** - * 此车站下站台区段停站时间 + * 区段code */ - private String sectionParkingTime; + private String sectionCode; + + /** + * 停站时间 + */ + private Integer parkingTime; private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/DraftMapParkingTimeExample.java b/src/main/java/club/joylink/rtss/entity/DraftMapParkingTimeExample.java index 32dffd3a2..a3dccb623 100644 --- a/src/main/java/club/joylink/rtss/entity/DraftMapParkingTimeExample.java +++ b/src/main/java/club/joylink/rtss/entity/DraftMapParkingTimeExample.java @@ -313,6 +313,136 @@ public class DraftMapParkingTimeExample { addCriterion("station_code not between", value1, value2, "stationCode"); return (Criteria) this; } + + public Criteria andSectionCodeIsNull() { + addCriterion("section_code is null"); + return (Criteria) this; + } + + public Criteria andSectionCodeIsNotNull() { + addCriterion("section_code is not null"); + return (Criteria) this; + } + + public Criteria andSectionCodeEqualTo(String value) { + addCriterion("section_code =", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeNotEqualTo(String value) { + addCriterion("section_code <>", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeGreaterThan(String value) { + addCriterion("section_code >", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeGreaterThanOrEqualTo(String value) { + addCriterion("section_code >=", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeLessThan(String value) { + addCriterion("section_code <", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeLessThanOrEqualTo(String value) { + addCriterion("section_code <=", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeLike(String value) { + addCriterion("section_code like", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeNotLike(String value) { + addCriterion("section_code not like", value, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeIn(List values) { + addCriterion("section_code in", values, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeNotIn(List values) { + addCriterion("section_code not in", values, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeBetween(String value1, String value2) { + addCriterion("section_code between", value1, value2, "sectionCode"); + return (Criteria) this; + } + + public Criteria andSectionCodeNotBetween(String value1, String value2) { + addCriterion("section_code not between", value1, value2, "sectionCode"); + return (Criteria) this; + } + + public Criteria andParkingTimeIsNull() { + addCriterion("parking_time is null"); + return (Criteria) this; + } + + public Criteria andParkingTimeIsNotNull() { + addCriterion("parking_time is not null"); + return (Criteria) this; + } + + public Criteria andParkingTimeEqualTo(Integer value) { + addCriterion("parking_time =", value, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeNotEqualTo(Integer value) { + addCriterion("parking_time <>", value, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeGreaterThan(Integer value) { + addCriterion("parking_time >", value, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeGreaterThanOrEqualTo(Integer value) { + addCriterion("parking_time >=", value, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeLessThan(Integer value) { + addCriterion("parking_time <", value, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeLessThanOrEqualTo(Integer value) { + addCriterion("parking_time <=", value, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeIn(List values) { + addCriterion("parking_time in", values, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeNotIn(List values) { + addCriterion("parking_time not in", values, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeBetween(Integer value1, Integer value2) { + addCriterion("parking_time between", value1, value2, "parkingTime"); + return (Criteria) this; + } + + public Criteria andParkingTimeNotBetween(Integer value1, Integer value2) { + addCriterion("parking_time not between", value1, value2, "parkingTime"); + return (Criteria) this; + } } /** diff --git a/src/main/java/club/joylink/rtss/services/DraftMapService.java b/src/main/java/club/joylink/rtss/services/DraftMapService.java index 2caf4e427..bc0611954 100644 --- a/src/main/java/club/joylink/rtss/services/DraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/DraftMapService.java @@ -444,8 +444,8 @@ public class DraftMapService implements IDraftMapService { //车站轨道停站时间 DraftMapParkingTimeExample parkingTimeExample = new DraftMapParkingTimeExample(); parkingTimeExample.createCriteria().andMapIdEqualTo(id); - List parkingTimeList = draftMapParkingTimeDAO.selectByExampleWithBLOBs(parkingTimeExample); - logicDataVO.setParkingTimeList(CollectionUtils.isEmpty(draftMapRunLevels) ? new ArrayList<>() : + List parkingTimeList = draftMapParkingTimeDAO.selectByExample(parkingTimeExample); + logicDataVO.setParkingTimeList(CollectionUtils.isEmpty(parkingTimeList) ? new ArrayList<>() : parkingTimeList.stream().map(MapStationParkingTimeVO::convertRel2VO).collect(Collectors.toList())); // 自动信号 DraftMapAutoSignalExample autoSignalExample = new DraftMapAutoSignalExample(); @@ -1350,7 +1350,7 @@ public class DraftMapService implements IDraftMapService { if (StringUtils.hasText(queryVO.getStationCode())) { criteria.andStationCodeEqualTo(queryVO.getStationCode()); } - Page page = (Page) this.draftMapParkingTimeDAO.selectByExampleWithBLOBs(example); + Page page = (Page) this.draftMapParkingTimeDAO.selectByExample(example); List parkingTimeList = page.getResult().stream().map(MapStationParkingTimeVO::convert2VO).collect(Collectors.toList()); return PageVO.convert(page, parkingTimeList); } @@ -1363,9 +1363,9 @@ public class DraftMapService implements IDraftMapService { @Override public void updateStationParkTime(Long id, MapStationParkingTimeVO parkingTimeVO) { - DraftMapParkingTime draftMapParkingTime = getDraftMapParkingTimeEntity(id); - draftMapParkingTime.setSectionParkingTime(JsonUtils.writeValueAsString(parkingTimeVO.getParkingTimeVOList())); - this.draftMapParkingTimeDAO.updateByPrimaryKeyWithBLOBs(draftMapParkingTime); +// DraftMapParkingTime draftMapParkingTime = getDraftMapParkingTimeEntity(id); +// draftMapParkingTime.setSectionParkingTime(JsonUtils.writeValueAsString(parkingTimeVO.getParkingTimeVOList())); +// this.draftMapParkingTimeDAO.updateByPrimaryKeyWithBLOBs(draftMapParkingTime); } @Override diff --git a/src/main/java/club/joylink/rtss/services/IRunPlanDraftService.java b/src/main/java/club/joylink/rtss/services/IRunPlanDraftService.java index d873ecc41..e557093d5 100644 --- a/src/main/java/club/joylink/rtss/services/IRunPlanDraftService.java +++ b/src/main/java/club/joylink/rtss/services/IRunPlanDraftService.java @@ -4,10 +4,8 @@ import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.map.MapRoutingSectionVO; -import club.joylink.rtss.vo.client.map.newmap.MapStationParkingTimeVO; import club.joylink.rtss.vo.client.map.newmap.MapStationRunLevelVO; import club.joylink.rtss.vo.client.runplan.*; -import club.joylink.rtss.vo.runplan.RunPlanInput; import club.joylink.rtss.vo.runplan.RunPlanInputData; import org.springframework.transaction.annotation.Transactional; @@ -95,9 +93,6 @@ public interface IRunPlanDraftService { /**获取地图原始站间运行等级*/ List getStationRunLevel(Long mapId); - /**获取地图原始车站轨道停站时间*/ - List getStationParkingTimeList(Long mapId); - /** * 设置站间运行时间 * @param mapId diff --git a/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java b/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java index 33973e4c2..500ac41aa 100644 --- a/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java +++ b/src/main/java/club/joylink/rtss/services/RunPlanDraftService.java @@ -7,14 +7,13 @@ import club.joylink.rtss.dao.RunPlanDraftDAO; import club.joylink.rtss.dao.RunPlanLevelDAO; import club.joylink.rtss.entity.*; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; -import club.joylink.rtss.services.runplan.*; +import club.joylink.rtss.services.runplan.IRunPlanRoutingService; +import club.joylink.rtss.services.runplan.IRunPlanRunlevelService; +import club.joylink.rtss.services.runplan.RunPlanGenerator; import club.joylink.rtss.services.runplan.importReal.IRunPlanStrategyNew; import club.joylink.rtss.services.runplan.importReal.RunPlanImportStrategyEnum; import club.joylink.rtss.simulation.cbtc.GroupSimulationService; -import club.joylink.rtss.simulation.cbtc.build.RunPlanBuilder; -import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder; import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; -import club.joylink.rtss.simulation.cbtc.data.map.MapElement; import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.UserVO; @@ -25,13 +24,10 @@ import club.joylink.rtss.vo.client.map.newmap.*; import club.joylink.rtss.vo.client.runplan.*; import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO; import club.joylink.rtss.vo.client.runplan.user.RunPlanRunlevelVO; -import club.joylink.rtss.vo.client.runplan.user.RunPlanUserConfigVO; import club.joylink.rtss.vo.runplan.RunPlanInputData; -import com.fasterxml.jackson.annotation.JsonProperty; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,7 +35,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; -import java.lang.reflect.Array; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.temporal.ChronoUnit; @@ -263,11 +258,6 @@ public class RunPlanDraftService implements IRunPlanDraftService { return this.iMapService.getMapDetail(mapId).getLogicDataNew().getRunLevelList(); } - @Override - public List getStationParkingTimeList(Long mapId) { - return this.iMapService.getMapDetail(mapId).getLogicDataNew().getParkingTimeList(); - } - @Override @Transactional public void setStationRunningTime(Long mapId, List runPlanLevelVOList, UserVO userVO) { diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java index 782a06fea..777c3437e 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -29,7 +29,6 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { @Autowired private DraftMapService draftMapService; - @Autowired private RoutingGenerator routingGenerator; @@ -88,7 +87,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { // 删除旧联锁数据,保存新联锁数据 this.draftMapService.cleanAndSaveCiData(mapId, approachSectionVOList, routeVOList, overlapVOList, flsVOList, autoSignalNewVOList, - autoReentryVOList, destinationCodeDefinitionVOList, result.getRoutingList(), result.getStationRunLevelList()); + autoReentryVOList, destinationCodeDefinitionVOList, result.getRoutingList()); return result.convert2VO(); } @@ -123,11 +122,10 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { private List destinationCodeDefinitionList; List routingList; - List stationRunLevelList; public CiGenerateResult(List errMsgList, List approachList, List autoSignalList, List routeList, List overlapList, List flsList, List generateCycleList, List routingList, - List stationRunLevelList, List destinationCodeDefinitionList) { + List destinationCodeDefinitionList) { this.errMsgList = errMsgList; this.approachList = approachList; this.autoSignalList = autoSignalList; @@ -137,7 +135,6 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { this.cycleList = generateCycleList; this.destinationCodeDefinitionList = destinationCodeDefinitionList; this.routingList = routingList; - this.stationRunLevelList = stationRunLevelList; log.info(String.format("生成信号机接近区段数据[%s]条", approachList.size())); log.info(String.format("生成进路数据总计[%s]条", routeList.size())); log.info(String.format("生成延续保护数据[%s]条", overlapList.size())); @@ -145,7 +142,6 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { log.info(String.format("生成自动信号数据[%s]条", autoSignalList.size())); log.info(String.format("生成自动折返数据[%s]条", generateCycleList.size())); log.info(String.format("生成交路数据[%s]条", routingList.size())); - log.info(String.format("生成站间运行数据[%s]条", stationRunLevelList.size())); } public CiGenerateResultVO convert2VO() { @@ -155,7 +151,8 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { resultVO.setCycleCount(this.cycleList.size()); resultVO.setAutoSignalCount(this.autoSignalList.size()); resultVO.setRoutingCount(this.routingList.size()); - resultVO.setStationRunlevelCount(this.stationRunLevelList.size()); +// resultVO.setStationRunlevelCount(this.stationRunLevelList.size()); +// resultVO.setStationParkTimeCount(this.parkTimeList.size()); resultVO.setDestinationCodeDefinitionCount(this.destinationCodeDefinitionList.size()); return resultVO; } @@ -306,9 +303,12 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { List generateRoutingList = this.routingGenerator.generateAllRouting(deviceMap, errorList); //站间运行等级生成 - List generatedStationRunLevelList = new ArrayList<>(); -// generateRunLevel(deviceMap, errorList, generateRoutingList, generatedStationRunLevelList); - generateRunLevel(deviceMap, errorList, generatedStationRunLevelList); +// List generatedStationRunLevelList = +// this.runLevelGenerator.generateRunLevels( +// generateRoutingList, deviceMap, errorList +// ); + // 停站时间生成 +// List parkTimeList = this.parkTimeGenerator.generate(deviceMap, errorList); //目的地码生成 List destinationCodeDefinitionList = new ArrayList<>(); @@ -374,7 +374,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { return new CiGenerateResult(errorList, approachList, autoSignalList, generatedRouteList, generatedOverlapList, flsList, - generateCycleList, generateRoutingList, generatedStationRunLevelList, destinationCodeDefinitionList); + generateCycleList, generateRoutingList, destinationCodeDefinitionList); } /** @@ -936,79 +936,6 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { } } - private void generateRunLevel(Map deviceMap, List errorList, List generatedStationRunLevelList) { - deviceMap.values().stream().filter(mapElement -> { - if (mapElement.getDeviceType().equals(MapElement.DeviceType.SECTION)) { - Section section = (Section) mapElement; - if (section.isTransferTrack() || section.isNormalStandTrack() || section.isTurnBackTrack()) { - return true; - } - return false; - } - return false; - }).map(mapElement -> (Section) mapElement).forEach(startSection -> { - - getStationRunLevel(generatedStationRunLevelList, startSection, true, errorList); - getStationRunLevel(generatedStationRunLevelList, startSection, false, errorList); - }); - } - - private void getStationRunLevel(List generatedStationRunLevelList, Section startSection, boolean right, List errorList) { - List
adjacentSections = CalculateService.findAdjacentSections(startSection, right); - log.debug(" 车站{}区段({}) 的相邻 {} 站间区段为:{}", startSection.getStation().getName(), startSection.getName(), right ? "右向" : "左向", JsonUtils.writeValueAsString(adjacentSections.stream().map(Section::getCode).collect(Collectors.toList()))); - adjacentSections.forEach(endSection -> { - - //验证是否是进路路径的站间 - List routePaths = CalculateService.queryRoutePathsOnDirection(startSection, endSection, right, 10); - if (CollectionUtils.isEmpty(routePaths)) { - log.warn(String.format("站间运行等级数据生成失败:没有找到[%s(%s) ——> %s(%s)]对应方向[%s]的进路路径可达的站间", - startSection.getStation().getName(), startSection.getName(), endSection.getStation().getName(), endSection.getName(), right ? "右向" : "左向")); - errorList.add(String.format("站间运行等级数据生成失败:没有找到[%s(%s) ——> %s(%s)]对应方向[%s]的进路路径可达的站间", - startSection.getStation().getName(), startSection.getName(), endSection.getStation().getName(), endSection.getName(), right ? "右向" : "左向")); - return; - } - - // 创建 - MapStationRunLevelVO runLevelVO = new MapStationRunLevelVO(); - runLevelVO.setStartSectionCode(startSection.getCode()); - runLevelVO.setStartStationCode(startSection.getStation().getCode()); - runLevelVO.setEndSectionCode(endSection.getCode()); - runLevelVO.setEndStationCode(endSection.getStation().getCode()); - runLevelVO.setRight(right); - -// List routePaths = CalculateService.queryRoutePathsOnDirection(startSection, endSection, right); -// if (CollectionUtils.isEmpty(routePaths)) { -// // 未找到,反方向再找 -// routePaths = CalculateService.queryRoutePathsOnDirection(startSection, endSection, !right); -// if (!CollectionUtils.isEmpty(routePaths)) { -// runLevelVO.setRight(!right); -// } -// } -// if (CollectionUtils.isEmpty(routePaths)) { -// log.warn(String.format("站间运行等级数据生成失败:没有找到[%s(%s) ——> %s(%s)]对应方向[%s]的站间", -// startSection.getStation().getName(), startSection.getName(), endSection.getStation().getName(), endSection.getName(), right ? "右向" : "左向")); -//// errorList.add(String.format("站间运行等级数据生成失败:没有找到[%s(%s) ——> %s(%s)]对应方向[%s]的站间", -//// startSection.getStation().getName(), startSection.getName(), endSection.getStation().getName(), endSection.getName(), right ? "右向" : "左向")); -// continue; -// } - // 找到,计算距离 -// float distance = routePaths.get(0).calculateDistance(); - Float distance = CalculateService.calculateDistance(startSection, endSection, right); - if (Objects.isNull(distance)) { - errorList.add(String.format("站间运行等级数据生成失败:没有找到[%s(%s) ——> %s(%s)]对应方向[%s]的站间", - startSection.getStation().getName(), startSection.getName(), endSection.getStation().getName(), endSection.getName(), right ? "右向" : "左向")); - return; - } - runLevelVO.setDistance(distance); - runLevelVO.generateDefaultRunLevel(); - log.debug(String.format("站间运行等级[%s]生成成功", - String.format("%s(%s(%s))->%s(%s(%s))", - startSection.getStation().getName(), startSection.getName(), startSection.getCode(), - endSection.getStation().getName(), endSection.getName(), endSection.getCode()))); - generatedStationRunLevelList.add(runLevelVO); - }); - } - private void buildAutoSignalRouteConflict(List autoSignalList, List generatedRouteList) { if (CollectionUtils.isEmpty(autoSignalList)) { // 自动信号为空,返回 @@ -1591,17 +1518,15 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { SectionPath tempPath, List overlapPathList, MapCiGenerateConfig config, List errorList) { if (!CollectionUtils.isEmpty(tempPath.getSectionList())) { // 已经有路径 + Section lastSection = tempPath.getLastSection(); if (Objects.isNull(section) || !section.isSwitchTrack() || - !tempPath.getLastSection().isSwitchTrack()) { + !lastSection.isSwitchTrack()) { // 且后面的是尽头或路径最后已经是非道岔区段,构建成功,返回 overlapPathList.add(tempPath); return; - } else if (config.isOverlapOnlyOneSwitch() && - Objects.nonNull(section) && - section.isSwitchTrack() && - !Objects.equals(tempPath.getLastSection().getParent(), section.getParent())) { - // 配置只构建一个道岔计轴的情况,如果已经不是相同道岔计轴,完成,返回 + } else if (tempPath.getTotalLen() > config.getOverlapMinLen()) { + // 延续保护长度已经足够,返回 overlapPathList.add(tempPath); return; } @@ -1632,7 +1557,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { SectionPath rpPath = tempPath.cloneNew();// 反位路径 rpPath.addSection(relSwitch.getC()); rpPath.addSwitchElement(new SwitchElement(relSwitch, false)); - if (!config.isGenerateFls() && Objects.nonNull(linkedSwitch) && config.isOverlapOnlyOneSwitch()) { + if (!config.isGenerateFls() && Objects.nonNull(linkedSwitch)) { // 如果有联动道岔,且配置只构建一个道岔,这里添加上联动道岔 rpPath.addSwitchElement(new SwitchElement(linkedSwitch, false)); } diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapService.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapService.java index b4086a809..2e2bdd98c 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapService.java @@ -31,6 +31,15 @@ public interface DraftMapService { List flsVOList, List autoSignalVOList, List autoReentryVOList, List destinationCodeDefinitionVOList, - List generatedRoutingList, - List generatedStationRunLevelList); + List generatedRoutingList); + + List queryRoutings(Long mapId); + + void cleanAndSaveRunLevel(Long mapId, List runLevelVOList); + + List queryRunLevels(Long mapId); + + void cleanAndSaveParkTime(Long mapId, List parkTimeList); + + List queryParkTimes(Long mapId); } diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapServiceImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapServiceImpl.java index ee494db45..52c686869 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapServiceImpl.java @@ -11,36 +11,31 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.List; +import java.util.stream.Collectors; @Service public class DraftMapServiceImpl implements DraftMapService { @Autowired private DraftMapDAO draftMapDAO; - @Autowired private DraftMapSignalApproachSectionDAO draftMapSignalApproachSectionDAO; - @Autowired private DraftMapOverlapDAO draftMapOverlapDAO; - @Autowired private DraftMapRouteDAO draftMapRouteDAO; - @Autowired private DraftMapRouteFlankProtectionDAO draftMapRouteFlankProtectionDAO; - @Autowired private DraftMapAutoSignalDAO draftMapAutoSignalDAO; - @Autowired private DraftMapAutoReentryDAO draftMapAutoReentryDAO; - @Autowired private DraftMapRoutingDAO draftMapRoutingDAO; - @Autowired private DraftMapRunLevelDAO draftMapRunLevelDAO; + @Autowired + private DraftMapParkingTimeDAO draftMapParkingTimeDAO; @Override public MapVO getDraftMapData(Long mapId) { @@ -59,8 +54,7 @@ public class DraftMapServiceImpl implements DraftMapService { List autoSignalVOList, List autoReentryVOList, List destinationCodeDefinitionVOList, - List generatedRoutingList, - List generatedStationRunLevelList) { + List generatedRoutingList) { // 删除旧数据 this.cleanMapApproachSection(mapId); this.cleanMapRoute(mapId); @@ -69,7 +63,6 @@ public class DraftMapServiceImpl implements DraftMapService { this.cleanMapAutoSignal(mapId); this.cleanMapCycle(mapId); this.cleanMapRouting(mapId); - this.cleanMapRunLevel(mapId); // 保存新数据 this.saveMapApproachSection(mapId, approachVOList); this.saveMapRoute(mapId, routeVOList); @@ -78,13 +71,55 @@ public class DraftMapServiceImpl implements DraftMapService { this.saveMapAutoSignal(mapId, autoSignalVOList); this.saveMapCycle(mapId, autoReentryVOList); this.saveMapRouting(mapId, generatedRoutingList); - this.saveMapRunLevel(mapId, generatedStationRunLevelList); //目的地码数据 if (!CollectionUtils.isEmpty(destinationCodeDefinitionVOList)) { this.updateMapDestinationCodeDefinition(mapId, destinationCodeDefinitionVOList); } } + @Override + public List queryRoutings(Long mapId) { + DraftMapRoutingExample example = new DraftMapRoutingExample(); + example.createCriteria() + .andMapIdEqualTo(mapId); + List draftMapRoutings = this.draftMapRoutingDAO.selectByExampleWithBLOBs(example); + return draftMapRoutings.stream() + .map(MapRoutingDataVO::convert2VO) + .collect(Collectors.toList()); + } + + @Override + public void cleanAndSaveRunLevel(Long mapId, List runLevelVOList) { + this.cleanMapRunLevel(mapId); + this.saveMapRunLevel(mapId, runLevelVOList); + } + + @Override + public List queryRunLevels(Long mapId) { + DraftMapRunLevelExample example = new DraftMapRunLevelExample(); + example.createCriteria() + .andMapIdEqualTo(mapId); + List draftMapRunLevels = this.draftMapRunLevelDAO.selectByExampleWithBLOBs(example); + return MapStationRunLevelVO.convert2VOList(draftMapRunLevels); + } + + @Override + public void cleanAndSaveParkTime(Long mapId, List parkTimeList) { + this.cleanMapStationParkTime(mapId); + this.saveMapStationParkTime(mapId, parkTimeList); + } + + @Override + public List queryParkTimes(Long mapId) { + DraftMapParkingTimeExample example = new DraftMapParkingTimeExample(); + example.createCriteria() + .andMapIdEqualTo(mapId); + List parkingTimes = this.draftMapParkingTimeDAO.selectByExample(example); + return parkingTimes.stream() + .map(MapStationParkingTimeVO::convert2VO) + .collect(Collectors.toList()); + } + private void saveMapCycle(Long mapId, List autoReentryVOList) { if (!CollectionUtils.isEmpty(autoReentryVOList)) { for (MapAutoReentryVO autoReentryVO : autoReentryVOList) { @@ -170,6 +205,17 @@ public class DraftMapServiceImpl implements DraftMapService { } } + @Transactional + public void saveMapStationParkTime(Long mapId, List parkTimeList) { + if (!CollectionUtils.isEmpty(parkTimeList)) { + for (MapStationParkingTimeVO vo : parkTimeList) { + vo.setMapId(mapId); + DraftMapParkingTime entity = vo.convert2Draft(); + this.draftMapParkingTimeDAO.insert(entity); + } + } + } + private void cleanMapOverlap(Long mapId) { DraftMapOverlapExample example = new DraftMapOverlapExample(); example.createCriteria() @@ -231,4 +277,11 @@ public class DraftMapServiceImpl implements DraftMapService { .andMapIdEqualTo(mapId); this.draftMapRunLevelDAO.deleteByExample(example); } + + private void cleanMapStationParkTime(Long mapId) { + DraftMapParkingTimeExample example = new DraftMapParkingTimeExample(); + example.createCriteria() + .andMapIdEqualTo(mapId); + this.draftMapParkingTimeDAO.deleteByExample(example); + } } diff --git a/src/main/java/club/joylink/rtss/services/draftData/ParkTimeService.java b/src/main/java/club/joylink/rtss/services/draftData/ParkTimeService.java new file mode 100644 index 000000000..7ee6374c4 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/draftData/ParkTimeService.java @@ -0,0 +1,67 @@ +package club.joylink.rtss.services.draftData; + +import club.joylink.rtss.dao.DraftMapParkingTimeDAO; +import club.joylink.rtss.entity.DraftMapParkingTime; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder; +import club.joylink.rtss.simulation.cbtc.data.map.MapElement; +import club.joylink.rtss.simulation.cbtc.data.map.Section; +import club.joylink.rtss.util.JsonUtils; +import club.joylink.rtss.vo.client.map.MapVO; +import club.joylink.rtss.vo.client.map.newmap.MapStationParkingTimeVO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 停站时间生成 + */ +@Slf4j +@Service +public class ParkTimeService { + + @Autowired + private DraftMapService draftMapService; + @Autowired + private DraftMapParkingTimeDAO draftMapParkingTimeDAO; + + public List generate(Map deviceMap) { + List list = new ArrayList<>(); + List
standSectionList = deviceMap.values().stream() + .filter(mapElement -> mapElement.getDeviceType().equals(MapElement.DeviceType.SECTION)) + .map(mapElement -> ((Section) mapElement)) + .filter(section -> section.isNormalStandTrack()) + .collect(Collectors.toList()); + for (Section section : standSectionList) { + list.add(new MapStationParkingTimeVO(section.getStation().getCode(), section.getCode())); + } + return list; + } + + public List generate(Long mapId) { + // 先校验地图基础数据 + MapVO mapVO = this.draftMapService.getDraftMapData(mapId); + SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildBasicMapData(mapVO); + BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(), + String.format("地图基础数据有错误: %s", JsonUtils.writeValueAsString(buildResult.getErrMsgList()))); + Map deviceMap = buildResult.getDeviceMap(); + List parkTimeList = this.generate(deviceMap); + this.draftMapService.cleanAndSaveParkTime(mapId, parkTimeList); + return parkTimeList; + } + + public List queryAll(Long mapId) { + return draftMapService.queryParkTimes(mapId); + } + + public void update(Long mapId, Long id, MapStationParkingTimeVO parkingTimeVO) { + DraftMapParkingTime parkingTime = this.draftMapParkingTimeDAO.selectByPrimaryKey(id); + parkingTime.setParkingTime(parkingTimeVO.getParkingTime()); + this.draftMapParkingTimeDAO.updateByPrimaryKeySelective(parkingTime); + } +} diff --git a/src/main/java/club/joylink/rtss/services/draftData/RunLevelService.java b/src/main/java/club/joylink/rtss/services/draftData/RunLevelService.java new file mode 100644 index 000000000..3cbd38d10 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/draftData/RunLevelService.java @@ -0,0 +1,107 @@ +package club.joylink.rtss.services.draftData; + +import club.joylink.rtss.dao.DraftMapRunLevelDAO; +import club.joylink.rtss.entity.DraftMapRunLevel; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder; +import club.joylink.rtss.simulation.cbtc.data.CalculateService; +import club.joylink.rtss.simulation.cbtc.data.map.MapElement; +import club.joylink.rtss.simulation.cbtc.data.map.Section; +import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; +import club.joylink.rtss.util.JsonUtils; +import club.joylink.rtss.vo.client.map.MapVO; +import club.joylink.rtss.vo.client.map.newmap.MapRoutingDataVO; +import club.joylink.rtss.vo.client.map.newmap.MapRoutingSectionNewVO; +import club.joylink.rtss.vo.client.map.newmap.MapStationRunLevelVO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 运行等级生成 + */ +@Slf4j +@Service +public class RunLevelService { + + @Autowired + private DraftMapService draftMapService; + @Autowired + private DraftMapRunLevelDAO draftMapRunLevelDAO; + + /** + * 生成正常站间运行等级(基于生成交路) + * @param routingList + * @param deviceMap + * @return + */ + public List generateRunLevels(List routingList, + Map deviceMap) { + Map runLevelVOMap = new HashMap<>(); + for (MapRoutingDataVO routingDataVO : routingList) { + List allStationSectionList = routingDataVO.getAllStationSectionList(); + for (int i = 1; i < allStationSectionList.size(); i++) { + MapRoutingSectionNewVO start = allStationSectionList.get(i - 1); + MapRoutingSectionNewVO end = allStationSectionList.get(i); + if (start.getSectionCode().equals(end.getSectionCode())) { + continue; + } + String key = MapStationRunLevelVO.buildKey(start.getSectionCode(), end.getSectionCode()); + if (runLevelVOMap.containsKey(key)) { + continue; + } + MapStationRunLevelVO vo = new MapStationRunLevelVO(start, end, routingDataVO.getRight()); + float distance = this.calculateDistance(vo, deviceMap); + vo.setDistance(distance); + vo.generateDefaultRunLevel(); + log.debug(String.format("生成站间运行等级:[%s]", vo.debugStr())); + runLevelVOMap.put(key, vo); + } + } + return new ArrayList<>(runLevelVOMap.values()); + } + + private float calculateDistance(MapStationRunLevelVO vo, Map deviceMap) { + Section start = (Section) deviceMap.get(vo.getStartSectionCode()); + Section end = (Section) deviceMap.get(vo.getEndSectionCode()); + boolean right = vo.getRight(); + List routePaths = CalculateService.queryRoutePathsOnDirection(start, end, right, 20); + BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionNotEmpty(routePaths, + String.format("进路路径[%s->%s]未找到", start.debugStr(), end.debugStr())); + return routePaths.get(0).getLength(); + } + + public List generate(Long mapId) { + // 先校验地图基础数据 + MapVO mapVO = this.draftMapService.getDraftMapData(mapId); + SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildBasicMapData(mapVO); + BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(), + String.format("地图基础数据有错误: %s", JsonUtils.writeValueAsString(buildResult.getErrMsgList()))); + Map deviceMap = buildResult.getDeviceMap(); + List routingDataVOList = this.draftMapService.queryRoutings(mapId); + List runLevelVOList = this.generateRunLevels(routingDataVOList, deviceMap); + this.draftMapService.cleanAndSaveRunLevel(mapId, runLevelVOList); + return runLevelVOList; + } + + public List queryAll(Long mapId) { + return this.draftMapService.queryRunLevels(mapId); + } + + public void update(Long mapId, Long rlId, MapStationRunLevelVO runLevelVO) { + DraftMapRunLevel draftMapRunLevel = this.draftMapRunLevelDAO.selectByPrimaryKey(rlId); + MapStationRunLevelVO vo = MapStationRunLevelVO.fromDraft(draftMapRunLevel); + vo.setL1(runLevelVO.getL1()); + vo.setL2(runLevelVO.getL2()); + vo.setL3(runLevelVO.getL3()); + vo.setL4(runLevelVO.getL4()); + vo.setL5(runLevelVO.getL5()); + draftMapRunLevel.setRunLevelData(vo.getRunLevelData()); + this.draftMapRunLevelDAO.updateByPrimaryKeyWithBLOBs(draftMapRunLevel); + } +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index bbd72bf07..0ad0232f9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -412,6 +412,12 @@ public class Operation { //--------------------------- 方向杆 --------------------------- /** 方向转换 */ Direction_Change, + + //--------------------------- 运行计划 --------------------------- + /** 添加计划 */ + RunPlan_Add_Trip, + /** 删除计划 */ + RunPlan_Delete_Trip, } /**操作对象枚举*/ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/RunPlanOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/RunPlanOperateHandler.java new file mode 100644 index 000000000..68303e2b7 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/RunPlanOperateHandler.java @@ -0,0 +1,24 @@ +package club.joylink.rtss.simulation.cbtc.ATS.operation.handler; + +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.Simulation; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@OperateHandler +public class RunPlanOperateHandler { + + @OperateHandlerMapping(type = Operation.Type.RunPlan_Add_Trip) + public void addTripPlan(Simulation simulation) { + + } + + @OperateHandlerMapping(type = Operation.Type.RunPlan_Delete_Trip) + public void deleteTripPlan(Simulation simulation, String serviceNumber, + String tripNumber, String stationCode) { + + } + +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java index abe0ee7e6..24cc18b86 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java @@ -61,8 +61,8 @@ public class SimulationBuilder { // simulation.getRepository().setRunLevelList(mapDataBuildResult.getRunLevelList()); simulation.getRepository().getCatenaryMap().putAll(mapDataBuildResult.getCatenaryMap()); simulation.getRepository().getSectionRespondersMap().putAll(mapDataBuildResult.getSectionRespondersMap()); - UserConfigDataBuilder.buildUserRunLevel(simulation.getRepository(), buildParams.getUserRunLevelList()); - UserConfigDataBuilder.buildUserParkTime(simulation.getRepository(), buildParams.getUserParkTimeList()); + UserConfigDataBuilder.buildRunLevel(simulation.getRepository(), buildParams.getUserRunLevelList(), buildParams.getMap()); + UserConfigDataBuilder.buildParkTime(simulation.getRepository(), buildParams.getUserParkTimeList(), buildParams.getMap()); // 加载运行图 checkAndLoadRunPlan(simulation, buildParams.getRunPlan()); // 加载派班计划 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/UserConfigDataBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/UserConfigDataBuilder.java index 36b93591f..c74d61765 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/UserConfigDataBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/UserConfigDataBuilder.java @@ -5,17 +5,31 @@ import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.map.StationParkTime; import club.joylink.rtss.simulation.cbtc.data.map.StationRunLevel; +import club.joylink.rtss.vo.client.map.MapVO; +import club.joylink.rtss.vo.client.map.newmap.MapStationParkingTimeVO; +import club.joylink.rtss.vo.client.map.newmap.MapStationRunLevelVO; import club.joylink.rtss.vo.client.runplan.user.RunPlanParkingTimeVO; import club.joylink.rtss.vo.client.runplan.user.RunPlanRunlevelVO; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; public class UserConfigDataBuilder { - public static void buildUserRunLevel(SimulationDataRepository repository, List userRunLevelList) { + public static void buildRunLevel(SimulationDataRepository repository, List userRunLevelList, MapVO map) { + Map voMap = userRunLevelList.stream() + .collect(Collectors.toMap( + vo -> StationRunLevel.buildKey(vo.getStartSectionCode(), vo.getEndSectionCode()), + Function.identity())); + List runLevelList = map.getLogicDataNew().getRunLevelList(); + for (MapStationRunLevelVO vo : runLevelList) { + String key = StationRunLevel.buildKey(vo.getStartSectionCode(), vo.getEndSectionCode()); + voMap.putIfAbsent(key, new RunPlanRunlevelVO(vo)); + } Map runLevelMap = new HashMap<>(); - for (RunPlanRunlevelVO vo : userRunLevelList) { + for (RunPlanRunlevelVO vo : voMap.values()) { Station startStation = repository.getByCode(vo.getStartStationCode(), Station.class); Section startSection = repository.getByCode(vo.getStartSectionCode(), Section.class); Station endStation = repository.getByCode(vo.getEndStationCode(), Station.class); @@ -37,8 +51,20 @@ public class UserConfigDataBuilder { repository.setRunLevelMap(runLevelMap); } - public static void buildUserParkTime(SimulationDataRepository repository, List userParkTimeList) { + public static void buildParkTime(SimulationDataRepository repository, + List userParkTimeList, MapVO map) { + Map voMap = userParkTimeList.stream() + .collect(Collectors.toMap(RunPlanParkingTimeVO::getSectionCode, Function.identity())); + List parkingTimeList = map.getLogicDataNew().getParkingTimeList(); + for (MapStationParkingTimeVO vo : parkingTimeList) { + voMap.putIfAbsent(vo.getSectionCode(), new RunPlanParkingTimeVO(vo)); + } Map parkTimeMap = new HashMap<>(); - + for (RunPlanParkingTimeVO vo : voMap.values()) { + Section section = repository.getByCode(vo.getSectionCode(), Section.class); + StationParkTime stationParkTime = new StationParkTime(section, vo.getParkingTime()); + parkTimeMap.putIfAbsent(section.getCode(), stationParkTime); + } + repository.setParkTimeMap(parkTimeMap); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SectionPath.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SectionPath.java index 91c2ae39a..6d90394aa 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SectionPath.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SectionPath.java @@ -149,4 +149,9 @@ public class SectionPath { public boolean isStraight() { return !this.containRpSwitch(); } + + public boolean isNormalPosition(Switch relSwitch) { + SwitchElement element = this.getSwitchElement(relSwitch); + return element.isNormal(); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationParkTime.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationParkTime.java index 86d1f3c10..15dd6bb70 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationParkTime.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationParkTime.java @@ -4,4 +4,15 @@ import lombok.Getter; @Getter public class StationParkTime { + Section section; + int parkTime; + + public StationParkTime(Section section, Integer parkingTime) { + this.section = section; + this.parkTime = parkingTime; + } + + public void setParkTime(int parkTime) { + this.parkTime = parkTime; + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationRunLevel.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationRunLevel.java index 3dabdb3b5..7e58b6d62 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationRunLevel.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StationRunLevel.java @@ -54,4 +54,8 @@ public class StationRunLevel { public String buildKey() { return String.format("%s-%s", this.startSection.getCode(), this.endSection.getCode()); } + + public static String buildKey(String startSectionCode, String endSectionCode) { + return String.format("%s-%s", startSectionCode, endSectionCode); + } } diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/CiGenerateResultVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/CiGenerateResultVO.java index f43b276d6..897715ab8 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/CiGenerateResultVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/CiGenerateResultVO.java @@ -22,6 +22,8 @@ public class CiGenerateResultVO { private int routingCount; @ApiModelProperty(value = "站间运行等级数量") private int stationRunlevelCount; + // 停站时间数量 + private int stationParkTimeCount; @ApiModelProperty(value = "目的地码定义") private int destinationCodeDefinitionCount; diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapCiGenerateConfig.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapCiGenerateConfig.java index 26a70ff3a..774785965 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapCiGenerateConfig.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapCiGenerateConfig.java @@ -44,9 +44,13 @@ public class MapCiGenerateConfig { @ApiModelProperty(value = "延续保护是否只构建道岔") private boolean overlapOnlySwitch; - - @ApiModelProperty(value = "延续保护构建是否只考虑一个道岔计轴") - private boolean overlapOnlyOneSwitch; +// +// @ApiModelProperty(value = "延续保护构建是否只考虑一个道岔计轴") +// private boolean overlapOnlyOneSwitch; + /** + * 延续保护最小长度 + */ + private float overlapMinLen = 55; @ApiModelProperty(value = "延续保护道岔是否只构建定位道岔") private boolean overlapSwitchNpOnly; diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapLogicDataNewVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapLogicDataNewVO.java index d950bbe63..11c3e95ed 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapLogicDataNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapLogicDataNewVO.java @@ -1,7 +1,6 @@ package club.joylink.rtss.vo.client.map.newmap; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; -import club.joylink.rtss.vo.client.runplan.user.RunPlanParkingTimeVO; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; @@ -31,12 +30,6 @@ public class MapLogicDataNewVO { @ApiModelProperty(value = "站间运行等级列表") private List runLevelList; - /** - * 停站时间列表 - */ - private List parkTimeList; - - @Deprecated @ApiModelProperty(value = "车站区段停站时间列表") private List parkingTimeList; diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRoutingDataVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRoutingDataVO.java index 8c47e2880..f2716c80a 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRoutingDataVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapRoutingDataVO.java @@ -1,8 +1,9 @@ package club.joylink.rtss.vo.client.map.newmap; -import club.joylink.rtss.simulation.cbtc.data.map.Routing; import club.joylink.rtss.entity.DraftMapRouting; +import club.joylink.rtss.simulation.cbtc.data.map.Routing; import club.joylink.rtss.util.JsonUtils; +import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; @@ -130,4 +131,13 @@ public class MapRoutingDataVO { routing.setDescription(description+LOOP_MARK); return routing; } + + @JsonIgnore + public List getAllStationSectionList() { + List list = new ArrayList<>(); + list.add(new MapRoutingSectionNewVO(this.startStationCode, this.startSectionCode)); + list.addAll(this.parkSectionCodeList); + list.add(new MapRoutingSectionNewVO(this.endStationCode, this.endSectionCode)); + return list; + } } diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationParkingTimeVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationParkingTimeVO.java index 4acd3ec40..eba558460 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationParkingTimeVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationParkingTimeVO.java @@ -1,17 +1,14 @@ package club.joylink.rtss.vo.client.map.newmap; import club.joylink.rtss.entity.DraftMapParkingTime; -import club.joylink.rtss.util.JsonUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import javax.validation.Valid; import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import java.util.List; +import javax.validation.constraints.NotNull; @ApiModel(value = "地图车站区段停站时间对象") @Getter @@ -27,17 +24,27 @@ public class MapStationParkingTimeVO { @NotBlank(message = "车站code不能为空") private String stationCode; - @ApiModelProperty(value = "车站站台区段停车时间列表") - @Valid - @NotEmpty(message = "车站站台区段停车时间不能为空") - private List parkingTimeVOList; + @ApiModelProperty(value = "站台轨/折返轨/转换轨区段code") + @NotBlank(message = "区段code不能为空") + private String sectionCode; + + @ApiModelProperty(value = "停站时间,单位秒(s)") + @NotNull(message = "停站时间不能为空") + private Integer parkingTime; + + public MapStationParkingTimeVO(String stationCode, String sectionCode) { + this.stationCode = stationCode; + this.sectionCode = sectionCode; + this.parkingTime = 30; + } public DraftMapParkingTime convert2Draft(){ DraftMapParkingTime draftMapParkingTime = new DraftMapParkingTime(); draftMapParkingTime.setId(this.id); draftMapParkingTime.setMapId(this.mapId); draftMapParkingTime.setStationCode(this.stationCode); - draftMapParkingTime.setSectionParkingTime(JsonUtils.writeValueAsString(this.parkingTimeVOList)); + draftMapParkingTime.setSectionCode(this.sectionCode); + draftMapParkingTime.setParkingTime(this.parkingTime); return draftMapParkingTime; } @@ -46,14 +53,16 @@ public class MapStationParkingTimeVO { vo.setId(draftMapParkingTime.getId()); vo.setMapId(draftMapParkingTime.getMapId()); vo.setStationCode(draftMapParkingTime.getStationCode()); - vo.setParkingTimeVOList(JsonUtils.read(draftMapParkingTime.getSectionParkingTime(), JsonUtils.getCollectionType(List.class, SectionParkingTimeVO.class))); + vo.setSectionCode(draftMapParkingTime.getSectionCode()); + vo.setParkingTime(draftMapParkingTime.getParkingTime()); return vo; } public static MapStationParkingTimeVO convertRel2VO(DraftMapParkingTime draftMapParkingTime) { MapStationParkingTimeVO vo = new MapStationParkingTimeVO(); vo.setStationCode(draftMapParkingTime.getStationCode()); - vo.setParkingTimeVOList(JsonUtils.read(draftMapParkingTime.getSectionParkingTime(), JsonUtils.getCollectionType(List.class, SectionParkingTimeVO.class))); + vo.setSectionCode(draftMapParkingTime.getSectionCode()); + vo.setParkingTime(draftMapParkingTime.getParkingTime()); return vo; } } diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationRunLevelVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationRunLevelVO.java index d12b4b5a3..467f94273 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationRunLevelVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/newmap/MapStationRunLevelVO.java @@ -96,6 +96,14 @@ public class MapStationRunLevelVO { this.l5 = runPlanRunlevelVO.getL5(); } + public MapStationRunLevelVO(MapRoutingSectionNewVO start, MapRoutingSectionNewVO end, Boolean right) { + this.startStationCode = start.getStationCode(); + this.startSectionCode = start.getSectionCode(); + this.endStationCode = end.getStationCode(); + this.endSectionCode = end.getSectionCode(); + this.right = right; + } + public static List convert2VOList(List list) { List voList = new ArrayList<>(); if (!CollectionUtils.isEmpty(list)) { @@ -191,6 +199,10 @@ public class MapStationRunLevelVO { return String.format("%s-%s", this.startSectionCode, this.endSectionCode); } + public static String buildKey(String startSectionCode, String endSectionCode) { + return String.format("%s-%s", startSectionCode, endSectionCode); + } + public boolean isSameOf(String startSectionCode, String endSectionCode) { if (Objects.equals(this.startSectionCode, startSectionCode) && Objects.equals(this.endSectionCode, endSectionCode)) { @@ -198,4 +210,10 @@ public class MapStationRunLevelVO { } return false; } + + public String debugStr() { + return String.format("站间运行等级:%s->%s, distance:%s, l1:%s, l2:%s, l3:%s, l4:%s, l5:%s", + this.startSectionCode, this.endSectionCode, this.distance, + this.l1, this.l2, this.l3, this.l4, this.l5); + } } diff --git a/src/main/java/club/joylink/rtss/vo/client/map/newmap/SectionParkingTimeVO.java b/src/main/java/club/joylink/rtss/vo/client/map/newmap/SectionParkingTimeVO.java deleted file mode 100644 index 2162fd8f7..000000000 --- a/src/main/java/club/joylink/rtss/vo/client/map/newmap/SectionParkingTimeVO.java +++ /dev/null @@ -1,26 +0,0 @@ -package club.joylink.rtss.vo.client.map.newmap; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -@ApiModel(value = "区段停站时间对象") -@Getter -@Setter -@NoArgsConstructor -public class SectionParkingTimeVO { - - @ApiModelProperty(value = "站台轨/折返轨/转换轨区段code") - @NotBlank(message = "区段code不能为空") - private String sectionCode; - - @ApiModelProperty(value = "停站时间,单位秒(s)") - @NotNull(message = "停站时间不能为空") - private Integer parkingTime; - -} diff --git a/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanParkingTimeVO.java b/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanParkingTimeVO.java index 157e4dbcc..b7e5588a6 100644 --- a/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanParkingTimeVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanParkingTimeVO.java @@ -1,6 +1,7 @@ package club.joylink.rtss.vo.client.runplan.user; import club.joylink.rtss.entity.RunPlanParktime; +import club.joylink.rtss.vo.client.map.newmap.MapStationParkingTimeVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; @@ -39,6 +40,13 @@ public class RunPlanParkingTimeVO { @NotNull(message = "停站时间不能为空") private Integer parkingTime; + public RunPlanParkingTimeVO(MapStationParkingTimeVO vo) { + this.mapId = vo.getMapId(); + this.stationCode = vo.getStationCode(); + this.sectionCode = vo.getSectionCode(); + this.parkingTime = vo.getParkingTime(); + } + public RunPlanParktime convert2Entity() { RunPlanParktime runPlanParktime = new RunPlanParktime(); diff --git a/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanRunlevelVO.java b/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanRunlevelVO.java index 40f923aff..cb455bf1c 100644 --- a/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanRunlevelVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/runplan/user/RunPlanRunlevelVO.java @@ -88,6 +88,21 @@ public class RunPlanRunlevelVO { @PositiveOrZero private Integer l5; + public RunPlanRunlevelVO(MapStationRunLevelVO vo) { + this.mapId = vo.getMapId(); + this.startStationCode = vo.getStartStationCode(); + this.startSectionCode = vo.getStartSectionCode(); + this.endStationCode = vo.getEndStationCode(); + this.endSectionCode = vo.getEndSectionCode(); + this.right = vo.getRight(); + this.distance = vo.getDistance(); + this.l1 = vo.getL1(); + this.l2 = vo.getL2(); + this.l3 = vo.getL3(); + this.l4 = vo.getL4(); + this.l5 = vo.getL5(); + } + public static List convert2VOList(List list) { List voList = new ArrayList<>(); if (!CollectionUtils.isEmpty(list)) { diff --git a/src/main/resources/mybatis/mapper/DraftMapParkingTimeDAO.xml b/src/main/resources/mybatis/mapper/DraftMapParkingTimeDAO.xml index 0761a7b02..2ebc6d253 100644 --- a/src/main/resources/mybatis/mapper/DraftMapParkingTimeDAO.xml +++ b/src/main/resources/mybatis/mapper/DraftMapParkingTimeDAO.xml @@ -5,9 +5,8 @@ - - - + + @@ -68,35 +67,8 @@ - id, map_id, station_code + id, map_id, station_code, section_code, parking_time - - section_parking_time - - - select - , - from draft_map_parking_time where id = #{id,jdbcType=BIGINT} @@ -138,10 +108,10 @@ - insert into draft_map_parking_time (map_id, station_code, section_parking_time - ) - values (#{mapId,jdbcType=BIGINT}, #{stationCode,jdbcType=VARCHAR}, #{sectionParkingTime,jdbcType=LONGVARCHAR} - ) + insert into draft_map_parking_time (map_id, station_code, section_code, + parking_time) + values (#{mapId,jdbcType=BIGINT}, #{stationCode,jdbcType=VARCHAR}, #{sectionCode,jdbcType=VARCHAR}, + #{parkingTime,jdbcType=INTEGER}) insert into draft_map_parking_time @@ -152,8 +122,11 @@ station_code, - - section_parking_time, + + section_code, + + + parking_time, @@ -163,8 +136,11 @@ #{stationCode,jdbcType=VARCHAR}, - - #{sectionParkingTime,jdbcType=LONGVARCHAR}, + + #{sectionCode,jdbcType=VARCHAR}, + + + #{parkingTime,jdbcType=INTEGER}, @@ -186,29 +162,24 @@ station_code = #{record.stationCode,jdbcType=VARCHAR}, - - section_parking_time = #{record.sectionParkingTime,jdbcType=LONGVARCHAR}, + + section_code = #{record.sectionCode,jdbcType=VARCHAR}, + + + parking_time = #{record.parkingTime,jdbcType=INTEGER}, - - update draft_map_parking_time - set id = #{record.id,jdbcType=BIGINT}, - map_id = #{record.mapId,jdbcType=BIGINT}, - station_code = #{record.stationCode,jdbcType=VARCHAR}, - section_parking_time = #{record.sectionParkingTime,jdbcType=LONGVARCHAR} - - - - update draft_map_parking_time set id = #{record.id,jdbcType=BIGINT}, map_id = #{record.mapId,jdbcType=BIGINT}, - station_code = #{record.stationCode,jdbcType=VARCHAR} + station_code = #{record.stationCode,jdbcType=VARCHAR}, + section_code = #{record.sectionCode,jdbcType=VARCHAR}, + parking_time = #{record.parkingTime,jdbcType=INTEGER} @@ -222,23 +193,21 @@ station_code = #{stationCode,jdbcType=VARCHAR}, - - section_parking_time = #{sectionParkingTime,jdbcType=LONGVARCHAR}, + + section_code = #{sectionCode,jdbcType=VARCHAR}, + + + parking_time = #{parkingTime,jdbcType=INTEGER}, where id = #{id,jdbcType=BIGINT} - - update draft_map_parking_time - set map_id = #{mapId,jdbcType=BIGINT}, - station_code = #{stationCode,jdbcType=VARCHAR}, - section_parking_time = #{sectionParkingTime,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=BIGINT} - update draft_map_parking_time set map_id = #{mapId,jdbcType=BIGINT}, - station_code = #{stationCode,jdbcType=VARCHAR} + station_code = #{stationCode,jdbcType=VARCHAR}, + section_code = #{sectionCode,jdbcType=VARCHAR}, + parking_time = #{parkingTime,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT} \ No newline at end of file