From 77fab501e7db456a5b176902c7d2d727c09b7a9c Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 23 三月 2026 15:36:01 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
---
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
index f1c911e..efdfddc 100644
--- a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
+++ b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
@@ -334,19 +334,23 @@
private void validateFenceTime(@NotNull Integer status, Integer effectType, LocalDateTime effectTime,
Integer failureType, LocalDateTime failureTime) {
LocalDateTime now = LocalDateTime.now();
- // 定时生效时,生效时间不能早于当前时间
- if (null != status && status == 2 && effectType != null && effectType != 1) {
+ // 发布/启用时,定时生效的生效时间不能早于当前时间
+ if (requiresScheduleValidation(status) && effectType != null && effectType != 1) {
if (effectTime == null || effectTime.isBefore(now)) {
throw new ServiceException("围栏生效时间不合法,定时生效时生效时间不能早于当前时间",
I18nKeyConstant.FENCE_EFFECT_TIME_INVALID);
}
}
- // 定时失效时,失效时间不能早于当前时间
- if (null != status && status == 2 && failureType != null && failureType != 1) {
+ // 发布/启用时,定时失效的失效时间不能早于当前时间
+ if (requiresScheduleValidation(status) && failureType != null && failureType != 1) {
if (failureTime == null || failureTime.isBefore(now)) {
throw new ServiceException("围栏失效时间不合法,定时失效时失效时间不能早于当前时间",
I18nKeyConstant.FENCE_FAILURE_TIME_INVALID);
}
}
}
+
+ private boolean requiresScheduleValidation(Integer status) {
+ return status != null && (status == 1 || status == 2);
+ }
}
--
Gitblit v1.7.1