From c6f298dc2f39673891eb90f219f610cdde20ef24 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期日, 15 三月 2026 20:32:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java
index c1416c7..f327b09 100644
--- a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java
+++ b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java
@@ -202,10 +202,31 @@
     public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) {
         XpPoint xpPoint = xpPointService.getById(pointAddDto.getId());
         BeanUtils.copyProperties(pointAddDto, xpPoint);
-        if (xpGeoFencingPolygonService.isInFence(pointAddDto.getPointLon(), pointAddDto.getPointLat(), pointAddDto.getFenceId(), "prohibited_area")) {
-            return R.ok("in_prohibited_area");
+        if (xpPoint == null) {
+            throw new ServiceException("系统异常", I18nKeyConstant.SYSTEM_EXCEPTION);
         }
-
+        if (Integer.valueOf(2).equals(pointAddDto.getOperationStatus()) && Integer.valueOf(5).equals(pointAddDto.getVerificationStatus())) {
+            Long electronicAreaId = xpPoint.getElectronicAreaId();
+            if (electronicAreaId == null) {
+                throw new ServiceException("当前点位不在围栏运营区域内,不能启用。", I18nKeyConstant.POINT_ENABLE_NOT_IN_OPERATING_AREA);
+            }
+            XpElectronicFenceArea electronicFenceArea = xpElectronicFenceAreaService.getById(electronicAreaId);
+            if (electronicFenceArea == null || electronicFenceArea.getElectronicId() == null) {
+                throw new ServiceException("运营区域不存在", I18nKeyConstant.POINT_ELECTRONIC_AREA_NOT_EXIST);
+            }
+            if (xpPoint.getPointLon() == null || xpPoint.getPointLat() == null) {
+                throw new ServiceException("系统异常", I18nKeyConstant.SYSTEM_EXCEPTION);
+            }
+            String fenceId = String.valueOf(electronicFenceArea.getElectronicId());
+            boolean inOperatingArea = xpGeoFencingPolygonService.isInFence(xpPoint.getPointLon(), xpPoint.getPointLat(), fenceId, "operating_area");
+            if (!inOperatingArea) {
+                throw new ServiceException("当前点位不在围栏运营区域内,不能启用。", I18nKeyConstant.POINT_ENABLE_NOT_IN_OPERATING_AREA);
+            }
+            boolean inProhibitedArea = xpGeoFencingPolygonService.isInFence(xpPoint.getPointLon(), xpPoint.getPointLat(), fenceId, "prohibited_area");
+            if (inProhibitedArea) {
+                throw new ServiceException("当前点位在禁行区内,不能启用。", I18nKeyConstant.POINT_ENABLE_IN_PROHIBITED_AREA);
+            }
+        }
         xpPointService.updateById(xpPoint);
         return R.ok();
     }

--
Gitblit v1.7.1