From 9256180bd57599b0fb64e4627aeff7c5d65186ef Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期二, 30 九月 2025 17:42:20 +0800
Subject: [PATCH] 诊所erp

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java
index 06c3444..703cb8e 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java
@@ -97,9 +97,11 @@
         if(!CollectionUtils.isEmpty(branchAreas)){
             List<String> branchAreaCityCodes = branchAreas.stream().map(TCrmBranchArea::getCityCode).collect(Collectors.toList());
 
-            long count = crmBranchAreaService.count(Wrappers.lambdaQuery(TCrmBranchArea.class).in(TCrmBranchArea::getCityCode, branchAreaCityCodes));
-            if(count > 0){
-                return R.fail("区域已存在");
+            if(!CollectionUtils.isEmpty(branchAreaCityCodes)){
+                long count = crmBranchAreaService.count(Wrappers.lambdaQuery(TCrmBranchArea.class).in(TCrmBranchArea::getCityCode, branchAreaCityCodes));
+                if(count > 0){
+                    return R.fail("区域已存在");
+                }
             }
         }
 

--
Gitblit v1.7.1