puzhibing
2026-03-03 1e16fb98c0dd2db59429e7b40f42841ea01bdb2e
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java
@@ -89,7 +89,9 @@
//    @Transactional
//    @ShardingSphereTransactionType(TransactionType.BASE)
    public R add(@Validated @RequestBody PointAddDto pointAddDto) {
        xpPointService.addPointWithGeneratedNumber(pointAddDto);
        XpPoint xpPoint = new XpPoint();
        BeanUtils.copyProperties(pointAddDto, xpPoint);
        xpPointService.save(xpPoint);
        return R.ok();
    }
@@ -114,12 +116,10 @@
//    @Transactional
//    @ShardingSphereTransactionType(TransactionType.BASE)
    public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) {
        XpPoint xpPoint = xpPointService.getById(pointAddDto.getId());
        //先删除原有的数据,因为会存在点位的从属区域变化的情况,所以先删除原有的数据后添加新的数据重新分片到新的库中
        xpPointService.removeById(pointAddDto.getId());
        XpPoint xpPoint = new XpPoint();
        BeanUtils.copyProperties(pointAddDto, xpPoint);
        xpPoint.setId(null);
        xpPointService.save(xpPoint);
        xpPoint.setElectronicAreaId(null);
        xpPointService.updateById(xpPoint);
        return R.ok();
    }
@@ -142,7 +142,6 @@
    public R enableDisable(@RequestBody XpPointEnableDisableDto dto) {
        XpPoint xpPoint = xpPointService.getById(dto.getId());
        xpPoint.setOperationStatus(dto.getOperationStatus());
        xpPoint.setVerificationStatus(dto.getVerificationStatus());
        xpPoint.setElectronicAreaId(null);
        xpPointService.updateById(xpPoint);
        return R.ok();