Эх сурвалжийг харах

fixbug: 全局搜索,供应商是否开通店铺判断

wangdy 7 жил өмнө
parent
commit
219ca536fa

+ 5 - 0
src/main/java/com/uas/platform/b2c/common/account/dao/EnterpriseDao.java

@@ -24,6 +24,11 @@ public interface EnterpriseDao extends JpaSpecificationExecutor<Enterprise>, Jpa
 	@Query(value="select e.enName from Enterprise e where e.enName like %?1%")
 	public List<String> findEnNameByName(String name);
 
+	@Query(value = "select e.*, ifnull(s.id, 0) as isStore from sec$enterprises e " +
+			" left join store$info s on e.en_uu = s.st_enuu and s.st_status = 'OPENED' where e.en_uu = :uu  "
+			, nativeQuery = true)
+	public Enterprise findEnterpriseAndIsStoreByUu(@Param("uu") Long uu);
+
 	/**
 	 * 企业资料初始化
 	 *

+ 11 - 0
src/main/java/com/uas/platform/b2c/common/account/model/Enterprise.java

@@ -189,6 +189,9 @@ public class Enterprise implements Serializable {
 	@Transient
 	private Integer receiptStatus;
 
+	@Transient
+	private Integer isStore;
+
 	/**
 	 * 企业简介
 	 */
@@ -235,6 +238,14 @@ public class Enterprise implements Serializable {
 		this.uu = uu;
 	}
 
+	public Integer getIsStore() {
+		return isStore;
+	}
+
+	public void setIsStore(Integer isStore) {
+		this.isStore = isStore;
+	}
+
 	public String getEnName() {
 		return enName;
 	}

+ 2 - 2
src/main/java/com/uas/platform/b2c/common/search/service/impl/SearcherServiceImpl.java

@@ -327,7 +327,7 @@ public class SearcherServiceImpl implements SearcherService {
 
         if (!CollectionUtils.isEmpty(enUUs)) {
             for (Object enuu : enUUs) {
-                vendorIntroductionsFutures.add(VendorIntroduction.convertFromEnterprise(enterpriseDao.findByUu(Long.valueOf(enuu.toString()))));
+                vendorIntroductionsFutures.add(VendorIntroduction.convertFromEnterprise(enterpriseDao.findEnterpriseAndIsStoreByUu(Long.valueOf(enuu.toString()))));
             }
         }
 
@@ -458,7 +458,7 @@ public class SearcherServiceImpl implements SearcherService {
 
                 if (!CollectionUtils.isEmpty(enUUs)) {
                     for (Object enuu : enUUs) {
-                        vendorIntroductionsFutures.add(VendorIntroduction.convertFromEnterprise(enterpriseDao.findByUu(Long.valueOf(enuu.toString()))));
+                        vendorIntroductionsFutures.add(VendorIntroduction.convertFromEnterprise(enterpriseDao.findEnterpriseAndIsStoreByUu(Long.valueOf(enuu.toString()))));
                     }
                 }
 

+ 2 - 2
src/main/java/com/uas/platform/b2c/trade/vendor/model/VendorIntroduction.java

@@ -260,10 +260,10 @@ public class VendorIntroduction {
         vendorIntroduction.setEnTel(enterprise.getEnTel());
         vendorIntroduction.setEnCorporation(enterprise.getEnCorporation());
         vendorIntroduction.setEnLogoUrl(enterprise.getEnLogoUrl());
-        if (null == enterprise.getEnMallVendorStatus()) {
+        if (null == enterprise.getIsStore()) {
             vendorIntroduction.setIsStore(new Short((short)0));
         } else {
-            vendorIntroduction.setIsStore(enterprise.getEnMallVendorStatus().intValue() ==  313 ? new Short("1") : 0);
+            vendorIntroduction.setIsStore(enterprise.getIsStore().intValue() != 0 ? new Short("1") : 0);
         }
        return vendorIntroduction;
     }