From df851ece762f3e4b5867f2de83e655dfd5506e04 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期六, 14 二月 2026 16:10:42 +0800
Subject: [PATCH] 点位修改
---
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPricingServiceImpl.java | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPricingServiceImpl.java b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPricingServiceImpl.java
index f59e5db..062b9fd 100644
--- a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPricingServiceImpl.java
+++ b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPricingServiceImpl.java
@@ -36,6 +36,7 @@
import com.xiaopeng.operation.mapper.*;
import com.xiaopeng.operation.query.PricingPageListQuery;
import com.xiaopeng.operation.service.IXpGeoQueryEntityService;
+import com.xiaopeng.operation.service.XpPointService;
import com.xiaopeng.operation.service.XpPricingService;
import com.xiaopeng.operation.utils.XpPricingUtil;
import com.xiaopeng.operation.utils.holiday.HolidayUtil;
@@ -48,6 +49,7 @@
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.time.LocalDateTime;
+import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
@@ -97,9 +99,6 @@
@Resource
- private XpPointMapper xpPointMapper;
-
- @Resource
private XpWhitelistMapper xpWhitelistMapper;
@Resource
@@ -113,6 +112,9 @@
@Autowired
private XpElectronicFenceMapper xpElectronicFenceMapper;
+
+ @Autowired
+ private XpPointService xpPointService;
// 自定义线程池用于并行执行任务
@@ -396,6 +398,9 @@
@Override
public Long saveOrder(XpOrderDto dto, String uid) {
+
+
+
// 是否在运营区域时间内
XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreaMapper.selectById(dto.getXpElectronicFenceAreaId());
XpElectronicFence xpElectronicFence = xpElectronicFenceMapper.selectById(xpElectronicFenceArea.getElectronicId());
@@ -414,10 +419,21 @@
}
// 获取起点经纬度
- XpPoint xpPoint = xpPointMapper.selectById(dto.getStartPointId());
+ XpPoint xpPoint = xpPointService.getById(dto.getStartPointId());
// 终点
- XpPoint endXpPoint = xpPointMapper.selectById(dto.getStartPointId());
+ XpPoint endXpPoint = xpPointService.getById(dto.getStartPointId());
+
+ // 判断点位是否在运营区域内
+ LocalTime now = LocalTime.now();
+ boolean inTime = xpPointService.getInTime(now, xpPoint.getEffectivePeriod(), xpPoint.getEffectiveTimePeriod());
+ if(!inTime){
+ throw new ServiceException("当前点位未开通服务", I18nKeyConstant.NO_CURRENT_REGION);
+ }
+ inTime = xpPointService.getInTime(now, endXpPoint.getEffectivePeriod(), endXpPoint.getEffectiveTimePeriod());
+ if(!inTime){
+ throw new ServiceException("当前点位未开通服务", I18nKeyConstant.NO_CURRENT_REGION);
+ }
// 判断当天取消的次数 后台配置 redis 查询
Object cancelOrder = redisService.getCacheObject("CANCEL_ORDER_" + uid);
--
Gitblit v1.7.1