From c2614ad5c7d1e27fae68e52cd058af363464cdb4 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期六, 21 五月 2022 23:16:38 +0800
Subject: [PATCH] 优化代码

---
 service-user/src/main/java/com/java110/user/cmd/owner/OwnerCommunityCmd.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/service-user/src/main/java/com/java110/user/cmd/owner/OwnerCommunityCmd.java b/service-user/src/main/java/com/java110/user/cmd/owner/OwnerCommunityCmd.java
index e367ef3..2c8dbc0 100644
--- a/service-user/src/main/java/com/java110/user/cmd/owner/OwnerCommunityCmd.java
+++ b/service-user/src/main/java/com/java110/user/cmd/owner/OwnerCommunityCmd.java
@@ -20,7 +20,7 @@
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.ArrayList;
@@ -56,7 +56,7 @@
         ownerDto.setLink(reqJson.getString("link"));
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
 
-        if (ownerDtos == null || ownerDtos.size() < 0) {
+        if (ownerDtos == null || ownerDtos.size() < 1) {
             cmdDataFlowContext.setResponseEntity(ResultVo.success());
             return;
         }
@@ -64,18 +64,24 @@
         List<String> communityIds = new ArrayList<>();
         for (OwnerDto tmpOwnerDto : ownerDtos) {
             communityIds.add(tmpOwnerDto.getCommunityId());
+            tmpOwnerDto.setAppUserName(tmpOwnerDto.getName());
         }
 
         CommunityDto communityDto = new CommunityDto();
         communityDto.setState("1100");
         communityDto.setCommunityIds(communityIds.toArray(new String[communityIds.size()]));
         List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+        if(communityDtos == null || communityDtos.size()<1){
+            cmdDataFlowContext.setResponseEntity(ResultVo.success());
+            return ;
+        }
         for (OwnerDto tmpOwnerDto : ownerDtos) {
             for (CommunityDto tmpCommunityDto : communityDtos) {
                 if (!tmpCommunityDto.getCommunityId().equals(tmpOwnerDto.getCommunityId())) {
                     continue;
                 }
                 tmpOwnerDto.setCommunityName(tmpCommunityDto.getName());
+                tmpOwnerDto.setsCommunityTel(tmpCommunityDto.getTel());
             }
         }
 

--
Gitblit v1.8.0