zy 8 luni în urmă
părinte
comite
83ad6273ec
21 a modificat fișierele cu 403 adăugiri și 91 ștergeri
  1. 1 1
      bus-biz/src/main/java/bus/mapper/BCourseInfoMapper.java
  2. 8 0
      bus-biz/src/main/java/bus/service/BCourseInfoService.java
  3. 7 0
      bus-biz/src/main/java/bus/service/BStationInfoService.java
  4. 5 4
      bus-biz/src/main/java/bus/service/BUserCourseService.java
  5. 48 3
      bus-biz/src/main/java/bus/service/impl/BCourseInfoServiceImpl.java
  6. 6 0
      bus-biz/src/main/java/bus/service/impl/BNoticeUserServiceImpl.java
  7. 24 0
      bus-biz/src/main/java/bus/service/impl/BStationInfoServiceImpl.java
  8. 103 21
      bus-biz/src/main/java/bus/service/impl/BUserCourseServiceImpl.java
  9. 9 1
      bus-biz/src/main/resources/mapper/BCourseInfoMapper.xml
  10. 6 0
      bus-common/src/main/java/bus/model/dto/BCourseBusDto.java
  11. 10 0
      bus-common/src/main/java/bus/model/dto/BCourseInfoDto.java
  12. 0 3
      bus-common/src/main/java/bus/model/dto/BNoticeInfoDto.java
  13. 1 1
      bus-common/src/main/java/bus/model/dto/BStationInfoDto.java
  14. 9 0
      bus-common/src/main/java/bus/model/dto/StationTypeDto.java
  15. 34 0
      bus-common/src/main/java/bus/model/dto/WBusTrackInfoDto.java
  16. 43 0
      bus-common/src/main/java/bus/model/dto/WCourseInfoByTypeDto.java
  17. 43 0
      bus-common/src/main/java/bus/model/enums/StationTypeEnum.java
  18. 2 1
      bus-common/src/main/java/bus/model/vo/BCourseInfoVo.java
  19. 13 0
      bus-web/src/main/java/bus/controller/biz/BCourseInfoController.java
  20. 12 0
      bus-web/src/main/java/bus/controller/biz/BStationInfoController.java
  21. 19 56
      bus-web/src/main/java/bus/controller/biz/BUserCourseController.java

+ 1 - 1
bus-biz/src/main/java/bus/mapper/BCourseInfoMapper.java

@@ -25,5 +25,5 @@ public interface BCourseInfoMapper extends BaseMapper<BCourseInfoPo> {
     List<BStationInfoDto> findNearbyStations(@Param("longitude") BigDecimal longitude,
                                              @Param("latitude") BigDecimal latitude,
                                              @Param("distance") Integer distance);
-    List<BCourseInfoVo> findRoutesByStations(@Param("stationIds") List<Long> stationIds);
+    List<BCourseInfoVo> findRoutesByStations(@Param("stationIds") List<String> stationIds);
 }

+ 8 - 0
bus-biz/src/main/java/bus/service/BCourseInfoService.java

@@ -25,6 +25,7 @@ public interface BCourseInfoService extends IService<BCourseInfoPo> {
      */
     BCourseInfoDto getDetailById(String id);
 
+    BCourseInfoPo getDetail(String id);
 	/**
      * 保存
      * @param dto
@@ -62,4 +63,11 @@ public interface BCourseInfoService extends IService<BCourseInfoPo> {
     List<BStationPointDto> getAllPoint();
 
     List<BTrackCourseDto> getAllCourse();
+
+    /**
+     * 根据站点类型获取路线信息
+     * @param stationType
+     * @return
+     */
+    List<WCourseInfoByTypeDto> getAllCourseByType(String stationType);
 }

+ 7 - 0
bus-biz/src/main/java/bus/service/BStationInfoService.java

@@ -2,6 +2,7 @@ package bus.service;
 
 import bus.model.dto.BStationInfoDto;
 import bus.model.dto.BStationInfoPageDto;
+import bus.model.dto.StationTypeDto;
 import bus.model.vo.BStationInfoVo;
 import bus.model.po.BStationInfoPo;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -51,4 +52,10 @@ public interface BStationInfoService extends IService<BStationInfoPo> {
      * @return
      */
     void delete(String id);
+
+    /**
+     * 获取所有站点类型
+     * @return
+     */
+    List<StationTypeDto> getStationTypeList();
 }

+ 5 - 4
bus-biz/src/main/java/bus/service/BUserCourseService.java

@@ -2,6 +2,7 @@ package bus.service;
 
 import bus.model.dto.BUserCourseDto;
 import bus.model.dto.BUserCoursePageDto;
+import bus.model.dto.WBusTrackInfoDto;
 import bus.model.vo.BUserCourseVo;
 import bus.model.po.BUserCoursePo;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -31,15 +32,15 @@ public interface BUserCourseService extends IService<BUserCoursePo> {
     void topCourse(String courseId);
 
     /**
-    * 我的路线
-    * @param dto
+    * 我的路线List
+    * @param
     * @return
     */
-    List<BUserCourseVo> list(BUserCoursePageDto dto);
+    List<WBusTrackInfoDto> getMyCourse();
 
 
 	/**
-     *  g根据路线id删除
+     *  取消收藏
      * @param courseId
      * @return
      */

+ 48 - 3
bus-biz/src/main/java/bus/service/impl/BCourseInfoServiceImpl.java

@@ -72,7 +72,6 @@ public class BCourseInfoServiceImpl extends ServiceImpl<BCourseInfoMapper, BCour
         List<BCourseTimePo> list = bCourseTimeService.list(queryWrapper);
         bCourseInfoDto.setBCourseTimeList(BeanUtil.copyToList(list, BCourseTimeDto.class));
 
-
         QueryWrapper<BCourseStationPo> queryWrapper1 = new QueryWrapper<>();
         queryWrapper1.eq("course_id", id);
         queryWrapper1.orderByAsc("sort");
@@ -130,6 +129,7 @@ public class BCourseInfoServiceImpl extends ServiceImpl<BCourseInfoMapper, BCour
                     bCourseBusDto.setBusNo(bBusInfoPo.getBusNo());
                     bCourseBusDto.setDriverName(bBusInfoPo.getDriverName());
                     bCourseBusDto.setDriverPhone(bBusInfoPo.getDriverPhone());
+
                     list2.add(bCourseBusDto);
                 }
             }
@@ -139,7 +139,12 @@ public class BCourseInfoServiceImpl extends ServiceImpl<BCourseInfoMapper, BCour
         return bCourseInfoDto;
     }
 
-	/**
+    @Override
+    public BCourseInfoPo getDetail(String id) {
+        return bCourseInfoMapper.selectById(id);
+    }
+
+    /**
      * 保存
      * @param dto
      * @return
@@ -355,7 +360,7 @@ public class BCourseInfoServiceImpl extends ServiceImpl<BCourseInfoMapper, BCour
             return Collections.emptyList();
         }
         // 2. 查询经过这些站点的路线
-        List<Long> stationIds = nearbyStations.stream()
+        List<String> stationIds = nearbyStations.stream()
                 .map(BStationInfoDto::getId)
                 .collect(Collectors.toList());
 
@@ -521,7 +526,47 @@ public class BCourseInfoServiceImpl extends ServiceImpl<BCourseInfoMapper, BCour
         return list;
     }
 
+    /**
+     * 根据站点类型获取路线信息
+     *
+     * @param stationType
+     * @return
+     */
+    @Override
+    public List<WCourseInfoByTypeDto> getAllCourseByType(String stationType) {
+        // 1. 查询指定类型的所有站点
+        QueryWrapper<BStationInfoPo> stationWrapper = new QueryWrapper<>();
+        stationWrapper.eq("station_type", stationType)
+                     .eq("is_delete", 0);
+        List<BStationInfoPo> stations = bStationInfoService.list(stationWrapper);
+        
+        if (CollectionUtil.isEmpty(stations)) {
+            return Collections.emptyList();
+        }
+
+        // 2. 获取站点ID集合
+        List<String> stationIds = stations.stream()
+                .map(BStationInfoPo::getId)
+                .collect(Collectors.toList());
 
+        // 3. 查询包含这些站点的线路
+        List<BCourseInfoVo> courses = bCourseInfoMapper.findRoutesByStations(stationIds);
 
+        // 4. 去重处理(基于线路ID)
+        Map<String, BCourseInfoVo> uniqueCourses = courses.stream()
+                .collect(Collectors.toMap(
+                        BCourseInfoVo::getId, 
+                        course -> course,
+                        (existing, replacement) -> existing));
 
+        // 5. 转换DTO
+        return uniqueCourses.values().stream().map(course -> {
+            WCourseInfoByTypeDto dto =BeanUtil.toBean(course, WCourseInfoByTypeDto.class);
+            String mapPoint = course.getMapPoint();
+            if (StrUtil.isNotBlank(mapPoint)) {
+                dto.setMapPointList(JSONUtil.toList(mapPoint, BCoursePointDto.class));
+            }
+            return dto;
+        }).collect(Collectors.toList());
+    }
 }

+ 6 - 0
bus-biz/src/main/java/bus/service/impl/BNoticeUserServiceImpl.java

@@ -42,6 +42,12 @@ public class BNoticeUserServiceImpl extends ServiceImpl<BNoticeUserMapper,BNotic
     public void addNoticeUser(BNoticeUserDto dto) {
         ExtInfo extInfo = CurrentUserHolder.get();
         String userId = extInfo.getUserId();
+        QueryWrapper<BNoticeUserPo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId);
+        queryWrapper.eq("notice_id", dto.getNoticeId());
+        if (bNoticeUserMapper.selectList(queryWrapper) != null) {
+            return;
+        }
         BNoticeUserPo po = new BNoticeUserPo();
         po.setId(snowflakeUtil.snowflakeId());
         po.setUserId(userId);

+ 24 - 0
bus-biz/src/main/java/bus/service/impl/BStationInfoServiceImpl.java

@@ -3,6 +3,8 @@ package bus.service.impl;
 import bus.model.SnowflakeUtil;
 import bus.model.dto.BStationInfoDto;
 import bus.model.dto.BStationInfoPageDto;
+import bus.model.dto.StationTypeDto;
+import bus.model.enums.StationTypeEnum;
 import bus.model.po.BBusInfoPo;
 import bus.model.vo.BStationInfoVo;
 import bus.model.po.BStationInfoPo;
@@ -24,6 +26,7 @@ import javax.annotation.Resource;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Program: bus
@@ -134,4 +137,25 @@ public class BStationInfoServiceImpl extends ServiceImpl<BStationInfoMapper, BSt
     public void delete(String id){
 		bStationInfoMapper.deleteById(id);
     }
+
+    /**
+     * 获取所有站点类型
+     *
+     * @return
+     */
+    @Override
+    public List<StationTypeDto> getStationTypeList() {
+        try {
+            List<StationTypeDto> stationTypeList = Arrays.stream(StationTypeEnum.values())
+                    .map(item -> {
+                        StationTypeDto stationTypeDto = new StationTypeDto();
+                        stationTypeDto.setCode(item.getCode());
+                        stationTypeDto.setName(item.getName());
+                        return stationTypeDto;
+                    })
+                    .collect(Collectors.toList());
+            return stationTypeList;
+        } catch (Exception e){}
+        return null;
+    }
 }

+ 103 - 21
bus-biz/src/main/java/bus/service/impl/BUserCourseServiceImpl.java

@@ -1,18 +1,21 @@
 package bus.service.impl;
 
 import bus.model.SnowflakeUtil;
-import bus.model.dto.BUserCourseDto;
-import bus.model.dto.BUserCoursePageDto;
+import bus.model.dto.*;
 import bus.model.vo.BUserCourseVo;
 import bus.model.po.BUserCoursePo;
 import bus.mapper.BUserCourseMapper;
-
 import bus.service.BUserCourseService;
+import bus.service.BCourseInfoService;
+import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.orcas.common.sso.model.ExtInfo;
 import com.orcas.iso.config.common.user.CurrentUserHolder;
+import com.qzwisdom.qzframework.core.tool.exception.BusinessException;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.BeanUtils;
@@ -22,10 +25,12 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.ArrayList;
 
 /**
  * @Program: bus
- * @Description: 描述
+ * @Description: 用户路线服务实现类
  * @Author: zy
  * @Date: 2025-03-11 18:22:22
  **/
@@ -38,47 +43,124 @@ public class BUserCourseServiceImpl extends ServiceImpl<BUserCourseMapper,BUserC
     @Resource
     private SnowflakeUtil snowflakeUtil;
 
-	/**
-     * 保存
-     * @param dto
+    @Resource
+    private BCourseInfoService bCourseInfoService;
+
+    /**
+     * 收藏路线
+     * @param dto 路线信息
      * @return
      */
     @Override
-	public void save(BUserCourseDto dto){
+    public void save(BUserCourseDto dto){
         ExtInfo extInfo = CurrentUserHolder.get();
+
+        QueryWrapper<BUserCoursePo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("course_id", dto.getCourseId());
+        queryWrapper.eq("user_id", extInfo.getUserId());
+        List<BUserCoursePo> bUserCoursePos = bUserCourseMapper.selectList(queryWrapper);
+        if(CollectionUtil.isNotEmpty(bUserCoursePos)){
+            //已经收藏,执行取消收藏
+            delete(dto.getCourseId());
+            return;
+        }
         BUserCoursePo po = new BUserCoursePo();
         po.setUserId(extInfo.getUserId());
         po.setCourseId(dto.getCourseId());
         po.setTop("0");
         po.setTop(snowflakeUtil.snowflakeId());
-		this.bUserCourseMapper.insert(po);
+        this.bUserCourseMapper.insert(po);
     }
 
+    /**
+     * 顶置路线
+     * @param courseId 路线ID
+     */
     @Override
     public void topCourse(String courseId) {
+        // 获取当前用户信息
+        ExtInfo extInfo = CurrentUserHolder.get();
+        String userId = extInfo.getUserId();
+        // 先将所有路线设置为非顶置
+        UpdateWrapper<BUserCoursePo> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("user_id", userId);
+        updateWrapper.eq("top","0");
+        updateWrapper.set("top","0");
+        bUserCourseMapper.update(null,updateWrapper);
 
+        // 将指定路线设置为顶置
+        UpdateWrapper<BUserCoursePo> updateWrapper1 = new UpdateWrapper<>();
+        updateWrapper1.eq("user_id", userId);
+        updateWrapper1.eq("course_id", courseId);
+        updateWrapper1.set("top","1");
+        bUserCourseMapper.update(null,updateWrapper1);
     }
 
     /**
-    * 列表
-    * @param dto
-    * @return
-    */
+     * 获取我的路线列表
+     * @return 路线列表
+     */
     @Override
-    public List<BUserCourseVo> list(BUserCoursePageDto dto){
-        return this.bUserCourseMapper.list(dto);
-    }
+    public List<WBusTrackInfoDto> getMyCourse() {
+        // 获取当前用户信息
+        ExtInfo extInfo = CurrentUserHolder.get();
+        String userId = extInfo.getUserId();
+        // 查询用户收藏的路线
+        QueryWrapper<BUserCoursePo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId);
+        queryWrapper.orderByDesc("top");
+        List<BUserCoursePo> bUserCoursePos = bUserCourseMapper.selectList(queryWrapper);
+        if(CollectionUtil.isEmpty(bUserCoursePos)) {
+            return new ArrayList<>();
+        }
+        // 获取路线ID列表
+        List<String> courseIdList = bUserCoursePos.stream().map(BUserCoursePo::getCourseId).collect(Collectors.toList());
+        
+        // 获取每个路线的详细信息
+        List<WBusTrackInfoDto> result = new ArrayList<>();
+        for(String courseId : courseIdList) {
+            BCourseInfoDto courseInfo = bCourseInfoService.getDetailById(courseId);
+            if(courseInfo != null) {
+                // 构建路线追踪信息
+                WBusTrackInfoDto trackInfo = new WBusTrackInfoDto();
+                trackInfo.setCourseId(courseInfo.getId());
+                trackInfo.setCourseName(courseInfo.getCourseName());
+                trackInfo.setFirstStationName(courseInfo.getFirstStationName());
+                trackInfo.setLastStationName(courseInfo.getLastStationName());
+                trackInfo.setFirstBusSpace(courseInfo.getFirstBusSpace());
+                trackInfo.setTicketAmount(courseInfo.getTicketAmount());
+                // 处理路线站点信息
+                List<BCoursePointDto> stationInfoList = courseInfo.getMapPointList();
+                trackInfo.setClist(stationInfoList);
 
+                //车辆经纬度
+                List<BCourseBusDto> bCourseBusList = courseInfo.getBCourseBusList();
+                List<BCoursePointDto> bStationInfoList = new ArrayList<>();
+                for(BCourseBusDto bCourseBus : bCourseBusList) {
+                    BCoursePointDto bCoursePointDto = new BCoursePointDto();
+                    bCoursePointDto.setLongitude(bCourseBus.getLocalLongitude());
+                    bCoursePointDto.setLatitude(bCourseBus.getLocalLatitude());
+                    bStationInfoList.add(bCoursePointDto);
+                }
+                trackInfo.setBlist(bStationInfoList);
+                result.add(trackInfo);
+            }
+        }
+        return result;
+    }
 
     /**
-     *  g根据路线id删除
-     * @param courseId
+     * 取消收藏路线
+     * @param courseId 路线ID
      * @return
      */
     @Override
     public void delete(String courseId){
-
+        ExtInfo extInfo = CurrentUserHolder.get();
+        String userId = extInfo.getUserId();
+        QueryWrapper<BUserCoursePo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("course_id", courseId);
+        queryWrapper.eq("user_id", userId);
+        bUserCourseMapper.delete(queryWrapper);
     }
-
-
 }

+ 9 - 1
bus-biz/src/main/resources/mapper/BCourseInfoMapper.xml

@@ -69,7 +69,15 @@
     <select id="findRoutesByStations" resultType="bus.model.vo.BCourseInfoVo">
         SELECT DISTINCT
         r.id,
-        r.course_name as courseName
+        r.course_name as courseName,
+        r.course_code as courseCode,
+        r.map_pic_url as mapPicUrl,
+        r.first_station_name as firstStationName,
+        r.last_station_name as lastStationName,
+        r.first_bus_space as firstBusSpace,
+        r.area as area,
+        r.map_point as mapPoint
+
         FROM
         b_course_info r
         INNER JOIN

+ 6 - 0
bus-common/src/main/java/bus/model/dto/BCourseBusDto.java

@@ -2,6 +2,8 @@ package bus.model.dto;
 
 import lombok.Data;
 import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
 /**
@@ -26,4 +28,8 @@ public class BCourseBusDto{
     private String driverName;
     @ApiModelProperty("驾驶员号码 展示用")
     private String driverPhone;
+    @ApiModelProperty("当前经度")
+    private BigDecimal localLongitude;
+    @ApiModelProperty("当前纬度")
+    private BigDecimal localLatitude;
 }

+ 10 - 0
bus-common/src/main/java/bus/model/dto/BCourseInfoDto.java

@@ -27,6 +27,16 @@ public class BCourseInfoDto{
     private String courseCode;
     @ApiModelProperty("地图快照")
     private String mapPicUrl;
+    @ApiModelProperty("首个站点名称")
+    private String firstStationName;
+    @ApiModelProperty("首个站点id")
+    private String firstStationId;
+    @ApiModelProperty("最后站点名称")
+    private String lastStationName;
+    @ApiModelProperty("最后站点id")
+    private String lastStationId;
+    @ApiModelProperty("首次发车时间")
+    private String firstBusSpace;
     @ApiModelProperty("区")
     private String area;
     @ApiModelProperty("线路标记点LIST")

+ 0 - 3
bus-common/src/main/java/bus/model/dto/BNoticeInfoDto.java

@@ -31,7 +31,4 @@ public class BNoticeInfoDto{
     @ApiModelProperty("状态 0警用 1启用")
     @NotNull(message = "状态不能为空")
     private String status;
-    @NotNull(message = "是否已读 0未读 1已读")
-    private String isRead;
-
 }

+ 1 - 1
bus-common/src/main/java/bus/model/dto/BStationInfoDto.java

@@ -17,7 +17,7 @@ import java.util.List;
 @Data
 public class BStationInfoDto{
     @ApiModelProperty("id")
-    private Long id;
+    private String id;
     @ApiModelProperty("标志点名称")
     private String name;
     @ApiModelProperty("标志点类型")

+ 9 - 0
bus-common/src/main/java/bus/model/dto/StationTypeDto.java

@@ -0,0 +1,9 @@
+package bus.model.dto;
+
+import lombok.Data;
+
+@Data
+public class StationTypeDto {
+    private String code;
+    private String name;
+}

+ 34 - 0
bus-common/src/main/java/bus/model/dto/WBusTrackInfoDto.java

@@ -0,0 +1,34 @@
+package bus.model.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+* @Program: bus
+* @Description: 描述
+* @Author: zy
+* @Date: 2025-03-01 09:44:24
+**/
+@Data
+public class WBusTrackInfoDto {
+    @ApiModelProperty("路线id")
+    private String courseId;
+    @ApiModelProperty("线路名称")
+    private String courseName;
+    @ApiModelProperty("出发站点名称")
+    private String firstStationName;
+    @ApiModelProperty("最后站点名称")
+    private String lastStationName;
+    @ApiModelProperty("首发时间")
+    private String firstBusSpace;
+    @ApiModelProperty("票价")
+    private BigDecimal ticketAmount;
+
+    @ApiModelProperty("车辆经纬度")
+    List<BCoursePointDto> blist;
+    @ApiModelProperty("路线经纬度")
+    List<BCoursePointDto> clist;
+}

+ 43 - 0
bus-common/src/main/java/bus/model/dto/WCourseInfoByTypeDto.java

@@ -0,0 +1,43 @@
+package bus.model.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+* @Program: bus
+* @Description: 描述
+* @Author: zy
+* @Date: 2025-03-02 19:53:50
+**/
+@Data
+public class WCourseInfoByTypeDto {
+    @ApiModelProperty("id")
+    private String id;
+    @ApiModelProperty("线路名称")
+    private String courseName;
+    @ApiModelProperty("线路编号")
+    private String courseCode;
+    @ApiModelProperty("地图快照")
+    private String mapPicUrl;
+    @ApiModelProperty("首个站点名称")
+    private String firstStationName;
+    @ApiModelProperty("首个站点id")
+    private String firstStationId;
+    @ApiModelProperty("最后站点名称")
+    private String lastStationName;
+    @ApiModelProperty("最后站点id")
+    private String lastStationId;
+    @ApiModelProperty("首次发车时间")
+    private String firstBusSpace;
+    @ApiModelProperty("区")
+    private String area;
+    @ApiModelProperty("线路标记点LIST")
+    private List<BCoursePointDto> mapPointList;
+    @ApiModelProperty("线路类型 0单层专线,1闭环专线")
+    private String courseType;
+
+}

+ 43 - 0
bus-common/src/main/java/bus/model/enums/StationTypeEnum.java

@@ -0,0 +1,43 @@
+package bus.model.enums;
+
+public enum StationTypeEnum {
+
+    /**
+     * 状态
+     */
+    N1("1", "商圈"),
+    N2("2", "公园"),
+    N3("3", "学校"),
+    N4("4", "社区"),
+    N5("5", "枢纽"),
+    N6("6", "市场"),
+    N7("7", "酒店"),
+    N8("8", "医院"),
+    N9("9", "加油站"),
+    N10("10", "车站"),
+    N11("101", "其他");
+    private final String code;
+    private final String name;
+
+
+    StationTypeEnum(String value, String name) {
+        this.code = value;
+        this.name = name;
+    }
+
+    public static String getInfoByCode(String value) {
+        for (StationTypeEnum a : StationTypeEnum.values()) {
+            if (a.code.equals(value)) {
+                return a.name;
+            }
+        }
+        return "";
+    }
+
+    public String getCode() {
+        return code;
+    }
+    public String getName() {
+        return name;
+    }
+}

+ 2 - 1
bus-common/src/main/java/bus/model/vo/BCourseInfoVo.java

@@ -37,5 +37,6 @@ public class BCourseInfoVo extends AbstractBaseVO{
     private String lastStationName;
     @ApiModelProperty("始发时间")
     private String firstBusSpace;
-
+    @ApiModelProperty("路线点")
+    private String mapPoint;
 }

+ 13 - 0
bus-web/src/main/java/bus/controller/biz/BCourseInfoController.java

@@ -1,5 +1,6 @@
 package bus.controller.biz;
 
+import bus.model.dto.WCourseInfoByTypeDto;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageSerializable;
 import bus.model.dto.BCourseInfoDto;
@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
 import com.qzwisdom.qzframework.core.tool.base.controller.BaseController;
 
 import javax.validation.Valid;
+import java.util.List;
 
 
 /**
@@ -94,4 +96,15 @@ public class BCourseInfoController implements BaseController {
         return "删除成功";
     }
 
+    /**
+     * 根据站点类型获取路线信息
+     * @param stationType
+     * @return
+     */
+    @ApiOperation("根据站点类型获取路线信息")
+    @GetMapping(value = "getAllCourseByType")
+    List<WCourseInfoByTypeDto> getAllCourseByType(@RequestParam String stationType){
+        return bCourseInfoService.getAllCourseByType(stationType);
+    }
+
 }

+ 12 - 0
bus-web/src/main/java/bus/controller/biz/BStationInfoController.java

@@ -1,5 +1,6 @@
 package bus.controller.biz;
 
+import bus.model.dto.StationTypeDto;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageSerializable;
 import bus.model.dto.BStationInfoDto;
@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.qzwisdom.qzframework.core.tool.base.controller.BaseController;
 
+import java.util.List;
 
 
 /**
@@ -92,4 +94,14 @@ public class BStationInfoController implements BaseController {
         return "删除成功";
     }
 
+    /**
+     * 获取所有站点类型
+     * @return
+     */
+    @ApiOperation("获取所有站点类型")
+    @GetMapping(value = "getStationTypeList")
+    List<StationTypeDto> getStationTypeList(){
+        return bStationInfoService.getStationTypeList();
+    }
+
 }

+ 19 - 56
bus-web/src/main/java/bus/controller/biz/BUserCourseController.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageSerializable;
 import bus.model.dto.BUserCourseDto;
 import bus.model.dto.BUserCoursePageDto;
 import bus.model.vo.BUserCourseVo;
+import bus.model.dto.WBusTrackInfoDto;
 import bus.service.BUserCourseService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -13,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.qzwisdom.qzframework.core.tool.base.controller.BaseController;
 
-
+import java.util.List;
 
 /**
  * @Program: bus
@@ -24,72 +25,34 @@ import com.qzwisdom.qzframework.core.tool.base.controller.BaseController;
 @Slf4j
 @CrossOrigin
 @RestController
-@Api(tags = "bUserCourse接口")
+@Api(tags = "收藏接口")
 @RequestMapping(value="/bUserCourse")
 public class BUserCourseController implements BaseController {
 
     @Autowired
     private BUserCourseService bUserCourseService;
 
-
-
-    /**
-     * 详情
-     * @param id
-     * @return
-     */
-    @ApiOperation("详情")
-    @GetMapping(value = "getDetailById")
-    public BUserCourseVo getDetailById(@RequestParam String id){
-        return doSingle(bUserCourseService.getDetailById(id),BUserCourseVo::new);
+    @PostMapping("/save")
+    @ApiOperation(value = "收藏-取消-路线")
+    public void save(@RequestBody BUserCourseDto dto) {
+        bUserCourseService.save(dto);
     }
 
-	/**
-     * 保存
-     * @param dto
-     * @return
-     */
-    @ApiOperation("保存")
-    @PostMapping(value = "save")
-    public String save(@RequestBody BUserCourseDto dto){
-		bUserCourseService.save(dto);
-        return "保存成功";
+    @PostMapping("/topCourse")
+    @ApiOperation(value = "顶置路线")
+    public void topCourse(@RequestParam String courseId) {
+        bUserCourseService.topCourse(courseId);
     }
 
-    /**
-    * 列表
-    * @param dto
-    * @return
-    */
-    @ApiOperation("列表")
-    @PostMapping(value = "list")
-    public PageSerializable<BUserCourseVo> list(@RequestBody BUserCoursePageDto dto){
-       PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
-       return new PageSerializable<>(bUserCourseService.list(dto));
+    @GetMapping("/getMyCourse")
+    @ApiOperation(value = "我的路线列表")
+    public List<WBusTrackInfoDto> getMyCourse() {
+        return bUserCourseService.getMyCourse();
     }
 
-	/**
-     * 修改
-     * @param dto
-     * @return
-     */
-    @ApiOperation("修改")
-    @PostMapping(value = "update")
-    public String update(@RequestBody BUserCourseDto dto){
-		bUserCourseService.update(dto);
-        return "修改成功";
+    @DeleteMapping("/delete")
+    @ApiOperation(value = "取消收藏")
+    public void delete(@RequestParam String courseId) {
+        bUserCourseService.delete(courseId);
     }
-
-	/**
-     * 删除
-     * @param id
-     * @return
-     */
-    @ApiOperation("删除")
-    @GetMapping(value = "deleteById")
-    public String deleteById(@RequestParam String id){
-		bUserCourseService.delete(id);
-        return "删除成功";
-    }
-
 }