| | |
| | | import com.xiaopeng.api.dto.operation.PointAddDto; |
| | | import com.xiaopeng.api.dto.operation.PointUpdateDto; |
| | | import com.xiaopeng.api.dto.operation.XpPointEnableDisableDto; |
| | | import com.xiaopeng.api.model.operation.XpCruisePlanPoint; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFence; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFenceArea; |
| | | import com.xiaopeng.api.model.operation.XpPoint; |
| | | import com.xiaopeng.api.query.operation.PointListQuery; |
| | | import com.xiaopeng.api.query.operation.PointPageListListQuery; |
| | | import com.xiaopeng.map.constant.I18nKeyConstant; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.api.dto.map.XpPointExportExcelQuery; |
| | | import com.xiaopeng.map.exportExcel.XpPointExportExcel; |
| | | import com.xiaopeng.map.mapper.XpCruisePlanPointMapper; |
| | | import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService; |
| | | import com.xiaopeng.map.service.XpElectronicFenceAreaService; |
| | | import com.xiaopeng.map.service.XpElectronicFenceService; |
| | | import com.xiaopeng.map.service.XpPointService; |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private XpElectronicFenceService xpElectronicFenceService; |
| | | @Resource |
| | | private XpGeoFencingPolygonService xpGeoFencingPolygonService; |
| | | @Resource |
| | | private XpCruisePlanPointMapper xpCruisePlanPointMapper; |
| | | |
| | | |
| | | @ApiOperation(value = "获取所有运营中的区域", response = XpElectronicFenceArea.class) |
| | |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | | xpPointService.removeBatchByIds(Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList())); |
| | | List<Long> pointIds = Arrays.stream(ids.split(",")) |
| | | .map(String::trim) |
| | | .filter(s -> !s.isEmpty()) |
| | | .map(Long::parseLong) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | if (pointIds.isEmpty()) { |
| | | return R.ok(); |
| | | } |
| | | Long relatedCount = xpCruisePlanPointMapper.selectCount( |
| | | new LambdaQueryWrapper<XpCruisePlanPoint>().in(XpCruisePlanPoint::getPointId, pointIds) |
| | | ); |
| | | if (relatedCount != null && relatedCount > 0) { |
| | | throw new ServiceException("操作失败,该点位有关联的巡游点位", I18nKeyConstant.POINT_DELETE_HAS_CRUISE_PLAN_POINT); |
| | | } |
| | | xpPointService.removeBatchByIds(pointIds); |
| | | return R.ok(); |
| | | } |
| | | |