From bf74fbaa6732c5a192555a856de585ac9f70f3aa Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期二, 30 九月 2025 11:42:22 +0800
Subject: [PATCH] bug修改

---
 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