Browse Source

在getNoConnectList里判断isNetworkOk, 对外就一个方法getNoConnectList

final/10.0
alex.sung 6 years ago
parent
commit
67ff7823ff
  1. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  2. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  3. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
  4. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
  5. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java

3
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -135,6 +135,9 @@ public class AlphaFineHelper {
* @return * @return
*/ */
public static SearchResult getNoConnectList(Object object) { public static SearchResult getNoConnectList(Object object) {
if (isNetworkOk()){
return null;
}
SearchResult result = new SearchResult(); SearchResult result = new SearchResult();
if (object instanceof RecommendSearchManager) { if (object instanceof RecommendSearchManager) {
result.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend"))); result.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend")));

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -58,8 +58,10 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
if (ArrayUtils.isEmpty(searchText)) { if (ArrayUtils.isEmpty(searchText)) {
lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help")));
return lessModelList; return lessModelList;
} else if (!AlphaFineHelper.isNetworkOk()) { }
return AlphaFineHelper.getNoConnectList(instance); SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance);
if(noConnectList != null){
return noConnectList;
} }
SearchResult searchResult = new SearchResult(); SearchResult searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -104,8 +104,10 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
if (ArrayUtils.isEmpty(searchText)) { if (ArrayUtils.isEmpty(searchText)) {
lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"))); lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon")));
return lessModelList; return lessModelList;
} else if (!AlphaFineHelper.isNetworkOk()) { }
return AlphaFineHelper.getNoConnectList(instance); SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance);
if(noConnectList != null){
return noConnectList;
} }
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
try { try {

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

@ -52,8 +52,10 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {
if (ArrayUtils.isEmpty(searchText)) { if (ArrayUtils.isEmpty(searchText)) {
return new SearchResult(); return new SearchResult();
} else if(!AlphaFineHelper.isNetworkOk()){ }
return AlphaFineHelper.getNoConnectList(instance); SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance);
if(noConnectList != null){
return noConnectList;
} }
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY); searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY);

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java

@ -42,8 +42,10 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider {
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) {
if (ArrayUtils.isEmpty(searchText)) { if (ArrayUtils.isEmpty(searchText)) {
return new SearchResult(); return new SearchResult();
} else if (!AlphaFineHelper.isNetworkOk()) { }
return AlphaFineHelper.getNoConnectList(instance); SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance);
if(noConnectList != null){
return noConnectList;
} }
SearchResult allModelList = new SearchResult(); SearchResult allModelList = new SearchResult();
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {

Loading…
Cancel
Save