From 22e8a676ee42c0d78b3526bcd9a635abbe8dca03 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 28 六月 2022 11:28:21 +0800
Subject: [PATCH] 优化databus bug

---
 service-user/src/main/java/com/java110/user/cmd/owner/OwnerCommunityCmd.java |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 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..a40d559 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
@@ -4,15 +4,13 @@
 import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.context.ICmdDataFlowContext;
-import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.owner.OwnerAppUserDto;
 import com.java110.dto.owner.OwnerDto;
-import com.java110.intf.common.ISmsInnerServiceSMO;
 import com.java110.intf.community.ICommunityInnerServiceSMO;
-import com.java110.intf.store.IStoreInnerServiceSMO;
 import com.java110.intf.user.*;
 import com.java110.po.owner.OwnerAppUserPo;
 import com.java110.utils.exception.CmdException;
@@ -20,7 +18,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;
@@ -30,7 +28,7 @@
  * 鏈嶅姟娉ㄥ唽鍔熻兘杩佺Щ
  */
 @Java110Cmd(serviceCode = "owner.ownerCommunity")
-public class OwnerCommunityCmd extends AbstractServiceCmdListener {
+public class OwnerCommunityCmd extends Cmd {
     private final static Logger logger = LoggerFactory.getLogger(OwnerCommunityCmd.class);
 
     @Autowired
@@ -56,7 +54,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 +62,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