Jelajahi Sumber

删除teamwork

zhourui 5 tahun lalu
induk
melakukan
8d8229013f
100 mengubah file dengan 14 tambahan dan 15106 penghapusan
  1. 14 0
      o2server/pom.xml
  2. 0 129
      o2server/x_teamwork_assemble_control/pom.xml
  3. 0 353
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/Business.java
  4. 0 7
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/MimeTypeDefinition.java
  5. 0 150
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/CustomExtFieldReleFactory.java
  6. 0 105
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/PriorityFactory.java
  7. 0 230
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectConfigFactory.java
  8. 0 289
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectFactory.java
  9. 0 278
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectTemplateFactory.java
  10. 0 184
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/StatisticFactory.java
  11. 0 270
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/TaskListTemplateFactory.java
  12. 0 49
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/ActionApplication.java
  13. 0 25
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/JaxrsManagerUserFilter.java
  14. 0 219
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/chat/ActionCreate.java
  15. 0 120
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionDelete.java
  16. 0 85
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionGet.java
  17. 0 81
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionGetNextUseableExtFieldName.java
  18. 0 33
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListAllExtFields.java
  19. 0 80
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListWithCorrelation.java
  20. 0 80
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionListWithType.java
  21. 0 290
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/ActionSave.java
  22. 0 30
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/BaseAction.java
  23. 0 167
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleAction.java
  24. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleFlagForQueryEmptyException.java
  25. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleNotExistsException.java
  26. 0 20
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldRelePersistException.java
  27. 0 20
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/CustomExtFieldReleQueryException.java
  28. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/extfield/TaskNotExistsException.java
  29. 0 73
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionInitConfig.java
  30. 0 39
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionIsManager.java
  31. 0 140
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionListProjectConfigNextWithFilter.java
  32. 0 80
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPriorityDelete.java
  33. 0 78
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPriorityGet.java
  34. 0 70
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPriorityList.java
  35. 0 61
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPrioritySave.java
  36. 0 70
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigDelete.java
  37. 0 79
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigGet.java
  38. 0 83
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigGetByProject.java
  39. 0 61
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigSave.java
  40. 0 34
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/BaseAction.java
  41. 0 245
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/GlobalAction.java
  42. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/PriorityFlagForQueryEmptyException.java
  43. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/PriorityNotExistsException.java
  44. 0 20
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/PriorityPersistException.java
  45. 0 16
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/PriorityQueryException.java
  46. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ProjectConfigFlagForQueryEmptyException.java
  47. 0 12
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ProjectConfigNotExistsException.java
  48. 0 20
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ProjectConfigPersistException.java
  49. 0 16
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ProjectConfigQueryException.java
  50. 0 223
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/WrapInQueryProjectConfig.java
  51. 0 160
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/list/ActionListWithTaskGroup.java
  52. 0 37
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/list/BaseAction.java
  53. 0 92
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionComplete.java
  54. 0 92
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionCreateable.java
  55. 0 230
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionGet.java
  56. 0 190
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListArchiveNextWithFilter.java
  57. 0 190
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListCompletedNextWithFilter.java
  58. 0 190
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListMyNextWithFilter.java
  59. 0 184
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextInGroupWithFilter.java
  60. 0 213
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextWithFilter.java
  61. 0 190
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNoGroupNextWithFilter.java
  62. 0 180
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageInGroupWithFilter.java
  63. 0 187
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageWithFilter.java
  64. 0 185
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListRecycleNextWithFilter.java
  65. 0 190
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListStarNextWithFilter.java
  66. 0 74
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionRecovery.java
  67. 0 276
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionSave.java
  68. 0 280
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjects.java
  69. 0 167
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjectsGroups.java
  70. 0 35
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/BaseAction.java
  71. 0 447
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ProjectAction.java
  72. 0 139
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/WrapOutControl.java
  73. 0 122
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionDelete.java
  74. 0 161
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionGet.java
  75. 0 74
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionList.java
  76. 0 173
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionListNextWithFilter.java
  77. 0 220
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionStatisticProjectTemplates.java
  78. 0 131
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ProjectTemplateAction.java
  79. 0 103
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/WrapInQueryProjectTemplate.java
  80. 0 51
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/WrapOutControl.java
  81. 0 272
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/ActionStatisticMyProjects.java
  82. 0 132
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/ActionStatisticTaskWithFilter.java
  83. 0 28
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/BaseAction.java
  84. 0 16
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/ProjectQueryException.java
  85. 0 16
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/StatisticQueryException.java
  86. 0 73
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/StatisticsAction.java
  87. 0 139
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/WrapInQueryTask.java
  88. 0 216
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionCopyTask.java
  89. 0 474
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionGet.java
  90. 0 219
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListMyTaskWithTaskList.java
  91. 0 252
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListNextWithFilter.java
  92. 0 248
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListPageWithFilter.java
  93. 0 153
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListSubTaskWithTaskId.java
  94. 0 231
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListWithTaskList.java
  95. 0 758
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionSave.java
  96. 0 428
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionUpdateSingleProperty.java
  97. 0 426
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewAllListNextWithFilter.java
  98. 0 425
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewCompletedListNextWithFilter.java
  99. 0 426
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewMyExecutListNextWithFilter.java
  100. 0 425
      o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewOverTimeListNextWithFilter.java

+ 14 - 0
o2server/pom.xml

@@ -320,6 +320,20 @@
 		<finalName>${project.artifactId}</finalName>
 		<pluginManagement>
 			<plugins>
+				<plugin>
+					<artifactId>maven-clean-plugin</artifactId>
+					<version>3.1.0</version>
+					<configuration>
+						<filesets>
+							<fileset>
+								<directory>${basedir}</directory>
+								<includes>
+									<include>**/*_.java</include>
+								</includes>
+							</fileset>
+						</filesets>
+					</configuration>
+				</plugin>
 				<plugin>
 					<groupId>org.codehaus.mojo</groupId>
 					<artifactId>exec-maven-plugin</artifactId>

+ 0 - 129
o2server/x_teamwork_assemble_control/pom.xml

@@ -1,129 +0,0 @@
-<?xml version="1.0"?>
-<project
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-	xmlns="http://maven.apache.org/POM/4.0.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>o2oa</groupId>
-		<artifactId>o2server</artifactId>
-		<version>5</version>
-	</parent>
-	<artifactId>x_teamwork_assemble_control</artifactId>
-	<packaging>war</packaging>
-	<dependencies>
-		<dependency>
-			<groupId>o2oa</groupId>
-			<artifactId>x_base_core_project</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>o2oa</groupId>
-			<artifactId>x_organization_core_entity</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>o2oa</groupId>
-			<artifactId>x_organization_core_express</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>o2oa</groupId>
-			<artifactId>x_teamwork_core_entity</artifactId>
-		</dependency>
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>exec-maven-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>describeBuilder</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>java</goal>
-						</goals>
-						<configuration>
-							<addOutputToClasspath>true</addOutputToClasspath>
-							<includePluginDependencies>true</includePluginDependencies>
-							<includeProjectDependencies>true</includeProjectDependencies>
-							<mainClass>com.x.base.core.project.annotation.DescribeBuilder</mainClass>
-							<arguments>
-								<argument>${basedir}</argument>
-								<argument>${project.build.sourceDirectory}</argument>
-							</arguments>
-						</configuration>
-					</execution>
-					<execution>
-						<id>apiBuilder</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>java</goal>
-						</goals>
-						<configuration>
-							<addOutputToClasspath>true</addOutputToClasspath>
-							<includePluginDependencies>true</includePluginDependencies>
-							<includeProjectDependencies>true</includeProjectDependencies>
-							<mainClass>com.x.base.core.project.annotation.ApiBuilder</mainClass>
-							<arguments>
-								<argument>${basedir}</argument>
-								<argument>${project.build.sourceDirectory}</argument>
-							</arguments>
-						</configuration>
-					</execution>
-					<execution>
-						<id>checkAssemble</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>java</goal>
-						</goals>
-						<configuration>
-							<addOutputToClasspath>true</addOutputToClasspath>
-							<includePluginDependencies>true</includePluginDependencies>
-							<includeProjectDependencies>true</includeProjectDependencies>
-							<mainClass>com.x.base.core.project.build.CheckAssemble</mainClass>
-						</configuration>
-					</execution>
-					<execution>
-						<id>createWebXml</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>java</goal>
-						</goals>
-						<configuration>
-							<addOutputToClasspath>true</addOutputToClasspath>
-							<includePluginDependencies>true</includePluginDependencies>
-							<includeProjectDependencies>true</includeProjectDependencies>
-							<mainClass>com.x.base.core.project.build.CreateWebXml</mainClass>
-							<arguments>
-								<argument>${basedir}</argument>
-								<argument>${project.artifactId}</argument>
-							</arguments>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<artifactId>maven-resources-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-war</id>
-						<phase>verify</phase>
-						<goals>
-							<goal>copy-resources</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>../../o2server/custom</outputDirectory>
-							<resources>
-								<resource>
-									<directory>target</directory>
-									<includes>
-										<include>${project.artifactId}.war</include>
-									</includes>
-								</resource>
-							</resources>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-</project>

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

@@ -1,353 +0,0 @@
-package com.x.teamwork.assemble.control;
-
-import java.util.List;
-
-import com.x.base.core.project.tools.ListTools;
-import org.apache.commons.lang3.StringUtils;
-
-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.teamwork.assemble.control.factory.AttachmentFactory;
-import com.x.teamwork.assemble.control.factory.BatchOperationFactory;
-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.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;
-import com.x.teamwork.assemble.control.factory.ProjectTemplateFactory;
-import com.x.teamwork.assemble.control.factory.ReviewFactory;
-import com.x.teamwork.assemble.control.factory.SystemConfigFactory;
-import com.x.teamwork.assemble.control.factory.TaskFactory;
-import com.x.teamwork.assemble.control.factory.TaskGroupFactory;
-import com.x.teamwork.assemble.control.factory.TaskGroupReleFactory;
-import com.x.teamwork.assemble.control.factory.TaskListFactory;
-import com.x.teamwork.assemble.control.factory.TaskListTemplateFactory;
-import com.x.teamwork.assemble.control.factory.TaskTagFactory;
-import com.x.teamwork.assemble.control.factory.TaskViewFactory;
-
-public class Business {
-
-	private EntityManagerContainer emc;
-	
-	public Business(EntityManagerContainer emc) throws Exception {
-		this.emc = emc;
-	}
-	public EntityManagerContainer entityManagerContainer() {
-		return this.emc;
-	}
-	
-	private Organization organization;
-	private ProjectFactory projectFactory;
-	private TaskFactory taskFactory;
-	private ProjectTemplateFactory projectTemplateFactory;
-	private TaskListTemplateFactory taskListTemplateFactory;
-	private DynamicFactory dynamicFactory;
-	private SystemConfigFactory systemConfigFactory;
-	private ProjectGroupFactory projectGroupFactory;
-	private ProjectGroupReleFactory projectGroupReleFactory;
-	private TaskListFactory taskListFactory;
-	private ChatFactory chatFactory;
-	private TaskGroupFactory taskGroupFactory;
-	private TaskGroupReleFactory taskGroupReleFactory;
-	private TaskViewFactory taskViewFactory;
-	private CustomExtFieldReleFactory customExtFieldReleFactory;
-	private ReviewFactory reviewFactory;
-	private BatchOperationFactory batchOperationFactory;
-	private TaskTagFactory taskTagFactory;	
-	private AttachmentFactory attachmentFactory;	
-	private PriorityFactory priorityFactory;
-	private ProjectConfigFactory projectConfigFactory;
-	
-	public Organization organization() throws Exception {
-		if (null == this.organization) {
-			this.organization = new Organization(ThisApplication.context());
-		}
-		return organization;
-	}
-	
-	/**
-	 * 获取附件信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public AttachmentFactory attachmentFactory() throws Exception {
-		if (null == this.attachmentFactory) {
-			this.attachmentFactory = new AttachmentFactory( this );
-		}
-		return attachmentFactory;
-	}
-	
-	/**
-	 * 获取工作任务标签数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskTagFactory taskTagFactory() throws Exception {
-		if (null == this.taskTagFactory) {
-			this.taskTagFactory = new TaskTagFactory( this );
-		}
-		return taskTagFactory;
-	}
-	
-	/**
-	 * 获取批处理任务数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public BatchOperationFactory batchOperationFactory() throws Exception {
-		if (null == this.batchOperationFactory) {
-			this.batchOperationFactory = new BatchOperationFactory( this );
-		}
-		return batchOperationFactory;
-	}
-	
-	/**
-	 * 获取Review信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public ReviewFactory reviewFactory() throws Exception {
-		if (null == this.reviewFactory) {
-			this.reviewFactory = new ReviewFactory( this );
-		}
-		return reviewFactory;
-	}
-	
-	/**
-	 * 获取项目扩展属性关联信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public CustomExtFieldReleFactory customExtFieldReleFactory() throws Exception {
-		if (null == this.customExtFieldReleFactory) {
-			this.customExtFieldReleFactory = new CustomExtFieldReleFactory( this );
-		}
-		return customExtFieldReleFactory;
-	}
-	
-	/**
-	 * 获取任务视图数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskViewFactory taskViewFactory() throws Exception {
-		if (null == this.taskViewFactory) {
-			this.taskViewFactory = new TaskViewFactory( this );
-		}
-		return taskViewFactory;
-	}
-	
-	/**
-	 * 获取工作任务组关联信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskGroupReleFactory taskGroupReleFactory() throws Exception {
-		if (null == this.taskGroupReleFactory) {
-			this.taskGroupReleFactory = new TaskGroupReleFactory( this );
-		}
-		return taskGroupReleFactory;
-	}
-	
-	/**
-	 * 获取工作任务组数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskGroupFactory taskGroupFactory() throws Exception {
-		if (null == this.taskGroupFactory) {
-			this.taskGroupFactory = new TaskGroupFactory( this );
-		}
-		return taskGroupFactory;
-	}
-	
-	/**
-	 * 获取工作交流数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public ChatFactory chatFactory() throws Exception {
-		if (null == this.chatFactory) {
-			this.chatFactory = new ChatFactory( this );
-		}
-		return chatFactory;
-	}
-	
-	/**
-	 * 获取工作任务列表数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskListFactory taskListFactory() throws Exception {
-		if (null == this.taskListFactory) {
-			this.taskListFactory = new TaskListFactory( this );
-		}
-		return taskListFactory;
-	}
-	
-	/**
-	 * 获取项目组数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectGroupFactory projectGroupFactory() throws Exception {
-		if (null == this.projectGroupFactory) {
-			this.projectGroupFactory = new ProjectGroupFactory( this );
-		}
-		return projectGroupFactory;
-	}
-	
-	/**
-	 * 获取优先级数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectConfigFactory projectConfigFactory() throws Exception {
-		if (null == this.projectConfigFactory) {
-			this.projectConfigFactory = new ProjectConfigFactory( this );
-		}
-		return projectConfigFactory;
-	}
-	
-	/**
-	 * 获取优先级数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public PriorityFactory priorityFactory() throws Exception {
-		if (null == this.priorityFactory) {
-			this.priorityFactory = new PriorityFactory( this );
-		}
-		return priorityFactory;
-	}
-	
-	/**
-	 * 获取项目模板数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectTemplateFactory projectTemplateFactory() throws Exception {
-		if (null == this.projectTemplateFactory) {
-			this.projectTemplateFactory = new ProjectTemplateFactory( this );
-		}
-		return projectTemplateFactory;
-	}
-	
-	/**
-	 * 获取项目模板对应的泳道数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskListTemplateFactory taskListTemplateFactory() throws Exception {
-		if (null == this.taskListTemplateFactory) {
-			this.taskListTemplateFactory = new TaskListTemplateFactory( this );
-		}
-		return taskListTemplateFactory;
-	}
-	
-	/**
-	 * 获取项目与项目组关联信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectGroupReleFactory projectGroupReleFactory() throws Exception {
-		if (null == this.projectGroupReleFactory) {
-			this.projectGroupReleFactory = new ProjectGroupReleFactory( this );
-		}
-		return projectGroupReleFactory;
-	}
-	
-	/**
-	 * 获取系统配置信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public SystemConfigFactory systemConfigFactory() throws Exception {
-		if (null == this.systemConfigFactory) {
-			this.systemConfigFactory = new SystemConfigFactory( this );
-		}
-		return systemConfigFactory;
-	}
-	
-	/**
-	 * 获取工作任务信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskFactory taskFactory() throws Exception {
-		if (null == this.taskFactory) {
-			this.taskFactory = new TaskFactory( this );
-		}
-		return taskFactory;
-	}
-	
-	/**
-	 * 获取项目信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectFactory projectFactory() throws Exception {
-		if (null == this.projectFactory) {
-			this.projectFactory = new ProjectFactory( this );
-		}
-		return projectFactory;
-	}
-	
-	/**
-	 * 获取动态信息数据库访问类
-	 * @return
-	 * @throws Exception
-	 */
-	public DynamicFactory dynamicFactory() throws Exception {
-		if (null == this.dynamicFactory) {
-			this.dynamicFactory = new DynamicFactory( this );
-		}
-		return dynamicFactory;
-	}
-	
-	/**
-	 * TODO 判断用户是否管理员权限 1、person.isManager() 2、xadmin 3、CRMManager
-	 * 
-	 * @param request
-	 * @param personName
-	 * @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(), "TeamWorkManager@TeamWorkManager@R")) {
-			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 (ListTools.isNotEmpty(roleList) ) {
-			if (roleList.stream().filter(r -> roleName.equalsIgnoreCase(r)).count() > 0) {
-				return true;
-			}
-		} else {
-			return false;
-		}
-		return false;
-	}
-}

+ 0 - 7
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/MimeTypeDefinition.java

@@ -1,7 +0,0 @@
-package com.x.teamwork.assemble.control;
-
-import javax.activation.MimetypesFileTypeMap;
-
-public class MimeTypeDefinition {
-	public static MimetypesFileTypeMap instance;
-}

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

@@ -1,150 +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.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();
-	}
-	
-	/**
-	 * 列示所有扩展属性信息列表
-	 * @return
-	 * @throws Exception
-	 */
-	public List<CustomExtFieldRele> listAllFieldReleObj() throws Exception {
-		
-		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);
-		cq.orderBy( cb.asc( root.get( CustomExtFieldRele_.order ) ) );
-		return em.createQuery(cq).getResultList();
-	}
-
-	/**
-	 * 根据关联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();
-	}
-	
-	/**
-	 * 根据扩展属性类型列示扩展属性信息列表
-	 * @param type
-	 * @return
-	 * @throws Exception
-	 */
-	public List<CustomExtFieldRele> listFieldReleObjByType( String type ) throws Exception {
-		if( StringUtils.isEmpty( type ) ){
-			throw new Exception("type 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_.type), type );
-		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 - 105
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/PriorityFactory.java

@@ -1,105 +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.base.core.project.tools.ListTools;
-import com.x.teamwork.assemble.control.AbstractFactory;
-import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Priority;
-import com.x.teamwork.core.entity.Priority_;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.ProjectGroup_;
-
-
-public class PriorityFactory extends AbstractFactory {
-
-	public PriorityFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 获取指定Id的ProjectGroup实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public Priority get( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, Priority.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 获取指定name的优先级实体信息对象
-	 * @param name
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Priority> getByName( String name ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Priority.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Priority> cq = cb.createQuery(Priority.class);
-		Root<Priority> root = cq.from(Priority.class);
-		Predicate p = cb.equal( root.get(Priority_.priority), name );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 列示指定Id的ProjectGroup实体信息列表
-	 * @param ids
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Priority> listPriority() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Priority.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Priority> cq = cb.createQuery(Priority.class);
-		Root<Priority> root = cq.from(Priority.class);
-		//Predicate p = cb.equal( root.get(Priority_.owner), person );
-		cq.orderBy( cb.asc( root.get( Priority_.order ) ) );
-		return em.createQuery(cq).getResultList();
-	}
-
-	/**
-	 * 根据用户列示ProjectGroup实体信息列表
-	 * @param person
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listByPerson( String person ) throws Exception {
-		if( StringUtils.isEmpty( person ) ){
-			throw new Exception("person can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(ProjectGroup.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<ProjectGroup> root = cq.from(ProjectGroup.class);
-		Predicate p = cb.equal( root.get(ProjectGroup_.owner), person );
-		cq.select( root.get(ProjectGroup_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据用户列示Priority实体信息列表
-	 * @param person
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Priority> listPriorityByPerson( String person ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Priority.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Priority> cq = cb.createQuery(Priority.class);
-		Root<Priority> root = cq.from(Priority.class);
-		//Predicate p = cb.equal( root.get(Priority_.owner), person );
-		cq.orderBy( cb.desc( root.get( Priority_.order ) ) );
-		return em.createQuery(cq).getResultList();
-	}	
-}

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

@@ -1,230 +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.Order;
-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.base.core.project.tools.ListTools;
-import com.x.teamwork.assemble.control.AbstractFactory;
-import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Dynamic_;
-import com.x.teamwork.core.entity.Priority;
-import com.x.teamwork.core.entity.Priority_;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectConfig;
-import com.x.teamwork.core.entity.ProjectConfig_;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.ProjectGroup_;
-import com.x.teamwork.core.entity.Project_;
-import com.x.teamwork.core.entity.tools.CriteriaBuilderTools;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-
-
-public class ProjectConfigFactory extends AbstractFactory {
-
-	public ProjectConfigFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 获取指定Id的ProjectGroup实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectConfig get( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, ProjectConfig.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 获取指定name的优先级实体信息对象
-	 * @param name
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Priority> getByName( String name ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Priority.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Priority> cq = cb.createQuery(Priority.class);
-		Root<Priority> root = cq.from(Priority.class);
-		Predicate p = cb.equal( root.get(Priority_.priority), name );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 列示指定Id的ProjectGroup实体信息列表
-	 * @param ids
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Priority> listPriority() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Priority.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Priority> cq = cb.createQuery(Priority.class);
-		Root<Priority> root = cq.from(Priority.class);
-		//Predicate p = cb.equal( root.get(Priority_.owner), person );
-		cq.orderBy( cb.asc( root.get( Priority_.order ) ) );
-		return em.createQuery(cq).getResultList();
-	}
-
-	/**
-	 * 根据用户列示ProjectGroup实体信息列表
-	 * @param person
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listByPerson( String person ) throws Exception {
-		if( StringUtils.isEmpty( person ) ){
-			throw new Exception("person can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(ProjectGroup.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<ProjectGroup> root = cq.from(ProjectGroup.class);
-		Predicate p = cb.equal( root.get(ProjectGroup_.owner), person );
-		cq.select( root.get(ProjectGroup_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据用户列示Priority实体信息列表
-	 * @param person
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Priority> listPriorityByPerson( String person ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Priority.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Priority> cq = cb.createQuery(Priority.class);
-		Root<Priority> root = cq.from(Priority.class);
-		//Predicate p = cb.equal( root.get(Priority_.owner), person );
-		cq.orderBy( cb.desc( root.get( Priority_.order ) ) );
-		return em.createQuery(cq).getResultList();
-	}	
-	
-	/**
-	 * 根据条件查询所有符合条件的项目配置信息ID,项目配置信息不会很多 ,所以直接查询出来
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listAllProjectConfigIds( Integer maxCount, String personName,  QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( ProjectConfig.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<ProjectConfig> root = cq.from(ProjectConfig.class);
-		Predicate p_permission = null;
-		
-		
-		/*if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}*/
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( ProjectConfig_.class, cb, p_permission, root, queryFilter );
-		cq.distinct(true).select( root.get(ProjectConfig_.id) );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 *  根据条件查询符合条件的项目信息ID
-	 * @param maxCount
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectConfig> listWithFilter( Integer maxCount, String orderField, String orderType, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( ProjectConfig.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectConfig> cq = cb.createQuery(ProjectConfig.class);
-		Root<ProjectConfig> root = cq.from(ProjectConfig.class);
-		Predicate p_permission = null;
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( ProjectConfig_.class, cb, p_permission, root, queryFilter );
-
-		Order orderWithField = CriteriaBuilderTools.getOrder(cb, root, ProjectConfig_.class, orderField, orderType);
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectConfig> listWithFilter( Integer maxCount, Object sequenceFieldValue, String orderField, String orderType, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( ProjectConfig.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectConfig> cq = cb.createQuery(ProjectConfig.class);
-		Root<ProjectConfig> root = cq.from(ProjectConfig.class);
-		Predicate p_permission = null;
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( ProjectConfig_.class, cb, p_permission, root, queryFilter );
-		
-		if( sequenceFieldValue != null && StringUtils.isNotEmpty( sequenceFieldValue.toString() )) {
-			Predicate p_seq = cb.isNotNull( root.get( Dynamic_.sequence ) );
-			if( "desc".equalsIgnoreCase( orderType )){
-				p_seq = cb.and( p_seq, cb.lessThan( root.get( ProjectConfig_.sequence ), sequenceFieldValue.toString() ));
-			}else{
-				p_seq = cb.and( p_seq, cb.greaterThan( root.get( ProjectConfig_.sequence ), sequenceFieldValue.toString() ));
-			}
-			p = cb.and( p, p_seq);
-		}		
-		
-		Order orderWithField = CriteriaBuilderTools.getOrder( cb, root, ProjectConfig_.class, orderField, orderType );
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		System.out.println(">>>SQL:" + em.createQuery(cq.where(p)).setMaxResults( maxCount).toString() );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 * 获取指定name的优先级实体信息对象
-	 * @param name
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectConfig> getProjectConfigByProject( String name ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(ProjectConfig.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectConfig> cq = cb.createQuery(ProjectConfig.class);
-		Root<ProjectConfig> root = cq.from(ProjectConfig.class);
-		Predicate p = cb.equal( root.get(ProjectConfig_.project), name );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

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

@@ -1,289 +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.Order;
-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.base.core.project.tools.ListTools;
-import com.x.teamwork.assemble.control.AbstractFactory;
-import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Dynamic_;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectDetail;
-import com.x.teamwork.core.entity.Project_;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.Task_;
-import com.x.teamwork.core.entity.tools.CriteriaBuilderTools;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-
-
-public class ProjectFactory extends AbstractFactory {
-
-	public ProjectFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 获取指定Id的Project实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public Project get( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, Project.class, ExceptionWhen.none );
-	}
-	
-	public ProjectDetail getDetail(String id) throws Exception {
-		return this.entityManagerContainer().find( id, ProjectDetail.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 列示指定Id的Project实体信息列表
-	 * @param ids
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Project> list( List<String> ids ) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<Project>();
-		}
-		EntityManager em = this.entityManagerContainer().get(Project.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Project> cq = cb.createQuery(Project.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p = root.get(Project_.id).in(ids);
-		cq.orderBy( cb.desc( root.get( Project_.updateTime ) ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listAllProjectIds() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Project.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Project> root = cq.from(Project.class);
-		cq.select( root.get( Project_.id) );
-		return em.createQuery(cq ).getResultList();
-	}	
-	
-	/**
-	 * 根据条件查询符合条件的项目信息数量
-	 * @param personName
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public Long countWithFilter( String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-
-		if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-		cq.select(cb.count(root)).where(p);
-		Long count =  em.createQuery(cq).getSingleResult();
-		return count;
-	}
-	
-	/**
-	 *  根据条件查询符合条件的项目信息ID
-	 * @param maxCount
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Project> listWithFilter( Integer maxCount, String orderField, String orderType, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Project> cq = cb.createQuery(Project.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-		
-		if( StringUtils.isNotEmpty( personName )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-
-		Order orderWithField = CriteriaBuilderTools.getOrder(cb, root, Project_.class, orderField, orderType);
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 *  根据条件查询符合条件的项目信息ID
-	 * @param projectId
-	 * @param deleted
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Task> listAllTasks(String projectId, Boolean deleted) throws Exception {
-		if( StringUtils.isEmpty( projectId ) ){
-			return new ArrayList<Task>();
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Task> cq = cb.createQuery(Task.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = root.get(Task_.project).in(projectId);
-		p = cb.and( p, cb.isFalse( root.get(Task_.deleted )));
-		
-		cq.orderBy( cb.desc( root.get( Task_.updateTime ) ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Project> listWithFilter( Integer maxCount, Object sequenceFieldValue, String orderField, String orderType, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Project> cq = cb.createQuery(Project.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-		
-		if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-		
-		if( sequenceFieldValue != null && StringUtils.isNotEmpty( sequenceFieldValue.toString() )) {
-			Predicate p_seq = cb.isNotNull( root.get( Dynamic_.sequence ) );
-			if( "desc".equalsIgnoreCase( orderType )){
-				p_seq = cb.and( p_seq, cb.lessThan( root.get( Project_.sequence ), sequenceFieldValue.toString() ));
-			}else{
-				p_seq = cb.and( p_seq, cb.greaterThan( root.get( Project_.sequence ), sequenceFieldValue.toString() ));
-			}
-			p = cb.and( p, p_seq);
-		}		
-		
-		Order orderWithField = CriteriaBuilderTools.getOrder( cb, root, Project_.class, orderField, orderType );
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		System.out.println(">>>SQL:" + em.createQuery(cq.where(p)).setMaxResults( maxCount).toString() );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询所有符合条件的项目信息ID,项目信息不会很多 ,所以直接查询出来
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listAllViewableProjectIds( Integer maxCount, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-		
-		
-		if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-		cq.distinct(true).select( root.get(Project_.id) );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-
-	
-}

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

@@ -1,278 +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.Order;
-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.base.core.project.tools.ListTools;
-import com.x.organization.core.entity.PersonCard;
-import com.x.organization.core.entity.PersonCard_;
-import com.x.teamwork.assemble.control.AbstractFactory;
-import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Dynamic_;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectDetail;
-import com.x.teamwork.core.entity.ProjectTemplate;
-import com.x.teamwork.core.entity.ProjectTemplate_;
-import com.x.teamwork.core.entity.Project_;
-import com.x.teamwork.core.entity.tools.CriteriaBuilderTools;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-
-
-public class ProjectTemplateFactory extends AbstractFactory {
-
-	public ProjectTemplateFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 获取指定Id的Project实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public ProjectTemplate get( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, ProjectTemplate.class, ExceptionWhen.none );
-	}
-	
-	public ProjectDetail getDetail(String id) throws Exception {
-		return this.entityManagerContainer().find( id, ProjectDetail.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 列示指定Id的Project实体信息列表
-	 * @param ids
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Project> list( List<String> ids ) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<Project>();
-		}
-		EntityManager em = this.entityManagerContainer().get(Project.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Project> cq = cb.createQuery(Project.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p = root.get(Project_.id).in(ids);
-		cq.orderBy( cb.desc( root.get( Project_.updateTime ) ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listAllProjectIds() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Project.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Project> root = cq.from(Project.class);
-		cq.select( root.get( Project_.id) );
-		return em.createQuery(cq ).getResultList();
-	}	
-	
-	/**
-	 * 根据条件查询符合条件的项目信息数量
-	 * @param personName
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public Long countWithFilter( String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-
-		if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-		cq.select(cb.count(root)).where(p);
-		Long count =  em.createQuery(cq).getSingleResult();
-		return count;
-	}
-	
-	/**
-	 *  根据条件查询符合条件的项目信息ID
-	 * @param maxCount
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Project> listWithFilter( Integer maxCount, String orderField, String orderType, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Project> cq = cb.createQuery(Project.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-		
-		if( StringUtils.isNotEmpty( personName )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-
-		Order orderWithField = CriteriaBuilderTools.getOrder(cb, root, Project_.class, orderField, orderType);
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectTemplate> listWithFilter( Integer maxCount, Object sequenceFieldValue, String orderField, String orderType, String personName, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( ProjectTemplate.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectTemplate> cq = cb.createQuery(ProjectTemplate.class);
-		Root<ProjectTemplate> root = cq.from(ProjectTemplate.class);
-		Predicate p_permission = null;
-		
-		/*if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}*/
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( ProjectTemplate_.class, cb, p_permission, root, queryFilter );
-		
-		if( sequenceFieldValue != null && StringUtils.isNotEmpty( sequenceFieldValue.toString() )) {
-			Predicate p_seq = cb.isNotNull( root.get( Dynamic_.sequence ) );
-			if( "desc".equalsIgnoreCase( orderType )){
-				p_seq = cb.and( p_seq, cb.lessThan( root.get( ProjectTemplate_.sequence ), sequenceFieldValue.toString() ));
-			}else{
-				p_seq = cb.and( p_seq, cb.greaterThan( root.get( ProjectTemplate_.sequence ), sequenceFieldValue.toString() ));
-			}
-			p = cb.and( p, p_seq);
-		}		
-		
-		Order orderWithField = CriteriaBuilderTools.getOrder( cb, root, ProjectTemplate_.class, orderField, orderType );
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		System.out.println(">>>SQL:" + em.createQuery(cq.where(p)).setMaxResults( maxCount).toString() );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询所有符合条件的项目模板信息ID,项目信息不会很多 ,所以直接查询出来
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listAllProjectTemplateIds( Integer maxCount, String personName, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( ProjectTemplate.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<ProjectTemplate> root = cq.from(ProjectTemplate.class);
-		Predicate p_permission = null;
-		
-		
-		/*if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( ProjectTemplate_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( ProjectTemplate_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( ProjectTemplate_.executor ), personName ) );
-		}*/
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( ProjectTemplate_.class, cb, p_permission, root, queryFilter );
-		cq.distinct(true).select( root.get(ProjectTemplate_.id) );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-
-	/**
-	 * 列示所有模板的分类信息
-	 * @param distinguishName
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> fetchAllGroupType( String distinguishName ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(ProjectTemplate.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<ProjectTemplate> root = cq.from(ProjectTemplate.class);
-		Predicate p = cb.equal(root.get(ProjectTemplate_.deleted), false);
-		cq.select(root.get(ProjectTemplate_.type)).where(p).distinct(true);
-		return em.createQuery(cq).getResultList();
-	}
-	
-	/**
-	 * 根据模板类型列示模板信息
-	 * @param type
-	 * @return
-	 * @throws Exception
-	 */
-	public List<ProjectTemplate> ListProjectTemplateWithType( String type ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(ProjectTemplate.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<ProjectTemplate> cq = cb.createQuery(ProjectTemplate.class);
-		Root<ProjectTemplate> root = cq.from(ProjectTemplate.class);
-		Predicate p = cb.equal(root.get(ProjectTemplate_.deleted), false);
-		p = cb.and( p, cb.equal(root.get(ProjectTemplate_.type), type));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-}

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

@@ -1,184 +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.Task;
-import com.x.teamwork.core.entity.TaskDetail;
-import com.x.teamwork.core.entity.Task_;
-
-
-public class StatisticFactory extends AbstractFactory {
-
-	public StatisticFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 获取指定Id的Task实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public Task get( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, Task.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 获取指定Id的TaskDetail实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskDetail getDetail( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, TaskDetail.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 列示指定Id的Task实体信息列表
-	 * @param ids
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Task> list( List<String> ids ) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<Task>();
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Task> cq = cb.createQuery(Task.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = root.get(Task_.id).in(ids);
-		cq.orderBy( cb.asc( root.get( Task_.createTime ) ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据类别列示Task实体ID信息列表
-	 * @param application
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listByProject( String projectId ) throws Exception {
-		if( StringUtils.isEmpty( projectId ) ){
-			throw new Exception("projectId can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = cb.equal( root.get(Task_.project), projectId );
-		cq.select( root.get(Task_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据类别列示Task实体ID信息列表
-	 * @param projectId
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Task> listAllTasksByProject( String projectId ) throws Exception {
-		if( StringUtils.isEmpty( projectId ) ){
-			throw new Exception("projectId can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Task> cq = cb.createQuery(Task.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = cb.equal( root.get(Task_.project), projectId );
-		return em.createQuery(cq.where(p)).getResultList(); 
-	}
-	
-	/**
-	 * 查询未review的工作任务信息
-	 * @param maxCount
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Task> listUnReviewTask(int maxCount) throws Exception {
-		if( maxCount == 0  ){
-			maxCount = 100;
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Task> cq = cb.createQuery(Task.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = cb.or( cb.isNull(root.get(Task_.reviewed )), cb.isFalse( root.get(Task_.reviewed )));
-		cq.orderBy( cb.asc( root.get( Task_.updateTime ) ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	
-	/**
-	 * 根据类别列示Task实体信息列表
-	 * @param application
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listByParent( String pid) throws Exception {
-		if( StringUtils.isEmpty( pid ) ){
-			throw new Exception("projectId can not be empty!");
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = cb.equal( root.get(Task_.parent), pid );
-		cq.select( root.get(Task_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询符合条件的项目信息数量
-	 * @param projectId
-	 * @return
-	 * @throws Exception
-	 */
-	public Long countWithProject( String projectId ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Task.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = cb.equal( root.get( Task_.project), projectId );
-		cq.select(cb.count(root)).where(p);
-		return em.createQuery(cq).getSingleResult();
-	}
-
-	public List<Task> allUnCompletedSubTasks(String taskId) throws Exception {
-		if( StringUtils.isEmpty( taskId )  ){
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Task> cq = cb.createQuery(Task.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = cb.equal(  root.get( Task_.parent ), taskId );
-		p = cb.and( p, cb.isFalse( root.get(Task_.completed )));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listAllTaskIdsWithProject(String project) throws Exception {
-		if( StringUtils.isEmpty( project )  ){
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(Task.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Task> root = cq.from(Task.class);
-		Predicate p = cb.equal(  root.get( Task_.project ), project );
-		cq.select( root.get(Task_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

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

@@ -1,270 +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.Order;
-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.base.core.project.tools.ListTools;
-import com.x.teamwork.assemble.control.AbstractFactory;
-import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Dynamic_;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectDetail;
-import com.x.teamwork.core.entity.ProjectTemplate;
-import com.x.teamwork.core.entity.Project_;
-import com.x.teamwork.core.entity.TaskListTemplate;
-import com.x.teamwork.core.entity.TaskListTemplate_;
-import com.x.teamwork.core.entity.Task_;
-import com.x.teamwork.core.entity.tools.CriteriaBuilderTools;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-
-
-public class TaskListTemplateFactory extends AbstractFactory {
-
-	public TaskListTemplateFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 获取指定Id的Project实体信息对象
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public TaskListTemplate get( String id ) throws Exception {
-		return this.entityManagerContainer().find( id, TaskListTemplate.class, ExceptionWhen.none );
-	}
-	
-	public ProjectDetail getDetail(String id) throws Exception {
-		return this.entityManagerContainer().find( id, ProjectDetail.class, ExceptionWhen.none );
-	}
-	
-	/**
-	 * 列示指定ProjectTemplate Id的TaskListTemplate实体信息列表
-	 * @param id
-	 * @return
-	 * @throws Exception
-	 */
-	public List<TaskListTemplate> list( String id ) throws Exception {
-		if( StringUtils.isEmpty( id ) ){
-			return new ArrayList<TaskListTemplate>();
-		}
-		EntityManager em = this.entityManagerContainer().get(TaskListTemplate.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<TaskListTemplate> cq = cb.createQuery(TaskListTemplate.class);
-		Root<TaskListTemplate> root = cq.from(TaskListTemplate.class);
-		Predicate p = cb.equal( root.get( TaskListTemplate_.projectTemplate ), id ); 
-		p = cb.and( p, cb.isFalse( root.get(TaskListTemplate_.deleted)));
-		cq.orderBy( cb.desc( root.get( TaskListTemplate_.updateTime ) ) ); 
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listAllProjectIds() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Project.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Project> root = cq.from(Project.class);
-		cq.select( root.get( Project_.id) );
-		return em.createQuery(cq ).getResultList();
-	}	
-	
-	/**
-	 * 根据条件查询符合条件的项目信息数量
-	 * @param personName
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public Long countWithFilter( String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-
-		if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-		cq.select(cb.count(root)).where(p);
-		Long count =  em.createQuery(cq).getSingleResult();
-		return count;
-	}
-	
-	/**
-	 *  根据条件查询符合条件的项目信息ID
-	 * @param maxCount
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Project> listWithFilter( Integer maxCount, String orderField, String orderType, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Project> cq = cb.createQuery(Project.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-		
-		if( StringUtils.isNotEmpty( personName )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-
-		Order orderWithField = CriteriaBuilderTools.getOrder(cb, root, Project_.class, orderField, orderType);
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询符合条件的项目信息ID,根据上一条的sequnce查询指定数量的信息
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<Project> listWithFilter( Integer maxCount, Object sequenceFieldValue, String orderField, String orderType, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Project> cq = cb.createQuery(Project.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-		
-		if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-		
-		if( sequenceFieldValue != null && StringUtils.isNotEmpty( sequenceFieldValue.toString() )) {
-			Predicate p_seq = cb.isNotNull( root.get( Dynamic_.sequence ) );
-			if( "desc".equalsIgnoreCase( orderType )){
-				p_seq = cb.and( p_seq, cb.lessThan( root.get( Project_.sequence ), sequenceFieldValue.toString() ));
-			}else{
-				p_seq = cb.and( p_seq, cb.greaterThan( root.get( Project_.sequence ), sequenceFieldValue.toString() ));
-			}
-			p = cb.and( p, p_seq);
-		}		
-		
-		Order orderWithField = CriteriaBuilderTools.getOrder( cb, root, Project_.class, orderField, orderType );
-		if( orderWithField != null ){
-			cq.orderBy( orderWithField );
-		}
-		System.out.println(">>>SQL:" + em.createQuery(cq.where(p)).setMaxResults( maxCount).toString() );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-	
-	/**
-	 * 根据条件查询所有符合条件的项目信息ID,项目信息不会很多 ,所以直接查询出来
-	 * @param maxCount
-	 * @param sequenceFieldValue
-	 * @param orderField
-	 * @param orderType
-	 * @param personName
-	 * @param identityNames
-	 * @param unitNames
-	 * @param groupNames
-	 * @param queryFilter
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listAllViewableProjectIds( Integer maxCount, String personName, List<String> identityNames, List<String> unitNames, List<String> groupNames, QueryFilter queryFilter) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( Project.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Project> root = cq.from(Project.class);
-		Predicate p_permission = null;
-		
-		
-		if( StringUtils.isNotEmpty( personName )) {
-			//可以管理的栏目,肯定可以发布信息
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.participantPersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.isMember( personName, root.get( Project_.manageablePersonList )) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.creatorPerson ), personName ) );
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission, cb.equal( root.get( Project_.executor ), personName ) );
-		}
-		if( ListTools.isNotEmpty( identityNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantIdentityList).in(identityNames));
-		}
-		if( ListTools.isNotEmpty( unitNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantUnitList).in(unitNames));
-		}
-		if( ListTools.isNotEmpty( groupNames )) {
-			p_permission = CriteriaBuilderTools.predicate_or( cb, p_permission,  root.get( Project_.participantGroupList).in(groupNames));
-		}
-		
-		Predicate p = CriteriaBuilderTools.composePredicateWithQueryFilter( Project_.class, cb, p_permission, root, queryFilter );
-		cq.distinct(true).select( root.get(Project_.id) );
-		return em.createQuery(cq.where(p)).setMaxResults( maxCount).getResultList();
-	}
-
-	
-}

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

@@ -1,49 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs;
-
-import java.util.Set;
-
-import javax.ws.rs.ApplicationPath;
-
-import com.x.base.core.project.jaxrs.AbstractActionApplication;
-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.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;
-import com.x.teamwork.assemble.control.jaxrs.projectTemplate.ProjectTemplateAction;
-import com.x.teamwork.assemble.control.jaxrs.projectgroup.ProjectGroupAction;
-import com.x.teamwork.assemble.control.jaxrs.task.TaskAction;
-import com.x.teamwork.assemble.control.jaxrs.taskListTemplate.TaskListTemplateAction;
-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 {
-
-	public Set<Class<?>> getClasses() {
-		
-		this.classes.add( ProjectAction.class );
-		this.classes.add( TaskAction.class );
-		this.classes.add( TaskTagAction.class );
-		this.classes.add( TaskViewAction.class );
-		this.classes.add( AttachmentAction.class );
-		this.classes.add( ProjectGroupAction.class );
-		this.classes.add( TaskGroupAction.class );
-		this.classes.add( TaskListAction.class );
-		this.classes.add( DynamicAction.class );
-		this.classes.add( ChatAction.class );
-		this.classes.add( SystemConfigAction.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;
-	}
-
-}

+ 0 - 25
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/JaxrsManagerUserFilter.java

@@ -1,25 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs;
-
-import javax.servlet.annotation.WebFilter;
-
-import com.x.base.core.project.jaxrs.ManagerUserJaxrsFilter;
-
-@WebFilter(urlPatterns = { 		
-		"/jaxrs/project/*",
-		"/jaxrs/chat/*",
-		"/jaxrs/task/*",
-		"/jaxrs/task_tag/*",
-		"/jaxrs/task_view/*",
-		"/jaxrs/attachment/*",
-		"/jaxrs/project_group/*",
-		"/jaxrs/projectTemplate/*",
-		"/jaxrs/taskListTemplate/*",
-		"/jaxrs/task_group/*",
-		"/jaxrs/task_list/*",
-		"/jaxrs/config/*",
-		"/jaxrs/extfield/*",
-		"/jaxrs/global/*",
-		"/jaxrs/dynamic/*"
-		}, asyncSupported = true)
-public class JaxrsManagerUserFilter extends ManagerUserJaxrsFilter {
-}

+ 0 - 219
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/chat/ActionCreate.java

@@ -1,219 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.chat;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.assemble.control.service.MessageFactory;
-import com.x.teamwork.core.entity.Chat;
-import com.x.teamwork.core.entity.Dynamic;
-import com.x.teamwork.core.entity.Task;
-
-public class ActionCreate extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionCreate.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Chat chat = null;
-		Task task = null;
-		Wi wi = null;
-		Wo wo = new Wo();
-		Boolean check = true;
-
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-			chat = Wi.copier.copy( wi );
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ChatPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( wi.getTaskId() )) {
-				check = false;
-				Exception exception = new TaskIDEmptyException();
-				result.error(exception);
-			}
-		}		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( wi.getContent() )) {
-				check = false;
-				Exception exception = new ChatContentEmptyException();
-				result.error(exception);
-			}
-		}		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( wi.getSender() )) {
-				chat.setSender( effectivePerson.getDistinguishedName() );
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				task = taskQueryService.get( wi.getTaskId() );
-				if ( task == null) {
-					check = false;
-					Exception exception = new TaskNotExistsException( wi.getTaskId() );
-					result.error( exception );
-				}else {
-					chat.setProjectId( task.getProject() );
-					chat.setProjectTitle( task.getProjectName() );
-					chat.setTaskTitle( task.getName() );
-					chat.setTarget(effectivePerson.getDistinguishedName());
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ChatPersistException(e, "根据ID查询工作任务信息对象时发生异常。ID:" + wi.getTaskId());
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				String lobContent = wi.getContent();
-				if( wi.getContent().length() > 70 ) {
-					chat.setIsLob( true );
-					chat.setContent( wi.getContent().substring(0, 70) + "...");
-				}
-				
-				chat = chatPersistService.create( effectivePerson, chat, lobContent );
-				
-				// 更新缓存
-				ApplicationCache.notify( Chat.class );
-				
-				wo.setId( chat.getId() );
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ChatPersistException(e, "工作评论信息保存时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}			
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				MessageFactory.message_to_chat( chat );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				Dynamic dynamic = dynamicPersistService.chatPublishDynamic( chat, effectivePerson,  jsonElement.toString() );
-				if( dynamic != null ) {
-					List<WoDynamic> dynamics = new ArrayList<>();
-					dynamics.add( WoDynamic.copier.copy( dynamic ) );
-					if( wo != null ) {
-						wo.setDynamics(dynamics);
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		result.setData( wo );
-		return result;
-	}	
-
-	public static class Wi {
-		
-		public static WrapCopier<Wi, Chat> copier = WrapCopierFactory.wi( Wi.class, Chat.class, null, null );
-
-		@FieldDescribe("所属工作ID,<font style='color:red'>必填</font>")
-		private String taskId = null;
-		
-		@FieldDescribe("交流内容,<font style='color:red'>必填</font>" )
-		private String content = null;
-		
-		@FieldDescribe("发送者,非必填")
-		private String sender = null;
-
-		@FieldDescribe("目标者,非必填")
-		private String target = null;		
-
-		public String getTaskId() {
-			return taskId;
-		}
-
-		public void setTaskId(String taskId) {
-			this.taskId = taskId;
-		}
-
-		public String getSender() {
-			return sender;
-		}
-
-		public void setSender(String sender) {
-			this.sender = sender;
-		}
-
-		public String getTarget() {
-			return target;
-		}
-
-		public void setTarget(String target) {
-			this.target = target;
-		}
-
-		public String getContent() {
-			return content;
-		}
-
-		public void setContent(String content) {
-			this.content = content;
-		}
-	}
-
-	public static class Wo extends WoId {
-		
-		@FieldDescribe("操作引起的动态内容")
-		List<WoDynamic> dynamics = new ArrayList<>();
-
-		public List<WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-		
-	}
-	
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, WoDynamic.class, null, JpaObject.FieldsInvisible);
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}		
-	}
-	
-}

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

@@ -1,120 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.CustomExtFieldRele;
-
-public class ActionDelete extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionDelete.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		CustomExtFieldRele customExtFieldRele = null;
-		Wo wo = new Wo();
-		Boolean check = true;
-
-		if ( StringUtils.isEmpty( flag ) ) {
-			check = false;
-			Exception exception = new CustomExtFieldReleFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				customExtFieldRele = customExtFieldReleQueryService.get(flag);
-				if ( customExtFieldRele == null) {
-					check = false;
-					Exception exception = new CustomExtFieldReleNotExistsException(flag);
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new CustomExtFieldReleQueryException(e, "根据指定flag查询扩展属性关联信息对象时发生异常。flag:" + flag);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				customExtFieldRelePersistService.delete(flag, effectivePerson );
-				
-				// 更新缓存
-				ApplicationCache.notify( CustomExtFieldRele.class );
-				
-				wo.setId( customExtFieldRele.getId() );
-				
-			} catch (Exception e) {
-				check = false;
-				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( customExtFieldRele, effectivePerson);
-				if( dynamic != null ) {
-					List<WoDynamic> dynamics = new ArrayList<>();
-					dynamics.add( WoDynamic.copier.copy( dynamic ) );
-					if( wo != null ) {
-						wo.setDynamics(dynamics);
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}	
-		}
-		result.setData( wo );
-		return result;
-	}
-
-	public static class Wo extends WoId {
-		
-		@FieldDescribe("操作引起的动态内容")
-		List<WoDynamic> dynamics = new ArrayList<>();
-
-		public List<WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-		
-	}
-	
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, WoDynamic.class, null, JpaObject.FieldsInvisible);
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}		
-	}
-}

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

@@ -1,85 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.cache.ApplicationCache;
-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.teamwork.core.entity.CustomExtFieldRele;
-
-import net.sf.ehcache.Element;
-
-public class ActionGet extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionGet.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		CustomExtFieldRele customExtFieldRele = null;
-		Boolean check = true;
-
-		if ( StringUtils.isEmpty( id ) ) {
-			check = false;
-			Exception exception = new CustomExtFieldReleFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		String cacheKey = ApplicationCache.concreteCacheKey( "CustomExtFieldRele.Get." + id );
-		Element element = customExtFieldReleCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			
-		} else {
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					customExtFieldRele = customExtFieldReleQueryService.get(id);
-					if ( customExtFieldRele == null) {
-						check = false;
-						Exception exception = new CustomExtFieldReleNotExistsException(id);
-						result.error( exception );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new CustomExtFieldReleQueryException( e, "根据指定id查询扩展属性关联信息对象时发生异常。flag:" + id );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = Wo.copier.copy( customExtFieldRele );
-				} catch (Exception e) {
-					Exception exception = new CustomExtFieldReleQueryException(e, "将查询出来的扩展属性关联信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		result.setData( wo );
-		return result;
-	}
-
-	public static class Wo extends CustomExtFieldRele {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<CustomExtFieldRele, Wo> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-}

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

@@ -1,81 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.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 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( correlationId )) {
-				check = false;
-				Exception exception = new CustomExtFieldReleFlagForQueryEmptyException();
-				result.error( exception );
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( fieldType )) {
-				fieldType = "TEXT";
-			}
-		}
-		
-		/*if( Boolean.TRUE.equals( check ) ){
-			try {
-				project = projectQueryService.get( correlationId );
-				if ( project == null) {
-					check = false;
-					Exception exception = new ProjectNotExistsException( correlationId );
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new CustomExtFieldRelePersistException(e, "根据指定flag查询应用项目信息对象时发生异常。flag:" +  correlationId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}*/
-		
-		if( Boolean.TRUE.equals( check ) ){
-			String fieldName = customExtFieldReleQueryService.getNextUseableExtFieldName( correlationId, fieldType );
-			if( StringUtils.isNotEmpty( fieldName )) {
-				wo.setFieldName(fieldName);
-			}else {
-				Exception exception = new CustomExtFieldReleQueryException( "当前关联ID无可用扩展属性。" );
-				result.error(exception);
-			}
-		}
-		
-		result.setData(wo);	
-		return result;
-	}
-
-	public static class Wo {
- 
-		private String fieldName = null;
-
-		public String getFieldName() {
-			return fieldName;
-		}
-
-		public void setFieldName(String fieldName) {
-			this.fieldName = fieldName;
-		}
-	}
-}

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

@@ -1,33 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import java.util.List;
-
-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.CustomExtField;
-
-public class ActionListAllExtFields extends BaseAction {
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		result.setData(wo);	
-		return result;
-	}
-
-	public static class Wo {
- 
-		private List<FieldInfo> fieldInfos = CustomExtField.listAllExtField();
-		
-		public List<FieldInfo> getFieldInfos() {
-			return fieldInfos;
-		}
-
-		public void setFieldInfos(List<FieldInfo> fieldInfos) {
-			this.fieldInfos = fieldInfos;
-		}
-	}
-}

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

@@ -1,80 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.cache.ApplicationCache;
-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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.CustomExtFieldRele;
-
-import net.sf.ehcache.Element;
-
-public class ActionListWithCorrelation extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListWithCorrelation.class);
-
-	@SuppressWarnings("unchecked")
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String correlationId ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = null;
-		List<CustomExtFieldRele> customExtFieldReles = null;
-		Boolean check = true;
-
-		String cacheKey = ApplicationCache.concreteCacheKey( "ActionListWithCorrelation", correlationId, effectivePerson.getDistinguishedName() );
-		Element element = customExtFieldReleCache.get( cacheKey );
-		
-		if ((null != element) && (null != element.getObjectValue())) {
-			wos = (List<Wo>) element.getObjectValue();
-			result.setData( wos );
-		} else {
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					customExtFieldReles = customExtFieldReleQueryService.listReleWithCorrelation(correlationId);
-					if( ListTools.isEmpty( customExtFieldReles )) {
-						customExtFieldReles = new ArrayList<>();
-					}
-					wos = Wo.copier.copy( customExtFieldReles );						
-					SortTools.asc( wos, "createTime");						
-					customExtFieldReleCache.put(new Element(cacheKey, wos));
-					result.setData(wos);	
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new CustomExtFieldReleQueryException(e, "根据关联ID查询对应的扩展属性信息列表时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		return result;
-	}
-
-	public static class Wo extends CustomExtFieldRele {
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<CustomExtFieldRele, Wo> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-}

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

@@ -1,80 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.cache.ApplicationCache;
-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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.CustomExtFieldRele;
-
-import net.sf.ehcache.Element;
-
-public class ActionListWithType extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListWithType.class);
-
-	@SuppressWarnings("unchecked")
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String type ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = null;
-		List<CustomExtFieldRele> customExtFieldReles = null;
-		Boolean check = true;
-
-		String cacheKey = ApplicationCache.concreteCacheKey( "ActionListWithPublic", type, effectivePerson.getDistinguishedName() );
-		Element element = customExtFieldReleCache.get( cacheKey );
-		
-		if ((null != element) && (null != element.getObjectValue())) {
-			wos = (List<Wo>) element.getObjectValue();
-			result.setData( wos );
-		} else {
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					customExtFieldReles = customExtFieldReleQueryService.listReleWithType(type);
-					if( ListTools.isEmpty( customExtFieldReles )) {
-						customExtFieldReles = new ArrayList<>();
-					}
-					wos = Wo.copier.copy( customExtFieldReles );						
-					SortTools.asc( wos, "createTime");						
-					customExtFieldReleCache.put(new Element(cacheKey, wos));
-					result.setData(wos);	
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new CustomExtFieldReleQueryException(e, "根据关联ID查询对应的扩展属性信息列表时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		return result;
-	}
-
-	public static class Wo extends CustomExtFieldRele {
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<CustomExtFieldRele, Wo> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-}

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

@@ -1,290 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Project;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.CustomExtFieldRele;
-
-public class ActionSave extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionSave.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		CustomExtFieldRele customExtFieldRele = null;
-		CustomExtFieldRele customExtFieldRele_old = null;
-		Project project = null;
-		Task task = null;
-		Wi wi = null;
-		Wo wo = new Wo();
-		String fieldName = null;
-		Boolean check = true;
-
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-			customExtFieldRele = Wi.copier.copy( wi );
-		} catch (Exception e) {
-			check = false;
-			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( customExtFieldRele.getProjectId() )) {
-				check = false;
-				Exception exception = new ProjectFlagForQueryEmptyException();
-				result.error( exception );
-			}
-		}*/
-		
-		if( Boolean.TRUE.equals( check ) ){
-			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 CustomExtFieldRelePersistException(e, "根据指定flag查询应用项目信息对象时发生异常。flag:" +  customExtFieldRele.getCorrelationId() );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isNotEmpty( customExtFieldRele.getId() )) {
-				try {
-					customExtFieldRele_old = customExtFieldReleQueryService.get( customExtFieldRele.getId() );
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new CustomExtFieldReleQueryException(e, "系统在根据ID查询指定的扩展属性关联信息时发生异常。ID:" +  customExtFieldRele.getId() );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( customExtFieldRele_old == null ) { //新建
-				fieldName = customExtFieldReleQueryService.getNextUseableExtFieldName( customExtFieldRele.getCorrelationId(), customExtFieldRele.getDisplayType() );
-			}else {
-				//判断是否属性在富文本和普通 文本之间发生了变换
-				if( (StringUtils.equals("RICHTEXT",wi.getDisplayType()) && !StringUtils.equals("RICHTEXT",customExtFieldRele_old.getDisplayType()))
-						|| !StringUtils.equals("RICHTEXT",wi.getDisplayType()) && StringUtils.equals("RICHTEXT",customExtFieldRele_old.getDisplayType())) {
-					//判断当前所需要的类型的备用属性是否足够
-					fieldName = customExtFieldReleQueryService.getNextUseableExtFieldName( customExtFieldRele.getCorrelationId(), customExtFieldRele.getDisplayType() );
-				}else {
-					fieldName = customExtFieldRele_old.getExtFieldName();
-				}
-			}
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty(  fieldName )) {
-				//备用属性已经用完了,无法再添加新的属性
-				check = false;
-				wo.setUseable(false);
-				/*Exception exception = new CustomExtFieldRelePersistException( "扩展属性不足(备用属性已用完),系统无法为该对象分配["+ customExtFieldRele.getDisplayType() +"]。"  );
-				result.error(exception);*/
-			}else {
-				customExtFieldRele.setExtFieldName( fieldName );
-			}
-		}
-
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				
-				customExtFieldRele = customExtFieldRelePersistService.save( customExtFieldRele, effectivePerson );
-				
-				// 更新缓存
-				ApplicationCache.notify( CustomExtFieldRele.class );
-				
-				wo.setId( customExtFieldRele.getId()  );
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new CustomExtFieldRelePersistException(e, "扩展属性关联信息保存时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}			
-		}
-		if( Boolean.TRUE.equals( check ) ){
-			try {					
-				Dynamic dynamic = dynamicPersistService.projectExtFieldReleSaveDynamic(customExtFieldRele_old, customExtFieldRele, effectivePerson);
-				if( dynamic != null ) {
-					List<WoDynamic> dynamics = new ArrayList<>();
-					dynamics.add( WoDynamic.copier.copy( dynamic ) );
-					if( wo != null ) {
-						wo.setDynamics(dynamics);
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		result.setData( wo );
-		return result;
-	}	
-
-	public static class Wi {
-		
-		@FieldDescribe("ID,为空时为新建")
-		private String id;
-
-		@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, CustomExtFieldRele> copier = WrapCopierFactory.wi( Wi.class, CustomExtFieldRele.class, null, null );
-		
-		public String getDisplayType() {
-			return displayType;
-		}
-
-		public void setDisplayType(String displayType) {
-			this.displayType = displayType;
-		}
-
-		public String getOptionsData() {
-			return optionsData;
-		}
-
-		public void setOptionsData(String optionsData) {
-			this.optionsData = optionsData;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getCorrelationId() {
-			return correlationId;
-		}
-
-		public void setCorrelationId(String correlationId) {
-			this.correlationId = correlationId;
-		}
-
-		public String getDisplayName() {
-			return displayName;
-		}
-
-		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;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-	}
-
-	public static class Wo extends WoId {
-		
-		@FieldDescribe("操作引起的动态内容")
-		List<WoDynamic> dynamics = new ArrayList<>();
-		
-		@FieldDescribe("备用属性是否可用")
-		Boolean useable = true;
-		
-		public Boolean getUseable(){
-			return useable;
-		}
-		
-		public void setUseable(Boolean useable){
-			this.useable = useable;
-		}
-
-		public List<WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-		
-	}
-	
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, WoDynamic.class, null, JpaObject.FieldsInvisible);
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}		
-	}
-	
-}

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

@@ -1,30 +0,0 @@
-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.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.assemble.control.service.TaskQueryService;
-import com.x.teamwork.core.entity.CustomExtFieldRele;
-
-import net.sf.ehcache.Ehcache;
-
-public class BaseAction extends StandardJaxrsAction {
-
-	protected Ehcache customExtFieldReleCache = ApplicationCache.instance().getCache( CustomExtFieldRele.class );
-	
-	protected 	CustomExtFieldReleQueryService customExtFieldReleQueryService = new CustomExtFieldReleQueryService();
-	
-	protected 	CustomExtFieldRelePersistService customExtFieldRelePersistService = new CustomExtFieldRelePersistService();
-	
-	protected 	ProjectQueryService projectQueryService = new ProjectQueryService();
-	protected 	TaskQueryService taskQueryService = new TaskQueryService();
-	
-	protected 	DynamicPersistService dynamicPersistService = new DynamicPersistService();
-	
-	protected 	SystemConfigQueryService systemConfigQueryService = new SystemConfigQueryService();
-	
-}

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

@@ -1,167 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.extfield;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-@Path("extfield")
-@JaxrsDescribe("扩展属性关联信息管理")
-public class CustomExtFieldReleAction extends StandardJaxrsAction {
-
-	private Logger logger = LoggerFactory.getLogger(CustomExtFieldReleAction.class);
-	
-	@JaxrsMethodDescribe(value = "查询所有扩展属性信息.", action = ActionListAllExtFields.class)
-	@GET
-	@Path("list/fields/all")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listAllUseableFields(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request ) {
-		ActionResult<ActionListAllExtFields.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);	
-		try {
-			result = new ActionListAllExtFields().execute( request, effectivePerson );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据指定ID查询扩展属性关联信息.", action = ActionGet.class)
-	@GET
-	@Path("rele/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void get(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, @JaxrsParameterDescribe("关联信息ID") @PathParam("id") String id ) {
-		ActionResult<ActionGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);	
-		try {
-			result = new ActionGet().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据关联ID,需要的扩展属性类别获取下一个可用的属性名称.", action = ActionGetNextUseableExtFieldName.class)
-	@GET
-	@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("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, correlationId, fieldType );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据关联ID查询用户创建的所有扩展属性关联信息列表.", action = ActionListWithCorrelation.class)
-	@GET
-	@Path("list/{correlationId}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listFieldsWithCorrelation(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request,
-			@JaxrsParameterDescribe("关联ID") @PathParam("correlationId") String correlationId ) {
-		ActionResult<List<ActionListWithCorrelation.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);	
-		try {
-			result = new ActionListWithCorrelation().execute( request, effectivePerson, correlationId );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据扩展属性类型查询扩展属性信息列表.", action = ActionListWithType.class)
-	@GET
-	@Path("listPublicFields/{type}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listFieldsWithType(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request,
-			@JaxrsParameterDescribe("扩展属性类型") @PathParam("type") String type ) {
-		ActionResult<List<ActionListWithType.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);	
-		try {
-			result = new ActionListWithType().execute( request, effectivePerson, type );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@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 ) {
-		ActionResult<ActionSave.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionSave().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识删除扩展属性关联信息.", action = ActionDelete.class)
-	@DELETE
-	@Path("relevance/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void delete(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionDelete.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionDelete().execute(request, effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

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

@@ -1,12 +0,0 @@
-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为空,无法继续查询数据。" );
-	}
-}

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

@@ -1,12 +0,0 @@
-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 );
-	}
-}

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

@@ -1,20 +0,0 @@
-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 );
-	}
-}

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

@@ -1,20 +0,0 @@
-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/TaskNotExistsException.java

@@ -1,12 +0,0 @@
-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 );
-	}
-}

+ 0 - 73
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionInitConfig.java

@@ -1,73 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.base.core.project.tools.ListTools;
-import com.x.teamwork.core.entity.Priority;
-
-public class ActionInitConfig extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionInitConfig.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		List<Priority> prioritys = null;
-		
-		try {
-			prioritys = priorityQueryService.listPriority();
-			if( ListTools.isEmpty( prioritys )) {
-				//初始化默认的优先级配置、默认模板
-				this.initPrioritys(wo,effectivePerson);
-				
-			}
-		} catch (Exception e) {
-			Exception exception = new PriorityQueryException(e, "查询优先级信息列表时发生异常。");
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		result.setData( wo );
-		return result;
-	}	
-	
-	private void initPrioritys(Wo wo,EffectivePerson effectivePerson) throws Exception{
-		for(int i=0;i<3;i++){
-			Priority priority = new Priority();
-			if(i==0){
-				priority.setPriority("紧急");
-				priority.setPriorityColor("#e62412");
-			}
-			if(i==1){
-				priority.setPriority("优先");
-				priority.setPriorityColor("#fa8c15");
-			}
-			if(i==2){
-				priority.setPriority("普通");
-				priority.setPriorityColor("#15ad31");
-			}
-			priority.setOrder(i);
-			priority.setOwner("系统");
-			try {
-				priority = priorityPersistService.save( priority, effectivePerson );
-				ApplicationCache.notify( Priority.class );	
-				wo.setId( priority.getId() );
-			} catch (Exception e) {
-				Exception exception = new PriorityPersistException(e, "优先级信息保存时发生异常。");
-			}
-		}
-	}
-
-	public static class Wo extends WoId {
-		
-	}
-	
-}

+ 0 - 39
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionIsManager.java

@@ -1,39 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import javax.servlet.http.HttpServletRequest;
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.assemble.control.Business;
-
-
-
-public class ActionIsManager extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionIsManager.class);
-
-	protected ActionResult<String> execute(HttpServletRequest request, EffectivePerson effectivePerson) throws Exception {
-		ActionResult<String> result = new ActionResult<>();
-		
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()){
-			Business business = new Business(emc);
-			if(business.isManager(effectivePerson)){
-				result.setData( "yes" );
-			}else{
-				result.setData( "no" );
-			}
-		} catch (Exception e) {
-			result.error(e);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		return result;
-	}
-	public static class Wo extends WoId {
-
-	}
-}

+ 0 - 140
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionListProjectConfigNextWithFilter.java

@@ -1,140 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.JsonElement;
-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.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.tools.filter.QueryFilter;
-
-import com.x.teamwork.core.entity.ProjectConfig;
-
-public class ActionListProjectConfigNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListProjectConfigNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		QueryFilter  queryFilter = null;
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectConfigQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*采用缓存
-			 * cacheKey = ApplicationCache.concreteCacheKey( "ActionListNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectConfigIds = projectConfigQueryService.listAllProjectConfigIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectConfigIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectConfigIds.size() + "" );										
-						List<ProjectConfig>  projectConfigList = projectConfigQueryService.listWithProjectConfigIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectConfigIds );
-						
-						if( ListTools.isNotEmpty( projectConfigList )) {
-							for( ProjectConfig projectConfig : projectConfigList ) {
-								Wo wo = Wo.copier.copy(projectConfig);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目配置信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProjectConfig{
-		
-	}
-	
-	public static class Wo extends ProjectConfig {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<ProjectConfig, Wo> copier = WrapCopierFactory.wo( ProjectConfig.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 80
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPriorityDelete.java

@@ -1,80 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Priority;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectGroup;
-
-public class ActionPriorityDelete extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionPriorityDelete.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Priority priority = null;
-		Boolean check = true;
-		Wo wo = new Wo();
-
-		if ( StringUtils.isEmpty( flag ) ) {
-			check = false;
-			Exception exception = new PriorityFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				priority = priorityQueryService.get(flag);
-				if ( priority == null) {
-					check = false;
-					Exception exception = new PriorityNotExistsException(flag);
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new PriorityQueryException(e, "根据指定flag查询优先级信息对象时发生异常。flag:" + flag);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				priorityPersistService.delete(flag, effectivePerson );				
-				// 更新缓存
-				ApplicationCache.notify( Priority.class );
-				
-				wo.setId( priority.getId() );
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new PriorityQueryException(e, "根据指定flag删除优先级信息对象时发生异常。flag:" + flag);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		result.setData( wo );
-		return result;
-	}
-
-	public static class Wo extends WoId {
-		
-	}
-	
-}

+ 0 - 78
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPriorityGet.java

@@ -1,78 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.cache.ApplicationCache;
-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.teamwork.core.entity.Priority;
-import com.x.teamwork.core.entity.ProjectGroup;
-
-import net.sf.ehcache.Element;
-
-public class ActionPriorityGet extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionPriorityGet.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		Priority priority = null;
-		Boolean check = true;
-
-		if ( StringUtils.isEmpty( id ) ) {
-			check = false;
-			Exception exception = new PriorityFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				priority = priorityQueryService.get( id );
-				if ( priority == null) {
-					check = false;
-					Exception exception = new PriorityNotExistsException( id );
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new PriorityQueryException(e, "根据指定flag查询优先级信息对象时发生异常。id:" + id );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				wo = Wo.copier.copy( priority );					
-				result.setData(wo);
-			} catch (Exception e) {
-				Exception exception = new PriorityQueryException(e, "将查询出来的优先级信息对象转换为可输出的数据信息时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}
-
-	public static class Wo extends Priority {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Priority, Wo> copier = WrapCopierFactory.wo( Priority.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-}

+ 0 - 70
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPriorityList.java

@@ -1,70 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.cache.ApplicationCache;
-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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.Priority;
-import com.x.teamwork.core.entity.ProjectGroup;
-
-import net.sf.ehcache.Element;
-
-public class ActionPriorityList extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionPriorityList.class);
-
-	@SuppressWarnings("unchecked")
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = null;
-		List<Priority> prioritys = null;
-
-		try {
-			prioritys = priorityQueryService.listPriority();
-			if( ListTools.isNotEmpty( prioritys )) {
-				wos = Wo.copier.copy( prioritys );
-				
-				//SortTools.asc( wos, "createTime");
-				result.setData(wos);
-			}
-			result.setData(wos);
-		} catch (Exception e) {
-			Exception exception = new PriorityQueryException(e, "查询优先级信息列表时发生异常。");
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		return result;
-	}
-
-	public static class Wo extends Priority {
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Priority, Wo> copier = WrapCopierFactory.wo( Priority.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-}

+ 0 - 61
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionPrioritySave.java

@@ -1,61 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Priority;
-
-public class ActionPrioritySave extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionPrioritySave.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Priority priority = null;
-		Wi wi = null;
-		Wo wo = new Wo();
-
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e) {
-			Exception exception = new PriorityPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		
-		try {					
-			priority = priorityPersistService.save( wi, effectivePerson );
-			// 更新缓存
-			ApplicationCache.notify( Priority.class );		
-			wo.setId( priority.getId() );
-		} catch (Exception e) {
-			Exception exception = new PriorityPersistException(e, "优先级信息保存时发生异常。");
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}			
-		
-		result.setData( wo );
-		return result;
-	}	
-
-	public static class Wi extends Priority {
-		private static final long serialVersionUID = -6314932919066148113L;
-		
-		public static WrapCopier<Wi, Priority> copier = WrapCopierFactory.wi( Wi.class, Priority.class, null, null );
-		
-	}
-
-	public static class Wo extends WoId {
-		
-	}
-	
-}

+ 0 - 70
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigDelete.java

@@ -1,70 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.ProjectConfig;
-
-public class ActionProjectConfigDelete extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionProjectConfigDelete.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		ProjectConfig projectConfig = null;
-		Boolean check = true;
-		Wo wo = new Wo();
-
-		if ( StringUtils.isEmpty( flag ) ) {
-			check = false;
-			Exception exception = new ProjectConfigFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				projectConfig = projectConfigQueryService.get(flag);
-				if ( projectConfig == null) {
-					check = false;
-					Exception exception = new ProjectConfigNotExistsException(flag);
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectConfigQueryException(e, "根据指定flag查询项目配置信息对象时发生异常。flag:" + flag);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				projectConfigPersistService.delete(flag, effectivePerson );				
-				// 更新缓存
-				ApplicationCache.notify( ProjectConfig.class );
-				
-				wo.setId( projectConfig.getId() );
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectConfigQueryException(e, "根据指定flag删除项目配置信息对象时发生异常。flag:" + flag);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		result.setData( wo );
-		return result;
-	}
-
-	public static class Wo extends WoId {
-		
-	}
-	
-}

+ 0 - 79
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigGet.java

@@ -1,79 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.cache.ApplicationCache;
-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.teamwork.core.entity.Priority;
-import com.x.teamwork.core.entity.ProjectConfig;
-import com.x.teamwork.core.entity.ProjectGroup;
-
-import net.sf.ehcache.Element;
-
-public class ActionProjectConfigGet extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionProjectConfigGet.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		ProjectConfig projectConfig = null;
-		Boolean check = true;
-
-		if ( StringUtils.isEmpty( id ) ) {
-			check = false;
-			Exception exception = new PriorityFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				projectConfig = projectConfigQueryService.get( id );
-				if ( projectConfig == null) {
-					check = false;
-					Exception exception = new ProjectConfigNotExistsException( id );
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectConfigQueryException(e, "根据指定flag查询项目配置信息对象时发生异常。id:" + id );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				wo = Wo.copier.copy( projectConfig );					
-				result.setData(wo);
-			} catch (Exception e) {
-				Exception exception = new ProjectConfigQueryException(e, "将查询出来的项目配置信息对象转换为可输出的数据信息时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}
-
-	public static class Wo extends ProjectConfig {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<ProjectConfig, Wo> copier = WrapCopierFactory.wo( ProjectConfig.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-}

+ 0 - 83
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigGetByProject.java

@@ -1,83 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.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.ProjectConfig;
-
-
-
-
-public class ActionProjectConfigGetByProject extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionProjectConfigGetByProject.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<Wo>();
-		Wo  wo = null;
-		List<ProjectConfig>  projectConfigs = null;
-		ProjectConfig projectConfig = null;
-		Boolean check = true;
-
-		if ( StringUtils.isEmpty( id ) ) {
-			check = false;
-			Exception exception = new ProjectConfigFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				projectConfigs = projectConfigQueryService.getProjectConfigByProject( id );
-				if(ListTools.isNotEmpty(projectConfigs)){
-					projectConfig = projectConfigs.get(0);
-				}
-				/*
-				if ( projectConfig == null) {
-					check = false;
-					Exception exception = new ProjectConfigNotExistsException( id );
-					result.error( exception );
-				}*/
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectConfigQueryException(e, "根据指定flag查询项目配置信息对象时发生异常。id:" + id );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-					wo = Wo.copier.copy( projectConfig );					
-					result.setData(wo);
-				
-			} catch (Exception e) {
-				Exception exception = new ProjectConfigQueryException(e, "将查询出来的项目配置信息对象转换为可输出的数据信息时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}
-
-	public static class Wo extends ProjectConfig {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<ProjectConfig, Wo> copier = WrapCopierFactory.wo( ProjectConfig.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-}

+ 0 - 61
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ActionProjectConfigSave.java

@@ -1,61 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.ProjectConfig;
-
-public class ActionProjectConfigSave extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionProjectConfigSave.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		ProjectConfig projectConfig = null;
-		Wi wi = null;
-		Wo wo = new Wo();
-
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e) {
-			Exception exception = new PriorityPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		
-		try {					
-			projectConfig = projectConfigPersistService.save( wi, effectivePerson );
-			// 更新缓存
-			ApplicationCache.notify( ProjectConfig.class );		
-			wo.setId( projectConfig.getId() );
-		} catch (Exception e) {
-			Exception exception = new PriorityPersistException(e, "项目配置信息保存时发生异常。");
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}			
-		
-		result.setData( wo );
-		return result;
-	}	
-
-	public static class Wi extends ProjectConfig {
-		private static final long serialVersionUID = -6314932919066148113L;
-		
-		public static WrapCopier<Wi, ProjectConfig> copier = WrapCopierFactory.wi( Wi.class, ProjectConfig.class, null, null );
-		
-	}
-
-	public static class Wo extends WoId {
-		
-	}
-	
-}

+ 0 - 34
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/BaseAction.java

@@ -1,34 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-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.PriorityPersistService;
-import com.x.teamwork.assemble.control.service.PriorityQueryService;
-import com.x.teamwork.assemble.control.service.ProjectConfigPersistService;
-import com.x.teamwork.assemble.control.service.ProjectConfigQueryService;
-import com.x.teamwork.assemble.control.service.SystemConfigQueryService;
-import com.x.teamwork.core.entity.Priority;
-import com.x.teamwork.core.entity.ProjectConfig;
-
-import net.sf.ehcache.Ehcache;
-
-public class BaseAction extends StandardJaxrsAction {
-
-	protected Ehcache priorityCache = ApplicationCache.instance().getCache( Priority.class );
-	
-	protected 	PriorityQueryService priorityQueryService = new PriorityQueryService();
-	
-	protected 	PriorityPersistService priorityPersistService = new PriorityPersistService();
-	
-	protected 	DynamicPersistService dynamicPersistService = new DynamicPersistService();
-	
-	protected 	SystemConfigQueryService systemConfigQueryService = new SystemConfigQueryService();
-	
-	protected Ehcache projectConfigCache = ApplicationCache.instance().getCache( ProjectConfig.class );
-	
-	protected 	ProjectConfigPersistService projectConfigPersistService = new ProjectConfigPersistService();
-	
-	protected 	ProjectConfigQueryService projectConfigQueryService = new ProjectConfigQueryService();
-	
-}

+ 0 - 245
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/GlobalAction.java

@@ -1,245 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.teamwork.assemble.control.jaxrs.project.ActionListNextWithFilter;
-
-@Path("global")
-@JaxrsDescribe("全局信息管理")
-public class GlobalAction extends StandardJaxrsAction {
-
-	private Logger logger = LoggerFactory.getLogger(GlobalAction.class);
-	
-	@JaxrsMethodDescribe(value = "查询当前用户是否具有管理员权限.", action = ActionIsManager.class)
-	@GET
-	@Path("isManager")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void isManager(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request ) {
-		ActionResult<String> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);	
-		try {
-			result = new ActionIsManager().execute( request, effectivePerson );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据ID查询优先级信息.", action = ActionPriorityGet.class)
-	@GET
-	@Path("priority/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void priorityGet(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("优先级ID") @PathParam("id") String id ) {
-		ActionResult<ActionPriorityGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionPriorityGet().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "查询所有优先级信息列表.", action = ActionPriorityList.class)
-	@GET
-	@Path("priority/list")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void priorityList(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request ) {
-		ActionResult<List<ActionPriorityList.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);	
-		try {
-			result = new ActionPriorityList().execute( request, effectivePerson );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "创建或者更新一个优先级信息.", action = ActionPrioritySave.class)
-	@POST
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void prioritySave(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("需要保存的优先级信息") JsonElement jsonElement ) {
-		ActionResult<ActionPrioritySave.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionPrioritySave().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识删除优先级信息.", action = ActionPriorityDelete.class)
-	@DELETE
-	@Path("priority/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void priorityDelete(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionPriorityDelete.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionPriorityDelete().execute(request, effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据ID查询项目配置信息.", action = ActionProjectConfigGet.class)
-	@GET
-	@Path("projectConfig/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void projectConfigGet(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("项目配置ID") @PathParam("id") String id ) {
-		ActionResult<ActionProjectConfigGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionProjectConfigGet().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "创建或者更新一个项目配置信息.", action = ActionProjectConfigSave.class)
-	@POST
-	@Path("projectConfig")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void projectConfigSave(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("需要保存的优先级信息") JsonElement jsonElement ) {
-		ActionResult<ActionProjectConfigSave.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionProjectConfigSave().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识删除项目配置信息.", action = ActionProjectConfigDelete.class)
-	@DELETE
-	@Path("projectConfig/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void projectConfigDelete(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionProjectConfigDelete.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionProjectConfigDelete().execute(request, effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示项目配置信息,下一页.", action = ActionListProjectConfigNextWithFilter.class)
-	@PUT
-	@Path("listProjectConfig/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listProjectConfigNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListProjectConfigNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListProjectConfigNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据ID查询项目配置信息.", action = ActionProjectConfigGetByProject.class)
-	@GET
-	@Path("projectConfig/project/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void projectConfigGetByProject(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("项目ID") @PathParam("id") String id ) {
-		ActionResult<ActionProjectConfigGetByProject.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionProjectConfigGetByProject().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "初始化优先级信息.", action = ActionInitConfig.class)
-	@GET
-	@Path("initConfig")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void initConfig(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request) {
-		ActionResult<ActionInitConfig.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionInitConfig().execute(request, effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-}

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

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

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

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

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

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

+ 0 - 16
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/PriorityQueryException.java

@@ -1,16 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import com.x.base.core.project.exception.PromptException;
-
-class PriorityQueryException extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	PriorityQueryException( Throwable e ) {
-		super("系统在查询优先级信息时发生异常。" , e );
-	}
-	
-	PriorityQueryException( Throwable e, String message ) {
-		super("系统在查询优先级信息时发生异常。Message:" + message, e );
-	}
-}

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

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

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

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

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

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

+ 0 - 16
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/ProjectConfigQueryException.java

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

+ 0 - 223
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/global/WrapInQueryProjectConfig.java

@@ -1,223 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.global;
-
-import javax.persistence.Column;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.openjpa.persistence.jdbc.Index;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.entity.annotation.CheckPersist;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.LikeTerm;
-
-public class WrapInQueryProjectConfig {
-	@FieldDescribe("用于排列的属性,非必填,默认为createTime.")
-	private String orderField = "createTime";
-
-	@FieldDescribe("排序方式:DESC | ASC,非必填, 默认为DESC.")
-	private String orderType = "DESC";
-	
-	@FieldDescribe("项目ID.")
-	private String project=null;
-	
-	@FieldDescribe("新建任务:true|false.")
-	private String taskCreate = null;
-	
-	@FieldDescribe("复制任务:true|false.")
-	private String taskCopy = null;
-	
-	@FieldDescribe("删除任务:true|false.")
-	private String taskRemove = null;
-	
-	@FieldDescribe("新建泳道:true|false.")
-	private String laneCreate = null;
-	
-	@FieldDescribe("编辑泳道:true|false.")
-	private String laneEdit = null;
-	
-	@FieldDescribe("删除泳道:true|false.")
-	private String laneRemove = null;
-	
-	@FieldDescribe("上传附件:true|false.")
-	private String attachmentUpload = null;
-	
-	@FieldDescribe("允许评论:true|false.")
-	private String comment = null;
-	
-	private Long rank = 0L;
-	
-	public String getProject() {
-		return project;
-	}
-
-	public void setProject(String project) {
-		this.project = project;
-	}
-	
-	public String getTaskCreate() {
-		return taskCreate;
-	}
-
-	public void setTaskCreate(String taskCreate) {
-		this.taskCreate = taskCreate;
-	}
-	
-	public String getTaskCopy() {
-		return taskCopy;
-	}
-
-	public void setTaskCopy(String taskCopy) {
-		this.taskCopy = taskCopy;
-	}
-	
-	public String getTaskRemove() {
-		return taskRemove;
-	}
-
-	public void setTaskRemove(String taskRemove) {
-		this.taskRemove = taskRemove;
-	}
-	
-	public String getLaneCreate() {
-		return laneCreate;
-	}
-
-	public void setLaneCreate(String laneCreate) {
-		this.laneCreate = laneCreate;
-	}
-	
-	public String getLaneEdit() {
-		return laneEdit;
-	}
-
-	public void setLaneEdit(String laneEdit) {
-		this.laneEdit = laneEdit;
-	}
-	
-	public String getLaneRemove() {
-		return laneRemove;
-	}
-
-	public void setLaneRemove(String laneRemove) {
-		this.laneRemove = laneRemove;
-	}
-
-	public String getAttachmentUpload() {
-		return attachmentUpload;
-	}
-
-	public void setAttachmentUpload(String attachmentUpload) {
-		this.attachmentUpload = attachmentUpload;
-	}
-	
-	public String getComment() {
-		return comment;
-	}
-
-	public void setComment(String comment) {
-		this.comment = comment;
-	}
-	
-	public String getOrderField() {
-		return orderField;
-	}
-	public void setOrderField(String orderField) {
-		this.orderField = orderField;
-	}
-	public String getOrderType() {
-		return orderType;
-	}
-
-	public void setOrderType(String orderType) {
-		this.orderType = orderType;
-	}
-	
-	public Long getRank() {
-		return rank;
-	}
-	public void setRank(Long rank) {
-		this.rank = rank;
-	}
-
-
-
-	/**
-	 * 根据传入的查询参数,组织一个完整的QueryFilter对象
-	 * @return
-	 */
-	public QueryFilter getQueryFilter() {
-		QueryFilter queryFilter = new QueryFilter();		
-		queryFilter.setJoinType( "and" );
-		//组织查询条件对象
-		if( StringUtils.isNotEmpty( this.getProject())) {
-			queryFilter.addEqualsTerm( new EqualsTerm( "project", this.getProject() ) );
-		}
-		
-		if( StringUtils.isNotEmpty( this.getTaskCreate() )) {
-			if("true".equalsIgnoreCase( this.getTaskCreate() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "taskCreate", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "taskCreate", false ) );
-			}
-		}
-		if( StringUtils.isNotEmpty( this.getTaskCopy() )) {
-			if("true".equalsIgnoreCase( this.getTaskCopy() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "taskCopy", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "taskCopy", false ) );
-			}
-		}
-		
-		if( StringUtils.isNotEmpty( this.getTaskRemove() )) {
-			if("true".equalsIgnoreCase( this.getTaskRemove() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "taskRemove", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "taskRemove", false ) );
-			}
-		}
-		
-		if( StringUtils.isNotEmpty( this.getLaneCreate() )) {
-			if("true".equalsIgnoreCase( this.getLaneCreate() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "laneCreate", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "laneCreate", false ) );
-			}
-		}
-		
-		if( StringUtils.isNotEmpty( this.getLaneEdit() )) {
-			if("true".equalsIgnoreCase( this.getLaneEdit() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "laneEdit", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "laneEdit", false ) );
-			}
-		}
-		
-		if( StringUtils.isNotEmpty( this.getLaneRemove() )) {
-			if("true".equalsIgnoreCase( this.getLaneRemove() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "laneRemove", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "laneRemove", false ) );
-			}
-		}
-		
-		if( StringUtils.isNotEmpty( this.getAttachmentUpload() )) {
-			if("true".equalsIgnoreCase( this.getAttachmentUpload() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "attachmentUpload", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "attachmentUpload", false ) );
-			}
-		}
-		
-		if( StringUtils.isNotEmpty( this.getComment() )) {
-			if("true".equalsIgnoreCase( this.getComment() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "comment", true ) );
-			}else{
-				queryFilter.addEqualsTerm( new EqualsTerm( "comment", false ) );
-			}
-		}
-		
-		return queryFilter;
-	}
-}

+ 0 - 160
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/list/ActionListWithTaskGroup.java

@@ -1,160 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.list;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-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.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.Project;
-import com.x.teamwork.core.entity.TaskList;
-
-
-public class ActionListWithTaskGroup extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListWithTaskGroup.class);
-
-	@SuppressWarnings("unchecked")
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String taskGroupId ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = null;
-		List<TaskList> taskLists = null;
-		Boolean check = true;
-		/*String cacheKey = ApplicationCache.concreteCacheKey( "list.my.taskgroup", taskGroupId, effectivePerson.getDistinguishedName() );
-		Element element = taskListCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			System.out.println("111");
-			wos = (List<Wo>) element.getObjectValue(); 
-			result.setData( wos );
-		} else {*/
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					taskLists = taskListQueryService.listWithTaskGroup( effectivePerson.getDistinguishedName(), taskGroupId );
-					if( ListTools.isNotEmpty( taskLists )) {
-						wos = Wo.copier.copy( taskLists );
-						if( ListTools.isNotEmpty( wos )) {
-							for( Wo wo : wos ) {
-								//计算当前List里的任务数量
-								wo.setTaskCount(taskListQueryService.countTaskWithTaskListId( effectivePerson.getDistinguishedName(), wo.getId(), wo.getTaskGroup() ));
-								if( "NoneList".equalsIgnoreCase( wo.getMemo() )) {
-									wo.setControl( new Control(false, false, false, false ));
-								}else {
-									wo.setControl( new Control(true, true, true, true ));
-								}
-								Project project = null;
-								project = projectQueryService.get(wo.getProject());
-								if(project != null && (project.getDeleted() || project.getCompleted())){
-									wo.setControl( new Control(false, false, false, false ));
-								}
-							}
-						}
-						//taskListCache.put(new Element(cacheKey, wos));
-						result.setData(wos);
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskListQueryException(e, "根据用户在指定工作任务组拥有的工作任务列表信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		//}
-		return result;
-	}
-
-	public static class Wo extends TaskList {
-		
-		private Long rank;
-		
-		@FieldDescribe("工作任务数量.")
-		private Long taskCount = 0L;
-		
-		@FieldDescribe("工作任务列表操作权限.")
-		private Control control;
-		
-		public Control getControl() {
-			return control;
-		}
-
-		public void setControl(Control control) {
-			this.control = control;
-		}
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public Long getTaskCount() {
-			return taskCount;
-		}
-
-		public void setTaskCount(Long taskCount) {
-			this.taskCount = taskCount;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskList, Wo> copier = WrapCopierFactory.wo( TaskList.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class Control{
-		 
-		private Boolean delete = false;
-		
-		private Boolean edit = false;
-		
-		private Boolean sortable = true;
-		
-		private Boolean founder = false;
-
-		public Control( Boolean edit, Boolean delete, Boolean sortable, Boolean founder ) {
-			this.delete = delete;
-			this.edit = edit;
-			this.sortable = sortable;
-			this.founder = founder;
-		}
-		public Boolean getDelete() {
-			return delete;
-		}
-
-		public void setDelete(Boolean delete) {
-			this.delete = delete;
-		}
-
-		public Boolean getEdit() {
-			return edit;
-		}
-
-		public void setEdit(Boolean edit) {
-			this.edit = edit;
-		}
-		public Boolean getSortable() {
-			return sortable;
-		}
-		public void setSortable(Boolean sortable) {
-			this.sortable = sortable;
-		}
-		public Boolean getFounder() {
-			return founder;
-		}
-		public void setFounder(Boolean founder) {
-			this.founder = founder;
-		}
-	}
-}

+ 0 - 37
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/list/BaseAction.java

@@ -1,37 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.list;
-
-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.ProjectQueryService;
-import com.x.teamwork.assemble.control.service.SystemConfigQueryService;
-import com.x.teamwork.assemble.control.service.TaskGroupQueryService;
-import com.x.teamwork.assemble.control.service.TaskListPersistService;
-import com.x.teamwork.assemble.control.service.TaskListQueryService;
-import com.x.teamwork.assemble.control.service.TaskQueryService;
-import com.x.teamwork.assemble.control.service.TaskTagQueryService;
-import com.x.teamwork.core.entity.TaskList;
-
-import net.sf.ehcache.Ehcache;
-
-public class BaseAction extends StandardJaxrsAction {
-
-	protected Ehcache taskListCache = ApplicationCache.instance().getCache( TaskList.class );
-	
-	protected 	TaskGroupQueryService taskGroupQueryService = new TaskGroupQueryService();
-	
-	protected 	TaskListQueryService taskListQueryService = new TaskListQueryService();
-	
-	protected 	TaskQueryService taskQueryService = new TaskQueryService();
-	
-	protected 	TaskListPersistService taskListPersistService = new TaskListPersistService();
-	
-	protected 	DynamicPersistService dynamicPersistService = new DynamicPersistService();
-	
-	protected TaskTagQueryService taskTagQueryService = new TaskTagQueryService();
-	
-	protected 	SystemConfigQueryService systemConfigQueryService = new SystemConfigQueryService();
-	
-	protected 	ProjectQueryService projectQueryService = new ProjectQueryService();
-	
-}

+ 0 - 92
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionComplete.java

@@ -1,92 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Project;
-
-public class ActionComplete extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionComplete.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String projectId, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wi wi = null;
-		Project project = null;
-		Boolean check = true;
-		
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				project = projectQueryService.get( projectId );
-				if ( project == null) {
-					check = false;
-					Exception exception = new ProjectNotExistsException( projectId );
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectQueryException(e, "根据指定flag查询应用项目信息对象时发生异常。ID:" + projectId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {	
-				projectPersistService.completeProject( projectId,wi.getCompleted());
-
-				// 更新缓存
-				ApplicationCache.notify( Project.class );
-				Wo wo = new Wo();
-				wo.setId( project.getId() );
-				result.setData( wo );
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectPersistException(e, "项目状态信息更新时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-			
-			try {					
-				dynamicPersistService.projectCompleteDynamic( project, effectivePerson ,wi.getCompleted()); 
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}	
-
-public static class Wi {
-
-		@FieldDescribe("已完成/未完成")
-		private Boolean completed = true;
-
-		public Boolean getCompleted() {
-			return completed;
-		}
-
-		public void setCompleted(Boolean completed) {
-			this.completed = completed;
-		}
-	}
-
-	public static class Wo extends WoId {
-	}
-	
-}

+ 0 - 92
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionCreateable.java

@@ -1,92 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Project;
-
-public class ActionCreateable extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionCreateable.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String projectId, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wi wi = null;
-		Project project = null;
-		Boolean check = true;
-		
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				project = projectQueryService.get( projectId );
-				if ( project == null) {
-					check = false;
-					Exception exception = new ProjectNotExistsException( projectId );
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectQueryException(e, "根据指定flag查询应用项目信息对象时发生异常。ID:" + projectId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {	
-				projectPersistService.createableProject( projectId,wi.getCreateable());
-
-				// 更新缓存
-				ApplicationCache.notify( Project.class );
-				Wo wo = new Wo();
-				wo.setId( project.getId() );
-				result.setData( wo );
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectPersistException(e, "项目状态信息更新时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-			
-			try {					
-				dynamicPersistService.projectCreateableDynamic( project, effectivePerson ,wi.getCreateable()); 
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}	
-
-public static class Wi {
-
-		@FieldDescribe("是否可新建任务")
-		private Boolean createable = true;
-
-		public Boolean getCreateable() {
-			return createable;
-		}
-
-		public void setCreateable(Boolean createable) {
-			this.createable = createable;
-		}
-	}
-
-	public static class Wo extends WoId {
-	}
-	
-}

+ 0 - 230
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionGet.java

@@ -1,230 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-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.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.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectConfig;
-import com.x.teamwork.core.entity.ProjectDetail;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.Task;
-
-
-public class ActionGet extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionGet.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		Project project = null;
-		ProjectDetail projectDetail = null;
-		List<String> groupIds = null;
-		List<ProjectGroup> groups = null;
-		List<Task>  taskList = null;
-		List<ProjectConfig>  projectConfigs = null;
-		WrapOutControl control = null;
-		Boolean check = true;
-		
-		Integer taskTotal = 0;
-		Integer progressTotal = 0;
-		Integer completedTotal = 0;
-		Integer overtimeTotal = 0;
-
-		if ( StringUtils.isEmpty( flag ) ) {
-			check = false;
-			Exception exception = new ProjectFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		/*String cacheKey = ApplicationCache.concreteCacheKey( flag,effectivePerson );
-		Element element = projectCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			result.setData( wo );
-		} else {*/
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					project = projectQueryService.get(flag);
-					if ( project == null) {
-						check = false;
-						Exception exception = new ProjectNotExistsException(flag);
-						result.error( exception );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectQueryException(e, "根据指定flag查询应用项目信息对象时发生异常。flag:" + flag);
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){				
-				taskList = projectQueryService.listAllTasks(flag , true);
-				if( ListTools.isNotEmpty( taskList )) {
-					for( Task task : taskList ) {
-						taskTotal ++;
-						if( "completed".equalsIgnoreCase(task.getWorkStatus()) ) {
-							completedTotal++;
-						}
-						if( "processing".equalsIgnoreCase(task.getWorkStatus()) ) {
-							progressTotal++;
-						}
-						if( task.getOvertime() ) {
-							overtimeTotal++;
-						}
-					}
-				}
-				
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = Wo.copier.copy( project );
-					if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-						wo.setStar( true );
-					}					
-					//查询项目详情
-					projectDetail = projectQueryService.getDetail( project.getId() );
-					if( projectDetail != null ) {
-						wo.setDescription( projectDetail.getDescription() );
-					}
-					
-					//查询项目组信息
-					groupIds = projectGroupQueryService.listGroupIdByProject( project.getId() );
-					groups = projectGroupQueryService.list( groupIds );
-					wo.setGroups( groups );	
-					
-					//查询项目配置信息
-					projectConfigs = projectConfigQueryService.getProjectConfigByProject( project.getId() );
-					
-					Business business = null;
-					try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-						business = new Business(bc);
-					}
-					
-					control = new WrapOutControl();
-					if(ListTools.isNotEmpty(projectConfigs)){
-						ProjectConfig projectConfig = projectConfigs.get(0);
-						control.setTaskCreate(projectConfig.getTaskCreate());
-						control.setTaskCopy(projectConfig.getTaskCopy());
-						control.setTaskRemove(projectConfig.getTaskRemove());
-						control.setLaneCreate(projectConfig.getLaneCreate());
-						control.setLaneEdit(projectConfig.getLaneEdit());
-						control.setLaneRemove(projectConfig.getLaneRemove());
-						control.setAttachmentUpload(projectConfig.getAttachmentUpload());
-						control.setComment(projectConfig.getComment());
-					}else{
-						control.setTaskCreate(true);
-					}
-					
-					if( business.isManager(effectivePerson)
-							|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-							|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-						control.setDelete( true );
-						control.setEdit( true );
-						control.setSortable( true );
-						control.setTaskCreate(true);
-						
-					}else{
-						control.setDelete( false );
-						control.setEdit( false );
-						control.setSortable( false );
-					}
-					if(project.getDeleted() || project.getCompleted()){
-						control.setTaskCreate(false);
-					}
-					if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-						control.setFounder( true );
-					}else{
-						control.setFounder( false );
-					}
-					wo.setControl(control);
-					
-					wo.setProgressTotal(progressTotal);
-					wo.setCompletedTotal(completedTotal);
-					wo.setOvertimeTotal(overtimeTotal);
-					wo.setTaskTotal(taskTotal);
-					result.setData(wo);
-				} catch (Exception e) {
-					Exception exception = new ProjectQueryException(e, "将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		//}
-		return result;
-	}
-
-	public static class Wo extends WrapOutProject {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-		
-		@FieldDescribe("所有任务数量")
-		private Integer taskTotal = 0;
-		
-		@FieldDescribe("执行中任务数量")
-		private Integer progressTotal = 0;
-		
-		@FieldDescribe("已完成任务数量")
-		private Integer completedTotal = 0;
-		
-		@FieldDescribe("超时任务数量")
-		private Integer overtimeTotal = 0;
-		
-		public Integer getTaskTotal() {
-			return taskTotal;
-		}
-
-		public void setTaskTotal(Integer taskTotal) {
-			this.taskTotal = taskTotal;
-		}
-		
-		public Integer getProgressTotal() {
-			return progressTotal;
-		}
-
-		public void setProgressTotal(Integer progressTotal) {
-			this.progressTotal = progressTotal;
-		}
-
-		public Integer getCompletedTotal() {
-			return completedTotal;
-		}
-
-		public void setCompletedTotal( Integer completedTotal ) {
-			this.completedTotal = completedTotal;
-		}
-
-		public Integer getOvertimeTotal() {
-			return overtimeTotal;
-		}
-
-		public void setOvertimeTotal( Integer overtimeTotal ) {
-			this.overtimeTotal = overtimeTotal;
-		}
-		
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-}

+ 0 - 190
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListArchiveNextWithFilter.java

@@ -1,190 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsTrueTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListArchiveNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListArchiveNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;		
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-			//已归档
-			queryFilter.addIsTrueTerm( new IsTrueTerm("archive" ));
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListArchiveNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {	
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-	
-	public static class Wi extends  WrapInQueryProject{		
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 190
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListCompletedNextWithFilter.java

@@ -1,190 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsTrueTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListCompletedNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListCompletedNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-			//已完成
-			queryFilter.addIsTrueTerm( new IsTrueTerm("completed" ));
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListCompletedNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {	
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends  WrapInQueryProject{		
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 190
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListMyNextWithFilter.java

@@ -1,190 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListMyNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListMyNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-			//执行者该用户
-			queryFilter.addEqualsTerm( new EqualsTerm("executor", effectivePerson.getDistinguishedName() ));
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListMyNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {	
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{	
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 184
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextInGroupWithFilter.java

@@ -1,184 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListNextInGroupWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListNextInGroupWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, String groupId, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( groupId );
-			if( ListTools.isEmpty( projectIds )) {
-				queryProjectIds.add("0000-0000-0000");
-			}else {
-				for( String projectId : projectIds ) {
-					queryProjectIds.add( projectId );
-				}
-			}
-			queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListNextInGroupWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {	
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 213
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextWithFilter.java

@@ -1,213 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectConfig;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*采用缓存
-			 * cacheKey = ApplicationCache.concreteCacheKey( "ActionListNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								
-								//查询项目配置信息
-								List<ProjectConfig>  projectConfigs = null;
-								projectConfigs = projectConfigQueryService.getProjectConfigByProject( project.getId() );
-								
-								control = new WrapOutControl();
-								
-								if(ListTools.isNotEmpty(projectConfigs)){
-									ProjectConfig projectConfig = projectConfigs.get(0);
-									control.setTaskCreate(projectConfig.getTaskCreate());
-									control.setTaskCopy(projectConfig.getTaskCopy());
-									control.setTaskRemove(projectConfig.getTaskRemove());
-									control.setLaneCreate(projectConfig.getLaneCreate());
-									control.setLaneEdit(projectConfig.getLaneEdit());
-									control.setLaneRemove(projectConfig.getLaneRemove());
-									control.setAttachmentUpload(projectConfig.getAttachmentUpload());
-									control.setComment(projectConfig.getComment());
-								}else{
-									control.setTaskCreate(true);
-								}
-								
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-									control.setTaskCreate(true);
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								if(project.getDeleted() || project.getCompleted()){
-									control.setTaskCreate(false);
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 190
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNoGroupNextWithFilter.java

@@ -1,190 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListNoGroupNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListNoGroupNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-			//分组个数为0
-			queryFilter.addEqualsTerm( new EqualsTerm("groupCount", 0 ));
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListNoGroupNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {	
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 180
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageInGroupWithFilter.java

@@ -1,180 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListPageInGroupWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListPageInGroupWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, Integer pageNum, Integer count, String groupId, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = new ArrayList<>();
-		ResultObject resultObject = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( groupId );
-			if( ListTools.isEmpty( projectIds )) {
-				queryProjectIds.add("0000-0000-0000");
-			}else {
-				for( String projectId : projectIds ) {
-					queryProjectIds.add( projectId );
-				}
-			}
-			queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-		}
-		
-		/*if( Boolean.TRUE.equals( check ) ){
-			
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionListPageWithFilter", effectivePerson.getDistinguishedName(), 
-					pageNum, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-		}*/
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/				
-				try {
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );
-						List<Project> projectList = projectQueryService.listWithProjectIdsFilter( count, pageNum, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{		
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 187
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageWithFilter.java

@@ -1,187 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListPageWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListPageWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, Integer pageNum, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = new ArrayList<>();
-		ResultObject resultObject = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			//添加过滤条件未删除状态才被查询
-			wrapIn.setDeleted("false");
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-		}
-		
-		/*if( Boolean.TRUE.equals( check ) ){
-			
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionListPageWithFilter", effectivePerson.getDistinguishedName(), 
-					pageNum, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-		}*/
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {	*/			
-				try {					
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );
-						List<Project> projectList = projectQueryService.listWithProjectIdsFilter( count, pageNum, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{		
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 185
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListRecycleNextWithFilter.java

@@ -1,185 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsTrueTerm;
-import java.util.ArrayList;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import net.sf.ehcache.Element;
-import org.apache.commons.lang3.StringUtils;
-
-public class ActionListRecycleNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListRecycleNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ) {
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			//已删除
-			wrapIn.setDeleted("true");
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-			//queryFilter.addIsTrueTerm( new IsTrueTerm("deleted" ));
-		}
-		
-		if( Boolean.TRUE.equals( check ) ) {
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListRecycleNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {	
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 190
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListStarNextWithFilter.java

@@ -1,190 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-import com.x.teamwork.core.entity.tools.filter.term.MemberTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListStarNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListStarNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		//String cacheKey = null;
-		//Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			if( StringUtils.isNotEmpty( wrapIn.getGroup() )) {
-				//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
-				List<String> projectIds = projectGroupQueryService.listProjectIdByGroup( wrapIn.getGroup() );
-				if( ListTools.isEmpty( projectIds )) {
-					queryProjectIds.add("0000-0000-0000");
-				}else {
-					for( String projectId : projectIds ) {
-						queryProjectIds.add( projectId );
-					}
-				}
-				queryFilter.addInTerm( new InTerm("id", new ArrayList<Object>(queryProjectIds) ));
-			}
-			//标星人员里有该用户
-			queryFilter.addMemberTerm( new MemberTerm("starPersonList", effectivePerson.getDistinguishedName() ));
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListStarNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {	
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<Project>  projectList = projectQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) {
-							WrapOutControl control = null;
-							for( Project project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								wo.setDescription( projectQueryService.getDescription( project.getId()));
-								if( wo.getStarPersonList().contains( effectivePerson.getDistinguishedName() )) {
-									wo.setStar( true );
-								}
-								
-								Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProject{
-	}
-	
-	public static class Wo extends WrapOutProject {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Project, Wo> copier = WrapCopierFactory.wo( Project.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 74
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionRecovery.java

@@ -1,74 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Project;
-
-public class ActionRecovery extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionRecovery.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String projectId) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Project project = null;
-		Boolean check = true;
-		
-		if ( StringUtils.isEmpty( projectId )) {
-			check = false;
-			Exception exception = new ProjectFlagForQueryEmptyException();
-			result.error( exception );
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				project = projectQueryService.get( projectId );
-				if ( project == null) {
-					check = false;
-					Exception exception = new ProjectNotExistsException( projectId );
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectQueryException(e, "根据指定flag查询应用项目信息对象时发生异常。ID:" + projectId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {	
-				projectPersistService.recoveryProject( projectId);
-
-				// 更新缓存
-				ApplicationCache.notify( Project.class );
-				Wo wo = new Wo();
-				wo.setId( project.getId() );
-				result.setData( wo );
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectPersistException(e, "项目恢复时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-			
-			try {					
-				dynamicPersistService.projectRecoveryDynamic( project, effectivePerson);
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}	
-
-	public static class Wo extends WoId {
-	}
-	
-}

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

@@ -1,276 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.base.core.project.tools.ListTools;
-import com.x.teamwork.assemble.control.service.BatchOperationPersistService;
-import com.x.teamwork.assemble.control.service.BatchOperationProcessService;
-import com.x.teamwork.core.entity.Dynamic;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectDetail;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.Task;
-
-public class ActionSave extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionSave.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Project project = null;
-		Project old_project = null;
-		Wi wi = null;
-		Wo wo = new Wo();
-		Boolean check = true;
-
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if ( !projectPersistService.checkPermissionForPersist( effectivePerson, systemConfigQueryService.getValueByCode("PROJECT_CREATOR")) ) {
-				check = false;
-				Exception exception = new ProjectPersistException("project save permission denied!" );
-				result.error(exception);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			old_project = projectQueryService.get( wi.getId() );
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			ProjectDetail projectDetail = new ProjectDetail();
-			projectDetail.setDescription( wi.getDescription() );
-			
-			try {	
-				if( ListTools.isNotEmpty( wi.getGroups() )) {
-					wi.setGroupCount( wi.getGroups().size() );
-				}
-				
-				project = projectPersistService.save( Wi.copier.copy(wi), projectDetail, effectivePerson );
-				
-				//将项目添加到指定的项目组
-				projectGroupPersistService.releProjectToGroup(  project.getId(), wi.getGroups() );
-				
-				// 更新缓存
-				ApplicationCache.notify( Project.class );
-				ApplicationCache.notify( ProjectGroup.class );
-
-				ApplicationCache.notify( Task.class, ApplicationCache.concreteCacheKey( "ActionStatisticMyTasks", project.getId(), effectivePerson.getDistinguishedName() )  );
-				ApplicationCache.notify( Task.class, ApplicationCache.concreteCacheKey( "ActionStatisticMyTaskViews", project.getId(),  effectivePerson.getDistinguishedName() )  );				
-				
-				wo.setId( project.getId() );
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectPersistException(e, "项目信息保存时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {					
-				new BatchOperationPersistService().addOperation( 
-						BatchOperationProcessService.OPT_OBJ_PROJECT, 
-						BatchOperationProcessService.OPT_TYPE_PERMISSION,  project.getId(),  project.getId(), "刷新文档权限:ID=" +   project.getId() );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}	
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {					
-				List<Dynamic> dynamics = dynamicPersistService.projectSaveDynamic(old_project, project, effectivePerson,  jsonElement.toString() );
-				if( dynamics == null ) {
-					dynamics = new ArrayList<>();
-				}
-				if( wo != null ) {
-					wo.setDynamics(WoDynamic.copier.copy(dynamics));
-				}
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		result.setData( wo );
-		return result;
-	}	
-
-	public static class Wi {
-		
-		@FieldDescribe("数据库主键,自动生成,非必填.")
-		private String id;
-		
-		@FieldDescribe("项目名称,必填")
-		private String title;
-
-		@FieldDescribe("排序号,非必填")
-		private Integer order;
-
-		@FieldDescribe("项目类型:普通项目 | 软件项目,非必填")
-		private String type = "普通项目";
-
-		@FieldDescribe("图标文件ID,非必填")
-		private String icon = null;
-
-		@FieldDescribe("执行者|负责人,非必填")
-		private String executor;
-		
-		@FieldDescribe("模板id")
-		private String templateId;
-		
-		@FieldDescribe("管理者,非必填")
-		private List<String> manageablePersonList;
-		
-		public static WrapCopier<Wi, Project> copier = WrapCopierFactory.wi( Wi.class, Project.class, null, null );
-
-		@FieldDescribe("说明信息(1M),非必填")
-		private String description;
-		
-		@FieldDescribe("项目所属的项目组,可多值,非必填.")
-		private List<String> groups = null;
-
-		private Integer groupCount = 0;
-		
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public Integer getGroupCount() {
-			return groupCount;
-		}
-
-		public void setGroupCount(Integer groupCount) {
-			this.groupCount = groupCount;
-		}
-
-		public String getDescription() {
-			return description;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-
-		public List<String> getGroups() {
-			return groups;
-		}
-
-		public void setGroups(List<String> groups) {
-			this.groups = groups;
-		}
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public Integer getOrder() {
-			return order;
-		}
-
-		public void setOrder(Integer order) {
-			this.order = order;
-		}
-
-		public String getType() {
-			return type;
-		}
-
-		public void setType(String type) {
-			this.type = type;
-		}
-
-		public String getIcon() {
-			return icon;
-		}
-
-		public void setIcon(String icon) {
-			this.icon = icon;
-		}
-
-		public String getExecutor() {
-			return executor;
-		}
-
-		public void setExecutor(String executor) {
-			this.executor = executor;
-		}
-		
-		public String getTemplateId() {
-			return templateId;
-		}
-
-		public void setTemplateId(String templateId) {
-			this.templateId = templateId;
-		}
-
-		public List<String> getManageablePersonList() {
-			return manageablePersonList;
-		}
-
-		public void setManageablePersonList(List<String> manageablePersonList) {
-			this.manageablePersonList = manageablePersonList;
-		}
-	}
-
-public static class Wo extends WoId {
-		
-		@FieldDescribe("操作引起的动态内容")
-		List<WoDynamic> dynamics = new ArrayList<>();
-
-		public List<WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-		
-	}
-	
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, WoDynamic.class, null, JpaObject.FieldsInvisible);
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}		
-	}
-	
-}

+ 0 - 280
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjects.java

@@ -1,280 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionStatisticMyProjects extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionStatisticMyProjects.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		List<String> projectIds = null;
-		List<Project> projectList = null;
-		List<ProjectGroup>  projectGroupList = null;
-		List<WoGroup> woGroupList = null;
-		Boolean check = true;
-		
-		Integer allCount = 0;
-		Integer starCount = 0;
-		Integer myCount = 0;
-		Integer unGroupCount = 0;
-		Integer completedCount = 0;
-		Integer archiveCount = 0;
-		Integer deleteCount = 0;
-
-		/*String cacheKey = ApplicationCache.concreteCacheKey( "ActionStatisticMyProjects", effectivePerson.getDistinguishedName() );
-		Element element = projectCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			result.setData( wo );
-		} else {*/
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询我参与的所有项目
-					projectIds = projectQueryService.listAllProjectIds( effectivePerson, 2000,  new QueryFilter() );
-					if( ListTools.isNotEmpty( projectIds )) {
-						projectList = projectQueryService.list( projectIds );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectQueryException( e, "查询用户参与的所有项目信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询我所有的项目组列表
-					projectGroupList = projectGroupQueryService.listGroupByPerson( effectivePerson.getDistinguishedName() );
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectQueryException( e, "查询用户所有项目组信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				if( ListTools.isNotEmpty( projectGroupList )) {
-					woGroupList = WoGroup.copier.copy( projectGroupList );
-					SortTools.asc( woGroupList, "createTime");
-				}
-			}			
-			
-			if( Boolean.TRUE.equals( check ) ){
-				if( ListTools.isNotEmpty( projectList )) {
-					for(  Project project : projectList ) {
-						if(project.getDeleted() != null && project.getDeleted() ){
-							deleteCount++;
-						}else{
-							allCount++;						
-							if( project.getStarPersonList() != null  && project.getStarPersonList().contains( effectivePerson.getDistinguishedName() ) ) {
-								starCount++;
-							}
-							if( project.getCreatorPerson().equalsIgnoreCase(effectivePerson.getDistinguishedName()  )) {
-								myCount++;
-							}
-							if( project.getGroupCount() == null || project.getGroupCount() == 0 ) {
-								unGroupCount++;
-							}
-							if( project.getCompleted() != null && project.getCompleted() ) {
-								completedCount++;
-							}
-							if( project.getArchive() != null && project.getArchive() ) {
-								archiveCount++;
-							}
-							woGroupList = checkGroup( project, woGroupList );
-						}
-						
-					}
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = new Wo();
-					wo.setAllCount( allCount );
-					wo.setMyCount(myCount);
-					wo.setStarCount(starCount);
-					wo.setUnGroupCount(unGroupCount);
-					wo.setCompletedCount(completedCount);
-					wo.setArchiveCount(archiveCount);
-					wo.setDeleteCount(deleteCount);					
-					if( ListTools.isNotEmpty( woGroupList )) {
-						SortTools.asc( woGroupList, "createTime");
-					}	
-					wo.setGroups( woGroupList );
-					//projectCache.put( new Element(cacheKey, wo) );
-					result.setData(wo);
-				} catch (Exception e) {
-					Exception exception = new ProjectQueryException(e, "将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		//}
-		return result;
-	}
-
-	private List<WoGroup> checkGroup( Project project, List<WoGroup> woGroupList) throws Exception {
-		if( ListTools.isEmpty( woGroupList )) {
-			return null;
-		}
-		for( WoGroup woGroup : woGroupList ) {
-			if( projectGroupQueryService.existsWithProjectAndGroup( woGroup.getId(), project.getId() ) ) {
-				woGroup.addProjectCount(1);
-				break;
-			}
-		}
-		return woGroupList;
-	}
-
-	public static class Wo{
-
-		@FieldDescribe("所有项目数量")
-		private Integer allCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer starCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer myCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer unGroupCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer completedCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer archiveCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer deleteCount = 0;
-		
-		@FieldDescribe("所有分组信息")
-		private List<WoGroup> groups = null;
-		
-		public List<WoGroup> getGroups() {
-			return groups;
-		}
-
-		public void setGroups(List<WoGroup> groups) {
-			this.groups = groups;
-		}
-
-		public Integer getAllCount() {
-			return allCount;
-		}
-
-		public void setAllCount(Integer allCount) {
-			this.allCount = allCount;
-		}
-
-		public Integer getStarCount() {
-			return starCount;
-		}
-
-		public void setStarCount(Integer starCount) {
-			this.starCount = starCount;
-		}
-
-		public Integer getMyCount() {
-			return myCount;
-		}
-
-		public void setMyCount(Integer myCount) {
-			this.myCount = myCount;
-		}
-
-		public Integer getUnGroupCount() {
-			return unGroupCount;
-		}
-
-		public void setUnGroupCount(Integer unGroupCount) {
-			this.unGroupCount = unGroupCount;
-		}
-
-		public Integer getCompletedCount() {
-			return completedCount;
-		}
-
-		public void setCompletedCount(Integer completedCount) {
-			this.completedCount = completedCount;
-		}
-
-		public Integer getArchiveCount() {
-			return archiveCount;
-		}
-
-		public void setArchiveCount(Integer archiveCount) {
-			this.archiveCount = archiveCount;
-		}
-
-		public Integer getDeleteCount() {
-			return deleteCount;
-		}
-
-		public void setDeleteCount(Integer deleteCount) {
-			this.deleteCount = deleteCount;
-		}
-	}
-	
-	public static class WoGroup extends ProjectGroup{
-		
-		@FieldDescribe("分组项目数量")
-		private Integer projectCount = 0;
-		
-		public Integer getProjectCount() {
-			return projectCount;
-		}
-
-		public void setProjectCount(Integer projectCount) {
-			this.projectCount = projectCount;
-		}
-
-		public void addProjectCount( Integer count ) {
-			if( this.projectCount == null ) {
-				this.projectCount =0;
-			}
-			this.projectCount += count;
-		}
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-		
-		static {
-			Excludes.add("creatorPerson");
-			Excludes.add("owner");
-			Excludes.add("updateTime");
-			Excludes.add("distributeFactor");
-			Excludes.add("sequence");
-		}
-		
-		static WrapCopier<ProjectGroup, WoGroup> copier = WrapCopierFactory.wo( ProjectGroup.class, WoGroup.class, null, Excludes);
-	}
-}

+ 0 - 167
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjectsGroups.java

@@ -1,167 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-
-import net.sf.ehcache.Element;
-
-public class ActionStatisticMyProjectsGroups extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionStatisticMyProjectsGroups.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		List<String> projectIds = null;
-		List<Project> projectList = null;
-		List<ProjectGroup>  projectGroupList = null;
-		List<WoGroup> woGroupList = null;
-		Boolean check = true;
-		
-		/*String cacheKey = ApplicationCache.concreteCacheKey( "ActionStatisticMyProjectsGroups", effectivePerson.getDistinguishedName() );
-		Element element = projectCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			result.setData( wo );
-		} else {*/
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询我参与的所有项目
-					projectIds = projectQueryService.listAllViewableProjectIds( effectivePerson, 2000, new QueryFilter() );
-					if( ListTools.isNotEmpty( projectIds )) {
-						projectList = projectQueryService.list( projectIds );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectQueryException( e, "查询用户参与的所有项目信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询我所有的项目组列表
-					projectGroupList = projectGroupQueryService.listGroupByPerson( effectivePerson.getDistinguishedName() );
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectQueryException( e, "查询用户所有项目组信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				if( ListTools.isNotEmpty( projectGroupList )) {
-					woGroupList = WoGroup.copier.copy( projectGroupList );
-					SortTools.asc( woGroupList, "createTime");
-				}
-			}			
-			
-			if( Boolean.TRUE.equals( check ) ){
-				if( ListTools.isNotEmpty( projectList )) {
-					for(  Project project : projectList ) {
-						woGroupList = checkGroup( project, woGroupList );
-					}
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = new Wo();
-					if( ListTools.isNotEmpty( woGroupList )) {
-						SortTools.asc( woGroupList, "createTime");
-					}
-					wo.setGroups( woGroupList );
-					result.setData(wo);
-					
-					//projectCache.put( new Element(cacheKey, wo) );					
-				} catch (Exception e) {
-					Exception exception = new ProjectQueryException(e, "将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		//}
-		return result;
-	}
-
-	private List<WoGroup> checkGroup( Project project, List<WoGroup> woGroupList) throws Exception {
-		if( ListTools.isEmpty( woGroupList )) {
-			return null;
-		}
-		for( WoGroup woGroup : woGroupList ) {
-			if( projectGroupQueryService.existsWithProjectAndGroup( woGroup.getId(), project.getId() ) ) {
-				woGroup.addProjectCount(1);
-				break;
-			}
-		}
-		return woGroupList;
-	}
-
-	public static class Wo{
-		
-		@FieldDescribe("所有分组信息")
-		private List<WoGroup> groups = null;
-		
-		public List<WoGroup> getGroups() {
-			return groups;
-		}
-
-		public void setGroups(List<WoGroup> groups) {
-			this.groups = groups;
-		}		
-	}
-	
-	public static class WoGroup extends ProjectGroup{
-		
-		@FieldDescribe("分组项目数量")
-		private Integer projectCount = 0;
-		
-		public Integer getProjectCount() {
-			return projectCount;
-		}
-
-		public void setProjectCount(Integer projectCount) {
-			this.projectCount = projectCount;
-		}
-
-		public void addProjectCount( Integer count ) {
-			if( this.projectCount == null ) {
-				this.projectCount =0;
-			}
-			this.projectCount += count;
-		}
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-		
-		static {
-			Excludes.add("creatorPerson");
-			Excludes.add("owner");
-			Excludes.add("updateTime");
-			Excludes.add("distributeFactor");
-			Excludes.add("sequence");
-		}
-		
-		static WrapCopier<ProjectGroup, WoGroup> copier = WrapCopierFactory.wo( ProjectGroup.class, WoGroup.class, null, Excludes);
-	}
-}

+ 0 - 35
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/BaseAction.java

@@ -1,35 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-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.ProjectConfigQueryService;
-import com.x.teamwork.assemble.control.service.ProjectGroupPersistService;
-import com.x.teamwork.assemble.control.service.ProjectGroupQueryService;
-import com.x.teamwork.assemble.control.service.ProjectPersistService;
-import com.x.teamwork.assemble.control.service.ProjectQueryService;
-import com.x.teamwork.assemble.control.service.SystemConfigQueryService;
-import com.x.teamwork.assemble.control.service.TaskPersistService;
-import com.x.teamwork.core.entity.Project;
-
-import net.sf.ehcache.Ehcache;
-
-public class BaseAction extends StandardJaxrsAction {
-
-	protected Ehcache projectCache = ApplicationCache.instance().getCache( Project.class );
-	
-	protected 	ProjectQueryService projectQueryService = new ProjectQueryService();
-	
-	protected 	ProjectPersistService projectPersistService = new ProjectPersistService();
-	
-	protected 	DynamicPersistService dynamicPersistService = new DynamicPersistService();
-	
-	protected ProjectGroupQueryService projectGroupQueryService = new ProjectGroupQueryService();
-	
-	protected ProjectGroupPersistService projectGroupPersistService = new ProjectGroupPersistService();	
-	
-	protected 	SystemConfigQueryService systemConfigQueryService = new SystemConfigQueryService();
-	
-	protected 	ProjectConfigQueryService projectConfigQueryService = new ProjectConfigQueryService();
-	
-}

+ 0 - 447
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ProjectAction.java

@@ -1,447 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-@Path("project")
-@JaxrsDescribe("项目信息管理")
-public class ProjectAction extends StandardJaxrsAction {
-
-	private Logger logger = LoggerFactory.getLogger(ProjectAction.class);
-
-	@JaxrsMethodDescribe(value = "查询我的项目统计信息.", action = ActionStatisticMyProjects.class)
-	@GET
-	@Path("statitic/my")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void statiticMyProject(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request ) {
-		ActionResult<ActionStatisticMyProjects.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionStatisticMyProjects().execute( request, effectivePerson );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "查询我的项目组统计信息.", action = ActionStatisticMyProjectsGroups.class)
-	@GET
-	@Path("statitic/group")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void statiticMyProjectGroup(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request ) {
-		ActionResult<ActionStatisticMyProjectsGroups.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionStatisticMyProjectsGroups().execute( request, effectivePerson );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据ID查询项目信息.", action = ActionGet.class)
-	@GET
-	@Path("{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void get(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGet().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据ID给项目标星.", action = ActionStar.class)
-	@GET
-	@Path("star/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void star(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionStar.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionStar().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据ID取消项目标星.", action = ActionUnStar.class)
-	@GET
-	@Path("unstar/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void unStar(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionUnStar.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionUnStar().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "列示项目信息,按页码分页.", action = ActionListPageWithFilter.class)
-	@PUT
-	@Path("list/{page}/size/{size}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listPageWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("当前页码") @PathParam( "page" ) Integer page, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "size" ) Integer size, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListPageWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListPageWithFilter().execute(request, effectivePerson, page, size, jsonElement );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示指定项目组中的项目信息,按页码分页.", action = ActionListPageInGroupWithFilter.class)
-	@PUT
-	@Path("list/{page}/size/{size}/group/{groupId}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listPageInGroupWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("当前页码") @PathParam( "page" ) Integer page, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "size" ) Integer size, 
-			@JaxrsParameterDescribe("项目组ID") @PathParam( "groupId" ) String groupId, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListPageInGroupWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListPageInGroupWithFilter().execute(request, effectivePerson, page, size, groupId, jsonElement );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示项目信息,下一页.", action = ActionListNextWithFilter.class)
-	@PUT
-	@Path("list/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示指定项目组中的项目信息,下一页.", action = ActionListNextInGroupWithFilter.class)
-	@PUT
-	@Path("list/{id}/next/{count}/group/{groupId}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listNextInGroupWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("项目组ID") @PathParam( "groupId" ) String groupId, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListNextInGroupWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListNextInGroupWithFilter().execute(request, effectivePerson, id, count, groupId, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示已归档项目信息,下一页.", action = ActionListArchiveNextWithFilter.class)
-	@PUT
-	@Path("list/archive/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listArchiveNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListArchiveNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListArchiveNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示已完成项目信息,下一页.", action = ActionListCompletedNextWithFilter.class)
-	@PUT
-	@Path("list/completed/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listCompletedNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListCompletedNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListCompletedNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示我负责的项目信息,下一页.", action = ActionListMyNextWithFilter.class)
-	@PUT
-	@Path("list/my/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listMyNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListMyNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListMyNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示未分类项目信息,下一页.", action = ActionListNoGroupNextWithFilter.class)
-	@PUT
-	@Path("list/groupness/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listNoGroupNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListNoGroupNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListNoGroupNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示标星项目信息,下一页.", action = ActionListStarNextWithFilter.class)
-	@PUT
-	@Path("list/star/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listStarNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListStarNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListStarNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示回收站项目信息,下一页.", action = ActionListRecycleNextWithFilter.class)
-	@PUT
-	@Path("list/recycle/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listRecycleNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListRecycleNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListRecycleNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "创建或者更新一个项目信息.", action = ActionSave.class)
-	@POST
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void save(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("需要保存的项目信息") JsonElement jsonElement ) {
-		ActionResult<ActionSave.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionSave().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "更新一个项目图标信息.", action = ActionUpdateIcon.class)
-	@PUT
-	@Path("{id}/icon")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void updateIcon(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id,
-			@JaxrsParameterDescribe("需要保存的项目图标信息") JsonElement jsonElement ) {
-		ActionResult<ActionUpdateIcon.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionUpdateIcon().execute(request, effectivePerson, id, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识恢复项目.", action = ActionRecovery.class)
-	@GET
-	@Path("{id}/recovery")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void recoveryProject(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionRecovery.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try { 
-			result = new ActionRecovery().execute(request, effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识更改项目状态为已完成或未完成.", action = ActionComplete.class)
-	@PUT
-	@Path("{id}/complete")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void completeProject(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id,
-			@JaxrsParameterDescribe("需要保存的项目状态信息") JsonElement jsonElement ) {
-		ActionResult<ActionComplete.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionComplete().execute(request, effectivePerson, id, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识设置项目是否可新建任务.", action = ActionCreateable.class)
-	@PUT
-	@Path("{id}/createable")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void createableProject(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id,
-			@JaxrsParameterDescribe("需要保存的项目状态信息") JsonElement jsonElement ) {
-		ActionResult<ActionCreateable.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionCreateable().execute(request, effectivePerson, id, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识删除项目信息.", action = ActionDelete.class)
-	@DELETE
-	@Path("{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void delete(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionDelete.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionDelete().execute(request, effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 0 - 139
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/WrapOutControl.java

@@ -1,139 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.project;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-
-public class WrapOutControl {
-	
-	@FieldDescribe("是否可删除")
-	private Boolean delete = false;
-	
-	@FieldDescribe("是否可编辑")
-	private Boolean edit = false;
-	
-	@FieldDescribe("是否可排序")
-	private Boolean sortable = true;
-	
-	@FieldDescribe("是否创始人")
-	private Boolean founder = false;
-	
-	
-	@FieldDescribe("是否可新建任务")
-	private Boolean taskCreate = true;
-	
-	@FieldDescribe("是否可复制任务")
-	private Boolean taskCopy = true;
-	
-	@FieldDescribe("是否可删除任务")
-	private Boolean taskRemove = true;
-	
-	@FieldDescribe("是否可新建泳道")
-	private Boolean laneCreate = true;
-	
-	@FieldDescribe("是否可编辑泳道")
-	private Boolean laneEdit = true;
-	
-	@FieldDescribe("是否可删除泳道")
-	private Boolean laneRemove = true;
-	
-	@FieldDescribe("是否上传附件")
-	private Boolean attachmentUpload = true;
-	
-	@FieldDescribe("是否允许评论")
-	private Boolean comment = true;
-	
-	public Boolean getDelete() {
-		return delete;
-	}
-
-	public void setDelete(Boolean delete) {
-		this.delete = delete;
-	}
-	
-	public Boolean getEdit() {
-		return edit;
-	}
-
-	public void setEdit(Boolean edit) {
-		this.edit = edit;
-	}
-	
-	public Boolean getSortable() {
-		return sortable;
-	}
-
-	public void setSortable(Boolean sortable) {
-		this.sortable = sortable;
-	}
-	
-	public Boolean getFounder() {
-		return founder;
-	}
-
-	public void setFounder(Boolean founder) {
-		this.founder = founder;
-	}
-	
-	public Boolean getTaskCreate() {
-		return taskCreate;
-	}
-
-	public void setTaskCreate(Boolean taskCreate) {
-		this.taskCreate = taskCreate;
-	}
-	
-	public Boolean getTaskCopy() {
-		return taskCopy;
-	}
-
-	public void setTaskCopy(Boolean taskCopy) {
-		this.taskCopy = taskCopy;
-	}
-	
-	public Boolean getTaskRemove() {
-		return taskRemove;
-	}
-
-	public void setTaskRemove(Boolean taskRemove) {
-		this.taskRemove = taskRemove;
-	}
-	
-	public Boolean getLaneCreate() {
-		return laneCreate;
-	}
-
-	public void setLaneCreate(Boolean laneCreate) {
-		this.laneCreate = laneCreate;
-	}
-	
-	public Boolean getLaneEdit() {
-		return laneEdit;
-	}
-
-	public void setLaneEdit(Boolean laneEdit) {
-		this.laneEdit = laneEdit;
-	}
-	
-	public Boolean getLaneRemove() {
-		return laneRemove;
-	}
-
-	public void setLaneRemove(Boolean laneRemove) {
-		this.laneRemove = laneRemove;
-	}
-	
-	public Boolean getAttachmentUpload() {
-		return attachmentUpload;
-	}
-
-	public void setAttachmentUpload(Boolean attachmentUpload) {
-		this.attachmentUpload = attachmentUpload;
-	}
-	
-	public Boolean getComment() {
-		return comment;
-	}
-
-	public void setComment(Boolean comment) {
-		this.comment = comment;
-	}
-}

+ 0 - 122
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionDelete.java

@@ -1,122 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.ProjectTemplate;
-import com.x.teamwork.core.entity.TaskListTemplate;
-
-public class ActionDelete extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionDelete.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		ProjectTemplate projectTemplate = null;
-		Boolean check = true;
-		Wo wo = new Wo();
-
-		if ( StringUtils.isEmpty( flag ) ) {
-			check = false;
-			Exception exception = new ProjectTemplateFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				projectTemplate = projectTemplateQueryService.get(flag);
-				if ( projectTemplate == null) {
-					check = false;
-					Exception exception = new ProjectTemplateNotExistsException(flag);
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectTemplateQueryException(e, "根据指定flag查询项模板目信息对象时发生异常。flag:" + flag);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				projectTemplatePersistService.delete(flag, effectivePerson );
-				
-				// 更新缓存
-				ApplicationCache.notify( ProjectTemplate.class );
-				ApplicationCache.notify( TaskListTemplate.class );
-				
-				wo.setId( projectTemplate.getId() );
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectTemplateQueryException(e, "根据指定flag删除项目模板信息对象时发生异常。flag:" + flag);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		if( Boolean.TRUE.equals( check ) ){
-			try {					
-				Dynamic dynamic = dynamicPersistService.projectTemplateDeleteDynamic( projectTemplate, effectivePerson );
-				if( dynamic != null ) {
-					List<WoDynamic> dynamics = new ArrayList<>();
-					dynamics.add( WoDynamic.copier.copy( dynamic ) );
-					if( wo != null ) {
-						wo.setDynamics(dynamics);
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}	
-		}
-		result.setData( wo );
-		return result;
-	}
-
-	public static class Wo extends WoId {
-		
-		@FieldDescribe("操作引起的动态内容")
-		List<WoDynamic> dynamics = new ArrayList<>();
-
-		public List<WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-		
-	}
-	
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, WoDynamic.class, null, JpaObject.FieldsInvisible);
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}		
-	}
-}

+ 0 - 161
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionGet.java

@@ -1,161 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.ProjectTemplate;
-import com.x.teamwork.core.entity.TaskListTemplate;
-
-import net.sf.ehcache.Element;
-
-public class ActionGet extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionGet.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		ProjectTemplate projectTemplate = null;
-		Boolean check = true;
-		List<TaskListTemplate> taskListTemplate = null;
-		WrapOutControl control = null;
-
-		if ( StringUtils.isEmpty( id ) ) {
-			check = false;
-			Exception exception = new ProjectTemplateFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		/*String cacheKey = ApplicationCache.concreteCacheKey( id ,effectivePerson);
-		Element element = projectTemplateCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			result.setData( wo );
-		} else {*/
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					projectTemplate = projectTemplateQueryService.get( id );
-					if ( projectTemplate == null) {
-						check = false;
-						Exception exception = new ProjectTemplateNotExistsException( id );
-						result.error( exception );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectTemplateQueryException(e, "根据指定flag查询项目模板信息对象时发生异常。id:" + id );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = Wo.copier.copy( projectTemplate );
-					taskListTemplate = projectTemplateQueryService.getTaskListTemplateWithTemplateId(wo.getId());
-					if( ListTools.isNotEmpty( taskListTemplate )) {
-						wo.setTaskListTemplate( WoTaskListTemplate.copier.copy( taskListTemplate ));
-					}
-					
-					//计算权限
-					if( Boolean.TRUE.equals( check ) ){
-						Business business = null;
-						try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-							business = new Business(bc);
-						}
-						try {
-							control = new WrapOutControl();
-							if( business.isManager(effectivePerson) 
-									|| effectivePerson.getDistinguishedName().equalsIgnoreCase( projectTemplate.getOwner() )){
-								control.setDelete( true );
-								control.setEdit( true );
-								control.setSortable( true );								
-							}else{
-								control.setDelete( false );
-								control.setEdit( false );
-								control.setSortable( false );								
-							}
-							if(effectivePerson.getDistinguishedName().equalsIgnoreCase( projectTemplate.getOwner() )){
-								control.setFounder( true );
-							}else{
-								control.setFounder( false );
-							}
-							wo.setControl(control);
-						} catch (Exception e) {
-							check = false;
-							Exception exception = new ProjectTemplateQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。id:" + id);
-							result.error(exception);
-							logger.error(e, effectivePerson, request, null);
-						}
-					}
-					
-					//projectTemplateCache.put(new Element(cacheKey, wo));
-					result.setData(wo);
-				} catch (Exception e) {
-					Exception exception = new ProjectTemplateQueryException(e, "将查询出来的项目模板信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		//}
-		return result;
-	}
-
-	public static class Wo extends ProjectTemplate {
-		@FieldDescribe("项目模板权限")
-		private WrapOutControl control = null;	
-		
-		@FieldDescribe("模板对应的泳道信息")
-		private List<WoTaskListTemplate> taskListTemplate = null;
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-		
-		public List<WoTaskListTemplate> getTaskListTemplate() {
-			return taskListTemplate;
-		}
-
-		public void setTaskListTemplate(List<WoTaskListTemplate> taskListTemplate) {
-			this.taskListTemplate = taskListTemplate;
-		}
-		
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<ProjectTemplate, Wo> copier = WrapCopierFactory.wo( ProjectTemplate.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	public static class WoTaskListTemplate extends TaskListTemplate {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskListTemplate, WoTaskListTemplate> copier = WrapCopierFactory.wo( TaskListTemplate.class, WoTaskListTemplate.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-}

+ 0 - 74
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionList.java

@@ -1,74 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.cache.ApplicationCache;
-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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.TaskListTemplate;
-
-import net.sf.ehcache.Element;
-
-public class ActionList extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionList.class);
-
-	@SuppressWarnings("unchecked")
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = null;
-		List<TaskListTemplate> projectGroups = null;
-		Boolean check = true;
-
-		/*if( Boolean.TRUE.equals( check ) ){
-			try {
-				projectGroups = projectGroupQueryService.listGroupByPerson( effectivePerson.getDistinguishedName() );
-				if( ListTools.isNotEmpty( projectGroups )) {
-					wos = Wo.copier.copy( projectGroups );
-					
-					SortTools.asc( wos, "createTime");
-					
-					result.setData(wos);
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ProjectTemplateQueryException(e, "根据用户拥有的项目组信息列表时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}*/
-		
-		return result;
-	}
-
-	public static class Wo extends TaskListTemplate {
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskListTemplate, Wo> copier = WrapCopierFactory.wo( TaskListTemplate.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-}

+ 0 - 173
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionListNextWithFilter.java

@@ -1,173 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectTemplate;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		QueryFilter  queryFilter = null;
-		List<String> queryProjectIds = new ArrayList<>();
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) { 
-			flag = null;
-		}
-
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new ProjectTemplateQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			if( wrapIn == null ) {
-				wrapIn = new Wi();
-			}
-			queryFilter = wrapIn.getQueryFilter();
-			
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListNextWithFilter", effectivePerson.getDistinguishedName(), flag, count, 
-					wrapIn.getOrderField(), wrapIn.getOrderType(), 	queryFilter.getContentSHA1() );
-			element = projectTemplateCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				try {
-					//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
-					List<String>  projectIds = projectTemplateQueryService.listAllProjectTemplateIds( effectivePerson, 2000, queryFilter );
-					if( ListTools.isNotEmpty( projectIds )) {
-						//直接根据可见项目ID列表进行分页查询
-						Long total = Long.parseLong( projectIds.size() + "" );										
-						List<ProjectTemplate>  projectList = projectTemplateQueryService.listWithProjectIdFilter( count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), projectIds );
-						
-						if( ListTools.isNotEmpty( projectList )) { 
-							WrapOutControl control = null;
-							for( ProjectTemplate project : projectList ) {
-								Wo wo = Wo.copier.copy(project);
-								
-								/*Business business = null;
-								try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-									business = new Business(bc);
-								}
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
-										|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
-									control.setDelete( true );
-									control.setEdit( true );
-									control.setSortable( true );
-								}else{
-									control.setDelete( false );
-									control.setEdit( false );
-									control.setSortable( false );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);*/
-								wos.add( wo );
-							}
-						}
-						resultObject = new ResultObject( total, wos );
-						//projectTemplateCache.put(new Element( cacheKey, resultObject ));
-						
-						result.setCount( resultObject.getTotal() );
-						result.setData( resultObject.getWos() );
-					}
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-
-	public static class Wi extends WrapInQueryProjectTemplate{
-	}
-	
-	public static class Wo extends ProjectTemplate {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<ProjectTemplate, Wo> copier = WrapCopierFactory.wo( ProjectTemplate.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 220
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionStatisticProjectTemplates.java

@@ -1,220 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.ProjectTemplate;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-
-
-import net.sf.ehcache.Element;
-
-public class ActionStatisticProjectTemplates extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionStatisticProjectTemplates.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		List<String> projectTemplateIds = null;
-		List<ProjectTemplate> projectTemplateList = null;
-		List<String>  projectGroupList = null;
-		List<WoGroup> woGroupList = new ArrayList<>();
-		Business business = null;
-		Boolean check = true;
-		
-		Integer allCount = 0;
-		Integer myCount = 0;
-
-		String cacheKey = ApplicationCache.concreteCacheKey( "ActionStatisticProjectTemplates", effectivePerson.getDistinguishedName() );
-		Element element = projectTemplateCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			result.setData( wo );
-		} else {
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询所有模板
-					projectTemplateIds = projectTemplateQueryService.listAllProjectTemplateIds( effectivePerson, 2000,  new QueryFilter() );
-					if( ListTools.isNotEmpty( projectTemplateIds )) {
-						projectTemplateList = projectTemplateQueryService.list( projectTemplateIds );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectTemplateQueryException( e, "查询所有项目模板信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询我所有的项目组列表
-					//projectGroupList = projectGroupQueryService.listGroupByPerson( effectivePerson.getDistinguishedName() );
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						business = new Business(emc);
-						projectGroupList = business.projectTemplateFactory().fetchAllGroupType(effectivePerson.getDistinguishedName());
-					}
-					
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectTemplateQueryException( e, "查询用户所有项目模板信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}	
-			
-			if( Boolean.TRUE.equals( check ) ){
-				if( ListTools.isNotEmpty( projectTemplateList )) {
-					for(  ProjectTemplate projectTemplate : projectTemplateList ) {
-							allCount++;						
-							if( projectTemplate.getOwner().equalsIgnoreCase(effectivePerson.getDistinguishedName()  )) {
-								myCount++;
-							}
-					}
-				}
-			}
-			
-			if(Boolean.TRUE.equals( check )){
-				if( ListTools.isNotEmpty( projectGroupList )) {
-					for(  String projectGroup : projectGroupList ) {						
-						List<ProjectTemplate> templateLists = business.projectTemplateFactory().ListProjectTemplateWithType(projectGroup);
-						if(ListTools.isNotEmpty(templateLists)){
-							List<WoTemplate> woTemplate = new ArrayList<>();
-							WoGroup woGroup = new WoGroup();
-							String type = "";
-							woTemplate = WoTemplate.copier.copy( templateLists );
-							for(ProjectTemplate templateList : templateLists){
-								woGroup.addProjectTemplateTypeCount(1);
-								type = templateList.getType();								
-							}
-							woGroup.setProjecTemplatetTypeName(type);
-							woGroup.setWoTemplate(woTemplate);
-							woGroupList.add(woGroup);
-						}
-					}
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = new Wo();
-					wo.setAllCount( allCount );
-					wo.setMyCount(myCount);				
-					//SortTools.asc( woGroupList, "projectTemplateTypeCount");
-					wo.setGroups( woGroupList );
-					projectTemplateCache.put( new Element(cacheKey, wo) );
-					result.setData(wo);
-				} catch (Exception e) {
-					Exception exception = new ProjectTemplateQueryException(e, "将查询出来的应用项目模板信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		return result;
-	}
-
-	public static class Wo{
-
-		@FieldDescribe("所有项目数量")
-		private Integer allCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer myCount = 0;
-		
-		@FieldDescribe("所有分组信息")
-		private List<WoGroup> groups = null;
-		
-		public List<WoGroup> getGroups() {
-			return groups;
-		}
-
-		public void setGroups(List<WoGroup> groups) {
-			this.groups = groups;
-		}
-
-		public Integer getAllCount() {
-			return allCount;
-		}
-
-		public void setAllCount(Integer allCount) {
-			this.allCount = allCount;
-		}
-
-		public Integer getMyCount() {
-			return myCount;
-		}
-
-		public void setMyCount(Integer myCount) {
-			this.myCount = myCount;
-		}
-
-	}
-	
-	public static class WoTemplate extends ProjectTemplate{
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<ProjectTemplate, WoTemplate> copier = WrapCopierFactory.wo( ProjectTemplate.class, WoTemplate.class, null, JpaObject.FieldsInvisible);
-	}
-
-	public static class WoGroup{
-		
-		@FieldDescribe("分组项目数量")
-		private Integer projectTemplateTypeCount = 0;
-		
-		@FieldDescribe("分组名称")
-		private String projecTemplatetTypeName;
-		
-		public String getProjecTemplatetName() {
-			return projecTemplatetTypeName;
-		}
-		
-		public void setProjecTemplatetTypeName(String projecTemplatetTypeName) {
-			this.projecTemplatetTypeName = projecTemplatetTypeName;
-		}
-		
-		public Integer getProjectTemplateTypeCount() {
-			return projectTemplateTypeCount;
-		}
-
-		public void setProjectTemplateTypeCount(Integer projectTemplateTypeCount) {
-			this.projectTemplateTypeCount = projectTemplateTypeCount;
-		}
-
-		public void addProjectTemplateTypeCount( Integer count ) {
-			if( this.projectTemplateTypeCount == null ) {
-				this.projectTemplateTypeCount =0;
-			}
-			this.projectTemplateTypeCount += count;
-	   }
-		
-		@FieldDescribe("所有分组信息")
-		private List<WoTemplate> woTemplate = null;
-		
-		public List<WoTemplate> getWoTemplate() {
-			return woTemplate;
-		}
-
-		public void setWoTemplate(List<WoTemplate> woTemplate) {
-			this.woTemplate = woTemplate;
-		}
-	}
-}

+ 0 - 131
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ProjectTemplateAction.java

@@ -1,131 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-
-@Path("projectTemplate")
-@JaxrsDescribe("项目模板信息管理")
-public class ProjectTemplateAction extends StandardJaxrsAction {
-
-	private Logger logger = LoggerFactory.getLogger(ProjectTemplateAction.class);
-	
-	@JaxrsMethodDescribe(value = "查询项目模板统计信息.", action = ActionStatisticProjectTemplates.class)
-	@GET
-	@Path("statitic/all")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void statiticMyProject(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request ) {
-		ActionResult<ActionStatisticProjectTemplates.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionStatisticProjectTemplates().execute( request, effectivePerson );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据ID查询项目模板信息.", action = ActionGet.class)
-	@GET
-	@Path("{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void get(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("项目组ID") @PathParam("id") String id ) {
-		ActionResult<ActionGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGet().execute( request, effectivePerson, id );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示项目信息,下一页.", action = ActionListNextWithFilter.class)
-	@PUT
-	@Path("list/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, 
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, 
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionListNextWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListNextWithFilter().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "创建或者更新一个项目模板信息.", action = ActionSave.class)
-	@POST
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void save(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("需要保存的项目模板信息") JsonElement jsonElement ) {
-		ActionResult<ActionSave.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionSave().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "根据标识删除项目模板信息.", action = ActionDelete.class)
-	@DELETE
-	@Path("{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void delete(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id ) {
-		ActionResult<ActionDelete.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionDelete().execute(request, effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 0 - 103
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/WrapInQueryProjectTemplate.java

@@ -1,103 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.LikeTerm;
-
-public class WrapInQueryProjectTemplate {
-	@FieldDescribe("用于排列的属性,非必填,默认为createTime.")
-	private String orderField = "createTime";
-
-	@FieldDescribe("排序方式:DESC | ASC,非必填, 默认为DESC.")
-	private String orderType = "DESC";
-	
-	@FieldDescribe("用于搜索的标题,非必填.")
-	private String title = null;
-	
-	@FieldDescribe("用于搜索的项目模板类型,非必填.")
-	private String type = null;			
-	
-	@FieldDescribe("是否已经删除,非必填")
-	private String deleted = null;
-	
-	@FieldDescribe("创建者,非必填")
-	private String owner = null;		
-	
-	private Long rank = 0L;
-	
-	public String getOrderField() {
-		return orderField;
-	}
-	public void setOrderField(String orderField) {
-		this.orderField = orderField;
-	}
-	public String getOrderType() {
-		return orderType;
-	}
-
-	public void setOrderType(String orderType) {
-		this.orderType = orderType;
-	}
-	public String getTitle() {
-		return title;
-	}
-	public void setTitle(String title) {
-		this.title = title;
-	}
-	public String getType() {
-		return type;
-	}
-	public void setType(String type) {
-		this.type = type;
-	}
-	public String getDeleted() {
-		return deleted;
-	}
-	public void setDeleted(String deleted) {
-		this.deleted = deleted;
-	}
-	public String getOwner() {
-		return owner;
-	}
-	public void setOwner(String owner) {
-		this.owner = owner;
-	}
-	public Long getRank() {
-		return rank;
-	}
-	public void setRank(Long rank) {
-		this.rank = rank;
-	}
-
-
-
-	/**
-	 * 根据传入的查询参数,组织一个完整的QueryFilter对象
-	 * @return
-	 */
-	public QueryFilter getQueryFilter() {
-		QueryFilter queryFilter = new QueryFilter();		
-		queryFilter.setJoinType( "and" );
-		//组织查询条件对象
-		if( StringUtils.isNotEmpty( this.getTitle() )) {
-			queryFilter.addLikeTerm( new LikeTerm( "title", this.getTitle() ) );
-		}
-		if( StringUtils.isNotEmpty( this.getType())) {
-			queryFilter.addEqualsTerm( new EqualsTerm( "type", this.getType() ) );
-		}
-		if( StringUtils.isNotEmpty( this.getOwner())) {
-			queryFilter.addEqualsTerm( new EqualsTerm( "owner", this.getOwner() ) );
-		}
-		if( StringUtils.isNotEmpty( this.getDeleted() )) {
-			if( "true".equalsIgnoreCase( this.getDeleted() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "deleted", true ) );
-			}else {
-				queryFilter.addEqualsTerm( new EqualsTerm( "deleted", false ) );
-			}
-		}
-		return queryFilter;
-	}
-}

+ 0 - 51
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/WrapOutControl.java

@@ -1,51 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.projectTemplate;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-
-public class WrapOutControl {
-	
-	@FieldDescribe("是否可删除")
-	private Boolean delete = false;
-	
-	@FieldDescribe("是否可编辑")
-	private Boolean edit = false;
-	
-	@FieldDescribe("是否可排序")
-	private Boolean sortable = true;
-	
-	@FieldDescribe("是否创始人")
-	private Boolean founder = false;
-	
-	public Boolean getDelete() {
-		return delete;
-	}
-
-	public void setDelete(Boolean delete) {
-		this.delete = delete;
-	}
-	
-	public Boolean getEdit() {
-		return edit;
-	}
-
-	public void setEdit(Boolean edit) {
-		this.edit = edit;
-	}
-	
-	public Boolean getSortable() {
-		return sortable;
-	}
-
-	public void setSortable(Boolean sortable) {
-		this.sortable = sortable;
-	}
-	
-	public Boolean getFounder() {
-		return founder;
-	}
-
-	public void setFounder(Boolean founder) {
-		this.founder = founder;
-	}
-	
-}

+ 0 - 272
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/ActionStatisticMyProjects.java

@@ -1,272 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.statistics;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.base.core.project.tools.SortTools;
-import com.x.teamwork.core.entity.Project;
-import com.x.teamwork.core.entity.ProjectGroup;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionStatisticMyProjects extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionStatisticMyProjects.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		List<String> projectIds = null;
-		List<Project> projectList = null;
-		List<ProjectGroup>  projectGroupList = null;
-		List<WoGroup> woGroupList = null;
-		Boolean check = true;
-		
-		Integer allCount = 0;
-		Integer starCount = 0;
-		Integer myCount = 0;
-		Integer unGroupCount = 0;
-		Integer completedCount = 0;
-		Integer archiveCount = 0;
-		Integer deleteCount = 0;
-
-
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询我参与的所有项目
-					projectIds = projectQueryService.listAllProjectIds( effectivePerson, 2000,  new QueryFilter() );
-					if( ListTools.isNotEmpty( projectIds )) {
-						projectList = projectQueryService.list( projectIds );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectQueryException( e, "查询用户参与的所有项目信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					//查询我所有的项目组列表
-					projectGroupList = projectGroupQueryService.listGroupByPerson( effectivePerson.getDistinguishedName() );
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ProjectQueryException( e, "查询用户所有项目组信息列表时发生异常。" );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				if( ListTools.isNotEmpty( projectGroupList )) {
-					woGroupList = WoGroup.copier.copy( projectGroupList );
-					SortTools.asc( woGroupList, "createTime");
-				}
-			}			
-			
-			if( Boolean.TRUE.equals( check ) ){
-				if( ListTools.isNotEmpty( projectList )) {
-					for(  Project project : projectList ) {
-						if(project.getDeleted() != null && project.getDeleted() ){
-							deleteCount++;
-						}else{
-							allCount++;						
-							if( project.getStarPersonList() != null  && project.getStarPersonList().contains( effectivePerson.getDistinguishedName() ) ) {
-								starCount++;
-							}
-							if( project.getCreatorPerson().equalsIgnoreCase(effectivePerson.getDistinguishedName()  )) {
-								myCount++;
-							}
-							if( project.getGroupCount() == null || project.getGroupCount() == 0 ) {
-								unGroupCount++;
-							}
-							if( project.getCompleted() != null && project.getCompleted() ) {
-								completedCount++;
-							}
-							if( project.getArchive() != null && project.getArchive() ) {
-								archiveCount++;
-							}
-							woGroupList = checkGroup( project, woGroupList );
-						}
-						
-					}
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = new Wo();
-					wo.setAllCount( allCount );
-					wo.setMyCount(myCount);
-					wo.setStarCount(starCount);
-					wo.setUnGroupCount(unGroupCount);
-					wo.setCompletedCount(completedCount);
-					wo.setArchiveCount(archiveCount);
-					wo.setDeleteCount(deleteCount);					
-					if( ListTools.isNotEmpty( woGroupList )) {
-						SortTools.asc( woGroupList, "createTime");
-					}	
-					wo.setGroups( woGroupList );
-					result.setData(wo);
-				} catch (Exception e) {
-					Exception exception = new ProjectQueryException(e, "将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		return result;
-	}
-
-	private List<WoGroup> checkGroup( Project project, List<WoGroup> woGroupList) throws Exception {
-		if( ListTools.isEmpty( woGroupList )) {
-			return null;
-		}
-		for( WoGroup woGroup : woGroupList ) {
-			if( projectGroupQueryService.existsWithProjectAndGroup( woGroup.getId(), project.getId() ) ) {
-				woGroup.addProjectCount(1);
-				break;
-			}
-		}
-		return woGroupList;
-	}
-
-	public static class Wo{
-
-		@FieldDescribe("所有项目数量")
-		private Integer allCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer starCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer myCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer unGroupCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer completedCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer archiveCount = 0;
-		
-		@FieldDescribe("所有项目数量")
-		private Integer deleteCount = 0;
-		
-		@FieldDescribe("所有分组信息")
-		private List<WoGroup> groups = null;
-		
-		public List<WoGroup> getGroups() {
-			return groups;
-		}
-
-		public void setGroups(List<WoGroup> groups) {
-			this.groups = groups;
-		}
-
-		public Integer getAllCount() {
-			return allCount;
-		}
-
-		public void setAllCount(Integer allCount) {
-			this.allCount = allCount;
-		}
-
-		public Integer getStarCount() {
-			return starCount;
-		}
-
-		public void setStarCount(Integer starCount) {
-			this.starCount = starCount;
-		}
-
-		public Integer getMyCount() {
-			return myCount;
-		}
-
-		public void setMyCount(Integer myCount) {
-			this.myCount = myCount;
-		}
-
-		public Integer getUnGroupCount() {
-			return unGroupCount;
-		}
-
-		public void setUnGroupCount(Integer unGroupCount) {
-			this.unGroupCount = unGroupCount;
-		}
-
-		public Integer getCompletedCount() {
-			return completedCount;
-		}
-
-		public void setCompletedCount(Integer completedCount) {
-			this.completedCount = completedCount;
-		}
-
-		public Integer getArchiveCount() {
-			return archiveCount;
-		}
-
-		public void setArchiveCount(Integer archiveCount) {
-			this.archiveCount = archiveCount;
-		}
-
-		public Integer getDeleteCount() {
-			return deleteCount;
-		}
-
-		public void setDeleteCount(Integer deleteCount) {
-			this.deleteCount = deleteCount;
-		}
-	}
-	
-	public static class WoGroup extends ProjectGroup{
-		
-		@FieldDescribe("分组项目数量")
-		private Integer projectCount = 0;
-		
-		public Integer getProjectCount() {
-			return projectCount;
-		}
-
-		public void setProjectCount(Integer projectCount) {
-			this.projectCount = projectCount;
-		}
-
-		public void addProjectCount( Integer count ) {
-			if( this.projectCount == null ) {
-				this.projectCount =0;
-			}
-			this.projectCount += count;
-		}
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-		
-		static {
-			Excludes.add("creatorPerson");
-			Excludes.add("owner");
-			Excludes.add("updateTime");
-			Excludes.add("distributeFactor");
-			Excludes.add("sequence");
-		}
-		
-		static WrapCopier<ProjectGroup, WoGroup> copier = WrapCopierFactory.wo( ProjectGroup.class, WoGroup.class, null, Excludes);
-	}
-}

+ 0 - 132
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/ActionStatisticTaskWithFilter.java

@@ -1,132 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.statistics;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionStatisticTaskWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionStatisticTaskWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;		
-		Boolean check = true;
-		QueryFilter  queryFilter = null;
-		String flag = null;
-		Integer count = 2000;
-		
-		
-		
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new StatisticQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			wrapIn.setDeleted("false");
-			queryFilter = wrapIn.getQueryFilter();
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			
-				try {
-					Long total = statisticQueryService.countWithFilter( effectivePerson, queryFilter );
-					List<Task>  taskList = statisticQueryService.listWithFilter( effectivePerson, count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter );
-					wos = Wo.copier.copy(taskList);
-					resultObject = new ResultObject( total, wos );
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}		
-		return result;
-	}
-	
-	public static class Wi extends WrapInQueryTask{
-	}
-	
-	public static class Wo extends Task {
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

+ 0 - 28
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/BaseAction.java

@@ -1,28 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.statistics;
-
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.teamwork.assemble.control.service.ProjectGroupPersistService;
-import com.x.teamwork.assemble.control.service.ProjectGroupQueryService;
-import com.x.teamwork.assemble.control.service.ProjectQueryService;
-import com.x.teamwork.assemble.control.service.StatisticQueryService;
-import com.x.teamwork.assemble.control.service.SystemConfigQueryService;
-import com.x.teamwork.core.entity.Project;
-
-import net.sf.ehcache.Ehcache;
-
-public class BaseAction extends StandardJaxrsAction {
-
-	protected Ehcache projectCache = ApplicationCache.instance().getCache( Project.class );
-	
-	protected 	ProjectQueryService projectQueryService = new ProjectQueryService();
-	
-	protected ProjectGroupQueryService projectGroupQueryService = new ProjectGroupQueryService();
-	
-	protected ProjectGroupPersistService projectGroupPersistService = new ProjectGroupPersistService();	
-	
-	protected 	SystemConfigQueryService systemConfigQueryService = new SystemConfigQueryService();
-	
-	protected 	StatisticQueryService statisticQueryService = new StatisticQueryService();
-	
-}

+ 0 - 16
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/ProjectQueryException.java

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

+ 0 - 16
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/StatisticQueryException.java

@@ -1,16 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.statistics;
-
-import com.x.base.core.project.exception.PromptException;
-
-class StatisticQueryException extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	StatisticQueryException( Throwable e ) {
-		super("统计查询工作任务信息时发生异常。" , e );
-	}
-	
-	StatisticQueryException( Throwable e, String message ) {
-		super("统计查询工作任务信息时发生异常。Message:" + message, e );
-	}
-}

+ 0 - 73
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/StatisticsAction.java

@@ -1,73 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.statistics;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-
-@Path("statistics")
-@JaxrsDescribe("统计管理")
-public class StatisticsAction extends StandardJaxrsAction {
-
-	private Logger logger = LoggerFactory.getLogger(StatisticsAction.class);
-
-	@JaxrsMethodDescribe(value = "查询我的项目统计信息.", action = ActionStatisticMyProjects.class)
-	@GET
-	@Path("statitic/my")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void statiticMyProject(@Suspended final AsyncResponse asyncResponse, 
-			@Context HttpServletRequest request ) {
-		ActionResult<ActionStatisticMyProjects.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionStatisticMyProjects().execute( request, effectivePerson );
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-	
-	@JaxrsMethodDescribe(value = "列示工作任务信息,下一页.", action = ActionStatisticTaskWithFilter.class)
-	@PUT
-	@Path("statitic/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listNextWithFilter(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) {
-		ActionResult<List<ActionStatisticTaskWithFilter.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionStatisticTaskWithFilter().execute(request, effectivePerson,jsonElement); 
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-}

+ 0 - 139
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/statistics/WrapInQueryTask.java

@@ -1,139 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.statistics;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsFalseTerm;
-import com.x.teamwork.core.entity.tools.filter.term.LikeTerm;
-
-public class WrapInQueryTask {
-	
-	@FieldDescribe("用于排列的属性,非必填,默认为createTime.")
-	private String orderField = "createTime";
-
-	@FieldDescribe("排序方式:DESC | ASC,非必填,默认为DESC.")
-	private String orderType = "DESC";
-	
-	@FieldDescribe("用于搜索的项目ID,单值,非必填.")
-	private String project = null;
-	
-	@FieldDescribe("用于搜索的上级工作任务ID,单值,非必填.")
-	private String parentId = null;	
-	
-	@FieldDescribe("用于搜索的工作状态:草稿- draft  | 执行中- processing | 已完成- completed | 已归档- archived,单值,非必填")
-	private String workStatus = null;
-		
-	
-	@FieldDescribe("是否已经删除,true|false,非必填")
-	private String deleted = null;		
-	
-	@FieldDescribe("执行者或者负责人,单值,非必填")
-	private String executor = null;		
-
-	private Long rank = 0L;
-
-	public Long getRank() {
-		return rank;
-	}
-
-	public void setRank(Long rank) {
-		this.rank = rank;
-	}
-	
-	public String getOrderField() {
-		return orderField;
-	}
-
-	public void setOrderField(String orderField) {
-		this.orderField = orderField;
-	}
-
-	public String getOrderType() {
-		return orderType;
-	}
-
-	public void setOrderType(String orderType) {
-		this.orderType = orderType;
-	}
-
-	public String getProject() {
-		return project;
-	}
-
-	public void setProject(String project) {
-		this.project = project;
-	}
-
-	public String getParentId() {
-		return parentId;
-	}
-
-	public void setParentId(String parentId) {
-		this.parentId = parentId;
-	}
-
-	public String getWorkStatus() {
-		return workStatus;
-	}
-
-	public void setWorkStatus(String workStatus) {
-		this.workStatus = workStatus;
-	}
-	
-	public String getDeleted() {
-		return deleted;
-	}
-
-	public void setDeleted(String deleted) {
-		this.deleted = deleted;
-	}
-
-	public String getExecutor() {
-		return executor;
-	}
-
-	public void setExecutor(String executor) {
-		this.executor = executor;
-	}
-	
-	/**
-	 * 根据传入的查询参数,组织一个完整的QueryFilter对象
-	 * @return
-	 */
-	public QueryFilter getQueryFilter() {
-		QueryFilter queryFilter = new QueryFilter();
-		//组织查询条件对象
-		if( StringUtils.isNotEmpty( this.getProject() )) {
-			queryFilter.addEqualsTerm( new EqualsTerm( "project", this.getProject() ) );
-		}
-		if( StringUtils.isNotEmpty( this.getParentId() )) {
-			queryFilter.addEqualsTerm( new EqualsTerm( "parent", this.getParentId() ) );
-		}
-		if( StringUtils.isNotEmpty( this.getWorkStatus() )) {
-			queryFilter.addEqualsTerm( new EqualsTerm( "workStatus", this.getWorkStatus() ) );
-		}else {
-			//默认查询所有的未归档的工作任务
-			queryFilter.addIsFalseTerm( new IsFalseTerm("archive"));
-		}
-		if( StringUtils.isNotEmpty( this.getExecutor())) {
-			queryFilter.addEqualsTerm( new EqualsTerm( "executor", this.getExecutor() ) );
-		}
-		/*if( StringUtils.isNotEmpty( this.getCompleted() )) {
-			if( "true".equalsIgnoreCase( this.getCompleted() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "completed", true ) );
-			}else {
-				queryFilter.addEqualsTerm( new EqualsTerm( "completed", false ) );
-			}
-		}*/
-		if( StringUtils.isNotEmpty( this.getDeleted() )) {
-			if( "true".equalsIgnoreCase( this.getDeleted() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "deleted", true ) );
-			}else {
-				queryFilter.addEqualsTerm( new EqualsTerm( "deleted", false ) );
-			}
-		}
-		return queryFilter;
-	}
-}

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

@@ -1,216 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.base.core.project.tools.ListTools;
-import com.x.teamwork.assemble.control.service.BatchOperationPersistService;
-import com.x.teamwork.assemble.control.service.BatchOperationProcessService;
-import com.x.teamwork.assemble.control.service.UserManagerService;
-import com.x.teamwork.core.entity.*;
-import org.apache.commons.lang3.StringUtils;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 将指定的任务复制为新的工作任务
- */
-public class ActionCopyTask extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionCopyTask.class);
-	private UserManagerService userManagerService = new UserManagerService();
-
-	/**
-	 * 将指定的任务复制为新的工作任务
-	 * 1、确认ID是否合法
-	 * 2、将Task,TaskDetail,以及TaskExtField复制一份
-	 * 3、调整ID,并且进行新任务的存储工作
-	 * 4、记录动态信息
-	 *
-	 * @param request
-	 * @param effectivePerson
-	 * @param sourceTaskId
-	 * @return
-	 * @throws Exception
-	 */
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String sourceTaskId ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		Task sourceTask = null;
-		TaskDetail taskDetail = null;
-		TaskExtField taskExtField = null;
-		List<Dynamic> dynamics  = new ArrayList<>();
-		Boolean check = true;
-		List<String> groupIds = null;
-		List<String> listIds = null;
-
-		if ( StringUtils.isEmpty( sourceTaskId ) ) {
-			check = false;
-			Exception exception = new TaskTransformException("需要复制的工作任务ID不允许为空!");
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				sourceTask = taskQueryService.get( sourceTaskId );
-				if ( sourceTask == null) {
-					check = false;
-					Exception exception = new TaskNotExistsException(sourceTaskId);
-					result.error( exception );
-				}
-				groupIds = taskGroupQueryService.listGroupIdsByTask( sourceTask.getId() );
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务信息对象时发生异常。ID:" + sourceTaskId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				taskDetail = taskQueryService.getDetail( sourceTaskId );
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务信息对象时发生异常。ID:" + sourceTaskId);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				taskExtField = taskQueryService.getExtField( sourceTaskId );
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务扩展属性信息对象时发生异常。ID:" + sourceTaskId);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		Task newTask = new Task();
-		TaskDetail newTaskDetail = new TaskDetail();
-		TaskExtField newTaskExtField = new TaskExtField();
-		
-		if( Boolean.TRUE.equals( check ) ){
-			//COPY对象
-			sourceTask.copyTo( newTask );
-			taskDetail.copyTo( newTaskDetail );
-			taskExtField.copyTo( newTaskExtField );
-
-			//重新命名
-			newTask.setName( sourceTask.getName() + " - 副本");
-			
-			//调整负责人为当前用户
-			newTask.setExecutor(effectivePerson.getDistinguishedName());
-			newTask.setExecutorIdentity(userManagerService.getIdentityWithPerson( newTask.getExecutor(), "min"));
-			
-			//调整创建人为当前用户
-			newTask.setCreatorPerson(effectivePerson.getDistinguishedName());
-
-			//调整ID
-			newTask.setId( Task.createId() );
-			newTaskDetail.setId( newTask.getId() );
-			newTaskExtField.setId( newTask.getId() );
-
-			try {
-				newTask = taskPersistService.save( newTask, newTaskDetail, newTaskExtField, effectivePerson );
-				wo.setId( newTask.getId() );
-				if(ListTools.isNotEmpty( groupIds )){
-					if( !taskGroupQueryService.existsWithTaskAndGroup( groupIds.get(0), newTask.getId() )){
-						//添加任务和任务组的关联
-						taskGroupPersistService.addTaskToGroup( newTask.getId(),groupIds.get(0) );
-						taskGroupPersistService.refreshTaskCountInTaskGroupWithTaskId( effectivePerson.getDistinguishedName(), newTask.getId() );
-						listIds = taskListQueryService.listTaskListIdWithTaskId( sourceTask.getId(), groupIds.get(0));
-					}
-				}
-				if(ListTools.isNotEmpty( listIds )){
-					taskListPersistService.addTaskToTaskListWithOrderNumber( newTask.getId(), listIds.get(0), null,  effectivePerson);
-				}
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskPersistException(e, "工作上级任务ID信息更新时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				dynamics = dynamicPersistService.taskCopyDynamic( sourceTask, newTask, effectivePerson );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				new BatchOperationPersistService().addOperation(
-						BatchOperationProcessService.OPT_OBJ_TASK,
-						BatchOperationProcessService.OPT_TYPE_PERMISSION,  newTask.getId(),  newTask.getId(), "刷新文档权限:ID=" +   sourceTask.getId() );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if( ListTools.isNotEmpty( dynamics ) ) {
-			wo.setDynamics( WoDynamic.copier.copy( dynamics ) );
-		}
-
-		// 更新缓存
-		ApplicationCache.notify( Task.class );
-		ApplicationCache.notify( TaskList.class );
-		ApplicationCache.notify( TaskView.class );
-		ApplicationCache.notify( Review.class );
-		ApplicationCache.notify( TaskGroup.class );
-		ApplicationCache.notify( Dynamic.class );
-
-		result.setData( wo );
-		return result;
-	}
-
-
-	public static class Wo extends WoId {
-
-		@FieldDescribe("操作引起的动态内容")
-		List<ActionSave.WoDynamic> dynamics = new ArrayList<>();
-
-		public List<ActionSave.WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<ActionSave.WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-
-	}
-
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, ActionSave.WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, ActionSave.WoDynamic.class, null, JpaObject.FieldsInvisible);
-
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-	}
-}

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

@@ -1,474 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.*;
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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 net.sf.ehcache.Element;
-
-public class ActionGet extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionGet.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String flag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		Task task = null;
-		TaskDetail taskDetail = null;
-		TaskExtField taskExtField = null;
-		List<CustomExtFieldRele> extFieldReleList = null;
-		List<TaskTag> tags = null;
-		Boolean check = true;
-		WrapOutControl control = null;
-
-		if ( StringUtils.isEmpty( flag ) ) {
-			check = false;
-			Exception exception = new TaskFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		String cacheKey = ApplicationCache.concreteCacheKey( flag,effectivePerson );
-		Element element = taskCache.get( cacheKey );
-
-		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			result.setData( wo );
-		} else {
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					task = taskQueryService.get( flag );
-					if ( task == null) {
-						check = false;
-						Exception exception = new TaskNotExistsException(flag);
-						result.error( exception );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务信息对象时发生异常。flag:" + flag);
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					taskDetail = taskQueryService.getDetail( flag );
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务信息对象时发生异常。flag:" + flag);
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					taskExtField = taskQueryService.getExtField( flag );
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务扩展属性信息对象时发生异常。flag:" + flag);
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					extFieldReleList = customExtFieldReleQueryService.listReleWithCorrelation( task.getId() ); 
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定taskId查询任务扩展列配置信息对象时发生异常。taskId:" + task.getId());
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			if( Boolean.TRUE.equals( check ) ){
-				try {
-					wo = Wo.copier.copy( task );
-					if ( wo != null && taskDetail != null) {
-						wo.setDetail( taskDetail.getDetail() );
-						wo.setDescription( taskDetail.getDescription() );
-					}
-
-					if( taskExtField != null ) {
-						wo.setExtField( WoTaskExtField.copier.copy( taskExtField ));
-					}
-
-					if( ListTools.isNotEmpty( extFieldReleList )) {
-						List<WoExtFieldRele> reles = WoExtFieldRele.copier.copy( extFieldReleList ) ;
-						for( WoExtFieldRele woExtFieldRele :  reles ) {
-							woExtFieldRele.setValue( taskQueryService.getValueFromTaskExtField( taskExtField, woExtFieldRele.getExtFieldName() ));
-						}
-						wo.setExtFieldConfigs( reles );
-					}
-					
-					tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, task);
-					if( ListTools.isNotEmpty( tags )) {
-						wo.setTags( WoTaskTag.copier.copy( tags ));
-					}
-
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "将查询出来的工作任务信息对象转换为可输出的数据信息时发生异常。");
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			//计算权限
-			if( Boolean.TRUE.equals( check ) ){
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					control = new WrapOutControl();
-					if( business.isManager(effectivePerson) 
-							|| effectivePerson.getDistinguishedName().equalsIgnoreCase( task.getCreatorPerson() )
-							|| (ListTools.isNotEmpty(task.getManageablePersonList()) && task.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-						control.setDelete( true );					
-						control.setSortable( true );
-						control.setChangeExecutor( true );
-					}else{
-						control.setDelete( false );
-						control.setSortable( false );
-						control.setChangeExecutor( false );
-					}
-					control.setEdit( true );
-					if(effectivePerson.getDistinguishedName().equalsIgnoreCase( task.getExecutor())){
-						control.setChangeExecutor( true );
-					}
-					if(effectivePerson.getDistinguishedName().equalsIgnoreCase( task.getCreatorPerson())){
-						control.setFounder( true );
-					}else{
-						control.setFounder( false );
-					}
-					
-					Project project = null;
-					project = projectQueryService.get(wo.getProject());
-					if(project != null && (project.getDeleted() || project.getCompleted())){
-						control.setEdit( false );
-						control.setDelete( false );					
-						control.setSortable( false );
-						control.setChangeExecutor( false );
-					}
-					
-					wo.setControl(control);
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + flag);
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			
-			//查询任务所在的Group信息
-			if( Boolean.TRUE.equals( check ) ){
-				List<String> groupIds = null;
-				try {
-					//groupIds = taskGroupQueryService.listGroupIdsByTask( task.getId() );
-					groupIds = taskGroupQueryService.listGroupIdsByPersonAndProject(effectivePerson,task.getProject());
-					if( ListTools.isNotEmpty( groupIds )){
-						wo.setTaskGroupId( groupIds.get(0) );
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定projectId查询项目扩展列配置信息对象时发生异常。projectId:" + task.getProject());
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-
-			//查询任务所在的List信息
-			if( Boolean.TRUE.equals( check ) ){
-				if( StringUtils.isNotEmpty(wo.getTaskGroupId() )){
-					List<String> listIds = null;
-					try {
-						listIds = taskListQueryService.listTaskListIdWithTaskId( task.getId(), wo.getTaskGroupId() );
-						if( ListTools.isNotEmpty( listIds )){
-							wo.setTaskListId( listIds.get(0) );
-						}else{
-							//返回当前项目的未分类taskListId
-							List<TaskList> taskList= null;
-							taskList = taskListQueryService.listWithTaskGroup( effectivePerson.getDistinguishedName(), wo.getTaskGroupId() );
-							if(taskList !=null){
-								wo.setTaskListId(taskList.get(0).getId());
-							}
-						}
-					} catch (Exception e) {
-						Exception exception = new TaskQueryException(e, "根据指定projectId查询项目扩展列配置信息对象时发生异常。projectId:" + task.getProject());
-						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
-					}
-				}
-			}
-		}
-		taskCache.put(new Element( cacheKey, wo ));
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends Task {
-		
-		@FieldDescribe("工作内容(128K)")
-		private String detail;
-
-		@FieldDescribe("说明详细信息(10M)")
-		private String description;
-		
-		@FieldDescribe("扩展属性信息(对象)")
-		private WoTaskExtField extField;
-		
-		@FieldDescribe("任务标签(列表)")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("所属项目的扩展列设定(配置列表)")
-		private List<WoExtFieldRele> extFieldConfigs;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-
-		@FieldDescribe("工作任务所属的工作任务组信息ID")
-		String taskGroupId = null;
-
-		@FieldDescribe("工作任务所属的工作任务列表(泳道)信息ID")
-		String taskListId = null;
-
-		private Long rank;
-
-		public String getTaskGroupId() {
-			return taskGroupId;
-		}
-
-		public void setTaskGroupId(String taskGroupId) {
-			this.taskGroupId = taskGroupId;
-		}
-
-		public String getTaskListId() {
-			return taskListId;
-		}
-
-		public void setTaskListId(String taskListId) {
-			this.taskListId = taskListId;
-		}
-
-		public WoTaskExtField getExtField() {
-			return extField;
-		}
-
-		public void setExtField(WoTaskExtField extField) {
-			this.extField = extField;
-		}
-
-		public List<WoExtFieldRele> getExtFieldConfigs() {
-			return extFieldConfigs;
-		}
-
-		public void setExtFieldConfigs(List<WoExtFieldRele> extFieldConfigs) {
-			this.extFieldConfigs = extFieldConfigs;
-		}
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getDetail() {
-			return detail;
-		}
-
-		public void setDetail(String detail) {
-			this.detail = detail;
-		}
-
-		public String getDescription() {
-			return description;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskExtField extends TaskExtField {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskExtField, WoTaskExtField> copier = WrapCopierFactory.wo( TaskExtField.class, WoTaskExtField.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class WoExtFieldRele{
-
-		@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";
-		
-		@FieldDescribe("选择荐的备选数据,数据Json, displayType=SELECT|MUTISELECT时必须填写,否则无选择项")
-		private String optionsData;
-		
-		@FieldDescribe("排序号(非必填)")
-		private Integer order= 0 ;
-
-		@FieldDescribe("是否允许为空(非必填)")
-		private Boolean nullable = true ;
-
-		@FieldDescribe("说明信息(非必填)")
-		private String description;
-		
-		@FieldDescribe("属性值")
-		private String value = "";
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<CustomExtFieldRele, WoExtFieldRele> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, WoExtFieldRele.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-		public String getExtFieldName() {
-			return extFieldName;
-		}
-
-		public void setExtFieldName(String extFieldName) {
-			this.extFieldName = extFieldName;
-		}
-
-		public String getDisplayName() {
-			return displayName;
-		}
-
-		public void setDisplayName(String displayName) {
-			this.displayName = displayName;
-		}
-		
-		public String getType() {
-			return type;
-		}
-
-		public void setType(String type) {
-			this.type = type;
-		}
-
-		public String getCorrelationId() {
-			return correlationId;
-		}
-
-		public void setCorrelationId(String correlationId) {
-			this.correlationId = correlationId;
-		}
-
-		public String getDisplayType() {
-			return displayType;
-		}
-
-		public void setDisplayType(String displayType) {
-			this.displayType = displayType;
-		}
-
-		public String getOptionsData() {
-			return optionsData;
-		}
-
-		public void setOptionsData(String optionsData) {
-			this.optionsData = optionsData;
-		}
-
-		public Integer getOrder() {
-			return order;
-		}
-
-		public void setOrder(Integer order) {
-			this.order = order;
-		}
-
-		public Boolean getNullable() {
-			return nullable;
-		}
-
-		public void setNullable(Boolean nullable) {
-			this.nullable = nullable;
-		}
-
-		public String getDescription() {
-			return description;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-
-		public String getValue() {
-			return value;
-		}
-
-		public void setValue(String value) {
-			this.value = value;
-		}
-	}
-}

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

@@ -1,219 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.assemble.control.jaxrs.task.ActionListWithTaskList.WoSubTask;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-
-import net.sf.ehcache.Element;
-
-public class ActionListMyTaskWithTaskList extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListMyTaskWithTaskList.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String projectId, String taskListId ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		List<TaskTag> tags = null;
-		List<Task> subTasks = null;
-		WrapOutControl control = null;
-		
-		if ( StringUtils.isEmpty( taskListId ) ) {
-			check = false;
-			Exception exception = new TaskListIdForQueryEmptyException( );
-			result.error(exception);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListMyTaskWithTaskList", taskListId );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					List<Task>  taskList = taskQueryService.listMyTaskWithTaskListId( projectId, taskListId, effectivePerson.getDistinguishedName() );
-					Long total = 0L;
-					if( ListTools.isNotEmpty( taskList )) {
-						total = Long.parseLong( taskList.size() + "" );
-						wos = Wo.copier.copy(taskList);
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							//添加一级子任务信息
-							subTasks = taskQueryService.listTaskWithParentId( wo.getId(), effectivePerson );
-							if( ListTools.isNotEmpty( subTasks )) {
-								wo.setSubTasks( WoSubTask.copier.copy( subTasks ));
-							}
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}
-					
-					resultObject = new ResultObject( total, wos );
-					//taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-	
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("一级子任务")
-		private List<WoSubTask> subTasks = null;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		public List<WoSubTask> getSubTasks() {
-			return subTasks;
-		}
-
-		public void setSubTasks(List<WoSubTask> subTasks) {
-			this.subTasks = subTasks;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

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

@@ -1,252 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.assemble.control.jaxrs.task.ActionListWithTaskList.WoSubTask;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Wi wrapIn = null;		
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		List<TaskTag> tags = null;
-		QueryFilter  queryFilter = null;
-		List<Task> subTasks = null;
-		WrapOutControl control = null;
-		
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-		
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			wrapIn.setDeleted("false");
-			queryFilter = wrapIn.getQueryFilter();
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionListNext", effectivePerson.getDistinguishedName(),  
-					flag, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					List<String> taskIds = null;
-					if( StringUtils.isNotEmpty(  wrapIn.getTag() )) {
-						//查询该拥有该Tag的TaskId列表
-						taskIds = taskTagQueryService.listTaskIdsWithTagContent( wrapIn.getTag(), null,  effectivePerson.getDistinguishedName() );
-						if( ListTools.isEmpty( taskIds )) {
-							taskIds = new ArrayList<>();
-							taskIds.add( "NoOne" );
-						}
-						queryFilter.addInTerm( new InTerm("id", new ArrayList<>(taskIds)) );
-					}
-					
-					Long total = taskQueryService.countWithFilter( effectivePerson, queryFilter );
-					List<Task>  taskList = taskQueryService.listWithFilter( effectivePerson, count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter );
-					
-					if( ListTools.isNotEmpty( taskList )) {
-						wos = Wo.copier.copy(taskList);
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							//添加一级子任务信息
-							subTasks = taskQueryService.listTaskWithParentId( wo.getId(), effectivePerson );
-							if( ListTools.isNotEmpty( subTasks )) {
-								wo.setSubTasks( WoSubTask.copier.copy( subTasks ));
-							}
-							
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );									
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}
-					
-					resultObject = new ResultObject( total, wos );
-					taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}		
-		}
-		return result;
-	}
-	
-	public static class Wi extends WrapInQueryTask{
-	}
-	
-	public static class Wo extends Task {
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		@FieldDescribe("一级子任务")
-		private List<WoSubTask> subTasks = null;
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		public List<WoSubTask> getSubTasks() {
-			return subTasks;
-		}
-
-		public void setSubTasks(List<WoSubTask> subTasks) {
-			this.subTasks = subTasks;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

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

@@ -1,248 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.assemble.control.jaxrs.task.ActionListWithTaskList.WoSubTask;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.InTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionListPageWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListPageWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, Integer pageNum, Integer pageSize, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();		
-		List<Wo> wos = new ArrayList<>();
-		ResultObject resultObject = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		QueryFilter  queryFilter = null;
-		List<TaskTag> tags = null;
-		List<Task> subTasks = null;
-		WrapOutControl control = null;
-		
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		wrapIn.setDeleted("false");
-		if( Boolean.TRUE.equals( check ) ){
-			if( Boolean.TRUE.equals( check ) ){
-				queryFilter = wrapIn.getQueryFilter();
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionListPage", effectivePerson.getDistinguishedName(), 
-					pageNum, pageSize, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {	
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					List<String> taskIds = null;
-					if( StringUtils.isNotEmpty(  wrapIn.getTag() )) {
-						//查询该拥有该Tag的TaskId列表
-						taskIds = taskTagQueryService.listTaskIdsWithTagContent( wrapIn.getTag(), null,  effectivePerson.getDistinguishedName() );
-						if( ListTools.isEmpty( taskIds )) {
-							taskIds = new ArrayList<>();
-							taskIds.add( "NoOne" );
-						}
-						queryFilter.addInTerm( new InTerm("id", new ArrayList<>(taskIds)) );
-					}
-					Long total = taskQueryService.countWithFilter( effectivePerson, queryFilter );
-					List<Task> taskList = taskQueryService.listWithFilter( effectivePerson, pageSize, pageNum, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter );
-					
-					if( ListTools.isNotEmpty( taskList )) {
-						wos = Wo.copier.copy(taskList);
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							//添加一级子任务信息
-							subTasks = taskQueryService.listTaskWithParentId( wo.getId(), effectivePerson );
-							if( ListTools.isNotEmpty( subTasks )) {
-								wo.setSubTasks( WoSubTask.copier.copy( subTasks ));
-							}
-							
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}
-
-					resultObject = new ResultObject( total, wos );
-					taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询工作任务信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}		
-		}
-		return result;
-	}
-	
-	public static class Wi extends WrapInQueryTask{
-	}
-	
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		@FieldDescribe("一级子任务")
-		private List<WoSubTask> subTasks = null;
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		public List<WoSubTask> getSubTasks() {
-			return subTasks;
-		}
-
-		public void setSubTasks(List<WoSubTask> subTasks) {
-			this.subTasks = subTasks;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

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

@@ -1,153 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-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.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.CustomExtFieldRele;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-
-public class ActionListSubTaskWithTaskId extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListSubTaskWithTaskId.class);
-
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String taskId ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wos = null;
-		Task task = null;
-		List<Task> taskList = null;
-		Boolean check = true;
-		List<TaskTag> tags = null;
-
-		if ( StringUtils.isEmpty( taskId ) ) {
-			check = false;
-			Exception exception = new TaskFlagForQueryEmptyException();
-			result.error( exception );
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				task = taskQueryService.get( taskId );
-				if ( task == null) {
-					check = false;
-					Exception exception = new TaskNotExistsException(taskId);
-					result.error( exception );
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务信息对象时发生异常。flag:" + taskId);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				taskList = taskQueryService.listTaskWithParentId( taskId, effectivePerson );
-				if( taskList == null ) {
-					taskList = new ArrayList<>();
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定flag查询子任务列表时发生异常。flag:" + taskId);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-				
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				wos = Wo.copier.copy( taskList );
-				if(ListTools.isNotEmpty( wos )) {
-					for( Wo wo : wos ) {
-						tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-						if( ListTools.isNotEmpty( tags )) {
-							wo.setTags( WoTaskTag.copier.copy( tags ));
-						}
-					}
-				}
-				result.setCount( Long.parseLong( wos.size() + "" ) );
-				result.setData( wos );
-			} catch (Exception e) {
-				Exception exception = new TaskQueryException(e, "将查询出来的工作任务信息对象转换为可输出的数据信息时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			} 
-		} 
-		
-		return result;
-	}
-
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-
-	public static class WoExtFieldRele{
-	
-		@FieldDescribe("备用列名称")
-		private String extFieldName;
-		
-		@FieldDescribe("显示属性名称")
-		private String displayName;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<CustomExtFieldRele, WoExtFieldRele> copier = WrapCopierFactory.wo( CustomExtFieldRele.class, WoExtFieldRele.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-		public String getExtFieldName() {
-			return extFieldName;
-		}
-
-		public void setExtFieldName(String extFieldName) {
-			this.extFieldName = extFieldName;
-		}
-
-		public String getDisplayName() {
-			return displayName;
-		}
-
-		public void setDisplayName(String displayName) {
-			this.displayName = displayName;
-		}
-	}
-}

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

@@ -1,231 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-
-import net.sf.ehcache.Element;
-
-public class ActionListWithTaskList extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionListWithTaskList.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String projectId, String taskListId ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		ResultObject resultObject = null;
-		List<Wo> wos = new ArrayList<>();
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		List<TaskTag> tags = null;
-		List<Task> subTasks = null;
-		WrapOutControl control = null;
-		
-		if ( StringUtils.isEmpty( taskListId ) ) {
-			check = false;
-			Exception exception = new TaskListIdForQueryEmptyException( );
-			result.error(exception);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			/*cacheKey = ApplicationCache.concreteCacheKey( "ActionListWithTaskList", taskListId );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {*/
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					List<Task>  taskList = taskQueryService.listTaskWithTaskListId( projectId, taskListId, effectivePerson.getDistinguishedName() );
-					Long total = 0L;
-					if( ListTools.isNotEmpty( taskList )) {
-						total = Long.parseLong( taskList.size() + "" );
-						wos = Wo.copier.copy(taskList);
-						
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							//添加一级子任务信息
-							subTasks = taskQueryService.listTaskWithParentId( wo.getId(), effectivePerson );
-							if( ListTools.isNotEmpty( subTasks )) {
-								wo.setSubTasks( WoSubTask.copier.copy( subTasks ));
-							}
-							
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );									
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}					
-					resultObject = new ResultObject( total, wos );
-					//taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询项目信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			//}		
-		}
-		return result;
-	}
-	
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		@FieldDescribe("一级子任务")
-		private List<WoSubTask> subTasks = null;
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-				
-		
-		public List<WoSubTask> getSubTasks() {
-			return subTasks;
-		}
-
-		public void setSubTasks(List<WoSubTask> subTasks) {
-			this.subTasks = subTasks;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class WoSubTask extends Task {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, WoSubTask> copier = WrapCopierFactory.wo( Task.class, WoSubTask.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

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

@@ -1,758 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.base.core.project.tools.ListTools;
-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.Project;
-import com.x.teamwork.core.entity.Review;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskDetail;
-import com.x.teamwork.core.entity.TaskExtField;
-import com.x.teamwork.core.entity.TaskGroup;
-import com.x.teamwork.core.entity.TaskList;
-import com.x.teamwork.core.entity.TaskStatuType;
-import com.x.teamwork.core.entity.TaskTag;
-import com.x.teamwork.core.entity.TaskView;
-
-public class ActionSave extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger(ActionSave.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Task task = null;
-		Task oldTask = null;
-		Task parentTask = null;
-		TaskDetail oldTaskDetail = null;
-		Project project = null;
-		TaskGroup taskGroup = null;
-		Wi wi = null;
-		Boolean check = true;
-		Boolean split = false;
-		Wo wo = new Wo();
-		List<Dynamic> dynamics  = new ArrayList<>();
-		List<Dynamic> tagDynamics = new ArrayList<>();
-		
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				oldTask = taskQueryService.get( wi.getId() );
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务信息对象时发生异常。ID:" + wi.getId());
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				oldTaskDetail = taskQueryService.getDetail( wi.getId() );
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务信息对象时发生异常。ID:" + wi.getId());
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( wi.getProject() ) && oldTask != null ) {
-				wi.setProject( oldTask.getProject() );
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isEmpty( wi.getTaskGroupId() ) && StringUtils.isEmpty( wi.getProject() )  ) {
-				check = false;
-				Exception exception = new TaskGroupIdAndProjectEmptyException( );
-				result.error(exception);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( StringUtils.isNotEmpty( wi.getTaskGroupId()) ) {
-				try {
-					taskGroup = taskGroupQueryService.get( wi.getTaskGroupId() );
-					if( taskGroup == null ) {
-						check = false;
-						Exception exception = new TaskPersistException( "指定的工作任务组不存在!taskGroupId:" + wi.getTaskGroupId() );
-						result.error(exception);
-					}else {
-						wi.setProject( taskGroup.getProject());
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskPersistException(e, "根据指定ID查询工作任务组信息对象时发生异常.taskGroupId:" + wi.getTaskGroupId() );
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				project = projectQueryService.get( wi.getProject() );
-				if( project == null ) {
-					check = false;
-					Exception exception = new TaskPersistException( "指定的项目信息不存在!projectID:" + wi.getProject() );
-					result.error(exception);
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskPersistException(e, "根据指定ID查询项目信息对象时发生异常.projectID:" + wi.getProject() );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if ( !taskPersistService.checkPermissionForPersist( project, effectivePerson ) ) {
-				check = false;
-				Exception exception = new TaskPersistException("task save permission denied!" );
-				result.error(exception);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( taskGroup == null ) {
-				//查询默认的全部工作的taskGroup
-				taskGroup = taskGroupQueryService.getDefaultTaskGroupWithProject( effectivePerson, project.getId() );
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			//校验parentID, 确认上级任务是否存在, parentId = "0"或者为空都不会视为工作拆解
-			if( StringUtils.isNotEmpty( wi.getParent() ) && !wi.getParent().equalsIgnoreCase( "0" ) && !wi.getParent().equalsIgnoreCase( wi.getId() )) {
-				try {
-					parentTask = taskQueryService.get( wi.getParent() );
-					if( parentTask == null ) {
-						check = false;
-						Exception exception = new TaskPersistException("parent task not exists!PID=" + wi.getParent() );
-						result.error(exception);
-					}else {
-						//判断是否是新的工作拆解操作
-						if( StringUtils.isEmpty( wi.getId() ) || taskQueryService.get( wi.getId() ) == null ) {
-							split = true; //新增下级任务
-						}
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务信息对象时发生异常。ID:" + wi.getParent());
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}		
-		
-		if( Boolean.TRUE.equals( check ) ){
-			//如果是标识为已完成,那么需要判断一下,该任务的所有下级任务是否全部都已经完成,否则不允许标识为已完成
-			if( TaskStatuType.completed.name().equalsIgnoreCase( wi.getWorkStatus() )) {
-				List<Task> unCompletedTasks =  taskQueryService.allUnCompletedSubTasks( wi.getId() );
-				if( ListTools.isNotEmpty( unCompletedTasks )) {
-					check = false;
-					Exception exception = new TaskPersistException( "当前任务还有"+ unCompletedTasks.size() +"个子任务未完成,暂无法设定为已完成任务。");
-					result.error(exception);
-				}
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			TaskDetail taskDetail = new TaskDetail();
-			taskDetail.setId( wi.getId() );
-			taskDetail.setProject( project.getId() );
-			taskDetail.setDescription( wi.getDescription() );
-			taskDetail.setDetail( wi.getDetail() );
-			
-			TaskExtField taskExtField = new TaskExtField();
-			taskExtField.setId( wi.getId());
-			taskExtField.setProject( project.getId() );
-			taskExtField.setName( wi.getName() );
-			taskExtField.setMemoString_1( wi.getMemoString_1() );
-			taskExtField.setMemoString_2( wi.getMemoString_2() );
-			taskExtField.setMemoString_3( wi.getMemoString_3() );
-			taskExtField.setMemoString_4( wi.getMemoString_4() );
-			taskExtField.setMemoString_5( wi.getMemoString_5() );
-			taskExtField.setMemoString_6( wi.getMemoString_6() );
-			taskExtField.setMemoString_7( wi.getMemoString_7() );
-			taskExtField.setMemoString_8( wi.getMemoString_8() );
-			taskExtField.setMemoString_1_lob( wi.getMemoString_1_lob() );
-			taskExtField.setMemoString_2_lob( wi.getMemoString_2_lob() );
-			taskExtField.setMemoString_3_lob( wi.getMemoString_3_lob() );
-			taskExtField.setMemoString_4_lob( wi.getMemoString_4_lob() );
-			
-			try {	
-				wi.setProject( project.getId() );
-				task = taskPersistService.save( Wi.copier.copy(wi), taskDetail, taskExtField,  effectivePerson );
-				
-				taskListPersistService.addTaskToTaskListWithOrderNumber( task.getId(), wi.getTaskListIds(), null,  effectivePerson);
-				
-				wo.setId( task.getId() );			
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskPersistException(e, "工作任务信息保存时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		//查询该任务和任务组的绑定情况
-		if( Boolean.TRUE.equals( check ) ){
-			if( !taskGroupQueryService.existsWithTaskAndGroup( wi.getTaskGroupId(), task.getId() )){
-				//添加任务和任务组的关联
-				taskGroupPersistService.addTaskToGroup( task.getId(), wi.getTaskGroupId() );
-				taskGroupPersistService.refreshTaskCountInTaskGroupWithTaskId( effectivePerson.getDistinguishedName(), task.getId() );
-			}
-		}
-
-		//检查标签是否有变动
-		if( Boolean.TRUE.equals( check ) ){
-			//检查任务和标签的所有关联
-			List<String> tagIds = taskTagQueryService.listTagIdsWithTask( effectivePerson, task.getId() );
-			if( ListTools.isNotEmpty( wi.getTaskTagIds() )) {
-				TaskTag taskTag = null; 
-				for( String _tagId : wi.getTaskTagIds() ) {
-					try {
-						taskTag = taskTagQueryService.get( _tagId );
-						if ( taskTag == null) {
-							check = false;
-							Exception exception = new TaskTagNotExistsException( _tagId );
-							result.error( exception );
-						}
-					} catch (Exception e) {
-						check = false;
-						Exception exception = new TaskPersistException(e, "根据指定flag查询应用工作任务标签信息对象时发生异常。ID:" + _tagId);
-						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
-						break;
-					}
-					if( !tagIds.contains( _tagId )) {
-						//需要新增
-						taskTagPersistService.addTagRele( task, taskTag, effectivePerson );
-						tagDynamics.add( dynamicPersistService.addTaskTagReleDynamic( task, taskTag, effectivePerson ));
-					}
-				}
-				if( check && ListTools.isNotEmpty( tagIds )) {
-					for( String _tagId : tagIds ) {
-						if( !wi.getTaskTagIds().contains( _tagId )) {
-							try {
-								taskTag = taskTagQueryService.get( _tagId );
-								if ( taskTag == null) {
-									check = false;
-									Exception exception = new TaskTagNotExistsException( _tagId );
-									result.error( exception );
-								}
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskPersistException(e, "根据指定flag查询应用工作任务标签信息对象时发生异常。ID:" + _tagId);
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-								break;
-							}
-							//需要删除
-							taskTagPersistService.removeTagRele( task.getId(), _tagId, effectivePerson);
-							tagDynamics.add( dynamicPersistService.removeTaskTagReleDynamic( task, taskTag, effectivePerson ));
-						}
-					}
-				}
-			}else {
-				if( ListTools.isNotEmpty( tagIds )) {
-					TaskTag taskTag = null; 
-					for( String _tagId : tagIds ) {
-						try {
-							taskTag = taskTagQueryService.get( _tagId );
-							if ( taskTag == null) {
-								check = false;
-								Exception exception = new TaskTagNotExistsException( _tagId );
-								result.error( exception );
-							}
-						} catch (Exception e) {
-							check = false;
-							Exception exception = new TaskPersistException(e, "根据指定flag查询应用工作任务标签信息对象时发生异常。ID:" + _tagId);
-							result.error(exception);
-							logger.error(e, effectivePerson, request, null);
-							break;
-						}
-						//需要删除
-						taskTagPersistService.removeTagRele( task.getId(), _tagId, effectivePerson);
-						tagDynamics.add( dynamicPersistService.removeTaskTagReleDynamic( task, taskTag, effectivePerson ));
-					}
-				}
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {					
-				new BatchOperationPersistService().addOperation( 
-						BatchOperationProcessService.OPT_OBJ_TASK, 
-						BatchOperationProcessService.OPT_TYPE_PERMISSION,  task.getId(),  task.getId(), "刷新文档权限:ID=" +   task.getId() );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}	
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			//记录父工作任务拆解的动态记录
-			if( split && parentTask != null ) {
-				dynamics = new ArrayList<>();
-				try {
-					dynamics.add( dynamicPersistService.taskSplitDynamic( parentTask, task, effectivePerson ));
-				} catch (Exception e) {
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				if( oldTask == null ) {
-					MessageFactory.message_to_teamWorkCreate( task );
-				}else {
-					MessageFactory.message_to_teamWorkUpdate( task, null );
-				}
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			//记录工作任务信息变化记录
-			try {
-				if( ListTools.isNotEmpty( dynamics ) ) {
-					dynamicPersistService.taskSaveDynamic( oldTask, task, oldTaskDetail, effectivePerson,  jsonElement.toString() );
-				}else {
-					dynamics = dynamicPersistService.taskSaveDynamic( oldTask, task, oldTaskDetail, effectivePerson,  jsonElement.toString() );
-				}
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( ListTools.isEmpty( dynamics ) ) {
-			dynamics = new ArrayList<>();
-		}
-		
-		// 更新缓存
-		ApplicationCache.notify( Task.class );
-		ApplicationCache.notify( TaskList.class );
-		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 ) );
-		result.setData( wo );
-		return result;
-	}	
-
-	public static class Wi {
-		
-		public static WrapCopier<Wi, Task> copier = WrapCopierFactory.wi( Wi.class, Task.class, null, null );
-		
-		@FieldDescribe("数据库主键,非必填,自动生成.")
-		private String id;
-		
-		@FieldDescribe("所属项目ID,<font style='color:red'>必填</font>")
-		private String project;
-
-		@FieldDescribe("父级工作任务ID,非必填.")
-		private String parent;	
-
-		@FieldDescribe("工作任务名称(40字),<font style='color:red'>必填</font>")
-		private String name;
-
-		@FieldDescribe("工作任务概括(80字),非必填")
-		private String summay;
-
-		@FieldDescribe("工作开始时间,非必填")
-		private Date startTime;
-
-		@FieldDescribe("工作开始时间,非必填")
-		private Date endTime;
-		
-		@FieldDescribe("工作状态:processing | completed,非必填,默认processing")
-		private String workStatus = "processing";
-
-		@FieldDescribe("工作优先级:普通 | 紧急 | 特急 ,非必填")
-		private String priority;
-
-		@FieldDescribe("提醒关联任务,非必填")
-		private Boolean remindRelevance;
-		
-		@FieldDescribe("执行者和负责人,<font style='color:red'>必填</font>")
-		private String executor;	
-		
-		@FieldDescribe("执行者|负责人身份,非必填,若有则以identity为准")
-		private String executorIdentity;	
-		
-		@FieldDescribe("工作内容(128K),非必填")
-		private String detail;
-		
-		@FieldDescribe("说明信息(10M),非必填")
-		private String description;		
-		
-		@FieldDescribe("工作任务组ID,非必填,与taskListIds必须填写一种")
-		private String taskGroupId;
-		
-		@FieldDescribe("任务默认归类的任务列表ID,非必填,与taskGroupId必须填写一种")
-		private List<String> taskListIds;
-		
-		@FieldDescribe("工作任务标签ID列表,非必填")
-		private List<String> taskTagIds;
-		
-		@FieldDescribe("工作任务参与者,非必填")
-		private List<String> participantList;
-
-		@FieldDescribe("工作任务管理者,非必填")
-		private List<String> manageablePersonList;		
-
-		@FieldDescribe("备用属性1(最大长度:255)")
-		private String memoString_1 = "";
-
-		@FieldDescribe("备用属性2(最大长度:255)")
-		private String memoString_2 = "";	
-		
-		@FieldDescribe("备用属性3(最大长度:255)")
-		private String memoString_3 = "";	
-
-		@FieldDescribe("备用属性4(最大长度:255)")
-		private String memoString_4 = "";
-		
-		@FieldDescribe("备用属性5(最大长度:255)")
-		private String memoString_5 = "";
-
-		@FieldDescribe("备用属性6(最大长度:255)")
-		private String memoString_6 = "";
-
-		@FieldDescribe("备用属性7(最大长度:255)")
-		private String memoString_7 = "";
-
-		@FieldDescribe("备用属性8(最大长度:255)")
-		private String memoString_8 = "";
-
-		@FieldDescribe("备用长文本1(最大长度:10M)")
-		private String memoString_1_lob = "";
-
-		@FieldDescribe("备用长文本2(最大长度:10M)")
-		private String memoString_2_lob = "";
-
-		@FieldDescribe("备用长文本3(最大长度:10M)")
-		private String memoString_3_lob = "";
-		
-		@FieldDescribe("备用长文本4(最大长度:10M)")
-		private String memoString_4_lob = "";
-		
-		public List<String> getTaskTagIds() {
-			return taskTagIds;
-		}
-
-		public void setTaskTagIds(List<String> taskTagIds) {
-			this.taskTagIds = taskTagIds;
-		}
-
-		public List<String> getParticipantList() {
-			return participantList;
-		}
-
-		public void setParticipantList(List<String> participantList) {
-			this.participantList = participantList;
-		}
-
-		public List<String> getManageablePersonList() {
-			return manageablePersonList;
-		}
-
-		public void setManageablePersonList(List<String> manageablePersonList) {
-			this.manageablePersonList = manageablePersonList;
-		}
-
-		public String getWorkStatus() {
-			return workStatus;
-		}
-
-		public void setWorkStatus(String workStatus) {
-			this.workStatus = workStatus;
-		}
-
-		public String getDetail() {
-			return detail;
-		}
-
-		public void setDetail(String detail) {
-			this.detail = detail;
-		}
-
-		public String getDescription() {
-			return description;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-
-		public List<String> getTaskListIds() {
-			return taskListIds;
-		}
-
-		public void setTaskListIds(List<String> taskListIds) {
-			this.taskListIds = taskListIds;
-		}
-
-		public String getTaskGroupId() {
-			return taskGroupId;
-		}
-
-		public void setTaskGroupId(String taskGroupId) {
-			this.taskGroupId = taskGroupId;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getProject() {
-			return project;
-		}
-
-		public void setProject(String project) {
-			this.project = project;
-		}
-
-		public String getParent() {
-			return parent;
-		}
-
-		public void setParent(String parent) {
-			this.parent = parent;
-		}
-
-		public String getName() {
-			return name;
-		}
-
-		public void setName(String name) {
-			this.name = name;
-		}
-
-		public String getSummay() {
-			return summay;
-		}
-
-		public void setSummay(String summay) {
-			this.summay = summay;
-		}
-
-		public Date getStartTime() {
-			return startTime;
-		}
-
-		public void setStartTime(Date startTime) {
-			this.startTime = startTime;
-		}
-
-		public Date getEndTime() {
-			return endTime;
-		}
-
-		public void setEndTime(Date endTime) {
-			this.endTime = endTime;
-		}
-
-		public String getPriority() {
-			return priority;
-		}
-
-		public void setPriority(String priority) {
-			this.priority = priority;
-		}
-
-		public Boolean getRemindRelevance() {
-			return remindRelevance;
-		}
-
-		public void setRemindRelevance(Boolean remindRelevance) {
-			this.remindRelevance = remindRelevance;
-		}
-
-		public String getExecutor() {
-			return executor;
-		}
-
-		public void setExecutor(String executor) {
-			this.executor = executor;
-		}
-
-		public String getExecutorIdentity() {
-			return executorIdentity;
-		}
-
-		public void setExecutorIdentity(String executorIdentity) {
-			this.executorIdentity = executorIdentity;
-		}
-
-		public String getMemoString_1() {
-			return memoString_1;
-		}
-
-		public void setMemoString_1(String memoString_1) {
-			this.memoString_1 = memoString_1;
-		}
-
-		public String getMemoString_2() {
-			return memoString_2;
-		}
-
-		public void setMemoString_2(String memoString_2) {
-			this.memoString_2 = memoString_2;
-		}
-
-		public String getMemoString_3() {
-			return memoString_3;
-		}
-
-		public void setMemoString_3(String memoString_3) {
-			this.memoString_3 = memoString_3;
-		}
-
-		public String getMemoString_4() {
-			return memoString_4;
-		}
-
-		public void setMemoString_4(String memoString_4) {
-			this.memoString_4 = memoString_4;
-		}
-
-		public String getMemoString_5() {
-			return memoString_5;
-		}
-
-		public void setMemoString_5(String memoString_5) {
-			this.memoString_5 = memoString_5;
-		}
-
-		public String getMemoString_6() {
-			return memoString_6;
-		}
-
-		public void setMemoString_6(String memoString_6) {
-			this.memoString_6 = memoString_6;
-		}
-
-		public String getMemoString_7() {
-			return memoString_7;
-		}
-
-		public void setMemoString_7(String memoString_7) {
-			this.memoString_7 = memoString_7;
-		}
-
-		public String getMemoString_8() {
-			return memoString_8;
-		}
-
-		public void setMemoString_8(String memoString_8) {
-			this.memoString_8 = memoString_8;
-		}
-
-		public String getMemoString_1_lob() {
-			return memoString_1_lob;
-		}
-
-		public void setMemoString_1_lob(String memoString_1_lob) {
-			this.memoString_1_lob = memoString_1_lob;
-		}
-
-		public String getMemoString_2_lob() {
-			return memoString_2_lob;
-		}
-
-		public void setMemoString_2_lob(String memoString_2_lob) {
-			this.memoString_2_lob = memoString_2_lob;
-		}
-
-		public String getMemoString_3_lob() {
-			return memoString_3_lob;
-		}
-
-		public void setMemoString_3_lob(String memoString_3_lob) {
-			this.memoString_3_lob = memoString_3_lob;
-		}
-
-		public String getMemoString_4_lob() {
-			return memoString_4_lob;
-		}
-
-		public void setMemoString_4_lob(String memoString_4_lob) {
-			this.memoString_4_lob = memoString_4_lob;
-		}
-
-	}
-
-	public static class Wo extends WoId {
-		
-		@FieldDescribe("操作引起的动态内容")
-		List<WoDynamic> dynamics = new ArrayList<>();
-
-		public List<WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-		
-	}
-	
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, WoDynamic.class, null, JpaObject.FieldsInvisible);
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}		
-	}
-	
-}

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

@@ -1,428 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.base.core.project.tools.ListTools;
-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.CustomExtFieldRele;
-import com.x.teamwork.core.entity.Review;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskDetail;
-import com.x.teamwork.core.entity.TaskExtField;
-import com.x.teamwork.core.entity.TaskStatuType;
-
-public class ActionUpdateSingleProperty extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionUpdateSingleProperty.class );
-
-	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson, String taskId, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Task newTask = null;
-		Task oldTask = null;
-		TaskDetail oldDetail = null;
-		TaskExtField oldExtField = null;
-		Wi wi = null;
-		Wo wo = new Wo();
-		Boolean check = true;
-		Dynamic dynamicInfo = new Dynamic();
-		List<Dynamic> dynamics = null;
-
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskPersistException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				oldTask = taskQueryService.get( taskId );
-				if( oldTask == null ) {
-					check = false;
-					Exception exception = new TaskNotExistsException(taskId);
-					result.error(exception);
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务信息对象时发生异常。ID:" + taskId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				oldDetail = taskQueryService.getDetail( taskId );
-				if( oldDetail == null ) {
-					oldDetail = new  TaskDetail();
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务信息对象时发生异常。ID:" + taskId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				oldExtField = taskQueryService.getExtField( taskId );
-				if( oldExtField == null ) {
-					oldExtField = new TaskExtField();
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskQueryException(e, "根据指定ID查询工作任务扩展属性信息对象时发生异常。ID:" + taskId );
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			//如果是标识为已完成,那么需要判断一下,该任务的所有下级任务是否全部都已经完成,否则不允许标识为已完成
-			if( Task.workStatus_FIELDNAME.equalsIgnoreCase(wi.getProperty()) && TaskStatuType.completed.name().equalsIgnoreCase( wi.getMainValue().toString() )) {
-				List<Task> unCompletedTasks =  taskQueryService.allUnCompletedSubTasks( taskId );
-				if( ListTools.isNotEmpty( unCompletedTasks )) {
-					check = false;
-					Exception exception = new TaskPersistException( "当前任务还有"+ unCompletedTasks.size() +"个子任务未完成,暂无法设定为已完成任务。");
-					result.error(exception);
-				}
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				if( TaskDetail.description_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "任务说明", "UPDATE_DESCRIPTION", 
-							wi.getProperty(), oldDetail.getDescription(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), true );
-				} else  if( TaskDetail.detail_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "详细内容", "UPDATE_DETAIL", 
-							wi.getProperty(), oldDetail.getDetail(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), true );
-				}  else if( Task.workStatus_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "任务状态", "UPDATE_WORKSTATUS", 
-							wi.getProperty(), oldTask.getWorkStatus(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), false );
-				} else if( Task.priority_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "优先级", "UPDATE_PRIORITY", 
-							wi.getProperty(), oldTask.getPriority(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), false );
-				}   else if( Task.name_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "任务名称", "UPDATE_NAME", 
-							wi.getProperty(), oldTask.getName(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), false );
-				}   else if( Task.executor_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "工作负责人", "UPDATE_EXECUTOR", 
-							wi.getProperty(), oldTask.getExecutor(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), false );
-					//也要给新的工作负责人发送通知
-					newTask = taskQueryService.get( taskId );
-				} else if( Task.startTime_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "任务开始日期", "UPDATE_STARTDATE", 
-							wi.getProperty(), oldTask.getExecutor(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), false );	
-				} else if( Task.endTime_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, "任务截止日期", "UPDATE_WORKDATE", 
-							wi.getProperty(), oldTask.getExecutor(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType(), false );
-				} else if( TaskExtField.memoString_1_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_1(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else if( TaskExtField.memoString_2_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_2(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else if( TaskExtField.memoString_3_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_3(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else if( TaskExtField.memoString_4_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_4(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else if( TaskExtField.memoString_5_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_5(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else if( TaskExtField.memoString_6_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_6(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else if( TaskExtField.memoString_7_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_7(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else if( TaskExtField.memoString_8_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_8(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				}  else if( TaskExtField.memoString_1_lob_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_1_lob(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				}  else if( TaskExtField.memoString_2_lob_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_2_lob(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				}  else if( TaskExtField.memoString_3_lob_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_3_lob(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				}  else if( TaskExtField.memoString_4_lob_FIELDNAME.equalsIgnoreCase( wi.getProperty() )) {
-					dynamicInfo = changeExtTaskProperty( 
-							effectivePerson.getName(), oldTask.getProject(), taskId, wi.getProperty(), oldExtField.getMemoString_4_lob(), wi.getMainValue(), wi.getSecondaryValue(), wi.getDataType() );
-				} else {
-					check = false;
-					Exception exception = new TaskPersistException( "工作任务属性暂不支持属性名称:" + wi.getProperty() );
-					result.error(exception);
-				}
-				
-				// 缓存
-				ApplicationCache.notify( Task.class );
-				ApplicationCache.notify( Review.class );					
-				
-				wo.setId( taskId );			
-				
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new TaskPersistException(e, "工作任务信息保存时发生异常。");
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if( Boolean.TRUE.equals( check ) ){
-			try {					
-				new BatchOperationPersistService().addOperation( 
-						BatchOperationProcessService.OPT_OBJ_TASK, 
-						BatchOperationProcessService.OPT_TYPE_PERMISSION,  oldTask.getId(),  oldTask.getId(), "变更任务信息,刷新Review:ID=" +   taskId );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}	
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			try {
-				MessageFactory.message_to_teamWorkUpdate( oldTask, newTask );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			//记录工作任务属性信息变化记录
-			try {
-				dynamics = dynamicPersistService.taskUpdatePropertyDynamic( oldTask,  dynamicInfo.getTitle(), dynamicInfo.getOptType(), dynamicInfo.getDescription(), effectivePerson );
-			} catch (Exception e) {
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		
-		if( ListTools.isNotEmpty( dynamics ) ) {
-			wo.setDynamics( WoDynamic.copier.copy( dynamics ) );
-		}
-		result.setData( wo );
-		return result;
-	}	
-
-	private Dynamic changeTaskProperty( String personName,  String projectId, String taskId, String dynamicTitle, String dynamicOptType, String property, String oldValue, String mainValue, String secondaryValue, String dataType, Boolean nullable ) throws Exception {
-		
-		taskPersistService.changeTaskProperty( taskId, property, mainValue, secondaryValue );
-		if(Task.priority_FIELDNAME.equalsIgnoreCase( property )){
-			mainValue = mainValue.split("\\|\\|")[0];
-		}
-		if(mainValue.equals("completed")){
-			mainValue = "已完成";
-		}
-		if(mainValue.equals("processing")){
-			mainValue = "执行中";
-		}
-		String dynamicDescription =  personName + "将工作任务的[" + dynamicTitle + "]变更为:[" + mainValue + "]。";
-		if(  StringUtils.isEmpty( mainValue ) && nullable ) {
-			Exception exception = new TaskPersistException( "工作任务属性["+ dynamicTitle +"]不允许为空,请检查您的输入。");
-			throw exception;
-		}
-		if(  StringUtils.isEmpty( mainValue ) ) {
-			if( StringUtils.isNotEmpty( oldValue )) {
-				dynamicDescription = personName + "清除了工作任务的["+dynamicTitle+"]信息["+ transferOrganNameToShort(oldValue) +"]。";		
-			}
-		}else {
-			if(  StringUtils.isEmpty( oldValue ) ) {
-				if( "RichText".equalsIgnoreCase(dataType )) {
-					dynamicDescription =personName + "设置了工作任务属性["+ dynamicTitle +"]为:["+ transferOrganNameToShort(secondaryValue) +"]。";			
-				}else {
-					dynamicDescription = personName + "设置了工作任务属性["+ dynamicTitle +"]为:["+ transferOrganNameToShort(mainValue) +"]。";			
-				}
-			}else {
-				if( "RichText".equalsIgnoreCase(dataType )) {
-					dynamicDescription =personName + "将工作任务属性["+ dynamicTitle +"]变更为:["+ transferOrganNameToShort(secondaryValue) +"]。";			
-				}else {
-					dynamicDescription = personName + "将工作任务属性["+ dynamicTitle +"]变更为:["+ transferOrganNameToShort(mainValue) +"]。";			
-				}	
-			}
-		}
-		//taskPersistService.changeTaskProperty( taskId, property, mainValue, secondaryValue );
-		
-		Dynamic dynamic_info = new Dynamic();
-		dynamic_info.setTitle( dynamicTitle  );
-		dynamic_info.setOptType( dynamicOptType );
-		dynamic_info.setDescription( dynamicDescription );
-		return dynamic_info;
-	}
-	
-	private Dynamic changeExtTaskProperty( String personName,  String projectId, String taskId, String property, String oldValue, String mainValue, String secondaryValue, String dataType ) throws Exception {
-		CustomExtFieldRele projectExtFieldRele = customExtFieldReleQueryService.getExtFieldRele(projectId, property);
-		if( projectExtFieldRele == null || StringUtils.isEmpty( projectExtFieldRele.getDisplayName() )) {
-			Exception exception = new TaskPersistException( "工作任务未配置扩展属性:" + property );
-			throw exception;
-		}
-		
-		String dynamicTitle = projectExtFieldRele.getDisplayName();
-		String dynamicOptType = "UPDATE_EXTFIELD";
-		String dynamicDescription = personName + "将工作任务的[" + dynamicTitle + "]变更为:[" + mainValue + "]。";
-		if(  StringUtils.isEmpty( mainValue ) && projectExtFieldRele.getNullable() ) {
-			Exception exception = new TaskPersistException( "工作任务属性["+ dynamicTitle +"]不允许为空,请检查您的输入。");
-			throw exception;
-		}
-		
-		if(  StringUtils.isEmpty( mainValue ) ) {
-			if( StringUtils.isNotEmpty( oldValue )) {
-				dynamicDescription = personName + "清除了工作任务的["+dynamicTitle+"]信息["+ transferOrganNameToShort(oldValue) +"]。";		
-			}
-		}else {
-			if(  StringUtils.isEmpty( oldValue ) ) {
-				if( "RichText".equalsIgnoreCase(dataType )) {
-					dynamicDescription =personName + "设置了工作任务属性["+ dynamicTitle +"]为:["+ transferOrganNameToShort(secondaryValue) +"]。";			
-				}else {
-					dynamicDescription = personName + "设置了工作任务属性["+ dynamicTitle +"]为:["+ transferOrganNameToShort(mainValue) +"]。";			
-				}
-			}else {
-				if( "RichText".equalsIgnoreCase(dataType )) {
-					dynamicDescription =personName + "将工作任务属性["+ dynamicTitle +"]变更为:["+ transferOrganNameToShort(secondaryValue) +"]。";			
-				}else {
-					dynamicDescription = personName + "将工作任务属性["+ dynamicTitle +"]变更为:["+ transferOrganNameToShort(mainValue) +"]。";			
-				}	
-			}
-		}
-		taskPersistService.changeTaskProperty( taskId, property, mainValue, secondaryValue );
-		
-		Dynamic dynamic_info = new Dynamic();
-		dynamic_info.setTitle( dynamicTitle  );
-		dynamic_info.setOptType( dynamicOptType );
-		dynamic_info.setDescription( dynamicDescription );
-		return dynamic_info;
-	}
-	
-	/**
-	 * 将值里的所有数据中组织类别相关的数据改成简称,人员,身份,组织,群组等,适应列表数据(使用##分隔)
-	 * @param oldValue
-	 * @return
-	 */
-	private String transferOrganNameToShort(String oldValue) {
-		String[] array = oldValue.split("##");
-		StringBuffer sb = new StringBuffer();
-		if( array != null && array.length > 0) {
-			for( int i = 0; i< array.length; i++ ) {
-				if( i == 0) {
-					sb.append( array[i].split("@")[0]);
-				}else {
-					sb.append("##").append( array[i].split("@")[0]);
-				}
-			}
-		}
-		return sb.toString();
-	}
-
-	public static class Wi {
-		
-		public static WrapCopier<Wi, Task> copier = WrapCopierFactory.wi( Wi.class, Task.class, null, null );
-		
-		@FieldDescribe("需要修改的属性标识,<font style='color:red'>必填</font>。" )
-		private String property;
-
-		@FieldDescribe("属性的主要值,<font style='color:red'>必填</font>")
-		private String mainValue;
-
-		@FieldDescribe("属性次要值,如果工作任务时间中的结束时间,非必填")
-		private String secondaryValue;
-		
-		@FieldDescribe("值的类别Number|Text|RichText,默认Text,如果是RichText, secondaryValue需要填写去除标签的文字内容(<70字),会记录到动态内容")
-		private String dataType ="Text";
-				
-		public String getDataType() {
-			return dataType;
-		}
-
-		public void setDataType(String dataType) {
-			this.dataType = dataType;
-		}
-
-		public String getProperty() {
-			return property;
-		}
-
-		public void setProperty(String property) {
-			this.property = property;
-		}
-
-		public String getMainValue() {
-			return mainValue;
-		}
-
-		public void setMainValue(String mainValue) {
-			this.mainValue = mainValue;
-		}
-
-		public String getSecondaryValue() {
-			return secondaryValue;
-		}
-
-		public void setSecondaryValue(String secondaryValue) {
-			this.secondaryValue = secondaryValue;
-		}
-	}
-
-	public static class Wo extends WoId {
-		
-		@FieldDescribe("操作引起的动态内容")
-		List<WoDynamic> dynamics = new ArrayList<>();
-
-		public List<WoDynamic> getDynamics() {
-			return dynamics;
-		}
-
-		public void setDynamics(List<WoDynamic> dynamics) {
-			this.dynamics = dynamics;
-		}
-		
-	}
-	
-	public static class WoDynamic extends Dynamic{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static WrapCopier<Dynamic, WoDynamic> copier = WrapCopierFactory.wo( Dynamic.class, WoDynamic.class, null, null);
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}		
-	}
-	
-}

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

@@ -1,426 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsFalseTerm;
-import com.x.teamwork.core.entity.tools.filter.term.LikeTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionViewAllListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionViewAllListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, String projectId, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();		
-		List<Wo> wos = new ArrayList<>();
-		ResultObject resultObject = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		QueryFilter  queryFilter = null;
-		List<TaskTag> tags = null; 
-		WrapOutControl control = null;
-		
-		if ( StringUtils.isEmpty( projectId ) ) {
-			check = false;
-			Exception exception = new TaskProjectFlagForQueryEmptyException();
-			result.error( exception );
-		}
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-		
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( Boolean.TRUE.equals( check ) ){
-				wrapIn.setProject(projectId);
-				wrapIn.setDeleted("false");
-				queryFilter = wrapIn.getQueryFilter();
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionAllListNext", effectivePerson.getDistinguishedName(), 
-					flag, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {	
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					
-					Long total = taskQueryService.countWithFilter( effectivePerson, queryFilter );
-					List<Task> taskList = taskQueryService.listWithFilter( effectivePerson, count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter );
-					
-					if( ListTools.isNotEmpty( taskList )) {
-						wos = Wo.copier.copy(taskList);
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}
-
-					resultObject = new ResultObject( total, wos );
-					taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询工作任务信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}		
-		}
-		return result;
-	}
-	
-	public static class Wi extends  GsonPropertyObject{
-		@FieldDescribe("用于排列的属性,非必填,默认为createTime.")
-		private String orderField = "createTime";
-
-		@FieldDescribe("排序方式:DESC | ASC,非必填,默认为DESC.")
-		private String orderType = "DESC";
-		
-		@FieldDescribe("用于搜索的标题,单值,非必填.")
-		private String title = null;
-		
-		private String project = null;
-		
-		@FieldDescribe("用于搜索的上级工作任务ID,单值,非必填.")
-		private String parentId = null;
-		
-		@FieldDescribe("用于搜索的工作标签:自定义标签,单值,非必填.")
-		private String tag = null;
-		
-		@FieldDescribe("工作等级:普通-normal | 紧急-urgent | 特急-extraurgent,单值,非必填")
-		private String priority = null;		
-		
-		@FieldDescribe("用于搜索的工作状态:草稿- draft  | 执行中- processing | 已完成- completed | 已归档- archived,单值,非必填")
-		private String workStatus = null;
-		
-		@FieldDescribe("是否已完成,true|false,非必填")
-		private String completed = null;		
-
-		@FieldDescribe("是否已超时,true|false,非必填")
-		private String overtime = null;		
-		
-		@FieldDescribe("是否已经删除,true|false,非必填")
-		private String deleted = null;		
-		
-		@FieldDescribe("执行者或者负责人,单值,非必填")
-		private String executor = null;		
-
-		private Long rank = 0L;
-
-		public String getOrderField() {
-			return orderField;
-		}
-
-		public void setOrderField(String orderField) {
-			this.orderField = orderField;
-		}
-
-		public String getOrderType() {
-			return orderType;
-		}
-
-		public void setOrderType(String orderType) {
-			this.orderType = orderType;
-		}
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getProject() {
-			return project;
-		}
-
-		public void setProject(String project) {
-			this.project = project;
-		}
-
-		public String getParentId() {
-			return parentId;
-		}
-
-		public void setParentId(String parentId) {
-			this.parentId = parentId;
-		}
-
-		public String getTag() {
-			return tag;
-		}
-
-		public void setTag(String tag) {
-			this.tag = tag;
-		}
-
-		public String getPriority() {
-			return priority;
-		}
-
-		public void setPriority(String priority) {
-			this.priority = priority;
-		}
-
-		public String getWorkStatus() {
-			return workStatus;
-		}
-
-		public void setWorkStatus(String workStatus) {
-			this.workStatus = workStatus;
-		}
-
-		public String getCompleted() {
-			return completed;
-		}
-
-		public void setCompleted(String completed) {
-			this.completed = completed;
-		}
-
-		public String getOvertime() {
-			return overtime;
-		}
-
-		public void setOvertime(String overtime) {
-			this.overtime = overtime;
-		}
-
-		public String getDeleted() {
-			return deleted;
-		}
-
-		public void setDeleted(String deleted) {
-			this.deleted = deleted;
-		}
-
-		public String getExecutor() {
-			return executor;
-		}
-
-		public void setExecutor(String executor) {
-			this.executor = executor;
-		}
-		
-		
-		/**
-		 * 根据传入的查询参数,组织一个完整的QueryFilter对象
-		 * @return
-		 */
-		public QueryFilter getQueryFilter() {
-			QueryFilter queryFilter = new QueryFilter();
-			//组织查询条件对象
-			if( StringUtils.isNotEmpty( this.getTitle() )) {
-				queryFilter.addLikeTerm( new LikeTerm( "name", "%" + this.getTitle() + "%" ) );
-			}
-			if( StringUtils.isNotEmpty( this.getProject() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "project", this.getProject() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getParentId() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "parent", this.getParentId() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getPriority())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "priority", this.getPriority() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getWorkStatus() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "workStatus", this.getWorkStatus() ) );
-			}else {
-				//默认查询所有的未归档的工作任务
-				queryFilter.addIsFalseTerm( new IsFalseTerm("archive"));
-			}
-			if( StringUtils.isNotEmpty( this.getExecutor())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "executor", this.getExecutor() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getCompleted() )) {
-				if( "true".equalsIgnoreCase( this.getCompleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getDeleted() )) {
-				if( "true".equalsIgnoreCase( this.getDeleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getOvertime() )) {
-				if( "true".equalsIgnoreCase( this.getOvertime() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", false ) );
-				}
-			}
-			return queryFilter;
-		}
-	}
-	
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

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

@@ -1,425 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsFalseTerm;
-import com.x.teamwork.core.entity.tools.filter.term.LikeTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionViewCompletedListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionViewCompletedListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, String projectId, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();		
-		List<Wo> wos = new ArrayList<>();
-		ResultObject resultObject = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		QueryFilter  queryFilter = null;
-		List<TaskTag> tags = null; 
-		WrapOutControl control = null;
-		
-		if ( StringUtils.isEmpty( projectId ) ) {
-			check = false;
-			Exception exception = new TaskProjectFlagForQueryEmptyException();
-			result.error( exception );
-		}
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-		
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( Boolean.TRUE.equals( check ) ){
-				wrapIn.setProject(projectId);
-				wrapIn.setWorkStatus("completed");
-				wrapIn.setDeleted("false");
-				queryFilter = wrapIn.getQueryFilter();
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionCompletedListNext", effectivePerson.getDistinguishedName(), 
-					flag, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					
-					Long total = taskQueryService.countWithFilter( effectivePerson, queryFilter );
-					List<Task> taskList = taskQueryService.listWithFilter( effectivePerson, count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter );
-					
-					if( ListTools.isNotEmpty( taskList )) {
-						wos = Wo.copier.copy(taskList);
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );								
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}
-
-					resultObject = new ResultObject( total, wos );
-					taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询工作任务信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}		
-		}
-		return result;
-	}
-	
-	public static class Wi extends  GsonPropertyObject{
-		@FieldDescribe("用于排列的属性,非必填,默认为createTime.")
-		private String orderField = "createTime";
-
-		@FieldDescribe("排序方式:DESC | ASC,非必填,默认为DESC.")
-		private String orderType = "DESC";
-		
-		@FieldDescribe("用于搜索的标题,单值,非必填.")
-		private String title = null;
-		
-		private String project = null;
-		
-		@FieldDescribe("用于搜索的上级工作任务ID,单值,非必填.")
-		private String parentId = null;
-		
-		@FieldDescribe("用于搜索的工作标签:自定义标签,单值,非必填.")
-		private String tag = null;
-		
-		@FieldDescribe("工作等级:普通-normal | 紧急-urgent | 特急-extraurgent,单值,非必填")
-		private String priority = null;		
-		
-		private String workStatus = null;
-		
-		private String completed = null;		
-
-		@FieldDescribe("是否已超时,true|false,非必填")
-		private String overtime = null;		
-		
-		@FieldDescribe("是否已经删除,true|false,非必填")
-		private String deleted = null;		
-		
-		@FieldDescribe("执行者或者负责人,单值,非必填")
-		private String executor = null;		
-
-		private Long rank = 0L;
-
-		public String getOrderField() {
-			return orderField;
-		}
-
-		public void setOrderField(String orderField) {
-			this.orderField = orderField;
-		}
-
-		public String getOrderType() {
-			return orderType;
-		}
-
-		public void setOrderType(String orderType) {
-			this.orderType = orderType;
-		}
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getProject() {
-			return project;
-		}
-
-		public void setProject(String project) {
-			this.project = project;
-		}
-
-		public String getParentId() {
-			return parentId;
-		}
-
-		public void setParentId(String parentId) {
-			this.parentId = parentId;
-		}
-
-		public String getTag() {
-			return tag;
-		}
-
-		public void setTag(String tag) {
-			this.tag = tag;
-		}
-
-		public String getPriority() {
-			return priority;
-		}
-
-		public void setPriority(String priority) {
-			this.priority = priority;
-		}
-
-		public String getWorkStatus() {
-			return workStatus;
-		}
-
-		public void setWorkStatus(String workStatus) {
-			this.workStatus = workStatus;
-		}
-
-		public String getCompleted() {
-			return completed;
-		}
-
-		public void setCompleted(String completed) {
-			this.completed = completed;
-		}
-
-		public String getOvertime() {
-			return overtime;
-		}
-
-		public void setOvertime(String overtime) {
-			this.overtime = overtime;
-		}
-
-		public String getDeleted() {
-			return deleted;
-		}
-
-		public void setDeleted(String deleted) {
-			this.deleted = deleted;
-		}
-
-		public String getExecutor() {
-			return executor;
-		}
-
-		public void setExecutor(String executor) {
-			this.executor = executor;
-		}
-		
-		/**
-		 * 根据传入的查询参数,组织一个完整的QueryFilter对象
-		 * @return
-		 */
-		public QueryFilter getQueryFilter() {
-			QueryFilter queryFilter = new QueryFilter();
-			//组织查询条件对象
-			if( StringUtils.isNotEmpty( this.getTitle() )) {
-				queryFilter.addLikeTerm( new LikeTerm( "name", "%" + this.getTitle() + "%" ) );
-			}
-			if( StringUtils.isNotEmpty( this.getProject() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "project", this.getProject() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getParentId() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "parent", this.getParentId() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getPriority())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "priority", this.getPriority() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getWorkStatus() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "workStatus", this.getWorkStatus() ) );
-			}else {
-				//默认查询所有的未归档的工作任务
-				queryFilter.addIsFalseTerm( new IsFalseTerm("archive"));
-			}
-			if( StringUtils.isNotEmpty( this.getExecutor())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "executor", this.getExecutor() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getCompleted() )) {
-				if( "true".equalsIgnoreCase( this.getCompleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getDeleted() )) {
-				if( "true".equalsIgnoreCase( this.getDeleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getOvertime() )) {
-				if( "true".equalsIgnoreCase( this.getOvertime() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", false ) );
-				}
-			}
-			return queryFilter;
-		}
-	}
-	
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

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

@@ -1,426 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsFalseTerm;
-import com.x.teamwork.core.entity.tools.filter.term.LikeTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionViewMyExecutListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionViewMyExecutListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, String projectId, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();		
-		List<Wo> wos = new ArrayList<>();
-		ResultObject resultObject = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		QueryFilter  queryFilter = null;
-		List<TaskTag> tags = null; 
-		WrapOutControl control = null;
-		
-		if ( StringUtils.isEmpty( projectId ) ) {
-			check = false;
-			Exception exception = new TaskProjectFlagForQueryEmptyException();
-			result.error( exception );
-		}
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( Boolean.TRUE.equals( check ) ){
-				wrapIn.setProject(projectId);
-				wrapIn.setExecutor(effectivePerson.getDistinguishedName());
-				wrapIn.setDeleted("false");
-				queryFilter = wrapIn.getQueryFilter();
-				//queryFilter.addEqualsTerm( new EqualsTerm( "executor", effectivePerson.getDistinguishedName() ) );
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionMyExecutListNext", effectivePerson.getDistinguishedName(), 
-					flag, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {	
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					
-					Long total = taskQueryService.countWithFilter( effectivePerson, queryFilter );
-					List<Task> taskList = taskQueryService.listWithFilter( effectivePerson, count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter );
-					
-					if( ListTools.isNotEmpty( taskList )) {
-						wos = Wo.copier.copy(taskList);
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );									
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}
-
-					resultObject = new ResultObject( total, wos );
-					taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询工作任务信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}		
-		}
-		return result;
-	}
-	
-	public static class Wi extends GsonPropertyObject{
-		@FieldDescribe("用于排列的属性,非必填,默认为createTime.")
-		private String orderField = "createTime";
-
-		@FieldDescribe("排序方式:DESC | ASC,非必填,默认为DESC.")
-		private String orderType = "DESC";
-		
-		@FieldDescribe("用于搜索的标题,单值,非必填.")
-		private String title = null;
-		
-		private String project = null;
-		
-		@FieldDescribe("用于搜索的上级工作任务ID,单值,非必填.")
-		private String parentId = null;
-		
-		@FieldDescribe("用于搜索的工作标签:自定义标签,单值,非必填.")
-		private String tag = null;
-		
-		@FieldDescribe("工作等级:普通-normal | 紧急-urgent | 特急-extraurgent,单值,非必填")
-		private String priority = null;		
-		
-		@FieldDescribe("用于搜索的工作状态:草稿- draft  | 执行中- processing | 已完成- completed | 已归档- archived,单值,非必填")
-		private String workStatus = null;
-		
-		@FieldDescribe("是否已完成,true|false,非必填")
-		private String completed = null;		
-
-		@FieldDescribe("是否已超时,true|false,非必填")
-		private String overtime = null;		
-		
-		@FieldDescribe("是否已经删除,true|false,非必填")
-		private String deleted = null;		
-		
-		private String executor = null;		
-
-		private Long rank = 0L;
-
-		public String getOrderField() {
-			return orderField;
-		}
-
-		public void setOrderField(String orderField) {
-			this.orderField = orderField;
-		}
-
-		public String getOrderType() {
-			return orderType;
-		}
-
-		public void setOrderType(String orderType) {
-			this.orderType = orderType;
-		}
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getProject() {
-			return project;
-		}
-
-		public void setProject(String project) {
-			this.project = project;
-		}
-
-		public String getParentId() {
-			return parentId;
-		}
-
-		public void setParentId(String parentId) {
-			this.parentId = parentId;
-		}
-
-		public String getTag() {
-			return tag;
-		}
-
-		public void setTag(String tag) {
-			this.tag = tag;
-		}
-
-		public String getPriority() {
-			return priority;
-		}
-
-		public void setPriority(String priority) {
-			this.priority = priority;
-		}
-
-		public String getWorkStatus() {
-			return workStatus;
-		}
-
-		public void setWorkStatus(String workStatus) {
-			this.workStatus = workStatus;
-		}
-
-		public String getCompleted() {
-			return completed;
-		}
-
-		public void setCompleted(String completed) {
-			this.completed = completed;
-		}
-
-		public String getOvertime() {
-			return overtime;
-		}
-
-		public void setOvertime(String overtime) {
-			this.overtime = overtime;
-		}
-
-		public String getDeleted() {
-			return deleted;
-		}
-
-		public void setDeleted(String deleted) {
-			this.deleted = deleted;
-		}
-
-		public String getExecutor() {
-			return executor;
-		}
-
-		public void setExecutor(String executor) {
-			this.executor = executor;
-		}
-		
-		/**
-		 * 根据传入的查询参数,组织一个完整的QueryFilter对象
-		 * @return
-		 */
-		public QueryFilter getQueryFilter() {
-			QueryFilter queryFilter = new QueryFilter();
-			//组织查询条件对象
-			if( StringUtils.isNotEmpty( this.getTitle() )) {
-				queryFilter.addLikeTerm( new LikeTerm( "name", "%" + this.getTitle() + "%" ) );
-			}
-			if( StringUtils.isNotEmpty( this.getProject() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "project", this.getProject() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getParentId() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "parent", this.getParentId() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getPriority())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "priority", this.getPriority() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getWorkStatus() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "workStatus", this.getWorkStatus() ) );
-			}else {
-				//默认查询所有的未归档的工作任务
-				queryFilter.addIsFalseTerm( new IsFalseTerm("archive"));
-			}
-			if( StringUtils.isNotEmpty( this.getExecutor())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "executor", this.getExecutor() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getCompleted() )) {
-				if( "true".equalsIgnoreCase( this.getCompleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getDeleted() )) {
-				if( "true".equalsIgnoreCase( this.getDeleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getOvertime() )) {
-				if( "true".equalsIgnoreCase( this.getOvertime() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", false ) );
-				}
-			}
-			return queryFilter;
-		}
-	}
-	
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

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

@@ -1,425 +0,0 @@
-package com.x.teamwork.assemble.control.jaxrs.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-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.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.teamwork.assemble.control.Business;
-import com.x.teamwork.core.entity.Task;
-import com.x.teamwork.core.entity.TaskTag;
-import com.x.teamwork.core.entity.tools.filter.QueryFilter;
-import com.x.teamwork.core.entity.tools.filter.term.EqualsTerm;
-import com.x.teamwork.core.entity.tools.filter.term.IsFalseTerm;
-import com.x.teamwork.core.entity.tools.filter.term.LikeTerm;
-
-import net.sf.ehcache.Element;
-
-public class ActionViewOverTimeListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionViewOverTimeListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String flag, Integer count, String projectId, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();		
-		List<Wo> wos = new ArrayList<>();
-		ResultObject resultObject = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-		String cacheKey = null;
-		Element element = null;
-		QueryFilter  queryFilter = null;
-		List<TaskTag> tags = null; 
-		WrapOutControl control = null;
-		
-		if ( StringUtils.isEmpty( projectId ) ) {
-			check = false;
-			Exception exception = new TaskProjectFlagForQueryEmptyException();
-			result.error( exception );
-		}
-		if ( StringUtils.isEmpty( flag ) || "(0)".equals(flag)) {
-			flag = null;
-		}
-		
-		try {
-			wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-		} catch (Exception e) {
-			check = false;
-			Exception exception = new TaskQueryException(e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString());
-			result.error(exception);
-			logger.error(e, effectivePerson, request, null);
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			if( Boolean.TRUE.equals( check ) ){
-				wrapIn.setProject(projectId);
-				wrapIn.setOvertime("true");
-				wrapIn.setDeleted("false");
-				queryFilter = wrapIn.getQueryFilter();
-			}
-		}
-		
-		if( Boolean.TRUE.equals( check ) ){
-			cacheKey = ApplicationCache.concreteCacheKey( "ActionOverTimeListNext", effectivePerson.getDistinguishedName(), 
-					flag, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
-			element = taskCache.get( cacheKey );
-			
-			if ((null != element) && (null != element.getObjectValue())) {
-				resultObject = (ResultObject) element.getObjectValue();
-				result.setCount( resultObject.getTotal() );
-				result.setData( resultObject.getWos() );
-			} else {		
-				Business business = null;
-				try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
-					business = new Business(bc);
-				}
-				try {
-					
-					Long total = taskQueryService.countWithFilter( effectivePerson, queryFilter );
-					List<Task> taskList = taskQueryService.listWithFilter( effectivePerson, count, flag, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter );
-					
-					if( ListTools.isNotEmpty( taskList )) {
-						wos = Wo.copier.copy(taskList);
-						for( Wo wo : wos ) {
-							tags = taskTagQueryService.listWithTaskAndPerson(effectivePerson, wo );
-							if( ListTools.isNotEmpty( tags )) {
-								wo.setTags( WoTaskTag.copier.copy( tags ));
-							}
-							try {
-								control = new WrapOutControl();
-								if( business.isManager(effectivePerson) 
-										|| effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson() )
-										|| (ListTools.isNotEmpty(wo.getManageablePersonList()) && wo.getManageablePersonList().contains( effectivePerson.getDistinguishedName() ))){
-									control.setDelete( true );
-									control.setSortable( true );
-									control.setChangeExecutor(true);
-								}else{
-									control.setDelete( false );
-									control.setSortable( false );
-									control.setChangeExecutor(false);
-								}
-								control.setEdit( true );
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getExecutor())){
-									control.setChangeExecutor( true );
-								}
-								if(effectivePerson.getDistinguishedName().equalsIgnoreCase( wo.getCreatorPerson())){
-									control.setFounder( true );
-								}else{
-									control.setFounder( false );
-								}
-								wo.setControl(control);
-							} catch (Exception e) {
-								check = false;
-								Exception exception = new TaskQueryException(e, "根据指定flag查询工作任务权限信息时发生异常。flag:" + wo.getId());
-								result.error(exception);
-								logger.error(e, effectivePerson, request, null);
-							}
-						}
-					}
-
-					resultObject = new ResultObject( total, wos );
-					taskCache.put(new Element( cacheKey, resultObject ));
-					
-					result.setCount( resultObject.getTotal() );
-					result.setData( resultObject.getWos() );
-				} catch (Exception e) {
-					check = false;
-					logger.warn("系统查询工作任务信息列表时发生异常!");
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}		
-		}
-		return result;
-	}
-	
-	public static class Wi extends  GsonPropertyObject{
-		@FieldDescribe("用于排列的属性,非必填,默认为createTime.")
-		private String orderField = "createTime";
-
-		@FieldDescribe("排序方式:DESC | ASC,非必填,默认为DESC.")
-		private String orderType = "DESC";
-		
-		@FieldDescribe("用于搜索的标题,单值,非必填.")
-		private String title = null;
-		
-		private String project = null;
-		
-		@FieldDescribe("用于搜索的上级工作任务ID,单值,非必填.")
-		private String parentId = null;
-		
-		@FieldDescribe("用于搜索的工作标签:自定义标签,单值,非必填.")
-		private String tag = null;
-		
-		@FieldDescribe("工作等级:普通-normal | 紧急-urgent | 特急-extraurgent,单值,非必填")
-		private String priority = null;		
-		
-		@FieldDescribe("用于搜索的工作状态:草稿- draft  | 执行中- processing | 已完成- completed | 已归档- archived,单值,非必填")
-		private String workStatus = null;
-		
-		@FieldDescribe("是否已完成,true|false,非必填")
-		private String completed = null;		
-
-		private String overtime = null;		
-		
-		@FieldDescribe("是否已经删除,true|false,非必填")
-		private String deleted = null;		
-		
-		@FieldDescribe("执行者或者负责人,单值,非必填")
-		private String executor = null;		
-
-		private Long rank = 0L;
-
-		public String getOrderField() {
-			return orderField;
-		}
-
-		public void setOrderField(String orderField) {
-			this.orderField = orderField;
-		}
-
-		public String getOrderType() {
-			return orderType;
-		}
-
-		public void setOrderType(String orderType) {
-			this.orderType = orderType;
-		}
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getProject() {
-			return project;
-		}
-
-		public void setProject(String project) {
-			this.project = project;
-		}
-
-		public String getParentId() {
-			return parentId;
-		}
-
-		public void setParentId(String parentId) {
-			this.parentId = parentId;
-		}
-
-		public String getTag() {
-			return tag;
-		}
-
-		public void setTag(String tag) {
-			this.tag = tag;
-		}
-
-		public String getPriority() {
-			return priority;
-		}
-
-		public void setPriority(String priority) {
-			this.priority = priority;
-		}
-
-		public String getWorkStatus() {
-			return workStatus;
-		}
-
-		public void setWorkStatus(String workStatus) {
-			this.workStatus = workStatus;
-		}
-
-		public String getCompleted() {
-			return completed;
-		}
-
-		public void setCompleted(String completed) {
-			this.completed = completed;
-		}
-
-		public String getOvertime() {
-			return overtime;
-		}
-
-		public void setOvertime(String overtime) {
-			this.overtime = overtime;
-		}
-
-		public String getDeleted() {
-			return deleted;
-		}
-
-		public void setDeleted(String deleted) {
-			this.deleted = deleted;
-		}
-
-		public String getExecutor() {
-			return executor;
-		}
-
-		public void setExecutor(String executor) {
-			this.executor = executor;
-		}
-		
-		/**
-		 * 根据传入的查询参数,组织一个完整的QueryFilter对象
-		 * @return
-		 */
-		public QueryFilter getQueryFilter() {
-			QueryFilter queryFilter = new QueryFilter();
-			//组织查询条件对象
-			if( StringUtils.isNotEmpty( this.getTitle() )) {
-				queryFilter.addLikeTerm( new LikeTerm( "name", "%" + this.getTitle() + "%" ) );
-			}
-			if( StringUtils.isNotEmpty( this.getProject() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "project", this.getProject() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getParentId() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "parent", this.getParentId() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getPriority())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "priority", this.getPriority() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getWorkStatus() )) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "workStatus", this.getWorkStatus() ) );
-			}else {
-				//默认查询所有的未归档的工作任务
-				queryFilter.addIsFalseTerm( new IsFalseTerm("archive"));
-			}
-			if( StringUtils.isNotEmpty( this.getExecutor())) {
-				queryFilter.addEqualsTerm( new EqualsTerm( "executor", this.getExecutor() ) );
-			}
-			if( StringUtils.isNotEmpty( this.getCompleted() )) {
-				if( "true".equalsIgnoreCase( this.getCompleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "completed", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getDeleted() )) {
-				if( "true".equalsIgnoreCase( this.getDeleted() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "deleted", false ) );
-				}
-			}
-			if( StringUtils.isNotEmpty( this.getOvertime() )) {
-				if( "true".equalsIgnoreCase( this.getOvertime() )) {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", true ) );
-				}else {
-					queryFilter.addEqualsTerm( new EqualsTerm( "overtime", false ) );
-				}
-			}
-			return queryFilter;
-		}
-	}
-	
-	public static class Wo extends Task {
-
-		@FieldDescribe("任务标签")
-		private List<WoTaskTag> tags = null;
-		
-		@FieldDescribe("任务权限")
-		private WrapOutControl control = null;	
-		
-		public List<WoTaskTag> getTags() {
-			return tags;
-		}
-
-		public void setTags(List<WoTaskTag> tags) {
-			this.tags = tags;
-		}
-		
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public WrapOutControl getControl() {
-			return control;
-		}
-
-		public void setControl(WrapOutControl control) {
-			this.control = control;
-		}
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo( Task.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-	
-	public static class WoTaskTag extends TaskTag {
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		static WrapCopier<TaskTag, WoTaskTag> copier = WrapCopierFactory.wo( TaskTag.class, WoTaskTag.class, null, ListTools.toList(JpaObject.FieldsInvisible));		
-
-	}
-	
-	public static class ResultObject {
-
-		private Long total;
-		
-		private List<Wo> wos;
-
-		public ResultObject() {}
-		
-		public ResultObject(Long count, List<Wo> data) {
-			this.total = count;
-			this.wos = data;
-		}
-
-		public Long getTotal() {
-			return total;
-		}
-
-		public void setTotal(Long total) {
-			this.total = total;
-		}
-
-		public List<Wo> getWos() {
-			return wos;
-		}
-
-		public void setWos(List<Wo> wos) {
-			this.wos = wos;
-		}
-	}
-}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini