puzhibing
2026-04-10 ed838e62602c0a63a64ff4bd144a0d16cc9a7cf8
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();
    }