Kaynağa Gözat

fixbug: 全局搜索,器件搜索关键词

wangdy 7 yıl önce
ebeveyn
işleme
2948d88d8a

+ 4 - 0
src/main/java/com/uas/platform/b2c/common/search/constant/SearchUrl.java

@@ -98,6 +98,10 @@ public class SearchUrl {
      */
     public static final String SIMILAR_COMPONENT_URL = "/search/similarComponents?keyword={keyword}";
 
+    /**
+     * 根据关键字联想产品
+     */
+    public static final String SIMILAR_PRODUCTS_URL = "/search/similarProducts?keyword={keyword}";
 
     /**
      * 根据关键字联想品牌

+ 2 - 1
src/main/java/com/uas/platform/b2c/common/search/rpc/service/Impl/SearchServiceImpl.java

@@ -291,7 +291,8 @@ public class SearchServiceImpl implements SearchService{
         String result;
         switch (type) {
             case COMPONENT:
-                result = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_COMPONENT_URL, String.class, map);
+                result = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_PRODUCTS_URL, String.class, map);
+                result = result.replaceAll("pcmpcode","cmpcode");
                 break;
             case BRAND:
                 result = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_BRAND_URL, String.class, map);

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

@@ -297,6 +297,12 @@ public class SearcherServiceImpl implements SearcherService {
         return resultMap;
     }
 
+    /**
+     * 根据类目名称搜索供应商列表(现货,期货)
+     * @param keyword
+     * @param page
+     * @return
+     */
     @Override
     public ModelMap getEnterpriseBySearchKind(String keyword, PageParams page) {
         ModelMap resultMap = new ModelMap();

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

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