Parcourir la source

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!2679
胡起 il y a 5 ans
Parent
commit
da41711afc
30 fichiers modifiés avec 1030 ajouts et 333 suppressions
  1. 11 2
      o2server/pom.xml
  2. 65 0
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/Business.java
  3. 2 1
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/ThisApplication.java
  4. 212 2
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/AttendanceAppealInfoFactory.java
  5. 5 4
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/AttendanceWorkDayConfigFactory.java
  6. 5 1
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attachment/ActionExportDetailWithFilter.java
  7. 7 4
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendanceappealinfo/ActionListNextWithFilter.java
  8. 3 0
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseService.java
  9. 14 0
      o2server/x_attendance_core_entity/src/main/java/com/x/attendance/entity/AttendanceDetail.java
  10. 14 3
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WrapDesigner.java
  11. 76 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/ZipTools.java
  12. 4 2
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ActionSearch.java
  13. 2 2
      o2server/x_console/src/main/java/com/x/server/console/NodeAgent.java
  14. 6 3
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ActionSearch.java
  15. 165 251
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java
  16. 44 0
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGetProcess.java
  17. 138 0
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGetProcessElementList.java
  18. 37 1
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ProcessAction.java
  19. 2 0
      o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/designer/ActionSearch.java
  20. 7 4
      o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/designer/ActionSearch.java
  21. 48 2
      o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/Business.java
  22. 34 17
      o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java
  23. 11 3
      o2web/source/x_component_Attendance/$MyDetail/listItem.json
  24. 10 2
      o2web/source/x_component_Attendance/$PeopleDetail/listItem.json
  25. 10 2
      o2web/source/x_component_Attendance/$TopUnitDetail/listItem.json
  26. 10 2
      o2web/source/x_component_Attendance/$UnitDetail/listItem.json
  27. 7 7
      o2web/source/x_component_Attendance/AppealExplorer.js
  28. 40 5
      o2web/source/x_component_Attendance/MyAppeal.js
  29. 39 3
      o2web/source/x_component_Attendance/MyDetail.js
  30. 2 10
      o2web/source/x_component_Attendance/StatisticsCycle.js

+ 11 - 2
o2server/pom.xml

@@ -294,7 +294,7 @@
 			<groupId>com.squareup</groupId>
 			<groupId>com.squareup</groupId>
 			<artifactId>javapoet</artifactId>
 			<artifactId>javapoet</artifactId>
 		</dependency>
 		</dependency>
-		<!-- dependency> <groupId>javax.visrec</groupId> <artifactId>visrec-api</artifactId> 
+		<!-- dependency> <groupId>javax.visrec</groupId> <artifactId>visrec-api</artifactId>
 			</dependency -->
 			</dependency -->
 		<dependency>
 		<dependency>
 			<groupId>com.github.neuroph</groupId>
 			<groupId>com.github.neuroph</groupId>
@@ -348,6 +348,10 @@
 			<groupId>javax.activation</groupId>
 			<groupId>javax.activation</groupId>
 			<artifactId>activation</artifactId>
 			<artifactId>activation</artifactId>
 		</dependency>
 		</dependency>
+		<dependency>
+			<groupId>net.lingala.zip4j</groupId>
+			<artifactId>zip4j</artifactId>
+		</dependency>
 	</dependencies>
 	</dependencies>
 
 
 	<build>
 	<build>
@@ -785,7 +789,7 @@
 				<artifactId>javapoet</artifactId>
 				<artifactId>javapoet</artifactId>
 				<version>1.11.1</version>
 				<version>1.11.1</version>
 			</dependency>
 			</dependency>
-			<!--dependency> <groupId>javax.visrec</groupId> <artifactId>visrec-api</artifactId> 
+			<!--dependency> <groupId>javax.visrec</groupId> <artifactId>visrec-api</artifactId>
 				<version>20200316</version> </dependency -->
 				<version>20200316</version> </dependency -->
 			<dependency>
 			<dependency>
 				<groupId>com.github.neuroph</groupId>
 				<groupId>com.github.neuroph</groupId>
@@ -1002,6 +1006,11 @@
 				<artifactId>x_workschedu_core_entity</artifactId>
 				<artifactId>x_workschedu_core_entity</artifactId>
 				<version>5.3</version>
 				<version>5.3</version>
 			</dependency>
 			</dependency>
+			<dependency>
+				<groupId>net.lingala.zip4j</groupId>
+				<artifactId>zip4j</artifactId>
+				<version>2.3.2</version>
+			</dependency>
 		</dependencies>
 		</dependencies>
 	</dependencyManagement>
 	</dependencyManagement>
 	<repositories>
 	<repositories>

+ 65 - 0
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/Business.java

@@ -2,7 +2,12 @@ package com.x.attendance.assemble.control;
 
 
 import com.x.attendance.assemble.control.factory.*;
 import com.x.attendance.assemble.control.factory.*;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.project.http.EffectivePerson;
 import com.x.organization.core.express.Organization;
 import com.x.organization.core.express.Organization;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 
 public class Business {
 public class Business {
 
 
@@ -204,4 +209,64 @@ public class Business {
 		}
 		}
 		return attendanceSelfHolidayFactory;
 		return attendanceSelfHolidayFactory;
 	}
 	}
+
+	/**
+	 * TODO 判断用户是否管理员权限 1、person.isManager() 2、xadmin 3、CRMManager
+	 *
+	 * @param request
+	 * @return
+	 * @throws Exception
+	 */
+	public boolean isManager(HttpServletRequest request, EffectivePerson person) throws Exception {
+		// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
+		if (person.isManager()) {
+			return true;
+		}
+		if ("xadmin".equalsIgnoreCase(person.getDistinguishedName())) {
+			return true;
+		}
+		if (isHasPlatformRole(person.getDistinguishedName(), ThisApplication.ROLE_AttendanceManager)) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * TODO 判断用户是否管理员权限 1、person.isManager() 2、xadmin 3、CRMManager
+	 * @return
+	 * @throws Exception
+	 */
+
+	public boolean isManager(EffectivePerson person) throws Exception {
+		// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
+		if (person.isManager()) {
+			return true;
+		}
+		if ("xadmin".equalsIgnoreCase(person.getDistinguishedName())) {
+			return true;
+		}
+		if (isHasPlatformRole(person.getDistinguishedName(), ThisApplication.ROLE_AttendanceManager)) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean isHasPlatformRole(String personName, String roleName) throws Exception {
+		if (StringUtils.isEmpty(personName)) {
+			throw new Exception("personName is null!");
+		}
+		if (StringUtils.isEmpty(roleName)) {
+			throw new Exception("roleName is null!");
+		}
+		List<String> roleList = null;
+		roleList = organization().role().listWithPerson(personName);
+		if (roleList != null && !roleList.isEmpty()) {
+			if (roleList.stream().filter(r -> roleName.equalsIgnoreCase(r)).count() > 0) {
+				return true;
+			}
+		} else {
+			return false;
+		}
+		return false;
+	}
 }
 }

+ 2 - 1
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/ThisApplication.java

@@ -36,6 +36,7 @@ public class ThisApplication {
 
 
 	public static final QueuePersonAttendanceDetailAnalyse detailAnalyseQueue = new QueuePersonAttendanceDetailAnalyse();
 	public static final QueuePersonAttendanceDetailAnalyse detailAnalyseQueue = new QueuePersonAttendanceDetailAnalyse();
 	public static final QueueAttendanceDetailStatistic detailStatisticQueue = new QueueAttendanceDetailStatistic();
 	public static final QueueAttendanceDetailStatistic detailStatisticQueue = new QueueAttendanceDetailStatistic();
+	public static final String ROLE_AttendanceManager = "AttendanceManager@AttendanceManagerSystemRole@R";
 
 
 	public static void init() throws Exception {
 	public static void init() throws Exception {
 		try {
 		try {
@@ -58,7 +59,7 @@ public class ThisApplication {
 				context.schedule(QywxAttendanceSyncScheduleTask.class, "0 0 1 * * ?");
 				context.schedule(QywxAttendanceSyncScheduleTask.class, "0 0 1 * * ?");
 			}
 			}
 			context.schedule(AttendanceStatisticTask.class, "0 0 0/4 * * ?");
 			context.schedule(AttendanceStatisticTask.class, "0 0 0/4 * * ?");
-			context.schedule(MobileRecordAnalyseTask.class, "0 0 * * * ?");
+			//context.schedule(MobileRecordAnalyseTask.class, "0 0 * * * ?");
 			// 每天凌晨1点,计算前一天所有的未签退和未分析的打卡数据
 			// 每天凌晨1点,计算前一天所有的未签退和未分析的打卡数据
 			context.schedule(DetailLastDayRecordAnalyseTask.class, "0 0 1 * * ?");
 			context.schedule(DetailLastDayRecordAnalyseTask.class, "0 0 1 * * ?");
 
 

+ 212 - 2
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/AttendanceAppealInfoFactory.java

@@ -10,6 +10,7 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import javax.persistence.criteria.Root;
 
 
+import com.x.attendance.assemble.control.service.UserManagerService;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 
 
 import com.x.attendance.assemble.control.AbstractFactory;
 import com.x.attendance.assemble.control.AbstractFactory;
@@ -311,8 +312,124 @@ public class AttendanceAppealInfoFactory extends AbstractFactory {
 			query.setParameter(i + 1, vs.get(i));
 			query.setParameter(i + 1, vs.get(i));
 		}
 		}
 		return query.setMaxResults(count).getResultList();
 		return query.setMaxResults(count).getResultList();
-	}	
-	
+	}
+
+	/**
+	 * 查询下一页的信息数据--只查询当前人有权限审批的
+	 * @param id
+	 * @param count
+	 * @param sequence
+	 * @param wrapIn
+	 * @return
+	 * @throws Exception
+	 */
+	@SuppressWarnings("unchecked")
+	public List<AttendanceAppealInfo> listIdsNextWithFilterWithCurrentProcessor( String id, Integer count, Object sequence, WrapInFilterAppeal wrapIn ,Boolean isManager) throws Exception {
+		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
+		EntityManager em = this.entityManagerContainer().get( AttendanceAppealInfo.class );
+		String order = wrapIn.getOrder();//排序方式
+		List<Object> vs = new ArrayList<>();
+		StringBuffer sql_stringBuffer = new StringBuffer();
+		UserManagerService userManagerService = new UserManagerService();
+		if( order == null || order.isEmpty() ){
+			order = "DESC";
+		}
+
+		Integer index = 1;
+		sql_stringBuffer.append( "SELECT o FROM "+AttendanceAppealInfo.class.getCanonicalName()+" o where 1=1" );
+
+		if ((null != sequence) ) {
+			sql_stringBuffer.append(" and o.sequence " + (StringUtils.equalsIgnoreCase(order, "DESC") ? "<" : ">") + (" ?" + (index)));
+			vs.add(sequence);
+			index++;
+		}
+		if ((null != wrapIn.getDetailId()) && (!wrapIn.getDetailId().isEmpty())) {
+			sql_stringBuffer.append(" and o.detailId = ?" + (index));
+			vs.add( wrapIn.getDetailId() );
+			index++;
+		}
+		if ((null != wrapIn.getEmpName()) && (!wrapIn.getEmpName().isEmpty())) {
+			sql_stringBuffer.append(" and o.empName = ?" + (index));
+			vs.add( wrapIn.getEmpName() );
+			index++;
+		}
+		if ((null != wrapIn.getUnitName()) && (!wrapIn.getUnitName().isEmpty())) {
+			sql_stringBuffer.append(" and o.unitName = ?" + (index));
+			vs.add( wrapIn.getUnitName() );
+			index++;
+		}
+		if ((null != wrapIn.getTopUnitName()) && (!wrapIn.getTopUnitName().isEmpty())) {
+			sql_stringBuffer.append(" and o.topUnitName = ?" + (index));
+			vs.add( wrapIn.getTopUnitName() );
+			index++;
+		}
+		if ((null != wrapIn.getYearString() ) && (!wrapIn.getYearString().isEmpty())) {
+			sql_stringBuffer.append(" and o.yearString = ?" + (index));
+			vs.add( wrapIn.getYearString() );
+			index++;
+		}
+		if ((null != wrapIn.getMonthString()) && (!wrapIn.getMonthString().isEmpty())) {
+			sql_stringBuffer.append(" and o.monthString = ?" + (index));
+			vs.add( wrapIn.getMonthString() );
+			index++;
+		}
+		if (wrapIn.getStatus()!=999) {
+			sql_stringBuffer.append(" and o.status = ?" + (index));
+			vs.add( wrapIn.getStatus() );
+			index++;
+		}
+		if ((null != wrapIn.getAppealReason()) && (!wrapIn.getAppealReason().isEmpty())) {
+			sql_stringBuffer.append(" and o.appealReason = ?" + (index));
+			vs.add( wrapIn.getAppealReason() );
+			index++;
+		}
+		if(!isManager){
+			if ((null != wrapIn.getProcessPerson1()) && (!wrapIn.getProcessPerson1().isEmpty())) {
+				sql_stringBuffer.append(" and o.currentProcessor = ?" + (index));
+				vs.add( wrapIn.getProcessPerson1() );
+				index++;
+			}
+		}
+
+//		if ((null != wrapIn.getProcessPerson2()) && (!wrapIn.getProcessPerson2().isEmpty())) {
+//			sql_stringBuffer.append(" and o.processPerson2 = ?" + (index));
+//			vs.add( wrapIn.getProcessPerson2() );
+//			index++;
+//		}
+
+		//添加OR条件
+		if (wrapIn.getOrAtrribute() != null && wrapIn.getOrAtrribute().size() > 0) {
+			sql_stringBuffer.append(" and (");
+			NameValueCountPair nameValueCountPair = null;
+			for (int p = 0; p < wrapIn.getOrAtrribute().size(); p++) {
+				nameValueCountPair = wrapIn.getOrAtrribute().get(p);
+				if (p == 0) {
+					sql_stringBuffer.append(" o." + nameValueCountPair.getName() + " = ?" + (index));
+
+				} else {
+					sql_stringBuffer.append(" or o." + nameValueCountPair.getName() + " = ?" + (index));
+				}
+				vs.add(nameValueCountPair.getValue());
+				index++;
+			}
+			sql_stringBuffer.append(" )");
+		}
+
+		if( StringUtils.isNotEmpty( wrapIn.getKey() )){
+			sql_stringBuffer.append(" order by o."+wrapIn.getKey()+" " + order );
+		}else{
+			sql_stringBuffer.append(" order by o.sequence " + order );
+		}
+
+		Query query = em.createQuery( sql_stringBuffer.toString(), AttendanceAppealInfo.class );
+		//为查询设置所有的参数值
+		for (int i = 0; i < vs.size(); i++) {
+			query.setParameter(i + 1, vs.get(i));
+		}
+		System.out.println("listIdsNextWithFilterWithCurrentProcessor="+query);
+		return query.setMaxResults(count).getResultList();
+	}
+
 	/**
 	/**
 	 * 查询上一页的文档信息数据
 	 * 查询上一页的文档信息数据
 	 * @param id
 	 * @param id
@@ -514,4 +631,97 @@ public class AttendanceAppealInfoFactory extends AbstractFactory {
 		}		
 		}		
 		return (Long) query.getSingleResult();
 		return (Long) query.getSingleResult();
 	}
 	}
+
+	/**
+	 * 查询符合的文档信息总数
+	 * @param wrapIn
+	 * @return
+	 * @throws Exception
+	 */
+	public long getCountWithFilterWithCurrentProcessor( WrapInFilterAppeal wrapIn ,boolean isManager) throws Exception {
+		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
+		EntityManager em = this.entityManagerContainer().get( AttendanceAppealInfo.class );
+		List<Object> vs = new ArrayList<>();
+		StringBuffer sql_stringBuffer = new StringBuffer();
+		Integer index = 1;
+
+		sql_stringBuffer.append( "SELECT count(o.id) FROM "+AttendanceAppealInfo.class.getCanonicalName()+" o where 1=1" );
+
+		if ((null != wrapIn.getDetailId()) && (!wrapIn.getDetailId().isEmpty())) {
+			sql_stringBuffer.append(" and o.detailId = ?" + (index));
+			vs.add( wrapIn.getDetailId() );
+			index++;
+		}
+		if ((null != wrapIn.getEmpName()) && (!wrapIn.getEmpName().isEmpty())) {
+			sql_stringBuffer.append(" and o.empName = ?" + (index));
+			vs.add( wrapIn.getEmpName() );
+			index++;
+		}
+		if ((null != wrapIn.getUnitName()) && (!wrapIn.getUnitName().isEmpty())) {
+			sql_stringBuffer.append(" and o.unitName = ?" + (index));
+			vs.add( wrapIn.getUnitName() );
+			index++;
+		}
+		if ((null != wrapIn.getTopUnitName()) && (!wrapIn.getTopUnitName().isEmpty())) {
+			sql_stringBuffer.append(" and o.topUnitName = ?" + (index));
+			vs.add( wrapIn.getTopUnitName() );
+			index++;
+		}
+		if ((null != wrapIn.getYearString() ) && (!wrapIn.getYearString().isEmpty())) {
+			sql_stringBuffer.append(" and o.yearString = ?" + (index));
+			vs.add( wrapIn.getYearString() );
+			index++;
+		}
+		if ((null != wrapIn.getMonthString()) && (!wrapIn.getMonthString().isEmpty())) {
+			sql_stringBuffer.append(" and o.monthString = ?" + (index));
+			vs.add( wrapIn.getMonthString() );
+			index++;
+		}
+		if (wrapIn.getStatus()!=999) {
+			sql_stringBuffer.append(" and o.status = ?" + (index));
+			vs.add( wrapIn.getStatus() );
+			index++;
+		}
+		if ((null != wrapIn.getAppealReason()) && (!wrapIn.getAppealReason().isEmpty())) {
+			sql_stringBuffer.append(" and o.appealReason = ?" + (index));
+			vs.add( wrapIn.getAppealReason() );
+			index++;
+		}
+		if(!isManager){
+			if ((null != wrapIn.getProcessPerson1()) && (!wrapIn.getProcessPerson1().isEmpty())) {
+				sql_stringBuffer.append(" and o.currentProcessor = ?" + (index));
+				vs.add( wrapIn.getProcessPerson1() );
+				index++;
+			}
+		}
+//		if ((null != wrapIn.getProcessPerson2()) && (!wrapIn.getProcessPerson2().isEmpty())) {
+//			sql_stringBuffer.append(" and o.processPerson2 = ?" + (index));
+//			vs.add( wrapIn.getProcessPerson2() );
+//			index++;
+//		}
+		//添加OR
+		if (wrapIn.getOrAtrribute() != null && wrapIn.getOrAtrribute().size() > 0) {
+			sql_stringBuffer.append(" and (");
+			NameValueCountPair nameValueCountPair = null;
+			for (int p = 0; p < wrapIn.getOrAtrribute().size(); p++) {
+				nameValueCountPair = wrapIn.getOrAtrribute().get(p);
+				if (p == 0) {
+					sql_stringBuffer.append(" o." + nameValueCountPair.getName() + " = ?" + (index));
+
+				} else {
+					sql_stringBuffer.append(" or o." + nameValueCountPair.getName() + " = ?" + (index));
+				}
+				vs.add(nameValueCountPair.getValue());
+				index++;
+			}
+			sql_stringBuffer.append(" )");
+		}
+
+		Query query = em.createQuery( sql_stringBuffer.toString(), AttendanceAppealInfo.class );
+		//为查询设置所有的参数值
+		for (int i = 0; i < vs.size(); i++) {
+			query.setParameter(i + 1, vs.get(i));
+		}
+		return (Long) query.getSingleResult();
+	}
 }
 }

+ 5 - 4
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/AttendanceWorkDayConfigFactory.java

@@ -1,8 +1,6 @@
 package com.x.attendance.assemble.control.factory;
 package com.x.attendance.assemble.control.factory;
 
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManager;
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaBuilder;
@@ -177,7 +175,10 @@ public class AttendanceWorkDayConfigFactory extends AbstractFactory {
 		boolean isHoliday = true;
 		boolean isHoliday = true;
 		int workDaysCountForMonth = 0;
 		int workDaysCountForMonth = 0;
 		if( endDate.getTime() > new Date().getTime()){
 		if( endDate.getTime() > new Date().getTime()){
-			endDate = new Date();
+			Calendar calendar = new GregorianCalendar();
+			calendar.setTime(new Date());
+			calendar.add(calendar.DATE,-1);
+			endDate = calendar.getTime();
 		}
 		}
 		List<String> dateStringList = dateOperation.listDateStringBetweenDate(startDate, endDate);
 		List<String> dateStringList = dateOperation.listDateStringBetweenDate(startDate, endDate);
 		if( dateStringList != null && dateStringList.size() > 0 ){
 		if( dateStringList != null && dateStringList.size() > 0 ){

+ 5 - 1
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attachment/ActionExportDetailWithFilter.java

@@ -235,7 +235,11 @@ public class ActionExportDetailWithFilter extends BaseAction {
 				row.createCell(8).setCellValue(attendanceDetail.getOffDutyTime());
 				row.createCell(8).setCellValue(attendanceDetail.getOffDutyTime());
 
 
 				if(attendanceDetail.getIsGetSelfHolidays()){
 				if(attendanceDetail.getIsGetSelfHolidays()){
-					row.createCell(9).setCellValue("请假或外出报备");
+					if(StringUtils.isNotEmpty(attendanceDetail.getLeaveType())){
+						row.createCell(9).setCellValue(attendanceDetail.getLeaveType());
+					}else{
+						row.createCell(9).setCellValue("请假或外出报备");
+					}
 				}else if (attendanceDetail.getIsAbsent()) {
 				}else if (attendanceDetail.getIsAbsent()) {
 					row.createCell(9).setCellValue("缺勤");
 					row.createCell(9).setCellValue("缺勤");
 				} else if (attendanceDetail.getIsLackOfTime()) {
 				} else if (attendanceDetail.getIsLackOfTime()) {

+ 7 - 4
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/jaxrs/attendanceappealinfo/ActionListNextWithFilter.java

@@ -37,6 +37,7 @@ public class ActionListNextWithFilter extends BaseAction {
 		List<AttendanceAppealInfo> detailList = null;
 		List<AttendanceAppealInfo> detailList = null;
 		WrapInFilterAppeal wrapIn = null;
 		WrapInFilterAppeal wrapIn = null;
 		Boolean check = true;
 		Boolean check = true;
+		Boolean isManager = false;
 
 
 		try {
 		try {
 			wrapIn = this.convertToWrapIn(jsonElement, WrapInFilterAppeal.class);
 			wrapIn = this.convertToWrapIn(jsonElement, WrapInFilterAppeal.class);
@@ -60,11 +61,13 @@ public class ActionListNextWithFilter extends BaseAction {
 						sequence = PropertyUtils.getProperty(emc.find(id, AttendanceAppealInfo.class),  JpaObject.sequence_FIELDNAME);
 						sequence = PropertyUtils.getProperty(emc.find(id, AttendanceAppealInfo.class),  JpaObject.sequence_FIELDNAME);
 					}
 					}
 				}
 				}
-				// 从数据库中查询符合条件的一页数据对象
-				detailList = business.getAttendanceAppealInfoFactory().listIdsNextWithFilter(id, count, sequence,
-						wrapIn);
+
+				isManager = business.isManager(effectivePerson);
+				// 从数据库中查询符合条件的一页数据对象(根据当前审批人查询)
+				detailList = business.getAttendanceAppealInfoFactory().listIdsNextWithFilterWithCurrentProcessor(id, count, sequence,
+						wrapIn,isManager);
 				// 从数据库中查询符合条件的对象总数
 				// 从数据库中查询符合条件的对象总数
-				total = business.getAttendanceAppealInfoFactory().getCountWithFilter(wrapIn);
+				total = business.getAttendanceAppealInfoFactory().getCountWithFilterWithCurrentProcessor(wrapIn,isManager);
 				// 将所有查询出来的有状态的对象转换为可以输出的过滤过属性的对象
 				// 将所有查询出来的有状态的对象转换为可以输出的过滤过属性的对象
 				wraps = Wo.copier.copy(detailList);
 				wraps = Wo.copier.copy(detailList);
 
 

+ 3 - 0
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceDetailAnalyseService.java

@@ -476,6 +476,7 @@ public class AttendanceDetailAnalyseService {
 							logger.debug( debugger, detail.getEmpName()+"全天请假了");
 							logger.debug( debugger, detail.getEmpName()+"全天请假了");
 							//全天休假
 							//全天休假
 							detail.setIsGetSelfHolidays(true);
 							detail.setIsGetSelfHolidays(true);
+							detail.setLeaveType(selfHoliday.getLeaveType());
 							detail.setSelfHolidayDayTime("全天");
 							detail.setSelfHolidayDayTime("全天");
 							detail.setGetSelfHolidayDays(1.0);
 							detail.setGetSelfHolidayDays(1.0);
 						}else if( selfHoliday.getEndTime().getTime() <= dayMiddle.getTime() && selfHoliday.getEndTime().getTime() > dayWorkStart.getTime()
 						}else if( selfHoliday.getEndTime().getTime() <= dayMiddle.getTime() && selfHoliday.getEndTime().getTime() > dayWorkStart.getTime()
@@ -483,6 +484,7 @@ public class AttendanceDetailAnalyseService {
 							//上午休假
 							//上午休假
 							logger.debug( debugger, detail.getEmpName()+"上午休假了");
 							logger.debug( debugger, detail.getEmpName()+"上午休假了");
 							detail.setIsGetSelfHolidays(true);
 							detail.setIsGetSelfHolidays(true);
+							detail.setLeaveType(selfHoliday.getLeaveType());
 							detail.setSelfHolidayDayTime("上午");
 							detail.setSelfHolidayDayTime("上午");
 							detail.setGetSelfHolidayDays(0.5);
 							detail.setGetSelfHolidayDays(0.5);
 						}else if( selfHoliday.getStartTime().getTime() >= dayMiddle.getTime() && selfHoliday.getStartTime().getTime() <= dayWorkEnd.getTime()
 						}else if( selfHoliday.getStartTime().getTime() >= dayMiddle.getTime() && selfHoliday.getStartTime().getTime() <= dayWorkEnd.getTime()
@@ -490,6 +492,7 @@ public class AttendanceDetailAnalyseService {
 							//上午休假
 							//上午休假
 							logger.debug( debugger, detail.getEmpName()+"下午休假了");
 							logger.debug( debugger, detail.getEmpName()+"下午休假了");
 							detail.setIsGetSelfHolidays( true );
 							detail.setIsGetSelfHolidays( true );
+							detail.setLeaveType(selfHoliday.getLeaveType());
 							detail.setSelfHolidayDayTime("下午");
 							detail.setSelfHolidayDayTime("下午");
 							detail.setGetSelfHolidayDays(0.5);
 							detail.setGetSelfHolidayDays(0.5);
 						}
 						}

+ 14 - 0
o2server/x_attendance_core_entity/src/main/java/com/x/attendance/entity/AttendanceDetail.java

@@ -294,6 +294,12 @@ public class AttendanceDetail extends SliceJpaObject {
 	@CheckPersist(allowEmpty = false)
 	@CheckPersist(allowEmpty = false)
 	private Boolean isGetSelfHolidays = false;
 	private Boolean isGetSelfHolidays = false;
 
 
+	public static final String leaveType_FIELDNAME = "leaveType";
+	@FieldDescribe("休假类型")
+	@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + leaveType_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String leaveType;
+
 	public static final String isAbsent_FIELDNAME = "isAbsent";
 	public static final String isAbsent_FIELDNAME = "isAbsent";
 	@FieldDescribe("是否缺勤")
 	@FieldDescribe("是否缺勤")
 	@Column(name = ColumnNamePrefix + isAbsent_FIELDNAME)
 	@Column(name = ColumnNamePrefix + isAbsent_FIELDNAME)
@@ -886,6 +892,14 @@ public class AttendanceDetail extends SliceJpaObject {
 		this.isGetSelfHolidays = isGetSelfHolidays;
 		this.isGetSelfHolidays = isGetSelfHolidays;
 	}
 	}
 
 
+	public String getLeaveType() {
+		return leaveType;
+	}
+
+	public void setLeaveType(String leaveType) {
+		this.leaveType = leaveType;
+	}
+
 	/**
 	/**
 	 * 获取休假时段:无,上午,下午,全天(String)
 	 * 获取休假时段:无,上午,下午,全天(String)
 	 * 
 	 * 

+ 14 - 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) {
 	public void setPatternList(Map<String, String> map) {
 		if(map!=null && !map.isEmpty()){
 		if(map!=null && !map.isEmpty()){
-			List<DesignerPattern> patternList = new ArrayList<>();
 			for (String key : map.keySet()){
 			for (String key : map.keySet()){
 				DesignerPattern pattern = new DesignerPattern();
 				DesignerPattern pattern = new DesignerPattern();
 				pattern.setProperty(key);
 				pattern.setProperty(key);
@@ -97,9 +96,10 @@ public class WrapDesigner extends GsonPropertyObject {
 					}
 					}
 				}
 				}
 				pattern.setPropertyValue(propertyValue);
 				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);
 				pattern.setPropertyValue(propertyValue);
 				this.patternList.add(pattern);
 				this.patternList.add(pattern);
 			}
 			}
+			map.clear();
+			map = null;
 		}
 		}
 	}
 	}
 
 
@@ -138,6 +140,14 @@ public class WrapDesigner extends GsonPropertyObject {
 				pattern.setPropertyValue(propertyValue);
 				pattern.setPropertyValue(propertyValue);
 				this.patternList.add(pattern);
 				this.patternList.add(pattern);
 			}
 			}
+			map.clear();
+			map = null;
+		}else{
+			DesignerPattern pattern = new DesignerPattern();
+			pattern.setElementType(elementType);
+			pattern.setElementId(elementId);
+			pattern.setElementName(elementName);
+			this.patternList.add(pattern);
 		}
 		}
 	}
 	}
 
 
@@ -190,6 +200,7 @@ public class WrapDesigner extends GsonPropertyObject {
 				}
 				}
 				this.lines = lines;
 				this.lines = lines;
 				map.clear();
 				map.clear();
+				map = null;
 			}
 			}
 		}
 		}
 
 

+ 76 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/ZipTools.java

@@ -0,0 +1,76 @@
+package com.x.base.core.project.tools;
+
+import net.lingala.zip4j.ZipFile;
+import net.lingala.zip4j.model.ExtraDataRecord;
+import net.lingala.zip4j.model.FileHeader;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.util.List;
+
+public class ZipTools {
+    public static void unZip(File source, List<String> subs, File dist, boolean asNew, Charset charset) {
+        try{
+            ZipFile zipFile = new ZipFile(source);
+            if(charset == null){
+                charset = DefaultCharset.charset;
+            }
+            zipFile.setCharset(charset);
+            List<FileHeader> fileHeaderList = zipFile.getFileHeaders();
+            for (FileHeader fileHeader : fileHeaderList){
+                if(isFromExtraData(fileHeader) && DefaultCharset.charset.name() == charset.name()){
+                    unZip(source, subs, dist, asNew, DefaultCharset.charset_gbk);
+                    return;
+                }
+                String name = fileHeader.getFileName();
+                //System.out.println(name);
+                if (name.length() < 2) {
+                    continue;
+                }
+                if (subs != null) {
+                    boolean flag = false;
+                    for (String sub : subs) {
+                        if (StringUtils.startsWith(name, sub)) {
+                            flag = true;
+                            break;
+                        }
+                    }
+                    if (flag) {
+                        continue;
+                    }
+                }
+                if (fileHeader.isDirectory()) {
+                    File dir = new File(dist, name);
+                    if (dir.exists() && name.indexOf("/") == name.lastIndexOf("/") && asNew) {
+                        FileUtils.cleanDirectory(dir);
+                    }
+                    FileUtils.forceMkdir(dir);
+                } else {
+                    zipFile.extractFile(fileHeader, dist.getAbsolutePath());
+                }
+            }
+            fileHeaderList.clear();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+    public static boolean isFromExtraData(FileHeader fileHeader) {
+        if(fileHeader.getExtraDataRecords()!=null){
+            for (ExtraDataRecord extraDataRecord : fileHeader.getExtraDataRecords()) {
+                long identifier = extraDataRecord.getHeader();
+                if (identifier == 0x7075) {
+                    byte[] bytes = extraDataRecord.getData();
+                    ByteBuffer buffer = ByteBuffer.wrap(bytes);
+                    byte version = buffer.get();
+                    assert (version == 1);
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+}

+ 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());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						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){
 						if(appInfo != null){
 							wo.setAppId(appInfo.getId());
 							wo.setAppId(appInfo.getId());
 							wo.setAppName(appInfo.getAppName());
 							wo.setAppName(appInfo.getAppName());
@@ -102,6 +102,7 @@ class ActionSearch extends BaseAction {
 					}
 					}
 				}
 				}
 				woScripts.clear();
 				woScripts.clear();
+				woScripts = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(e);
 				logger.error(e);
 			}
 			}
@@ -126,7 +127,7 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
 							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){
 							if(appInfo != null){
 								wo.setAppId(appInfo.getId());
 								wo.setAppId(appInfo.getId());
 								wo.setAppName(appInfo.getAppName());
 								wo.setAppName(appInfo.getAppName());
@@ -140,6 +141,7 @@ class ActionSearch extends BaseAction {
 						}
 						}
 					}
 					}
 					woForms.clear();
 					woForms.clear();
+					woForms = null;
 				}
 				}
 
 
 			}catch (Exception e){
 			}catch (Exception e){

+ 2 - 2
o2server/x_console/src/main/java/com/x/server/console/NodeAgent.java

@@ -378,7 +378,7 @@ public class NodeAgent extends Thread {
 						FileTools.forceMkdir(dist);
 						FileTools.forceMkdir(dist);
 					}
 					}
 					List<String> subs = new ArrayList<>();
 					List<String> subs = new ArrayList<>();
-					JarTools.unjar(zipFile, subs, dist, asNew);
+					ZipTools.unZip(zipFile, subs, dist, asNew, null);
 
 
 					FileUtils.cleanDirectory(tempFile);
 					FileUtils.cleanDirectory(tempFile);
 					logger.print("upload resource {} success!", fileName);
 					logger.print("upload resource {} success!", fileName);
@@ -655,7 +655,7 @@ public class NodeAgent extends Thread {
 		FileUtils.writeByteArrayToFile(zipFile, bytes);
 		FileUtils.writeByteArrayToFile(zipFile, bytes);
 		File dist = Config.dir_custom(true);
 		File dist = Config.dir_custom(true);
 		List<String> subs = new ArrayList<>();
 		List<String> subs = new ArrayList<>();
-		JarTools.unjar(zipFile, subs, dist, false);
+		ZipTools.unZip(zipFile, subs, dist, false, null);
 
 
 		FileUtils.cleanDirectory(tempFile);
 		FileUtils.cleanDirectory(tempFile);
 
 

+ 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());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						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){
 						if(portal != null){
 							wo.setAppId(portal.getId());
 							wo.setAppId(portal.getId());
 							wo.setAppName(portal.getName());
 							wo.setAppName(portal.getName());
@@ -105,6 +105,7 @@ class ActionSearch extends BaseAction {
 					}
 					}
 				}
 				}
 				woScripts.clear();
 				woScripts.clear();
+				woScripts = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(e);
 				logger.error(e);
 			}
 			}
@@ -129,7 +130,7 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
 							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){
 							if(portal != null){
 								wo.setAppId(portal.getId());
 								wo.setAppId(portal.getId());
 								wo.setAppName(portal.getName());
 								wo.setAppName(portal.getName());
@@ -143,6 +144,7 @@ class ActionSearch extends BaseAction {
 						}
 						}
 					}
 					}
 					wos.clear();
 					wos.clear();
+					wos = null;
 				}
 				}
 
 
 			}catch (Exception e){
 			}catch (Exception e){
@@ -169,7 +171,7 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
 							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){
 							if(portal != null){
 								wo.setAppId(portal.getId());
 								wo.setAppId(portal.getId());
 								wo.setAppName(portal.getName());
 								wo.setAppName(portal.getName());
@@ -183,6 +185,7 @@ class ActionSearch extends BaseAction {
 						}
 						}
 					}
 					}
 					wos.clear();
 					wos.clear();
+					wos = null;
 				}
 				}
 
 
 			}catch (Exception e){
 			}catch (Exception e){

+ 165 - 251
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 org.apache.commons.lang3.StringUtils;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.concurrent.*;
 import java.util.concurrent.*;
@@ -32,7 +33,7 @@ import java.util.concurrent.*;
 class ActionSearch extends BaseAction {
 class ActionSearch extends BaseAction {
 
 
 	private static Logger logger = LoggerFactory.getLogger(ActionSearch.class);
 	private static Logger logger = LoggerFactory.getLogger(ActionSearch.class);
-	private final static String DESIGN_PROCESS_ACTIVITY = "activity";
+	private final static String DESIGN_PROCESS_ROUTE = "route";
 
 
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
 		if(!effectivePerson.isManager()){
 		if(!effectivePerson.isManager()){
@@ -91,7 +92,8 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						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) {
 						if (app != null) {
 							wo.setAppId(app.getId());
 							wo.setAppId(app.getId());
 							wo.setAppName(app.getName());
 							wo.setAppName(app.getName());
@@ -105,6 +107,7 @@ class ActionSearch extends BaseAction {
 					}
 					}
 				}
 				}
 				woScripts.clear();
 				woScripts.clear();
+				woScripts = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(e);
 				logger.error(e);
 			}
 			}
@@ -129,7 +132,8 @@ class ActionSearch extends BaseAction {
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
 							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) {
 							if (app != null) {
 								wo.setAppId(app.getId());
 								wo.setAppId(app.getId());
 								wo.setAppName(app.getName());
 								wo.setAppName(app.getName());
@@ -143,6 +147,7 @@ class ActionSearch extends BaseAction {
 						}
 						}
 					}
 					}
 					woForms.clear();
 					woForms.clear();
+					woForms = null;
 				}
 				}
 
 
 			}catch (Exception e){
 			}catch (Exception e){
@@ -184,6 +189,7 @@ class ActionSearch extends BaseAction {
 						}
 						}
 					}
 					}
 					processList.clear();
 					processList.clear();
+					processList = null;
 				}catch (Exception e){
 				}catch (Exception e){
 					logger.error(e);
 					logger.error(e);
 				}
 				}
@@ -205,313 +211,221 @@ class ActionSearch extends BaseAction {
 
 
 	private Wo doProcessSearch(Business business, Process process, Wi wi) throws Exception {
 	private Wo doProcessSearch(Business business, Process process, Wi wi) throws Exception {
 		Wo wo = null;
 		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);
-			}
-			wo.addPatternList(DesignerType.process.toString(), pmap);
-		}
-
-		if(!wrap.getAgentList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getAgentList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
-				}
-			}
-		}
 
 
-		if(wrap.getBegin() != null && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getBegin()), 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(),
+		if(StringTools.matchKeyword(wi.getKeyword(), XGsonBuilder.toJson(process), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+			Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapProcess.outCopier.getCopyFields(), process, wi.getKeyword(),
 					wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 			if (!map.isEmpty()) {
 			if (!map.isEmpty()) {
 				if(wo == null){
 				if(wo == null){
 					wo = this.getProcessWo(business, process);
 					wo = this.getProcessWo(business, process);
 				}
 				}
-				wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				wo.addPatternList(DesignerType.process.toString(), map);
 			}
 			}
 		}
 		}
 
 
-		if(!wrap.getCancelList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getCancelList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		List<Agent> agentList = business.entityManagerContainer().list(Agent.class,
+				business.agent().listWithProcess(process.getId()));
+		for (Agent active : agentList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.agent.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
+		agentList.clear();
+		agentList = null;
 
 
-		if(!wrap.getChoiceList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getChoiceList()), 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){
 			if(wo == null){
 				wo = this.getProcessWo(business, process);
 				wo = this.getProcessWo(business, process);
 			}
 			}
-			for (WrapChoice active : wrap.getChoiceList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapChoice.outCopier.getCopyFields(), active, wi.getKeyword(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
-				}
-			}
+			wo.addPatternList(ActivityType.begin.toString(), begin.getId(), begin.getName(), null);
 		}
 		}
 
 
-		if(!wrap.getDelayList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getDelayList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		List<Cancel> cancelList =  business.entityManagerContainer().list(Cancel.class,
+				business.cancel().listWithProcess(process.getId()));
+		for (Cancel active : cancelList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.cancel.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getEmbedList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getEmbedList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		cancelList.clear();
+		cancelList = null;
+
+		List<Choice> choiceList =  business.entityManagerContainer().list(Choice.class,
+				business.choice().listWithProcess(process.getId()));
+		for (Choice active : choiceList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.choice.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getEndList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getEndList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		choiceList.clear();
+		choiceList = null;
+
+		List<Delay> delayList =  business.entityManagerContainer().list(Delay.class,
+				business.delay().listWithProcess(process.getId()));
+		for (Delay active : delayList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.delay.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getInvokeList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getInvokeList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		delayList.clear();
+		delayList = null;
+
+		List<Embed> embedList = business.entityManagerContainer().list(Embed.class,
+				business.embed().listWithProcess(process.getId()));
+		for (Embed active : embedList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.embed.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getManualList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getManualList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		embedList.clear();
+		embedList = null;
+
+		List<End> endList = business.entityManagerContainer().list(End.class, business.end().listWithProcess(process.getId()));
+		for (End active : endList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.end.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getMergeList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getMergeList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		endList.clear();
+		endList = null;
+
+		List<Invoke> invokeList = business.entityManagerContainer().list(Invoke.class, business.invoke().listWithProcess(process.getId()));
+		for (Invoke active : invokeList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.invoke.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getMessageList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getMessageList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		invokeList.clear();
+		invokeList = null;
+
+		List<Manual> manualList = business.entityManagerContainer().list(Manual.class, business.manual().listWithProcess(process.getId()));
+		for (Manual active : manualList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.manual.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getParallelList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getParallelList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		manualList.clear();
+		manualList = null;
+
+		List<Merge> mergeList = business.entityManagerContainer().list(Merge.class, business.merge().listWithProcess(process.getId()));
+		for (Merge active : mergeList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.merge.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getServiceList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getServiceList()), 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(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		mergeList.clear();
+		mergeList = null;
+
+		List<Message> messageList = business.entityManagerContainer().list(Message.class, business.message().listWithProcess(process.getId()));
+		for (Message active : messageList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.message.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getSplitList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getSplitList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
-			if(wo == null){
-				wo = this.getProcessWo(business, process);
+		messageList.clear();
+		messageList = null;
+
+		List<Parallel> parallelList = business.entityManagerContainer().list(Parallel.class, business.parallel().listWithProcess(process.getId()));
+		for (Parallel active : parallelList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
+				}
+				wo.addPatternList(ActivityType.parallel.toString(), active.getId(), active.getName(), null);
 			}
 			}
-			for (WrapSplit active : wrap.getSplitList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapSplit.outCopier.getCopyFields(), active, wi.getKeyword(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		}
+		parallelList.clear();
+		parallelList = null;
+
+		List<Service> serviceList = business.entityManagerContainer().list(Service.class, business.service().listWithProcess(process.getId()));
+		for (Service active : serviceList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(ActivityType.service.toString(), active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
-
-		if(!wrap.getRouteList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
-				XGsonBuilder.toJson(wrap.getRouteList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
-			if(wo == null){
-				wo = this.getProcessWo(business, process);
+		serviceList.clear();
+		serviceList = null;
+
+		List<Split> splitList = business.entityManagerContainer().list(Split.class, business.split().listWithProcess(process.getId()));
+		for (Split active : splitList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
+				}
+				wo.addPatternList(ActivityType.split.toString(), active.getId(), active.getName(), null);
 			}
 			}
-			for (WrapRoute active : wrap.getRouteList()){
-				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapRoute.outCopier.getCopyFields(), active, wi.getKeyword(),
-						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-				if (!map.isEmpty()) {
-					if(wo == null){
-						wo = this.getProcessWo(business, process);
-					}
-					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+		}
+		splitList.clear();
+		splitList = null;
+
+		List<Route> routeList = business.entityManagerContainer().list(Route.class, business.route().listWithProcess(process.getId()));
+		for (Route active : routeList){
+			if(StringTools.matchKeyword(wi.getKeyword(),
+					XGsonBuilder.toJson(active), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+				if (wo == null) {
+					wo = this.getProcessWo(business, process);
 				}
 				}
+				wo.addPatternList(DESIGN_PROCESS_ROUTE, active.getId(), active.getName(), null);
 			}
 			}
 		}
 		}
+		routeList.clear();
+		routeList = null;
 
 
-		wrap.getManualList().clear();
 		return wo;
 		return wo;
 	}
 	}
 
 
 	private Wo getProcessWo(Business business, Process process) throws Exception {
 	private Wo getProcessWo(Business business, Process process) throws Exception {
 		Wo wo = new Wo();
 		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) {
 		if (app != null) {
 			wo.setAppId(app.getId());
 			wo.setAppId(app.getId());
 			wo.setAppName(app.getName());
 			wo.setAppName(app.getName());

+ 44 - 0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGetProcess.java

@@ -0,0 +1,44 @@
+package com.x.processplatform.assemble.designer.jaxrs.process;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.entity.JpaObject;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.processplatform.assemble.designer.Business;
+import com.x.processplatform.core.entity.element.Process;
+import com.x.processplatform.core.entity.element.*;
+
+class ActionGetProcess extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			Business business = new Business(emc);
+			Process process = emc.fetch(id, Process.class);
+			if (null == process) {
+				throw new ExceptionProcessNotExisted(id);
+			}
+			Application application = emc.find(process.getApplication(), Application.class);
+			if (null == application) {
+				throw new ExceptionApplicationNotExist(process.getApplication());
+			}
+			if (!business.editable(effectivePerson, application)) {
+				throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(),
+						application.getName(), application.getId());
+			}
+			result.setData(Wo.outCopier.copy(process));
+			return result;
+		}
+	}
+
+	public static class Wo extends Process {
+
+		private static final long serialVersionUID = 1683913161529174561L;
+
+		public static WrapCopier<Process, Wo> outCopier = WrapCopierFactory.wo(Process.class, Wo.class,
+				null, JpaObject.FieldsInvisible);
+	}
+}

+ 138 - 0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGetProcessElementList.java

@@ -0,0 +1,138 @@
+package com.x.processplatform.assemble.designer.jaxrs.process;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.annotation.FieldDescribe;
+import com.x.base.core.project.annotation.FieldTypeDescribe;
+import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.tools.ListTools;
+import com.x.processplatform.assemble.designer.Business;
+import com.x.processplatform.core.entity.element.*;
+import com.x.processplatform.core.entity.element.Process;
+
+import java.util.*;
+
+class ActionGetProcessElementList extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionGetProcessElementList.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Process process = emc.fetch(id, Process.class, ListTools.toList(Process.application_FIELDNAME));
+			if (null == process) {
+				throw new ExceptionProcessNotExisted(id);
+			}
+			Application application = emc.find(process.getApplication(), Application.class);
+			if (null == application) {
+				throw new ExceptionApplicationNotExist(process.getApplication());
+			}
+			if (!business.editable(effectivePerson, application)) {
+				throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(),
+						application.getName(), application.getId());
+			}
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+			final Map<String, Set<String>> map = new HashMap<>();
+			if(ListTools.isNotEmpty(wi.getElementWiList())){
+				wi.getElementWiList().stream().forEach(elementWi -> {
+					if (map.containsKey(elementWi.getElementType())){
+						map.get(elementWi.getElementType()).add(elementWi.getElementId());
+					}else{
+						Set<String> set = new HashSet<>();
+						set.add(elementWi.getElementId());
+						map.put(elementWi.getElementType(), set);
+					}
+				});
+			}
+			//logger.print("查询的元素信息:{}", map);
+			Wo wo = new Wo();
+			for (String key : map.keySet()){
+				if("route".equals(key)){
+					List<Route> routeList = emc.listEqualAndIn(Route.class, Route.process_FIELDNAME, id,Route.id_FIELDNAME, map.get(key));
+					wo.setRouteList(routeList);
+				}else{
+					List<Activity> list = (List<Activity>)emc.listEqualAndIn(ActivityType.getClassOfActivityType(ActivityType.valueOf(key)),
+							Route.process_FIELDNAME, id, Activity.id_FIELDNAME, map.get(key));
+					if(wo.getActivityList()==null){
+						wo.setActivityList(list);
+					}else{
+						wo.getActivityList().addAll(list);
+					}
+				}
+			}
+
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wo extends GsonPropertyObject {
+
+		@FieldDescribe("节点信息.")
+		private List<Activity> activityList;
+
+		@FieldDescribe("路由信息.")
+		private List<Route> routeList;
+
+		public List<Activity> getActivityList() {
+			return activityList;
+		}
+
+		public void setActivityList(List<Activity> activityList) {
+			this.activityList = activityList;
+		}
+
+		public List<Route> getRouteList() {
+			return routeList;
+		}
+
+		public void setRouteList(List<Route> routeList) {
+			this.routeList = routeList;
+		}
+	}
+
+	public static class Wi extends GsonPropertyObject {
+
+		@FieldDescribe("查询元素列表(元素类型:route|begin|agent|...)")
+		@FieldTypeDescribe(fieldType = "class", fieldTypeName = "ElementWi", fieldValue = "{\"elementType\": \"元素类型\", \"elementId\": \"元素ID\"}")
+		private List<ElementWi> elementWiList;
+
+		public List<ElementWi> getElementWiList() {
+			return elementWiList;
+		}
+
+		public void setElementWiList(List<ElementWi> elementWiList) {
+			this.elementWiList = elementWiList;
+		}
+	}
+
+	public static class ElementWi extends GsonPropertyObject {
+
+		@FieldDescribe("元素类型(route|begin|agent|...).")
+		private String elementType;
+		@FieldDescribe("元素ID.")
+		private String elementId;
+
+		public String getElementType() {
+			return elementType;
+		}
+
+		public void setElementType(String elementType) {
+			this.elementType = elementType;
+		}
+
+		public String getElementId() {
+			return elementId;
+		}
+
+		public void setElementId(String elementId) {
+			this.elementId = elementId;
+		}
+	}
+}

+ 37 - 1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ProcessAction.java

@@ -305,4 +305,40 @@ public class ProcessAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 	}
 
 
-}
+	@JaxrsMethodDescribe(value = "仅获取流程内容,不包含节点和路由信息", action = ActionGetProcess.class)
+	@GET
+	@Path("{id}/process")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void getProcess(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+					@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
+		ActionResult<ActionGetProcess.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGetProcess().execute(effectivePerson, id);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "查询流程的指定节点或路由信息.", action = ActionGetProcessElementList.class)
+	@POST
+	@Path("{id}/list/element")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void getProcessElementList(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+								  @JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement jsonElement) {
+		ActionResult<ActionGetProcessElementList.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGetProcessElementList().execute(effectivePerson, id, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, jsonElement);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+}

+ 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.clear();
+				woAgents = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(e);
 				logger.error(e);
 			}
 			}
@@ -127,6 +128,7 @@ class ActionSearch extends BaseAction {
 					}
 					}
 				}
 				}
 				woInvokes.clear();
 				woInvokes.clear();
+				woInvokes = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(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());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						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) {
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
 							wo.setAppName(query.getName());
@@ -135,7 +135,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						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) {
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
 							wo.setAppName(query.getName());
@@ -149,6 +149,7 @@ class ActionSearch extends BaseAction {
 					}
 					}
 				}
 				}
 				woTables.clear();
 				woTables.clear();
+				woTables = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(e);
 				logger.error(e);
 			}
 			}
@@ -174,7 +175,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						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) {
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
 							wo.setAppName(query.getName());
@@ -188,6 +189,7 @@ class ActionSearch extends BaseAction {
 					}
 					}
 				}
 				}
 				woStats.clear();
 				woStats.clear();
+				woStats = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(e);
 				logger.error(e);
 			}
 			}
@@ -213,7 +215,7 @@ class ActionSearch extends BaseAction {
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						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) {
 						if (query != null) {
 							wo.setAppId(query.getId());
 							wo.setAppId(query.getId());
 							wo.setAppName(query.getName());
 							wo.setAppName(query.getName());
@@ -227,6 +229,7 @@ class ActionSearch extends BaseAction {
 					}
 					}
 				}
 				}
 				woStatements.clear();
 				woStatements.clear();
+				woStatements = null;
 			}catch (Exception e){
 			}catch (Exception e){
 				logger.error(e);
 				logger.error(e);
 			}
 			}

+ 48 - 2
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/Business.java

@@ -24,6 +24,8 @@ public class Business {
 
 
 	private EntityManagerContainer emc;
 	private EntityManagerContainer emc;
 
 
+	public Business(){}
+
 	public Business(EntityManagerContainer emc) throws Exception {
 	public Business(EntityManagerContainer emc) throws Exception {
 		this.emc = emc;
 		this.emc = emc;
 	}
 	}
@@ -54,11 +56,55 @@ public class Business {
 		if (effectivePerson.isManager()) {
 		if (effectivePerson.isManager()) {
 			return true;
 			return true;
 		}
 		}
-		if (this.organization.person().hasRole(effectivePerson, OrganizationDefinition.QueryManager,
+		if (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.QueryManager,
+				OrganizationDefinition.Manager)) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean isProcessManager(EffectivePerson effectivePerson) throws Exception {
+		if (effectivePerson.isManager()) {
+			return true;
+		}
+		if (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.ProcessPlatformManager,
+				OrganizationDefinition.Manager)) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean isServiceManager(EffectivePerson effectivePerson) throws Exception {
+		if (effectivePerson.isManager()) {
+			return true;
+		}
+		if (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.ServiceManager,
+				OrganizationDefinition.Manager)) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean isCmsManager(EffectivePerson effectivePerson) throws Exception {
+		if (effectivePerson.isManager()) {
+			return true;
+		}
+		if (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.CMSManager,
+				OrganizationDefinition.Manager)) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean isPortalManager(EffectivePerson effectivePerson) throws Exception {
+		if (effectivePerson.isManager()) {
+			return true;
+		}
+		if (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.PortalManager,
 				OrganizationDefinition.Manager)) {
 				OrganizationDefinition.Manager)) {
 			return true;
 			return true;
 		}
 		}
 		return false;
 		return false;
 	}
 	}
 
 
-}
+}

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

@@ -13,6 +13,7 @@ import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.tools.ListTools;
 import com.x.base.core.project.tools.ListTools;
 import com.x.base.core.project.tools.SortTools;
 import com.x.base.core.project.tools.SortTools;
+import com.x.query.service.processing.Business;
 import com.x.query.service.processing.ThisApplication;
 import com.x.query.service.processing.ThisApplication;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -33,13 +34,13 @@ class ActionSearch extends BaseAction {
 		if(StringUtils.isBlank(wi.getKeyword())){
 		if(StringUtils.isBlank(wi.getKeyword())){
 			throw new ExceptionFieldEmpty("keyword");
 			throw new ExceptionFieldEmpty("keyword");
 		}
 		}
-		logger.info("{}搜索全局设计:{}", effectivePerson.getDistinguishedName(), wi);
-		if (ListTools.isEmpty(wi.getModuleList())) {
-			result.setData(search(wi));
+		logger.info("{}搜索设计:{}的关键字:{}", effectivePerson.getDistinguishedName(), wi.getModuleList(), wi.getKeyword());
+		if (ListTools.isNotEmpty(wi.getModuleList())) {
+			result.setData(search(wi, effectivePerson));
 		}else{
 		}else{
 			lock.lock();
 			lock.lock();
 			try {
 			try {
-				result.setData(search(wi));
+				result.setData(search(wi, effectivePerson));
 			} finally {
 			} finally {
 				lock.unlock();
 				lock.unlock();
 			}
 			}
@@ -47,33 +48,49 @@ class ActionSearch extends BaseAction {
 		return result;
 		return result;
 	}
 	}
 
 
-	private Wo search(final Wi wi) {
+	private Wo search(final Wi wi, EffectivePerson effectivePerson) throws Exception{
+		Business business = new Business();
 		final Map<String, List<WiDesigner.ModuleApp>> moduleMap = new HashMap<>();
 		final Map<String, List<WiDesigner.ModuleApp>> moduleMap = new HashMap<>();
 		if(!ListTools.isEmpty(wi.getModuleList())){
 		if(!ListTools.isEmpty(wi.getModuleList())){
 			for (Module module: wi.getModuleList()){
 			for (Module module: wi.getModuleList()){
-				if(module.getModuleType().equalsIgnoreCase(ModuleType.cms.toString())){
+				if(module.getModuleType().equalsIgnoreCase(ModuleType.cms.toString())
+						&& business.isCmsManager(effectivePerson)){
 					moduleMap.put(ModuleType.cms.toString(), module.getModuleAppList());
 					moduleMap.put(ModuleType.cms.toString(), module.getModuleAppList());
 				}
 				}
-				if(module.getModuleType().equalsIgnoreCase(ModuleType.portal.toString())){
+				if(module.getModuleType().equalsIgnoreCase(ModuleType.portal.toString())
+						&& business.isPortalManager(effectivePerson)){
 					moduleMap.put(ModuleType.portal.toString(), module.getModuleAppList());
 					moduleMap.put(ModuleType.portal.toString(), module.getModuleAppList());
 				}
 				}
-				if(module.getModuleType().equalsIgnoreCase(ModuleType.processPlatform.toString())){
+				if(module.getModuleType().equalsIgnoreCase(ModuleType.processPlatform.toString())
+						&& business.isProcessManager(effectivePerson)){
 					moduleMap.put(ModuleType.processPlatform.toString(), module.getModuleAppList());
 					moduleMap.put(ModuleType.processPlatform.toString(), module.getModuleAppList());
 				}
 				}
-				if(module.getModuleType().equalsIgnoreCase(ModuleType.query.toString())){
+				if(module.getModuleType().equalsIgnoreCase(ModuleType.query.toString())
+						&& business.isManager(effectivePerson)){
 					moduleMap.put(ModuleType.query.toString(), module.getModuleAppList());
 					moduleMap.put(ModuleType.query.toString(), module.getModuleAppList());
 				}
 				}
-				if(module.getModuleType().equalsIgnoreCase(ModuleType.service.toString())){
+				if(module.getModuleType().equalsIgnoreCase(ModuleType.service.toString())
+						&& business.isServiceManager(effectivePerson)){
 					moduleMap.put(ModuleType.service.toString(), module.getModuleAppList());
 					moduleMap.put(ModuleType.service.toString(), module.getModuleAppList());
 				}
 				}
 			}
 			}
 		}else{
 		}else{
 			List<WiDesigner.ModuleApp> list = new ArrayList<>();
 			List<WiDesigner.ModuleApp> list = new ArrayList<>();
-			moduleMap.put(ModuleType.cms.toString(), list);
-			moduleMap.put(ModuleType.portal.toString(), list);
-			moduleMap.put(ModuleType.processPlatform.toString(), list);
-			moduleMap.put(ModuleType.query.toString(), list);
-			moduleMap.put(ModuleType.service.toString(), list);
+			if(business.isCmsManager(effectivePerson)) {
+				moduleMap.put(ModuleType.cms.toString(), list);
+			}
+			if(business.isPortalManager(effectivePerson)) {
+				moduleMap.put(ModuleType.portal.toString(), list);
+			}
+			if(business.isProcessManager(effectivePerson)) {
+				moduleMap.put(ModuleType.processPlatform.toString(), list);
+			}
+			if(business.isManager(effectivePerson)) {
+				moduleMap.put(ModuleType.query.toString(), list);
+			}
+			if(business.isServiceManager(effectivePerson)) {
+				moduleMap.put(ModuleType.service.toString(), list);
+			}
 		}
 		}
 		Executor executor = Executors.newFixedThreadPool(5);
 		Executor executor = Executors.newFixedThreadPool(5);
 		CompletableFuture<List<WrapDesigner>> processPlatformCf = searchAsync(wi, moduleMap, ModuleType.processPlatform.toString(), x_processplatform_assemble_designer.class, executor);
 		CompletableFuture<List<WrapDesigner>> processPlatformCf = searchAsync(wi, moduleMap, ModuleType.processPlatform.toString(), x_processplatform_assemble_designer.class, executor);
@@ -112,7 +129,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){
 	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(() -> {
 		CompletableFuture<List<WrapDesigner>> cf = CompletableFuture.supplyAsync(() -> {
-			List<WrapDesigner> swList = new ArrayList<>();
+			List<WrapDesigner> swList = null;
 			if(moduleMap.containsKey(moduleType)) {
 			if(moduleMap.containsKey(moduleType)) {
 				try {
 				try {
 					WiDesigner wiDesigner = new WiDesigner();
 					WiDesigner wiDesigner = new WiDesigner();
@@ -126,7 +143,7 @@ class ActionSearch extends BaseAction {
 				} catch (Exception e) {
 				} catch (Exception e) {
 					logger.error(e);
 					logger.error(e);
 				}
 				}
-				if (swList.size() > 2) {
+				if (swList!=null && swList.size() > 2) {
 					try {
 					try {
 						SortTools.desc(swList, "designerType","appId");
 						SortTools.desc(swList, "designerType","appId");
 					} catch (Exception e) {
 					} catch (Exception e) {

+ 11 - 3
o2web/source/x_component_Attendance/$MyDetail/listItem.json

@@ -14,7 +14,7 @@
     "defaultSort" : "desc",
     "defaultSort" : "desc",
     "item" : "recordDateString",
     "item" : "recordDateString",
     "name" : "recordDateString",
     "name" : "recordDateString",
-    "width" : "9%"
+    "width" : "6%"
   },
   },
 
 
   {
   {
@@ -62,17 +62,25 @@
     "title": "考勤状态",
     "title": "考勤状态",
     "headStyles": "normalThNode",
     "headStyles": "normalThNode",
     "contentStyles": "normalTdNode",
     "contentStyles": "normalTdNode",
-    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ status = '请假或外出报备' }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
+    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ if(d.leaveType && d.leaveType!=''){status =d.leaveType }else{status = '请假或外出报备'}  }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
     "name" : "status",
     "name" : "status",
     "width" : "9%"
     "width" : "9%"
   } ,
   } ,
+  {
+    "title": "是否范围外打卡",
+    "headStyles": "normalThNode",
+    "contentStyles": "normalTdNode",
+    "item": "function( d ){  if(d.isExternal){ return '是' }else{ return '否' }}",
+    "name" : "appealStatus",
+    "width" : "7%"
+  },
   {
   {
     "title": "申诉状态",
     "title": "申诉状态",
     "headStyles": "normalThNode",
     "headStyles": "normalThNode",
     "contentStyles": "normalTdNode",
     "contentStyles": "normalTdNode",
     "item": "function( d ){  if(d.appealStatus==1){ return '申诉中' }else if(d.appealStatus==-1){ return '申诉未通过' }else if(d.appealStatus==9){ return '申诉通过' }else{ return '' } }",
     "item": "function( d ){  if(d.appealStatus==1){ return '申诉中' }else if(d.appealStatus==-1){ return '申诉未通过' }else if(d.appealStatus==9){ return '申诉通过' }else{ return '' } }",
     "name" : "appealStatus",
     "name" : "appealStatus",
-    "width" : "9%"
+    "width" : "6%"
   },
   },
   {
   {
     "title": "申诉审核人",
     "title": "申诉审核人",

+ 10 - 2
o2web/source/x_component_Attendance/$PeopleDetail/listItem.json

@@ -62,9 +62,17 @@
     "title": "考勤状态",
     "title": "考勤状态",
     "headStyles": "normalThNode",
     "headStyles": "normalThNode",
     "contentStyles": "normalTdNode",
     "contentStyles": "normalTdNode",
-    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ status = '请假或外出报备' }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
+    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ if(d.leaveType && d.leaveType!=''){status =d.leaveType }else{status = '请假或外出报备'} }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
     "name" : "status",
     "name" : "status",
-    "width" : "11%"
+    "width" : "7%"
+  },
+  {
+    "title": "是否范围外打卡",
+    "headStyles": "normalThNode",
+    "contentStyles": "normalTdNode",
+    "item": "function( d ){  if(d.isExternal){ return '是' }else{ return '否' }}",
+    "name" : "appealStatus",
+    "width" : "7%"
   },
   },
   {
   {
     "title": "申诉状态",
     "title": "申诉状态",

+ 10 - 2
o2web/source/x_component_Attendance/$TopUnitDetail/listItem.json

@@ -62,9 +62,17 @@
     "title": "考勤状态",
     "title": "考勤状态",
     "headStyles": "normalThNode",
     "headStyles": "normalThNode",
     "contentStyles": "normalTdNode",
     "contentStyles": "normalTdNode",
-    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ status = '请假或外出报备' }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
+    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ if(d.leaveType && d.leaveType!=''){status =d.leaveType }else{status = '请假或外出报备'} }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
     "name" : "status",
     "name" : "status",
-    "width" : "11%"
+    "width" : "7%"
+  },
+  {
+    "title": "是否范围外打卡",
+    "headStyles": "normalThNode",
+    "contentStyles": "normalTdNode",
+    "item": "function( d ){  if(d.isExternal){ return '是' }else{ return '否' }}",
+    "name" : "appealStatus",
+    "width" : "7%"
   },
   },
   {
   {
     "title": "申诉状态",
     "title": "申诉状态",

+ 10 - 2
o2web/source/x_component_Attendance/$UnitDetail/listItem.json

@@ -62,9 +62,17 @@
     "title": "考勤状态",
     "title": "考勤状态",
     "headStyles": "normalThNode",
     "headStyles": "normalThNode",
     "contentStyles": "normalTdNode",
     "contentStyles": "normalTdNode",
-    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ status = '请假或外出报备' }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
+    "item": "function( d ){  var status=''; if(d.isGetSelfHolidays){ if(d.leaveType && d.leaveType!=''){status =d.leaveType }else{status = '请假或外出报备'} }else if(d.isLate){ status = '迟到' }else if(d.isLeaveEarlier){ status = '早退' }else if(d.isAbsent){ status = '缺勤' }else if(d.isAbnormalDuty){ status = '异常打卡' }else if(d.isLackOfTime){ status = '工时不足' }else{ status = '正常' }; return status; }",
     "name" : "status",
     "name" : "status",
-    "width" : "11%"
+    "width" : "7%"
+  },
+  {
+    "title": "是否范围外打卡",
+    "headStyles": "normalThNode",
+    "contentStyles": "normalTdNode",
+    "item": "function( d ){  if(d.isExternal){ return '是' }else{ return '否' }}",
+    "name" : "appealStatus",
+    "width" : "7%"
   },
   },
   {
   {
     "title": "申诉状态",
     "title": "申诉状态",

+ 7 - 7
o2web/source/x_component_Attendance/AppealExplorer.js

@@ -95,14 +95,14 @@ MWF.xApplication.Attendance.AppealExplorer = new Class({
         }).inject( this.fileterNode );
         }).inject( this.fileterNode );
         var tr = new Element("tr").inject(table);
         var tr = new Element("tr").inject(table);
 
 
-        var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : this.preMonthDate.format(this.app.lp.dateFormatMonth)  }).inject(tr);
+        //var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : this.preMonthDate.format(this.app.lp.dateFormatMonth)  }).inject(tr);
 
 
+        this.createYearSelectTd( tr );
+        this.createMonthSelectTd( tr );
         this.createStatusSelectTd(tr);
         this.createStatusSelectTd(tr);
         this.createAppealReasonTd(tr);
         this.createAppealReasonTd(tr);
         this.createUnitTd(tr);
         this.createUnitTd(tr);
         this.createPersonTd( tr );
         this.createPersonTd( tr );
-        //this.createYearSelectTd( tr );
-        //this.createMonthSelectTd( tr );
         this.createActionTd( tr );
         this.createActionTd( tr );
     },
     },
     createStatusSelectTd : function( tr ){
     createStatusSelectTd : function( tr ){
@@ -192,16 +192,16 @@ MWF.xApplication.Attendance.AppealExplorer = new Class({
             "styles" : this.css.filterButton
             "styles" : this.css.filterButton
         }).inject(td);
         }).inject(td);
         input.addEvent("click", function(){
         input.addEvent("click", function(){
-            var year = this.preMonthDate.getFullYear().toString();
+            /*var year = this.preMonthDate.getFullYear().toString();
             var month = (this.preMonthDate.getMonth()+1).toString();
             var month = (this.preMonthDate.getMonth()+1).toString();
-            if( month.length == 1 )month = "0"+month;
+            if( month.length == 1 )month = "0"+month;*/
             var filterData = {
             var filterData = {
                 status : this.status.getValue(),
                 status : this.status.getValue(),
                 appealReason : this.appealReason.getValue(),
                 appealReason : this.appealReason.getValue(),
                 unitName : this.unitName.getValue(),
                 unitName : this.unitName.getValue(),
                 empName : this.empName.getValue(),
                 empName : this.empName.getValue(),
-                yearString : year, //this.yearString.getValue(),
-                monthString : month //this.monthString.getValue()
+                yearString : this.yearString.getValue(),
+                monthString : this.monthString.getValue()
             }
             }
             this.loadView( filterData );
             this.loadView( filterData );
         }.bind(this))
         }.bind(this))

+ 40 - 5
o2web/source/x_component_Attendance/MyAppeal.js

@@ -39,9 +39,12 @@ MWF.xApplication.Attendance.MyAppeal = new Class({
             "styles" : this.css.fileterNode
             "styles" : this.css.fileterNode
         }).inject(this.node);
         }).inject(this.node);
 
 
-        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' style='width: 560px;font-size: 14px;color:#666'>"+
+        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' style='width: 580px;font-size: 14px;color:#666'>"+
             "<tr>" +
             "<tr>" +
-            "    <td styles='filterTableTitle' item='date'></td>"+
+            "    <td styles='filterTableTitle' lable='yearString'></td>"+
+            "    <td styles='filterTableValue' item='yearString'></td>" +
+            "    <td styles='filterTableTitle' lable='monthString'></td>"+
+            "    <td styles='filterTableValue' item='monthString'></td>" +
             "    <td styles='filterTableTitle' lable='status'></td>"+
             "    <td styles='filterTableTitle' lable='status'></td>"+
             "    <td styles='filterTableValue' item='status'></td>" +
             "    <td styles='filterTableValue' item='status'></td>" +
             "    <td styles='filterTableTitle' lable='appealReason'></td>"+
             "    <td styles='filterTableTitle' lable='appealReason'></td>"+
@@ -55,7 +58,39 @@ MWF.xApplication.Attendance.MyAppeal = new Class({
             this.form = new MForm( this.fileterNode, {}, {
             this.form = new MForm( this.fileterNode, {}, {
                 isEdited : true,
                 isEdited : true,
                 itemTemplate : {
                 itemTemplate : {
-                    date : { "type" : "innerText", value : (new Date).format(this.app.lp.dateFormatMonth) },
+                    yearString : {
+                        text : "年度",
+                        "type" : "select",
+                        "selectValue" : function(){
+                            var years = [];
+                            var year = new Date().getFullYear();
+                            for(var i=0; i<6; i++ ){
+                                years.push( year-- );
+                            }
+                            return years;
+                        },
+                        "event" : {
+                            "change" : function( item, ev ){
+                                var values = this.getDateSelectValue();
+                                item.form.getItem( "date").resetItemOptions( values , values )
+                            }.bind(this)
+                        }
+                    },
+                    monthString : {
+                        text : "月份",
+                        "type" : "select",
+                        "defaultValue" : function(){
+                            var month = (new Date().getMonth() + 1 ).toString();
+                            return  month.length == 1 ? "0"+month : month;
+                        },
+                        "selectValue" :["","01","02","03","04","05","06","07","08","09","10","11","12"],
+                        "event" : {
+                            "change" : function( item, ev ){
+                                var values = this.getDateSelectValue();
+                                item.form.getItem( "date").resetItemOptions( values , values )
+                            }.bind(this)
+                        }
+                    },
                     status : {
                     status : {
                         "text" : "申述状态",
                         "text" : "申述状态",
                         "type" : "select",
                         "type" : "select",
@@ -263,10 +298,10 @@ MWF.xApplication.Attendance.MyAppeal.View = new Class({
         var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
         var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
         var filter = this.filterData || {};
         var filter = this.filterData || {};
 
 
-        var month = (new Date().getMonth()+1).toString();
+        /*var month = (new Date().getMonth()+1).toString();
         if( month.length == 1 )month = "0"+month;
         if( month.length == 1 )month = "0"+month;
         filter.yearString = new Date().getFullYear().toString();
         filter.yearString = new Date().getFullYear().toString();
-        filter.monthString = month;
+        filter.monthString = month;*/
         filter.empName = layout.desktop.session.user.distinguishedName;
         filter.empName = layout.desktop.session.user.distinguishedName;
 
 
         this.actions.listAppealFilterNext(id, count, filter, function(json){
         this.actions.listAppealFilterNext(id, count, filter, function(json){

+ 39 - 3
o2web/source/x_component_Attendance/MyDetail.js

@@ -153,7 +153,10 @@ MWF.xApplication.Attendance.MyDetail.Explorer = new Class({
 
 
         var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='filterTable'>"+
         var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='filterTable'>"+
             "<tr>" +
             "<tr>" +
-            "    <td styles='filterTableTitle'>"+ (new Date()).format("%Y年%m月") +"</td>"+
+            "    <td styles='filterTableTitle' lable='cycleYear'></td>"+
+            "    <td styles='filterTableValue' item='cycleYear'></td>" +
+            "    <td styles='filterTableTitle' lable='cycleMonth'></td>"+
+            "    <td styles='filterTableValue' item='cycleMonth'></td>" +
             "    <td styles='filterTableTitle' lable='date'></td>"+
             "    <td styles='filterTableTitle' lable='date'></td>"+
             "    <td styles='filterTableValue' item='date'></td>" +
             "    <td styles='filterTableValue' item='date'></td>" +
             "    <td styles='filterTableTitle' lable='isAbsent'></td>"+
             "    <td styles='filterTableTitle' lable='isAbsent'></td>"+
@@ -171,6 +174,39 @@ MWF.xApplication.Attendance.MyDetail.Explorer = new Class({
             this.form = new MForm( this.fileterNode, {}, {
             this.form = new MForm( this.fileterNode, {}, {
                 isEdited : true,
                 isEdited : true,
                 itemTemplate : {
                 itemTemplate : {
+                    cycleYear : {
+                        text : "年度",
+                        "type" : "select",
+                        "selectValue" : function(){
+                            var years = [];
+                            var year = new Date().getFullYear();
+                            for(var i=0; i<6; i++ ){
+                                years.push( year-- );
+                            }
+                            return years;
+                        },
+                        "event" : {
+                            "change" : function( item, ev ){
+                                var values = this.getDateSelectValue();
+                                item.form.getItem( "date").resetItemOptions( values , values )
+                            }.bind(this)
+                        }
+                    },
+                    cycleMonth : {
+                        text : "月份",
+                        "type" : "select",
+                        "defaultValue" : function(){
+                            var month = (new Date().getMonth() + 1 ).toString();
+                            return  month.length == 1 ? "0"+month : month;
+                        },
+                        "selectValue" :["","01","02","03","04","05","06","07","08","09","10","11","12"],
+                        "event" : {
+                            "change" : function( item, ev ){
+                                var values = this.getDateSelectValue();
+                                item.form.getItem( "date").resetItemOptions( values , values )
+                            }.bind(this)
+                        }
+                    },
                     date : { text : "日期",  "type" : "select", "selectValue" : function(){
                     date : { text : "日期",  "type" : "select", "selectValue" : function(){
                             var year =  this.preMonthDate.getFullYear() ;
                             var year =  this.preMonthDate.getFullYear() ;
                             var month =  this.preMonthDate.getMonth() ;
                             var month =  this.preMonthDate.getMonth() ;
@@ -193,11 +229,11 @@ MWF.xApplication.Attendance.MyDetail.Explorer = new Class({
                             click : function(){
                             click : function(){
                                 var result = this.form.getResult(false,null,false,true,false);
                                 var result = this.form.getResult(false,null,false,true,false);
 
 
-                                var year = this.preMonthDate.getFullYear().toString();
+                               /* var year = this.preMonthDate.getFullYear().toString();
                                 var month = (this.preMonthDate.getMonth()+1).toString();
                                 var month = (this.preMonthDate.getMonth()+1).toString();
                                 if( month.length == 1 )month = "0"+month;
                                 if( month.length == 1 )month = "0"+month;
                                 result.cycleYear = year;
                                 result.cycleYear = year;
-                                result.cycleMonth = month;
+                                result.cycleMonth = month;*/
 
 
                                 if( typeOf( result.isAbsent ) == "string" )result.isAbsent = this.getBoolean( result.isAbsent );
                                 if( typeOf( result.isAbsent ) == "string" )result.isAbsent = this.getBoolean( result.isAbsent );
                                 if( typeOf( result.isLate ) == "string" )result.isLate = this.getBoolean( result.isLate );
                                 if( typeOf( result.isLate ) == "string" )result.isLate = this.getBoolean( result.isLate );

+ 2 - 10
o2web/source/x_component_Attendance/StatisticsCycle.js

@@ -105,16 +105,8 @@ MWF.xApplication.Attendance.StatisticsCycle.Form = new Class({
             this.form = new MForm( this.formTableArea, this.data, {
             this.form = new MForm( this.formTableArea, this.data, {
                 isEdited : this.isEdited || this.isNew,
                 isEdited : this.isEdited || this.isNew,
                 itemTemplate : {
                 itemTemplate : {
-                    topUnitName : { text: "统计公司",  tType : "unit",unsetDefaultEvent : true, event : {
-                        dblclick : function(item, ev){
-                            item.selectPerson(item.getElements()[0],"","unit")
-                        }
-                    }},
-                    unitName : { text: "统计部门", tType : "unit",unsetDefaultEvent : true, event : {
-                        dblclick : function(item, ev){
-                            item.selectPerson(item.getElements()[0],"","unit")
-                        }
-                    } },
+                    topUnitName : { text:"统计公司", type : "org", orgType : "unit" },
+                    unitName : { text: "统计部门", type : "org", orgType : "unit" },
                     cycleYear : { text: "统计周期年份", type : "select", notEmpty:true, defaultValue : new Date().getFullYear(), selectValue : function(){
                     cycleYear : { text: "统计周期年份", type : "select", notEmpty:true, defaultValue : new Date().getFullYear(), selectValue : function(){
                         var years = [];
                         var years = [];
                         var year = new Date().getFullYear() + 5;
                         var year = new Date().getFullYear() + 5;