From 560be817c1342d4da523760ba38433c4c0f52983 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期二, 12 五月 2026 10:56:09 +0800
Subject: [PATCH] Merge branch '1.1' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi into 1.1

---
 xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 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 36abdb8..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
@@ -131,6 +131,7 @@
             vo.setLon(xpCheckLocation.getLocationLon());
             vo.setLat(xpCheckLocation.getLocationLat());
             vo.setAddress(xpCheckLocation.getLocationAddress());
+            vo.setOpenRange(xpCheckLocation.getLocationRange());
             appXpCruiseCheckInLocationVos.add(vo);
         }
         return appXpCruiseCheckInLocationVos;
@@ -234,12 +235,6 @@
             vo.setIsInRange(true);
             vo.setMessageType(2);
             vo.setCheckLocationId(cruiseCheckInRuleLocation.getCheckLocationId());
-//            Boolean read = redisService.getCacheObject("CHECK_IN_SCOPE:" + xpCheckLocation.getId());
-//            if(null == read || !read){
-//                vo.setMessageType(2);
-//                vo.setCheckLocationId(cruiseCheckInRuleLocation.getCheckLocationId());
-//                redisService.setCacheObject("CHECK_IN_SCOPE:" + xpCheckLocation.getId(), true, 1L, TimeUnit.HOURS);
-//            }
             return vo;
         }
         //判断时间小于10分钟首次触发和小于3分钟再次触发
@@ -317,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