|
|
@@ -1,11 +1,13 @@
|
|
|
package bus.service.impl;
|
|
|
|
|
|
+import bus.mapper.BCourseStationMapper;
|
|
|
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.po.BCourseStationPo;
|
|
|
import bus.model.vo.BStationInfoVo;
|
|
|
import bus.model.po.BStationInfoPo;
|
|
|
import bus.mapper.BStationInfoMapper;
|
|
|
@@ -41,6 +43,8 @@ public class BStationInfoServiceImpl extends ServiceImpl<BStationInfoMapper, BSt
|
|
|
private BStationInfoMapper bStationInfoMapper;
|
|
|
@Resource
|
|
|
private SnowflakeUtil snowflakeUtil;
|
|
|
+ @Resource
|
|
|
+ private BCourseStationMapper bCourseStationMapper;
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
|
@@ -135,6 +139,12 @@ public class BStationInfoServiceImpl extends ServiceImpl<BStationInfoMapper, BSt
|
|
|
*/
|
|
|
@Override
|
|
|
public void delete(String id){
|
|
|
+ //判断该站点有没有被路线绑定
|
|
|
+ QueryWrapper<BCourseStationPo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("station_id", id);
|
|
|
+ if (bCourseStationMapper.selectList(queryWrapper).size() > 0) {
|
|
|
+ throw new BusinessException("该站点已被路线绑定,请先解除绑定");
|
|
|
+ }
|
|
|
bStationInfoMapper.deleteById(id);
|
|
|
}
|
|
|
|