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/QueryOwnersCmd.java |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/service-user/src/main/java/com/java110/user/cmd/owner/QueryOwnersCmd.java b/service-user/src/main/java/com/java110/user/cmd/owner/QueryOwnersCmd.java
index 076209a..d83b931 100644
--- a/service-user/src/main/java/com/java110/user/cmd/owner/QueryOwnersCmd.java
+++ b/service-user/src/main/java/com/java110/user/cmd/owner/QueryOwnersCmd.java
@@ -3,7 +3,7 @@
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Cmd;
 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.dto.RoomDto;
 import com.java110.dto.basePrivilege.BasePrivilegeDto;
@@ -26,7 +26,7 @@
 import java.util.Map;
 
 @Java110Cmd(serviceCode = "owner.queryOwners")
-public class QueryOwnersCmd extends AbstractServiceCmdListener {
+public class QueryOwnersCmd extends Cmd {
 
     @Autowired
     private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
@@ -51,6 +51,7 @@
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
 //鏍规嵁鎴垮眿鏌ヨ鏃� 鍏堢敤 鎴垮眿淇℃伅鏌ヨ 涓氫富ID
         freshRoomId(reqJson);
+
 
         if (reqJson.containsKey("name") && !StringUtil.isEmpty(reqJson.getString("name"))) {
             queryByCondition(reqJson, cmdDataFlowContext);
@@ -134,14 +135,20 @@
      */
     private void queryByCondition(JSONObject reqJson, ICmdDataFlowContext cmdDataFlowContext) {
         //鑾峰彇褰撳墠鐢ㄦ埛id
+        String ownerTypeCd = reqJson.getString("ownerTypeCd");
+        OwnerDto tmpOwnerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class);
+        if(!StringUtil.isEmpty(ownerTypeCd) && ownerTypeCd.contains(",")){
+            tmpOwnerDto.setOwnerTypeCd("");
+            tmpOwnerDto.setOwnerTypeCds(ownerTypeCd.split(","));
+        }
         String userId = reqJson.getString("userId");
         int row = reqJson.getInteger("row");
         ApiOwnerVo apiOwnerVo = new ApiOwnerVo();
-        int total = ownerInnerServiceSMOImpl.queryOwnerCountByCondition(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
+        int total = ownerInnerServiceSMOImpl.queryOwnerCountByCondition(tmpOwnerDto);
         apiOwnerVo.setTotal(total);
         List<OwnerDto> ownerDtos = new ArrayList<>();
         if (total > 0) {
-            List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwnersByCondition(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
+            List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwnersByCondition(tmpOwnerDto);
             List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
             for (OwnerDto ownerDto : ownerDtoList) {
                 //瀵逛笟涓昏韩浠借瘉鍙烽殣钘忓鐞�

--
Gitblit v1.8.0