Browse Source

teamwork自定义字段服务

luojing 5 years ago
parent
commit
979caa5e55
35 changed files with 506 additions and 433 deletions
  1. 6 6
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/Business.java
  2. 117 0
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/CustomExtFieldReleFactory.java
  3. 0 115
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectExtFieldReleFactory.java
  4. 4 2
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/ActionApplication.java
  5. 12 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionDelete.java
  6. 13 13
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionGet.java
  7. 12 10
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionGetNextUseableExtFieldName.java
  8. 2 2
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListAllExtFields.java
  9. 15 15
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListWithCorrelation.java
  10. 69 42
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionSave.java
  11. 8 6
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/BaseAction.java
  12. 17 17
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleAction.java
  13. 12 0
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleFlagForQueryEmptyException.java
  14. 12 0
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleNotExistsException.java
  15. 20 0
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldRelePersistException.java
  16. 20 0
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleQueryException.java
  17. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldReleFlagForQueryEmptyException.java
  18. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldReleNotExistsException.java
  19. 0 20
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldRelePersistException.java
  20. 0 20
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldReleQueryException.java
  21. 12 0
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/TaskNotExistsException.java
  22. 21 10
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionGet.java
  23. 2 2
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListSubTaskWithTaskId.java
  24. 1 0
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionSave.java
  25. 2 2
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionUpdateSingleProperty.java
  26. 1 1
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/BaseAction.java
  27. 15 15
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/CustomExtFieldRelePersistService.java
  28. 22 22
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/CustomExtFieldReleQueryService.java
  29. 39 39
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/CustomExtFieldReleService.java
  30. 4 4
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/DynamicPersistService.java
  31. 15 15
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/DynamicService.java
  32. 1 1
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectService.java
  33. 29 15
      o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/CustomExtFieldRele.java
  34. 2 2
      o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/PersistenceProperties.java
  35. 1 1
      o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/tools/CustomExtField.java

+ 6 - 6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/Business.java

@@ -13,7 +13,7 @@ import com.x.teamwork.assemble.control.factory.ChatFactory;
 import com.x.teamwork.assemble.control.factory.DynamicFactory;
 import com.x.teamwork.assemble.control.factory.PriorityFactory;
 import com.x.teamwork.assemble.control.factory.ProjectConfigFactory;
-import com.x.teamwork.assemble.control.factory.ProjectExtFieldReleFactory;
+import com.x.teamwork.assemble.control.factory.CustomExtFieldReleFactory;
 import com.x.teamwork.assemble.control.factory.ProjectFactory;
 import com.x.teamwork.assemble.control.factory.ProjectGroupFactory;
 import com.x.teamwork.assemble.control.factory.ProjectGroupReleFactory;
@@ -53,7 +53,7 @@ public class Business {
 	private TaskGroupFactory taskGroupFactory;
 	private TaskGroupReleFactory taskGroupReleFactory;
 	private TaskViewFactory taskViewFactory;
-	private ProjectExtFieldReleFactory projectExtFieldReleFactory;
+	private CustomExtFieldReleFactory customExtFieldReleFactory;
 	private ReviewFactory reviewFactory;
 	private BatchOperationFactory batchOperationFactory;
 	private TaskTagFactory taskTagFactory;	
@@ -121,11 +121,11 @@ public class Business {
 	 * @return
 	 * @throws Exception
 	 */
-	public ProjectExtFieldReleFactory projectExtFieldReleFactory() throws Exception {
-		if (null == this.projectExtFieldReleFactory) {
-			this.projectExtFieldReleFactory = new ProjectExtFieldReleFactory( this );
+	public CustomExtFieldReleFactory customExtFieldReleFactory() throws Exception {
+		if (null == this.customExtFieldReleFactory) {
+			this.customExtFieldReleFactory = new CustomExtFieldReleFactory( this );
 		}
-		return projectExtFieldReleFactory;
+		return customExtFieldReleFactory;
 	}
 	
 	/**

+ 117 - 0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/CustomExtFieldReleFactory.java

@@ -0,0 +1,117 @@
+package com.x.teamwork.assemble.control.factory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.x.base.core.project.exception.ExceptionWhen;
+import com.x.teamwork.assemble.control.AbstractFactory;
+import com.x.teamwork.assemble.control.Business;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele_;
+
+
+public class CustomExtFieldReleFactory extends AbstractFactory {
+
+	public CustomExtFieldReleFactory( Business business ) throws Exception {
+		super(business);
+	}
+
+	/**
+	 * 获取指定Id的CustomExtFieldRele实体信息对象
+	 * @param id
+	 * @return
+	 * @throws Exception
+	 */
+	public CustomExtFieldRele get( String id ) throws Exception {
+		return this.entityManagerContainer().find( id, CustomExtFieldRele.class, ExceptionWhen.none );
+	}
+	
+	/**
+	 * 列示指定Id的CustomExtFieldRele实体信息列表
+	 * @param ids
+	 * @return
+	 * @throws Exception
+	 */
+	public List<CustomExtFieldRele> list( List<String> ids ) throws Exception {
+		if( ids == null || ids.size() == 0 ){
+			return new ArrayList<CustomExtFieldRele>();
+		}
+		EntityManager em = this.entityManagerContainer().get(CustomExtFieldRele.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<CustomExtFieldRele> cq = cb.createQuery(CustomExtFieldRele.class);
+		Root<CustomExtFieldRele> root = cq.from(CustomExtFieldRele.class);
+		Predicate p = root.get(CustomExtFieldRele_.id).in(ids);
+		cq.orderBy( cb.desc( root.get( CustomExtFieldRele_.updateTime ) ) );
+		return em.createQuery(cq.where(p)).getResultList();
+	}
+
+	/**
+	 * 根据关联ID列示扩展属性ID信息列表
+	 * @param correlationId
+	 * @return
+	 * @throws Exception
+	 */
+	public List<CustomExtFieldRele> listFieldReleObjByCorrelation( String correlationId ) throws Exception {
+		if( StringUtils.isEmpty( correlationId ) ){
+			throw new Exception("correlationId can not be empty!");
+		}
+		EntityManager em = this.entityManagerContainer().get(CustomExtFieldRele.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<CustomExtFieldRele> cq = cb.createQuery(CustomExtFieldRele.class);
+		Root<CustomExtFieldRele> root = cq.from(CustomExtFieldRele.class);
+		Predicate p = cb.equal( root.get(CustomExtFieldRele_.correlationId), correlationId );
+		return em.createQuery(cq.where(p)).getResultList();
+	}
+	
+	/**
+	 * 根据关联ID列示扩展属性ID信息列表
+	 * @param correlationId
+	 * @return
+	 * @throws Exception
+	 */
+	public List<String> listFieldReleIdsByCorrelation( String correlationId ) throws Exception {
+		if( StringUtils.isEmpty( correlationId ) ){
+			throw new Exception("correlationId can not be empty!");
+		}
+		EntityManager em = this.entityManagerContainer().get(CustomExtFieldRele.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<String> cq = cb.createQuery(String.class);
+		Root<CustomExtFieldRele> root = cq.from(CustomExtFieldRele.class);
+		Predicate p = cb.equal( root.get(CustomExtFieldRele_.correlationId), correlationId );
+		cq.select( root.get(CustomExtFieldRele_.correlationId) );
+		return em.createQuery(cq.where(p)).getResultList();
+	}
+	
+	/**
+	 * 根据扩展属性名以及关联ID获取一组关联信息
+	 * @param fieldName
+	 * @param correlationId
+	 * @return
+	 * @throws Exception
+	 */
+	public List<CustomExtFieldRele> listWithFieldNameAndCorrelation( String fieldName, String correlationId ) throws Exception {
+		if( StringUtils.isEmpty( fieldName ) ){
+			throw new Exception("fieldName can not be empty!");
+		}
+		/*if( StringUtils.isEmpty( correlationId ) ){
+			throw new Exception("correlationId can not be empty!");
+		}*/
+		EntityManager em = this.entityManagerContainer().get(CustomExtFieldRele.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<CustomExtFieldRele> cq = cb.createQuery(CustomExtFieldRele.class);
+		Root<CustomExtFieldRele> root = cq.from(CustomExtFieldRele.class);
+		Predicate p = cb.equal( root.get(CustomExtFieldRele_.extFieldName), fieldName );
+		if( StringUtils.isNotEmpty( correlationId ) ){
+			p = cb.and( p,  cb.equal( root.get(CustomExtFieldRele_.correlationId), correlationId ));
+		}
+		return em.createQuery(cq.where(p)).getResultList();
+	}
+}

+ 0 - 115
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectExtFieldReleFactory.java

@@ -1,115 +0,0 @@
-package com.x.teamwork.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.project.exception.ExceptionWhen;
-import com.x.teamwork.assemble.control.AbstractFactory;
-import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
-import com.x.teamwork.core.entity.ProjectExtFieldRele_;
-
-
-public class ProjectExtFieldReleFactory extends AbstractFactory {
-
-	public ProjectExtFieldReleFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 获取指定Id的ProjectExtFieldRele实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectExtFieldRele get( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, ProjectExtFieldRele.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 列示指定Id的ProjectExtFieldRele实体信息列表
-	 * @param ids
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectExtFieldRele> list( List<String> ids ) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<ProjectExtFieldRele>();
-		}
-		EntityManager em = this.entityManagerContainer().get(ProjectExtFieldRele.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectExtFieldRele> cq = cb.createQuery(ProjectExtFieldRele.class);
-		Root<ProjectExtFieldRele> root = cq.from(ProjectExtFieldRele.class);
-		Predicate p = root.get(ProjectExtFieldRele_.id).in(ids);
-		cq.orderBy( cb.desc( root.get( ProjectExtFieldRele_.updateTime ) ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据项目ID列示项目扩展属性ID信息列表
-	 * @param project
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectExtFieldRele> listFieldReleObjByProject( String project ) throws Exception {
-		if( StringUtils.isEmpty( project ) ){
-			throw new Exception("project can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(ProjectExtFieldRele.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectExtFieldRele> cq = cb.createQuery(ProjectExtFieldRele.class);
-		Root<ProjectExtFieldRele> root = cq.from(ProjectExtFieldRele.class);
-		Predicate p = cb.equal( root.get(ProjectExtFieldRele_.projectId), project );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据项目ID列示项目扩展属性ID信息列表
-	 * @param project
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listFieldReleIdsByProject( String project ) throws Exception {
-		if( StringUtils.isEmpty( project ) ){
-			throw new Exception("project can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(ProjectExtFieldRele.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<ProjectExtFieldRele> root = cq.from(ProjectExtFieldRele.class);
-		Predicate p = cb.equal( root.get(ProjectExtFieldRele_.projectId), project );
-		cq.select( root.get(ProjectExtFieldRele_.projectId) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据扩展属性名以及项目ID获取一组关联信息
-	 * @param fieldName
-	 * @param project
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectExtFieldRele> listWithFieldNameAndProject( String fieldName, String project ) throws Exception {
-		if( StringUtils.isEmpty( fieldName ) ){
-			throw new Exception("fieldName can not be empty!");
-		}
-		if( StringUtils.isEmpty( project ) ){
-			throw new Exception("project can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(ProjectExtFieldRele.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectExtFieldRele> cq = cb.createQuery(ProjectExtFieldRele.class);
-		Root<ProjectExtFieldRele> root = cq.from(ProjectExtFieldRele.class);
-		Predicate p = cb.equal( root.get(ProjectExtFieldRele_.extFieldName), fieldName );
-		p = cb.and( p,  cb.equal( root.get(ProjectExtFieldRele_.projectId), project ));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 4 - 2
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/ActionApplication.java

@@ -9,7 +9,7 @@ import com.x.teamwork.assemble.control.jaxrs.attachment.AttachmentAction;
 import com.x.teamwork.assemble.control.jaxrs.chat.ChatAction;
 import com.x.teamwork.assemble.control.jaxrs.config.SystemConfigAction;
 import com.x.teamwork.assemble.control.jaxrs.dynamic.DynamicAction;
-import com.x.teamwork.assemble.control.jaxrs.extfield.ProjectExtFieldReleAction;
+import com.x.teamwork.assemble.control.jaxrs.extfield.CustomExtFieldReleAction;
 import com.x.teamwork.assemble.control.jaxrs.global.GlobalAction;
 import com.x.teamwork.assemble.control.jaxrs.list.TaskListAction;
 import com.x.teamwork.assemble.control.jaxrs.project.ProjectAction;
@@ -20,6 +20,7 @@ import com.x.teamwork.assemble.control.jaxrs.taskListTemplate.TaskListTemplateAc
 import com.x.teamwork.assemble.control.jaxrs.taskgroup.TaskGroupAction;
 import com.x.teamwork.assemble.control.jaxrs.tasktag.TaskTagAction;
 import com.x.teamwork.assemble.control.jaxrs.taskview.TaskViewAction;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
 @ApplicationPath("jaxrs")
 public class ActionApplication extends AbstractActionApplication {
@@ -37,10 +38,11 @@ public class ActionApplication extends AbstractActionApplication {
 		this.classes.add( DynamicAction.class );
 		this.classes.add( ChatAction.class );
 		this.classes.add( SystemConfigAction.class );
-		this.classes.add( ProjectExtFieldReleAction.class );
+		this.classes.add( CustomExtFieldReleAction.class );
 		this.classes.add( ProjectTemplateAction.class );
 		this.classes.add( TaskListTemplateAction.class );
 		this.classes.add( GlobalAction.class );
+		this.classes.add( CustomExtFieldRele.class );
 		return this.classes;
 	}
 

+ 12 - 12
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionDelete.java

@@ -18,7 +18,7 @@ import com.x.base.core.project.jaxrs.WoId;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.teamwork.core.entity.Dynamic;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
 public class ActionDelete extends BaseAction {
 
@@ -26,27 +26,27 @@ public class ActionDelete extends BaseAction {
 
 	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
-		ProjectExtFieldRele projectExtFieldRele = null;
+		CustomExtFieldRele customExtFieldRele = null;
 		Wo wo = new Wo();
 		Boolean check = true;
 
 		if ( StringUtils.isEmpty( flag ) ) {
 			check = false;
-			Exception exception = new ProjectExtFieldReleFlagForQueryEmptyException();
+			Exception exception = new CustomExtFieldReleFlagForQueryEmptyException();
 			result.error( exception );
 		}
 
 		if( Boolean.TRUE.equals( check ) ){
 			try {
-				projectExtFieldRele = projectExtFieldReleQueryService.get(flag);
-				if ( projectExtFieldRele == null) {
+				customExtFieldRele = customExtFieldReleQueryService.get(flag);
+				if ( customExtFieldRele == null) {
 					check = false;
-					Exception exception = new ProjectExtFieldReleNotExistsException(flag);
+					Exception exception = new CustomExtFieldReleNotExistsException(flag);
 					result.error( exception );
 				}
 			} catch (Exception e) {
 				check = false;
-				Exception exception = new ProjectExtFieldReleQueryException(e, "根据指定flag查询项目扩展属性关联信息对象时发生异常。flag:" + flag);
+				Exception exception = new CustomExtFieldReleQueryException(e, "根据指定flag查询扩展属性关联信息对象时发生异常。flag:" + flag);
 				result.error(exception);
 				logger.error(e, effectivePerson, request, null);
 			}
@@ -54,23 +54,23 @@ public class ActionDelete extends BaseAction {
 		
 		if( Boolean.TRUE.equals( check ) ){
 			try {
-				projectExtFieldRelePersistService.delete(flag, effectivePerson );
+				customExtFieldRelePersistService.delete(flag, effectivePerson );
 				
 				// 更新缓存
-				ApplicationCache.notify( ProjectExtFieldRele.class );
+				ApplicationCache.notify( CustomExtFieldRele.class );
 				
-				wo.setId( projectExtFieldRele.getId() );
+				wo.setId( customExtFieldRele.getId() );
 				
 			} catch (Exception e) {
 				check = false;
-				Exception exception = new ProjectExtFieldReleQueryException(e, "根据指定flag删除项目扩展属性关联信息对象时发生异常。flag:" + flag);
+				Exception exception = new CustomExtFieldReleQueryException(e, "根据指定flag删除扩展属性关联信息对象时发生异常。flag:" + flag);
 				result.error(exception);
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
 		if( Boolean.TRUE.equals( check ) ){
 			try {					
-				Dynamic dynamic = dynamicPersistService.projectExtFieldReleDeleteDynamic( projectExtFieldRele, effectivePerson);
+				Dynamic dynamic = dynamicPersistService.projectExtFieldReleDeleteDynamic( customExtFieldRele, effectivePerson);
 				if( dynamic != null ) {
 					List<WoDynamic> dynamics = new ArrayList<>();
 					dynamics.add( WoDynamic.copier.copy( dynamic ) );

+ 13 - 13
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionGet.java

@@ -16,7 +16,7 @@ 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.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
 import net.sf.ehcache.Element;
 
@@ -27,17 +27,17 @@ public class ActionGet extends BaseAction {
 	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 		Wo wo = null;
-		ProjectExtFieldRele projectExtFieldRele = null;
+		CustomExtFieldRele customExtFieldRele = null;
 		Boolean check = true;
 
 		if ( StringUtils.isEmpty( id ) ) {
 			check = false;
-			Exception exception = new ProjectExtFieldReleFlagForQueryEmptyException();
+			Exception exception = new CustomExtFieldReleFlagForQueryEmptyException();
 			result.error( exception );
 		}
 
-		String cacheKey = ApplicationCache.concreteCacheKey( "ProjectExtFieldRele.Get." + id );
-		Element element = projectExtFieldReleCache.get( cacheKey );
+		String cacheKey = ApplicationCache.concreteCacheKey( "CustomExtFieldRele.Get." + id );
+		Element element = customExtFieldReleCache.get( cacheKey );
 
 		if ((null != element) && (null != element.getObjectValue())) {
 			wo = (Wo) element.getObjectValue();
@@ -45,15 +45,15 @@ public class ActionGet extends BaseAction {
 		} else {
 			if( Boolean.TRUE.equals( check ) ){
 				try {
-					projectExtFieldRele = projectExtFieldReleQueryService.get(id);
-					if ( projectExtFieldRele == null) {
+					customExtFieldRele = customExtFieldReleQueryService.get(id);
+					if ( customExtFieldRele == null) {
 						check = false;
-						Exception exception = new ProjectExtFieldReleNotExistsException(id);
+						Exception exception = new CustomExtFieldReleNotExistsException(id);
 						result.error( exception );
 					}
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ProjectExtFieldReleQueryException( e, "根据指定id查询扩展属性关联信息对象时发生异常。flag:" + id );
+					Exception exception = new CustomExtFieldReleQueryException( e, "根据指定id查询扩展属性关联信息对象时发生异常。flag:" + id );
 					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
@@ -61,9 +61,9 @@ public class ActionGet extends BaseAction {
 			
 			if( Boolean.TRUE.equals( check ) ){
 				try {
-					wo = Wo.copier.copy( projectExtFieldRele );
+					wo = Wo.copier.copy( customExtFieldRele );
 				} catch (Exception e) {
-					Exception exception = new ProjectExtFieldReleQueryException(e, "将查询出来的扩展属性关联信息对象转换为可输出的数据信息时发生异常。");
+					Exception exception = new CustomExtFieldReleQueryException(e, "将查询出来的扩展属性关联信息对象转换为可输出的数据信息时发生异常。");
 					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
@@ -73,13 +73,13 @@ public class ActionGet extends BaseAction {
 		return result;
 	}
 
-	public static class Wo extends ProjectExtFieldRele {
+	public static class Wo extends CustomExtFieldRele {
 		
 		private static final long serialVersionUID = -5076990764713538973L;
 
 		public static List<String> Excludes = new ArrayList<String>();
 
-		static WrapCopier<ProjectExtFieldRele, Wo> copier = WrapCopierFactory.wo( ProjectExtFieldRele.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
+		static WrapCopier<CustomExtFieldRele, Wo> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
 
 	}
 }

+ 12 - 10
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionGetNextUseableExtFieldName.java

@@ -9,21 +9,23 @@ 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.teamwork.core.entity.Project;
+import com.x.teamwork.core.entity.Task;
 
 public class ActionGetNextUseableExtFieldName extends BaseAction {
 	
 	private static  Logger logger = LoggerFactory.getLogger(ActionGetNextUseableExtFieldName.class);
 	
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String projectId, String fieldType ) throws Exception {
+	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String correlationId, String fieldType ) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 		Project project = null;
+		Task task = null;
 		Boolean check = true;
 		Wo wo = new Wo();
 		
 		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( projectId )) {
+			if( StringUtils.isEmpty( correlationId )) {
 				check = false;
-				Exception exception = new ProjectFlagForQueryEmptyException();
+				Exception exception = new CustomExtFieldReleFlagForQueryEmptyException();
 				result.error( exception );
 			}
 		}
@@ -34,28 +36,28 @@ public class ActionGetNextUseableExtFieldName extends BaseAction {
 			}
 		}
 		
-		if( Boolean.TRUE.equals( check ) ){
+		/*if( Boolean.TRUE.equals( check ) ){
 			try {
-				project = projectQueryService.get( projectId );
+				project = projectQueryService.get( correlationId );
 				if ( project == null) {
 					check = false;
-					Exception exception = new ProjectNotExistsException( projectId );
+					Exception exception = new ProjectNotExistsException( correlationId );
 					result.error( exception );
 				}
 			} catch (Exception e) {
 				check = false;
-				Exception exception = new ProjectExtFieldRelePersistException(e, "根据指定flag查询应用项目信息对象时发生异常。flag:" +  projectId );
+				Exception exception = new CustomExtFieldRelePersistException(e, "根据指定flag查询应用项目信息对象时发生异常。flag:" +  correlationId );
 				result.error(exception);
 				logger.error(e, effectivePerson, request, null);
 			}
-		}
+		}*/
 		
 		if( Boolean.TRUE.equals( check ) ){
-			String fieldName = projectExtFieldReleQueryService.getNextUseableExtFieldName( projectId, fieldType );
+			String fieldName = customExtFieldReleQueryService.getNextUseableExtFieldName( correlationId, fieldType );
 			if( StringUtils.isNotEmpty( fieldName )) {
 				wo.setFieldName(fieldName);
 			}else {
-				Exception exception = new ProjectExtFieldReleQueryException( "当前项目无可用扩展属性。" );
+				Exception exception = new CustomExtFieldReleQueryException( "当前关联ID无可用扩展属性。" );
 				result.error(exception);
 			}
 		}

+ 2 - 2
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListAllExtFields.java

@@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.teamwork.core.entity.tools.FieldInfo;
-import com.x.teamwork.core.entity.tools.ProjectExtField;
+import com.x.teamwork.core.entity.tools.CustomExtField;
 
 public class ActionListAllExtFields extends BaseAction {
 
@@ -20,7 +20,7 @@ public class ActionListAllExtFields extends BaseAction {
 
 	public static class Wo {
  
-		private List<FieldInfo> fieldInfos = ProjectExtField.listAllExtField();
+		private List<FieldInfo> fieldInfos = CustomExtField.listAllExtField();
 		
 		public List<FieldInfo> getFieldInfos() {
 			return fieldInfos;

+ 15 - 15
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListWithProject.java → o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListWithCorrelation.java

@@ -15,23 +15,23 @@ 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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
 import net.sf.ehcache.Element;
 
-public class ActionListWithProject extends BaseAction {
+public class ActionListWithCorrelation extends BaseAction {
 
-	private static Logger logger = LoggerFactory.getLogger(ActionListWithProject.class);
+	private static Logger logger = LoggerFactory.getLogger(ActionListWithCorrelation.class);
 
 	@SuppressWarnings("unchecked")
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String projectId ) throws Exception {
+	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String correlationId ) throws Exception {
 		ActionResult<List<Wo>> result = new ActionResult<>();
 		List<Wo> wos = null;
-		List<ProjectExtFieldRele> projectExtFieldReles = null;
+		List<CustomExtFieldRele> customExtFieldReles = null;
 		Boolean check = true;
 
-		String cacheKey = ApplicationCache.concreteCacheKey( "ActionList", projectId, effectivePerson.getDistinguishedName() );
-		Element element = projectExtFieldReleCache.get( cacheKey );
+		String cacheKey = ApplicationCache.concreteCacheKey( "ActionListWithCorrelation", correlationId, effectivePerson.getDistinguishedName() );
+		Element element = customExtFieldReleCache.get( cacheKey );
 		
 		if ((null != element) && (null != element.getObjectValue())) {
 			wos = (List<Wo>) element.getObjectValue();
@@ -39,17 +39,17 @@ public class ActionListWithProject extends BaseAction {
 		} else {
 			if( Boolean.TRUE.equals( check ) ){
 				try {
-					projectExtFieldReles = projectExtFieldReleQueryService.listReleWithProject(projectId);
-					if( ListTools.isEmpty( projectExtFieldReles )) {
-						projectExtFieldReles = new ArrayList<>();
+					customExtFieldReles = customExtFieldReleQueryService.listReleWithCorrelation(correlationId);
+					if( ListTools.isEmpty( customExtFieldReles )) {
+						customExtFieldReles = new ArrayList<>();
 					}
-					wos = Wo.copier.copy( projectExtFieldReles );						
+					wos = Wo.copier.copy( customExtFieldReles );						
 					SortTools.asc( wos, "createTime");						
-					projectExtFieldReleCache.put(new Element(cacheKey, wos));
+					customExtFieldReleCache.put(new Element(cacheKey, wos));
 					result.setData(wos);	
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ProjectExtFieldReleQueryException(e, "根据用户拥有的项目扩展属性关联信息列表时发生异常。");
+					Exception exception = new CustomExtFieldReleQueryException(e, "根据关联ID查询对应的扩展属性信息列表时发生异常。");
 					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
@@ -58,7 +58,7 @@ public class ActionListWithProject extends BaseAction {
 		return result;
 	}
 
-	public static class Wo extends ProjectExtFieldRele {
+	public static class Wo extends CustomExtFieldRele {
 		
 		private Long rank;
 
@@ -74,7 +74,7 @@ public class ActionListWithProject extends BaseAction {
 
 		public static List<String> Excludes = new ArrayList<String>();
 
-		static WrapCopier<ProjectExtFieldRele, Wo> copier = WrapCopierFactory.wo( ProjectExtFieldRele.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
+		static WrapCopier<CustomExtFieldRele, Wo> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
 
 	}
 }

+ 69 - 42
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionSave.java

@@ -20,7 +20,8 @@ import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.teamwork.core.entity.Dynamic;
 import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.Task;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
 public class ActionSave extends BaseAction {
 
@@ -28,9 +29,10 @@ public class ActionSave extends BaseAction {
 
 	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
-		ProjectExtFieldRele projectExtFieldRele = null;
-		ProjectExtFieldRele projectExtFieldRele_old = null;
+		CustomExtFieldRele customExtFieldRele = null;
+		CustomExtFieldRele customExtFieldRele_old = null;
 		Project project = null;
+		Task task = null;
 		Wi wi = null;
 		Wo wo = new Wo();
 		String fieldName = null;
@@ -38,45 +40,59 @@ public class ActionSave extends BaseAction {
 
 		try {
 			wi = this.convertToWrapIn( jsonElement, Wi.class );
-			projectExtFieldRele = Wi.copier.copy( wi );
+			customExtFieldRele = Wi.copier.copy( wi );
 		} catch (Exception e) {
 			check = false;
-			Exception exception = new ProjectExtFieldRelePersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
+			Exception exception = new CustomExtFieldRelePersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
 			result.error(exception);
 			logger.error(e, effectivePerson, request, null);
 		}
 		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( projectExtFieldRele.getProjectId() )) {
+		/*if( Boolean.TRUE.equals( check ) ){
+			if( StringUtils.isEmpty( customExtFieldRele.getProjectId() )) {
 				check = false;
 				Exception exception = new ProjectFlagForQueryEmptyException();
 				result.error( exception );
 			}
-		}
+		}*/
 		
 		if( Boolean.TRUE.equals( check ) ){
-			try {
-				project = projectQueryService.get( projectExtFieldRele.getProjectId() );
-				if ( project == null) {
+			if(StringUtils.isNotEmpty( customExtFieldRele.getCorrelationId() )){
+				try {
+					if(StringUtils.equals(customExtFieldRele.getType(), "project")){
+						project = projectQueryService.get( customExtFieldRele.getCorrelationId() );
+						if ( project == null) {
+							check = false;
+							Exception exception = new ProjectNotExistsException( customExtFieldRele.getCorrelationId() );
+							result.error( exception );
+						}
+					}
+					if(StringUtils.equals(customExtFieldRele.getType(), "task")){
+						task = taskQueryService.get( customExtFieldRele.getCorrelationId() );
+						if ( task == null) {
+							check = false;
+							Exception exception = new TaskNotExistsException( customExtFieldRele.getCorrelationId() );
+							result.error( exception );
+						}
+					}
+					
+				} catch (Exception e) {
 					check = false;
-					Exception exception = new ProjectNotExistsException( projectExtFieldRele.getProjectId() );
-					result.error( exception );
+					Exception exception = new CustomExtFieldRelePersistException(e, "根据指定flag查询应用项目信息对象时发生异常。flag:" +  customExtFieldRele.getCorrelationId() );
+					result.error(exception);
+					logger.error(e, effectivePerson, request, null);
 				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectExtFieldRelePersistException(e, "根据指定flag查询应用项目信息对象时发生异常。flag:" +  projectExtFieldRele.getProjectId() );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
 			}
+			
 		}
 		
 		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isNotEmpty( projectExtFieldRele.getId() )) {
+			if( StringUtils.isNotEmpty( customExtFieldRele.getId() )) {
 				try {
-					projectExtFieldRele_old = projectExtFieldReleQueryService.get( projectExtFieldRele.getId() );
+					customExtFieldRele_old = customExtFieldReleQueryService.get( customExtFieldRele.getId() );
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ProjectExtFieldReleQueryException(e, "系统在根据ID查询指定的扩展属性关联信息时发生异常。ID:" +  projectExtFieldRele.getId() );
+					Exception exception = new CustomExtFieldReleQueryException(e, "系统在根据ID查询指定的扩展属性关联信息时发生异常。ID:" +  customExtFieldRele.getId() );
 					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
@@ -84,16 +100,16 @@ public class ActionSave extends BaseAction {
 		}
 		
 		if( Boolean.TRUE.equals( check ) ){
-			if( projectExtFieldRele_old == null ) { //新建
-				fieldName = projectExtFieldReleQueryService.getNextUseableExtFieldName( projectExtFieldRele.getProjectId(), projectExtFieldRele.getDisplayType() );
+			if( customExtFieldRele_old == null ) { //新建
+				fieldName = customExtFieldReleQueryService.getNextUseableExtFieldName( customExtFieldRele.getCorrelationId(), customExtFieldRele.getDisplayType() );
 			}else {
 				//判断是否属性在富文本和普通 文本之间发生了变换
-				if( ("RICHTEXT".equals( wi.getDisplayType() ) && !"RICHTEXT".equals( projectExtFieldRele_old.getDisplayType() ))
-						|| !"RICHTEXT".equals( wi.getDisplayType() ) && "RICHTEXT".equals( projectExtFieldRele_old.getDisplayType() ) ) {
+				if( (StringUtils.equals("RICHTEXT",wi.getDisplayType()) && !StringUtils.equals("RICHTEXT",customExtFieldRele_old.getDisplayType()))
+						|| !StringUtils.equals("RICHTEXT",wi.getDisplayType()) && StringUtils.equals("RICHTEXT",customExtFieldRele_old.getDisplayType())) {
 					//判断当前所需要的类型的备用属性是否足够
-					fieldName = projectExtFieldReleQueryService.getNextUseableExtFieldName( projectExtFieldRele.getProjectId(), projectExtFieldRele.getDisplayType() );
+					fieldName = customExtFieldReleQueryService.getNextUseableExtFieldName( customExtFieldRele.getCorrelationId(), customExtFieldRele.getDisplayType() );
 				}else {
-					fieldName = projectExtFieldRele_old.getExtFieldName();
+					fieldName = customExtFieldRele_old.getExtFieldName();
 				}
 			}
 		}
@@ -102,33 +118,33 @@ public class ActionSave extends BaseAction {
 			if( StringUtils.isEmpty(  fieldName )) {
 				//备用属性已经用完了,无法再添加新的属性
 				check = false;
-				Exception exception = new ProjectExtFieldRelePersistException( "扩展属性不足,系统无法为该项目分配["+ projectExtFieldRele.getDisplayType() +"]。"  );
+				Exception exception = new CustomExtFieldRelePersistException( "扩展属性不足(备用属性已用完),系统无法为该对象分配["+ customExtFieldRele.getDisplayType() +"]。"  );
 				result.error(exception);
 			}else {
-				projectExtFieldRele.setExtFieldName( fieldName );
+				customExtFieldRele.setExtFieldName( fieldName );
 			}
 		}
 
 		if( Boolean.TRUE.equals( check ) ){
 			try {
 				
-				projectExtFieldRele = projectExtFieldRelePersistService.save( projectExtFieldRele, effectivePerson );
+				customExtFieldRele = customExtFieldRelePersistService.save( customExtFieldRele, effectivePerson );
 				
 				// 更新缓存
-				ApplicationCache.notify( ProjectExtFieldRele.class );
+				ApplicationCache.notify( CustomExtFieldRele.class );
 				
-				wo.setId( projectExtFieldRele.getId()  );
+				wo.setId( customExtFieldRele.getId()  );
 				
 			} catch (Exception e) {
 				check = false;
-				Exception exception = new ProjectExtFieldRelePersistException(e, "项目扩展属性关联信息保存时发生异常。");
+				Exception exception = new CustomExtFieldRelePersistException(e, "扩展属性关联信息保存时发生异常。");
 				result.error(exception);
 				logger.error(e, effectivePerson, request, null);
 			}			
 		}
 		if( Boolean.TRUE.equals( check ) ){
 			try {					
-				Dynamic dynamic = dynamicPersistService.projectExtFieldReleSaveDynamic(projectExtFieldRele_old, projectExtFieldRele, effectivePerson);
+				Dynamic dynamic = dynamicPersistService.projectExtFieldReleSaveDynamic(customExtFieldRele_old, customExtFieldRele, effectivePerson);
 				if( dynamic != null ) {
 					List<WoDynamic> dynamics = new ArrayList<>();
 					dynamics.add( WoDynamic.copier.copy( dynamic ) );
@@ -148,23 +164,26 @@ public class ActionSave extends BaseAction {
 		
 		@FieldDescribe("ID,为空时为新建")
 		private String id;
-		
-		@FieldDescribe("项目ID(必填)")
-		private String projectId;
 
 		@FieldDescribe("显示属性名称(必填)")
 		private String displayName;
 
 		@FieldDescribe("显示方式:TEXT|RADIO|CHECKBOX|SELECT|MUTISELECT|RICHTEXT(必填)")
 		private String displayType="TEXT";
+		
+		@FieldDescribe("类型:project|task(必填)")
+		private String type;
 
 		@FieldDescribe("说明信息(非必填)")
 		private String description;
+		
+		@FieldDescribe("关联ID((非必填)")
+		private String correlationId;
 
 		@FieldDescribe("选择荐的备选数据,数据Json, displayType=RADIO|CHECKBOX|SELECT|MUTISELECT时必须填写,否则无选择项")
 		private String optionsData;
 		
-		public static WrapCopier<Wi, ProjectExtFieldRele> copier = WrapCopierFactory.wi( Wi.class, ProjectExtFieldRele.class, null, null );
+		public static WrapCopier<Wi, CustomExtFieldRele> copier = WrapCopierFactory.wi( Wi.class, CustomExtFieldRele.class, null, null );
 		
 		public String getDisplayType() {
 			return displayType;
@@ -190,12 +209,12 @@ public class ActionSave extends BaseAction {
 			this.id = id;
 		}
 
-		public String getProjectId() {
-			return projectId;
+		public String getCorrelationId() {
+			return correlationId;
 		}
 
-		public void setProjectId(String projectId) {
-			this.projectId = projectId;
+		public void setCorrelationId(String correlationId) {
+			this.correlationId = correlationId;
 		}
 
 		public String getDisplayName() {
@@ -205,6 +224,14 @@ public class ActionSave extends BaseAction {
 		public void setDisplayName(String displayName) {
 			this.displayName = displayName;
 		}
+		
+		public String getType() {
+			return type;
+		}
+
+		public void setType(String type) {
+			this.type = type;
+		}
 
 		public String getDescription() {
 			return description;

+ 8 - 6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/BaseAction.java

@@ -3,23 +3,25 @@ package com.x.teamwork.assemble.control.jaxrs.extfield;
 import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.jaxrs.StandardJaxrsAction;
 import com.x.teamwork.assemble.control.service.DynamicPersistService;
-import com.x.teamwork.assemble.control.service.ProjectExtFieldRelePersistService;
-import com.x.teamwork.assemble.control.service.ProjectExtFieldReleQueryService;
+import com.x.teamwork.assemble.control.service.CustomExtFieldRelePersistService;
+import com.x.teamwork.assemble.control.service.CustomExtFieldReleQueryService;
 import com.x.teamwork.assemble.control.service.ProjectQueryService;
 import com.x.teamwork.assemble.control.service.SystemConfigQueryService;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.assemble.control.service.TaskQueryService;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
 import net.sf.ehcache.Ehcache;
 
 public class BaseAction extends StandardJaxrsAction {
 
-	protected Ehcache projectExtFieldReleCache = ApplicationCache.instance().getCache( ProjectExtFieldRele.class );
+	protected Ehcache customExtFieldReleCache = ApplicationCache.instance().getCache( CustomExtFieldRele.class );
 	
-	protected 	ProjectExtFieldReleQueryService projectExtFieldReleQueryService = new ProjectExtFieldReleQueryService();
+	protected 	CustomExtFieldReleQueryService customExtFieldReleQueryService = new CustomExtFieldReleQueryService();
 	
-	protected 	ProjectExtFieldRelePersistService projectExtFieldRelePersistService = new ProjectExtFieldRelePersistService();
+	protected 	CustomExtFieldRelePersistService customExtFieldRelePersistService = new CustomExtFieldRelePersistService();
 	
 	protected 	ProjectQueryService projectQueryService = new ProjectQueryService();
+	protected 	TaskQueryService taskQueryService = new TaskQueryService();
 	
 	protected 	DynamicPersistService dynamicPersistService = new DynamicPersistService();
 	

+ 17 - 17
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldReleAction.java → o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleAction.java

@@ -28,12 +28,12 @@ import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 
 @Path("extfield")
-@JaxrsDescribe("项目扩展属性关联信息管理")
-public class ProjectExtFieldReleAction extends StandardJaxrsAction {
+@JaxrsDescribe("扩展属性关联信息管理")
+public class CustomExtFieldReleAction extends StandardJaxrsAction {
 
-	private Logger logger = LoggerFactory.getLogger(ProjectExtFieldReleAction.class);
+	private Logger logger = LoggerFactory.getLogger(CustomExtFieldReleAction.class);
 	
-	@JaxrsMethodDescribe(value = "查询所有项目扩展属性信息.", action = ActionListAllExtFields.class)
+	@JaxrsMethodDescribe(value = "查询所有扩展属性信息.", action = ActionListAllExtFields.class)
 	@GET
 	@Path("list/fields/all")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@@ -51,7 +51,7 @@ public class ProjectExtFieldReleAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 	
-	@JaxrsMethodDescribe(value = "根据指定ID查询项目扩展属性关联信息.", action = ActionGet.class)
+	@JaxrsMethodDescribe(value = "根据指定ID查询扩展属性关联信息.", action = ActionGet.class)
 	@GET
 	@Path("rele/{id}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@@ -69,19 +69,19 @@ public class ProjectExtFieldReleAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 	
-	@JaxrsMethodDescribe(value = "根据项目ID,需要的扩展属性类别获取下一个可用的属性名称.", action = ActionGetNextUseableExtFieldName.class)
+	@JaxrsMethodDescribe(value = "根据关联ID,需要的扩展属性类别获取下一个可用的属性名称.", action = ActionGetNextUseableExtFieldName.class)
 	@GET
-	@Path("next/field/{projectId}/{fieldType}")
+	@Path("next/field/{correlationId}/{fieldType}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void getNextUseableFieldName(@Suspended final AsyncResponse asyncResponse, 
 			@Context HttpServletRequest request,
-			@JaxrsParameterDescribe("项目ID") @PathParam("projectId") String projectId,
+			@JaxrsParameterDescribe("关联ID") @PathParam("correlationId") String correlationId,
 			@JaxrsParameterDescribe("属性类别:TEXT|SELECT|MUTISELECT|RICHTEXT|DATE|DATETIME|PERSON|IDENTITY|UNIT|GROUP|") @PathParam("fieldType") String fieldType ) {
 		ActionResult<ActionGetNextUseableExtFieldName.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);	
 		try {
-			result = new ActionGetNextUseableExtFieldName().execute( request, effectivePerson, projectId, fieldType );
+			result = new ActionGetNextUseableExtFieldName().execute( request, effectivePerson, correlationId, fieldType );
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);
@@ -89,18 +89,18 @@ public class ProjectExtFieldReleAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 	
-	@JaxrsMethodDescribe(value = "查询用户创建的所有项目扩展属性关联信息列表.", action = ActionListWithProject.class)
+	@JaxrsMethodDescribe(value = "根据关联ID查询用户创建的所有扩展属性关联信息列表.", action = ActionListWithCorrelation.class)
 	@GET
-	@Path("list/{projectId}")
+	@Path("list/{correlationId}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void listFieldsWithProject(@Suspended final AsyncResponse asyncResponse, 
 			@Context HttpServletRequest request,
-			@JaxrsParameterDescribe("项目ID") @PathParam("projectId") String projectId ) {
-		ActionResult<List<ActionListWithProject.Wo>> result = new ActionResult<>();
+			@JaxrsParameterDescribe("关联ID") @PathParam("correlationId") String correlationId ) {
+		ActionResult<List<ActionListWithCorrelation.Wo>> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);	
 		try {
-			result = new ActionListWithProject().execute( request, effectivePerson, projectId );
+			result = new ActionListWithCorrelation().execute( request, effectivePerson, correlationId );
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);
@@ -108,14 +108,14 @@ public class ProjectExtFieldReleAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 	
-	@JaxrsMethodDescribe(value = "创建或者更新一个项目扩展属性关联信息.", action = ActionSave.class)
+	@JaxrsMethodDescribe(value = "创建或者更新一个扩展属性关联信息.", action = ActionSave.class)
 	@POST
 	@Path("relevance")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void save(@Suspended final AsyncResponse asyncResponse, 
 			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("需要保存的项目扩展属性关联信息") JsonElement jsonElement ) {
+			@JaxrsParameterDescribe("需要保存的扩展属性关联信息") JsonElement jsonElement ) {
 		ActionResult<ActionSave.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
@@ -127,7 +127,7 @@ public class ProjectExtFieldReleAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 	
-	@JaxrsMethodDescribe(value = "根据标识删除项目扩展属性关联信息.", action = ActionDelete.class)
+	@JaxrsMethodDescribe(value = "根据标识删除扩展属性关联信息.", action = ActionDelete.class)
 	@DELETE
 	@Path("relevance/{id}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)

+ 12 - 0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleFlagForQueryEmptyException.java

@@ -0,0 +1,12 @@
+package com.x.teamwork.assemble.control.jaxrs.extfield;
+
+import com.x.base.core.project.exception.PromptException;
+
+class CustomExtFieldReleFlagForQueryEmptyException extends PromptException {
+
+	private static final long serialVersionUID = 1859164370743532895L;
+
+	CustomExtFieldReleFlagForQueryEmptyException() {
+		super("查询的扩展属性关联信息ID为空,无法继续查询数据。" );
+	}
+}

+ 12 - 0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleNotExistsException.java

@@ -0,0 +1,12 @@
+package com.x.teamwork.assemble.control.jaxrs.extfield;
+
+import com.x.base.core.project.exception.PromptException;
+
+class CustomExtFieldReleNotExistsException extends PromptException {
+
+	private static final long serialVersionUID = 1859164370743532895L;
+
+	CustomExtFieldReleNotExistsException( String id ) {
+		super("指定ID的扩展属性关联信息不存在。ID:" + id );
+	}
+}

+ 20 - 0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldRelePersistException.java

@@ -0,0 +1,20 @@
+package com.x.teamwork.assemble.control.jaxrs.extfield;
+
+import com.x.base.core.project.exception.PromptException;
+
+class CustomExtFieldRelePersistException extends PromptException {
+
+	private static final long serialVersionUID = 1859164370743532895L;
+
+	CustomExtFieldRelePersistException( Throwable e ) {
+		super("系统在保存扩展属性关联信息时发生异常。" , e );
+	}
+	
+	CustomExtFieldRelePersistException( Throwable e, String message ) {
+		super("系统在保存扩展属性关联信息时发生异常。Message:" + message, e );
+	}
+	
+	CustomExtFieldRelePersistException( String message ) {
+		super("系统在保存扩展属性关联信息时发生异常。Message:" + message );
+	}
+}

+ 20 - 0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleQueryException.java

@@ -0,0 +1,20 @@
+package com.x.teamwork.assemble.control.jaxrs.extfield;
+
+import com.x.base.core.project.exception.PromptException;
+
+class CustomExtFieldReleQueryException extends PromptException {
+
+	private static final long serialVersionUID = 1859164370743532895L;
+
+	CustomExtFieldReleQueryException( Throwable e ) {
+		super("系统在查询扩展属性关联信息时发生异常。" , e );
+	}
+	
+	CustomExtFieldReleQueryException( Throwable e, String message ) {
+		super("系统在查询扩展属性关联信息时发生异常。Message:" + message, e );
+	}
+	
+	CustomExtFieldReleQueryException(  String message ) {
+		super("系统在查询扩展属性关联信息时发生异常。Message:" + message );
+	}
+}

+ 0 - 12
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldReleFlagForQueryEmptyException.java

@@ -1,12 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ProjectExtFieldReleFlagForQueryEmptyException extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	ProjectExtFieldReleFlagForQueryEmptyException() {
-		super("查询的项目扩展属性关联信息ID为空,无法继续查询数据。" );
-	}
-}

+ 0 - 12
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldReleNotExistsException.java

@@ -1,12 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ProjectExtFieldReleNotExistsException extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	ProjectExtFieldReleNotExistsException( String id ) {
-		super("指定ID的项目扩展属性关联信息不存在。ID:" + id );
-	}
-}

+ 0 - 20
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldRelePersistException.java

@@ -1,20 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ProjectExtFieldRelePersistException extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	ProjectExtFieldRelePersistException( Throwable e ) {
-		super("系统在保存项目扩展属性关联信息时发生异常。" , e );
-	}
-	
-	ProjectExtFieldRelePersistException( Throwable e, String message ) {
-		super("系统在保存项目扩展属性关联信息时发生异常。Message:" + message, e );
-	}
-	
-	ProjectExtFieldRelePersistException( String message ) {
-		super("系统在保存项目扩展属性关联信息时发生异常。Message:" + message );
-	}
-}

+ 0 - 20
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ProjectExtFieldReleQueryException.java

@@ -1,20 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ProjectExtFieldReleQueryException extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	ProjectExtFieldReleQueryException( Throwable e ) {
-		super("系统在查询项目扩展属性关联信息时发生异常。" , e );
-	}
-	
-	ProjectExtFieldReleQueryException( Throwable e, String message ) {
-		super("系统在查询项目扩展属性关联信息时发生异常。Message:" + message, e );
-	}
-	
-	ProjectExtFieldReleQueryException(  String message ) {
-		super("系统在查询项目扩展属性关联信息时发生异常。Message:" + message );
-	}
-}

+ 12 - 0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/TaskNotExistsException.java

@@ -0,0 +1,12 @@
+package com.x.teamwork.assemble.control.jaxrs.extfield;
+
+import com.x.base.core.project.exception.PromptException;
+
+class TaskNotExistsException extends PromptException {
+
+	private static final long serialVersionUID = 1859164370743532895L;
+
+	TaskNotExistsException( String id ) {
+		super("指定ID的任务信息不存在。ID:" + id );
+	}
+}

+ 21 - 10
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionGet.java

@@ -34,7 +34,7 @@ public class ActionGet extends BaseAction {
 		Task task = null;
 		TaskDetail taskDetail = null;
 		TaskExtField taskExtField = null;
-		List<ProjectExtFieldRele> extFieldReleList = null;
+		List<CustomExtFieldRele> extFieldReleList = null;
 		List<TaskTag> tags = null;
 		Boolean check = true;
 		WrapOutControl control = null;
@@ -92,10 +92,10 @@ public class ActionGet extends BaseAction {
 			
 			if( Boolean.TRUE.equals( check ) ){
 				try {
-					extFieldReleList = projectExtFieldReleQueryService.listReleWithProject( task.getProject() );
+					extFieldReleList = customExtFieldReleQueryService.listReleWithCorrelation( task.getId() ); 
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定projectId查询项目扩展列配置信息对象时发生异常。projectId:" + task.getProject());
+					Exception exception = new TaskQueryException(e, "根据指定taskId查询任务扩展列配置信息对象时发生异常。taskId:" + task.getId());
 					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
@@ -357,14 +357,17 @@ public class ActionGet extends BaseAction {
 	
 	public static class WoExtFieldRele{
 
-		@FieldDescribe("项目ID(必填)")
-		private String projectId;
+		@FieldDescribe("关联ID(必填)")
+		private String correlationId;
 
 		@FieldDescribe("备用列名(必填)")
 		private String extFieldName;
 
 		@FieldDescribe("显示属性名称(必填)")
 		private String displayName;
+		
+		@FieldDescribe("类型:project|task(必填)")
+		private String type;
 
 		@FieldDescribe("显示方式:TEXT|SELECT|MUTISELECT|RICHTEXT|DATE|DATETIME|PERSON|IDENTITY|UNIT|GROUP|(必填)")
 		private String displayType="TEXT";
@@ -386,7 +389,7 @@ public class ActionGet extends BaseAction {
 
 		public static List<String> Excludes = new ArrayList<String>();
 
-		static WrapCopier<ProjectExtFieldRele, WoExtFieldRele> copier = WrapCopierFactory.wo( ProjectExtFieldRele.class, WoExtFieldRele.class, null, ListTools.toList(JpaObject.FieldsInvisible));
+		static WrapCopier<CustomExtFieldRele, WoExtFieldRele> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, WoExtFieldRele.class, null, ListTools.toList(JpaObject.FieldsInvisible));
 
 		public String getExtFieldName() {
 			return extFieldName;
@@ -403,13 +406,21 @@ public class ActionGet extends BaseAction {
 		public void setDisplayName(String displayName) {
 			this.displayName = displayName;
 		}
+		
+		public String getType() {
+			return type;
+		}
+
+		public void setType(String type) {
+			this.type = type;
+		}
 
-		public String getProjectId() {
-			return projectId;
+		public String getCorrelationId() {
+			return correlationId;
 		}
 
-		public void setProjectId(String projectId) {
-			this.projectId = projectId;
+		public void setCorrelationId(String correlationId) {
+			this.correlationId = correlationId;
 		}
 
 		public String getDisplayType() {

+ 2 - 2
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListSubTaskWithTaskId.java

@@ -16,7 +16,7 @@ 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.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 import com.x.teamwork.core.entity.Task;
 import com.x.teamwork.core.entity.TaskTag;
 
@@ -132,7 +132,7 @@ public class ActionListSubTaskWithTaskId extends BaseAction {
 
 		public static List<String> Excludes = new ArrayList<String>();
 
-		static WrapCopier<ProjectExtFieldRele, WoExtFieldRele> copier = WrapCopierFactory.wo( ProjectExtFieldRele.class, WoExtFieldRele.class, null, ListTools.toList(JpaObject.FieldsInvisible));
+		static WrapCopier<CustomExtFieldRele, WoExtFieldRele> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, WoExtFieldRele.class, null, ListTools.toList(JpaObject.FieldsInvisible));
 
 		public String getExtFieldName() {
 			return extFieldName;

+ 1 - 0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionSave.java

@@ -368,6 +368,7 @@ public class ActionSave extends BaseAction {
 		ApplicationCache.notify( TaskView.class );
 		ApplicationCache.notify( Review.class );	
 		ApplicationCache.notify( TaskGroup.class );	
+		ApplicationCache.notify( TaskExtField.class );	
 		
 		dynamics.addAll( tagDynamics );
 		wo.setDynamics( WoDynamic.copier.copy( dynamics ) );

+ 2 - 2
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionUpdateSingleProperty.java

@@ -22,7 +22,7 @@ import com.x.teamwork.assemble.control.service.BatchOperationPersistService;
 import com.x.teamwork.assemble.control.service.BatchOperationProcessService;
 import com.x.teamwork.assemble.control.service.MessageFactory;
 import com.x.teamwork.core.entity.Dynamic;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 import com.x.teamwork.core.entity.Review;
 import com.x.teamwork.core.entity.Task;
 import com.x.teamwork.core.entity.TaskDetail;
@@ -282,7 +282,7 @@ public class ActionUpdateSingleProperty extends BaseAction {
 	}
 	
 	private Dynamic changeExtTaskProperty( String personName,  String projectId, String taskId, String property, String oldValue, String mainValue, String secondaryValue, String dataType ) throws Exception {
-		ProjectExtFieldRele projectExtFieldRele = projectExtFieldReleQueryService.getExtFieldRele(projectId, property);
+		CustomExtFieldRele projectExtFieldRele = customExtFieldReleQueryService.getExtFieldRele(projectId, property);
 		if( projectExtFieldRele == null || StringUtils.isEmpty( projectExtFieldRele.getDisplayName() )) {
 			Exception exception = new TaskPersistException( "工作任务未配置扩展属性:" + property );
 			throw exception;

+ 1 - 1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/BaseAction.java

@@ -23,7 +23,7 @@ public class BaseAction extends StandardJaxrsAction {
 	
 	protected 	ProjectQueryService projectQueryService = new ProjectQueryService();
 	
-	protected 	ProjectExtFieldReleQueryService projectExtFieldReleQueryService = new ProjectExtFieldReleQueryService();
+	protected 	CustomExtFieldReleQueryService customExtFieldReleQueryService = new CustomExtFieldReleQueryService();
 	
 	protected 	TaskPersistService taskPersistService = new TaskPersistService();
 	

+ 15 - 15
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectExtFieldRelePersistService.java → o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/CustomExtFieldRelePersistService.java

@@ -5,14 +5,14 @@ import org.apache.commons.lang3.StringUtils;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.project.http.EffectivePerson;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
-public class ProjectExtFieldRelePersistService {
+public class CustomExtFieldRelePersistService {
 
-	private ProjectExtFieldReleService projectExtFieldReleService = new ProjectExtFieldReleService();
+	private CustomExtFieldReleService customExtFieldReleService = new CustomExtFieldReleService();
 	
 	/**
-	 * 删除项目扩展属性信息
+	 * 删除扩展属性信息
 	 * @param flag
 	 * @param effectivePerson
 	 * @throws Exception
@@ -22,29 +22,29 @@ public class ProjectExtFieldRelePersistService {
 			throw new Exception("id is empty.");
 		}
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			projectExtFieldReleService.delete( emc, id );		
+			customExtFieldReleService.delete( emc, id );		
 		} catch (Exception e) {
 			throw e;
 		}
 	}
 
 	/**
-	 * 保存项目扩展属性关联信息
+	 * 保存扩展属性关联信息
 	 * @param object
 	 * @param effectivePerson
 	 * @return
 	 * @throws Exception
 	 */
-	public ProjectExtFieldRele save( ProjectExtFieldRele object, EffectivePerson effectivePerson ) throws Exception {
+	public CustomExtFieldRele save( CustomExtFieldRele object, EffectivePerson effectivePerson ) throws Exception {
 		if ( object == null) {
 			throw new Exception("object is null.");
 		}
 		if ( effectivePerson == null ) {
 			throw new Exception("effectivePerson is null.");
 		}
-		if( StringUtils.isEmpty( object.getProjectId() )  ){
-			throw new Exception("projectId can not empty for save field rele.");
-		}
+		/*if( StringUtils.isEmpty( object.getCorrelationId())  ){
+			throw new Exception("correlationId can not empty for save field rele.");
+		}*/
 		if( StringUtils.isEmpty( object.getExtFieldName() )  ){
 			throw new Exception("extFieldName can not empty for save field rele.");
 		}
@@ -52,7 +52,7 @@ public class ProjectExtFieldRelePersistService {
 			throw new Exception("displayName can not empty for save field rele.");
 		}
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			object = projectExtFieldReleService.save( emc, object );
+			object = customExtFieldReleService.save( emc, object );
 		} catch (Exception e) {
 			throw e;
 		}
@@ -68,13 +68,13 @@ public class ProjectExtFieldRelePersistService {
 	 * @return
 	 * @throws Exception
 	 */
-	public ProjectExtFieldRele save( String projectId, String extFieldName, String displayName, EffectivePerson effectivePerson ) throws Exception {
+	public CustomExtFieldRele save( String projectId, String extFieldName, String displayName, EffectivePerson effectivePerson ) throws Exception {
 		if ( effectivePerson == null ) {
 			throw new Exception("effectivePerson is null.");
 		}
-		if( StringUtils.isEmpty( projectId )  ){
+		/*if( StringUtils.isEmpty( projectId )  ){
 			throw new Exception("projectId can not empty for save field rele.");
-		}
+		}*/
 		if( StringUtils.isEmpty( extFieldName )  ){
 			throw new Exception("extFieldName can not empty for save field rele.");
 		}
@@ -82,7 +82,7 @@ public class ProjectExtFieldRelePersistService {
 			throw new Exception("displayName can not empty for save field rele.");
 		}
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return projectExtFieldReleService.save(emc, projectId, extFieldName, displayName);
+			return customExtFieldReleService.save(emc, projectId, extFieldName, displayName);
 		} catch (Exception e) {
 			throw e;
 		}

+ 22 - 22
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectExtFieldReleQueryService.java → o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/CustomExtFieldReleQueryService.java

@@ -8,59 +8,59 @@ import org.apache.commons.lang3.StringUtils;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.project.tools.ListTools;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 import com.x.teamwork.core.entity.tools.FieldInfo;
-import com.x.teamwork.core.entity.tools.ProjectExtField;
+import com.x.teamwork.core.entity.tools.CustomExtField;
 
 
 /**
  * 对项目扩展属性信息查询的服务
  */
-public class ProjectExtFieldReleQueryService {
+public class CustomExtFieldReleQueryService {
 
-	private ProjectExtFieldReleService projectExtFieldReleService = new ProjectExtFieldReleService();
+	private CustomExtFieldReleService customExtFieldReleService = new CustomExtFieldReleService();
 	
 
-	public List<ProjectExtFieldRele> list(List<String> ids ) throws Exception {
+	public List<CustomExtFieldRele> list(List<String> ids ) throws Exception {
 		if ( ListTools.isEmpty( ids )) {
 			return null;
 		}
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return projectExtFieldReleService.list( emc, ids );
+			return customExtFieldReleService.list( emc, ids );
 		} catch (Exception e) {
 			throw e;
 		}
 	}	
 	
 	/**
-	 * 根据项目扩展属性关联信息的标识查询项目扩展属性关联信息
+	 * 根据扩展属性关联信息的标识查询项目扩展属性关联信息
 	 * @param id
 	 * @return
 	 * @throws Exception
 	 */
-	public ProjectExtFieldRele get( String id ) throws Exception {
+	public CustomExtFieldRele get( String id ) throws Exception {
 		if ( StringUtils.isEmpty( id )) {
 			return null;
 		}
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return projectExtFieldReleService.get(emc, id );
+			return customExtFieldReleService.get(emc, id );
 		} catch (Exception e) {
 			throw e;
 		}
 	}
 	
 	/**
-	 * 根据项目ID查询项目关联的所有扩展属性关联信息
-	 * @param projectId
+	 * 根据项目ID查询项目/任务关联的所有扩展属性关联信息
+	 * @param correlationId
 	 * @return
 	 * @throws Exception
 	 */
-	public List<ProjectExtFieldRele> listReleWithProject( String projectId ) throws Exception {
-		if (StringUtils.isEmpty(projectId)) {
+	public List<CustomExtFieldRele> listReleWithCorrelation( String correlationId ) throws Exception {
+		if (StringUtils.isEmpty(correlationId)) {
 			return new ArrayList<>();
 		}
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return projectExtFieldReleService.listReleWithProject(emc, projectId);
+			return customExtFieldReleService.listReleWithCorrelation(emc, correlationId);
 		} catch (Exception e) {
 			throw e;
 		}
@@ -74,13 +74,13 @@ public class ProjectExtFieldReleQueryService {
 			throw new Exception("extFieldName can not empty for save field rele.");
 		}
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return projectExtFieldReleService.getExtFieldDisplayName(emc, projectId, extFieldName);
+			return customExtFieldReleService.getExtFieldDisplayName(emc, projectId, extFieldName);
 		} catch (Exception e) {
 			throw e;
 		}
 	}
 	
-	public ProjectExtFieldRele getExtFieldRele(String projectId, String extFieldName) throws Exception {
+	public CustomExtFieldRele getExtFieldRele(String projectId, String extFieldName) throws Exception {
 		if( StringUtils.isEmpty( projectId )  ){
 			throw new Exception("projectId can not empty for save field rele.");
 		}
@@ -88,7 +88,7 @@ public class ProjectExtFieldReleQueryService {
 			throw new Exception("extFieldName can not empty for save field rele.");
 		}
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return projectExtFieldReleService.getExtFieldRele(emc, projectId, extFieldName);
+			return customExtFieldReleService.getExtFieldRele(emc, projectId, extFieldName);
 		} catch (Exception e) {
 			throw e;
 		}
@@ -96,16 +96,16 @@ public class ProjectExtFieldReleQueryService {
 
 	/**
 	 * 在可用的扩展属性里选择一个未占用的属性名
-	 * @param projectId
+	 * @param correlationId
 	 * @param displayType
 	 * @return
 	 * @throws Exception 
 	 */
-	public String getNextUseableExtFieldName( String projectId, String displayType ) throws Exception {
-		List<ProjectExtFieldRele>  reles = listReleWithProject( projectId );
-		 List<FieldInfo> fieldInfos = ProjectExtField.listAllExtField();
+	public String getNextUseableExtFieldName( String correlationId, String displayType ) throws Exception {
+		List<CustomExtFieldRele>  reles = listReleWithCorrelation( correlationId );
+		 List<FieldInfo> fieldInfos = CustomExtField.listAllExtField();
 		 List<String> fieldNames = new ArrayList<>();
-		 for( ProjectExtFieldRele projectExtFieldRele : reles  ) {
+		 for( CustomExtFieldRele projectExtFieldRele : reles  ) {
 			 fieldNames.add( projectExtFieldRele.getExtFieldName() );
 		 }
 		for( FieldInfo fieldInfo : fieldInfos  ) {

+ 39 - 39
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectExtFieldReleService.java → o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/CustomExtFieldReleService.java

@@ -9,70 +9,70 @@ import com.x.base.core.entity.annotation.CheckPersistType;
 import com.x.base.core.entity.annotation.CheckRemoveType;
 import com.x.base.core.project.tools.ListTools;
 import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 
 /**
  * 对项目扩展属性查询信息的服务
  * 
- * @author O2LEE
+ * @author O2LEE,O2LJ
  */
-class ProjectExtFieldReleService {
+class CustomExtFieldReleService {
 
-	protected List<ProjectExtFieldRele> list(EntityManagerContainer emc, List<String> groupIds) throws Exception {
+	protected List<CustomExtFieldRele> list(EntityManagerContainer emc, List<String> groupIds) throws Exception {
 		Business business = new Business( emc );
-		return business.projectExtFieldReleFactory().list(groupIds);
+		return business.customExtFieldReleFactory().list(groupIds);
 	}
 	
 	/**
-	 * 根据项目扩展属性ID查询项目扩展属性的信息
+	 * 根据扩展属性ID查询项目扩展属性的信息
 	 * @param emc
 	 * @param id
 	 * @return
 	 * @throws Exception 
 	 */
-	protected ProjectExtFieldRele get( EntityManagerContainer emc, String id ) throws Exception {
+	protected CustomExtFieldRele get( EntityManagerContainer emc, String id ) throws Exception {
 		Business business = new Business( emc );
-		return business.projectExtFieldReleFactory().get( id );
+		return business.customExtFieldReleFactory().get( id );
 	}
 
 	/**
-	 * 根据项目ID查询项目关联的所有扩展属性关联信息
+	 * 根据项目或任务ID查询关联的所有扩展属性关联信息
 	 * @param emc
-	 * @param projectId
+	 * @param correlationId
 	 * @return
 	 * @throws Exception 
 	 */
-	protected List<ProjectExtFieldRele> listReleWithProject(EntityManagerContainer emc, String projectId ) throws Exception {
+	protected List<CustomExtFieldRele> listReleWithCorrelation(EntityManagerContainer emc, String correlationId ) throws Exception {
 		Business business = new Business( emc );
-		return business.projectExtFieldReleFactory().listFieldReleObjByProject( projectId );
+		return business.customExtFieldReleFactory().listFieldReleObjByCorrelation( correlationId );
 	}
 	
 	/**
-	 * 根据项目扩展属性ID删除项目扩展属性信息
+	 * 根据扩展属性ID删除项目扩展属性信息
 	 * @param emc
 	 * @param id
 	 * @throws Exception 
 	 */
 	protected void delete( EntityManagerContainer emc, String id ) throws Exception {
-		ProjectExtFieldRele projectExtFieldRele = emc.find( id, ProjectExtFieldRele.class );
-		emc.beginTransaction( ProjectExtFieldRele.class );
-		if( projectExtFieldRele != null ) {
-			emc.remove( projectExtFieldRele , CheckRemoveType.all );
+		CustomExtFieldRele customExtFieldRele = emc.find( id, CustomExtFieldRele.class );
+		emc.beginTransaction( CustomExtFieldRele.class );
+		if( customExtFieldRele != null ) {
+			emc.remove( customExtFieldRele , CheckRemoveType.all );
 		}
 		emc.commit();
 	}
 
 	/**
-	 * 向数据库持久化项目扩展属性信息
+	 * 向数据库持久化扩展属性信息
 	 * @param emc
-	 * @param projectExtFieldRele
+	 * @param customExtFieldRele
 	 * @return
 	 * @throws Exception 
 	 */
-	protected ProjectExtFieldRele save( EntityManagerContainer emc, ProjectExtFieldRele object ) throws Exception {
-		if( StringUtils.isEmpty( object.getProjectId() )  ){
+	protected CustomExtFieldRele save( EntityManagerContainer emc, CustomExtFieldRele object ) throws Exception {
+		/*if( StringUtils.isEmpty( object.getCorrelationId() )  ){
 			throw new Exception("projectId can not empty for save field rele.");
-		}
+		}*/
 		if( StringUtils.isEmpty( object.getExtFieldName() )  ){
 			throw new Exception("extFieldName can not empty for save field rele.");
 		}
@@ -80,20 +80,20 @@ class ProjectExtFieldReleService {
 			throw new Exception("displayName can not empty for save field rele.");
 		}
 		Business business = new Business( emc );
-		ProjectExtFieldRele projectExtFieldRele = null;
-		List<ProjectExtFieldRele> projectExtFieldReleList =  business.projectExtFieldReleFactory().listWithFieldNameAndProject( object.getExtFieldName(), object.getProjectId() );
-		if( ListTools.isNotEmpty( projectExtFieldReleList )) {
-			projectExtFieldRele = projectExtFieldReleList.get( 0 );
-			object.copyTo( projectExtFieldRele );
-			emc.beginTransaction( ProjectExtFieldRele.class );
-			emc.check( projectExtFieldRele, CheckPersistType.all);
+		CustomExtFieldRele customExtFieldRele = null;
+		List<CustomExtFieldRele> customExtFieldReleList =  business.customExtFieldReleFactory().listWithFieldNameAndCorrelation( object.getExtFieldName(), object.getCorrelationId() );
+		if( ListTools.isNotEmpty( customExtFieldReleList )) {
+			customExtFieldRele = customExtFieldReleList.get( 0 );
+			object.copyTo( customExtFieldRele );
+			emc.beginTransaction( CustomExtFieldRele.class );
+			emc.check( customExtFieldRele, CheckPersistType.all);
 			emc.commit();
-			return projectExtFieldRele;
+			return customExtFieldRele;
 		}else {
 			if( StringUtils.isEmpty( object.getId())) {
-				object.setId( ProjectExtFieldRele.createId() );
+				object.setId( CustomExtFieldRele.createId() );
 			}
-			emc.beginTransaction( ProjectExtFieldRele.class );
+			emc.beginTransaction( CustomExtFieldRele.class );
 			emc.persist( object, CheckPersistType.all);
 			emc.commit();
 			return object;
@@ -107,8 +107,8 @@ class ProjectExtFieldReleService {
 	 * @return
 	 * @throws Exception 
 	 */
-	protected ProjectExtFieldRele save( EntityManagerContainer emc, String projectId, String extFieldName,  String displayName ) throws Exception {
-		ProjectExtFieldRele projectExtFieldRele = null;
+	protected CustomExtFieldRele save( EntityManagerContainer emc, String projectId, String extFieldName,  String displayName ) throws Exception {
+		CustomExtFieldRele projectExtFieldRele = null;
 		if( StringUtils.isEmpty( projectId )  ){
 			throw new Exception("projectId can not empty for save field rele.");
 		}
@@ -118,8 +118,8 @@ class ProjectExtFieldReleService {
 		if( StringUtils.isEmpty( displayName )  ){
 			throw new Exception("displayName can not empty for save field rele.");
 		}
-		projectExtFieldRele = new ProjectExtFieldRele();
-		projectExtFieldRele.setProjectId(projectId);
+		projectExtFieldRele = new CustomExtFieldRele();
+		projectExtFieldRele.setCorrelationId(projectId);
 		projectExtFieldRele.setExtFieldName(extFieldName);
 		projectExtFieldRele.setDisplayName(displayName);	
 		return  save( emc, projectExtFieldRele );
@@ -133,14 +133,14 @@ class ProjectExtFieldReleService {
 			throw new Exception("extFieldName can not empty for save field rele.");
 		}
 		Business business = new Business( emc );
-		List<ProjectExtFieldRele> fieldReles = business.projectExtFieldReleFactory().listWithFieldNameAndProject( extFieldName, projectId );
+		List<CustomExtFieldRele> fieldReles = business.customExtFieldReleFactory().listWithFieldNameAndCorrelation( extFieldName, projectId );
 		if(ListTools.isNotEmpty(fieldReles )) {
 			return fieldReles.get(0).getDisplayName();
 		}
 		return null;
 	}
 	
-	public ProjectExtFieldRele getExtFieldRele(EntityManagerContainer emc, String projectId, String extFieldName) throws Exception {
+	public CustomExtFieldRele getExtFieldRele(EntityManagerContainer emc, String projectId, String extFieldName) throws Exception {
 		if( StringUtils.isEmpty( projectId )  ){
 			throw new Exception("projectId can not empty for save field rele.");
 		}
@@ -148,7 +148,7 @@ class ProjectExtFieldReleService {
 			throw new Exception("extFieldName can not empty for save field rele.");
 		}
 		Business business = new Business( emc );
-		List<ProjectExtFieldRele> fieldReles = business.projectExtFieldReleFactory().listWithFieldNameAndProject( extFieldName, projectId );
+		List<CustomExtFieldRele> fieldReles = business.customExtFieldReleFactory().listWithFieldNameAndCorrelation( extFieldName, projectId );
 		if(ListTools.isNotEmpty(fieldReles )) {
 			return fieldReles.get(0);
 		}

+ 4 - 4
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/DynamicPersistService.java

@@ -13,7 +13,7 @@ import com.x.teamwork.core.entity.Attachment;
 import com.x.teamwork.core.entity.Chat;
 import com.x.teamwork.core.entity.Dynamic;
 import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 import com.x.teamwork.core.entity.ProjectGroup;
 import com.x.teamwork.core.entity.ProjectTemplate;
 import com.x.teamwork.core.entity.Task;
@@ -205,7 +205,7 @@ public class DynamicPersistService {
 	 * @return
 	 * @throws Exception
 	 */
-	public Dynamic projectExtFieldReleSaveDynamic( ProjectExtFieldRele object_old, ProjectExtFieldRele object, EffectivePerson effectivePerson ) throws Exception {
+	public Dynamic projectExtFieldReleSaveDynamic( CustomExtFieldRele object_old, CustomExtFieldRele object, EffectivePerson effectivePerson ) throws Exception {
 		if ( object == null) {
 			throw new Exception("object is null.");
 		}
@@ -222,13 +222,13 @@ public class DynamicPersistService {
 	}
 	
 	/**
-	 * 保存项目删除操作动态
+	 * 保存扩展属性信息删除操作动态
 	 * @param object
 	 * @param effectivePerson
 	 * @return
 	 * @throws Exception
 	 */
-	public Dynamic projectExtFieldReleDeleteDynamic( ProjectExtFieldRele object, EffectivePerson effectivePerson ) throws Exception {
+	public Dynamic projectExtFieldReleDeleteDynamic( CustomExtFieldRele object, EffectivePerson effectivePerson ) throws Exception {
 		if ( object == null) {
 			throw new Exception("object is null.");
 		}

+ 15 - 15
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/DynamicService.java

@@ -19,7 +19,7 @@ import com.x.teamwork.core.entity.Chat;
 import com.x.teamwork.core.entity.Dynamic;
 import com.x.teamwork.core.entity.DynamicDetail;
 import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 import com.x.teamwork.core.entity.ProjectGroup;
 import com.x.teamwork.core.entity.ProjectTemplate;
 import com.x.teamwork.core.entity.Task;
@@ -275,7 +275,7 @@ class DynamicService {
 	 * @param personal
 	 * @return
 	 */
-	private Dynamic composeNewDynamic( String objectType, String title, String description, String viewUrl, String optType, ProjectExtFieldRele object,  EffectivePerson effectivePerson, Boolean personal ) {
+	private Dynamic composeNewDynamic( String objectType, String title, String description, String viewUrl, String optType, CustomExtFieldRele object,  EffectivePerson effectivePerson, Boolean personal ) {
 		Dynamic dynamic = composeNewSimpleDynamic(objectType, title, description, viewUrl, optType, effectivePerson, personal );
 		dynamic.setProjectId( object.getId() );
 		dynamic.setProjectTitle( object.getDisplayName() + "(" + object.getExtFieldName() + ")" );
@@ -609,46 +609,46 @@ class DynamicService {
 	}
 	
 	/**
-	 * 组织项目扩展信息配置保存操作动态
+	 * 组织扩展信息配置保存操作动态
 	 * @param object_old
 	 * @param object
 	 * @param effectivePerson
 	 * @return
 	 */
-	protected Dynamic getProjectSaveExtFieldReleDynamic( ProjectExtFieldRele object_old, ProjectExtFieldRele object, EffectivePerson effectivePerson ) {
-		String objectType =  "PROJECT_EXTFIELD_RELE";
+	protected Dynamic getProjectSaveExtFieldReleDynamic( CustomExtFieldRele object_old, CustomExtFieldRele object, EffectivePerson effectivePerson ) {
+		String objectType =  "CUSTOM_EXTFIELD_RELE";
 		String optType =  "UPDATE_EXTFIELD_RELE";
-		String title =  "保存项目扩展属性";
+		String title =  "保存扩展属性";
 		String viewUrl = null;
 		String description = null;
 		if( object_old != null ) {
 			if( !object_old.getDisplayName().equalsIgnoreCase( object.getDisplayName() )) { //变更了显示名称
-				title =  "变更项目扩展属性显示名称";
+				title =  "变更扩展属性显示名称";
 				optType = "UPDATE_DISPLAYNAME";
-				description = effectivePerson.getName() + "变更了项目扩展属性"+object.getExtFieldName()+"的显示名称为:" + object.getDisplayName();
+				description = effectivePerson.getName() + "变更了扩展属性"+object.getExtFieldName()+"的显示名称为:" + object.getDisplayName();
 				return composeNewDynamic( objectType, title, description, viewUrl, optType, object, effectivePerson, false );
 			}
 		}else {
-			title =  "添加项目扩展属性信息";
+			title =  "添加扩展属性信息";
 			optType = "CREATE";
-			description = effectivePerson.getName() + "添加了新的项目扩展属性:" + object.getDisplayName() + "("+object.getExtFieldName()+")。";
+			description = effectivePerson.getName() + "添加了新的扩展属性:" + object.getDisplayName() + "("+object.getExtFieldName()+")。";
 			return composeNewDynamic( objectType, title, description, viewUrl, optType, object, effectivePerson, false );
 		}
 		return null;
 	}
 	
 	/**
-	 * 组织项目扩展信息配置删除操作动态
+	 * 组织扩展信息配置删除操作动态
 	 * @param object
 	 * @param effectivePerson
 	 * @return
 	 */
-	protected Dynamic getProjectDeleteExtFieldReleDynamic( ProjectExtFieldRele object, EffectivePerson effectivePerson ) {
-		String objectType =  "PROJECT_EXTFIELD_RELE";
-		String title =  "项目扩展属性信息删除";
+	protected Dynamic getProjectDeleteExtFieldReleDynamic( CustomExtFieldRele object, EffectivePerson effectivePerson ) {
+		String objectType =  "CUSTOM_EXTFIELD_RELE";
+		String title =  "扩展属性信息删除";
 		String viewUrl = null;
 		String optType =  "DELETE";
-		String description = effectivePerson.getName() +"删除了项目扩展属性:" + object.getDisplayName() + "("+object.getExtFieldName()+")。";
+		String description = effectivePerson.getName() +"删除了扩展属性:" + object.getDisplayName() + "("+object.getExtFieldName()+")。";
 		return composeNewDynamic( objectType, title, description, viewUrl, optType, object, effectivePerson, false );
 	}
 	

+ 1 - 1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectService.java

@@ -12,7 +12,7 @@ import com.x.base.core.project.tools.ListTools;
 import com.x.teamwork.assemble.control.Business;
 import com.x.teamwork.core.entity.Project;
 import com.x.teamwork.core.entity.ProjectDetail;
-import com.x.teamwork.core.entity.ProjectExtFieldRele;
+import com.x.teamwork.core.entity.CustomExtFieldRele;
 import com.x.teamwork.core.entity.Review;
 import com.x.teamwork.core.entity.Task;
 import com.x.teamwork.core.entity.TaskDetail;

+ 29 - 15
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/ProjectExtFieldRele.java → o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/CustomExtFieldRele.java

@@ -20,16 +20,16 @@ import com.x.base.core.project.annotation.FieldDescribe;
 
 @ContainerEntity
 @Entity
-@Table(name = PersistenceProperties.ProjectExtFieldRele.table, uniqueConstraints = {
-		@UniqueConstraint(name = PersistenceProperties.ProjectExtFieldRele.table + JpaObject.IndexNameMiddle
+@Table(name = PersistenceProperties.CustomExtFieldRele.table, uniqueConstraints = {
+		@UniqueConstraint(name = PersistenceProperties.CustomExtFieldRele.table + JpaObject.IndexNameMiddle
 				+ JpaObject.DefaultUniqueConstraintSuffix, columnNames = { JpaObject.IDCOLUMN,
 						JpaObject.CREATETIMECOLUMN, JpaObject.UPDATETIMECOLUMN, JpaObject.SEQUENCECOLUMN }) })
 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-public class ProjectExtFieldRele extends SliceJpaObject {
+public class CustomExtFieldRele extends SliceJpaObject {
 
 	private static final long serialVersionUID = 3856138316794473794L;
 	
-	private static final String TABLE = PersistenceProperties.ProjectExtFieldRele.table;
+	private static final String TABLE = PersistenceProperties.CustomExtFieldRele.table;
 
 	public String getId() {
 		return id;
@@ -59,14 +59,14 @@ public class ProjectExtFieldRele extends SliceJpaObject {
 	 * =========================================================================
 	 * =========
 	 */	
-	public static final String projectId_FIELDNAME = "projectId";
-	@FieldDescribe("项目ID(必填)")
-	@Column( length = JpaObject.length_255B, name = ColumnNamePrefix + projectId_FIELDNAME)
-	@Index(name = TABLE + IndexNameMiddle + projectId_FIELDNAME)
-	private String projectId;
+	public static final String correlationId_FIELDNAME = "correlationId";
+	@FieldDescribe("关联ID(非必填)")
+	@Column( length = JpaObject.length_255B, name = ColumnNamePrefix + correlationId_FIELDNAME)
+	@Index(name = TABLE + IndexNameMiddle + correlationId_FIELDNAME)
+	private String correlationId;
 
 	public static final String extFieldName_FIELDNAME = "extFieldName";
-	@FieldDescribe("备用列名(必填)")
+	@FieldDescribe("扩展属性列名(必填)")
 	@Column( length = JpaObject.length_16B, name = ColumnNamePrefix + extFieldName_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + extFieldName_FIELDNAME)
 	private String extFieldName;
@@ -78,10 +78,16 @@ public class ProjectExtFieldRele extends SliceJpaObject {
 	private String displayName;
 	
 	public static final String displayType_FIELDNAME = "displayType";
-	@FieldDescribe("显示方式:TEXT|SELECT|MUTISELECT|RICHTEXT|DATE|DATETIME|PERSON|IDENTITY|UNIT|GROUP|(必填)")
+	@FieldDescribe("类型:TEXT|SELECT|MUTISELECT|RICHTEXT|DATE|DATETIME|PERSON|IDENTITY|UNIT|GROUP|(必填)")
 	@Column( length = JpaObject.length_16B, name = ColumnNamePrefix + displayType_FIELDNAME)
 	private String displayType="TEXT";
 	
+	public static final String type_FIELDNAME = "type";
+	@FieldDescribe("类型:project|task(必填)")
+	@Column( length = JpaObject.length_64B, name = ColumnNamePrefix + type_FIELDNAME)
+	@Index(name = TABLE + IndexNameMiddle + type_FIELDNAME)
+	private String type;
+	
 	public static final String optionsData_FIELDNAME = "optionsData";
 	@FieldDescribe("选择荐的备选数据,数据Json, displayType=SELECT|MUTISELECT时必须填写,否则无选择项")
 	@Lob
@@ -119,6 +125,14 @@ public class ProjectExtFieldRele extends SliceJpaObject {
 	public void setDisplayType(String displayType) {
 		this.displayType = displayType;
 	}
+	
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
 
 	public String getOptionsData() {
 		return optionsData;
@@ -128,12 +142,12 @@ public class ProjectExtFieldRele extends SliceJpaObject {
 		this.optionsData = optionsData;
 	}
 
-	public String getProjectId() {
-		return projectId;
+	public String getCorrelationId() {
+		return correlationId;
 	}
 
-	public void setProjectId(String projectId) {
-		this.projectId = projectId;
+	public void setCorrelationId(String correlationId) {
+		this.correlationId = correlationId;
 	}
 
 	public String getExtFieldName() {

+ 2 - 2
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/PersistenceProperties.java

@@ -110,8 +110,8 @@ public final class PersistenceProperties extends AbstractPersistenceProperties {
 		public static final String table = "TEW_PROJECTGROUP_RELE";
 	}
 	
-	public static class ProjectExtFieldRele {
-		public static final String table = "TEW_PROJECTEXTFIELD_RELE";
+	public static class CustomExtFieldRele {
+		public static final String table = "TEW_CUSTOMEXTFIELD_RELE";
 	}
 	
 	public static class TaskGroupRele {

+ 1 - 1
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/tools/ProjectExtField.java → o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/tools/CustomExtField.java

@@ -3,7 +3,7 @@ package com.x.teamwork.core.entity.tools;
 import java.util.ArrayList;
 import java.util.List;
 
-public class ProjectExtField {
+public class CustomExtField {
 
 	private static List<FieldInfo> fieldList = new ArrayList<>();