Quellcode durchsuchen

优化出库查询问题

java110 vor 5 Jahren
Ursprung
Commit
9187c9f298

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/resourceStore/ResourceStoreDto.java

@@ -44,6 +44,7 @@ public class ResourceStoreDto extends PageDto implements Serializable {
 
     private String shId;
     private String shType;
+    private String shObjId;
 
     private List<String> fileUrls;
     private Date createTime;
@@ -229,4 +230,12 @@ public class ResourceStoreDto extends PageDto implements Serializable {
     public void setShType(String shType) {
         this.shType = shType;
     }
+
+    public String getShObjId() {
+        return shObjId;
+    }
+
+    public void setShObjId(String shObjId) {
+        this.shObjId = shObjId;
+    }
 }

+ 6 - 0
java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml

@@ -189,6 +189,9 @@
         <if test="shType !=null and shType != ''">
             and sh.sh_type= #{shType}
         </if>
+        <if test="shObjId !=null and shObjId != ''">
+            and sh.sh_ob_id= #{shObjId}
+        </if>
         <if test="showMobile != null and showMobile != ''">
             and t.show_mobile = #{showMobile}
         </if>
@@ -309,6 +312,9 @@
         <if test="shId !=null and shId != ''">
             and t.sh_id= #{shId}
         </if>
+        <if test="shObjId !=null and shObjId != ''">
+            and sh.sh_ob_id= #{shObjId}
+        </if>
         <if test="shType !=null and shType != ''">
             and sh.sh_type= #{shType}
         </if>

+ 8 - 2
service-api/src/main/java/com/java110/api/listener/resourceStore/ListResourceStoresListener.java

@@ -4,9 +4,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
-import com.java110.intf.store.IResourceStoreInnerServiceSMO;
-import com.java110.dto.resourceStore.ResourceStoreDto;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.dto.resourceStore.ResourceStoreDto;
+import com.java110.dto.storehouse.StorehouseDto;
+import com.java110.intf.store.IResourceStoreInnerServiceSMO;
 import com.java110.utils.constant.ServiceCodeResourceStoreConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -62,6 +63,11 @@ public class ListResourceStoresListener extends AbstractServiceApiListener {
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
         ResourceStoreDto resourceStoreDto = BeanConvertUtil.covertBean(reqJson, ResourceStoreDto.class);
+
+        if (StorehouseDto.SH_TYPE_COMMUNITY.equals(resourceStoreDto.getShType())) {
+            resourceStoreDto.setShType(StorehouseDto.SH_TYPE_COMMUNITY);
+            resourceStoreDto.setShObjId(reqJson.getString("communityId"));
+        }
         int count = resourceStoreInnerServiceSMOImpl.queryResourceStoresCount(resourceStoreDto);
         List<ApiResourceStoreDataVo> resourceStores = new ArrayList<>();
         if (count > 0) {