|
|
@@ -844,4 +844,79 @@ public class BCourseInfoServiceImpl extends ServiceImpl<BCourseInfoMapper, BCour
|
|
|
}
|
|
|
return CollectionUtil.newArrayList();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据路线,标记点名称搜索路线
|
|
|
+ *
|
|
|
+ * @param name
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<FindTypeDto> findRoute(String name) {
|
|
|
+ List<FindTypeDto> listType = CollectionUtil.newArrayList();
|
|
|
+ List<FindResultDto> result = CollectionUtil.newArrayList();
|
|
|
+ QueryWrapper<BCourseInfoPo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.like("course_name", name);
|
|
|
+ List<BCourseInfoPo> list = bCourseInfoMapper.selectList(queryWrapper);
|
|
|
+ if(CollectionUtil.isNotEmpty(list)) {
|
|
|
+ for (BCourseInfoPo bCourseInfoPo : list) {
|
|
|
+ FindResultDto dto2 = new FindResultDto();
|
|
|
+ dto2.setId(bCourseInfoPo.getId());
|
|
|
+ dto2.setName(bCourseInfoPo.getCourseName());
|
|
|
+ dto2.setType("0");
|
|
|
+ result.add(dto2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ FindTypeDto dto1 = new FindTypeDto();
|
|
|
+ dto1.setType("0");
|
|
|
+ dto1.setDtoList(result);
|
|
|
+ listType.add(dto1);
|
|
|
+
|
|
|
+ List<FindResultDto> result1 = CollectionUtil.newArrayList();
|
|
|
+ QueryWrapper<BStationInfoPo> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.like("name", name);
|
|
|
+ List<BStationInfoPo> list2 = bStationInfoService.list(queryWrapper2);
|
|
|
+ if(CollectionUtil.isNotEmpty(list2)) {
|
|
|
+ for (BStationInfoPo bStationInfoPo : list2) {
|
|
|
+ FindResultDto dto = new FindResultDto();
|
|
|
+ dto.setId(bStationInfoPo.getId());
|
|
|
+ dto.setName(bStationInfoPo.getName());
|
|
|
+ dto.setType("1");
|
|
|
+ result1.add(dto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ FindTypeDto dto3 = new FindTypeDto();
|
|
|
+ dto3.setType("1");
|
|
|
+ dto3.setDtoList(result1);
|
|
|
+ listType.add(dto3);
|
|
|
+ return listType;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 小程序所选的站点,列出所有路线
|
|
|
+ *
|
|
|
+ * @param stationId
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public FindStationDetailDto findStationDetail(String stationId) {
|
|
|
+ FindStationDetailDto findStationDetailDto = new FindStationDetailDto();
|
|
|
+ BStationInfoDto detailById = bStationInfoService.getDetailById(stationId);
|
|
|
+ BStationPointDto bStationPointDto = BeanUtil.toBean(detailById, BStationPointDto.class);
|
|
|
+ findStationDetailDto.setSList(Arrays.asList(bStationPointDto));
|
|
|
+ //更具站点id查询路线
|
|
|
+ QueryWrapper<BCourseStationPo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("station_id", stationId);
|
|
|
+ List<BCourseStationPo> list = bCourseStationService.list(queryWrapper);
|
|
|
+ if(CollectionUtil.isNotEmpty(list)) {
|
|
|
+ // 获取路线Id 列表并去重
|
|
|
+ List<String> courseIdList = list.stream().map(BCourseStationPo::getCourseId).distinct().collect(Collectors.toList());
|
|
|
+ //根据路线id查询路线信息
|
|
|
+ List<BCourseInfoPo> list1 = bCourseInfoMapper.selectBatchIds(courseIdList);
|
|
|
+ List<WCourseInfoByTypeDto> wCourseInfoByTypeDtos = BeanUtil.copyToList(list1, WCourseInfoByTypeDto.class);
|
|
|
+ findStationDetailDto.setWList(wCourseInfoByTypeDtos);
|
|
|
+ }
|
|
|
+ return findStationDetailDto;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|