From 5fb8a58f6daaa5dfc0b2a349e1fed28f625b63ee Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期四, 26 十二月 2019 20:08:26 +0800
Subject: [PATCH] 优化编译报错问题

---
 UserService/src/main/java/com/java110/user/smo/impl/OrgInnerServiceSMOImpl.java |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/UserService/src/main/java/com/java110/user/smo/impl/OrgInnerServiceSMOImpl.java b/UserService/src/main/java/com/java110/user/smo/impl/OrgInnerServiceSMOImpl.java
index 006403d..ffc8586 100644
--- a/UserService/src/main/java/com/java110/user/smo/impl/OrgInnerServiceSMOImpl.java
+++ b/UserService/src/main/java/com/java110/user/smo/impl/OrgInnerServiceSMOImpl.java
@@ -5,9 +5,7 @@
 import com.java110.core.smo.community.ICommunityInnerServiceSMO;
 import com.java110.core.smo.org.IOrgInnerServiceSMO;
 import com.java110.core.smo.user.IUserInnerServiceSMO;
-import com.java110.dto.OwnerDto;
 import com.java110.dto.PageDto;
-import com.java110.dto.UserDto;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.org.OrgDto;
 import com.java110.user.dao.IOrgServiceDao;
@@ -15,8 +13,6 @@
 import com.java110.utils.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
@@ -56,8 +52,12 @@
 
         List<OrgDto> orgs = BeanConvertUtil.covertBeanList(orgServiceDaoImpl.getOrgInfo(BeanConvertUtil.beanCovertMap(orgDto)), OrgDto.class);
 
+        String[] communityIds = getCommunityIds(orgs);
+        if (communityIds == null || communityIds.length < 1) {
+            return orgs;
+        }
         CommunityDto communityDto = new CommunityDto();
-        communityDto.setCommunityIds(getCommunityIds(orgs));
+        communityDto.setCommunityIds(communityIds);
         List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
 
         for (CommunityDto tmpCommunityDto : communityDtos) {
@@ -108,11 +108,11 @@
     private String[] getCommunityIds(List<OrgDto> orgDtos) {
         List<String> communityIds = new ArrayList<String>();
         for (OrgDto orgDto : orgDtos) {
-            if("9999".equals(orgDto.getBelongCommunityId())){
+            if ("9999".equals(orgDto.getBelongCommunityId())) {
                 orgDto.setBelongCommunityName("鍏ラ┗鎵�鏈夊皬鍖�");
                 continue;
             }
-            if(StringUtil.isEmpty(orgDto.getBelongCommunityId())){
+            if (StringUtil.isEmpty(orgDto.getBelongCommunityId())) {
                 orgDto.setBelongCommunityName("鏈煡灏忓尯");
                 continue;
             }

--
Gitblit v1.8.0