Bläddra i källkod

设计搜索内存优化,减少对象创建,减少数据输出

o2sword 5 år sedan
förälder
incheckning
1ccef7520e

+ 8 - 3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WrapDesigner.java

@@ -86,7 +86,6 @@ public class WrapDesigner extends GsonPropertyObject {
 
 	public void setPatternList(Map<String, String> map) {
 		if(map!=null && !map.isEmpty()){
-			List<DesignerPattern> patternList = new ArrayList<>();
 			for (String key : map.keySet()){
 				DesignerPattern pattern = new DesignerPattern();
 				pattern.setProperty(key);
@@ -97,9 +96,10 @@ public class WrapDesigner extends GsonPropertyObject {
 					}
 				}
 				pattern.setPropertyValue(propertyValue);
-				patternList.add(pattern);
+				this.patternList.add(pattern);
 			}
-			this.patternList = patternList;
+			map.clear();
+			map = null;
 		}
 	}
 
@@ -118,6 +118,8 @@ public class WrapDesigner extends GsonPropertyObject {
 				pattern.setPropertyValue(propertyValue);
 				this.patternList.add(pattern);
 			}
+			map.clear();
+			map = null;
 		}
 	}
 
@@ -138,6 +140,8 @@ public class WrapDesigner extends GsonPropertyObject {
 				pattern.setPropertyValue(propertyValue);
 				this.patternList.add(pattern);
 			}
+			map.clear();
+			map = null;
 		}
 	}
 
@@ -190,6 +194,7 @@ public class WrapDesigner extends GsonPropertyObject {
 				}
 				this.lines = lines;
 				map.clear();
+				map = null;
 			}
 		}
 

+ 4 - 2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ActionSearch.java

@@ -88,7 +88,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
-						AppInfo appInfo = emc.find( woScript.getAppId(), AppInfo.class );
+						AppInfo appInfo = emc.fetch(woScript.getAppId(), AppInfo.class, ListTools.toList(AppInfo.id_FIELDNAME, AppInfo.appName_FIELDNAME));
 						if(appInfo != null){
 							wo.setAppId(appInfo.getId());
 							wo.setAppName(appInfo.getAppName());
@@ -102,6 +102,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woScripts.clear();
+				woScripts = null;
 			}catch (Exception e){
 				logger.error(e);
 			}
@@ -126,7 +127,7 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
-							AppInfo appInfo = emc.find( woForm.getAppId(), AppInfo.class );
+							AppInfo appInfo = emc.fetch(woForm.getAppId(), AppInfo.class, ListTools.toList(AppInfo.id_FIELDNAME, AppInfo.appName_FIELDNAME));
 							if(appInfo != null){
 								wo.setAppId(appInfo.getId());
 								wo.setAppName(appInfo.getAppName());
@@ -140,6 +141,7 @@ class ActionSearch extends BaseAction {
 						}
 					}
 					woForms.clear();
+					woForms = null;
 				}
 
 			}catch (Exception e){

+ 6 - 3
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ActionSearch.java

@@ -91,7 +91,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
-						Portal portal = emc.find(woScript.getPortal(), Portal.class);
+						Portal portal = emc.fetch(woScript.getPortal(), Portal.class, ListTools.toList(Portal.id_FIELDNAME, Portal.name_FIELDNAME));
 						if(portal != null){
 							wo.setAppId(portal.getId());
 							wo.setAppName(portal.getName());
@@ -105,6 +105,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woScripts.clear();
+				woScripts = null;
 			}catch (Exception e){
 				logger.error(e);
 			}
@@ -129,7 +130,7 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
-							Portal portal = emc.find(wopage.getPortal(), Portal.class);
+							Portal portal = emc.fetch(wopage.getPortal(), Portal.class, ListTools.toList(Portal.id_FIELDNAME, Portal.name_FIELDNAME));
 							if(portal != null){
 								wo.setAppId(portal.getId());
 								wo.setAppName(portal.getName());
@@ -143,6 +144,7 @@ class ActionSearch extends BaseAction {
 						}
 					}
 					wos.clear();
+					wos = null;
 				}
 
 			}catch (Exception e){
@@ -169,7 +171,7 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
-							Portal portal = emc.find(woWidget.getPortal(), Portal.class);
+							Portal portal = emc.fetch(woWidget.getPortal(), Portal.class, ListTools.toList(Portal.id_FIELDNAME, Portal.name_FIELDNAME));
 							if(portal != null){
 								wo.setAppId(portal.getId());
 								wo.setAppName(portal.getName());
@@ -183,6 +185,7 @@ class ActionSearch extends BaseAction {
 						}
 					}
 					wos.clear();
+					wos = null;
 				}
 
 			}catch (Exception e){

+ 127 - 106
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java

@@ -25,6 +25,7 @@ import com.x.processplatform.core.entity.element.wrap.*;
 import org.apache.commons.lang3.StringUtils;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.*;
@@ -91,7 +92,8 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
-						Application app = emc.find(woScript.getApplication(), Application.class);
+						Application app = emc.fetch(woScript.getApplication(), Application.class,
+								ListTools.toList(Application.id_FIELDNAME, Application.name_FIELDNAME));
 						if (app != null) {
 							wo.setAppId(app.getId());
 							wo.setAppName(app.getName());
@@ -105,6 +107,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woScripts.clear();
+				woScripts = null;
 			}catch (Exception e){
 				logger.error(e);
 			}
@@ -129,7 +132,8 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
-							Application app = emc.find(woForm.getApplication(), Application.class);
+							Application app = emc.fetch(woForm.getApplication(), Application.class,
+									ListTools.toList(Application.id_FIELDNAME, Application.name_FIELDNAME));
 							if (app != null) {
 								wo.setAppId(app.getId());
 								wo.setAppName(app.getName());
@@ -143,6 +147,7 @@ class ActionSearch extends BaseAction {
 						}
 					}
 					woForms.clear();
+					woForms = null;
 				}
 
 			}catch (Exception e){
@@ -184,6 +189,7 @@ class ActionSearch extends BaseAction {
 						}
 					}
 					processList.clear();
+					processList = null;
 				}catch (Exception e){
 					logger.error(e);
 				}
@@ -205,59 +211,28 @@ class ActionSearch extends BaseAction {
 
 	private Wo doProcessSearch(Business business, Process process, Wi wi) throws Exception {
 		Wo wo = null;
-		WrapProcess wrap = WrapProcess.outCopier.copy(process);
-		wrap.setAgentList(WrapAgent.outCopier.copy(business.entityManagerContainer().list(Agent.class,
-				business.agent().listWithProcess(process.getId()))));
-		wrap.setBegin(WrapBegin.outCopier.copy(
-				business.entityManagerContainer().find(business.begin().getWithProcess(process.getId()), Begin.class)));
-		wrap.setCancelList(WrapCancel.outCopier.copy(business.entityManagerContainer().list(Cancel.class,
-				business.cancel().listWithProcess(process.getId()))));
-		wrap.setChoiceList(WrapChoice.outCopier.copy(business.entityManagerContainer().list(Choice.class,
-				business.choice().listWithProcess(process.getId()))));
-		wrap.setDelayList(WrapDelay.outCopier.copy(business.entityManagerContainer().list(Delay.class,
-				business.delay().listWithProcess(process.getId()))));
-		wrap.setEmbedList(WrapEmbed.outCopier.copy(business.entityManagerContainer().list(Embed.class,
-				business.embed().listWithProcess(process.getId()))));
-		wrap.setEndList(WrapEnd.outCopier.copy(
-				business.entityManagerContainer().list(End.class, business.end().listWithProcess(process.getId()))));
-		wrap.setInvokeList(WrapInvoke.outCopier.copy(business.entityManagerContainer().list(Invoke.class,
-				business.invoke().listWithProcess(process.getId()))));
-		wrap.setManualList(WrapManual.outCopier.copy(business.entityManagerContainer().list(Manual.class,
-				business.manual().listWithProcess(process.getId()))));
-		wrap.setMergeList(WrapMerge.outCopier.copy(business.entityManagerContainer().list(Merge.class,
-				business.merge().listWithProcess(process.getId()))));
-		wrap.setMessageList(WrapMessage.outCopier.copy(business.entityManagerContainer().list(Message.class,
-				business.message().listWithProcess(process.getId()))));
-		wrap.setParallelList(WrapParallel.outCopier.copy(business.entityManagerContainer().list(Parallel.class,
-				business.parallel().listWithProcess(process.getId()))));
-		wrap.setServiceList(WrapService.outCopier.copy(business.entityManagerContainer().list(Service.class,
-				business.service().listWithProcess(process.getId()))));
-		wrap.setSplitList(WrapSplit.outCopier.copy(business.entityManagerContainer().list(Split.class,
-				business.split().listWithProcess(process.getId()))));
-		wrap.setRouteList(WrapRoute.outCopier.copy(business.entityManagerContainer().list(Route.class,
-				business.route().listWithProcess(process.getId()))));
-
-		if(!StringTools.matchKeyword(wi.getKeyword(), XGsonBuilder.toJson(wrap), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
-			wrap.getManualList().clear();
-			return null;
-		}
 
-		Map<String, String> pmap = PropertyTools.fieldMatchKeyword(WrapProcess.outCopier.getCopyFields(), process, wi.getKeyword(),
-				wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-		if (!pmap.isEmpty()) {
-			if(wo == null){
-				wo = this.getProcessWo(business, process);
+		Map<String, String> map;
+		if(!StringTools.matchKeyword(wi.getKeyword(), XGsonBuilder.toJson(process), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+			map = PropertyTools.fieldMatchKeyword(WrapProcess.outCopier.getCopyFields(), process, wi.getKeyword(),
+					wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+			if (!map.isEmpty()) {
+				if(wo == null){
+					wo = this.getProcessWo(business, process);
+				}
+				wo.addPatternList(DesignerType.process.toString(), map);
 			}
-			wo.addPatternList(DesignerType.process.toString(), pmap);
 		}
 
-		if(!wrap.getAgentList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getAgentList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Agent> agentList = business.entityManagerContainer().list(Agent.class,
+				business.agent().listWithProcess(process.getId()));
+		if(!agentList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(agentList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapAgent active : wrap.getAgentList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapAgent.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Agent active : agentList){
+				map = PropertyTools.fieldMatchKeyword(WrapAgent.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -267,14 +242,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		agentList.clear();
+		agentList = null;
 
-		if(wrap.getBegin() != null && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getBegin()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		Begin begin = business.entityManagerContainer().find(business.begin().getWithProcess(process.getId()), Begin.class);
+		if(begin != null && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(begin), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			WrapBegin active = wrap.getBegin();
-			Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapBegin.outCopier.getCopyFields(), active, wi.getKeyword(),
+			Begin active = begin;
+			map = PropertyTools.fieldMatchKeyword(WrapBegin.outCopier.getCopyFields(), active, wi.getKeyword(),
 					wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 			if (!map.isEmpty()) {
 				if(wo == null){
@@ -284,13 +262,15 @@ class ActionSearch extends BaseAction {
 			}
 		}
 
-		if(!wrap.getCancelList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getCancelList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Cancel> cancelList =  business.entityManagerContainer().list(Cancel.class,
+				business.cancel().listWithProcess(process.getId()));
+		if(!cancelList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(cancelList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapCancel active : wrap.getCancelList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapCancel.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Cancel active : cancelList){
+				map = PropertyTools.fieldMatchKeyword(WrapCancel.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -300,14 +280,18 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		cancelList.clear();
+		cancelList = null;
 
-		if(!wrap.getChoiceList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getChoiceList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Choice> choiceList =  business.entityManagerContainer().list(Choice.class,
+				business.choice().listWithProcess(process.getId()));
+		if(!choiceList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(choiceList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapChoice active : wrap.getChoiceList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapChoice.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Choice active : choiceList){
+				map = PropertyTools.fieldMatchKeyword(WrapChoice.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -317,14 +301,18 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		choiceList.clear();
+		choiceList = null;
 
-		if(!wrap.getDelayList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getDelayList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Delay> delayList =  business.entityManagerContainer().list(Delay.class,
+				business.delay().listWithProcess(process.getId()));
+		if(!delayList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(delayList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapDelay active : wrap.getDelayList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapDelay.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Delay active : delayList){
+				map = PropertyTools.fieldMatchKeyword(WrapDelay.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -334,14 +322,18 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		delayList.clear();
+		delayList = null;
 
-		if(!wrap.getEmbedList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getEmbedList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Embed> embedList = business.entityManagerContainer().list(Embed.class,
+				business.embed().listWithProcess(process.getId()));
+		if(!embedList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(embedList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapEmbed active : wrap.getEmbedList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapEmbed.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Embed active : embedList){
+				map = PropertyTools.fieldMatchKeyword(WrapEmbed.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -351,14 +343,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		embedList.clear();
+		embedList = null;
 
-		if(!wrap.getEndList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getEndList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<End> endList = business.entityManagerContainer().list(End.class, business.end().listWithProcess(process.getId()));
+		if(!endList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(endList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapEnd active : wrap.getEndList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapEnd.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (End active : endList){
+				map = PropertyTools.fieldMatchKeyword(WrapEnd.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -368,14 +363,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		endList.clear();
+		endList = null;
 
-		if(!wrap.getInvokeList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getInvokeList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Invoke> invokeList = business.entityManagerContainer().list(Invoke.class, business.invoke().listWithProcess(process.getId()));
+		if(!invokeList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(invokeList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapInvoke active : wrap.getInvokeList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapInvoke.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Invoke active : invokeList){
+				map = PropertyTools.fieldMatchKeyword(WrapInvoke.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -385,14 +383,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		invokeList.clear();
+		invokeList = null;
 
-		if(!wrap.getManualList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getManualList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Manual> manualList = business.entityManagerContainer().list(Manual.class, business.manual().listWithProcess(process.getId()));
+		if(!manualList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(manualList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapManual active : wrap.getManualList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapManual.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Manual active : manualList){
+				map = PropertyTools.fieldMatchKeyword(WrapManual.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -402,14 +403,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		manualList.clear();
+		manualList = null;
 
-		if(!wrap.getMergeList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getMergeList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Merge> mergeList = business.entityManagerContainer().list(Merge.class, business.merge().listWithProcess(process.getId()));
+		if(!mergeList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(mergeList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapMerge active : wrap.getMergeList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapMerge.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Merge active : mergeList){
+				map = PropertyTools.fieldMatchKeyword(WrapMerge.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -419,14 +423,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		mergeList.clear();
+		mergeList = null;
 
-		if(!wrap.getMessageList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getMessageList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Message> messageList = business.entityManagerContainer().list(Message.class, business.message().listWithProcess(process.getId()));
+		if(!messageList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(messageList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapMessage active : wrap.getMessageList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapMessage.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Message active : messageList){
+				map = PropertyTools.fieldMatchKeyword(WrapMessage.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -436,14 +443,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		messageList.clear();
+		messageList = null;
 
-		if(!wrap.getParallelList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getParallelList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Parallel> parallelList = business.entityManagerContainer().list(Parallel.class, business.parallel().listWithProcess(process.getId()));
+		if(!parallelList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(parallelList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapParallel active : wrap.getParallelList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapParallel.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Parallel active : parallelList){
+				map = PropertyTools.fieldMatchKeyword(WrapParallel.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -453,14 +463,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		parallelList.clear();
+		parallelList = null;
 
-		if(!wrap.getServiceList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getServiceList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Service> serviceList = business.entityManagerContainer().list(Service.class, business.service().listWithProcess(process.getId()));
+		if(!serviceList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(serviceList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapService active : wrap.getServiceList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapService.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Service active : serviceList){
+				map = PropertyTools.fieldMatchKeyword(WrapService.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -470,14 +483,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		serviceList.clear();
+		serviceList = null;
 
-		if(!wrap.getSplitList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getSplitList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Split> splitList = business.entityManagerContainer().list(Split.class, business.split().listWithProcess(process.getId()));
+		if(!splitList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(splitList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapSplit active : wrap.getSplitList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapSplit.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Split active : splitList){
+				map = PropertyTools.fieldMatchKeyword(WrapSplit.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -487,14 +503,17 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		splitList.clear();
+		splitList = null;
 
-		if(!wrap.getRouteList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getRouteList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+		List<Route> routeList = business.entityManagerContainer().list(Route.class, business.route().listWithProcess(process.getId()));
+		if(!routeList.isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(routeList), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 			}
-			for (WrapRoute active : wrap.getRouteList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapRoute.outCopier.getCopyFields(), active, wi.getKeyword(),
+			for (Route active : routeList){
+				map = PropertyTools.fieldMatchKeyword(WrapRoute.outCopier.getCopyFields(), active, wi.getKeyword(),
 						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 				if (!map.isEmpty()) {
 					if(wo == null){
@@ -504,14 +523,16 @@ class ActionSearch extends BaseAction {
 				}
 			}
 		}
+		routeList.clear();
+		routeList = null;
 
-		wrap.getManualList().clear();
 		return wo;
 	}
 
 	private Wo getProcessWo(Business business, Process process) throws Exception {
 		Wo wo = new Wo();
-		Application app = business.entityManagerContainer().find(process.getApplication(), Application.class);
+		Application app = business.entityManagerContainer().fetch(process.getApplication(), Application.class,
+				ListTools.toList(Application.id_FIELDNAME, Application.name_FIELDNAME));
 		if (app != null) {
 			wo.setAppId(app.getId());
 			wo.setAppName(app.getName());

+ 2 - 0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/designer/ActionSearch.java

@@ -93,6 +93,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woAgents.clear();
+				woAgents = null;
 			}catch (Exception e){
 				logger.error(e);
 			}
@@ -127,6 +128,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woInvokes.clear();
+				woInvokes = null;
 			}catch (Exception e){
 				logger.error(e);
 			}

+ 7 - 4
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/designer/ActionSearch.java

@@ -96,7 +96,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
-						Query query = emc.find(woView.getQuery(), Query.class);
+						Query query = emc.fetch(woView.getQuery(), Query.class, ListTools.toList(Query.id_FIELDNAME, Query.name_FIELDNAME));
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
@@ -135,7 +135,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
-						Query query = emc.find(woTable.getQuery(), Query.class);
+						Query query = emc.fetch(woTable.getQuery(), Query.class, ListTools.toList(Query.id_FIELDNAME, Query.name_FIELDNAME));
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
@@ -149,6 +149,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woTables.clear();
+				woTables = null;
 			}catch (Exception e){
 				logger.error(e);
 			}
@@ -174,7 +175,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
-						Query query = emc.find(woStat.getQuery(), Query.class);
+						Query query = emc.fetch(woStat.getQuery(), Query.class, ListTools.toList(Query.id_FIELDNAME, Query.name_FIELDNAME));
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
@@ -188,6 +189,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woStats.clear();
+				woStats = null;
 			}catch (Exception e){
 				logger.error(e);
 			}
@@ -213,7 +215,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
-						Query query = emc.find(woStatement.getQuery(), Query.class);
+						Query query = emc.fetch(woStatement.getQuery(), Query.class, ListTools.toList(Query.id_FIELDNAME, Query.name_FIELDNAME));
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
@@ -227,6 +229,7 @@ class ActionSearch extends BaseAction {
 					}
 				}
 				woStatements.clear();
+				woStatements = null;
 			}catch (Exception e){
 				logger.error(e);
 			}

+ 4 - 4
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java

@@ -33,8 +33,8 @@ class ActionSearch extends BaseAction {
 		if(StringUtils.isBlank(wi.getKeyword())){
 			throw new ExceptionFieldEmpty("keyword");
 		}
-		logger.info("{}搜索全局设计:{}", effectivePerson.getDistinguishedName(), wi);
-		if (ListTools.isEmpty(wi.getModuleList())) {
+		logger.info("{}搜索设计:{}的关键字:{}", effectivePerson.getDistinguishedName(), wi.getModuleList(), wi.getKeyword());
+		if (ListTools.isNotEmpty(wi.getModuleList())) {
 			result.setData(search(wi));
 		}else{
 			lock.lock();
@@ -112,7 +112,7 @@ class ActionSearch extends BaseAction {
 
 	private CompletableFuture<List<WrapDesigner>> searchAsync(final Wi wi, final Map<String, List<WiDesigner.ModuleApp>> moduleMap, final String moduleType, final Class<?> applicationClass, Executor executor){
 		CompletableFuture<List<WrapDesigner>> cf = CompletableFuture.supplyAsync(() -> {
-			List<WrapDesigner> swList = new ArrayList<>();
+			List<WrapDesigner> swList = null;
 			if(moduleMap.containsKey(moduleType)) {
 				try {
 					WiDesigner wiDesigner = new WiDesigner();
@@ -126,7 +126,7 @@ class ActionSearch extends BaseAction {
 				} catch (Exception e) {
 					logger.error(e);
 				}
-				if (swList.size() > 2) {
+				if (swList!=null && swList.size() > 2) {
 					try {
 						SortTools.desc(swList, "designerType","appId");
 					} catch (Exception e) {