liujie
2026-03-18 58c9b7c52b446ac2438eaaf24ec1e487d07dbaaa
修改后台围栏
4个文件已修改
38 ■■■■■ 已修改文件
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/OperationStrategyIndex.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/vo/OrderDetailVo.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
@@ -765,14 +765,12 @@
                || CollUtil.isNotEmpty(delPointIds)
                || CollUtil.isNotEmpty(disablePointIds);
        boolean needFenceAreaIds = needPointHandling || needAutoDisableByUnion;
        XpElectronicFenceArea operationArea = needFenceAreaIds
                ? xpElectronicFenceAreaService.lambdaQuery()
        XpElectronicFenceArea operationArea =  xpElectronicFenceAreaService.lambdaQuery()
                .eq(XpElectronicFenceArea::getElectronicId, dto.getId())
                .eq(XpElectronicFenceArea::getAreaType, 1)
                .orderByDesc(XpElectronicFenceArea::getId)
                .last("limit 1")
                .one()
                : null;
                .one();
        Long operationAreaId = operationArea == null ? null : operationArea.getId();
        if (needPointHandling && operationAreaId == null) {
            throw new ServiceException("运营区域不存在", I18nKeyConstant.POINT_ELECTRONIC_AREA_NOT_EXIST);
@@ -808,7 +806,7 @@
        }
        // 围栏运营时间缩短校验:若缩短后点位时间段不在新范围内,则更新为已停用(operation_status=3)
        if (needAutoDisableByUnion && operationAreaId != null) {
        if (true) {
            LambdaQueryWrapper<XpPoint> pointQuery = new LambdaQueryWrapper<>();
            pointQuery.eq(XpPoint::getElectronicAreaId, operationAreaId)
                    .eq(XpPoint::getPointType, 1)
@@ -837,13 +835,15 @@
                    }
                }
                if (!disablePointIdList.isEmpty()) {
                    XpPoint updatePoint = new XpPoint();
                    updatePoint.setOperationStatus(3);
                    UpdateWrapper<XpPoint> updateWrapper = new UpdateWrapper<>();
                    updateWrapper.in("id", disablePointIdList);
                    updateWrapper.and(w -> w.isNull("operation_status").or().ne("operation_status", 4));
                    xpPointMapper.update(updatePoint, updateWrapper);
                    log.info("围栏运营时间缩短停用点位完成 fenceId={}, disableCount={}", dto.getId(), disablePointIdList.size());
                    for (Long l : disablePointIdList) {
                        XpPoint xpPoint = xpPointMapper.selectById(l);
                        if(xpPoint.getOperationStatus()!=4){
                            xpPoint.setOperationStatus(3);
                            xpPoint.setVerificationStatus(5);
                            xpPointMapper.updateById(xpPoint);
                        }
                    }
                }
            }
        }
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/OperationStrategyIndex.java
@@ -370,8 +370,8 @@
     * main 自测:使用固定样例打印 old/new Union、是否修改/缩短,以及点位在旧/新范围内判断结果。
     */
    public static void main(String[] args) {
        String pointJson = "[\"05:00-12:00\", \"13:00-23:59\"]";
        String strategyJson = "[{\"name\": \"策略组1\", \"time\": [\"06:00-12:00\", \"13:00-23:59\"], \"type\": 0, \"typeStr\": []}, {\"name\": \"策略组2\", \"time\": [\"05:00-12:00\", \"12:00-23:00\"], \"type\": 2, \"typeStr\": \"\"}, {\"name\": \"策略组3\", \"time\": [\"09:00-23:59\"], \"type\": 1, \"typeStr\": \"\"}]";
        String pointJson = "[\"05:00-12:00\", \"13:00-21:59\"]";
        String strategyJson = "[{\"name\": \"策略组1\", \"time\": [\"06:00-22:00\", \"22:00-23:59\"], \"type\": 0, \"typeStr\": []}, {\"name\": \"策略组2\", \"time\": [\"06:00-12:00\", \"12:00-23:00\"], \"type\": 2, \"typeStr\": \"\"}, {\"name\": \"策略组3\", \"time\": [\"09:00-23:59\"], \"type\": 1, \"typeStr\": \"\"}]";
        OperationStrategyIndex index = OperationStrategyIndex.parse(strategyJson);
        List<TimeInterval> pointIntervals = OperationStrategyIndex.parsePointEffectiveTimePeriod(pointJson);
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java
@@ -57,6 +57,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
@@ -329,7 +330,10 @@
    public R<OrderDetailVo> orderDetail(@PathVariable("orderId") Long orderId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return R.ok(xpOrderService.orderDetail(orderId, uid));
        OrderDetailVo orderDetailVo = xpOrderService.orderDetail(orderId, uid);
        BigDecimal orderMoney = orderDetailVo.getOrderMoney();
        orderDetailVo.setOrderMoneyStr(orderMoney.setScale(2, RoundingMode.HALF_UP).toString());
        return R.ok();
    }
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/vo/OrderDetailVo.java
@@ -34,4 +34,8 @@
    private Double totalMileage;
    @ApiModelProperty(value = "轨迹")
    private List<OrderTrajectory> trajectories;
    @ApiModelProperty(value = "订单金额Str")
    private String orderMoneyStr;
}