Browse Source

REPORT-65475 AlphaFine搜索慢

bugfix/10.0
hades 3 years ago
parent
commit
95dadd063a
  1. 18
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

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

@ -11,10 +11,14 @@ import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.file.filetree.FileNodes;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
/** /**
@ -74,7 +78,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
return lessModelList; return lessModelList;
} }
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
fileNodes = FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true); fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true);
}
}).list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true, false);
isContainCpt = true; isContainCpt = true;
isContainFrm = true; isContainFrm = true;
doSearch(this.searchText); doSearch(this.searchText);
@ -128,7 +137,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
*/ */
private void doFileContentSearch(String searchText) { private void doFileContentSearch(String searchText) {
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) {
FileNode[] fileNodes = FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true); FileNode[] fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true);
}
}).filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true, false);
for (FileNode node : fileNodes) { for (FileNode node : fileNodes) {
FileModel model = new FileModel(node.getName(), node.getEnvPath()); FileModel model = new FileModel(node.getName(), node.getEnvPath());
if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) { if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) {

Loading…
Cancel
Save