From d2f2d372e03a81cdf2e44f02f1105cfb32dad88d Mon Sep 17 00:00:00 2001
From: yyy <1083599556@qq.com>
Date: 星期五, 08 五月 2026 20:47:50 +0800
Subject: [PATCH] 1.修改bug 路线,用户路线偏好,改派、车型

---
 xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java b/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java
index 81dbfe9..2a54996 100644
--- a/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java
+++ b/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java
@@ -312,6 +312,14 @@
         if(null != one){
             throw new ServiceException("巡游打卡规则名称已存在");
         }
+        // 校验同一运维人员是否已存在有效规则(未删除且非循环模式或时间在有效期内)
+        long count = this.count(new LambdaQueryWrapper<XpCruiseCheckInRule>()
+                .eq(XpCruiseCheckInRule::getOperationsUserId, dto.getRelationId())
+                .eq(XpCruiseCheckInRule::getDeleted, false));
+        if (count > 0) {
+            throw new ServiceException("该运维人员已存在有效的巡游打卡规则");
+        }
+
         XpCruiseCheckInRule xpCruiseCheckInRule = new XpCruiseCheckInRule();
         BeanUtils.copyProperties(dto, xpCruiseCheckInRule);
         xpCruiseCheckInRule.setDeleted(false);

--
Gitblit v1.7.1