diff --git a/src/main/java/club/joylink/rtss/services/DraftMapService.java b/src/main/java/club/joylink/rtss/services/DraftMapService.java index 3f026c993..a4eef9c0a 100644 --- a/src/main/java/club/joylink/rtss/services/DraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/DraftMapService.java @@ -101,9 +101,6 @@ public class DraftMapService implements IDraftMapService { @Autowired private IDraftMapStationDirectionService draftMapStationDirectionLabelService; - @Autowired - private DraftMapStationDirectionDAO draftMapStationDirectionDAO; - @Override public List list(AccountVO accountVO) { DraftMapExample example = new DraftMapExample(); @@ -408,6 +405,7 @@ public class DraftMapService implements IDraftMapService { dataExample.createCriteria().andMapIdEqualTo(id); draftMap3dDataDAO.deleteByExample(dataExample); draftMapDAO.deleteByPrimaryKey(id); + draftMapStationDirectionLabelService.deleteDraftStationDirection(id); } @Override @@ -599,11 +597,7 @@ public class DraftMapService implements IDraftMapService { } // 车站 方向的逻辑数据数据 - if (!CollectionUtils.isEmpty(logicDataVO.getDraftMapStationDirectionList())) { - List stationDirectionList = logicDataVO.getDraftMapStationDirectionList(); - stationDirectionList.forEach(stationDirection -> stationDirection.setMapId(id)); - draftMapStationDirectionDAO.insertList(stationDirectionList); - } + this.draftMapStationDirectionLabelService.insertList(logicDataVO.getDraftMapStationDirectionList(), id); } private void deleteMapLogicData(Long id) { diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapStationDirectionServiceImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapStationDirectionServiceImpl.java index 36d771710..089b4cf88 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapStationDirectionServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapStationDirectionServiceImpl.java @@ -75,4 +75,20 @@ public class DraftMapStationDirectionServiceImpl implements IDraftMapStationDire list.forEach(DraftMapStationDirection::generateSectionList); return list; } + + @Override + public void deleteDraftStationDirection(Long mapId) { + DraftMapStationDirectionExample draftMapStationDirectionExample = new DraftMapStationDirectionExample(); + DraftMapStationDirectionExample.Criteria criteria = draftMapStationDirectionExample.createCriteria(); + criteria.andMapIdEqualTo(mapId); + draftMapStationDirectionDAO.deleteByExample(draftMapStationDirectionExample); + } + + @Override + public void insertList(List stationDirectionList, Long mapId) { + if (!CollectionUtils.isEmpty(stationDirectionList)) { + stationDirectionList.forEach(stationDirection -> stationDirection.setMapId(mapId)); + draftMapStationDirectionDAO.insertList(stationDirectionList); + } + } } diff --git a/src/main/java/club/joylink/rtss/services/draftData/IDraftMapStationDirectionService.java b/src/main/java/club/joylink/rtss/services/draftData/IDraftMapStationDirectionService.java index 043e19089..f69057a40 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/IDraftMapStationDirectionService.java +++ b/src/main/java/club/joylink/rtss/services/draftData/IDraftMapStationDirectionService.java @@ -51,4 +51,19 @@ public interface IDraftMapStationDirectionService { * @return 关系列表 */ List queryAllStationLabelByMapId(Long mapId); + + /** + * 根据地图ID删除车站运行方向的草稿数据 + * + * @param mapId 地图ID + */ + void deleteDraftStationDirection(Long mapId); + + /** + * 批量插入运行方向逻辑数据 + * + * @param stationDirectionList 逻辑数据列表 + * @param mapId 地图ID + */ + void insertList(List stationDirectionList, Long mapId); }