From ed838e62602c0a63a64ff4bd144a0d16cc9a7cf8 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 10 四月 2026 09:39:25 +0800
Subject: [PATCH] 和客户同步1.0版本

---
 xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
index 142918b..000244d 100644
--- a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
+++ b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
@@ -27,6 +27,7 @@
 import com.xiaopeng.map.mapper.XpElectronicFenceMapper;
 import com.xiaopeng.map.mapper.XpPointMapper;
 import com.xiaopeng.map.mapper.XpRegionMapper;
+import com.xiaopeng.map.event.FenceChangedEvent;
 import com.xiaopeng.map.service.XpElectronicFenceAreaService;
 import com.xiaopeng.map.service.XpElectronicFenceService;
 import com.xiaopeng.map.service.XpPointService;
@@ -42,6 +43,7 @@
 import org.locationtech.jts.geom.LinearRing;
 import org.locationtech.jts.geom.Polygon;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.data.geo.Point;
 import org.springframework.data.mongodb.core.MongoTemplate;
 import org.springframework.data.mongodb.core.geo.GeoJsonPolygon;
@@ -89,6 +91,8 @@
     private GDMapGeocodingUtil gdMapGeocodingUtil;
     @Resource
     private XpElectronicFenceAreaService xpElectronicFenceAreaService;
+    @Autowired
+    private ApplicationEventPublisher applicationEventPublisher;
 
     @Override
     public PageInfo<XpElectronicFence> pageList(ElectronicPageListQuery query) {
@@ -746,6 +750,9 @@
                 }
             }
         }
+        // 发布围栏变更事件,事务提交后异步触发 ADC 推送
+        applicationEventPublisher.publishEvent(
+                new FenceChangedEvent(this, xpElectronicFence.getId(), xpElectronicFence.getStatus()));
         return R.ok();
 
     }

--
Gitblit v1.7.1