“mitao”
2026-03-16 701c37e4268c075c8b083e173efb46a4db79ad1d
bugfix
1个文件已修改
31 ■■■■■ 已修改文件
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
@@ -234,7 +234,7 @@
                            existingArea.getFencePoints())) {
                        throw new ServiceException(
                                "运营区域{}与现有运营区域{}发生重叠",
                                I18nKeyConstant.EDIT_ELECTRONIC_ERROR,
                                I18nKeyConstant.AREA_OVERLAP_ERROR,
                                new Object[]{existingArea.getAreaName(), existingArea.getAreaName()}
                        );
                    }
@@ -732,11 +732,32 @@
            }
        }
        // 围栏改为已停用(3)时:将围栏下启用中点位(operation_status=2)更新为已停用(operation_status=3)
        if (newFenceStatus != null && newFenceStatus == 3) {
            XpElectronicFenceArea operationAreaToDisable = xpElectronicFenceAreaService.lambdaQuery()
                    .eq(XpElectronicFenceArea::getElectronicId, dto.getId())
                    .eq(XpElectronicFenceArea::getAreaType, 1)
                    .orderByDesc(XpElectronicFenceArea::getId)
                    .last("limit 1")
                    .one();
            if (operationAreaToDisable == null || operationAreaToDisable.getId() == null) {
                log.warn("围栏停用同步停用点位跳过:未查询到运营区 fenceId={}", dto.getId());
            } else {
                Long operationAreaIdToDisable = operationAreaToDisable.getId();
                boolean updated = xpPointService.lambdaUpdate()
                        .eq(XpPoint::getElectronicAreaId, operationAreaIdToDisable)
                        .eq(XpPoint::getPointType, 1)
                        .eq(XpPoint::getOperationStatus, 2)
                        .set(XpPoint::getOperationStatus, 3)
                        .update();
                log.info("围栏停用同步停用点位完成 fenceId={}, operationAreaId={}, updated={}",
                        dto.getId(), operationAreaIdToDisable, updated);
            }
        }
        OperationStrategyIndex oldIndex = OperationStrategyIndex.parse(oldOperationStrategy);
        OperationStrategyIndex newIndex = OperationStrategyIndex.parse(newOperationStrategy);
        // boolean needAutoDisableByUnion = !oldIndex.equalsNormalized(newIndex) && oldIndex.hasAnyShrinkComparedTo(newIndex);
        boolean needAutoDisableByUnion = true;
        boolean needAutoDisableByUnion = !oldIndex.equalsNormalized(newIndex);
        List<Long> addPointIds = normalizePointIds(dto.getAddPointIdList());
        List<Long> delPointIds = normalizePointIds(dto.getDelPointIdList());
        List<Long> disablePointIds = normalizePointIds(dto.getDisablePointIdList());
@@ -787,7 +808,7 @@
        }
        // 围栏运营时间缩短校验:若缩短后点位时间段不在新范围内,则更新为已停用(operation_status=3)
        if (operationAreaId != null) {
        if (needAutoDisableByUnion && operationAreaId != null) {
            LambdaQueryWrapper<XpPoint> pointQuery = new LambdaQueryWrapper<>();
            pointQuery.eq(XpPoint::getElectronicAreaId, operationAreaId)
                    .eq(XpPoint::getPointType, 1)