Просмотр исходного кода

Merge branch 'release' into 'develop'

Release

See merge request o2oa/o2oa!1686
o2null 5 лет назад
Родитель
Сommit
8825e4ffb8
100 измененных файлов с 0 добавлено и 14991 удалено
  1. 0 7
      o2server/pom.xml
  2. 0 129
      o2server/x_okr_assemble_control/pom.xml
  3. 0 1046
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/date/DateOperation.java
  4. 0 70
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/date/MonthOfYear.java
  5. 0 70
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/date/WeekOfYear.java
  6. 0 278
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/Excel2003Reader.java
  7. 0 232
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/Excel2007Reader.java
  8. 0 57
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/ExcelReaderUtil.java
  9. 0 13
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/IRowReader.java
  10. 0 219
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/UserModelEventListener.java
  11. 0 264
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/AbstractExcel2007Writer.java
  12. 0 63
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/Excel2003Writer.java
  13. 0 30
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/Excel2007WriterImpl.java
  14. 0 203
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/WorkReportContentExportExcelWriter.java
  15. 0 156
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/WorkReportStatusExportExcelWriter.java
  16. 0 48
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/XMLEncoder.java
  17. 0 24
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/AbstractFactory.java
  18. 0 33
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/ApplicationServletContextListener.java
  19. 0 224
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/Business.java
  20. 0 92
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/OkrUserCache.java
  21. 0 97
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/ThisApplication.java
  22. 0 42
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/webservice/WebservicesClient.java
  23. 0 25
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/webservice/sms/SmsMessage.java
  24. 0 57
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/webservice/sms/SmsMessageOperator.java
  25. 0 74
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/wftask/WfReadCountGetter.java
  26. 0 74
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/wftask/WfTaskCountGetter.java
  27. 0 251
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/workflow/WorkComplexGetter.java
  28. 0 62
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/workflow/WorkFlowReaderAdder.java
  29. 0 35
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/workflow/WorkFlowStarter.java
  30. 0 58
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrAttachmentFileInfoFactory.java
  31. 0 440
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrCenterWorkInfoFactory.java
  32. 0 166
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigSecretaryFactory.java
  33. 0 139
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigSystemFactory.java
  34. 0 58
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigWorkLevelFactory.java
  35. 0 58
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigWorkTypeFactory.java
  36. 0 91
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrErrorSystemIdentityInfoFactory.java
  37. 0 390
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrStatisticReportContentFactory.java
  38. 0 185
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrStatisticReportStatusFactory.java
  39. 0 380
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrTaskFactory.java
  40. 0 157
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrTaskHandledFactory.java
  41. 0 80
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrUserInfoFactory.java
  42. 0 73
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkAppraiseInfoFactory.java
  43. 0 280
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkAuthorizeRecordFactory.java
  44. 0 842
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkBaseInfoFactory.java
  45. 0 295
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkChatFactory.java
  46. 0 91
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkDetailInfoFactory.java
  47. 0 349
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkDynamicsFactory.java
  48. 0 1432
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkPersonFactory.java
  49. 0 211
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkPersonSearchFactory.java
  50. 0 666
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportBaseInfoFactory.java
  51. 0 95
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportDetailInfoFactory.java
  52. 0 368
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportPersonLinkFactory.java
  53. 0 341
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportProcessLogFactory.java
  54. 0 86
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/ActionApplication.java
  55. 0 10
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/OkrAnonyJaxrsFilter.java
  56. 0 48
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/OkrJaxrsFilter.java
  57. 0 136
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/WorkCommonQueryFilter.java
  58. 0 262
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/WorkCommonSearchFilter.java
  59. 0 235
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/WorkPersonSearchFilter.java
  60. 0 154
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/ActionWorkAppraiseStatusSync.java
  61. 0 7
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/BaseAction.java
  62. 0 56
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/OkrWorkAppraiseAction.java
  63. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/exception/ExceptionWorkAppraiseProcess.java
  64. 0 90
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/ActionStatisticReportContentExport.java
  65. 0 90
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/ActionStatisticReportStatusExport.java
  66. 0 7
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/BaseAction.java
  67. 0 69
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/OkrExportAction.java
  68. 0 174
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionChangeIdentity.java
  69. 0 30
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionCheck.java
  70. 0 159
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionErrorInfoFilterListNextWithFilter.java
  71. 0 156
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionGetErrorRecords.java
  72. 0 156
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionGetOkrErrorIdentityRecords.java
  73. 0 36
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionReplaceOrganWithCheckTable.java
  74. 0 32
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionTestReplace.java
  75. 0 15
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/BaseAction.java
  76. 0 150
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/OkrSystemErrorIdentityProcessAction.java
  77. 0 58
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/entity/ErrorIdentityRecord.java
  78. 0 28
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/entity/ErrorIdentityRecords.java
  79. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionFilterIdentityEmpty.java
  80. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionIdentityCheck.java
  81. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionNewIdentityEmpty.java
  82. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionNewIdentityNotExists.java
  83. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionOldIdentityEmpty.java
  84. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionRecordIdEmpty.java
  85. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionRecordTypeEmpty.java
  86. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionTableNameEmpty.java
  87. 0 27
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/ActionGetLoginUser.java
  88. 0 155
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/ActionLogin.java
  89. 0 38
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/ActionLogout.java
  90. 0 110
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/BaseAction.java
  91. 0 69
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/OkrLoginAction.java
  92. 0 50
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/OkrLogoutAction.java
  93. 0 16
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionGetOkrUserCache.java
  94. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionOkrSystemAdminCheck.java
  95. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionUserHasNoProxyIdentity.java
  96. 0 16
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionUserIdentityQuery.java
  97. 0 12
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionUserProxyQuery.java
  98. 0 827
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/mind/ActionListMindForCenterId.java
  99. 0 14
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/mind/BaseAction.java
  100. 0 61
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/mind/OkrWorkMindAction.java

+ 0 - 7
o2server/pom.xml

@@ -29,7 +29,6 @@
 		<module>x_meeting_core_entity</module>
 		<module>x_message_core_entity</module>
 		<module>x_mind_core_entity</module>
-		<module>x_okr_core_entity</module>
 		<module>x_organization_core_entity</module>
 		<module>x_portal_core_entity</module>
 		<module>x_processplatform_core_entity</module>
@@ -50,7 +49,6 @@
 		<module>x_meeting_assemble_control</module>
 		<module>x_message_assemble_communicate</module>
 		<module>x_mind_assemble_control</module>
-		<module>x_okr_assemble_control</module>
 		<module>x_organization_assemble_authentication</module>
 		<module>x_organization_assemble_control</module>
 		<module>x_organization_assemble_express</module>
@@ -929,11 +927,6 @@
 				<artifactId>x_mind_core_entity</artifactId>
 				<version>5</version>
 			</dependency>
-			<dependency>
-				<groupId>o2oa</groupId>
-				<artifactId>x_okr_core_entity</artifactId>
-				<version>5</version>
-			</dependency>
 			<dependency>
 				<groupId>o2oa</groupId>
 				<artifactId>x_organization_core_entity</artifactId>

+ 0 - 129
o2server/x_okr_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_okr_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_express</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>o2oa</groupId>
-			<artifactId>x_okr_core_entity</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>o2oa</groupId>
-			<artifactId>x_processplatform_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>../store</outputDirectory>
-							<resources>
-								<resource>
-									<directory>target</directory>
-									<includes>
-										<include>${project.artifactId}.war</include>
-									</includes>
-								</resource>
-							</resources>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-</project>

+ 0 - 1046
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/date/DateOperation.java

@@ -1,1046 +0,0 @@
-package com.x.okr.assemble.common.date;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-
-public class DateOperation {
-	
-	private Logger logger =  LoggerFactory.getLogger( DateOperation.class);
-	/**
-	 * 根据样式得到格式化对象SimpleDateFormat
-	 * @param date
-	 * @param style
-	 * @return
-	 */
-	public String getDate(Date date, String style) {
-		SimpleDateFormat format = new SimpleDateFormat(style);
-		return format.format(date);
-	}
-
-	/**
-	 * 得到某日期的日期部分
-	 * 
-	 * @param date
-	 * @return yyyy-MM-dd
-	 */
-	public String getDate(Date date) {
-		return format1.format(date);
-	}
-
-	/**
-	 * 得到某日期的时间部分
-	 * 
-	 * @param date
-	 * @return HH:mm:ss
-	 */
-	public  String getTime(Date date) {
-		return format2.format(date);
-	}
-
-	public  Date getDateFromString(String dateString, String style) throws Exception{
-		Date date = null;
-		if(style==null||"".equals(style.trim())){
-			date = format1.parse(dateString);
-		}else if( "yyyy-MM-dd HH:mm:ss".equalsIgnoreCase(style.trim())){
-			date = format3.parse(dateString);
-		}else if( "yyyy-MM-dd HH:mm".equalsIgnoreCase(style.trim())){
-			date = format3_2.parse(dateString);
-		}else if( "yyyy/MM/dd HH:mm:ss".equalsIgnoreCase(style.trim())){
-			date = format3_1.parse(dateString);
-		}else if( "yyyy/MM/dd".equalsIgnoreCase(style.trim())){
-			date = format4.parse(dateString);
-		}else if( "yyyy-MM-dd".equalsIgnoreCase(style.trim())){
-			date = format1.parse(dateString);
-		}else if( "yyyyMMdd".equalsIgnoreCase(style.trim())){
-			date = format5.parse(dateString);
-		}else if( "yyyyMMddHHmmss".equalsIgnoreCase(style.trim())){
-			date = format7.parse(dateString);
-		}else if( "HH:mm:ss".equalsIgnoreCase(style.trim())){
-			date = format2.parse(dateString);
-		}else if( "HH:mm".equalsIgnoreCase(style.trim())){
-			date = format2_1.parse(dateString);
-		}else{
-			throw new Exception( "对不起,您输入的日期style系统无法识别,请检查您的参数输入!" );
-		}
-		return date;
-	}
-	
-	/**
-	 * 将字符串转换为日期格式
-	 * 会尝试多种格式转换,转换成功后返回结果
-	 * @param dateString
-	 * @return
-	 * @throws Exception
-	 */
-	public  Date getDateFromString( String dateString ) throws Exception{
-		Date date = null;
-		try{
-			date = getDateFromString( dateString, "yyyy-MM-dd HH:mm:ss" );
-			return date;
-		}catch(Exception e){}
-
-		try{
-			date = getDateFromString( dateString, "yyyy-MM-dd HH:mm" );
-			return date;
-		}catch(Exception e){}
-		
-		try{
-			date = getDateFromString( dateString, "yyyy/MM/dd HH:mm:ss" );
-			return date;
-		}catch(Exception e){}
-		
-		try{
-			date = getDateFromString( dateString, "yyyy-MM-dd" );
-			return date;
-		}catch(Exception e){}
-		
-		try{
-			date = getDateFromString( dateString, "yyyy/MM/dd" );
-			return date;
-		}catch(Exception e){}
-		
-		try{
-			date = getDateFromString( dateString, "yyyyMMdd" );
-			return date;
-		}catch(Exception e){}
-		
-		try{
-			date = getDateFromString( dateString, "yyyyMMddHHmmss" );
-			return date;
-		}catch(Exception e){}
-		
-		try{
-			date = getDateFromString( dateString, "HH:mm:ss" );
-			return date;
-		}catch(Exception e){}
-		
-		try{
-			date = getDateFromString( dateString, "HH:mm" );
-			return date;
-		}catch(Exception e){}
-		
-		throw new Exception( "the style of date has error, date:" + dateString );
-	}
-	
-	
-	public  String getDateStringFromDate(Date date, String style) throws Exception{
-		String dateString = null;
-		if(style==null||"".equals(style.trim())){
-			dateString = format1.format(date);
-		}else if( "yyyy-MM-dd HH:mm:ss".equalsIgnoreCase(style.trim())){
-			dateString = format3.format(date);
-		}else if( "yyyy/MM/dd HH:mm:ss".equalsIgnoreCase(style.trim())){
-			dateString = format3_1.format(date);
-		}else if( "yyyy/MM/dd".equalsIgnoreCase(style.trim())){
-			dateString = format4.format(date);
-		}else if( "yyyy-MM-dd".equalsIgnoreCase(style.trim())){
-			dateString = format1.format(date);
-		}else if( "yyyyMMdd".equalsIgnoreCase(style.trim())){
-			dateString = format5.format(date);
-		}else if( "yyyyMMddHHmmss".equalsIgnoreCase(style.trim())){
-			dateString = format7.format(date);
-		}else if( "HH:mm:ss".equalsIgnoreCase(style.trim())){
-			dateString = format2.format(date);
-		}else{
-			throw new Exception( "对不起,您输入的日期style系统无法识别,请检查您的参数输入!style=" + style);
-		}
-		return dateString;
-	}
-	
-	/**
-	 * 得到某日期加上或减去天数后的日期,day为负数时减去
-	 * 
-	 * @param date
-	 * @param month
-	 * @return "yyyy-MM-dd"
-	 * @throws Exception 
-	 */
-	public  String getDayAdd(String dateString, int day, String style) throws Exception {
-		Date date = getDateFromString(dateString, style);
-		return getDayAdd(date, day);
-	}
-	
-	/**
-	 * 得到某日期加上或减去天数后的日期,day为负数时减去
-	 * 
-	 * @param date
-	 * @param month
-	 * @return "yyyy-MM-dd"
-	 */
-	public  String getDayAdd(Date date, int day) {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(date);
-		calendar.add(Calendar.DATE, day);
-		return format1.format(calendar.getTime());
-	}
-
-	/**
-	 * 得到某日期加上或减去月份后的日期,month为负数时减去
-	 * 
-	 * @param date
-	 * @param month
-	 * @return "yyyy-MM-dd"
-	 */
-	public  String getMonthAdd(Date date, int month) {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(date);
-		calendar.add(Calendar.MONTH, month);
-		return format1.format(calendar.getTime());
-	}
-	
-	/**
-	 * 得到某日期加上或减去分钟后的日期,min为负数时减去
-	 * 
-	 * @param date
-	 * @param month
-	 * @return "yyyy-MM-dd HH:mi:ss"
-	 */
-	public  String getMinutesAdd(Date date, int min) {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(date);
-		calendar.add(Calendar.MINUTE, min);
-		return format3.format(calendar.getTime());
-	}
-	/**
-	 * 得到某日期的日
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 */
-	public  String getDay(Date date) {
-		try{
-			return format10.format(date);
-		}catch(Exception e){
-			return "0";
-		}
-	}
-	public int getDayNumber(Date date) {
-		String result = null;
-		try{
-			result = format10.format(date);
-		}catch(Exception e){
-			result = "0";
-		}
-		return Integer.parseInt(result);
-	}
-	/**
-	 * 得到某日期的月份
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 */
-	public  String getMonth(Date date) {
-		try{
-			return format9.format(date);
-		}catch(Exception e){
-			return "0";
-		}
-	}
-	public int getMonthNumber(Date date) {
-		String result = null;
-		try{
-			result = format9.format(date);
-		}catch(Exception e){
-			result = "0";
-		}
-		return Integer.parseInt(result);
-	}
-
-	/**
-	 * 得到某日期的年份
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 */
-	public  String getYear( Date date ) {
-		try{
-			return format8.format(date);
-		}catch(Exception e){
-			return "0";
-		}
-	}
-	public int getYearNumber(Date date) {
-		String result = null;
-		try{
-			result = format8.format(date);
-		}catch(Exception e){
-			result = "0";
-		}
-		return Integer.parseInt(result);
-	}
-	/**
-	 * 得到某日期的小时
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 */
-	public  String getHour(Date date) {
-		try{
-			return format11.format(date);
-		}catch(Exception e){
-			return "0";
-		}
-	}
-	/**
-	 * 得到某日期的分钟
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 */
-	public  String getMinites(Date date) {
-		return format12.format(date);
-	}
-	/**
-	 * 得到某日期的秒
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 */
-	public  String getSeconds(Date date) {
-		return format13.format(date);
-	}
-	/**
-	 * 得到某年有多少天
-	 * 
-	 * @param String
-	 *            date "yyyy-MM-dd"
-	 * @return
-	 * @throws ParseException
-	 */
-	@SuppressWarnings("static-access")
-	public  int getDaysForYear(String date) throws ParseException {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(format1.parse(date));
-		return calendar.get(calendar.DAY_OF_YEAR);
-	}
-
-	/**
-	 * 得到某年有多少天
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 * @throws ParseException
-	 */
-	@SuppressWarnings("static-access")
-	public  int getDaysForYear(Date date) throws ParseException {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(date);
-		return calendar.get(calendar.DAY_OF_YEAR);
-	}
-
-	/**
-	 * 得到某年有多少天
-	 * 
-	 * @param String
-	 *            year "yyyy"
-	 * @return
-	 * @throws ParseException
-	 */
-	@SuppressWarnings("static-access")
-	public  int getDaysForYear_YYYY(String year) throws ParseException {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(format8.parse(year));
-		return calendar.get(calendar.DAY_OF_YEAR);
-	}
-
-	/**
-	 * 得到某月有多少天
-	 * 
-	 * @param String
-	 *            date "yyyy-MM-dd"
-	 * @return
-	 * @throws ParseException
-	 */
-	public  int getDaysForMonth(String date) throws ParseException {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(format1.parse(date));
-		return calendar.getActualMaximum( Calendar.DAY_OF_MONTH);
-	}
-
-	/**
-	 * 得到某月有多少天
-	 * 
-	 * @param String
-	 *            date "yyyy-MM"
-	 * @return
-	 * @throws ParseException
-	 */
-	@SuppressWarnings("static-access")
-	public  int getDaysForMonth_MM(String date) throws ParseException {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(format14.parse(date));
-		return calendar.get(calendar.DAY_OF_MONTH);
-	}
-
-	/**
-	 * 得到某月有多少天
-	 * 
-	 * @param Date
-	 *            date
-	 * @return
-	 * @throws ParseException
-	 */
-	public  int getDaysForMonth(Date date) throws ParseException {
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(date);
-		return calendar.get(Calendar.DAY_OF_MONTH);
-	}
-
-	/**
-	 * 得到当前的日期
-	 * 
-	 * @return
-	 */
-	public  String getNowDate() {
-		return format1.format(new Date());
-	}
-
-	/**
-	 * 得到当前的时间
-	 * 
-	 * @return
-	 */
-	public  String getNowTime() {
-		return format2.format(new Date());
-	}
-	/**
-	 * 得到当前的时间
-	 * yyyyMMddHHmmss
-	 * @return
-	 */
-	public  String getNowTimeChar() {
-		return format7.format(new Date());
-	}
-	/**
-	 * 得到当前的时间
-	 * yyyy-MM-dd HH:mm:ss
-	 * @return
-	 */
-	public  String getNowDateTime() {
-		return format3.format(new Date());
-	}
-	/**
-	 * 得到两个时间之前的分差
-	 * @param date1 yyyy-MM-dd HH:mm:ss
-	 * @param date2 yyyy-MM-dd HH:mm:ss
-	 * @return
-	 */
-	public  long getDeff(String date1,String date2) {
-		long dayNumber = 0;
-		// 1小时=60分钟=3600秒=3600000
-		long mins = 60L * 1000L;
-		// long day= 24L * 60L * 60L * 1000L;计算天数之差
-		SimpleDateFormat df = null;
-		if(date1.length() == 19){
-			df = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
-		}else if(date1.length() == 10){
-			df = new SimpleDateFormat( "yyyy-MM-dd" );
-		}else if(date1.length() == 8){
-			df = new SimpleDateFormat( "HH:mm:ss" );
-		}else{
-			df = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
-		}
-		try {
-			java.util.Date d1 = df.parse(date1);
-			java.util.Date d2 = df.parse(date2);
-			dayNumber = (d2.getTime() - d1.getTime()) / mins;
-		} catch (Exception e) {
-			logger.warn( "系统获取得到两个时间之前的分差发生异常" );
-			logger.error(e);
-		}
-		return dayNumber;
-	}
-	/**
-	 * 得到两个时间之前的分差
-	 * @param date1 yyyy-MM-dd HH:mm:ss
-	 * @param date2 yyyy-MM-dd HH:mm:ss
-	 * @return
-	 */
-	public long getDeff(Date date1,Date date2) {
-		long dayNumber = 0;
-		// 1小时=60分钟=3600秒=3600000
-		long mins = 60L * 1000L;
-		// long day= 24L * 60L * 60L * 1000L;计算天数之差
-		try {
-			dayNumber = (date2.getTime() - date1.getTime()) / mins;
-		} catch (Exception e) {
-			logger.warn( "系统获取得到两个时间之前的分差发生异常");
-			logger.error(e);
-		}
-		return dayNumber;
-	}
-	/**
-	 * 
-	 * 日期格式转换
-	 * 从YYYY-MM-DD转换到YYYYMMDD
-	 * @param date
-	 * @throws ParseException 
-	 */
-	public  String changeDateFormat(String dateString){
-		Date date;
-		String reslut = null;
-		try {
-			if( "".equals(dateString)){
-				dateString="0000-00-00";
-			}
-			date = format1.parse(dateString);
-			reslut = format5.format(date);
-		} catch (ParseException e) {
-			try {
-				date = format1.parse( "0000-00-00" );
-			} catch (ParseException e1) {
-				logger.warn( "系统日期格式转换发生异常");
-				logger.error(e);
-			}
-			logger.warn( "系统日期格式转换发生异常" );
-			logger.error(e);
-		}
-		
-		return reslut;
-	}
-	
-	/** 格式 yyyy-MM-dd */
-	public  final SimpleDateFormat format1 = new SimpleDateFormat( "yyyy-MM-dd" );
-	/** 格式 HH:mm:ss */
-	public  final SimpleDateFormat format2 = new SimpleDateFormat( "HH:mm:ss" );
-	public  final SimpleDateFormat format2_1 = new SimpleDateFormat( "HH:mm" );
-	/** 格式 yyyy-MM-dd HH:mm:ss */
-	public  final SimpleDateFormat format3 = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
-	public  final SimpleDateFormat format3_2 = new SimpleDateFormat( "yyyy-MM-dd HH:mm" );
-	public  final SimpleDateFormat format3_1 = new SimpleDateFormat( "yyyy/MM/dd HH:mm:ss" );
-	/** 格式 yyyy/MM/dd */
-	public  final SimpleDateFormat format4 = new SimpleDateFormat( "yyyy/MM/dd" );
-	/** 格式 yyyyMMdd */
-	public  final SimpleDateFormat format5 = new SimpleDateFormat( "yyyyMMdd" );
-	/** 格式 HHmmss */
-	public  final SimpleDateFormat format6 = new SimpleDateFormat( "HHmmss" );
-	/** 格式 yyyyMMddHHmmss */
-	public  final SimpleDateFormat format7 = new SimpleDateFormat( "yyyyMMddHHmmss" );
-	/** 格式 yyyy */
-	public  final SimpleDateFormat format8 = new SimpleDateFormat( "yyyy" );
-	/** 格式 MM */
-	public  final SimpleDateFormat format9 = new SimpleDateFormat( "MM" );
-	/** 格式 dd */
-	public  final SimpleDateFormat format10 = new SimpleDateFormat( "dd" );
-	/** 格式 HH */
-	public  final SimpleDateFormat format11 = new SimpleDateFormat( "HH" );
-	/** 格式 mm */
-	public  final SimpleDateFormat format12 = new SimpleDateFormat( "mm" );
-	/** 格式 ss */
-	public  final SimpleDateFormat format13 = new SimpleDateFormat( "ss" );
-	/** 格式 ss */
-	public  final SimpleDateFormat format14 = new SimpleDateFormat( "yyyy-MM" );
-	
-	
-	public  String getStartOfWeek( String dateString ){
-		SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd" );
-		try {
-			Date date = format.parse(dateString);
-			Calendar cal = Calendar.getInstance();
-			cal.setTime(date);
-			cal.setFirstDayOfWeek(Calendar.MONDAY);
-			int tmp = cal.get(Calendar.DAY_OF_WEEK) - 1;
-			if (0 == tmp) {
-				tmp = 7;
-			}
-			cal.add(Calendar.DATE, -(tmp-1));
-			return getDateStringFromDate(cal.getTime(), "yyyy-MM-dd" ) + " 00:00:00";
-		} catch (ParseException e) {
-			logger.warn( "系统getStartOfWeek日期格式转换发生异常" );
-			logger.error(e);
-		} catch (Exception e) {
-			logger.warn( "系统getStartOfWeek发生异常" );
-			logger.error(e);
-		}
-		return null;
-	}
-	
-	@SuppressWarnings("unused")
-	public  String getEndOfWeek( String dateString ){
-		SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd" );
-		try {
-			Date date = getDateFromString(getStartOfWeek(dateString), "yyyy-MM-dd HH:mm:ss" );
-			Calendar cal = Calendar.getInstance();
-			cal.setTime(date);
-			cal.setFirstDayOfWeek(Calendar.MONDAY);
-			cal.add(Calendar.DATE, 6);
-			return getDateStringFromDate(cal.getTime(), "yyyy-MM-dd" ) + " 23:59:59";
-		} catch (ParseException e) {
-			logger.warn( "系统getEndOfWeek日期格式转换发生异常" );
-			logger.error(e);
-		} catch (Exception e) {
-			logger.warn( "系统getEndOfWeek发生异常",  e);
-			logger.error(e);
-		}
-		return null;
-	}
-	
-	
-	
-	/**
-	 * 将时间格式转换为 **月**日**时**分的格式
-	 * @param dateString
-	 * @param style
-	 * @return
-	 * @throws Exception
-	 */
-	public String getDateCNString( String dateString, String style ) throws Exception{
-		StringBuffer ch_date_string = new StringBuffer();
-		Date _date = null;
-		try{
-			_date = getDateFromString( dateString, style );
-		}catch(Exception e){
-			logger.warn( "系统getDateCNString日期格式转换发生异常" );
-			logger.error(e);
-		}
-		if(_date == null ){
-			_date = new Date();
-		}
-		String year = getYear( _date );
-		String month = getMonth( _date );
-		String day = getDay( _date );
-		String hour = getHour( _date );
-		String min = getMinites( _date );
-		ch_date_string.append( year );
-		ch_date_string.append( "年" );
-		ch_date_string.append( month );
-		ch_date_string.append( "月" );
-		ch_date_string.append( day );
-		ch_date_string.append( "日" );
-		ch_date_string.append( hour );
-		ch_date_string.append( "时" );
-		ch_date_string.append( min );
-		ch_date_string.append( "分" );		
-		return ch_date_string.toString();
-	}
-	
-	/**
-	 * 将时间格式转换为 **月**日**时**分**秒 的格式
-	 * @param dateString
-	 * @param style
-	 * @return
-	 * @throws Exception
-	 */
-	public String getDateCNString2( String dateString, String style ) throws Exception{
-		StringBuffer ch_date_string = new StringBuffer();
-		Date _date = null;
-		try{
-			_date = getDateFromString( dateString, style );
-		}catch(Exception e){
-			logger.warn( "系统getDateCNString2日期格式转换发生异常");
-			logger.error(e);
-		}
-		if(_date == null ){
-			_date = new Date();
-		}
-		String year = getYear( _date );
-		String month = getMonth( _date );
-		String day = getDay( _date );
-		String hour = getHour( _date );
-		String min = getMinites( _date );
-		String sec = getSeconds( _date );
-		ch_date_string.append( year );
-		ch_date_string.append( "年" );
-		ch_date_string.append( month );
-		ch_date_string.append( "月" );
-		ch_date_string.append( day );
-		ch_date_string.append( "日" );
-		ch_date_string.append( hour );
-		ch_date_string.append( "时" );
-		ch_date_string.append( min );
-		ch_date_string.append( "分" );
-		ch_date_string.append( sec );
-		ch_date_string.append( "秒" );
-		return ch_date_string.toString();
-	}
-	
-	
-	
-	
-     
-	/**
-	 * 判断是否周末
-	 * @param recordDate
-	 * @return
-	 */
-	public boolean isWeekend(Date date) {
-		Calendar cal = Calendar.getInstance();
-	    cal.setTime( date );
-	    if(cal.get(Calendar.DAY_OF_WEEK)==Calendar.SATURDAY||cal.get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY){
-	       return true;
-	    }
-		return false;
-	}
-	
-	@SuppressWarnings("unused")
-	public long getMinutes( Date date1, Date data2){
-		 long l=data2.getTime()-date1.getTime();
-		 long day=l/(24*60*60*1000);
-		 long hour=(l/(60*60*1000));
-		 long min=((l/(60*1000)));
-		 return min;
-	}
-
-	/**
-	 * 根据提供的年份月份,获取当月所有的日期字符串:yyyy-mm-dd
-	 * @param s_year
-	 * @param _month
-	 * @return
-	 */
-	public List<String> getDateStringFormMonth(String s_year, String _month) {
-		List<String> result = new ArrayList<String>();
-		Calendar cal = Calendar.getInstance();
-		int year = 0;
-		int month = 0;
-		int days = 0;
-		try{
-			year = Integer.parseInt( s_year );
-		}catch(Exception e){
-			e.printStackTrace();
-		}
-		try{
-			month = Integer.parseInt( _month );
-		}catch(Exception e){
-			e.printStackTrace();
-		}
-		cal.set(year, month-1, 1);
-		days = cal.getActualMaximum(Calendar.DATE);
-		for( int i =1; i<= days ; i++){
-			result.add( s_year + "-" + (month<10?"0"+month:month) + "-" + (i<10?"0"+i:i));
-		}
-		return result;
-	}
-	
-	/**
-	 * 根据提供的两个时间之间所有的日期字符串:yyyy-mm-dd
-	 * @param startDate
-	 * @param endDate
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listDateStringBetweenDate( Date startDate, Date endDate ) throws Exception {		
-		List<String> result = new ArrayList<String>();
-		Calendar cal = Calendar.getInstance();
-		startDate = getDateFromString( getDateStringFromDate( startDate, "yyyy-MM-dd" ) );
-		endDate = getDateFromString( getDateStringFromDate( endDate, "yyyy-MM-dd" ) + " 23:59:59" );	
-		cal.setTime( startDate );
-		while( cal.getTime().before(endDate)){
-			//logger.debug( getDateStringFromDate( cal.getTime(), "yyyy-MM-dd" ) );
-			result.add( getDateStringFromDate( cal.getTime(), "yyyy-MM-dd" ));
-			cal.add(Calendar.DATE, 1);
-		}
-		return result;
-	}	
-	/**
-	 * 获取日期所在月份的第一天
-	 * @param recordDate
-	 * @return
-	 * @throws Exception 
-	 */
-	public Date getFirstDateInMonth(Date recordDate) throws Exception {
-		String year = format8.format(recordDate);
-		String month = format9.format(recordDate);
-		return getDateFromString( year + "-" + month + "-01" );
-	}
-	
-	/**
-	 * 获取日期所在月份的第一天
-	 * @param recordDate yyyy-MM-dd
-	 * @return
-	 * @throws Exception 
-	 */
-	public String getFirstDateStringInMonth(Date recordDate) throws Exception {
-		String year = format8.format(recordDate);
-		String month = format9.format(recordDate);
-		return year + "-" + month + "-01";
-	}
-	
-	/**
-	 * 获取当月的最后一日
-	 * @param date
-	 * @return
-	 */
-	public static Date getLastDayOfMonth(Date date) {  
-        Calendar calendar = convert(date);  
-        calendar.set(Calendar.DATE, calendar.getMaximum(Calendar.DATE));  
-        return calendar.getTime();  
-    }  
-	/** 
-     * 将日期转换为日历 
-     * @param date 日期 
-     * @return 日历 
-     */  
-    private static Calendar convert(Date date) {  
-        Calendar calendar = Calendar.getInstance();  
-        calendar.setTime(date);  
-        return calendar;  
-    }  
-	/**
-	 * 获取日期所在月份的第一天
-	 * @param recordDate
-	 * @return
-	 * @throws Exception 
-	 */
-	public Date getLastDateInMonth(Date recordDate) throws Exception {
-		Date lastDate = getLastDayOfMonth(recordDate);
-		return getDateFromString( getDateStringFromDate( lastDate, "yyyy-MM-dd" ) );
-	}
-	
-	/**
-	 * 获取日期所在月份的第一天
-	 * @param recordDate yyyy-MM-dd
-	 * @return
-	 * @throws Exception 
-	 */
-	public String getLastDateStringInMonth(Date recordDate) throws Exception {
-		Date lastDate = getLastDayOfMonth(recordDate);
-		return getDateStringFromDate( lastDate, "yyyy-MM-dd" );
-	}
-	
-	public static Integer getWeekOfYear(Date date) {  
-        Calendar calendar = Calendar.getInstance();  
-        calendar.setFirstDayOfWeek(Calendar.MONDAY);  
-        calendar.setTime(date);  
-        int week = calendar.get(Calendar.WEEK_OF_YEAR);  
-        int mouth = calendar.get(Calendar.MONTH);  
-        // JDK think 2015-12-31 as 2016 1th week  
-        //如果月份是12月,且求出来的周数是第一周,说明该日期实质上是这一年的第53周,也是下一年的第一周  
-        if (mouth >= 11 && week <= 1) {  
-            week += 52;  
-        }  
-        return week;  
-    }  
-  
-    public static Integer getYearOfDate(Date date) {  
-        Calendar calendar = Calendar.getInstance();  
-        calendar.setTime(date);  
-        return calendar.get(Calendar.YEAR);  
-    }  
-  
-    public static Integer weeksBetween(Date fromDate, Date toDate) {  
-        if (fromDate.before(toDate)) {  
-            Date temp = fromDate;  
-            fromDate = toDate;  
-            toDate = temp;  
-        }  
-        Integer weekNum = (getWeekOfYear(fromDate) - getWeekOfYear(toDate))  
-                + (getYearOfDate(fromDate) - getYearOfDate(toDate)) * 52;  
-        return ++weekNum;  
-    } 
-    
-    /**
-	 * 获取日期在一年中的周数
-	 * 结果从1开始
-	 * @param dateString yyyy-mm-dd
-	 * @return
-	 */
-	public  int getWeekNumOfYear( String dateString ){
-		try {
-			Date date = getDateFromString( dateString , "yyyy-MM-dd" );
-			Calendar cal = Calendar.getInstance();
-			cal.setTime(date);
-			cal.setFirstDayOfWeek(2);//设置每周的第一天是星期一
-			return cal.get( Calendar.WEEK_OF_YEAR );
-		} catch (ParseException e) {
-			logger.warn( "系统getWeekNumOfYear日期格式转换发生异常" );
-			logger.error(e);
-		} catch (Exception e) {
-			logger.warn( "系统getWeekNumOfYear发生异常" );
-			logger.error(e);
-		}
-		return -1;
-	}
-	
-	/**
-	 * 获取日期在一年中的周数
-	 * 结果从1开始
-	 * @param dateString yyyy-mm-dd
-	 * @return
-	 */
-	public  int getWeekNumOfYear( Date date ){
-		try {
-			Calendar cal = Calendar.getInstance();
-			cal.setTime(date);
-			cal.setFirstDayOfWeek(2);//设置每周的第一天是星期一
-			return cal.get( Calendar.WEEK_OF_YEAR );
-		} catch (Exception e) {
-			logger.warn( "系统getWeekNumOfYear发生异常" );
-			logger.error(e);
-		}
-		return -1;
-	}
-	
-	/**
-	 * 计算两个日期之间的周数及详细情况
-	 * @param startDateString
-	 * @param endDateString
-	 * @return
-	 */
-	public  List<WeekOfYear> getWeeksOfYear( String startDateString, String endDateString ){
-		try {
-			Date startDate = getDateFromString( startDateString );
-			Date endDate = getDateFromString( endDateString );
-			return getWeeksOfYear( startDate, endDate );
-		} catch (Exception e) {
-			logger.warn( "系统getWeekNumOfYear发生异常" );
-			logger.error(e);
-		}
-		return null;
-	}
-	
-	/**
-	 * 计算两个日期之间的周数及详细情况
-	 * @param startDateString
-	 * @param endDateString
-	 * @return
-	 */
-	public  List<MonthOfYear> getMonthsOfYear( String startDateString, String endDateString ){
-		try {
-			Date startDate = getDateFromString( startDateString );
-			Date endDate = getDateFromString( endDateString );
-			return getMonthsOfYear( startDate, endDate );
-		} catch (Exception e) {
-			logger.warn( "系统getMonthsOfYear发生异常" );
-			logger.error(e);
-		}
-		return null;
-	}
-	
-	public List<MonthOfYear> getMonthsOfYear( Date startDate, Date endDate ) {
-		List<MonthOfYear> monthOfYearList =  new ArrayList<>();
-		MonthOfYear monthOfYear = null;
-		String monthStartDateString = null;
-		String monthEndDateString = null;
-		int year = 0;
-		int month = 0;
-		try {
-			Calendar cal = Calendar.getInstance();
-			cal.setTime( startDate );
-			
-			year = cal.get( Calendar.YEAR );
-			month = cal.get( Calendar.MONTH );
-			cal.set( year, month, 1 );
-			do{	
-				cal.set( Calendar.HOUR_OF_DAY, 0 );
-				cal.set( Calendar.MINUTE, 0 );
-				cal.set( Calendar.SECOND, 0 );
-				cal.set( Calendar.MILLISECOND, 0 );
-				monthOfYear = new MonthOfYear();
-				monthOfYear.setMonth( month + 1 );
-				monthOfYear.setYear( year );
-
-				monthStartDateString = getDateStringFromDate( cal.getTime(), "yyyy-MM-dd" );
-				monthOfYear.setStartDate( cal.getTime() );
-				monthOfYear.setStartDateString( monthStartDateString );
-				
-				cal.add( Calendar.MONTH, 1 );
-				cal.add( Calendar.DAY_OF_MONTH, -1 );
-				
-				cal.set( Calendar.HOUR_OF_DAY, 23 );
-				cal.set( Calendar.MINUTE, 59 );
-				cal.set( Calendar.SECOND, 59 );
-				cal.set( Calendar.MILLISECOND, 0 );
-				monthEndDateString = getDateStringFromDate( cal.getTime(), "yyyy-MM-dd" );
-				monthOfYear.setEndDate( cal.getTime() );
-				monthOfYear.setEndDateString( monthEndDateString );
-				monthOfYearList.add( monthOfYear );
-				
-				cal.set( year, month, 1 );
-				cal.add( Calendar.MONTH, 1 );
-				year = cal.get( Calendar.YEAR );
-				month = cal.get( Calendar.MONTH );
-
-			}while( cal.getTime().before( endDate ) );
-		} catch (Exception e) {
-			logger.warn( "系统getMonthsOfYear发生异常" );
-			logger.error(e);
-		}
-		return monthOfYearList;
-	}
-
-	/**
-	 * 计算两个日期之间的周数及详细情况
-	 * @param startDate
-	 * @param endDate
-	 * @return
-	 */
-	public  List<WeekOfYear> getWeeksOfYear( Date startDate, Date endDate ){
-		List<WeekOfYear> weekOfYearList =  new ArrayList<>();
-		WeekOfYear weekOfYear = null;
-		String weekStartDateString = null;
-		String weekEndDateString = null;
-		int year = 0;
-		int weekNo = 0;
-		int day_of_week = 0;
-		try {
-			Calendar cal = Calendar.getInstance();
-			cal.setTime( startDate );
-			day_of_week = cal.get( Calendar.DAY_OF_WEEK ) - 1;
-			//找出初始周的第一天
-			while( day_of_week != 1 ){
-				cal.add(Calendar.DATE, -1);
-				day_of_week = cal.get( Calendar.DAY_OF_WEEK ) - 1;
-			}
-			do{
-				cal.set( Calendar.HOUR_OF_DAY, 0 );
-				cal.set( Calendar.MINUTE, 0 );
-				cal.set( Calendar.SECOND, 0 );
-				cal.set( Calendar.MILLISECOND, 0 );
-				weekOfYear = new WeekOfYear();
-				year = cal.get( Calendar.YEAR );
-				weekNo = getWeekNumOfYear( cal.getTime() );
-				weekOfYear.setWeekNo( weekNo );
-				weekOfYear.setYear( year );
-				weekStartDateString = getDateStringFromDate( cal.getTime(), "yyyy-MM-dd" );
-				weekOfYear.setStartDate( cal.getTime() );
-				weekOfYear.setStartDateString( weekStartDateString );
-				
-				cal.add(Calendar.DATE, 6 );
-				weekEndDateString = getDateStringFromDate( cal.getTime(), "yyyy-MM-dd" );
-				year = cal.get( Calendar.YEAR );
-				if( year > weekOfYear.getYear() ){
-					//跨年了,取后一年的
-					if( weekOfYear.getWeekNo() == 1 ){
-						weekOfYear.setYear( year );
-					}
-				}
-				
-				cal.set( Calendar.HOUR_OF_DAY, 23 );
-				cal.set( Calendar.MINUTE, 59 );
-				cal.set( Calendar.SECOND, 59 );
-				cal.set( Calendar.MILLISECOND, 0 );
-				weekOfYear.setEndDate( cal.getTime() );
-				weekOfYear.setEndDateString( weekEndDateString );
-				weekOfYearList.add( weekOfYear );
-				cal.add(Calendar.DATE, 1 );
-			}while( cal.getTime().before( endDate ) );
-		} catch (Exception e) {
-			logger.warn( "系统getWeekNumOfYear发生异常" );
-			logger.error(e);
-		}
-		return weekOfYearList;
-	}
-	
-    public static void main(String[] args) throws Exception{
-		List<MonthOfYear> list = new DateOperation().getMonthsOfYear( "2016-01-01","2016-12-07" );
-		for( MonthOfYear enitty : list ){
-			System.out.println( enitty.toString() );
-		}
-    	
-	}
-}

+ 0 - 70
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/date/MonthOfYear.java

@@ -1,70 +0,0 @@
-package com.x.okr.assemble.common.date;
-
-import java.util.Date;
-
-public class MonthOfYear {
-
-	private Date startDate = null;
-	
-	private Date endDate = null;
-	
-	private String startDateString = null;
-	
-	private String endDateString = null;
-	
-	private Integer month = 1;
-	
-	private Integer year = 1;
-
-	public Date getStartDate() {
-		return startDate;
-	}
-
-	public void setStartDate(Date startDate) {
-		this.startDate = startDate;
-	}
-
-	public Date getEndDate() {
-		return endDate;
-	}
-
-	public void setEndDate(Date endDate) {
-		this.endDate = endDate;
-	}
-
-	public String getStartDateString() {
-		return startDateString;
-	}
-
-	public void setStartDateString(String startDateString) {
-		this.startDateString = startDateString;
-	}
-
-	public String getEndDateString() {
-		return endDateString;
-	}
-
-	public void setEndDateString(String endDateString) {
-		this.endDateString = endDateString;
-	}
-	
-	public Integer getMonth() {
-		return month;
-	}
-
-	public void setMonth(Integer month) {
-		this.month = month;
-	}
-
-	public Integer getYear() {
-		return year;
-	}
-
-	public void setYear(Integer year) {
-		this.year = year;
-	}
-
-	public String toString(){
-		return this.year + "年" +this.month + "月:" + this.startDateString + " -- " + this.endDateString;
-	}
-}

+ 0 - 70
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/date/WeekOfYear.java

@@ -1,70 +0,0 @@
-package com.x.okr.assemble.common.date;
-
-import java.util.Date;
-
-public class WeekOfYear {
-
-	private Date startDate = null;
-	
-	private Date endDate = null;
-	
-	private String startDateString = null;
-	
-	private String endDateString = null;
-	
-	private Integer weekNo = 1;
-	
-	private Integer year = 1;
-
-	public Date getStartDate() {
-		return startDate;
-	}
-
-	public void setStartDate(Date startDate) {
-		this.startDate = startDate;
-	}
-
-	public Date getEndDate() {
-		return endDate;
-	}
-
-	public void setEndDate(Date endDate) {
-		this.endDate = endDate;
-	}
-
-	public String getStartDateString() {
-		return startDateString;
-	}
-
-	public void setStartDateString(String startDateString) {
-		this.startDateString = startDateString;
-	}
-
-	public String getEndDateString() {
-		return endDateString;
-	}
-
-	public void setEndDateString(String endDateString) {
-		this.endDateString = endDateString;
-	}
-
-	public Integer getWeekNo() {
-		return weekNo;
-	}
-
-	public void setWeekNo(Integer weekNo) {
-		this.weekNo = weekNo;
-	}
-	
-	public Integer getYear() {
-		return year;
-	}
-
-	public void setYear(Integer year) {
-		this.year = year;
-	}
-
-	public String toString(){
-		return this.year + "年第"+this.weekNo + "周:" + this.startDateString + " -- " + this.endDateString;
-	}
-}

+ 0 - 278
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/Excel2003Reader.java

@@ -1,278 +0,0 @@
-package com.x.okr.assemble.common.excel.reader;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder.SheetRecordCollectingListener;
-import org.apache.poi.hssf.eventusermodel.FormatTrackingHSSFListener;
-import org.apache.poi.hssf.eventusermodel.HSSFEventFactory;
-import org.apache.poi.hssf.eventusermodel.HSSFListener;
-import org.apache.poi.hssf.eventusermodel.HSSFRequest;
-import org.apache.poi.hssf.eventusermodel.MissingRecordAwareHSSFListener;
-import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyRecord;
-import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingCellDummyRecord;
-import org.apache.poi.hssf.model.HSSFFormulaParser;
-import org.apache.poi.hssf.record.BOFRecord;
-import org.apache.poi.hssf.record.BlankRecord;
-import org.apache.poi.hssf.record.BoolErrRecord;
-import org.apache.poi.hssf.record.BoundSheetRecord;
-import org.apache.poi.hssf.record.FormulaRecord;
-import org.apache.poi.hssf.record.LabelRecord;
-import org.apache.poi.hssf.record.LabelSSTRecord;
-import org.apache.poi.hssf.record.NumberRecord;
-import org.apache.poi.hssf.record.Record;
-import org.apache.poi.hssf.record.SSTRecord;
-import org.apache.poi.hssf.record.StringRecord;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-
-/**
- * 抽象Excel2003读取器,通过实现HSSFListener监听器,采用事件驱动模式解析excel2003
- * 中的内容,遇到特定事件才会触发,大大减少了内存的使用。
- *
- */
-public  class Excel2003Reader implements HSSFListener{
-	private int minColumns = -1;
-	private POIFSFileSystem fs;
-	private int lastRowNumber;
-	private int lastColumnNumber;
-
-	/** Should we output the formula, or the value it has? */
-	private boolean outputFormulaValues = true;
-
-	/** For parsing Formulas */
-	private SheetRecordCollectingListener workbookBuildingListener;
-	//excel2003工作薄
-	private HSSFWorkbook stubWorkbook;
-
-	// Records we pick up as we process
-	private SSTRecord sstRecord;
-	private FormatTrackingHSSFListener formatListener;
-
-	//表索引
-	private int sheetIndex = -1;
-	private BoundSheetRecord[] orderedBSRs;
-	@SuppressWarnings("rawtypes")
-	private ArrayList boundSheetRecords = new ArrayList();
-
-	// For handling formulas with string results
-	private int nextRow;
-	private int nextColumn;
-	private boolean outputNextStringRecord;
-	//当前行
-	private int curRow = 0;
-	//存储行记录的容器
-	private List<String> rowlist = new ArrayList<String>();;
-	@SuppressWarnings( "unused" )
-	private String sheetName;
-	
-	private String fileKey;
-	private int startRow;
-	private IRowReader rowReader;
-
-	
-	public void setRowReader(IRowReader rowReader, String fileKey, int startRow ){
-		this.rowReader = rowReader;
-		this.fileKey = fileKey;
-		this.startRow = startRow;
-	}
-	
-	/**
-	 * 遍历excel下所有的sheet
-	 * @param fileKey 
-	 * @throws IOException
-	 */
-	public void process( String fileName ) throws IOException {
-		
-		this.fs = new POIFSFileSystem( new FileInputStream(fileName) );
-		MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener( this);
-		formatListener = new FormatTrackingHSSFListener(listener);
-		HSSFEventFactory factory = new HSSFEventFactory();
-		HSSFRequest request = new HSSFRequest();
-		if ( outputFormulaValues ) {
-			request.addListenerForAllRecords( formatListener );
-		} else {
-			workbookBuildingListener = new SheetRecordCollectingListener( formatListener);
-			request.addListenerForAllRecords(workbookBuildingListener);
-		}
-		factory.processWorkbookEvents(request, fs);
-		//数据读取完成
-		
-	}
-	
-	/**
-	 * 遍历excel下所有的sheet
-	 * @param fileKey 
-	 * @throws IOException
-	 */
-	public void process( InputStream is ) throws IOException {
-		this.fs = new POIFSFileSystem( is );
-		MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener( this);
-		formatListener = new FormatTrackingHSSFListener(listener);
-		HSSFEventFactory factory = new HSSFEventFactory();
-		HSSFRequest request = new HSSFRequest();
-		if ( outputFormulaValues ) {
-			request.addListenerForAllRecords( formatListener );
-		} else {
-			workbookBuildingListener = new SheetRecordCollectingListener( formatListener);
-			request.addListenerForAllRecords(workbookBuildingListener);
-		}
-		factory.processWorkbookEvents(request, fs);
-		//数据读取完成
-		
-	}
-	
-	/**
-	 * HSSFListener 监听方法,处理 Record
-	 */
-	@SuppressWarnings( "unchecked" )
-	public void processRecord(Record record) {
-		int thisRow = -1;
-		int thisColumn = -1;
-		String thisStr = null;
-		String value = null;
-		switch (record.getSid()) {
-			case BoundSheetRecord.sid:
-				boundSheetRecords.add(record);
-				break;
-			case BOFRecord.sid:
-				BOFRecord br = (BOFRecord) record;
-				if (br.getType() == BOFRecord.TYPE_WORKSHEET) {
-					// 如果有需要,则建立子工作薄
-					if (workbookBuildingListener != null && stubWorkbook == null) {
-						stubWorkbook = workbookBuildingListener
-								.getStubHSSFWorkbook();
-					}
-					
-					sheetIndex++;
-					if (orderedBSRs == null) {
-						orderedBSRs = BoundSheetRecord
-								.orderByBofPosition(boundSheetRecords);
-					}
-					sheetName = orderedBSRs[sheetIndex].getSheetname();
-				}
-				break;
-	
-			case SSTRecord.sid:
-				sstRecord = (SSTRecord) record;
-				break;
-	
-			case BlankRecord.sid:
-				BlankRecord brec = (BlankRecord) record;
-				thisRow = brec.getRow();
-				thisColumn = brec.getColumn();
-				thisStr = "";
-				rowlist.add(thisColumn, thisStr);
-				break;
-			case BoolErrRecord.sid: //单元格为布尔类型
-				BoolErrRecord berec = (BoolErrRecord) record;
-				thisRow = berec.getRow();
-				thisColumn = berec.getColumn();
-				thisStr = berec.getBooleanValue()+"";
-				rowlist.add(thisColumn, thisStr);
-				break;
-	
-			case FormulaRecord.sid: //单元格为公式类型
-				FormulaRecord frec = (FormulaRecord) record;
-				thisRow = frec.getRow();
-				thisColumn = frec.getColumn();
-				if (outputFormulaValues) {
-					if (Double.isNaN(frec.getValue())) {
-						// Formula result is a string
-						// This is stored in the next record
-						outputNextStringRecord = true;
-						nextRow = frec.getRow();
-						nextColumn = frec.getColumn();
-					} else {
-						thisStr = formatListener.formatNumberDateCell(frec);
-					}
-				} else {
-					thisStr = '"' + HSSFFormulaParser.toFormulaString(stubWorkbook, frec.getParsedExpression()) + '"';
-				}
-				rowlist.add(thisColumn,thisStr);
-				break;
-			case StringRecord.sid://单元格中公式的字符串
-				if (outputNextStringRecord) {
-					// String for formula
-					StringRecord srec = (StringRecord) record;
-					thisStr = srec.getString();
-					thisRow = nextRow;
-					thisColumn = nextColumn;
-					outputNextStringRecord = false;
-				}
-				break;
-			case LabelRecord.sid:
-				LabelRecord lrec = (LabelRecord) record;
-				curRow = thisRow = lrec.getRow();
-				thisColumn = lrec.getColumn();
-				value = lrec.getValue().trim();
-				value = value.equals( "" )?" ":value;
-				this.rowlist.add(thisColumn, value);
-				break;
-			case LabelSSTRecord.sid:  //单元格为字符串类型
-				LabelSSTRecord lsrec = (LabelSSTRecord) record;
-				curRow = thisRow = lsrec.getRow();
-				thisColumn = lsrec.getColumn();
-				if (sstRecord == null) {
-					rowlist.add(thisColumn, " " );
-				} else {
-					value =  sstRecord
-					.getString(lsrec.getSSTIndex()).toString().trim();
-					value = value.equals( "" )?" ":value;
-					rowlist.add(thisColumn,value);
-				}
-				break;
-			case NumberRecord.sid:  //单元格为数字类型
-				NumberRecord numrec = (NumberRecord) record;
-				curRow = thisRow = numrec.getRow();
-				thisColumn = numrec.getColumn();
-				value = formatListener.formatNumberDateCell(numrec).trim();
-				value = value.equals( "" )?" ":value;
-				// 向容器加入列值
-				rowlist.add(thisColumn, value);
-				break;
-			default:
-				break;
-		}
-
-		// 遇到新行的操作
-		if (thisRow != -1 && thisRow != lastRowNumber) {
-			lastColumnNumber = -1;
-		}
-
-		// 空值的操作
-		if (record instanceof MissingCellDummyRecord) {
-			MissingCellDummyRecord mc = (MissingCellDummyRecord) record;
-			curRow = thisRow = mc.getRow();
-			thisColumn = mc.getColumn();
-			rowlist.add(thisColumn," " );
-		}
-
-		// 更新行和列的值
-		if (thisRow > -1)
-			lastRowNumber = thisRow;
-		if (thisColumn > -1)
-			lastColumnNumber = thisColumn;
-
-		// 行结束时的操作
-		if (record instanceof LastCellOfRowDummyRecord) {
-			if (minColumns > 0) {
-				// 列值重新置空
-				if (lastColumnNumber == -1) {
-					lastColumnNumber = 0;
-				}
-			}
-			lastColumnNumber = -1;
-			// 每行结束时, 调用getRows() 方法
-			
-			rowReader.getRows(sheetIndex,curRow, rowlist, this.fileKey, this.startRow );
-			
-			// 清空容器
-			rowlist.clear();
-		}
-	}
-	
-}

+ 0 - 232
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/Excel2007Reader.java

@@ -1,232 +0,0 @@
-package com.x.okr.assemble.common.excel.reader;
-
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
-import org.apache.poi.openxml4j.opc.OPCPackage;
-import org.apache.poi.xssf.eventusermodel.XSSFReader;
-import org.apache.poi.xssf.model.SharedStringsTable;
-import org.apache.poi.xssf.usermodel.XSSFRichTextString;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * 抽象Excel2007读取器,excel2007的底层数据结构是xml文件,采用SAX的事件驱动的方法解析
- * xml,需要继承DefaultHandler,在遇到文件内容时,事件会触发,这种做法可以大大降低
- * 内存的耗费,特别使用于大数据量的文件。
- *
- */
-public class Excel2007Reader extends DefaultHandler {
-	//共享字符串表
-	private SharedStringsTable sst;
-	//上一次的内容
-	private String lastContents;
-	
-	private boolean nextIsString;
-
-	private int sheetIndex = -1;
-	
-	private List<String> rowlist = new ArrayList<String>();
-	//当前行
-	private int curRow = 0;
-	//当前列
-	private int curCol = 0;
-	//日期标志
-	private boolean dateFlag;
-	//数字标志
-	private boolean numberFlag;
-	
-	private boolean isTElement;
-	
-	private String fileKey;
-	private int startRow;
-	private IRowReader rowReader;
-	
-	public void setRowReader(IRowReader rowReader, String fileKey, int startRow){
-		this.rowReader = rowReader;
-		this.fileKey = fileKey;
-		this.startRow = startRow;
-	}
-	
-	/**只遍历一个电子表格,其中sheetId为要遍历的sheet索引,从1开始,1-3
-	 * @param filename
-	 * @param sheetId
-	 * @throws Exception
-	 */
-	public void processOneSheet(String filename,int sheetId) throws Exception {
-		OPCPackage pkg = OPCPackage.open(filename);
-		XSSFReader r = new XSSFReader(pkg);
-		SharedStringsTable sst = r.getSharedStringsTable();
-		XMLReader parser = fetchSheetParser(sst);
-		
-		// 根据 rId# 或 rSheet# 查找sheet
-		InputStream sheet2 = r.getSheet( "rId"+sheetId);
-		sheetIndex++;
-		InputSource sheetSource = new InputSource(sheet2);
-		parser.parse(sheetSource);
-		sheet2.close();
-	}
-
-	/**
-	 * 遍历工作簿中所有的电子表格
-	 * @param filename
-	 * @param fileKey 
-	 * @throws Exception
-	 */
-	public void process( String filename ) throws Exception {
-		OPCPackage pkg = OPCPackage.open( filename );
-		XSSFReader r = new XSSFReader(pkg);
-		SharedStringsTable sst = r.getSharedStringsTable();
-		XMLReader parser = fetchSheetParser(sst);
-		Iterator<InputStream> sheets = r.getSheetsData();
-		while (sheets.hasNext()) {
-			curRow = 0;
-			sheetIndex++;
-			InputStream sheet = sheets.next();
-			InputSource sheetSource = new InputSource(sheet);
-			parser.parse( sheetSource );
-			sheet.close();
-		}
-		//数据读取完成
-	}
-	/**
-	 * 遍历工作簿中所有的电子表格
-	 * @param is
-	 * @param fileKey 
-	 * @throws Exception
-	 */
-	public void process( InputStream is ) throws Exception {
-		OPCPackage pkg = OPCPackage.open( is );
-		XSSFReader r = new XSSFReader(pkg);
-		SharedStringsTable sst = r.getSharedStringsTable();
-		XMLReader parser = fetchSheetParser(sst);
-		Iterator<InputStream> sheets = r.getSheetsData();
-		while (sheets.hasNext()) {
-			curRow = 0;
-			sheetIndex++;
-			InputStream sheet = sheets.next();
-			InputSource sheetSource = new InputSource(sheet);
-			parser.parse( sheetSource );
-			sheet.close();
-		}
-		//数据读取完成
-	}
-	public XMLReader fetchSheetParser(SharedStringsTable sst) throws SAXException {
-		XMLReader parser = XMLReaderFactory.createXMLReader( "org.apache.xerces.parsers.SAXParser" );
-		this.sst = sst;
-		parser.setContentHandler(this);
-		return parser;
-	}
-
-	public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
-		
-		// c => 单元格
-		if ( "c".equals(name)) {
-			// 如果下一个元素是 SST 的索引,则将nextIsString标记为true
-			String cellType = attributes.getValue( "t" );
-			if ( "s".equals(cellType)) {
-				nextIsString = true;
-			} else {
-				nextIsString = false;
-			}
-			//日期格式
-			String cellDateType = attributes.getValue( "s" );
-			if ( "1".equals(cellDateType)){
-				dateFlag = true;
-			} else {
-				dateFlag = false;
-			}
-			String cellNumberType = attributes.getValue( "s" );
-			if( "2".equals(cellNumberType)){
-				numberFlag = true;
-			} else {
-				numberFlag = false;
-			}
-			
-		}
-		//当元素为t时
-		if( "t".equals(name)){
-			isTElement = true;
-		} else {
-			isTElement = false;
-		}
-		
-		// 置空
-		lastContents = "";
-	}
-
-	public void endElement(String uri, String localName, String name)
-			throws SAXException {
-		
-		// 根据SST的索引值的到单元格的真正要存储的字符串
-		// 这时characters()方法可能会被调用多次
-		if (nextIsString) {
-			try {
-				int idx = Integer.parseInt(lastContents);
-				lastContents = new XSSFRichTextString(sst.getEntryAt(idx))
-						.toString();
-			} catch (Exception e) {
-
-			}
-		} 
-		//t元素也包含字符串
-		if(isTElement){
-			String value = lastContents.trim();
-			rowlist.add(curCol, value);
-			curCol++;
-			isTElement = false;
-			// v => 单元格的值,如果单元格是字符串则v标签的值为该字符串在SST中的索引
-			// 将单元格内容加入rowlist中,在这之前先去掉字符串前后的空白符
-		} else if ( "v".equals(name)) {
-			String value = lastContents.trim();
-			value = value.equals( "" )?" ":value;
-			//日期格式处理
-			if(dateFlag){
-				try{
-					Date date = HSSFDateUtil.getJavaDate(Double.valueOf(value));
-					SimpleDateFormat dateFormat = new SimpleDateFormat( "dd/MM/yyyy" );
-					value = dateFormat.format(date);
-				}catch(Exception e){
-					
-				}
-			} 
-			//数字类型处理
-			if(numberFlag){
-				try{
-					BigDecimal bd = new BigDecimal(value);
-					value = bd.setScale(3,BigDecimal.ROUND_UP).toString();
-				}catch(Exception e){
-					
-				}
-			}
-			rowlist.add(curCol, value);
-			curCol++;
-		}else {
-			//如果标签名称为 row ,这说明已到行尾,调用 optRows() 方法
-			if (name.equals( "row" )) {
-				
-				rowReader.getRows(sheetIndex,curRow,rowlist, this.fileKey, this.startRow );
-				rowlist.clear();
-				curRow++;
-				curCol = 0;
-			}
-		}
-		
-	}
-
-	public void characters(char[] ch, int start, int length)
-			throws SAXException {
-		//得到单元格内容的值
-		lastContents += new String(ch, start, length);
-	}
-}

+ 0 - 57
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/ExcelReaderUtil.java

@@ -1,57 +0,0 @@
-package com.x.okr.assemble.common.excel.reader;
-
-import java.io.InputStream;
-
-public class ExcelReaderUtil {
-	
-	//excel2003扩展名
-	public static final String EXCEL03_EXTENSION = ".xls";
-	//excel2007扩展名
-	public static final String EXCEL07_EXTENSION = ".xlsx";
-	
-	/**
-	 * 读取Excel文件,可能是03也可能是07版本
-	 * @param excel03
-	 * @param excel07
-	 * @param fileName
-	 * @throws Exception 
-	 */
-	public static void readExcel(IRowReader reader, String fileName, String fileKey, int startRow ) throws Exception{
-		// 处理excel2003文件
-		if (fileName.endsWith(EXCEL03_EXTENSION)){
-			Excel2003Reader excel03 = new Excel2003Reader();
-			excel03.setRowReader(reader, fileKey, startRow);
-			excel03.process(fileName);
-		// 处理excel2007文件
-		} else if (fileName.endsWith(EXCEL07_EXTENSION)){
-			Excel2007Reader excel07 = new Excel2007Reader();
-			excel07.setRowReader(reader, fileKey, startRow);
-			excel07.process(fileName);
-		} else {
-			throw new  Exception( "文件格式错误,fileName的扩展名只能是xls或xlsx。" );
-		}
-	}
-	
-	/**
-	 * 读取Excel文件,可能是03也可能是07版本
-	 * @param excel03
-	 * @param excel07
-	 * @param fileName
-	 * @throws Exception 
-	 */
-	public static void readExcel(IRowReader reader,String fileName, InputStream inputStream, String fileKey, int startRow ) throws Exception{
-		// 处理excel2003文件
-		if (fileName.endsWith( EXCEL03_EXTENSION )){
-			Excel2003Reader excel03 = new Excel2003Reader();
-			excel03.setRowReader(reader, fileKey, startRow);
-			excel03.process(inputStream);
-		// 处理excel2007文件
-		} else if (fileName.endsWith(EXCEL07_EXTENSION)){
-			Excel2007Reader excel07 = new Excel2007Reader();
-			excel07.setRowReader(reader, fileKey, startRow);
-			excel07.process(inputStream);
-		} else {
-			throw new  Exception( "文件格式错误,fileName的扩展名只能是xls或xlsx。" );
-		}
-	}
-}

+ 0 - 13
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/IRowReader.java

@@ -1,13 +0,0 @@
-package com.x.okr.assemble.common.excel.reader;
-
-import java.util.List;
-
-public interface IRowReader {
-	
-	/**业务逻辑实现方法
-	 * @param sheetIndex
-	 * @param curRow
-	 * @param rowlist
-	 */
-	public  void getRows( int sheetIndex, int curRow, List<String> rowlist, String fileKey, int startRow );
-}

+ 0 - 219
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/reader/UserModelEventListener.java

@@ -1,219 +0,0 @@
-package com.x.okr.assemble.common.excel.reader;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder.SheetRecordCollectingListener;
-import org.apache.poi.hssf.eventusermodel.HSSFListener;
-import org.apache.poi.hssf.record.BOFRecord;
-import org.apache.poi.hssf.record.BlankRecord;
-import org.apache.poi.hssf.record.BoolErrRecord;
-import org.apache.poi.hssf.record.BoundSheetRecord;
-import org.apache.poi.hssf.record.FormulaRecord;
-import org.apache.poi.hssf.record.LabelSSTRecord;
-import org.apache.poi.hssf.record.NumberRecord;
-import org.apache.poi.hssf.record.RowRecord;
-import org.apache.poi.hssf.record.SSTRecord;
-
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-
-/**
- * 基于POI HSSF的eventmodel 模型的时间解析方式
- *   优点:解析数据相当快。
- *   缺点:1.仅仅支持97~2003版本的excel,不支持2007版本的excel。
- *         2.只能读Excel中一个Sheet页面。
- * 
- * @Title: 
- * @Description: 实现TODO
- * @Copyright:Copyright (c) 2011
- * @Date:2012-6-14
- * @author  longgangbai
- * @version 1.0
- */
-public class UserModelEventListener implements HSSFListener {
-	private static Logger logger=LoggerFactory.getLogger(UserModelEventListener.class);
-	private SSTRecord sstrec;
-	/** Should we output the formula, or the value it has? */
-	@SuppressWarnings("unused")
-	private boolean outputFormulaValues = true;
-	/** For parsing Formulas */
-	@SuppressWarnings("unused")
-	private SheetRecordCollectingListener workbookBuildingListener;
-
-    //当前Sheet的内容
-    private List<Map<String,Object>> currentSheetDataMap=new ArrayList<Map<String,Object>>();
-    //列对应的字段
-	private static String[] trianListheadTitle=new String[]{"trainCode","firstStation","lastStation","startStation","arriveStation","startTime","arriveTime","fistLevelPrice","secondLevelPrice","km","useDate"};
-
-    //一行记录
-    private Map<String,Object> currentSheetRowDataMap=new HashMap<String,Object>();
-    private int curRowNum=0;
-    private int ignoreRowNum=1;
-    @SuppressWarnings("unused")
-    private int sheetNo=0;
-    
-	@SuppressWarnings({ "static-access", "unused" })
-	@Override
-	public void processRecord(org.apache.poi.hssf.record.Record record) {
-		switch (record.getSid()) {
-		
-		case BOFRecord.sid:
-			BOFRecord bof = (BOFRecord) record;
-			//顺序进入新的Workbook  
-			if (bof.getType() == bof.TYPE_WORKBOOK) {
-				//logger.debug( "开始解析excel 文档....." );
-			//顺序进入新的Worksheet,因为Event API不会把Excel文件里的所有数据结构都关联起来,
-			//所以这儿一定要记录现在进入第几个sheet了。
-			} else if (bof.getType() == bof.TYPE_WORKSHEET) {
-				//读取新的一个Sheet页
-				//logger.debug( "开始解析sheet页面内容..." );
-				//System.out.println( "sheetNo="+sheetNo);
-				sheetNo++;
-				currentSheetDataMap=new ArrayList<Map<String,Object>>();
-			}
-			break;
-	    //开始解析Sheet的信息,记录sheet,这儿会把所有的sheet都顺序打印出来,如果有多个sheet的话,可以顺序记入到一个List里   
-		case BoundSheetRecord.sid:
-			BoundSheetRecord bsr = (BoundSheetRecord) record;
-			//System.out.println( "sheetName="+bsr.getSheetname());
-			//logger.debug( "New sheet named: " + bsr.getSheetname());
-			break;
-		//执行行记录事件
-		case RowRecord.sid:
-			RowRecord rowrec = (RowRecord) record;
-			//logger.debug( "记录开始, first column at "
-			//		+ rowrec.getFirstCol() + " last column at "
-			//		+ rowrec.getLastCol());
-			break;
-		// SSTRecords store a array of unique strings used in Excel.
-		case SSTRecord.sid:
-			sstrec = (SSTRecord) record;
-			for (int k = 0; k < sstrec.getNumUniqueStrings(); k++) {
-				//logger.debug( "String table value " + k + " = "
-				//		+ sstrec.getString(k));
-			}
-			break;
-			
-		//发现数字类型的cell,因为数字和日期都是用这个格式,所以下面一定要判断是不是日期格式,另外默认的数字也会被视为日期格式,所以如果是数字的话,一定要明确指定格式!!!!!!!   
-		case NumberRecord.sid:
-				NumberRecord nr = (NumberRecord) record;
-				//HSSFDateUtil.isInternalDateFormat(nr.getXFIndex())  判断是否为时间列
-				int column=nr.getColumn();
-				if(column==5||column==6){
-					addDataAndrChangeRow(nr.getRow(),nr.getColumn(),getTime(nr.getValue()));
-				}else{
-					addDataAndrChangeRow(nr.getRow(),nr.getColumn(),(int)nr.getValue());
-				}
-				break;
-		//发现字符串类型,这儿要取字符串的值的话,跟据其index去字符串表里读取   
-		case LabelSSTRecord.sid:
-			LabelSSTRecord lsr = (LabelSSTRecord)record; 
-			addDataAndrChangeRow(lsr.getRow(),lsr.getColumn(), sstrec.getString(lsr.getSSTIndex()));
-			//logger.debug( "文字列:"+sstrec.getString(lsr.getSSTIndex())+", 行:"+lsr.getRow()+", 列:"+lsr.getColumn());   
-			break;
-	    case BoolErrRecord.sid: //解析boolean错误信息
-            BoolErrRecord ber = (BoolErrRecord)record;   
-            if(ber.isBoolean()){   
-            	addDataAndrChangeRow(ber.getRow(),ber.getColumn(), ber.getBooleanValue());
-            	//logger.debug( "Boolean:"+ber.getBooleanValue()+", 行:"+ber.getRow()+", 列:"+ber.getColumn());   
-            }   
-            if(ber.isError()){   
-            	//logger.debug( "Error:"+ber.getErrorValue()+", 行:"+ber.getRow()+", 列:"+ber.getColumn());   
-            }   
-            break;   
-         //空白记录的信息
-        case BlankRecord.sid: 
-            BlankRecord br = (BlankRecord)record;   
-            addDataAndrChangeRow(br.getRow(),br.getColumn(), "" );
-            //logger.debug( "空。 行:"+br.getRow()+", 列:"+br.getColumn());   
-            break;   
-        case FormulaRecord.sid: //数式   
-            FormulaRecord fr = (FormulaRecord)record;  
-            addDataAndrChangeRow(fr.getRow(),fr.getColumn(), fr.getValue());
-            //logger.debug( "数字 。 行:"+fr.getRow()+", 列:"+fr.getColumn());  
-            break;  
-		}
-	}
-	/** 
-     * HH:MM格式时间的数字转换方法</li> 
-     * @param sNum 
-     * @return 
-     */ 
-    private static String getTime(double daynum) 
-    { 
-        double totalSeconds=daynum*86400.0D;
-        //总的分钟数
-        int seconds =(int)totalSeconds/60;
-        //实际小时数
-        int hours =seconds/60;
-        int minutes = seconds-hours*60;
-        //剩余的实际分钟数
-        StringBuffer sb=new StringBuffer();
-        if(String.valueOf(hours).length()==1){
-        	sb.append( "0"+hours);
-        }else{
-        	sb.append(hours);
-        }
-        sb.append( ":" );
-        if(String.valueOf(minutes).length()==1){
-        	sb.append( "0"+minutes);
-        }else{
-        	sb.append(minutes);
-        }
-        return sb.toString();
-    } 
-	/**
-	 *  添加数据记录并检查是否换行
-	 * @param row 实际当前行号
-	 * @param col 实际记录当前列
-	 * @param value  当前cell的值
-	 */
-	public void addDataAndrChangeRow(int row,int col,Object value){
-		//当前行如果大于实际行表示改行忽略,不记录
-		if(curRowNum!=row){
-			if(CollectionUtils.isEmpty(currentSheetDataMap)){
-				 currentSheetDataMap=new ArrayList<Map<String,Object>>();
-			}
-			currentSheetDataMap.add(currentSheetRowDataMap);
-			//logger.debug( "行号:"+curRowNum +" 行内容:"+currentSheetRowDataMap.toString());
-			//logger.debug( "\n" );
-			currentSheetRowDataMap=new HashMap<String,Object>();
-			currentSheetRowDataMap.put(trianListheadTitle[col], value);
-			logger.debug(row+":"+col+"  "+value+"\r" );
-			curRowNum=row;
-		}else{
-			currentSheetRowDataMap.put(trianListheadTitle[col], value);
-			//logger.debug(row+":"+col+"  "+value+"\r" );
-		}
-	}
-	public List<Map<String, Object>> getCurrentSheetDataMap() {
-		return currentSheetDataMap;
-	}
-	public void setCurrentSheetDataMap(List<Map<String, Object>> currentSheetDataMap) {
-		this.currentSheetDataMap = currentSheetDataMap;
-	}
-	public Map<String, Object> getCurrentSheetRowDataMap() {
-		return currentSheetRowDataMap;
-	}
-	public void setCurrentSheetRowDataMap(Map<String, Object> currentSheetRowDataMap) {
-		this.currentSheetRowDataMap = currentSheetRowDataMap;
-	}
-	public int getCurRowNum() {
-		return curRowNum;
-	}
-	public void setCurRowNum(int curRowNum) {
-		this.curRowNum = curRowNum;
-	}
-	public int getIgnoreRowNum() {
-		return ignoreRowNum;
-	}
-	public void setIgnoreRowNum(int ignoreRowNum) {
-		this.ignoreRowNum = ignoreRowNum;
-	}
-
-}

+ 0 - 264
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/AbstractExcel2007Writer.java

@@ -1,264 +0,0 @@
-package com.x.okr.assemble.common.excel.writer;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Calendar;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipOutputStream;
-
-import org.apache.poi.hssf.util.CellReference;
-import org.apache.poi.ss.usermodel.DateUtil;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-
-/**
- * 抽象excel2007读入器,先构建.xlsx一张模板,改写模板中的sheet.xml,使用这种方法
- * 写入.xlsx文件,不需要太大的内存
- *
- */
-public abstract class AbstractExcel2007Writer {
-	
-	private SpreadsheetWriter sw;
-
-	/**
-	 * 写入电子表格的主要流程
-	 * @param fileName
-	 * @throws Exception
-	 */
-	@SuppressWarnings("resource")
-	public void process( String fileName ) throws Exception{
-		// 建立工作簿和电子表格对象
-		XSSFWorkbook wb = new XSSFWorkbook();
-		XSSFSheet sheet = wb.createSheet( "sheet1" );
-		// 持有电子表格数据的xml文件名 例如 /xl/worksheets/sheet1.xml
-		String sheetRef = sheet.getPackagePart().getPartName().getName();
-
-		// 保存模板
-		FileOutputStream os = new FileOutputStream( "template.xlsx" );
-		wb.write(os);
-		os.close();
-		
-		// 生成xml文件
-		File tmp = File.createTempFile( "sheet", ".xml" );
-		Writer fw = new FileWriter(tmp);
-		sw = new SpreadsheetWriter(fw);
-		generate();
-		fw.close();
-		
-		// 使用产生的数据替换模板
-		File templateFile = new File( "template.xlsx" );
-		FileOutputStream out = new FileOutputStream(fileName);
-		substitute(templateFile, tmp, sheetRef.substring(1), out);
-		out.close();
-		//删除文件之前调用一下垃圾回收器,否则无法删除模板文件
-		System.gc();
-		// 删除临时模板文件
-		if (templateFile.isFile()&&templateFile.exists()){
-			templateFile.delete();
-		}
-	}
-	
-	/**
-	 * 写入电子表格的主要流程
-	 * @param fileName
-	 * @throws Exception
-	 */
-	@SuppressWarnings("resource")
-	public void process( OutputStream out ) throws Exception{
-		// 建立工作簿和电子表格对象
-		XSSFWorkbook wb = new XSSFWorkbook();
-		XSSFSheet sheet = wb.createSheet( "sheet1" );
-		// 持有电子表格数据的xml文件名 例如 /xl/worksheets/sheet1.xml
-		String sheetRef = sheet.getPackagePart().getPartName().getName();
-
-		// 保存模板
-		FileOutputStream os = new FileOutputStream( "template.xlsx" );
-		wb.write(os);
-		os.close();
-		
-		// 生成xml文件
-		File tmp = File.createTempFile( "sheet", ".xml" );
-		Writer fw = new FileWriter(tmp);
-		sw = new SpreadsheetWriter(fw);
-		generate();
-		fw.close();
-		
-		// 使用产生的数据替换模板
-		File templateFile = new File( "template.xlsx" );
-		substitute(templateFile, tmp, sheetRef.substring(1), out);
-		out.close();
-		//删除文件之前调用一下垃圾回收器,否则无法删除模板文件
-		System.gc();
-		// 删除临时模板文件
-		if (templateFile.isFile()&&templateFile.exists()){
-			templateFile.delete();
-		}
-	}
-
-	/**
-	 * 类使用者应该使用此方法进行写操作
-	 * @throws Exception
-	 */
-	public abstract void generate() throws Exception;
-
-	public void beginSheet() throws IOException {
-		sw.beginSheet();
-	}
-
-	public void insertRow(int rowNum) throws IOException {
-		sw.insertRow(rowNum);
-	}
-
-	public void createCell(int columnIndex, String value) throws IOException {
-		sw.createCell(columnIndex, value, -1);
-	}
-
-	public void createCell(int columnIndex, double value) throws IOException {
-		sw.createCell(columnIndex, value, -1);
-	}
-
-	public void endRow() throws IOException {
-		sw.endRow();
-	}
-
-	public void endSheet() throws IOException {
-		sw.endSheet();
-	}
-
-	/**
-	 *
-	 * @param zipfile the template file
-	 * @param tmpfile the XML file with the sheet data
-	 * @param entry the name of the sheet entry to substitute, e.g. xl/worksheets/sheet1.xml
-	 * @param out the stream to write the result to
-	 */
-	@SuppressWarnings("resource")
-	private static void substitute(File zipfile, File tmpfile, String entry,
-			OutputStream out) throws IOException {
-		ZipFile zip = new ZipFile(zipfile);
-		ZipOutputStream zos = new ZipOutputStream(out);
-
-		@SuppressWarnings( "unchecked" )
-		Enumeration<ZipEntry> en = (Enumeration<ZipEntry>) zip.entries();
-		while (en.hasMoreElements()) {
-			ZipEntry ze = en.nextElement();
-			if (!ze.getName().equals(entry)) {
-				zos.putNextEntry(new ZipEntry(ze.getName()));
-				InputStream is = zip.getInputStream(ze);
-				copyStream(is, zos);
-				is.close();
-			}
-		}
-		zos.putNextEntry(new ZipEntry(entry));
-		InputStream is = new FileInputStream(tmpfile);
-		copyStream(is, zos);
-		is.close();
-		zos.close();
-	}
-
-	private static void copyStream(InputStream in, OutputStream out)
-			throws IOException {
-		byte[] chunk = new byte[1024];
-		int count;
-		while ((count = in.read(chunk)) >= 0) {
-			out.write(chunk, 0, count);
-		}
-	}
-
-	/**
-	 * 在写入器中写入电子表格
-	 * 
-	 */
-	public static class SpreadsheetWriter {
-		private final Writer _out;
-		private int _rownum;
-		private static String LINE_SEPARATOR = System.getProperty( "line.separator" );
-
-		public SpreadsheetWriter(Writer out) {
-			_out = out;
-		}
-
-		public void beginSheet() throws IOException {
-			_out.write( "<?xml version=\"1.0\" encoding=\"GB2312\"?>"
-							+ "<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">" );
-			_out.write( "<sheetData>"+LINE_SEPARATOR);
-		}
-
-		public void endSheet() throws IOException {
-			_out.write( "</sheetData>" );
-			_out.write( "</worksheet>" );
-		}
-
-		/**
-		 * 插入新行
-		 *
-		 * @param rownum 以0开始
-		 */
-		public void insertRow(int rownum) throws IOException {
-			_out.write( "<row r=\"" + (rownum + 1) + "\">"+LINE_SEPARATOR);
-			this._rownum = rownum;
-		}
-
-		/**
-		 * 插入行结束标志
-		 */
-		public void endRow() throws IOException {
-			_out.write( "</row>"+LINE_SEPARATOR);
-		}
-
-		/**
-		 * 插入新列
-		 * @param columnIndex
-		 * @param value
-		 * @param styleIndex
-		 * @throws IOException
-		 */
-		public void createCell(int columnIndex, String value, int styleIndex)
-				throws IOException {
-			String ref = new CellReference(_rownum, columnIndex)
-					.formatAsString();
-			_out.write( "<c r=\"" + ref + "\" t=\"inlineStr\"" );
-			if (styleIndex != -1)
-				_out.write( " s=\"" + styleIndex + "\"" );
-			_out.write( ">" );
-			_out.write( "<is><t>"+XMLEncoder.encode(value)+"</t></is>" );
-			_out.write( "</c>" );
-		}
-
-		public void createCell(int columnIndex, String value)
-				throws IOException {
-			createCell(columnIndex, value, -1);
-		}
-
-		public void createCell(int columnIndex, double value, int styleIndex)
-				throws IOException {
-			String ref = new CellReference(_rownum, columnIndex)
-					.formatAsString();
-			_out.write( "<c r=\"" + ref + "\" t=\"n\"" );
-			if (styleIndex != -1)
-				_out.write( " s=\"" + styleIndex + "\"" );
-			_out.write( ">" );
-			_out.write( "<v>" + value + "</v>" );
-			_out.write( "</c>" );
-		}
-
-		public void createCell(int columnIndex, double value)
-				throws IOException {
-			createCell(columnIndex, value, -1);
-		}
-
-		public void createCell(int columnIndex, Calendar value, int styleIndex)
-				throws IOException {
-			createCell(columnIndex, DateUtil.getExcelDate(value, false),
-					styleIndex);
-		}
-	}
-}

+ 0 - 63
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/Excel2003Writer.java

@@ -1,63 +0,0 @@
-package com.x.okr.assemble.common.excel.writer;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-
-public class Excel2003Writer {
-
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		try{	
-			//System.out.println( "开始写入excel2003...." );
-			writeExcel( "tes2003.xls" );
-			//System.out.println( "写完xcel2003" );
-		} catch (IOException e) {
-		
-		}
-	}
-	
-	
-	/**
-	 * 写入excel并填充内容,一个sheet只能写65536行以下,超出会报异常,写入时建议使用AbstractExcel2007Writer
-	 * @param fileName
-	 * @throws IOException
-	 */
-	@SuppressWarnings("resource")
-	public static void writeExcel(String fileName) throws IOException{
-			
-			// 创建excel2003对象
-			Workbook wb = new HSSFWorkbook();
-			
-			// 设置文件放置路径和文件名
-		    FileOutputStream fileOut = new FileOutputStream(fileName);
-		    // 创建新的表单
-		    Sheet sheet = wb.createSheet( "newsheet" );
-		    // 创建新行
-		    for(int i=0;i<20000;i++){
-			    Row row = sheet.createRow(i);
-			    // 创建单元格
-			    Cell cell = row.createCell(0);
-			    // 设置单元格值
-			    cell.setCellValue(1);
-			    row.createCell(1).setCellValue(1+i);
-			    row.createCell(2).setCellValue(true);
-			    row.createCell(3).setCellValue(0.43d);
-			    row.createCell(4).setCellValue('d');
-			    row.createCell(5).setCellValue( "" );
-			    row.createCell(6).setCellValue( "第七列"+i);
-			    row.createCell(7).setCellValue( "第八列"+i);
-		    }
-		    wb.write(fileOut);
-		    fileOut.close();
-	}
-
-
-}

+ 0 - 30
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/Excel2007WriterImpl.java

@@ -1,30 +0,0 @@
-package com.x.okr.assemble.common.excel.writer;
-public class Excel2007WriterImpl extends AbstractExcel2007Writer{	
-	/* 
-	 * 可根据需求重写此方法,对于单元格的小数或者日期格式,会出现精度问题或者日期格式转化问题,建议使用字符串插入方法
-	 * @see com.excel.ver2.AbstractExcel2007Writer#generate()
-	 */
-	@Override
-	public void generate()throws Exception {
-        //电子表格开始
-        beginSheet();
-        for (int rownum = 0; rownum < 100; rownum++) {
-        	//插入新行
-            insertRow(rownum);
-            //建立新单元格,索引值从0开始,表示第一列
-            createCell(0, "中国<" + rownum + "!" );
-            createCell(1, 34343.123456789);
-            createCell(2, "23.67%" );
-            createCell(3, "12:12:23" );
-            createCell(4, "2010-10-11 12:12:23" );
-            createCell(5, "true" );
-            createCell(6, "false" );
-          
-            //结束行
-            endRow();
-        }
-        //电子表格结束
-        endSheet();
-	}
-
-}

+ 0 - 203
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/WorkReportContentExportExcelWriter.java

@@ -1,203 +0,0 @@
-package com.x.okr.assemble.common.excel.writer;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.VerticalAlignment;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.util.CellRangeAddress;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import com.x.base.core.project.gson.XGsonBuilder;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.common.date.DateOperation;
-import com.x.okr.assemble.control.jaxrs.statistic.BaseAction.WoOkrStatisticReportContent;
-import com.x.okr.assemble.control.jaxrs.statistic.BaseAction.WoOkrStatisticReportContentCenter;
-import com.x.okr.assemble.control.schedule.entity.WorkReportProcessOpinionEntity;
-import com.x.okr.assemble.control.service.OkrWorkDetailInfoService;
-import com.x.okr.entity.OkrWorkDetailInfo;
-
-public class WorkReportContentExportExcelWriter {
-
-	private static Logger logger = LoggerFactory.getLogger(WorkReportContentExportExcelWriter.class);
-	private OkrWorkDetailInfoService okrWorkDetailInfoService = new OkrWorkDetailInfoService();
-	private Integer currentRowNumber = 0;
-
-	/**
-	 * 写入excel并填充内容,一个sheet只能写65536行以下,超出会报异常,写入时建议大量数据时使用AbstractExcel2007Writer
-	 * 
-	 * @param fileOut
-	 * @throws IOException
-	 */
-	public String writeExcel(List<WoOkrStatisticReportContentCenter> exportDataList) {
-		String centerTitle = null;
-		Integer workCountInCenter = 0;
-
-		Workbook wb = new HSSFWorkbook();// 创建excel2003对象
-		Sheet sheet = wb.createSheet("工作汇报情况统计表");// 创建新的工作表
-		Row row = null;
-		Cell cell = null;
-		// 表头//////////////////////////////////////////////////////////////
-		row = sheet.createRow(currentRowNumber);
-		row.createCell(0).setCellValue("工作类别");
-		row.createCell(1).setCellValue("重点事项");// 中心工作内容
-		row.createCell(2).setCellValue("责任组织");
-		row.createCell(3).setCellValue("事项分解及描述");// 具体工作内容
-		row.createCell(4).setCellValue("工作汇报情况");
-		row.createCell(5).setCellValue("工作汇报形式");
-		row.createCell(6).setCellValue("具体行动举措");
-		row.createCell(7).setCellValue("预期里程碑/阶段性结果标志");
-		row.createCell(8).setCellValue("截止目前完成情况");
-		row.createCell(9).setCellValue("下一步工作要点及需求");
-		row.createCell(10).setCellValue("督办评价");
-		row.createCell(11).setCellValue("领导评价");
-
-		currentRowNumber++;// 表头占一行
-
-		if (exportDataList != null && !exportDataList.isEmpty()) {
-			for (WoOkrStatisticReportContentCenter contentForCenter : exportDataList) {
-				if (contentForCenter.getContents() != null && !contentForCenter.getContents().isEmpty()) {
-					// 中心工作中所有工作的数量
-					workCountInCenter = contentForCenter.getContents().size();
-					centerTitle = contentForCenter.getTitle();
-
-					logger.info(">>>>中心工作[" + centerTitle + "]:" + currentRowNumber + " --> "
-							+ (currentRowNumber + workCountInCenter - 1));
-					sheet.addMergedRegion(
-							new CellRangeAddress(currentRowNumber, (currentRowNumber + workCountInCenter - 1), 0, 0));
-					sheet.addMergedRegion(
-							new CellRangeAddress(currentRowNumber, (currentRowNumber + workCountInCenter - 1), 1, 1));
-
-					for (WoOkrStatisticReportContent wrapOutOkrStatisticReportContent : contentForCenter
-							.getContents()) {
-						row = sheet.createRow(currentRowNumber);
-						row.createCell(0).setCellValue(wrapOutOkrStatisticReportContent.getWorkType());// "工作类别"
-						row.createCell(1).setCellValue(centerTitle);// "中心工作事项"
-						composeWorkToExcel(sheet, row, wrapOutOkrStatisticReportContent);
-					}
-				}
-			}
-
-			//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-			//////////////// 单元格样式设计 //////////////////
-			//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-			sheet.setDefaultColumnWidth(20);
-			sheet.setDefaultRowHeightInPoints(20);
-
-			CellStyle cellStyle = wb.createCellStyle();
-			cellStyle.setAlignment(HorizontalAlignment.CENTER); // 居中
-			cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 居中
-
-			sheet.setColumnWidth(0, 10 * 256);
-			sheet.setColumnWidth(1, 50 * 256);
-			sheet.setColumnWidth(2, 20 * 256);
-			sheet.setColumnWidth(3, 50 * 256);
-			sheet.setColumnWidth(4, 10 * 256);
-			sheet.setColumnWidth(5, 10 * 256);
-			sheet.setColumnWidth(6, 50 * 256);
-			sheet.setColumnWidth(7, 50 * 256);
-			sheet.setColumnWidth(8, 50 * 256);
-			sheet.setColumnWidth(9, 50 * 256);
-			sheet.setColumnWidth(10, 50 * 256);
-			sheet.setColumnWidth(11, 50 * 256);
-
-			Iterator<Row> rowIterator = sheet.rowIterator();
-			Iterator<Cell> cellIterator = null;
-
-			while (rowIterator.hasNext()) {
-				row = rowIterator.next();
-				row.setHeight((short) (40 * 20));
-
-				cellIterator = row.cellIterator();
-				while (cellIterator.hasNext()) {
-					cell = cellIterator.next();
-					cell.setCellStyle(cellStyle);
-				}
-			}
-		}
-		try {
-			String timeFlag = new DateOperation().getNowTimeChar();
-			File dir = new File("download/temp");
-			if (!dir.exists()) {
-				dir.mkdirs();
-			}
-			FileOutputStream fos = new FileOutputStream("download/temp/export_" + timeFlag + ".xls");
-			wb.write(fos);
-			fos.close();
-			wb.close();
-			return timeFlag;
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return "none";
-	}
-
-	private void composeWorkToExcel(Sheet sheet, Row row,
-			WoOkrStatisticReportContent wrapOutOkrStatisticReportContent) {
-		if (wrapOutOkrStatisticReportContent == null) {
-			return;
-		}
-
-		List<WorkReportProcessOpinionEntity> opinions = null;
-		OkrWorkDetailInfo detail = null;
-		String opinionContent = null;
-		Gson gson = XGsonBuilder.instance();
-		String opinion = null;
-
-		row.createCell(2).setCellValue(wrapOutOkrStatisticReportContent.getResponsibilityUnitName());// "责任组织"
-		row.createCell(5).setCellValue(wrapOutOkrStatisticReportContent.getCycleType());// "工作汇报形式"
-		row.createCell(8).setCellValue(wrapOutOkrStatisticReportContent.getProgressDescription());// "截止目前完成情况"
-		row.createCell(9).setCellValue(wrapOutOkrStatisticReportContent.getWorkPlan());// "下一步工作要点及需求"
-		row.createCell(10).setCellValue(wrapOutOkrStatisticReportContent.getAdminSuperviseInfo());// "督办评价"
-
-		try {
-			detail = okrWorkDetailInfoService.get(wrapOutOkrStatisticReportContent.getWorkId());
-		} catch (Exception e) {
-			logger.warn("system get work detail with work id got an exception.");
-			logger.error(e);
-		}
-		if (detail != null) {
-			row.createCell(6).setCellValue(detail.getProgressAction());// "具体行动举措"
-			row.createCell(7).setCellValue(detail.getLandmarkDescription());// "预期里程碑/阶段性结果标志"
-			row.createCell(3).setCellValue(detail.getWorkDetail());// "事项分解及描述"
-		}
-
-		row.createCell(4).setCellValue(wrapOutOkrStatisticReportContent.getReportStatus());// "工作汇报情况"
-
-		opinionContent = wrapOutOkrStatisticReportContent.getOpinion();
-		if (opinionContent != null) {
-			opinion = "";
-			opinions = gson.fromJson(opinionContent, new TypeToken<List<WorkReportProcessOpinionEntity>>() {
-			}.getType());
-			if (opinions != null) {
-				for (WorkReportProcessOpinionEntity workReportProcessOpinionEntity : opinions) {
-					opinion = opinion + workReportProcessOpinionEntity.getProcessorName() + ":"
-							+ workReportProcessOpinionEntity.getOpinion() + "\n";
-				}
-				row.createCell(11).setCellValue(opinion);// "领导评价"
-			} else {
-				row.createCell(11).setCellValue("");// "领导评价"
-			}
-		}
-		currentRowNumber++;
-		if (wrapOutOkrStatisticReportContent.getSubWork() != null
-				&& !wrapOutOkrStatisticReportContent.getSubWork().isEmpty()) {
-			for (WoOkrStatisticReportContent subWorks : wrapOutOkrStatisticReportContent.getSubWork()) {
-				row = sheet.createRow(currentRowNumber);
-				composeWorkToExcel(sheet, row, subWorks);
-			}
-		}
-	}
-}

+ 0 - 156
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/WorkReportStatusExportExcelWriter.java

@@ -1,156 +0,0 @@
-package com.x.okr.assemble.common.excel.writer;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.VerticalAlignment;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.util.CellRangeAddress;
-
-import com.x.okr.assemble.common.date.DateOperation;
-import com.x.okr.assemble.control.jaxrs.statistic.BaseAction.WoOkrStatisticReportStatusEntity;
-import com.x.okr.assemble.control.jaxrs.statistic.BaseAction.WoOkrStatisticReportStatusHeader;
-import com.x.okr.assemble.control.jaxrs.statistic.BaseAction.WoOkrStatisticReportStatusTable;
-
-public class WorkReportStatusExportExcelWriter {
-	
-	private Integer currentRowNumber = 0;
-	
-	/**
-	 * 写入excel并填充内容,一个sheet只能写65536行以下,超出会报异常,写入时建议大量数据时使用AbstractExcel2007Writer
-	 * @param fileOut
-	 * @throws IOException
-	 */
-	public String writeExcel( WoOkrStatisticReportStatusTable wrapOutOkrStatisticReportStatusTable ) {		
-		String unitName = null;
-		String centerTitle = null;
-		Integer centerCount = 0;
-		Integer workCount = 0;
-		List<WoOkrStatisticReportStatusHeader> headers = null;
-		List<WoOkrStatisticReportStatusEntity> contents = null;
-		Workbook wb = new HSSFWorkbook();// 创建excel2003对象
-		Sheet sheet = wb.createSheet( "工作汇报情况统计表" );// 创建新的工作表
-		Row row = null;
-		Cell cell = null;
-		
-		if( wrapOutOkrStatisticReportStatusTable != null ){
-
-			headers = wrapOutOkrStatisticReportStatusTable.getHeader();
-			contents = wrapOutOkrStatisticReportStatusTable.getContent();
-			
-			//表头//////////////////////////////////////////////////////////////
-			row = sheet.createRow( currentRowNumber );
-			if( headers != null  && !headers.isEmpty() ){
-				for( int i = 0; i<headers.size(); i++ ){
-					row.createCell( i ).setCellValue( headers.get( i ).getTitle() );//具体工作内容
-				}
-			}
-			currentRowNumber++;//表头占一行
-			
-			if( contents != null && !contents.isEmpty() ){
-				for( WoOkrStatisticReportStatusEntity unitEntity : contents ){
-					
-					unitName = unitEntity.getTitle();
-					centerCount = unitEntity.getRowCount();
-
-					//logger.info( "|------------"+ currentRowNumber + " --> " + ( currentRowNumber + centerCount -1 )+ ": 组织["+ unitName +"]" );
-					sheet.addMergedRegion( new CellRangeAddress( currentRowNumber, ( currentRowNumber + centerCount -1 ), 0, 0 ));
-					
-					for( WoOkrStatisticReportStatusEntity centerEntity : unitEntity.getArray() ){
-						centerTitle = centerEntity.getTitle();
-						workCount = centerEntity.getRowCount();
-						
-						//logger.info( "--|------" + currentRowNumber + " --> " + ( currentRowNumber + workCount -1 ) + ": 中心工作["+ centerTitle +"]");
-						sheet.addMergedRegion( new CellRangeAddress( currentRowNumber, ( currentRowNumber + workCount -1 ), 1, 1 ));
-						
-						for( WoOkrStatisticReportStatusEntity workEntity : centerEntity.getArray() ){				
-							row = sheet.createRow( currentRowNumber );
-							row.createCell(0).setCellValue( unitName );
-							row.createCell(1).setCellValue( centerTitle );
-							
-							//logger.info( "----|--"+ currentRowNumber +": 具体工作["+ workEntity.getTitle() +"]" );
-							row.createCell(2).setCellValue( workEntity.getTitle() );
-							if( workEntity.getFields() != null && !workEntity.getFields().isEmpty() ){
-								for( int i = 0; i<workEntity.getFields().size(); i++ ){
-									if( workEntity.getFields().get( i ).getReportStatus() == 0 ){
-										row.createCell( i+3 ).setCellValue("无内容");
-									}else if( workEntity.getFields().get( i ).getReportStatus() == 1 ){
-										row.createCell( i+3 ).setCellValue("有内容");
-									}else if( workEntity.getFields().get( i ).getReportStatus() == -1 ){
-										row.createCell( i+3 ).setCellValue("'--");
-									}else{
-										row.createCell( i+3 ).setCellValue("'--");
-									}
-								}
-							}
-							currentRowNumber++;
-						}
-					}
-				}
-				
-				//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-				////////////////                                单元格样式设计                                                                                       //////////////////
-				//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-				sheet.setDefaultColumnWidth( 20 );  
-				sheet.setDefaultRowHeightInPoints( 20 );
-				
-				CellStyle cellStyle = wb.createCellStyle();
-				cellStyle.setWrapText(true);
-				cellStyle.setAlignment( HorizontalAlignment.CENTER ); // 居中
-				cellStyle.setVerticalAlignment( VerticalAlignment.CENTER ); // 居中
-				
-				if( headers != null  && !headers.isEmpty() ){
-					for( int i = 0; i<headers.size(); i++ ){
-						if( i == 0 ){
-							sheet.setColumnWidth( 0, 10*256 ); 
-						}else if( i == 1 ){
-							sheet.setColumnWidth( 1, 50*256 );
-						}else if( i == 2 ){
-							sheet.setColumnWidth( 2, 50*256 ); 
-						}else{
-							sheet.setColumnWidth( i, 10*256 );
-						}
-					}
-				}
-				
-				Iterator<Row> rowIterator = sheet.rowIterator();
-				Iterator<Cell> cellIterator = null;
-				
-				while( rowIterator.hasNext() ){
-					row = rowIterator.next();
-					row.setHeight( (short) ( 40 * 20 ) );
-					
-					cellIterator = row.cellIterator();
-					while( cellIterator.hasNext() ){
-						cell = cellIterator.next();
-						cell.setCellStyle( cellStyle );
-					}
-				}
-			}
-			try {
-				String timeFlag = new DateOperation().getNowTimeChar();
-				File dir = new File("download/temp");
-				if( !dir.exists() ){
-					dir.mkdirs();
-				}
-				FileOutputStream fos = new FileOutputStream("download/temp/export_"+timeFlag+".xls");
-				wb.write( fos );
-				fos.close();
-			    wb.close();
-			    return timeFlag;
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		}
-		return "none";
-	}
-}

+ 0 - 48
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/common/excel/writer/XMLEncoder.java

@@ -1,48 +0,0 @@
-package com.x.okr.assemble.common.excel.writer;
-
-public class XMLEncoder {
-
-    private static final String[] xmlCode = new String[256];
-
-    static {
-        // Special characters
-        xmlCode['\''] = "'";
-        xmlCode['\"'] = "\""; // double quote
-        xmlCode['&'] = "&"; // ampersand
-        xmlCode['<'] = "<"; // lower than
-        xmlCode['>'] = ">"; // greater than
-    }
-
-    /**
-     * <p>
-     * Encode the given text into xml.
-     * </p>
-     * 
-     * @param string the text to encode
-     * @return the encoded string
-     */
-    public static String encode(String string) {
-        if (string == null) return "";
-        int n = string.length();
-        char character;
-        String xmlchar;
-        StringBuffer buffer = new StringBuffer();
-        // loop over all the characters of the String.
-        for (int i = 0; i < n; i++) {
-            character = string.charAt(i);
-            // the xmlcode of these characters are added to a StringBuffer one by one
-            try {
-                xmlchar = xmlCode[character];
-                if (xmlchar == null) {
-                    buffer.append(character);
-                } else {
-                    buffer.append(xmlCode[character]);
-                }
-            } catch (ArrayIndexOutOfBoundsException aioobe) {
-                buffer.append(character);
-            }
-        }
-        return buffer.toString();
-    }
-
-}

+ 0 - 24
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/AbstractFactory.java

@@ -1,24 +0,0 @@
-package com.x.okr.assemble.control;
-
-import com.x.base.core.container.EntityManagerContainer;
-
-public abstract class AbstractFactory {
-
-	private Business business;
-
-	public AbstractFactory( Business business ) throws Exception {
-		try {
-			if ( null == business ) {
-				throw new Exception( "business can not be null.  " );
-			}
-			this.business = business;
-		} catch ( Exception e ) {
-			throw new Exception( "can not instantiating factory." );
-		}
-	}
-
-	public EntityManagerContainer entityManagerContainer() throws Exception {
-		return this.business.entityManagerContainer();
-	}
-
-}

+ 0 - 33
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/ApplicationServletContextListener.java

@@ -1,33 +0,0 @@
-package com.x.okr.assemble.control;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.annotation.WebListener;
-
-import com.x.base.core.project.Context;
-
-@WebListener
-public class ApplicationServletContextListener implements ServletContextListener {
-
-	@Override
-	public void contextInitialized(ServletContextEvent servletContextEvent) {
-		try {
-			ThisApplication.context = Context.concrete(servletContextEvent);
-			ThisApplication.init();
-			ThisApplication.context().regist();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-	@Override
-	public void contextDestroyed(ServletContextEvent servletContextEvent) {
-		try {
-			ThisApplication.destroy();
-			ThisApplication.context.destrory(servletContextEvent);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 224
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/Business.java

@@ -1,224 +0,0 @@
-package com.x.okr.assemble.control;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.okr.assemble.control.factory.OkrAttachmentFileInfoFactory;
-import com.x.okr.assemble.control.factory.OkrCenterWorkInfoFactory;
-import com.x.okr.assemble.control.factory.OkrConfigSecretaryFactory;
-import com.x.okr.assemble.control.factory.OkrConfigSystemFactory;
-import com.x.okr.assemble.control.factory.OkrConfigWorkLevelFactory;
-import com.x.okr.assemble.control.factory.OkrConfigWorkTypeFactory;
-import com.x.okr.assemble.control.factory.OkrErrorSystemIdentityInfoFactory;
-import com.x.okr.assemble.control.factory.OkrStatisticReportContentFactory;
-import com.x.okr.assemble.control.factory.OkrStatisticReportStatusFactory;
-import com.x.okr.assemble.control.factory.OkrTaskFactory;
-import com.x.okr.assemble.control.factory.OkrTaskHandledFactory;
-import com.x.okr.assemble.control.factory.OkrUserInfoFactory;
-import com.x.okr.assemble.control.factory.OkrWorkAppraiseInfoFactory;
-import com.x.okr.assemble.control.factory.OkrWorkAuthorizeRecordFactory;
-import com.x.okr.assemble.control.factory.OkrWorkBaseInfoFactory;
-import com.x.okr.assemble.control.factory.OkrWorkChatFactory;
-import com.x.okr.assemble.control.factory.OkrWorkDetailInfoFactory;
-import com.x.okr.assemble.control.factory.OkrWorkDynamicsFactory;
-import com.x.okr.assemble.control.factory.OkrWorkPersonFactory;
-import com.x.okr.assemble.control.factory.OkrWorkPersonSearchFactory;
-import com.x.okr.assemble.control.factory.OkrWorkReportBaseInfoFactory;
-import com.x.okr.assemble.control.factory.OkrWorkReportDetailInfoFactory;
-import com.x.okr.assemble.control.factory.OkrWorkReportPersonLinkFactory;
-import com.x.okr.assemble.control.factory.OkrWorkReportProcessLogFactory;
-import com.x.organization.core.express.Organization;
-
-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 OkrStatisticReportContentFactory okrStatisticReportContentFactory;
-	private OkrStatisticReportStatusFactory okrStatisticReportStatusFactory;
-	
-	private OkrAttachmentFileInfoFactory okrAttachmentFileInfoFactory;
-	private OkrCenterWorkInfoFactory okrCenterWorkInfoFactory;
-	private OkrConfigSecretaryFactory okrConfigSecretaryFactory;
-	private OkrConfigSystemFactory okrConfigSystemFactory;
-	private OkrConfigWorkLevelFactory okrConfigWorkLevelFactory;
-	private OkrConfigWorkTypeFactory okrConfigWorkTypeFactory;
-	private OkrTaskFactory okrTaskFactory;
-	private OkrTaskHandledFactory okrTaskHandledFactory;
-	private OkrWorkAuthorizeRecordFactory okrWorkAuthorizeRecordFactory;
-	private OkrWorkBaseInfoFactory okrWorkBaseInfoFactory;
-	private OkrWorkAppraiseInfoFactory okrWorkAppraiseInfoFactory;
-	private OkrWorkDetailInfoFactory okrWorkDetailInfoFactory;
-	private OkrWorkDynamicsFactory okrWorkDynamicsFactory;
-	private OkrWorkPersonFactory okrWorkPersonFactory;
-	private OkrWorkPersonSearchFactory okrWorkPersonSearchFactory;
-	private OkrWorkReportBaseInfoFactory okrWorkReportBaseInfoFactory;
-	private OkrWorkReportDetailInfoFactory okrWorkReportDetailInfoFactory;
-	private OkrWorkReportPersonLinkFactory okrWorkReportPersonLinkFactory;
-	private OkrWorkReportProcessLogFactory okrWorkReportProcessLogFactory;
-	private OkrErrorSystemIdentityInfoFactory okrErrorSystemIdentityInfoFactory;
-	private OkrUserInfoFactory okrUserInfoFactory;
-	
-	
-	
-	private OkrWorkChatFactory okrWorkChatFactory;
-	
-	public Organization organization() throws Exception {
-		if (null == this.organization) {
-			this.organization = new Organization(ThisApplication.context());
-		}
-		return organization;
-	}
-
-	public OkrWorkAppraiseInfoFactory okrWorkAppraiseInfoFactory() throws Exception {
-		if (null == this.okrWorkAppraiseInfoFactory) {
-			this.okrWorkAppraiseInfoFactory = new OkrWorkAppraiseInfoFactory( this );
-		}
-		return okrWorkAppraiseInfoFactory;
-	}
-
-	public OkrErrorSystemIdentityInfoFactory okrErrorSystemIdentityInfoFactory() throws Exception {
-		if (null == this.okrErrorSystemIdentityInfoFactory) {
-			this.okrErrorSystemIdentityInfoFactory = new OkrErrorSystemIdentityInfoFactory( this );
-		}
-		return okrErrorSystemIdentityInfoFactory;
-	}
-	public OkrStatisticReportStatusFactory okrStatisticReportStatusFactory() throws Exception {
-		if (null == this.okrStatisticReportStatusFactory) {
-			this.okrStatisticReportStatusFactory = new OkrStatisticReportStatusFactory( this );
-		}
-		return okrStatisticReportStatusFactory;
-	}
-	public OkrUserInfoFactory okrUserInfoFactory() throws Exception {
-		if (null == this.okrUserInfoFactory) {
-			this.okrUserInfoFactory = new OkrUserInfoFactory( this );
-		}
-		return okrUserInfoFactory;
-	} 
-	public OkrStatisticReportContentFactory okrStatisticReportContentFactory() throws Exception {
-		if (null == this.okrStatisticReportContentFactory) {
-			this.okrStatisticReportContentFactory = new OkrStatisticReportContentFactory( this );
-		}
-		return okrStatisticReportContentFactory;
-	} 
-	public OkrWorkChatFactory okrWorkChatFactory() throws Exception {
-		if (null == this.okrWorkChatFactory) {
-			this.okrWorkChatFactory = new OkrWorkChatFactory( this );
-		}
-		return okrWorkChatFactory;
-	} 
-	public OkrAttachmentFileInfoFactory okrAttachmentFileInfoFactory() throws Exception {
-		if (null == this.okrAttachmentFileInfoFactory) {
-			this.okrAttachmentFileInfoFactory = new OkrAttachmentFileInfoFactory( this );
-		}
-		return okrAttachmentFileInfoFactory;
-	} 
-	public OkrCenterWorkInfoFactory okrCenterWorkInfoFactory() throws Exception {
-		if (null == this.okrCenterWorkInfoFactory) {
-			this.okrCenterWorkInfoFactory = new OkrCenterWorkInfoFactory( this );
-		}
-		return okrCenterWorkInfoFactory;
-	}
-	public OkrConfigWorkLevelFactory okrConfigWorkLevelFactory() throws Exception {
-		if (null == this.okrConfigWorkLevelFactory) {
-			this.okrConfigWorkLevelFactory = new OkrConfigWorkLevelFactory( this );
-		}
-		return okrConfigWorkLevelFactory;
-	}
-	public OkrConfigSecretaryFactory okrConfigSecretaryFactory() throws Exception {
-		if (null == this.okrConfigSecretaryFactory) {
-			this.okrConfigSecretaryFactory = new OkrConfigSecretaryFactory( this );
-		}
-		return okrConfigSecretaryFactory;
-	}
-	public OkrConfigSystemFactory okrConfigSystemFactory() throws Exception {
-		if (null == this.okrConfigSystemFactory) {
-			this.okrConfigSystemFactory = new OkrConfigSystemFactory( this );
-		}
-		return okrConfigSystemFactory;
-	}
-	public OkrConfigWorkTypeFactory okrConfigWorkTypeFactory() throws Exception {
-		if (null == this.okrConfigWorkTypeFactory) {
-			this.okrConfigWorkTypeFactory = new OkrConfigWorkTypeFactory( this );
-		}
-		return okrConfigWorkTypeFactory;
-	}
-	public OkrTaskFactory okrTaskFactory() throws Exception {
-		if (null == this.okrTaskFactory) {
-			this.okrTaskFactory = new OkrTaskFactory( this );
-		}
-		return okrTaskFactory;
-	}
-	public OkrTaskHandledFactory okrTaskHandledFactory() throws Exception {
-		if (null == this.okrTaskHandledFactory) {
-			this.okrTaskHandledFactory = new OkrTaskHandledFactory( this );
-		}
-		return okrTaskHandledFactory;
-	}
-	public OkrWorkAuthorizeRecordFactory okrWorkAuthorizeRecordFactory() throws Exception {
-		if (null == this.okrWorkAuthorizeRecordFactory) {
-			this.okrWorkAuthorizeRecordFactory = new OkrWorkAuthorizeRecordFactory( this );
-		}
-		return okrWorkAuthorizeRecordFactory;
-	}
-	public OkrWorkBaseInfoFactory okrWorkBaseInfoFactory() throws Exception {
-		if (null == this.okrWorkBaseInfoFactory) {
-			this.okrWorkBaseInfoFactory = new OkrWorkBaseInfoFactory( this );
-		}
-		return okrWorkBaseInfoFactory;
-	}
-	public OkrWorkDetailInfoFactory okrWorkDetailInfoFactory() throws Exception {
-		if (null == this.okrWorkDetailInfoFactory) {
-			this.okrWorkDetailInfoFactory = new OkrWorkDetailInfoFactory( this );
-		}
-		return okrWorkDetailInfoFactory;
-	}
-	public OkrWorkDynamicsFactory okrWorkDynamicsFactory() throws Exception {
-		if (null == this.okrWorkDynamicsFactory) {
-			this.okrWorkDynamicsFactory = new OkrWorkDynamicsFactory( this );
-		}
-		return okrWorkDynamicsFactory;
-	}
-	public OkrWorkPersonFactory okrWorkPersonFactory() throws Exception {
-		if (null == this.okrWorkPersonFactory) {
-			this.okrWorkPersonFactory = new OkrWorkPersonFactory( this );
-		}
-		return okrWorkPersonFactory;
-	}
-	public OkrWorkPersonSearchFactory okrWorkPersonSearchFactory() throws Exception {
-		if (null == this.okrWorkPersonSearchFactory) {
-			this.okrWorkPersonSearchFactory = new OkrWorkPersonSearchFactory( this );
-		}
-		return okrWorkPersonSearchFactory;
-	}
-	public OkrWorkReportBaseInfoFactory okrWorkReportBaseInfoFactory() throws Exception {
-		if (null == this.okrWorkReportBaseInfoFactory) {
-			this.okrWorkReportBaseInfoFactory = new OkrWorkReportBaseInfoFactory( this );
-		}
-		return okrWorkReportBaseInfoFactory;
-	}
-	public OkrWorkReportDetailInfoFactory okrWorkReportDetailInfoFactory() throws Exception {
-		if (null == this.okrWorkReportDetailInfoFactory) {
-			this.okrWorkReportDetailInfoFactory = new OkrWorkReportDetailInfoFactory( this );
-		}
-		return okrWorkReportDetailInfoFactory;
-	} 
-	public OkrWorkReportPersonLinkFactory okrWorkReportPersonLinkFactory() throws Exception {
-		if (null == this.okrWorkReportPersonLinkFactory) {
-			this.okrWorkReportPersonLinkFactory = new OkrWorkReportPersonLinkFactory( this );
-		}
-		return okrWorkReportPersonLinkFactory;
-	} 
-	public OkrWorkReportProcessLogFactory okrWorkReportProcessLogFactory() throws Exception {
-		if (null == this.okrWorkReportProcessLogFactory) {
-			this.okrWorkReportProcessLogFactory = new OkrWorkReportProcessLogFactory( this );
-		}
-		return okrWorkReportProcessLogFactory;
-	}
-}

+ 0 - 92
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/OkrUserCache.java

@@ -1,92 +0,0 @@
-package com.x.okr.assemble.control;
-
-import java.io.Serializable;
-
-import com.x.base.core.project.gson.GsonPropertyObject;
-
-public class OkrUserCache extends GsonPropertyObject implements Serializable {	
-
-	private static final long serialVersionUID = 1L;
-	/**
-	 * 操作用户的姓名
-	 */
-	private String operationUserName = null;
-	/**
-	 * 操作用户的组织名称
-	 */
-	private String operationUserUnitName = null;
-	/**
-	 * 操作用户的顶层组织名称
-	 */
-	private String operationUserTopUnitName = null;
-	/**
-	 * 代理用户的身份名称
-	 */
-	private String loginIdentityName = null;
-	/**
-	 * 代理用户的姓名
-	 */
-	private String loginUserName = null;
-	/**
-	 * 代理用户的组织名称
-	 */
-	private String loginUserUnitName = null;
-	/**
-	 * 代理用户的顶层组织名称
-	 */
-	private String loginUserTopUnitName = null;
-	
-	private boolean okrManager = false; //系统管理员
-
-	
-	public boolean isOkrManager() {
-		return okrManager;
-	}
-	public void setOkrManager(boolean okrManager) {
-		this.okrManager = okrManager;
-	}
-	
-	public String getOperationUserName() {
-		return operationUserName;
-	}
-	public void setOperationUserName(String operationUserName) {
-		this.operationUserName = operationUserName;
-	}
-	public String getOperationUserUnitName() {
-		return operationUserUnitName;
-	}
-	public void setOperationUserUnitName(String operationUserUnitName) {
-		this.operationUserUnitName = operationUserUnitName;
-	}
-	public String getOperationUserTopUnitName() {
-		return operationUserTopUnitName;
-	}
-	public void setOperationUserTopUnitName(String operationUserTopUnitName) {
-		this.operationUserTopUnitName = operationUserTopUnitName;
-	}
-	public String getLoginIdentityName() {
-		return loginIdentityName;
-	}
-	public void setLoginIdentityName(String loginIdentityName) {
-		this.loginIdentityName = loginIdentityName;
-	}
-	public String getLoginUserName() {
-		return loginUserName;
-	}
-	public void setLoginUserName(String loginUserName) {
-		this.loginUserName = loginUserName;
-	}
-	public String getLoginUserUnitName() {
-		return loginUserUnitName;
-	}
-	public void setLoginUserUnitName(String loginUserUnitName) {
-		this.loginUserUnitName = loginUserUnitName;
-	}
-	public String getLoginUserTopUnitName() {
-		return loginUserTopUnitName;
-	}
-	public void setLoginUserTopUnitName(String loginUserTopUnitName) {
-		this.loginUserTopUnitName = loginUserTopUnitName;
-	}
-	
-}

+ 0 - 97
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/ThisApplication.java

@@ -1,97 +0,0 @@
-package com.x.okr.assemble.control;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.x.base.core.project.Context;
-import com.x.base.core.project.cache.CacheManager;
-import com.x.base.core.project.config.Config;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.control.jaxrs.queue.QueueWorkDynamicRecord;
-import com.x.okr.assemble.control.jaxrs.workimport.CacheImportFileStatus;
-import com.x.okr.assemble.control.schedule.ErrorIdentityCheckTask;
-import com.x.okr.assemble.control.schedule.St_CenterWorkCount;
-import com.x.okr.assemble.control.schedule.St_WorkReportContent;
-import com.x.okr.assemble.control.schedule.St_WorkReportStatus;
-import com.x.okr.assemble.control.schedule.WorkProgressConfirm;
-import com.x.okr.assemble.control.schedule.WorkReportCollectCreate;
-import com.x.okr.assemble.control.schedule.WorkReportCreate;
-import com.x.okr.assemble.control.service.OkrConfigSystemService;
-
-public class ThisApplication {
-
-	private ThisApplication() {
-		// nothing
-	}
-
-	protected static Context context;
-
-	public static Map<String, CacheImportFileStatus> importFileStatusMap = new HashMap<String, CacheImportFileStatus>();
-
-	public static final String OKRMANAGER = "OKRManager";
-
-	public static final QueueWorkDynamicRecord queueWorkDynamicRecord = new QueueWorkDynamicRecord();
-
-	public static Context context() {
-		return context;
-	}
-
-	public static void init() {
-		try {
-			CacheManager.init(context.clazz().getSimpleName());
-			LoggerFactory.setLevel(Config.logLevel().x_okr_assemble_control());
-			context().startQueue(queueWorkDynamicRecord);
-			new OkrConfigSystemService().initAllSystemConfig();
-			// 每天凌晨2点执行一次
-			context.schedule(St_WorkReportContent.class, "0 0 2 * * ?");
-			// 每天凌晨2点30执行一次
-			context.schedule(St_WorkReportStatus.class, "0 30 2 * * ?");
-			// 每天5点至20点间,每10分钟执行一次
-			context.schedule(St_CenterWorkCount.class, "0 0/10 5-20 * * ?");
-			// 每天7点至17点间,每10分钟执行一次
-			context.schedule(WorkReportCreate.class, "0 0/10 7-17 * * ?");
-			// 每天7点至17点间,每小时执行一次
-			context.schedule(WorkProgressConfirm.class, "0 0 7-17/1 * * ?");
-			// 每天7点至17点间,每10分钟执行一次
-			context.schedule(WorkReportCollectCreate.class, "0 0/10 7-17 * * ?");
-			// 每天凌晨2点执行一次
-			context.schedule(ErrorIdentityCheckTask.class, "0 0 2 * * ?");
-
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-	public static void destroy() {
-		try {
-			CacheManager.shutdown();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-	public static String getOkrUserInfoCacheKey(String personName) {
-		return "OkrUserInfo.withPerson." + personName;
-	}
-
-	public static Map<String, CacheImportFileStatus> getImportFileStatusMap() {
-		return importFileStatusMap;
-	}
-
-	public static void setImportFileStatusMap(Map<String, CacheImportFileStatus> importFileStatusMap) {
-		ThisApplication.importFileStatusMap = importFileStatusMap;
-	}
-
-	/**
-	 * 根据用户姓名,获取一个用户登录信息缓存
-	 * 
-	 * @param name
-	 * @return
-	 */
-	public static CacheImportFileStatus getCacheImportFileStatusElementByKey(String key) {
-		if (importFileStatusMap == null) {
-			importFileStatusMap = new HashMap<String, CacheImportFileStatus>();
-		}
-		return importFileStatusMap.get(key);
-	}
-}

+ 0 - 42
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/webservice/WebservicesClient.java

@@ -1,42 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.webservice;
-
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
-
-import com.google.gson.JsonElement;
-import com.x.okr.assemble.control.ThisApplication;
-
-public class WebservicesClient {
-	public Object[] jaxws(String wsdl, String method, Object... objects) {
-		Object[] result = null;
-		try {
-			JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
-			Client client = dcf.createClient(wsdl);
-			result = client.invoke(method, objects);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return result;
-	}
-
-	public JsonElement jaxrsGet(String applicationName, String uri) throws Exception {
-		Class<?> clz = Class.forName("com.x.base.core.project." + applicationName);
-		return ThisApplication.context().applications().getQuery(clz, uri).getData();
-	}
-
-	public JsonElement jaxrsPut(String applicationName, String uri, Object o) throws Exception {
-		Class<?> clz = Class.forName("com.x.base.core.project." + applicationName);
-		return ThisApplication.context().applications().putQuery(clz, uri, o).getData();
-	}
-
-	public JsonElement jaxrsPost(String applicationName, String uri, Object o) throws Exception {
-		Class<?> clz = Class.forName("com.x.base.core.project." + applicationName);
-		return ThisApplication.context().applications().postQuery(clz, uri, o).getData();
-	}
-
-	public JsonElement jaxrsDelete(String applicationName, String uri, Object o) throws Exception {
-		Class<?> clz = Class.forName("com.x.base.core.project." + applicationName);
-		return ThisApplication.context().applications().deleteQuery(clz, uri).getData();
-	}
-
-}

+ 0 - 25
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/webservice/sms/SmsMessage.java

@@ -1,25 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.webservice.sms;
-
-public class SmsMessage {	
-	String UNID = null;
-	String CONTENT = null;
-	
-	public SmsMessage(String uNID, String cONTENT) {
-		super();
-		UNID = uNID;
-		CONTENT = cONTENT;
-	}
-	public String getUNID() {
-		return UNID;
-	}
-	public String getCONTENT() {
-		return CONTENT;
-	}
-	public void setUNID(String uNID) {
-		UNID = uNID;
-	}
-	public void setCONTENT(String cONTENT) {
-		CONTENT = cONTENT;
-	}
-	
-}

+ 0 - 57
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/webservice/sms/SmsMessageOperator.java

@@ -1,57 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.webservice.sms;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.okr.assemble.control.dataadapter.webservice.WebservicesClient;
-import com.x.okr.assemble.control.service.OkrConfigSystemService;
-import com.x.okr.assemble.control.service.OkrUserManagerService;
-
-public class SmsMessageOperator {
-	
-	public static  OkrUserManagerService okrUserManagerService = new OkrUserManagerService();
-	
-	public static OkrConfigSystemService okrConfigSystemService = new OkrConfigSystemService();
-	
-	public static Boolean sendWithPersonName( String personName, String message ) {
-		String unique = null;
-		try {
-			unique = okrUserManagerService.getUniqueWithPerson(personName);
-			sendWithUnique(unique, message);
-		} catch (Exception e1) {
-			System.out.println("system query employee unique with person name  got an exception!");
-			e1.printStackTrace();
-			return false;
-		}
-		return false;
-	}
-	
-	public static Boolean sendWithUnique( String unique, String message ) {
-		if( StringUtils.isNotEmpty( unique )) {
-			String SMS_WSDL = null;
-			WebservicesClient webservicesClient = new WebservicesClient();
-			try {
-				SMS_WSDL = okrConfigSystemService.getValueWithConfigCode("SMS_WSDL");
-			} catch (Exception e) {
-				System.out.println("okr system get parameter named 'SMS_WSDL' got an exception!");
-				e.printStackTrace();
-			}
-			
-			message = "O2OA_OKR message: " + message;
-			
-			if(StringUtils.isNotEmpty(SMS_WSDL) && !"NONE".equalsIgnoreCase( SMS_WSDL )) {
-				try {
-					Object result = webservicesClient.jaxws( SMS_WSDL, "SENDSMS", unique, message);
-					System.out.println("Message send successful! result:" + result.toString());
-					return true;
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-			}else {
-				System.out.println("Message can not send, because sms wsdl not defind!");
-			}
-		}else {
-			System.out.println("Message can not send, because employee unique is empty!");
-		}
-		return false;
-	}
-}

+ 0 - 74
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/wftask/WfReadCountGetter.java

@@ -1,74 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.wftask;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import com.x.base.core.project.x_processplatform_assemble_surface;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.connection.ActionResponse;
-import com.x.base.core.project.gson.GsonPropertyObject;
-import com.x.okr.assemble.control.ThisApplication;
-import com.x.okr.assemble.control.service.OkrConfigSystemService;
-
-/**
- * 获取指定用户所有的待阅数量信息
- * 
- * @author O2LEE
- */
-public class WfReadCountGetter {
-	
-	public static OkrConfigSystemService okrConfigSystemService = new OkrConfigSystemService();
-	
-	public Long countWithProcess(String person) throws Exception {
-		String APPRAISE_WORKFLOW_ID = null;
-		
-		try {
-			APPRAISE_WORKFLOW_ID = okrConfigSystemService.getValueWithConfigCode("APPRAISE_WORKFLOW_ID");
-		} catch (Exception e) {
-			System.out.println("获取流程ID参数发生异常");
-			e.printStackTrace();
-		}
-		
-		if( StringUtils.isNotEmpty(APPRAISE_WORKFLOW_ID)) {
-			JsonParser jsonParser = new JsonParser();
-			String json = "{";
-			json  +=            "\"credentialList\":[";
-			json  +=              "'"+person+"'";
-			json +=              "],";
-			json  +=            "\"appliationList\":[],";
-			json  +=            "\"processList\":[";
-			json  +=              "'"+APPRAISE_WORKFLOW_ID+"'";
-			json +=              "]";
-			json +=         "}";
-			
-			String serviceUri = "read/count/filter";
-			JsonElement data = jsonParser.parse( json ); // 将json字符串转换成JsonElement
-			ActionResponse resp = ThisApplication.context().applications().postQuery(
-					x_processplatform_assemble_surface.class, serviceUri, data
-			);
-			
-			Wo wo = resp.getData( Wo.class );
-//			if( wo != null ){
-//				System.out.println(">>>>>>>>>>>>>>获取到用户的待阅(READ)数量:" + wo.count + ",  指定流程ID:" + APPRAISE_WORKFLOW_ID );
-//			}
-			return wo.count;
-		}
-		return 0L;
-	}
-	
-	public static class Wo extends GsonPropertyObject {
-
-		@FieldDescribe("待办数量")
-		private Long count = 0L;
-
-		public Long getCount() {
-			return count;
-		}
-
-		public void setCount(Long count) {
-			this.count = count;
-		}
-
-	}
-}

+ 0 - 74
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/wftask/WfTaskCountGetter.java

@@ -1,74 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.wftask;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import com.x.base.core.project.x_processplatform_assemble_surface;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.connection.ActionResponse;
-import com.x.base.core.project.gson.GsonPropertyObject;
-import com.x.okr.assemble.control.ThisApplication;
-import com.x.okr.assemble.control.service.OkrConfigSystemService;
-
-/**
- * 获取指定用户所有的待办数量信息
- * 
- * @author O2LEE
- */
-public class WfTaskCountGetter {
-	
-	public static OkrConfigSystemService okrConfigSystemService = new OkrConfigSystemService();
-	
-	public Long countWithProcess(String person) throws Exception {
-		String APPRAISE_WORKFLOW_ID = null;
-		
-		try {
-			APPRAISE_WORKFLOW_ID = okrConfigSystemService.getValueWithConfigCode("APPRAISE_WORKFLOW_ID");
-		} catch (Exception e) {
-			System.out.println("获取流程ID参数发生异常");
-			e.printStackTrace();
-		}
-		
-		if( StringUtils.isNotEmpty(APPRAISE_WORKFLOW_ID)) {
-			JsonParser jsonParser = new JsonParser();
-			String json = "{";
-			json  +=            "\"credentialList\":[";
-			json  +=              "'"+person+"'";
-			json +=              "],";
-			json  +=            "\"appliationList\":[],";
-			json  +=            "\"processList\":[";
-			json  +=              "'"+APPRAISE_WORKFLOW_ID+"'";
-			json +=              "]";
-			json +=         "}";
-			
-			String serviceUri = "task/count/filter";
-			JsonElement data = jsonParser.parse( json ); // 将json字符串转换成JsonElement
-			ActionResponse resp = ThisApplication.context().applications().postQuery(
-					x_processplatform_assemble_surface.class, serviceUri, data
-			);
-			
-			Wo wo = resp.getData( Wo.class );
-//			if( wo != null ){
-//				System.out.println(">>>>>>>>>>>>>>获取到用户的待办(TASK)数量:" + wo.count + ",  指定流程ID:" + APPRAISE_WORKFLOW_ID );
-//			}
-			return wo.count;
-		}
-		return 0L;
-	}
-	
-	public static class Wo extends GsonPropertyObject {
-
-		@FieldDescribe("待办数量")
-		private Long count = 0L;
-
-		public Long getCount() {
-			return count;
-		}
-
-		public void setCount(Long count) {
-			this.count = count;
-		}
-
-	}
-}

+ 0 - 251
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/workflow/WorkComplexGetter.java

@@ -1,251 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.workflow;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.x_processplatform_assemble_surface;
-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.connection.ActionResponse;
-import com.x.base.core.project.gson.GsonPropertyObject;
-import com.x.okr.assemble.control.ThisApplication;
-import com.x.processplatform.core.entity.content.Read;
-import com.x.processplatform.core.entity.content.Task;
-import com.x.processplatform.core.entity.content.TaskCompleted;
-import com.x.processplatform.core.entity.content.Work;
-import com.x.processplatform.core.entity.content.WorkLog;
-import com.x.processplatform.core.entity.element.ActivityType;
-
-
-/**
- * 获取工作流状态以及下一步处理人的服务
- * 
- * @author O2LEE
- */
-public class WorkComplexGetter {
-	
-	public Wo getWorkComplex( String workId ) throws Exception {
-		String serviceUri = "work/" + workId;
-		ActionResponse resp = ThisApplication.context().applications().getQuery(
-				x_processplatform_assemble_surface.class, serviceUri
-		);
-		Wo wo = resp.getData( Wo.class );
-		return wo;
-	}
-	
-	public static class Wo extends GsonPropertyObject {
-
-		@FieldDescribe("活动节点")
-		private WoActivity activity;
-
-		@FieldDescribe("工作")
-		private WoWork work;
-
-		@FieldDescribe("待办对象列表")
-		private List<WoTask> taskList = new ArrayList<>();
-		
-		@FieldDescribe("工作日志对象")
-		private List<WoWorkLog> workLogList = new ArrayList<>();
-		
-		public WoActivity getActivity() {
-			return activity;
-		}
-
-		public WoWork getWork() {
-			return work;
-		}
-
-		public List<WoWorkLog> getWorkLogList() {
-			return workLogList;
-		}
-
-		public void setActivity(WoActivity activity) {
-			this.activity = activity;
-		}
-
-		public void setWork(WoWork work) {
-			this.work = work;
-		}
-
-		public void setWorkLogList(List<WoWorkLog> workLogList) {
-			this.workLogList = workLogList;
-		}
-
-		public List<WoTask> getTaskList() {
-			return taskList;
-		}
-
-		public void setTaskList(List<WoTask> taskList) {
-			this.taskList = taskList;
-		}		
-	}
-	
-	public static class WoActivity extends GsonPropertyObject {
-
-		private String id;
-
-		private String name;
-
-		private String description;
-
-		private String alias;
-
-		private String position;
-
-		private ActivityType activityType;
-
-		private String resetRange;
-
-		private Integer resetCount;
-
-		public String getName() {
-			return name;
-		}
-
-		public void setName(String name) {
-			this.name = name;
-		}
-
-		public String getDescription() {
-			return description;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-
-		public String getAlias() {
-			return alias;
-		}
-
-		public void setAlias(String alias) {
-			this.alias = alias;
-		}
-
-		public String getPosition() {
-			return position;
-		}
-
-		public void setPosition(String position) {
-			this.position = position;
-		}
-
-		public ActivityType getActivityType() {
-			return activityType;
-		}
-
-		public void setActivityType(ActivityType activityType) {
-			this.activityType = activityType;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public Integer getResetCount() {
-			return resetCount;
-		}
-
-		public void setResetCount(Integer resetCount) {
-			this.resetCount = resetCount;
-		}
-
-		public String getResetRange() {
-			return resetRange;
-		}
-
-		public void setResetRange(String resetRange) {
-			this.resetRange = resetRange;
-		}
-
-	}
-
-	public static class WoWork extends Work {
-
-		private static final long serialVersionUID = 3269592171662996253L;
-
-		static WrapCopier<Work, WoWork> copier = WrapCopierFactory.wo(Work.class, WoWork.class, null,
-				JpaObject.FieldsInvisible);
-	}
-	
-	public static class WoWorkLog extends WorkLog {
-
-		private static final long serialVersionUID = 1307569946729101786L;
-
-		public static WrapCopier<WorkLog, WoWorkLog> copier = WrapCopierFactory.wo(WorkLog.class, WoWorkLog.class, null,
-				JpaObject.FieldsInvisible);
-
-		private List<WoTaskCompleted> taskCompletedList;
-
-		private List<WoTask> taskList;
-
-		private Integer currentTaskIndex;
-
-		public Integer getCurrentTaskIndex() {
-			return currentTaskIndex;
-		}
-
-		public void setCurrentTaskIndex(Integer currentTaskIndex) {
-			this.currentTaskIndex = currentTaskIndex;
-		}
-
-		public List<WoTaskCompleted> getTaskCompletedList() {
-			return taskCompletedList;
-		}
-
-		public void setTaskCompletedList(List<WoTaskCompleted> taskCompletedList) {
-			this.taskCompletedList = taskCompletedList;
-		}
-
-		public List<WoTask> getTaskList() {
-			return taskList;
-		}
-
-		public void setTaskList(List<WoTask> taskList) {
-			this.taskList = taskList;
-		}
-
-	}
-	
-	public static class WoTask extends Task {
-
-		private static final long serialVersionUID = 2279846765261247910L;
-
-		public static WrapCopier<Task, WoTask> copier = WrapCopierFactory.wo(Task.class, WoTask.class, null,
-				JpaObject.FieldsInvisible);
- 
-	}
-
-	public static class WoRead extends Read {
-
-		private static final long serialVersionUID = -8067704098385000667L;
-
-		public static WrapCopier<Read, WoRead> copier = WrapCopierFactory.wo(Read.class, WoRead.class, null,
-				JpaObject.FieldsInvisible);
-
-	}
-	
-	public static class WoTaskCompleted extends TaskCompleted {
-
-		private static final long serialVersionUID = -7253999118308715077L;
-
-		public static WrapCopier<TaskCompleted, WoTaskCompleted> copier = WrapCopierFactory.wo(TaskCompleted.class,
-				WoTaskCompleted.class, null, JpaObject.FieldsInvisible);
-		private Long rank;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-	}
-}

+ 0 - 62
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/workflow/WorkFlowReaderAdder.java

@@ -1,62 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.workflow;
-
-import java.io.UnsupportedEncodingException;
-import java.util.List;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import com.x.base.core.project.x_processplatform_assemble_surface;
-import com.x.base.core.project.connection.ActionResponse;
-import com.x.base.core.project.tools.ListTools;
-import com.x.okr.assemble.control.ThisApplication;
-
-/**
- * 为工作流添加阅读权限
- * 
- * @author O2LEE
- */
-public class WorkFlowReaderAdder {
-	
-	/**
-	 * 为工作流添加阅读权限
-	 * @param data
-	 * @return
-	 * @throws UnsupportedEncodingException
-	 * @throws Exception
-	 */
-	public void add( String wf_workId, List<String> identities ) throws UnsupportedEncodingException, Exception {
-		if( ListTools.isEmpty(identities )) {
-			return;
-		}
-		JsonParser jsonParser = new JsonParser();
-		String json = "{";
-		json  +=            "\"notify\": false,";
-		json  +=            "\"identityList\":[";
-		for(int i=0; i< identities.size() ; i++ ) {
-			if(i == 0 ) {
-				json  +=           "'"+ identities.get(i) +"'";
-			}else {
-				json  +=           ", '"+ identities.get(i) +"'";
-			}
-		}
-		json +=              "]";
-		json +=         "}";
-		/**
-		 * {
-		 * 		"notify": false,
-		 *  		"identityList":[
-		 *  					'叶洪@84f71856-6447-4714-b616-64949e6e21c0@I', 
-		 *  					'金飞@50ab9f6f-6690-4972-ae50-c5c105316481@I', 
-		 *  					'金飞@50ab9f6f-6690-4972-ae50-c5c105316452@I', 
-		 *  					'昌威@0c5e3d66-3271-4815-b7b4-9be2370ce35ef@I', 
-		 *  					'张剑@c59fc8f0-e04c-4c92-92a9-42321c57883f@I'
-		 * 		]
-		 *  }
-		 */
-		JsonElement data = jsonParser.parse( json ); // 将json字符串转换成JsonElement
-		ActionResponse resp = ThisApplication.context().applications().postQuery(
-				x_processplatform_assemble_surface.class, "read/work/" + wf_workId ,  data
-		);
-		return ;
-	}
-}

+ 0 - 35
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/dataadapter/workflow/WorkFlowStarter.java

@@ -1,35 +0,0 @@
-package com.x.okr.assemble.control.dataadapter.workflow;
-
-import java.io.UnsupportedEncodingException;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.x_processplatform_service_processing;
-import com.x.base.core.project.connection.ActionResponse;
-import com.x.base.core.project.http.WrapOutId;
-import com.x.okr.assemble.control.ThisApplication;
-
-/**
- * 启动工作流的服务
- * 
- * @author O2LEE
- */
-public class WorkFlowStarter {
-	
-	/**
-	 * 启动一个工作流程,并且返回工作流实例work的ID
-	 * @param data
-	 * @return String
-	 * @throws UnsupportedEncodingException
-	 * @throws Exception
-	 * 
-	 * http://dev.o2oa.io:20020/x_processplatform_service_processing/jaxrs/work
-	 * POST
-	 */
-	public String start( JsonElement data ) throws UnsupportedEncodingException, Exception {
-		ActionResponse resp = ThisApplication.context().applications().postQuery(
-				x_processplatform_service_processing.class, "work",  data
-		);
-		WrapOutId wrapOutId = resp.getData( WrapOutId.class );
-		return wrapOutId.getId();
-	}
-}

+ 0 - 58
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrAttachmentFileInfoFactory.java

@@ -1,58 +0,0 @@
-package com.x.okr.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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrAttachmentFileInfo;
-import com.x.okr.entity.OkrAttachmentFileInfo_;
-
-/**
- * 类   名:OkrAttachmentFileInfoFactory<br/>
- * 实体类:OkrAttachmentFileInfo<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrAttachmentFileInfoFactory extends AbstractFactory {
-
-	public OkrAttachmentFileInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrAttachmentFileInfo实体信息对象" )
-	public OkrAttachmentFileInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrAttachmentFileInfo.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrAttachmentFileInfo实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrAttachmentFileInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrAttachmentFileInfo> root = cq.from( OkrAttachmentFileInfo.class);
-		cq.select(root.get(OkrAttachmentFileInfo_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrAttachmentFileInfo实体信息列表" )
-	public List<OkrAttachmentFileInfo> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrAttachmentFileInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrAttachmentFileInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrAttachmentFileInfo> cq = cb.createQuery(OkrAttachmentFileInfo.class);
-		Root<OkrAttachmentFileInfo> root = cq.from(OkrAttachmentFileInfo.class);
-		Predicate p = root.get(OkrAttachmentFileInfo_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 440
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrCenterWorkInfoFactory.java

@@ -1,440 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-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.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.assemble.control.jaxrs.WorkCommonQueryFilter;
-import com.x.okr.entity.OkrCenterWorkInfo;
-import com.x.okr.entity.OkrCenterWorkInfo_;
-
-public class OkrCenterWorkInfoFactory extends AbstractFactory {
-	
-	public OkrCenterWorkInfoFactory( Business business ) throws Exception {
-		super(business);
-	}
-
-	//@MethodDescribe( "获取指定Id的OkrCenterWorkInfo应用信息对象" )
-	public OkrCenterWorkInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrCenterWorkInfo.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrCenterWorkInfo应用信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrCenterWorkInfo> root = cq.from( OkrCenterWorkInfo.class);
-		cq.select(root.get(OkrCenterWorkInfo_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrCenterWorkInfo应用信息列表" )
-	public List<OkrCenterWorkInfo> list( List<String> ids, List<String> statuses ) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrCenterWorkInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrCenterWorkInfo> cq = cb.createQuery(OkrCenterWorkInfo.class);
-		Root<OkrCenterWorkInfo> root = cq.from(OkrCenterWorkInfo.class);
-		Predicate p = root.get(OkrCenterWorkInfo_.id).in(ids);
-		if( statuses != null && statuses.size() > 0 ){
-			p = cb.and( p, root.get(OkrCenterWorkInfo_.status ).in(statuses) );
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 查询下一页的信息数据
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings( "unchecked" )
-	public List<OkrCenterWorkInfo> listNextWithFilter( String id, Integer count, Object sequence, WorkCommonQueryFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrCenterWorkInfo.class );
-		String order = wrapIn.getOrder();//排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		
-		if( order == null || order.isEmpty() ){
-			order = "DESC";
-		}
-		
-		Integer index = 1;
-		sql_stringBuffer.append( "SELECT o FROM "+OkrCenterWorkInfo.class.getCanonicalName()+" o where 1=1" );
-
-		if ((null != sequence) ) {
-			sql_stringBuffer.append( " and o." + wrapIn.getSequenceField()+" " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "<" : ">" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ((null != wrapIn.getDefaultWorkTypes()) && wrapIn.getDefaultWorkTypes().size() > 0) {
-			sql_stringBuffer.append( " and o.defaultWorkType in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getDefaultWorkTypes() );
-			index++;
-		}
-		if ((null != wrapIn.getCenterIds()) && wrapIn.getCenterIds().size() > 0) {
-			sql_stringBuffer.append( " and o.id in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCenterIds() );
-			index++;
-		}
-		
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0 ) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like ?" + (index) );
-			vs.add( "%"+wrapIn.getTitle()+"%" );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0 ) {
-			sql_stringBuffer.append( " and o.status in (?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + ( StringUtils.equalsIgnoreCase( order, "DESC" ) ? "DESC" : "ASC" ) );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrCenterWorkInfo.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults(count).getResultList();
-	}	
-	
-	/**
-	 * 查询上一页的信息数据
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings( "unchecked" )
-	public List<OkrCenterWorkInfo> listPrevWithFilter( String id, Integer count, Object sequence, WorkCommonQueryFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrCenterWorkInfo.class );
-		String order = wrapIn.getOrder();//排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		if( order == null || order.isEmpty() ){
-			order = "DESC";
-		}
-		
-		sql_stringBuffer.append( "SELECT o FROM " + OkrCenterWorkInfo.class.getCanonicalName()+" o where 1=1" );
-		if ((null != sequence) ) {
-			sql_stringBuffer.append( " and o."+wrapIn.getSequenceField()+" " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? ">" : "<" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ((null != wrapIn.getDefaultWorkTypes()) && wrapIn.getDefaultWorkTypes().size() > 0) {
-			sql_stringBuffer.append( " and o.defaultWorkType in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getDefaultWorkTypes() );
-			index++;
-		}
-		if ((null != wrapIn.getCenterIds()) && wrapIn.getCenterIds().size() > 0) {
-			sql_stringBuffer.append( " and o.id in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCenterIds() );
-			index++;
-		}
-
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0 ) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like ?" + (index) );
-			vs.add( "%"+wrapIn.getTitle()+"%" );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0 ) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}		
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + ( StringUtils.equalsIgnoreCase( order, "DESC" ) ? "DESC" : "ASC" ) );
-		//logger.debug( "listIdsNextWithFilter:[" +sql_stringBuffer.toString()+ "]" );
-		//logger.debug(vs);
-		
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrCenterWorkInfo.class );
-		//为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		
-		return query.setMaxResults(count).getResultList();
-	}
-	
-	/**
-	 * 查询符合的信息总数
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountWithFilter( WorkCommonQueryFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrCenterWorkInfo.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		sql_stringBuffer.append( "SELECT count(o.id) FROM "+OkrCenterWorkInfo.class.getCanonicalName()+" o where 1=1" );
-		
-		if ((null != wrapIn.getCenterIds()) && wrapIn.getCenterIds().size() > 0) {
-			sql_stringBuffer.append( " and o.id in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCenterIds() );
-			index++;
-		}
-		
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0 ) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		
-		if ((null != wrapIn.getDefaultWorkTypes()) && wrapIn.getDefaultWorkTypes().size() > 0) {
-			sql_stringBuffer.append( " and o.defaultWorkType in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getDefaultWorkTypes() );
-			index++;
-		}
-		
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like ?" + (index) );
-			vs.add( "%"+wrapIn.getTitle()+"%" );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0 ) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrCenterWorkInfo.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}		
-		return (Long) query.getSingleResult();
-	}
-
-	public List<String> listAllProcessingCenterWorkIds( List<String> processStatus, List<String> status ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrCenterWorkInfo> root = cq.from(OkrCenterWorkInfo.class);
-		cq.select(root.get( OkrCenterWorkInfo_.id ));
-		Predicate p = root.get(OkrCenterWorkInfo_.processStatus).in( processStatus );
-		if( status != null && status.size() > 0 ){
-			p = cb.and( p, root.get( OkrCenterWorkInfo_.status ).in( status ) );
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<OkrCenterWorkInfo> listAllCenterWorks( String status ) throws Exception {
-		if( status == null || status.isEmpty() ){
-			throw new Exception("status is null!");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrCenterWorkInfo> cq = cb.createQuery(OkrCenterWorkInfo.class);
-		Root<OkrCenterWorkInfo> root = cq.from(OkrCenterWorkInfo.class);
-		Predicate p = cb.equal( root.get( OkrCenterWorkInfo_.status ), status );
-		
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 查询中心工作审核领导身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	@SuppressWarnings({ "rawtypes", "unchecked" })
-	public List<String> listAllDistinctAuditLeaderIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrCenterWorkInfo> cq = cb.createQuery( OkrCenterWorkInfo.class );
-		
-		Root<OkrCenterWorkInfo> root = cq.from(OkrCenterWorkInfo.class);
-//		cq.select(root.get( OkrCenterWorkInfo_.reportAuditLeaderIdentityList ));
-		List<OkrCenterWorkInfo> centerWorkInfos = em.createQuery(cq).getResultList();
-		//ListTools.trim(list, ignoreNull, unique, ts);
-		if(ListTools.isNotEmpty( centerWorkInfos )) {
-			HashSet hashSet = new  HashSet();
-			for(OkrCenterWorkInfo centerWorkInfo : centerWorkInfos ) {
-				
-				if( ListTools.isNotEmpty( centerWorkInfo.getReportAuditLeaderIdentityList() ) ) {
-					for( String identity : centerWorkInfo.getReportAuditLeaderIdentityList() ) {
-						if( ListTools.isNotEmpty(identities_ok) && identities_ok.contains( identity ) ){
-							continue;
-						}
-						if( ListTools.isNotEmpty(identities_error) && identities_error.contains( identity ) ){
-							continue;
-						}
-						hashSet.add( identity );
-					}
-				}
-			}
-			List<String> result = new ArrayList<>();
-			result.addAll(hashSet);
-			return result;
-		}
-		return null;
-		
-	}
-	/**
-	 * 查询中心工作创建者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctCreatorIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrCenterWorkInfo> root = cq.from(OkrCenterWorkInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrCenterWorkInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrCenterWorkInfo_.creatorIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrCenterWorkInfo_.creatorIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrCenterWorkInfo_.creatorIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询中心工作部署者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctDeployerIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrCenterWorkInfo> root = cq.from(OkrCenterWorkInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrCenterWorkInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrCenterWorkInfo_.deployerIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrCenterWorkInfo_.deployerIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrCenterWorkInfo_.deployerIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询中心工作汇报审核领导身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public List<String> listAllDistinctReportAuditLeaderIdentity(List<String> identities_ok,
-			List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrCenterWorkInfo> cq = cb.createQuery(OkrCenterWorkInfo.class);
-		Root<OkrCenterWorkInfo> root = cq.from(OkrCenterWorkInfo.class);
-		List<OkrCenterWorkInfo> os = em.createQuery(cq.select(root)).getResultList();
-		List<List> allList = new ArrayList<>();
-		for (OkrCenterWorkInfo o : os) {
-			allList.add(o.getReportAuditLeaderIdentityList());
-		}
-		if(ListTools.isNotEmpty( allList )) {
-			HashSet hashSet = new  HashSet();
-			for( List<String> identities : allList ) {
-				if(ListTools.isNotEmpty( identities )) {
-					for( String identity : identities ) {
-						if( ListTools.isNotEmpty(identities_ok) && identities_ok.contains( identity ) ){
-							continue;
-						}
-						if( ListTools.isNotEmpty(identities_error) && identities_error.contains( identity ) ){
-							continue;
-						}
-						hashSet.add( identity );
-					}
-				}
-			}
-			List<String> result = new ArrayList<>();
-			result.addAll(hashSet);
-			return result;
-		}
-		return null;
-	}
-
-	/**
-	 * 根据身份名称,从中心工作信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception
-	 */
-	public List<OkrCenterWorkInfo> listErrorIdentitiesInCenterInfo( String identity, String recordId ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrCenterWorkInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrCenterWorkInfo> cq = cb.createQuery( OkrCenterWorkInfo.class );
-		Root<OkrCenterWorkInfo> root = cq.from( OkrCenterWorkInfo.class );
-		Predicate p = cb.isNotNull(root.get( OkrCenterWorkInfo_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrCenterWorkInfo_.id ), recordId ) );
-		}
-		
-		Predicate p_creatorIdentity = cb.isNotNull(root.get( OkrCenterWorkInfo_.creatorIdentity ));
-		p_creatorIdentity = cb.and( p_creatorIdentity, cb.equal( root.get( OkrCenterWorkInfo_.creatorIdentity ), identity ) );
-		
-		Predicate p_deployerIdentity = cb.isNotNull(root.get( OkrCenterWorkInfo_.deployerIdentity ));
-		p_deployerIdentity = cb.and( p_deployerIdentity, cb.equal( root.get( OkrCenterWorkInfo_.deployerIdentity ), identity ) );
-		
-		Predicate p_reportAuditLeaderIdentity = cb.isNotNull(root.get( OkrCenterWorkInfo_.reportAuditLeaderIdentityList ));
-		p_reportAuditLeaderIdentity = cb.and( p_reportAuditLeaderIdentity,cb.isMember(identity, root.get( OkrCenterWorkInfo_.reportAuditLeaderIdentityList )));
-		
-		Predicate p_auditLeaderIdentity = cb.isNotNull(root.get( OkrCenterWorkInfo_.reportAuditLeaderIdentityList ));
-		p_auditLeaderIdentity = cb.and( p_auditLeaderIdentity, cb.isMember( identity, root.get( OkrCenterWorkInfo_.reportAuditLeaderIdentityList ) ) );
-		
-		Predicate p_identity = cb.or( p_creatorIdentity, p_deployerIdentity, p_reportAuditLeaderIdentity, p_auditLeaderIdentity );
-			
-		p = cb.and( p, p_identity );
-		
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 166
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigSecretaryFactory.java

@@ -1,166 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrConfigSecretary;
-import com.x.okr.entity.OkrConfigSecretary_;
-
-public class OkrConfigSecretaryFactory extends AbstractFactory {
-
-	public OkrConfigSecretaryFactory(Business business) throws Exception {
-		super(business);
-	}
-
-	//@MethodDescribe( "获取指定Id的OkrConfigSecretary应用信息对象" )
-	public OkrConfigSecretary get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrConfigSecretary.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrConfigSecretary应用信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSecretary.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrConfigSecretary> root = cq.from( OkrConfigSecretary.class);
-		cq.select(root.get(OkrConfigSecretary_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrConfigSecretary应用信息列表" )
-	public List<OkrConfigSecretary> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrConfigSecretary>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSecretary.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigSecretary> cq = cb.createQuery(OkrConfigSecretary.class);
-		Root<OkrConfigSecretary> root = cq.from(OkrConfigSecretary.class);
-		Predicate p = root.get(OkrConfigSecretary_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据秘书姓名查询配置好的秘书信息ID列表
-	 * @param userName
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据秘书姓名查询配置好的秘书信息ID列表" )
-	public List<String> listBySecretaryName( String userName ) throws Exception {
-		if( userName == null || userName.isEmpty() ){
-			throw new Exception ( "the parameter: 'userName' is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrConfigSecretary.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrConfigSecretary> root = cq.from( OkrConfigSecretary.class);
-		cq.select(root.get(OkrConfigSecretary_.id));
-		Predicate p = cb.equal( root.get(OkrConfigSecretary_.secretaryName ) , userName);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	//@MethodDescribe( "根据秘书姓名和被代理员工姓名查询配置好的秘书信息ID列表" )
-	public List<String> listIdsByPerson( String name, String leaderName ) throws Exception {
-		if( name == null || name.isEmpty() ){
-			throw new Exception ( "the parameter: 'name' is null!" );
-		}
-		if( leaderName == null || leaderName.isEmpty() ){
-			throw new Exception ( "the parameter: 'leaderName' is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrConfigSecretary.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrConfigSecretary> root = cq.from( OkrConfigSecretary.class);
-		cq.select(root.get( OkrConfigSecretary_.id ));
-		Predicate p = cb.equal( root.get( OkrConfigSecretary_.secretaryName ) , name );
-		p = cb.and( p, cb.equal( root.get( OkrConfigSecretary_.leaderName ), leaderName ));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIdsByLeaderIdentity( String name, String leaderIdentity ) throws Exception {
-		if( name == null || name.isEmpty() ){
-			throw new Exception ( "the parameter: 'name' is null!" );
-		}
-		if( leaderIdentity == null || leaderIdentity.isEmpty() ){
-			throw new Exception ( "the parameter: 'leaderIdentity' is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrConfigSecretary.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrConfigSecretary> root = cq.from( OkrConfigSecretary.class);
-		cq.select(root.get( OkrConfigSecretary_.id ));
-		Predicate p = cb.equal( root.get( OkrConfigSecretary_.secretaryName ) , name );
-		p = cb.and( p, cb.equal( root.get( OkrConfigSecretary_.leaderIdentity ), leaderIdentity ));
-		return em.createQuery( cq.where(p) ).getResultList();
-	}
-	/**
-	 * 查询秘书代理领导身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctLeaderIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSecretary.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrConfigSecretary> root = cq.from(OkrConfigSecretary.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrConfigSecretary_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrConfigSecretary_.leaderIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrConfigSecretary_.leaderIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrConfigSecretary_.leaderIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从领导秘书配置信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrConfigSecretary> listErrorIdentitiesInConfigSecretary(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSecretary.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigSecretary> cq = cb.createQuery( OkrConfigSecretary.class );
-		Root<OkrConfigSecretary> root = cq.from( OkrConfigSecretary.class );
-		Predicate p = cb.isNotNull(root.get( OkrConfigSecretary_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrConfigSecretary_.id ), recordId ) );
-		}
-		
-		Predicate p_leaderIdentity = cb.isNotNull(root.get( OkrConfigSecretary_.leaderIdentity ));
-		p_leaderIdentity = cb.and( p_leaderIdentity, cb.equal( root.get( OkrConfigSecretary_.leaderIdentity ), identity ) );
-		Predicate p_secretaryIdentity = cb.isNotNull(root.get( OkrConfigSecretary_.secretaryIdentity ));
-		p_secretaryIdentity = cb.and( p_secretaryIdentity, cb.equal( root.get( OkrConfigSecretary_.secretaryIdentity ), identity ) );
-		Predicate p_identity = cb.or( p_leaderIdentity, p_secretaryIdentity );
-		p = cb.and( p, p_identity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIdsByIdentities(List<String> identities) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSecretary.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrConfigSecretary> root = cq.from(OkrConfigSecretary.class);
-		Predicate p = root.get( OkrConfigSecretary_.secretaryName ).in( identities );
-		cq.select(root.get( OkrConfigSecretary_.id ));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 139
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigSystemFactory.java

@@ -1,139 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrConfigSystem;
-import com.x.okr.entity.OkrConfigSystem_;
-
-/**
- * 类   名:OkrConfigSystemFactory<br/>
- * 实体类:OkrConfigSystem<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrConfigSystemFactory extends AbstractFactory {
-
-	public OkrConfigSystemFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-//	@MethodDescribe( "获取指定Id的OkrConfigSystem实体信息对象" )
-	public OkrConfigSystem get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrConfigSystem.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrConfigSystem实体信息列表" )
-	public List<OkrConfigSystem> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSystem.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigSystem> cq = cb.createQuery(OkrConfigSystem.class);
-		@SuppressWarnings("unused")
-		Root<OkrConfigSystem> root = cq.from( OkrConfigSystem.class);
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrConfigSystem实体信息列表" )
-	public List<OkrConfigSystem> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrConfigSystem>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSystem.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigSystem> cq = cb.createQuery(OkrConfigSystem.class);
-		Root<OkrConfigSystem> root = cq.from(OkrConfigSystem.class);
-		Predicate p = root.get(OkrConfigSystem_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	//@MethodDescribe( "根据指定的配置编码获取配置的值" )
-	public String getValueWithConfigCode(String configCode) throws Exception {
-		if( configCode == null || configCode.isEmpty() ){
-			throw new Exception( "config code is null, can not find any system config!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSystem.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrConfigSystem> root = cq.from(OkrConfigSystem.class);
-		Predicate p = cb.equal( root.get( OkrConfigSystem_.configCode ), configCode );
-		cq.select(root.get(OkrConfigSystem_.configValue));
-		//System.out.println("SQL:" + em.createQuery(cq.where(p)).toString() );
-		List<String> valueList = em.createQuery(cq.where(p)).getResultList();
-		if( valueList != null && valueList.size() > 0 ){
-			//System.out.println("valueList.get(0):" + valueList.get(0) );
-			return valueList.get(0);
-		}
-		return null;
-	}
-
-	public OkrConfigSystem getWithConfigCode(String configCode) throws Exception {
-		if( configCode == null || configCode.isEmpty() ){
-			throw new Exception( "config code is null, can not find any system config!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSystem.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigSystem> cq = cb.createQuery(OkrConfigSystem.class);
-		Root<OkrConfigSystem> root = cq.from(OkrConfigSystem.class);
-		Predicate p = cb.equal( root.get( OkrConfigSystem_.configCode ), configCode );
-		List<OkrConfigSystem> valueList = em.createQuery(cq.where(p)).getResultList();
-		if( valueList != null && valueList.size() > 0 ){
-			return valueList.get(0);
-		}
-		return null;
-	}
-	/**
-	 * 查询系统配置值身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctValueIdentity( List<String> identities_ok, List<String> identities_error ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigSystem.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrConfigSystem> root = cq.from(OkrConfigSystem.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrConfigSystem_.id ) );
-		p = cb.and( p, cb.equal( root.get( OkrConfigSystem_.valueType ), "identity") );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrConfigSystem_.configValue ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrConfigSystem_.configValue ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrConfigSystem_.configValue ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从系统参数配置信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrConfigSystem> listErrorIdentitiesInConfigSystem(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrConfigSystem.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigSystem> cq = cb.createQuery( OkrConfigSystem.class );
-		Root<OkrConfigSystem> root = cq.from( OkrConfigSystem.class );
-		Predicate p = cb.isNotNull(root.get( OkrConfigSystem_.configValue ));
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrConfigSystem_.id ), recordId ) );
-		}
-		//p = cb.and( p, cb.equal( root.get( OkrConfigSystem_.valueType ), "identity") );
-		p = cb.and( p, cb.like( root.get( OkrConfigSystem_.configValue ), "%"+identity+"%" ) );		
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 58
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigWorkLevelFactory.java

@@ -1,58 +0,0 @@
-package com.x.okr.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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrConfigWorkLevel;
-import com.x.okr.entity.OkrConfigWorkLevel_;
-
-/**
- * 类   名:OkrConfigWorkLevelFactory<br/>
- * 实体类:OkrConfigWorkLevel<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrConfigWorkLevelFactory extends AbstractFactory {
-
-	public OkrConfigWorkLevelFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrConfigWorkLevel实体信息对象" )
-	public OkrConfigWorkLevel get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrConfigWorkLevel.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrConfigWorkLevel实体信息列表" )
-	public List<OkrConfigWorkLevel> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigWorkLevel.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigWorkLevel> cq = cb.createQuery(OkrConfigWorkLevel.class);
-		@SuppressWarnings("unused")
-		Root<OkrConfigWorkLevel> root = cq.from( OkrConfigWorkLevel.class);
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrConfigWorkLevel实体信息列表" )
-	public List<OkrConfigWorkLevel> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrConfigWorkLevel>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrConfigWorkLevel.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigWorkLevel> cq = cb.createQuery(OkrConfigWorkLevel.class);
-		Root<OkrConfigWorkLevel> root = cq.from(OkrConfigWorkLevel.class);
-		Predicate p = root.get(OkrConfigWorkLevel_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 58
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrConfigWorkTypeFactory.java

@@ -1,58 +0,0 @@
-package com.x.okr.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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrConfigWorkType;
-import com.x.okr.entity.OkrConfigWorkType_;
-
-/**
- * 类   名:OkrConfigWorkTypeFactory<br/>
- * 实体类:OkrConfigWorkType<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrConfigWorkTypeFactory extends AbstractFactory {
-
-	public OkrConfigWorkTypeFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrConfigWorkType实体信息对象" )
-	public OkrConfigWorkType get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrConfigWorkType.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrConfigWorkType实体信息列表" )
-	public List<OkrConfigWorkType> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrConfigWorkType.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigWorkType> cq = cb.createQuery(OkrConfigWorkType.class);
-		@SuppressWarnings("unused")
-		Root<OkrConfigWorkType> root = cq.from( OkrConfigWorkType.class);
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrConfigWorkType实体信息列表" )
-	public List<OkrConfigWorkType> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrConfigWorkType>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrConfigWorkType.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrConfigWorkType> cq = cb.createQuery(OkrConfigWorkType.class);
-		Root<OkrConfigWorkType> root = cq.from(OkrConfigWorkType.class);
-		Predicate p = root.get(OkrConfigWorkType_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 91
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrErrorSystemIdentityInfoFactory.java

@@ -1,91 +0,0 @@
-package com.x.okr.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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrErrorIdentityRecords;
-import com.x.okr.entity.OkrErrorIdentityRecords_;
-import com.x.okr.entity.OkrErrorSystemIdentityInfo;
-import com.x.okr.entity.OkrErrorSystemIdentityInfo_;
-
-/**
- * 类   名:OkrErrorSystemIdentityInfoFactory<br/>
- * 实体类:OkrErrorSystemIdentityInfo<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrErrorSystemIdentityInfoFactory extends AbstractFactory {
-
-	public OkrErrorSystemIdentityInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-//	@MethodDescribe( "获取指定Id的OkrErrorSystemIdentityInfo实体信息对象" )
-	public OkrErrorSystemIdentityInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrErrorSystemIdentityInfo.class, ExceptionWhen.none);
-	}
-	
-//	@MethodDescribe( "获取指定Id的OkrErrorIdentityRecords实体信息对象" )
-	public OkrErrorIdentityRecords getRecords( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrErrorIdentityRecords.class, ExceptionWhen.none);
-	}
-
-	public List<OkrErrorSystemIdentityInfo> listByIdentityName(String identity) throws Exception {
-		if( identity == null || identity.isEmpty() ){
-			return new ArrayList<OkrErrorSystemIdentityInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrErrorSystemIdentityInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrErrorSystemIdentityInfo> cq = cb.createQuery(OkrErrorSystemIdentityInfo.class);
-		Root<OkrErrorSystemIdentityInfo> root = cq.from(OkrErrorSystemIdentityInfo.class);
-		Predicate p = cb.equal( root.get(OkrErrorSystemIdentityInfo_.identity), identity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<OkrErrorIdentityRecords> listRecordsByIdentityName(String identity) throws Exception {
-		if( identity == null || identity.isEmpty() ){
-			return new ArrayList<OkrErrorIdentityRecords>();
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrErrorIdentityRecords.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrErrorIdentityRecords> cq = cb.createQuery(OkrErrorIdentityRecords.class);
-		Root<OkrErrorIdentityRecords> root = cq.from(OkrErrorIdentityRecords.class);
-		Predicate p = cb.equal( root.get(OkrErrorIdentityRecords_.identity), identity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	public List<OkrErrorSystemIdentityInfo> listNotFlag(String flag) throws Exception {
-		if( flag == null || flag.isEmpty() ){
-			return new ArrayList<OkrErrorSystemIdentityInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrErrorSystemIdentityInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrErrorSystemIdentityInfo> cq = cb.createQuery(OkrErrorSystemIdentityInfo.class);
-		Root<OkrErrorSystemIdentityInfo> root = cq.from(OkrErrorSystemIdentityInfo.class);
-		Predicate p = cb.notEqual( root.get(OkrErrorSystemIdentityInfo_.flag), flag );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	public List<OkrErrorIdentityRecords> listRecordNotFlag(String flag) throws Exception {
-		if( flag == null || flag.isEmpty() ){
-			return new ArrayList<OkrErrorIdentityRecords>();
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrErrorIdentityRecords.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrErrorIdentityRecords> cq = cb.createQuery(OkrErrorIdentityRecords.class);
-		Root<OkrErrorIdentityRecords> root = cq.from(OkrErrorIdentityRecords.class);
-		Predicate p = cb.notEqual( root.get(OkrErrorIdentityRecords_.flag), flag );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-}

+ 0 - 390
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrStatisticReportContentFactory.java

@@ -1,390 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrStatisticReportContent;
-import com.x.okr.entity.OkrStatisticReportContent_;
-
-/**
- * 类   名:OkrStatisticReportContent<br/>
- * 实体类:OkrStatisticReportContent<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrStatisticReportContentFactory extends AbstractFactory {
-
-	public OkrStatisticReportContentFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrStatisticReportContent实体信息对象" )
-	public OkrStatisticReportContent get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrStatisticReportContent.class, ExceptionWhen.none);
-	}
-	
-//	@MethodDescribe( "根据中心工作,年份,月份,周数查询指定实体信息ID列表" )
-	public List<String> list( String workId, Integer year, Integer month, Integer week, String cycleType ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception("workId is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		Predicate p = cb.equal( root.get(OkrStatisticReportContent_.workId ), workId );
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.cycleType ), cycleType ));
-		}
-		if( year != null && year > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticYear ), year ));
-		}
-		if( month != null && month > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticMonth ), month ));
-		}
-		if( week != null && week > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticWeek ), week ));
-		}
-		cq.select( root.get( OkrStatisticReportContent_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	//@MethodDescribe( "根据中心工作,年份,月份,周数查询指定实体信息ID列表" )
-	public Long count( String workId, Integer year, Integer month, Integer week, String cycleType ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception("workId is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery( Long.class );
-		Root<OkrStatisticReportContent> root = cq.from( OkrStatisticReportContent.class );
-		Predicate p = cb.equal( root.get(OkrStatisticReportContent_.workId ), workId );
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.cycleType ), cycleType ));
-		}
-		if( year != null && year > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticYear ), year ));
-		}
-		if( month != null && month > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticMonth ), month ));
-		}
-		if( week != null && week > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticWeek ), week ));
-		}
-		cq.select( cb.count(root) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	/**
-	 * 根据条件获取统计信息列表
-	 * @param workTypeName
-	 * @param reportCycle
-	 * @param year
-	 * @param month
-	 * @param week
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> list( String centerId, String centerTitle, String parentId, String workType, String statisticTime, String cycleType, Integer year, Integer month, Integer week, String status ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		Predicate p = cb.isNotNull( root.get(OkrStatisticReportContent_.id ) );
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.centerId ), centerId ));
-		}
-		if( centerTitle != null && !centerTitle.trim().isEmpty() ){
-			p = cb.and( p, cb.like( root.get(OkrStatisticReportContent_.centerTitle ), "%" + centerTitle.trim() + "%" ));
-		}
-		if( parentId != null && !parentId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.parentId ), parentId ));
-		}
-		if( workType != null && !workType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workType ), workType ));
-		}
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.cycleType ), cycleType ));
-		}
-		if( year != null && year > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticYear ), year ));
-		}
-		if( month != null && month > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticMonth ), month ));
-		}
-		if( week != null && week > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticWeek ), week ));
-		}
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.status ), status ));
-		}
-		if( statisticTime != null && !statisticTime.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticTimeFlag ), statisticTime ));
-		}
-		cq.select( root.get( OkrStatisticReportContent_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据条件获取统计信息列表
-	 * @param workTypeName
-	 * @param reportCycle
-	 * @param year
-	 * @param month
-	 * @param week
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listFirstLayer( String centerId, String centerTitle, String workId, String workType, String statisticTimeFlag, String cycleType, Integer year, Integer month, Integer week, String status ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		Predicate p = cb.isNotNull( root.get(OkrStatisticReportContent_.id ) );
-		p = cb.and( p, cb.isNull( root.get(OkrStatisticReportContent_.parentId )));
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.centerId ), centerId ));
-		}
-		if( centerTitle != null && !centerTitle.trim().isEmpty() ){
-			p = cb.and( p, cb.like( root.get(OkrStatisticReportContent_.centerTitle ), "%" + centerTitle.trim() + "%" ));
-		}
-		if( workId != null && !workId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workId ), workId ));
-		}
-		if( workType != null && !workType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workType ), workType ));
-		}
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.cycleType ), cycleType ));
-		}
-		if( year != null && year > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticYear ), year ));
-		}
-		if( month != null && month > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticMonth ), month ));
-		}
-		if( week != null && week > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticWeek ), week ));
-		}
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.status ), status ));
-		}
-		if( statisticTimeFlag != null && !statisticTimeFlag.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticTimeFlag ), statisticTimeFlag ));
-		}
-		cq.select( root.get( OkrStatisticReportContent_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据条件获取统计信息列表
-	 * @param workTypeName
-	 * @param reportCycle
-	 * @param year
-	 * @param month
-	 * @param week
-	 * @return
-	 * @throws Exception 
-	 */
-	public Long count( String centerId, String centerTitle, String parentId, String workType, String statisticTime, String cycleType, Integer year, Integer month, Integer week, String status ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery( Long.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		Predicate p = cb.isNotNull( root.get( OkrStatisticReportContent_.id ) );
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.centerId ), centerId ));
-		}
-		if( centerTitle != null && !centerTitle.trim().isEmpty() ){
-			p = cb.and( p, cb.like( root.get(OkrStatisticReportContent_.centerTitle ), "%" + centerTitle.trim() + "%" ));
-		}
-		if( parentId != null && !parentId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.parentId ), parentId ));
-		}
-		if( workType != null && !workType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workType ), workType ));
-		}
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.cycleType ), cycleType ));
-		}
-		if( year != null && year > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticYear ), year ));
-		}
-		if( month != null && month > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticMonth ), month ));
-		}
-		if( week != null && week > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticWeek ), week ));
-		}
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.status ), status ));
-		}
-		if( statisticTime != null && !statisticTime.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticTimeFlag ), statisticTime ));
-		}
-		cq.select( cb.count(root) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-	
-	public Long countFirstLayer( String centerId, String centerTitle, String workId, String workType, String statisticTime, String cycleType, Integer year, Integer month, Integer week, String status ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery( Long.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		Predicate p = cb.isNotNull( root.get( OkrStatisticReportContent_.id ) );
-		p = cb.and( p, cb.isNull( root.get(OkrStatisticReportContent_.parentId )));
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.centerId ), centerId ));
-		}
-		if( centerTitle != null && !centerTitle.trim().isEmpty() ){
-			p = cb.and( p, cb.like( root.get(OkrStatisticReportContent_.centerTitle ), "%" + centerTitle.trim() + "%" ));
-		}
-		if( workType != null && !workType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workType ), workType ));
-		}
-		if( workId != null && !workId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workId ), workId ));
-		}
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.cycleType ), cycleType ));
-		}
-		if( year != null && year > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticYear ), year ));
-		}
-		if( month != null && month > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticMonth ), month ));
-		}
-		if( week != null && week > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticWeek ), week ));
-		}
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.status ), status ));
-		}
-		if( statisticTime != null && !statisticTime.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticTimeFlag ), statisticTime ));
-		}
-		cq.select( cb.count(root) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public List<OkrStatisticReportContent> list( List<String> ids ) throws Exception {
-		if( ids == null || ids.isEmpty() ){
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrStatisticReportContent> cq = cb.createQuery( OkrStatisticReportContent.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		Predicate p = root.get(OkrStatisticReportContent_.id ).in( ids );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listDateTimeFlags(String centerId, String centerTitle, String workId, String workType, String cycleType, Integer year, Integer month, Integer week, Date startDate, Date endDate, String status) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		Predicate p = cb.isNotNull( root.get( OkrStatisticReportContent_.id ) );
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.centerId ), centerId ));
-		}
-		if( centerTitle != null && !centerTitle.trim().isEmpty() ){
-			p = cb.and( p, cb.like( root.get(OkrStatisticReportContent_.centerTitle ), "%" + centerTitle.trim() + "%" ));
-		}
-		if( workId != null && !workId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workId ), workId ));
-		}
-		if( workType != null && !workType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.workType ), workType ));
-		}
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.cycleType ), cycleType ));
-		}
-		if( year != null && year > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticYear ), year ));
-		}
-		if( month != null && month > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticMonth ), month ));
-		}
-		if( week != null && week > 0 ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.statisticWeek ), week ));
-		}
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportContent_.status ), status ));
-		}
-		if( startDate != null ){
-			p = cb.and( p, cb.greaterThan( root.get(OkrStatisticReportContent_.statisticTime ), startDate));
-		}
-		if( endDate != null ){
-			p = cb.and( p, cb.lessThan( root.get(OkrStatisticReportContent_.statisticTime ), endDate));
-		}
-		cq.select( root.get(OkrStatisticReportContent_.statisticTimeFlag ));
-		return em.createQuery( cq.where(p) ).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询统计数据中工作责任者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctResponsibilityIdentity( List<String> identities_ok, List<String> identities_error ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrStatisticReportContent_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrStatisticReportContent_.responsibilityIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrStatisticReportContent_.responsibilityIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrStatisticReportContent_.responsibilityIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从工作最新汇报内容统计信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrStatisticReportContent> listErrorIdentitiesInStReportContent(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrStatisticReportContent> cq = cb.createQuery( OkrStatisticReportContent.class );
-		Root<OkrStatisticReportContent> root = cq.from( OkrStatisticReportContent.class );
-		Predicate p = cb.isNotNull(root.get( OkrStatisticReportContent_.id ));	
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrStatisticReportContent_.id ), recordId ) );
-		}
-		
-		Predicate p_responsibilityIdentity = cb.isNotNull(root.get( OkrStatisticReportContent_.responsibilityIdentity ));
-		p_responsibilityIdentity = cb.and( p_responsibilityIdentity, cb.equal( root.get( OkrStatisticReportContent_.responsibilityIdentity ), identity ) );		
-		p = cb.and( p, p_responsibilityIdentity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportContent.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrStatisticReportContent> root = cq.from(OkrStatisticReportContent.class);
-		cq.select(root.get( OkrStatisticReportContent_.id ));
-		return em.createQuery(cq).getResultList();
-	}
-}

+ 0 - 185
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrStatisticReportStatusFactory.java

@@ -1,185 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrStatisticReportStatus;
-import com.x.okr.entity.OkrStatisticReportStatus_;
-
-/**
- * 类   名:OkrStatisticReportStatusFactory<br/>
- * 实体类:OkrStatisticReportStatus<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrStatisticReportStatusFactory extends AbstractFactory {
-
-	public OkrStatisticReportStatusFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrStatisticReportStatus实体信息对象" )
-	public OkrStatisticReportStatus get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrStatisticReportStatus.class );
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrStatisticReportStatus实体信息对象" )
-	public List<OkrStatisticReportStatus> listWithWorkId( String workId ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception("workId is null!");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrStatisticReportStatus> cq = cb.createQuery(OkrStatisticReportStatus.class);
-		Root<OkrStatisticReportStatus> root = cq.from(OkrStatisticReportStatus.class);
-		Predicate p = cb.equal( root.get(OkrStatisticReportStatus_.workId), workId );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	//@MethodDescribe( "列示全部的OkrStatisticReportStatus实体信息列表" )
-	public List<OkrStatisticReportStatus> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrStatisticReportStatus> cq = cb.createQuery(OkrStatisticReportStatus.class);
-		@SuppressWarnings("unused")
-		Root<OkrStatisticReportStatus> root = cq.from( OkrStatisticReportStatus.class);
-		return em.createQuery(cq).getResultList();
-	}
-	
-	public List<String> listAllIds() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrStatisticReportStatus> root = cq.from( OkrStatisticReportStatus.class);
-		cq.select(root.get(OkrStatisticReportStatus_.id) );
-		return em.createQuery(cq).getResultList();
-	}
-	
-//	@MethodDescribe( "列示指定Id的OkrStatisticReportStatus实体信息列表" )
-	public List<OkrStatisticReportStatus> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrStatisticReportStatus>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrStatisticReportStatus> cq = cb.createQuery(OkrStatisticReportStatus.class);
-		Root<OkrStatisticReportStatus> root = cq.from(OkrStatisticReportStatus.class);
-		Predicate p = root.get(OkrStatisticReportStatus_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<OkrStatisticReportStatus> list( String centerId, String centerTitle, String workId, String workType, String unitName, String cycleType, String status ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrStatisticReportStatus> cq = cb.createQuery(OkrStatisticReportStatus.class);
-		Root<OkrStatisticReportStatus> root = cq.from(OkrStatisticReportStatus.class);
-		Predicate p = cb.isNotNull( root.get(OkrStatisticReportStatus_.id) );
-		
-		if( workType != null && !workType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.workType ), workType ));
-		}
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.reportCycle ), cycleType ));
-		}
-		if( centerTitle != null && !centerTitle.isEmpty() ){
-			p = cb.and( p, cb.like( root.get( OkrStatisticReportStatus_.centerTitle ), "%"+centerTitle+"%" ));
-		}
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.centerId ), centerId ));
-		}
-		if( workId != null && !workId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.workId ), workId ));
-		}
-		if( status != null && !"All".equals(status) ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.status ), status ));
-		}
-		if( unitName != null && !unitName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.responsibilityUnitName ), unitName ));
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIds(String centerId, String workId, String unitName, String cycleType, String status) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrStatisticReportStatus> root = cq.from(OkrStatisticReportStatus.class);
-		Predicate p = cb.isNotNull( root.get(OkrStatisticReportStatus_.id) );
-		
-		if( cycleType != null && !cycleType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.reportCycle ), cycleType ));
-		}
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.centerId ), centerId ));
-		}
-		if( workId != null && !workId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.workId ), workId ));
-		}
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.status ), status ));
-		}
-		if( unitName != null && !unitName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrStatisticReportStatus_.responsibilityUnitName ), unitName ));
-		}
-		cq.select(root.get(OkrStatisticReportStatus_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 查询统计数据中工作责任者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctResponsibilityIdentity( List<String> identities_ok, List<String> identities_error ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrStatisticReportStatus> root = cq.from(OkrStatisticReportStatus.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrStatisticReportStatus_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrStatisticReportStatus_.responsibilityIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrStatisticReportStatus_.responsibilityIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrStatisticReportStatus_.responsibilityIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据身份名称,从工作汇报状态统计信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrStatisticReportStatus> listErrorIdentitiesInStReportStatus(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrStatisticReportStatus.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrStatisticReportStatus> cq = cb.createQuery( OkrStatisticReportStatus.class );
-		Root<OkrStatisticReportStatus> root = cq.from( OkrStatisticReportStatus.class );
-		Predicate p = cb.isNotNull(root.get( OkrStatisticReportStatus_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrStatisticReportStatus_.id ), recordId ) );
-		}
-		
-		Predicate p_responsibilityIdentity = cb.isNotNull(root.get( OkrStatisticReportStatus_.responsibilityIdentity ));
-		p_responsibilityIdentity = cb.and( p_responsibilityIdentity, cb.equal( root.get( OkrStatisticReportStatus_.responsibilityIdentity ), identity ) );		
-		p = cb.and( p, p_responsibilityIdentity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 380
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrTaskFactory.java

@@ -1,380 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrTask;
-import com.x.okr.entity.OkrTask_;
-
-/**
- * 类   名:OkrTaskFactory<br/>
- * 实体类:OkrTask<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrTaskFactory extends AbstractFactory {
-
-	public OkrTaskFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrTask实体信息对象" )
-	public OkrTask get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrTask.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrTask实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		cq.select(root.get(OkrTask_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-//	@MethodDescribe( "列示指定Id的OkrTask实体信息列表" )
-	public List<OkrTask> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrTask>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrTask> cq = cb.createQuery(OkrTask.class);
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		Predicate p = root.get(OkrTask_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	//@MethodDescribe( "根据工作ID,处理人,处理环节名称查询一下是否存在待办信息" )
-	public List<String> listIdsByWorkAndTarget(String workId, String targetName, String activityName) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( " workId is null!" );
-		}
-		if( targetName == null || targetName.isEmpty() ){
-			throw new Exception( " targetName is null!" );
-		}
-		if( activityName == null || activityName.isEmpty() ){
-			throw new Exception( " activityName is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		Predicate p = cb.equal( root.get( OkrTask_.workId), workId);
-		p = cb.and( p, cb.equal( root.get( OkrTask_.targetName), targetName));
-		p = cb.and( p, cb.equal( root.get( OkrTask_.activityName), activityName));
-		cq.select(root.get( OkrTask_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	//@MethodDescribe( "查询在中心中工作是否有指定员工的待办信息" )
-	public List<String> listIdsByCenterAndPerson(String centerId, String identity, String dynamicObjectType ) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		if( identity == null || identity.isEmpty()){
-			throw new Exception( " identity is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		Predicate p = cb.equal( root.get( OkrTask_.centerId ), centerId );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.targetIdentity ), identity) );
-		if( dynamicObjectType != null && !dynamicObjectType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.dynamicObjectType ), dynamicObjectType) );
-		}
-		cq.select(root.get(OkrTask_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		Predicate p = cb.equal( root.get( OkrTask_.centerId ), centerId );
-		cq.select(root.get(OkrTask_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,列示所有的数据信息
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作信息ID,列示所有的数据信息" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		Predicate p = cb.equal( root.get(OkrTask_.workId), workId );
-		cq.select(root.get( OkrTask_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIdsByCenterAndIdentityActivity( String dynamicObjectType, String dynamicObjectId, String identity, String processType, String activityName) throws Exception {
-		if( dynamicObjectType == null || dynamicObjectType.isEmpty() ){
-			throw new Exception( " dynamicObjectType is null!" );
-		}
-		if( dynamicObjectId == null || dynamicObjectId.isEmpty()){
-			throw new Exception( " dynamicObjectId is null!" );
-		}
-		if( identity == null || identity.isEmpty()){
-			throw new Exception( " identity is null!" );
-		}
-		if( processType == null || processType.isEmpty()){
-			throw new Exception( " processType is null!" );
-		}
-		if( activityName == null || activityName.isEmpty()){
-			throw new Exception( " activityName is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		Predicate p = cb.equal( root.get( OkrTask_.dynamicObjectType ), dynamicObjectType );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.dynamicObjectId ), dynamicObjectId) );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.targetIdentity ), identity) );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.processType ), processType) );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.activityName ), activityName) );
-		cq.select(root.get(OkrTask_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIdsByTargetActivityAndObjId( String processType, String dynamicObjectType, String dynamicObjectId, String activityName, String processorIdentity ) throws Exception {
-		if( dynamicObjectType == null || dynamicObjectType.isEmpty() ){
-			throw new Exception( " dynamicObjectType is null!" );
-		}
-		if( dynamicObjectId == null || dynamicObjectId.isEmpty()){
-			throw new Exception( " dynamicObjectId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		Predicate p = cb.equal( root.get( OkrTask_.dynamicObjectId ), dynamicObjectId );
-		if( dynamicObjectType != null && !dynamicObjectType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.dynamicObjectType ), dynamicObjectType) );
-		}
-		if( processType != null && !processType.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.processType ), processType) );
-		}
-		if( activityName != null && !activityName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.activityName ), activityName) );
-		}
-		if( processorIdentity != null && !processorIdentity.isEmpty()){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.targetIdentity ), processorIdentity) );
-		}
-		cq.select(root.get(OkrTask_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listDistinctIdentity(List<String> taskTypeList) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		cq.select( root.get( OkrTask_.targetIdentity ));
-		Predicate p = root.get( OkrTask_.dynamicObjectType ).in( taskTypeList );
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据待办类别和用户身份,查询待办数量
-	 * @param taskTypeList
-	 * @param userIdentity
-	 * @return
-	 * @throws Exception 
-	 */
-	public Long getTaskCount( List<String> taskTypeList, String userIdentity, String workTypeName ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		Predicate p = root.get( OkrTask_.dynamicObjectType ).in( taskTypeList );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.targetIdentity ), userIdentity ) );
-		if( workTypeName != null && !workTypeName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.workType ), workTypeName ) );
-		}
-		cq.select( cb.count( root ) );	
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getNotReportConfirmTaskCount(List<String> taskTypeList, String userIdentity, String workTypeName) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		Predicate p = root.get( OkrTask_.dynamicObjectType ).in( taskTypeList );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.targetIdentity ), userIdentity ) );
-		p = cb.and( p, cb.notEqual( root.get( OkrTask_.activityName ), "汇报确认" ) );
-		if( workTypeName != null && !workTypeName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.workType ), workTypeName ) );
-		}
-		cq.select( cb.count( root ) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-	
-	/**
-	 * 根据待办类别和用户身份,查询待办列表
-	 * @param taskTypeList
-	 * @param userIdentity
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrTask> listTaskByTaskType( List<String> taskTypeList, String userIdentity, String workTypeName ) throws Exception {
-		List<OkrTask> okrTaskList = null;
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< OkrTask > cq = cb.createQuery( OkrTask.class );
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		Predicate p = root.get( OkrTask_.dynamicObjectType ).in( taskTypeList );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.targetIdentity ), userIdentity ) );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.processType ), "TASK" ) );
-		if( workTypeName != null && !workTypeName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.workType ), workTypeName ) );
-		}
-		okrTaskList = em.createQuery(cq.where(p)).getResultList();
-		if( okrTaskList == null ){
-			return null;
-		}else{
-			return okrTaskList;
-		}
-	}
-	
-	/**
-	 * 根据待办类别和用户身份,查询待办列表
-	 * @param taskTypeList
-	 * @param userIdentity
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrTask> listReadByTaskType( List<String> taskTypeList, String userIdentity, String workTypeName ) throws Exception {
-		List<OkrTask> okrTaskList = null;
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< OkrTask > cq = cb.createQuery( OkrTask.class );
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		Predicate p = root.get( OkrTask_.dynamicObjectType ).in( taskTypeList );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.targetIdentity ), userIdentity ) );
-		p = cb.and( p, cb.equal( root.get( OkrTask_.processType ), "READ" ) );
-		if( workTypeName != null && !workTypeName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.workType ), workTypeName ) );
-		}
-		okrTaskList = em.createQuery(cq.where(p)).getResultList();
-		if( okrTaskList == null ){
-			return null;
-		}else{
-			return okrTaskList;
-		}
-	}
-
-	/**
-	 * 根据用户唯一标识来查询用户信息
-	 * @param taskTypeList
-	 * @param name
-	 * @return
-	 * @throws Exception 
-	 */
-	public Long getTaskCountByUserName( List<String> taskTypeList, List<String> notInTaskTypeList, String name) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrTask.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrTask> root = cq.from( OkrTask.class);
-		Predicate p = cb.equal( root.get( OkrTask_.targetName ), name );
-		if( taskTypeList != null && !taskTypeList.isEmpty() ){
-			p = cb.and( p, root.get( OkrTask_.dynamicObjectType ).in( taskTypeList ) );
-		}
-		if( notInTaskTypeList != null && !notInTaskTypeList.isEmpty() ){
-			p = cb.and( p, cb.not( root.get( OkrTask_.dynamicObjectType ).in( notInTaskTypeList ) ) );
-		}
-		cq.select( cb.count( root ) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public List<String> listIdsByReportId(String id) throws Exception {
-		if( id == null || id.isEmpty() ){
-			throw new Exception( " id is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		Predicate p = cb.equal( root.get( OkrTask_.dynamicObjectId ), id );
-		p = cb.and(p, cb.equal( root.get( OkrTask_.dynamicObjectType), "工作汇报"));
-		cq.select(root.get( OkrTask_.id ));
-		return em.createQuery(cq.where(p)).setMaxResults(5000).getResultList();
-	}
-	/**
-	 * 查询待办处理者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctTargetIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrTask> root = cq.from(OkrTask.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrTask_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrTask_.targetIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrTask_.targetIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrTask_.targetIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从具体工作待办待阅信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrTask> listErrorIdentitiesInWorkTask(String identity, String recordId) throws Exception {		
-		EntityManager em = this.entityManagerContainer().get(OkrTask.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrTask> cq = cb.createQuery( OkrTask.class );
-		Root<OkrTask> root = cq.from( OkrTask.class );
-		Predicate p = cb.isNotNull(root.get( OkrTask_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrTask_.id ), recordId ) );
-		}
-		
-		Predicate p_targetIdentity = cb.isNotNull(root.get( OkrTask_.targetIdentity ));
-		p_targetIdentity = cb.and( p_targetIdentity, cb.equal( root.get( OkrTask_.targetIdentity ), identity ) );		
-		p = cb.and( p, p_targetIdentity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-}

+ 0 - 157
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrTaskHandledFactory.java

@@ -1,157 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrTaskHandled;
-import com.x.okr.entity.OkrTaskHandled_;
-
-/**
- * 类   名:OkrTaskHandledFactory<br/>
- * 实体类:OkrTaskHandled<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrTaskHandledFactory extends AbstractFactory {
-
-	public OkrTaskHandledFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrTaskHandled实体信息对象" )
-	public OkrTaskHandled get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrTaskHandled.class, ExceptionWhen.none);
-	}
-	
-//	@MethodDescribe( "列示全部的OkrTaskHandled实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrTaskHandled.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTaskHandled> root = cq.from( OkrTaskHandled.class);
-		cq.select(root.get(OkrTaskHandled_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrTaskHandled实体信息列表" )
-	public List<OkrTaskHandled> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrTaskHandled>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrTaskHandled.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrTaskHandled> cq = cb.createQuery(OkrTaskHandled.class);
-		Root<OkrTaskHandled> root = cq.from(OkrTaskHandled.class);
-		Predicate p = root.get(OkrTaskHandled_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrTaskHandled.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTaskHandled> root = cq.from(OkrTaskHandled.class);
-		Predicate p = cb.equal( root.get( OkrTaskHandled_.centerId ), centerId );
-		cq.select(root.get(OkrTaskHandled_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,列示所有的数据信息
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作信息ID,列示所有的数据信息" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrTaskHandled.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTaskHandled> root = cq.from( OkrTaskHandled.class);
-		Predicate p = cb.equal( root.get( OkrTaskHandled_.workId), workId );
-		cq.select(root.get( OkrTaskHandled_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIdsByReportId(String id) throws Exception {
-		if( id == null || id.isEmpty() ){
-			throw new Exception( " id is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrTaskHandled.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrTaskHandled> root = cq.from(OkrTaskHandled.class);
-		Predicate p = cb.equal( root.get( OkrTaskHandled_.dynamicObjectId), id);
-		p = cb.and(p, cb.equal( root.get( OkrTaskHandled_.dynamicObjectType), "工作汇报") );
-		cq.select(root.get( OkrTaskHandled_.id));
-		return em.createQuery(cq.where(p)).setMaxResults(5000).getResultList();
-	}
-	/**
-	 * 查询已办处理者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctTargetIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrTaskHandled.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrTaskHandled> root = cq.from(OkrTaskHandled.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrTaskHandled_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrTaskHandled_.targetIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrTaskHandled_.targetIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrTaskHandled_.targetIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从具体工作已办已阅信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrTaskHandled> listErrorIdentitiesInTaskhandled(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrTaskHandled.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrTaskHandled> cq = cb.createQuery( OkrTaskHandled.class );
-		Root<OkrTaskHandled> root = cq.from( OkrTaskHandled.class );
-		Predicate p = cb.isNotNull(root.get( OkrTaskHandled_.id ));		
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrTaskHandled_.id ), recordId ) );
-		}
-		
-		Predicate p_targetIdentity = cb.isNotNull(root.get( OkrTaskHandled_.targetIdentity ));
-		p_targetIdentity = cb.and( p_targetIdentity, cb.equal( root.get( OkrTaskHandled_.targetIdentity ), identity ) );		
-		p = cb.and( p, p_targetIdentity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-}

+ 0 - 80
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrUserInfoFactory.java

@@ -1,80 +0,0 @@
-package com.x.okr.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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrUserInfo;
-import com.x.okr.entity.OkrUserInfo_;
-
-/**
- * 类   名:OkrUserInfoFactory<br/>
- * 实体类:OkrUserInfo<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:26
-**/
-public class OkrUserInfoFactory extends AbstractFactory {
-
-	public OkrUserInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrUserInfo实体信息对象" )
-	public OkrUserInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrUserInfo.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrUserInfo实体信息列表" )
-	public List<OkrUserInfo> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrUserInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrUserInfo> cq = cb.createQuery(OkrUserInfo.class);
-		@SuppressWarnings("unused")
-		Root<OkrUserInfo> root = cq.from( OkrUserInfo.class);
-		return em.createQuery(cq).getResultList();
-	}
-	
-	public List<String> listAllIds() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrUserInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrUserInfo> root = cq.from( OkrUserInfo.class);
-		cq.select(root.get(OkrUserInfo_.id) );
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrUserInfo实体信息列表" )
-	public List<OkrUserInfo> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrUserInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrUserInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrUserInfo> cq = cb.createQuery(OkrUserInfo.class);
-		Root<OkrUserInfo> root = cq.from(OkrUserInfo.class);
-		Predicate p = root.get(OkrUserInfo_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定userName的OkrUserInfo实体信息列表" )
-	public List<OkrUserInfo> listWithPerson( String userName ) throws Exception {
-		if( userName == null || userName.isEmpty() ){
-			throw new Exception("username is null!");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrUserInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrUserInfo> cq = cb.createQuery(OkrUserInfo.class);
-		Root<OkrUserInfo> root = cq.from(OkrUserInfo.class);
-		Predicate p = cb.equal( root.get(OkrUserInfo_.userName), userName );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 73
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkAppraiseInfoFactory.java

@@ -1,73 +0,0 @@
-package com.x.okr.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.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrWorkAppraiseInfo;
-import com.x.okr.entity.OkrWorkAppraiseInfo_;
-
-public class OkrWorkAppraiseInfoFactory extends AbstractFactory {
-
-	public OkrWorkAppraiseInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-
-	//@MethodDescribe( "获取指定Id的OkrWorkAppraiseInfo应用信息对象" )
-	public OkrWorkAppraiseInfo get(String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkAppraiseInfo.class, ExceptionWhen.none);
-	}
-
-	//@MethodDescribe( "列示指定Id的OkrWorkAppraiseInfo应用信息列表" )
-	public List<OkrWorkAppraiseInfo> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkAppraiseInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAppraiseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkAppraiseInfo> cq = cb.createQuery(OkrWorkAppraiseInfo.class);
-		Root<OkrWorkAppraiseInfo> root = cq.from(OkrWorkAppraiseInfo.class);
-		Predicate p = root.get(OkrWorkAppraiseInfo_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	//@MethodDescribe( "根据工作ID列示指定Id的OkrWorkAppraiseInfo应用信息列表" )
-	public List<String> listIdsWithWorkId(String workId ) throws Exception {
-		if( StringUtils.isEmpty( workId )){
-			return new ArrayList<String>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAppraiseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkAppraiseInfo> root = cq.from(OkrWorkAppraiseInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkAppraiseInfo_.workId), workId );
-		cq.select( root.get(OkrWorkAppraiseInfo_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	//@MethodDescribe( "根据工作ID列示指定Id的OkrWorkAppraiseInfo应用信息列表" )
-	public List<String> listIdsWithWorkId(String workId, String wf_workId ) throws Exception {
-		if( StringUtils.isEmpty( workId )){
-			return new ArrayList<String>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAppraiseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkAppraiseInfo> root = cq.from(OkrWorkAppraiseInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkAppraiseInfo_.workId), workId );
-		p = cb.and( p, cb.equal( root.get(OkrWorkAppraiseInfo_.wf_workId ), wf_workId ) );
-		cq.select( root.get(OkrWorkAppraiseInfo_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-}

+ 0 - 280
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkAuthorizeRecordFactory.java

@@ -1,280 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrWorkAuthorizeRecord;
-import com.x.okr.entity.OkrWorkAuthorizeRecord_;
-
-/**
- * 类   名:OkrWorkAuthorizeRecordFactory<br/>
- * 实体类:OkrWorkAuthorizeRecord<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:27
-**/
-public class OkrWorkAuthorizeRecordFactory extends AbstractFactory {
-
-	public OkrWorkAuthorizeRecordFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrWorkAuthorizeRecord实体信息对象" )
-	public OkrWorkAuthorizeRecord get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkAuthorizeRecord.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrWorkAuthorizeRecord实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkAuthorizeRecord> root = cq.from( OkrWorkAuthorizeRecord.class);
-		cq.select(root.get(OkrWorkAuthorizeRecord_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkAuthorizeRecord实体信息列表" )
-	public List<OkrWorkAuthorizeRecord> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkAuthorizeRecord>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkAuthorizeRecord> cq = cb.createQuery(OkrWorkAuthorizeRecord.class);
-		Root<OkrWorkAuthorizeRecord> root = cq.from(OkrWorkAuthorizeRecord.class);
-		Predicate p = root.get(OkrWorkAuthorizeRecord_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkAuthorizeRecord.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< String > cq = cb.createQuery( String.class );
-		Root< OkrWorkAuthorizeRecord > root = cq.from( OkrWorkAuthorizeRecord.class );
-		Predicate p = cb.equal( root.get( OkrWorkAuthorizeRecord_.centerId ), centerId );
-		cq.select( root.get( OkrWorkAuthorizeRecord_.id ) );
-		return em.createQuery( cq.where(p) ).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,列示所有的数据信息
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作信息ID,列示所有的数据信息" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkAuthorizeRecord> root = cq.from( OkrWorkAuthorizeRecord.class);
-		Predicate p = cb.equal( root.get(OkrWorkAuthorizeRecord_.workId), workId );
-		cq.select(root.get( OkrWorkAuthorizeRecord_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	//@MethodDescribe( "根据工作ID获取工作最大的授权级别" )
-	public Integer getMaxDelegateLevel( String workId ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();		
-		CriteriaQuery<OkrWorkAuthorizeRecord> cq = cb.createQuery( OkrWorkAuthorizeRecord.class );
-		Root<OkrWorkAuthorizeRecord> root = cq.from( OkrWorkAuthorizeRecord.class);		
-		
-		cq.orderBy( cb.desc( root.get( OkrWorkAuthorizeRecord_.delegateLevel ) ) );	
-		
-		Predicate p = cb.equal( root.get( OkrWorkAuthorizeRecord_.workId), workId);
-		
-		List<OkrWorkAuthorizeRecord> resultList = em.createQuery(cq.where(p)).getResultList();
-		if( resultList == null || resultList.size() == 0 ){
-			return 0;
-		}else{
-			return resultList.get(0).getDelegateLevel();
-		}
-	}
-
-	/**
-	 * 根据工作授权人身份获取第一次授权记录信息
-	 * @param workId
-	 * @param authorizeIdentity
-	 * @return
-	 * @throws Exception
-	 */
-	public OkrWorkAuthorizeRecord getFirstAuthorizeRecord( String workId, String authorizeIdentity ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		if( authorizeIdentity == null || authorizeIdentity.isEmpty() ){
-			throw new Exception( "authorizeIdentity is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();		
-		CriteriaQuery<OkrWorkAuthorizeRecord> cq = cb.createQuery( OkrWorkAuthorizeRecord.class );
-		Root<OkrWorkAuthorizeRecord> root = cq.from( OkrWorkAuthorizeRecord.class);
-		cq.orderBy( cb.asc( root.get( OkrWorkAuthorizeRecord_.delegateLevel ) ) );	
-		Predicate p = cb.equal( root.get( OkrWorkAuthorizeRecord_.workId), workId);
-		p = cb.and( p, cb.equal( root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ), authorizeIdentity));
-		p = cb.and( p, cb.equal( root.get( OkrWorkAuthorizeRecord_.status ), "正常"));
-		List<OkrWorkAuthorizeRecord> resultList = em.createQuery(cq.where(p)).getResultList();
-		if( resultList == null || resultList.size() == 0 ){
-			return null;
-		}else{
-			return resultList.get(0);
-		}
-	}
-	
-	/**
-	 * 根据工作, 承担人获取最后的一次有效授权记录信息
-	 * @param workId
-	 * @param undertakerIdentity 可以为空
-	 * @return
-	 * @throws Exception
-	 */
-	public OkrWorkAuthorizeRecord getLastAuthorizeRecord( String workId, String identity, String status ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();		
-		CriteriaQuery<OkrWorkAuthorizeRecord> cq = cb.createQuery( OkrWorkAuthorizeRecord.class );
-		Root<OkrWorkAuthorizeRecord> root = cq.from( OkrWorkAuthorizeRecord.class);
-		
-		cq.orderBy( cb.desc( root.get( OkrWorkAuthorizeRecord_.delegateLevel ) ) );	
-		
-		Predicate p = cb.equal( root.get( OkrWorkAuthorizeRecord_.workId ), workId );
-		
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkAuthorizeRecord_.status ), status ));
-		}		
-		if( identity != null ){
-			Predicate p1 = cb.equal( root.get( OkrWorkAuthorizeRecord_.targetIdentity), identity);
-			p1 = cb.or( p1, cb.equal( root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ), identity));
-			p = cb.and( p, p1 );
-		}
-		List<OkrWorkAuthorizeRecord> resultList = em.createQuery(cq.where(p)).getResultList();
-		if( resultList == null || resultList.size() == 0 ){
-			return null;
-		}else{
-			return resultList.get(0);
-		}
-	}
-
-	public List<String> listByAuthorizor( String workId, String delegatorIdentity, Integer delegateLevel ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkAuthorizeRecord> root = cq.from( OkrWorkAuthorizeRecord.class);
-		Predicate p = cb.equal( root.get(OkrWorkAuthorizeRecord_.workId), workId );
-		if( delegatorIdentity != null && !delegatorIdentity.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ), delegatorIdentity));
-		}
-		if( delegateLevel != null && delegateLevel > 0 ){
-			p = cb.and( p, cb.greaterThanOrEqualTo( root.get( OkrWorkAuthorizeRecord_.delegateLevel ), delegateLevel ));
-		}
-		cq.select( root.get( OkrWorkAuthorizeRecord_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 查询工作授权者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctDelegatorIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkAuthorizeRecord> root = cq.from(OkrWorkAuthorizeRecord.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkAuthorizeRecord_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询工作承接者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctTargetIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkAuthorizeRecord> root = cq.from(OkrWorkAuthorizeRecord.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkAuthorizeRecord_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkAuthorizeRecord_.targetIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkAuthorizeRecord_.targetIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkAuthorizeRecord_.targetIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从工作授权信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrWorkAuthorizeRecord> listErrorIdentitiesInAuthorizeRecord(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkAuthorizeRecord.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkAuthorizeRecord> cq = cb.createQuery( OkrWorkAuthorizeRecord.class );
-		Root<OkrWorkAuthorizeRecord> root = cq.from( OkrWorkAuthorizeRecord.class );
-		Predicate p = cb.isNotNull(root.get( OkrWorkAuthorizeRecord_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkAuthorizeRecord_.id ), recordId ) );
-		}
-		
-		Predicate p_delegatorIdentity = cb.isNotNull(root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ));
-		p_delegatorIdentity = cb.and( p_delegatorIdentity, cb.equal( root.get( OkrWorkAuthorizeRecord_.delegatorIdentity ), identity ) );
-		
-		Predicate p_targetIdentity = cb.isNotNull(root.get( OkrWorkAuthorizeRecord_.targetIdentity ));
-		p_targetIdentity = cb.and( p_targetIdentity, cb.equal( root.get( OkrWorkAuthorizeRecord_.targetIdentity ), identity ) );
-
-		Predicate p_identity = cb.or( p_delegatorIdentity, p_targetIdentity );
-			
-		p = cb.and( p, p_identity );
-
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-}

+ 0 - 842
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkBaseInfoFactory.java

@@ -1,842 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-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.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.assemble.control.jaxrs.okrworkbaseinfo.WrapInFilter;
-import com.x.okr.entity.OkrCenterWorkInfo;
-import com.x.okr.entity.OkrWorkBaseInfo;
-import com.x.okr.entity.OkrWorkBaseInfo_;
-
-public class OkrWorkBaseInfoFactory extends AbstractFactory {
-	
-	public OkrWorkBaseInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-
-	//@MethodDescribe( "获取指定Id的OkrWorkBaseInfo应用信息对象" )
-	public OkrWorkBaseInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkBaseInfo.class, ExceptionWhen.none);
-	}
-	
-//	@MethodDescribe( "列示全部的OkrWorkBaseInfo应用信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class);
-		cq.select(root.get(OkrWorkBaseInfo_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkBaseInfo应用信息列表" )
-	public List<OkrWorkBaseInfo> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkBaseInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkBaseInfo> cq = cb.createQuery(OkrWorkBaseInfo.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		Predicate p = root.get(OkrWorkBaseInfo_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据工作信息ID,查询该工作信息的所有下级工作ID
-	 * @param id
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "列示指定Id的OkrWorkBaseInfo应用信息列表" )
-	public List<String> getSubNormalWorkBaseInfoIds( String id ) throws Exception {
-		if( id == null || id.isEmpty() ){
-			return new ArrayList<String>();
-		}
-		List<String> status = new ArrayList<>();
-		status.add( "正常" );
-		status.add( "已归档" );
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkBaseInfo_.parentWorkId ), id );
-		p = cb.and( p, root.get(OkrWorkBaseInfo_.status ).in( status ));
-		cq.select(root.get(OkrWorkBaseInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据工作信息ID,查询该工作信息的所有下级工作ID
-	 * @param id
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "列示指定Id的OkrWorkBaseInfo应用信息列表" )
-	public List<String> getSubAbnormalWorkBaseInfoIds( String id ) throws Exception {
-		if( id == null || id.isEmpty() ){
-			return new ArrayList<String>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkBaseInfo_.parentWorkId ), id );
-		p = cb.and( p, cb.notEqual( root.get(OkrWorkBaseInfo_.status ), "正常" ));
-		cq.select(root.get(OkrWorkBaseInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 查询下一页的信息数据
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings( "unchecked" )
-	public List<OkrWorkBaseInfo> listNextWithFilter( String id, Integer count, Object sequence, WrapInFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		String order = wrapIn.getOrder();//排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		
-		if( order == null || order.isEmpty() ){
-			order = "DESC";
-		}
-		
-		Integer index = 1;
-		sql_stringBuffer.append( "SELECT o FROM "+OkrWorkBaseInfo.class.getCanonicalName()+" o where 1=1" );
-
-		if ((null != sequence) ) {
-			sql_stringBuffer.append( " and o."+wrapIn.getSequenceField()+" " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "<" : ">" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ((null != wrapIn.getWorkIds()) && wrapIn.getWorkIds().size() > 0) {
-			sql_stringBuffer.append( " and o.id in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getWorkIds() );
-			index++;
-		}
-		if ((null != wrapIn.getCreatorNames()) && wrapIn.getCreatorNames().size() > 0) {
-			sql_stringBuffer.append( " and o.creatorName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorUnitNames() && wrapIn.getCreatorUnitNames().size()>0) {
-			sql_stringBuffer.append( " and o.creatorUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorTopUnitNames() && wrapIn.getCreatorTopUnitNames().size() > 0 ) {
-			sql_stringBuffer.append( " and o.creatorTopUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorTopUnitNames() );
-			index++;
-		}
-		if ((null != wrapIn.getDeployerNames()) && wrapIn.getDeployerNames().size()>0 ) {
-			sql_stringBuffer.append( " and o.deployerName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getDeployerNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorUnitNames() && wrapIn.getCreatorUnitNames().size()>0) {
-			sql_stringBuffer.append( " and o.deployerUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorTopUnitNames() && wrapIn.getCreatorTopUnitNames().size() > 0 ) {
-			sql_stringBuffer.append( " and o.deployerTopUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorTopUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getWorkProcessStatusList() && wrapIn.getWorkProcessStatusList().size() > 0 ) {
-			sql_stringBuffer.append( " and o.workProcessStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getWorkProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like ?" + (index) );
-			vs.add( "%"+wrapIn.getTitle()+"%" );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0 ) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + ( StringUtils.equalsIgnoreCase( order, "DESC" ) ? "DESC" : "ASC" ) );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkBaseInfo.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults(count).getResultList();
-	}	
-	
-	/**
-	 * 查询上一页的信息数据
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings( "unchecked" )
-	public List<OkrWorkBaseInfo> listPrevWithFilter( String id, Integer count, Object sequence, WrapInFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		String order = wrapIn.getOrder();//排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		if( order == null || order.isEmpty() ){
-			order = "DESC";
-		}
-		
-		sql_stringBuffer.append( "SELECT o FROM " + OkrWorkBaseInfo.class.getCanonicalName()+" o where 1=1" );
-		if ((null != sequence) ) {
-			sql_stringBuffer.append( " and o."+wrapIn.getSequenceField()+" " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? ">" : "<" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ((null != wrapIn.getWorkIds()) && wrapIn.getWorkIds().size() > 0) {
-			sql_stringBuffer.append( " and o.id in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getWorkIds() );
-			index++;
-		}
-		if ((null != wrapIn.getCreatorNames()) && wrapIn.getCreatorNames().size() > 0) {
-			sql_stringBuffer.append( " and o.creatorName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorUnitNames() && wrapIn.getCreatorUnitNames().size()>0) {
-			sql_stringBuffer.append( " and o.creatorUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorTopUnitNames() && wrapIn.getCreatorTopUnitNames().size() > 0 ) {
-			sql_stringBuffer.append( " and o.creatorTopUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorTopUnitNames() );
-			index++;
-		}
-		if ((null != wrapIn.getDeployerNames()) && wrapIn.getDeployerNames().size()>0 ) {
-			sql_stringBuffer.append( " and o.deployerName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getDeployerNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorUnitNames() && wrapIn.getCreatorUnitNames().size()>0) {
-			sql_stringBuffer.append( " and o.deployerUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorTopUnitNames() && wrapIn.getCreatorTopUnitNames().size() > 0 ) {
-			sql_stringBuffer.append( " and o.deployerTopUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorTopUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getWorkProcessStatusList() && wrapIn.getWorkProcessStatusList().size() > 0 ) {
-			sql_stringBuffer.append( " and o.workProcessStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getWorkProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like ?" + (index) );
-			vs.add( "%"+wrapIn.getTitle()+"%" );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0 ) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + ( StringUtils.equalsIgnoreCase( order, "DESC" ) ? "DESC" : "ASC" ) );
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkBaseInfo.class );
-		//为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		
-		return query.setMaxResults(count).getResultList();
-	}
-	
-	/**
-	 * 查询符合的信息总数
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountWithFilter( WrapInFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		sql_stringBuffer.append( "SELECT count(o.id) FROM "+OkrWorkBaseInfo.class.getCanonicalName()+" o where 1=1" );
-		
-		if ((null != wrapIn.getWorkIds()) && wrapIn.getWorkIds().size() > 0) {
-			sql_stringBuffer.append( " and o.id in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getWorkIds() );
-			index++;
-		}
-		if ((null != wrapIn.getCreatorNames()) && wrapIn.getCreatorNames().size() > 0) {
-			sql_stringBuffer.append( " and o.creatorName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorUnitNames() && wrapIn.getCreatorUnitNames().size()>0) {
-			sql_stringBuffer.append( " and o.creatorUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorTopUnitNames() && wrapIn.getCreatorTopUnitNames().size() > 0 ) {
-			sql_stringBuffer.append( " and o.creatorTopUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorTopUnitNames() );
-			index++;
-		}
-		if ((null != wrapIn.getDeployerNames()) && wrapIn.getDeployerNames().size()>0 ) {
-			sql_stringBuffer.append( " and o.deployerName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getDeployerNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorUnitNames() && wrapIn.getCreatorUnitNames().size()>0) {
-			sql_stringBuffer.append( " and o.deployerUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getCreatorTopUnitNames() && wrapIn.getCreatorTopUnitNames().size() > 0 ) {
-			sql_stringBuffer.append( " and o.deployerTopUnitName in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getCreatorTopUnitNames() );
-			index++;
-		}
-		if (null != wrapIn.getWorkProcessStatusList() && wrapIn.getWorkProcessStatusList().size() > 0 ) {
-			sql_stringBuffer.append( " and o.workProcessStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getWorkProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like ?" + (index) );
-			vs.add( "%"+wrapIn.getTitle()+"%" );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0 ) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkBaseInfo.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}		
-		return (Long) query.getSingleResult();
-	}
-
-	//@MethodDescribe( "在IDS范围内,查询所有状态正常并且待确认的工作" )
-	public List<String> listUnConfirmWorkIdInIds(List<String> ids ) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			throw new Exception( "ids is null" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		Predicate p = root.get(OkrWorkBaseInfo_.id).in(ids);
-		p = cb.and( p, cb.equal( root.get(OkrWorkBaseInfo_.workProcessStatus ), "待确认" ));
-		p = cb.and( p, cb.equal( root.get(OkrWorkBaseInfo_.status ), "正常" ));
-		cq.select(root.get(OkrWorkBaseInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId( String centerId, List<String> statuses ) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< String > cq = cb.createQuery( String.class );
-		Root< OkrWorkBaseInfo > root = cq.from( OkrWorkBaseInfo.class );
-		Predicate p = cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId );
-		if( statuses != null && statuses.size() > 0 ){
-			p = cb.and( p, root.get( OkrWorkBaseInfo_.status ).in( statuses ));
-		}
-		cq.select( root.get( OkrWorkBaseInfo_.id ) );
-		return em.createQuery( cq.where(p) ).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID和有权限访问的工作ID列表来查询工作信息列表
-	 * @param centerId
-	 * @param workIds
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据中心工作ID和有权限访问的工作ID列表来查询工作信息列表" )
-	public List<OkrWorkBaseInfo> listWorkByCenterId( String centerId, List<String> workIds, List<String> statuses) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< OkrWorkBaseInfo > cq = cb.createQuery( OkrWorkBaseInfo.class );
-		Root< OkrWorkBaseInfo > root = cq.from( OkrWorkBaseInfo.class );
-		Predicate p = cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId );
-		if( workIds != null && workIds.size() > 0 ){
-			p = cb.and( p, root.get( OkrWorkBaseInfo_.id ).in( workIds ));
-		}
-		if( statuses != null && statuses.size() > 0 ){
-			p = cb.and( p, root.get( OkrWorkBaseInfo_.status ).in( statuses ));
-		}
-		return em.createQuery( cq.where(p) ).getResultList();
-	}
-
-	//@MethodDescribe( "查询需要立即进行工作汇报的工作ID列表" )
-	public List<String> listNeedReportWorkIds() throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class);
-		cq.select( root.get( OkrWorkBaseInfo_.id ) );
-		Predicate p = cb.isNotNull( root.get( OkrWorkBaseInfo_.nextReportTime) );
-		//下一次汇报时间早于当前时间
-		p = cb.and( p, cb.lessThanOrEqualTo(root.get( OkrWorkBaseInfo_.nextReportTime ), new Date()));
-		//未完成的工作
-		p = cb.and( p, cb.isFalse( root.get( OkrWorkBaseInfo_.isCompleted ) ));
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.status ), "正常" ));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listByParentId(String id) throws Exception {
-		if( id == null || id.isEmpty() ){
-			throw new Exception( " id is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< String > cq = cb.createQuery( String.class );
-		Root< OkrWorkBaseInfo > root = cq.from( OkrWorkBaseInfo.class );
-		Predicate p = cb.equal( root.get( OkrWorkBaseInfo_.parentWorkId ), id );
-		cq.select( root.get( OkrWorkBaseInfo_.id ) );
-		return em.createQuery( cq.where(p) ).getResultList();
-	}
-	
-	/**
-	 * 根据分析时间来查询需要进行进展分析的工作ID列表
-	 * @param report_progress
-	 * @param count
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据分析时间来查询需要进行进展分析的工作ID列表" )
-	public List<String> listIdsForNeedProgressAnalyse( String report_progress, int count ) throws Exception {
-		if( report_progress == null || report_progress.isEmpty() ){
-			throw new Exception( "report_progress is null." );
-		}
-		if( count == 0 ){
-			throw new Exception( "count is 0." );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< String > cq = cb.createQuery( String.class );
-		Root< OkrWorkBaseInfo > root = cq.from( OkrWorkBaseInfo.class );
-		Predicate p = cb.isFalse( root.get( OkrWorkBaseInfo_.isCompleted ) );
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.workProcessStatus ), "执行中" ) );
-		Predicate p1 = cb.isNull( root.get( OkrWorkBaseInfo_.progressAnalyseTime ) );		
-		p1 = cb.or( p1, cb.notEqual( root.get( OkrWorkBaseInfo_.progressAnalyseTime ), report_progress ));		
-		p = cb.and( p, p1 );
-		cq.select( root.get( OkrWorkBaseInfo_.id ) );
-		return em.createQuery( cq.where(p) ).setMaxResults( count ).getResultList();
-	}
-
-	public Long getProcessingWorkCountByCenterId( String centerId, List<String> status ) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( "centerId is null." );
-		}
-		if( status == null || status.isEmpty() ){
-			throw new Exception( "status is null." );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class);
-		Predicate p = root.get( OkrWorkBaseInfo_.status ).in( status );
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId));
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.workProcessStatus ), "执行中"));
-		//查询总数
-		cq.select( cb.count( root ) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getWorkTotalByCenterId( String centerId, List<String> status ) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( "centerId is null." );
-		}
-		if( status == null || status.isEmpty() ){
-			throw new Exception( "status is null." );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class);
-		Predicate p = root.get( OkrWorkBaseInfo_.status ).in( status );
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId));
-		//查询总数
-		cq.select( cb.count( root ) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getCompletedWorkCountByCenterId(String centerId, List<String> status) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( "centerId is null." );
-		}
-		if( status == null || status.isEmpty() ){
-			throw new Exception( "status is null." );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class);
-		Predicate p = root.get( OkrWorkBaseInfo_.status ).in( status );
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId));
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.workProcessStatus ), "已完成"));
-		//查询总数
-		cq.select( cb.count( root ) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getOvertimeWorkCountByCenterId(String centerId, List<String> status) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( "centerId is null." );
-		}
-		if( status == null || status.isEmpty() ){
-			throw new Exception( "status is null." );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class);
-		Predicate p = root.get( OkrWorkBaseInfo_.status ).in( status );
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId));
-		p = cb.and( p, cb.isTrue( root.get( OkrWorkBaseInfo_.isOverTime )));
-		//查询总数
-		cq.select( cb.count( root ) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getDraftWorkCountByCenterId(String centerId, List<String> status) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( "centerId is null." );
-		}
-		if( status == null || status.isEmpty() ){
-			throw new Exception( "status is null." );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class);
-		Predicate p = root.get( OkrWorkBaseInfo_.status ).in( status );
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId));
-		p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.workProcessStatus ), "草稿"));
-		//查询总数
-		cq.select( cb.count( root ) );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public List<OkrWorkBaseInfo> listAllProcessingWorks() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkBaseInfo> cq = cb.createQuery(OkrWorkBaseInfo.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkBaseInfo_.status ), "正常");
-		p = cb.and( p, cb.equal( root.get(OkrWorkBaseInfo_.workProcessStatus ), "执行中" ) );
-		p = cb.and( p, cb.lessThan( root.get(OkrWorkBaseInfo_.overallProgress ), 100 ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	public List<String> listAllProcessingWorkIds() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkBaseInfo_.status ), "正常");
-		p = cb.and( p, cb.equal( root.get(OkrWorkBaseInfo_.workProcessStatus ), "执行中" ) );
-		p = cb.and( p, cb.lessThan( root.get(OkrWorkBaseInfo_.overallProgress ), 100 ) );
-		cq.select( root.get( OkrWorkBaseInfo_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<OkrWorkBaseInfo> listAllDeployedWorks( String centerId, String status ) throws Exception {
-		List<String> processStatus = new ArrayList<String>();
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkBaseInfo> cq = cb.createQuery(OkrWorkBaseInfo.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		processStatus.add( "执行中" );
-		processStatus.add( "已完成" );
-		Predicate p = root.get(OkrWorkBaseInfo_.workProcessStatus ).in( processStatus );
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrWorkBaseInfo_.status ), status ) );
-		}
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get(OkrWorkBaseInfo_.centerId ), centerId ) );
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	public List<String> listAllDeployedWorkIds( String centerId, String status ) throws Exception {
-		List<String> processStatus = new ArrayList<String>();
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		processStatus.add( "执行中" );
-		processStatus.add( "已完成" );
-		Predicate p = root.get( OkrWorkBaseInfo_.workProcessStatus ).in( processStatus );
-		if( status != null && !"All".equals( status )) {
-			p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.status ), status ) );
-		}
-		if( centerId != null && !centerId.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.centerId ), centerId ) );
-		}
-		cq.select( root.get( OkrWorkBaseInfo_.id ) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 查询具体工作协助者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctCooperateIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		/*
-		CriteriaQuery<List> cq = cb.createQuery( List.class );
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		cq.select(root.get( OkrWorkBaseInfo_.cooperateIdentityList ));
-		List<List> allList = em.createQuery(cq).getResultList();
-		*/
-		
-		CriteriaQuery<OkrWorkBaseInfo> cq = cb.createQuery( OkrWorkBaseInfo.class );
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);		
-		List<OkrWorkBaseInfo> os = em.createQuery(cq.select(root)).getResultList();
-		List<List> allList = new ArrayList<>();
-		for (OkrWorkBaseInfo o : os) {
-			allList.add(o.getCooperateIdentityList());
-		}
-		
-		
-		if(ListTools.isNotEmpty( allList )) {
-			HashSet hashSet = new  HashSet();
-			for( List<String> identities : allList ) {
-				if(ListTools.isNotEmpty( identities )) {
-					for( String identity : identities ) {
-						if( ListTools.isNotEmpty(identities_ok) && identities_ok.contains( identity ) ){
-							continue;
-						}
-						if( ListTools.isNotEmpty(identities_error) && identities_error.contains( identity ) ){
-							continue;
-						}
-						hashSet.add( identity );
-					}
-				}
-			}
-			List<String> result = new ArrayList<>();
-			result.addAll(hashSet);
-			return result;
-		}
-		return null;
-	}
-	
-	/**
-	 * 查询具体工作创建者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctCreatorIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkBaseInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkBaseInfo_.creatorIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkBaseInfo_.creatorIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkBaseInfo_.creatorIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询具体工作部署者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctDeployerIdentity( List<String> identities_ok, List<String> identities_error ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkBaseInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkBaseInfo_.deployerIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkBaseInfo_.deployerIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkBaseInfo_.deployerIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询具体工作阅知领导身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctReportLeaderIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		/*
-		CriteriaQuery<List> cq = cb.createQuery( List.class );		
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		cq.select(root.get( OkrWorkBaseInfo_.readLeaderIdentityList ));
-		List<List> allList = em.createQuery(cq).getResultList();
-		*/
-		
-		CriteriaQuery<OkrWorkBaseInfo> cq = cb.createQuery( OkrWorkBaseInfo.class );
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);		
-		List<OkrWorkBaseInfo> os = em.createQuery(cq.select(root)).getResultList();
-		List<List> allList = new ArrayList<>();
-		for (OkrWorkBaseInfo o : os) {
-			allList.add(o.getReadLeaderIdentityList());
-		}
-		
-		if(ListTools.isNotEmpty( allList )) {
-			HashSet hashSet = new  HashSet();
-			for( List<String> identities : allList ) {
-				if(ListTools.isNotEmpty( identities )) {
-					for( String identity : identities ) {
-						if( ListTools.isNotEmpty(identities_ok) && identities_ok.contains( identity ) ){
-							continue;
-						}
-						if( ListTools.isNotEmpty(identities_error) && identities_error.contains( identity ) ){
-							continue;
-						}
-						hashSet.add( identity );
-					}
-				}
-			}
-			List<String> result = new ArrayList<>();
-			result.addAll(hashSet);
-			return result;
-		}
-		return null;
-	}
-	/**
-	 * 查询具体工作阅知领导身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctResponsibilityIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrWorkBaseInfo.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkBaseInfo> root = cq.from(OkrWorkBaseInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkBaseInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkBaseInfo_.responsibilityIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkBaseInfo_.responsibilityIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkBaseInfo_.responsibilityIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据身份名称,从具体工作信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrWorkBaseInfo> listErrorIdentitiesInWorkBaseInfo(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkBaseInfo> cq = cb.createQuery( OkrWorkBaseInfo.class );
-		Root<OkrWorkBaseInfo> root = cq.from( OkrWorkBaseInfo.class );
-		Predicate p = cb.isNotNull(root.get( OkrWorkBaseInfo_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkBaseInfo_.id ), recordId ) );
-		}
-		
-		Predicate p_creatorIdentity = cb.isNotNull(root.get( OkrWorkBaseInfo_.creatorIdentity ));
-		p_creatorIdentity = cb.and( p_creatorIdentity, cb.equal( root.get( OkrWorkBaseInfo_.creatorIdentity ), identity ) );
-		
-		Predicate p_deployerIdentity = cb.isNotNull(root.get( OkrWorkBaseInfo_.deployerIdentity ));
-		p_deployerIdentity = cb.and( p_deployerIdentity, cb.equal( root.get( OkrWorkBaseInfo_.deployerIdentity ), identity ) );
-		
-		Predicate p_reportAdminIdentity = cb.isNotNull(root.get( OkrWorkBaseInfo_.reportAdminIdentity ));
-		p_reportAdminIdentity = cb.and( p_reportAdminIdentity, cb.equal( root.get( OkrWorkBaseInfo_.reportAdminIdentity ), identity ) );
-		
-		Predicate p_responsibilityIdentity = cb.isNotNull(root.get( OkrWorkBaseInfo_.responsibilityIdentity ));
-		p_responsibilityIdentity = cb.and( p_responsibilityIdentity, cb.equal( root.get( OkrWorkBaseInfo_.responsibilityIdentity ), identity ) );
-		
-		Predicate p_cooperateIdentity = cb.isNotNull(root.get( OkrWorkBaseInfo_.cooperateIdentityList ));
-		p_cooperateIdentity = cb.and( p_cooperateIdentity, cb.isMember( identity, root.get( OkrWorkBaseInfo_.cooperateIdentityList )) );
-		
-		Predicate p_readLeaderIdentity = cb.isNotNull(root.get( OkrWorkBaseInfo_.readLeaderIdentityList ));
-		p_readLeaderIdentity = cb.and( p_readLeaderIdentity, cb.isMember( identity, root.get( OkrWorkBaseInfo_.readLeaderIdentityList ) ) );
-		
-		Predicate p_identity = cb.or( p_creatorIdentity, p_deployerIdentity, p_reportAdminIdentity, p_responsibilityIdentity, p_cooperateIdentity, p_readLeaderIdentity );
-			
-		p = cb.and( p, p_identity );
-		
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-}

+ 0 - 295
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkChatFactory.java

@@ -1,295 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-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.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrWorkChat;
-import com.x.okr.entity.OkrWorkChat_;
-
-/**
- * 类   名:OkrWorkChatFactory<br/>
- * 实体类:OkrWorkChat<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:27
-**/
-public class OkrWorkChatFactory extends AbstractFactory {
-
-	public OkrWorkChatFactory( Business business ) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrWorkChat实体信息对象" )
-	public OkrWorkChat get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkChat.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrWorkChat实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkChat.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkChat> root = cq.from( OkrWorkChat.class);
-		cq.select(root.get(OkrWorkChat_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkChat实体信息列表" )
-	public List<OkrWorkChat> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkChat>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkChat.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkChat> cq = cb.createQuery(OkrWorkChat.class);
-		Root<OkrWorkChat> root = cq.from(OkrWorkChat.class);
-		Predicate p = root.get(OkrWorkChat_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkChat.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery< String > cq = cb.createQuery( String.class );
-		Root< OkrWorkChat > root = cq.from( OkrWorkChat.class );
-		Predicate p = cb.equal( root.get( OkrWorkChat_.centerId ), centerId );
-		cq.select( root.get( OkrWorkChat_.id ) );
-		return em.createQuery( cq.where(p) ).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,列示所有的数据信息
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作信息ID,列示所有的数据信息" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get( OkrWorkChat.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkChat> root = cq.from( OkrWorkChat.class);
-		Predicate p = cb.equal( root.get( OkrWorkChat_.workId ), workId );
-		cq.select(root.get( OkrWorkChat_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 查询下一页的信息数据
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings( "unchecked" )
-	public List<OkrWorkChat> listNextWithFilter( String id, Integer count, Object sequence, String workId, String sequenceField, String order ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkChat.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		
-		if( order == null || order.isEmpty() ){
-			order = "DESC";
-		}
-		
-		Integer index = 1;
-		sql_stringBuffer.append( "SELECT o FROM "+OkrWorkChat.class.getCanonicalName()+" o where 1=1" );
-
-		if ((null != sequence) ) {
-			sql_stringBuffer.append( " and o."+ sequenceField +" " + (StringUtils.equalsIgnoreCase( order, "DESC" ) ? "<" : ">" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ( null != workId && !workId.isEmpty() ) {
-			sql_stringBuffer.append( " and o.workId =  ?" + (index) );
-			vs.add( workId );
-			index++;
-		}
-		
-		sql_stringBuffer.append( " order by o." + sequenceField + " " + ( StringUtils.equalsIgnoreCase( order, "DESC" ) ? "DESC" : "ASC" ) );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkChat.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults(count).getResultList();
-	}	
-	
-	/**
-	 * 查询上一页的信息数据
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings( "unchecked" )
-	public List<OkrWorkChat> listPrevWithFilter( String id, Integer count, Object sequence, String workId, String sequenceField, String order ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkChat.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		if( order == null || order.isEmpty() ){
-			order = "DESC";
-		}
-		
-		sql_stringBuffer.append( "SELECT o FROM "+ OkrWorkChat.class.getCanonicalName() +" o where 1=1" );
-
-		if ((null != sequence) ) {
-			sql_stringBuffer.append( " and o."+ sequenceField +" " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? ">" : "<" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ( null != workId && !workId.isEmpty() ) {
-			sql_stringBuffer.append( " and o.workId =  ?" + (index) );
-			vs.add( workId );
-			index++;
-		}
-		
-		sql_stringBuffer.append( " order by o." + sequenceField + " " + ( StringUtils.equalsIgnoreCase( order, "DESC" ) ? "DESC" : "ASC" ) );
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkChat.class );
-		//为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		
-		return query.setMaxResults(count).getResultList();
-	}
-	
-	/**
-	 * 查询符合的信息总数
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountWithFilter( String workId ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkChat.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		sql_stringBuffer.append( "SELECT count(o.id) FROM "+OkrWorkChat.class.getCanonicalName()+" o where 1=1" );
-
-		if ( null != workId && !workId.isEmpty() ) {
-			sql_stringBuffer.append( " and o.workId =  ?" + (index) );
-			vs.add( workId );
-			index++;
-		}
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkChat.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}		
-		return (Long) query.getSingleResult();
-	}
-	/**
-	 * 查询工作交流信息发送者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctSenderIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkChat.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkChat> root = cq.from(OkrWorkChat.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkChat_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkChat_.senderIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkChat_.senderIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkChat_.senderIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询工作交流信息接收者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctTargetIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkChat.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkChat> root = cq.from(OkrWorkChat.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkChat_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkChat_.targetIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkChat_.targetIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkChat_.targetIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从具体工作交流信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrWorkChat> listErrorIdentitiesInWorkChat(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkChat.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkChat> cq = cb.createQuery( OkrWorkChat.class );
-		Root<OkrWorkChat> root = cq.from( OkrWorkChat.class );
-		Predicate p = cb.isNotNull(root.get( OkrWorkChat_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkChat_.id ), recordId ) );
-		}
-		
-		Predicate p_targetIdentity = cb.isNotNull(root.get( OkrWorkChat_.targetIdentity ));
-		p_targetIdentity = cb.and( p_targetIdentity, cb.equal( root.get( OkrWorkChat_.targetIdentity ), identity ) );
-		
-		Predicate p_senderIdentity = cb.isNotNull(root.get( OkrWorkChat_.senderIdentity ));
-		p_senderIdentity = cb.and( p_senderIdentity, cb.equal( root.get( OkrWorkChat_.senderIdentity ), identity ) );
-		
-		Predicate p_identity = cb.or( p_targetIdentity, p_senderIdentity );
-		
-		p = cb.and( p, p_identity );
-		
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 91
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkDetailInfoFactory.java

@@ -1,91 +0,0 @@
-package com.x.okr.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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrWorkDetailInfo;
-import com.x.okr.entity.OkrWorkDetailInfo_;
-
-/**
- * 类   名:OkrWorkDetailInfoFactory<br/>
- * 实体类:OkrWorkDetailInfo<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:27
-**/
-public class OkrWorkDetailInfoFactory extends AbstractFactory {
-
-	public OkrWorkDetailInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrWorkDetailInfo实体信息对象" )
-	public OkrWorkDetailInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkDetailInfo.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrWorkDetailInfo实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkDetailInfo> root = cq.from( OkrWorkDetailInfo.class);
-		cq.select(root.get(OkrWorkDetailInfo_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkDetailInfo实体信息列表" )
-	public List<OkrWorkDetailInfo> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkDetailInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkDetailInfo> cq = cb.createQuery(OkrWorkDetailInfo.class);
-		Root<OkrWorkDetailInfo> root = cq.from(OkrWorkDetailInfo.class);
-		Predicate p = root.get(OkrWorkDetailInfo_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-//	@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkDetailInfo> root = cq.from(OkrWorkDetailInfo.class);
-		Predicate p = cb.equal( root.get( OkrWorkDetailInfo_.centerId ), centerId );
-		cq.select(root.get( OkrWorkDetailInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listByWorkId(String workId) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( " workId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkDetailInfo> root = cq.from(OkrWorkDetailInfo.class);
-		Predicate p = cb.equal( root.get( OkrWorkDetailInfo_.id ), workId );
-		cq.select(root.get( OkrWorkDetailInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 349
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkDynamicsFactory.java

@@ -1,349 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-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.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrWorkDynamics;
-import com.x.okr.entity.OkrWorkDynamics_;
-
-/**
- * 类 名:OkrWorkDynamicsFactory<br/>
- * 实体类:OkrWorkDynamics<br/>
- * 作 者:Liyi<br/>
- * 单 位:O2 Team<br/>
- * 日 期:2016-05-20 17:17:27
- **/
-public class OkrWorkDynamicsFactory extends AbstractFactory {
-
-	public OkrWorkDynamicsFactory(Business business) throws Exception {
-		super(business);
-	}
-
-	// @MethodDescribe( "获取指定Id的OkrWorkDynamics实体信息对象" )
-	public OkrWorkDynamics get(String id) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkDynamics.class, ExceptionWhen.none);
-	}
-
-	// @MethodDescribe( "列示全部的OkrWorkDynamics实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkDynamics> root = cq.from(OkrWorkDynamics.class);
-		cq.select(root.get(OkrWorkDynamics_.id));
-		return em.createQuery(cq).getResultList();
-	}
-
-	// @MethodDescribe( "列示指定Id的OkrWorkDynamics实体信息列表" )
-	public List<OkrWorkDynamics> list(List<String> ids) throws Exception {
-		if (ids == null || ids.size() == 0) {
-			return new ArrayList<OkrWorkDynamics>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkDynamics> cq = cb.createQuery(OkrWorkDynamics.class);
-		Root<OkrWorkDynamics> root = cq.from(OkrWorkDynamics.class);
-		Predicate p = root.get(OkrWorkDynamics_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * 
-	 * @param centerId
-	 *            中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if (centerId == null || centerId.isEmpty()) {
-			throw new Exception(" centerId is null!");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkDynamics> root = cq.from(OkrWorkDynamics.class);
-		Predicate p = cb.equal(root.get(OkrWorkDynamics_.centerId), centerId);
-		cq.select(root.get(OkrWorkDynamics_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,列示所有的数据信息
-	 * 
-	 * @param workId
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe("根据工作信息ID,列示所有的数据信息")
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkDynamics> root = cq.from(OkrWorkDynamics.class);
-		Predicate p = cb.equal(root.get(OkrWorkDynamics_.workId), workId);
-		cq.select(root.get(OkrWorkDynamics_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 查询下一页的信息数据
-	 * 
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkDynamics> listNextWithFilter(String id, Integer count, Object sequence, List<String> centerIds,
-			List<String> workIds, String sequenceField, String order, Boolean isOkrManager) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-
-		Integer index = 1;
-		sql_stringBuffer.append("SELECT o FROM " + OkrWorkDynamics.class.getCanonicalName() + " o where 1=1");
-
-		if ((null != sequence)) {
-			sql_stringBuffer.append(" and o." + sequenceField + " "
-					+ (StringUtils.equalsIgnoreCase(order, "DESC") ? "<" : ">") + (" ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-
-		if ((null != centerIds && centerIds.size() > 0) || (null != workIds && workIds.size() > 0)) {
-			sql_stringBuffer.append(" and ( ");
-			// 中心工作IDS
-			if (null != centerIds && centerIds.size() > 0) {
-				sql_stringBuffer.append(" o.centerId in ( ?" + (index) + " )");
-				vs.add(centerIds);
-				index++;
-			}
-
-			if (null != centerIds && centerIds.size() > 0 && null != workIds && workIds.size() > 0) {
-				sql_stringBuffer.append(" or ");
-			}
-
-			// 工作IDS
-			if (null != workIds && workIds.size() > 0) {
-				sql_stringBuffer.append(" o.workId in ( ?" + (index) + " )");
-				vs.add(workIds);
-				index++;
-			}
-
-			sql_stringBuffer.append(" ) ");
-		} else {
-			if (!isOkrManager) {
-				return null;
-			}
-		}
-
-		sql_stringBuffer.append(
-				" order by o." + sequenceField + " " + (StringUtils.equalsIgnoreCase(order, "DESC") ? "DESC" : "ASC"));
-
-		Query query = em.createQuery(sql_stringBuffer.toString(), OkrWorkDynamics.class);
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-
-		return query.setMaxResults(count).getResultList();
-	}
-
-	/**
-	 * 查询上一页的信息数据
-	 * 
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkDynamics> listPrevWithFilter(String id, Integer count, Object sequence, List<String> centerIds,
-			List<String> workIds, String sequenceField, String order, Boolean isOkrSystemAdmin) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-
-		sql_stringBuffer.append("SELECT o FROM " + OkrWorkDynamics.class.getCanonicalName() + " o where 1=1");
-
-		if ((null != sequence)) {
-			sql_stringBuffer.append(" and o." + sequenceField + " "
-					+ (StringUtils.equalsIgnoreCase(order, "DESC") ? "<" : ">") + (" ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-
-		if ((null != centerIds && centerIds.size() > 0) || (null != workIds && workIds.size() > 0)) {
-			sql_stringBuffer.append(" and ( ");
-			// 中心工作IDS
-			if (null != centerIds && centerIds.size() > 0) {
-				sql_stringBuffer.append(" o.centerId in ( ?" + (index) + " )");
-				vs.add(centerIds);
-				index++;
-			}
-
-			if (null != centerIds && centerIds.size() > 0 && null != workIds && workIds.size() > 0) {
-				sql_stringBuffer.append(" or ");
-			}
-
-			// 工作IDS
-			if (null != workIds && workIds.size() > 0) {
-				sql_stringBuffer.append(" o.workId in ( ?" + (index) + " )");
-				vs.add(workIds);
-				index++;
-			}
-
-			sql_stringBuffer.append(" ) ");
-		} else {
-			if (!isOkrSystemAdmin) {
-				return null;
-			}
-		}
-
-		sql_stringBuffer.append(
-				" order by o." + sequenceField + " " + (StringUtils.equalsIgnoreCase(order, "DESC") ? "DESC" : "ASC"));
-
-		Query query = em.createQuery(sql_stringBuffer.toString(), OkrWorkDynamics.class);
-		// 为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-
-		return query.setMaxResults(count).getResultList();
-	}
-
-	/**
-	 * 查询符合的信息总数
-	 * 
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountWithFilter(List<String> centerIds, List<String> workIds, String sequenceField, String order,
-			Boolean isOkrSystemAdmin) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-
-		sql_stringBuffer.append("SELECT count(o.id) FROM " + OkrWorkDynamics.class.getCanonicalName() + " o where 1=1");
-
-		if ((null != centerIds && centerIds.size() > 0) || (null != workIds && workIds.size() > 0)) {
-			sql_stringBuffer.append(" and ( ");
-			// 中心工作IDS
-			if (null != centerIds && centerIds.size() > 0) {
-				sql_stringBuffer.append(" o.centerId in ( ?" + (index) + " )");
-				vs.add(centerIds);
-				index++;
-			}
-
-			if (null != centerIds && centerIds.size() > 0 && null != workIds && workIds.size() > 0) {
-				sql_stringBuffer.append(" or ");
-			}
-
-			// 工作IDS
-			if (null != workIds && workIds.size() > 0) {
-				sql_stringBuffer.append(" o.workId in ( ?" + (index) + " )");
-				vs.add(workIds);
-				index++;
-			}
-
-			sql_stringBuffer.append(" ) ");
-		} else {
-			if (!isOkrSystemAdmin) {
-				return 0;
-			}
-		}
-
-		Query query = em.createQuery(sql_stringBuffer.toString(), OkrWorkDynamics.class);
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return (Long) query.getSingleResult();
-	}
-
-	/**
-	 * 查询工作动态信息操作者身份列表(去重复)
-	 * 
-	 * @param identities_ok
-	 *            排除身份
-	 * @param identities_error
-	 *            排除身份
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listAllDistinctTargetIdentity(List<String> identities_ok, List<String> identities_error)
-			throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkDynamics> root = cq.from(OkrWorkDynamics.class);
-
-		Predicate p = cb.isNotNull(root.get(OkrWorkDynamics_.id));
-		if (identities_ok != null && identities_ok.size() > 0) {
-			p = cb.and(p, cb.not(root.get(OkrWorkDynamics_.targetIdentity).in(identities_ok)));
-		}
-		if (identities_error != null && identities_error.size() > 0) {
-			p = cb.and(p, cb.not(root.get(OkrWorkDynamics_.targetIdentity).in(identities_error)));
-		}
-		cq.select(root.get(OkrWorkDynamics_.targetIdentity));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据身份名称,从具体工作操作动态信息中查询与该身份有关的所有信息列表
-	 * 
-	 * @param identity
-	 * @return
-	 * @throws Exception
-	 */
-	public List<OkrWorkDynamics> listErrorIdentitiesInDynamics(String identity) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkDynamics.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkDynamics> cq = cb.createQuery(OkrWorkDynamics.class);
-		Root<OkrWorkDynamics> root = cq.from(OkrWorkDynamics.class);
-		Predicate p = cb.isNotNull(root.get(OkrWorkDynamics_.id));
-
-		Predicate p_targetIdentity = cb.isNotNull(root.get(OkrWorkDynamics_.targetIdentity));
-		p_targetIdentity = cb.and(p_targetIdentity, cb.equal(root.get(OkrWorkDynamics_.targetIdentity), identity));
-
-		p = cb.and(p, p_targetIdentity);
-
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 1432
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkPersonFactory.java

@@ -1,1432 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-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.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.assemble.control.jaxrs.WorkCommonSearchFilter;
-import com.x.okr.entity.OkrWorkPerson;
-import com.x.okr.entity.OkrWorkPerson_;
-
-public class OkrWorkPersonFactory extends AbstractFactory {
-
-	private static  Logger logger = LoggerFactory.getLogger(OkrWorkPersonFactory.class);
-
-	public OkrWorkPersonFactory(Business business) throws Exception {
-		super(business);
-	}
-
-	// @MethodDescribe( "获取指定Id的OkrWorkPerson对象" )
-	public OkrWorkPerson get(String id) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkPerson.class, ExceptionWhen.none);
-	}
-
-	// @MethodDescribe( "列示全部的OkrWorkPerson列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.id));
-		return em.createQuery(cq).getResultList();
-	}
-
-	// @MethodDescribe( "列示指定Id的OkrWorkPerson列表" )
-	public List<OkrWorkPerson> list(List<String> ids) throws Exception {
-		if (ids == null || ids.size() == 0) {
-			return new ArrayList<OkrWorkPerson>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkPerson> cq = cb.createQuery(OkrWorkPerson.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = root.get(OkrWorkPerson_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据用户姓名,列示有权限访问的所有具体工作Id列表
-	 * 
-	 * @param name
-	 * @param statuses
-	 *            需要显示的信息状态: 正常|已删除
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据用户姓名,列示有权限访问的所有具体工作Id列表" )
-	public List<String> listDistinctWorkIdsByIdentity(String userIdentity, String centerId, List<String> statuses)
-			throws Exception {
-		if (userIdentity == null || userIdentity.isEmpty()) {
-			logger.warn("userIdentity is null!");
-			return null;
-		}
-
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.workId));
-
-		/**
-		 * 获取的时候过滤条件: 1、如果当前身份是创建者或者部署者的,那么,草稿也要取,如果当前身份不是创建者或者部署者,那么草稿不要去
-		 * 2、信息状态是正常的才取出来 3、观察者是自己的取出来 状态正常 and ( ( 姓名 = name and 身份 in ( 部署者,
-		 * 创建者 ) ) or ( 姓名 = name and 身份 in ( 协助者,阅知者 ) and 处理状态 != 草稿 ) )
-		 */
-		Predicate p = cb.isNotNull(root.get(OkrWorkPerson_.workId)); // 工作ID不为空的就是具体工作的权限信息
-		if (centerId != null && !centerId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), centerId));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-
-		List<String> identityList_1 = new ArrayList<String>();
-		List<String> identityList_2 = new ArrayList<String>();
-		identityList_1.add("部署者");
-		identityList_1.add("创建者");
-		// ( 姓名 = name and 身份 in ( 部署者, 创建者 ) )
-		Predicate p_creator_or_depoloyer = cb.equal(root.get(OkrWorkPerson_.employeeIdentity), userIdentity);
-		p_creator_or_depoloyer = cb.and(p_creator_or_depoloyer,
-				root.get(OkrWorkPerson_.processIdentity).in(identityList_1));
-
-		identityList_2.add("观察者");
-		identityList_2.add("协助者");
-		identityList_2.add("责任者");
-		identityList_2.add("阅知者");
-		identityList_2.add("授权者");
-		// ( 姓名 = name and 身份 in ( 责任者,协助者,阅知者 ) and 处理状态 != 草稿 )
-		Predicate p_watcher = cb.equal(root.get(OkrWorkPerson_.employeeIdentity), userIdentity);
-		p_watcher = cb.and(p_watcher, root.get(OkrWorkPerson_.processIdentity).in(identityList_2));
-		p_watcher = cb.and(p_watcher, cb.notEqual(root.get(OkrWorkPerson_.workProcessStatus), "草稿"));
-
-		p = cb.and(p, cb.or(p_creator_or_depoloyer, p_watcher));
-
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据用户姓名,列示有权限访问的所有具体工作Id列表
-	 * 
-	 * @param name
-	 * @param statuses
-	 *            需要显示的信息状态: 正常|已删除
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据用户姓名,列示有权限访问的所有具体工作Id列表" )
-	public List<String> listDistinctWorkIdsWithMe(String userIdentity, String centerId) throws Exception {
-		if (userIdentity == null || userIdentity.isEmpty()) {
-			logger.warn("userIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.workId));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.employeeIdentity), userIdentity);
-		if (centerId != null && !centerId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), centerId));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据用户姓名和处理者身份,列示有权限访问的所有具体工作Id列表" )
-	public List<String> listDistinctWorkIdsByPerson(String name, String processIdentity) throws Exception {
-		if (name == null || name.isEmpty()) {
-			logger.warn("name is null!");
-			return null;
-		}
-		if (processIdentity == null || processIdentity.isEmpty()) {
-			logger.warn("processIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.workId));
-		Predicate p = cb.isNotNull(root.get(OkrWorkPerson_.workId));
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeName), name));
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据用户姓名和处理者身份,列示有权限访问的所有具体工作Id列表" )
-	public List<String> listDistinctWorkIdsByPersonIndentity(String centerId, String identity, String processIdentity,
-			List<String> notInCenterIds) throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			logger.warn("identity is null!");
-			return null;
-		}
-		if (processIdentity == null || processIdentity.isEmpty()) {
-			logger.warn("processIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.workId));
-
-		Predicate p = cb.isNotNull(root.get(OkrWorkPerson_.workId));
-
-		if (notInCenterIds != null && !notInCenterIds.isEmpty()) {
-			p = cb.and(p, cb.not(root.get(OkrWorkPerson_.centerId).in(notInCenterIds)));
-		}
-		if (centerId != null && !centerId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), centerId));
-		}
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.status), "正常"));
-
-		return em.createQuery(cq.where(p)).setMaxResults(200).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据用户姓名,列示有权限访问的所有中心工作Id列表" )
-	public List<String> listDistinctCenterIdsByPerson(String name, List<String> statuses) throws Exception {
-		if (name == null || name.isEmpty()) {
-			logger.warn("name is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.employeeName), name);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据用户姓名和处理者身份,列示有权限访问的所有中心工作Id列表" )
-	public List<String> listDistinctCenterIdsByPerson(String name, String processIdentity, List<String> statuses)
-			throws Exception {
-		if (name == null || name.isEmpty()) {
-			logger.warn("name is null!");
-			return null;
-		}
-		if (processIdentity == null || processIdentity.isEmpty()) {
-			logger.warn("processIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.employeeName), name);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据用户身份和处理者身份,列示有权限访问的所有中心工作Id列表" )
-	public List<String> listDistinctCenterIdsByPersonIdentity(String identity, String processIdentity,
-			List<String> statuses) throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			logger.warn("identity is null!");
-			return null;
-		}
-		if (processIdentity == null || processIdentity.isEmpty()) {
-			logger.warn("processIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据组织名称,列示有权限访问的所有中心工作Id列表" )
-	public List<String> listDistinctCenterIdsByUnitName(String name, List<String> statuses) throws Exception {
-		if (name == null || name.isEmpty()) {
-			logger.warn("name is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.unitName), name);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据组织列表,列示有权限访问的所有中心工作Id列表" )
-	public List<String> listDistinctCenterIdsByUnitNames(List<String> names, List<String> statuses) throws Exception {
-		if (names == null || names.size() == 0) {
-			logger.warn("names is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		Predicate p = root.get(OkrWorkPerson_.unitName).in(names);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据顶层组织名称,列示有权限访问的所有中心工作Id列表" )
-	public List<String> listDistinctCenterIdsByTopUnitName(String name, List<String> statuses) throws Exception {
-		if (name == null || name.isEmpty()) {
-			logger.warn("name is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.topUnitName), name);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据中心工作ID,查询所有的干系人姓名
-	 * 
-	 * @param centerId
-	 * @param identity
-	 *            干系人身份
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据中心工作ID,查询所有的干系人身份" )
-	public List<String> listDistinctIdentityNameByCenterId(String centerId, String identity) throws Exception {
-		if (centerId == null || centerId.isEmpty()) {
-			logger.warn("centerId is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.employeeIdentity));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.centerId), centerId);
-		if (identity != null && !identity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), identity));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(2000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	// @MethodDescribe( "根据顶层组织列表,列示有权限访问的所有中心工作Id列表" )
-	public List<String> listDistinctCenterIdsByTopUnitNames(List<String> names, List<String> statuses)
-			throws Exception {
-		if (names == null || names.size() == 0) {
-			logger.warn("names is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		Predicate p = root.get(OkrWorkPerson_.topUnitName).in(names);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据工作ID,获取工作的指定干系人
-	 * 
-	 * @param id
-	 * @param identity
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> getWorkPerson(String workId, String identity, List<String> statuses) throws Exception {
-		if (workId == null || workId.isEmpty()) {
-			logger.warn("id is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.employeeName));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.workId), workId);
-		if (identity != null && !identity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), identity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(100).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据中心工作ID,工作ID和员工姓名来查询已经存在的工作干系人信息
-	 * 
-	 * @param centerId
-	 * @param workId
-	 * @param employeeName
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listWorkByCenterAndIdentity(String centerId, String employeeIdentity, String identity,
-			List<String> statuses) throws Exception {
-		if (employeeIdentity == null || employeeIdentity.isEmpty()) {
-			logger.warn("employeeIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.id));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.employeeIdentity), employeeIdentity);
-		if (centerId != null && !centerId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), centerId));
-		}
-		p = cb.and(p, cb.isNotNull(root.get(OkrWorkPerson_.workId)));
-		if (identity != null && !identity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), identity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,工作ID和员工姓名来查询已经存在的工作干系人信息
-	 * 
-	 * @param centerId
-	 * @param workId
-	 * @param employeeName
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listByWorkAndIdentity(String centerId, String workId, String employeeIdentity, String identity,
-			List<String> statuses) throws Exception {
-		if (employeeIdentity == null || employeeIdentity.isEmpty()) {
-			logger.warn("employeeIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.id));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.employeeIdentity), employeeIdentity);
-		if (centerId != null && !centerId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), centerId));
-		}
-		if (workId != null && !workId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workId), workId));
-		}
-		if (identity != null && !identity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), identity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,工作ID和员工姓名来查询已经存在的工作干系人信息
-	 * 
-	 * @param centerId
-	 * @param workId
-	 * @param employeeName
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listDistinctWorkIdsByWorkAndIdentity(String centerId, String workId, String employeeIdentity,
-			String identity, List<String> statuses) throws Exception {
-		if (employeeIdentity == null || employeeIdentity.isEmpty()) {
-			logger.warn("employeeIdentity is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.workId));
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.employeeIdentity), employeeIdentity);
-		p = cb.and(p, cb.isNotNull(root.get(OkrWorkPerson_.workId)));
-		if (centerId != null && !centerId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), centerId));
-		}
-		if (workId != null && !workId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workId), workId));
-		}
-		if (identity != null && !identity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), identity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据中心工作ID,工作ID来查询已经存在的工作干系人身份
-	 * 
-	 * @param centerId
-	 * @param workId
-	 * @param employeeName
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listUserIndentityByWorkId(String centerId, String workId, String processIdentity,
-			List<String> statuses) throws Exception {
-		if (centerId == null || centerId.isEmpty()) {
-			logger.warn("centerId is null!");
-			return null;
-		}
-		if (workId == null || workId.isEmpty()) {
-			logger.warn("workId is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.employeeIdentity));
-		Predicate p = cb.isNotNull(root.get(OkrWorkPerson_.employeeIdentity));
-		if (centerId != null && !centerId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), centerId));
-		}
-		if (workId != null && !workId.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workId), workId));
-		}
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,获取工作干系人信息ID列表
-	 * 
-	 * @param workId
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据工作信息ID,获取工作干系人信息ID列表" )
-	public List<String> listByWorkId(String workId, List<String> statuses) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.workId), workId);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		cq.select(root.get(OkrWorkPerson_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,和处理身份, 获取工作干系人信息ID列表
-	 * 
-	 * @param workId
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据工作信息ID,和处理身份, 获取工作干系人信息ID列表" )
-	public List<String> listByWorkIdAndProcessIdentity(String workId, String processIdentity, List<String> statuses)
-			throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.workId), workId);
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		cq.select(root.get(OkrWorkPerson_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,获取工作干系人信息ID列表
-	 * 
-	 * @param workId
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据工作信息ID,用户身份,获取工作干系人信息ID列表" )
-	public List<String> listByWorkIdAndUserIdentity(String workId, String userIdentity, List<String> statuses)
-			throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.workId), workId);
-		if (userIdentity != null && !userIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), userIdentity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		cq.select(root.get(OkrWorkPerson_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	// @MethodDescribe( "查询中心工作ID和处理人查询与其有关的所有工作ID" )
-	public List<String> listByCenterAndPerson(String centerId, String userIdentity, String processIdentity,
-			List<String> statuses) throws Exception {
-		if (centerId == null || centerId.isEmpty()) {
-			throw new Exception("center is null");
-		}
-		if (userIdentity == null || userIdentity.isEmpty()) {
-			throw new Exception("userIdentity is null");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.centerId), centerId);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), userIdentity));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		cq.select(root.get(OkrWorkPerson_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,获取该中心工作信息(不包括下级工作信息)所有的干系人信息
-	 * 
-	 * @param centerId
-	 *            中心工作ID
-	 * @param processIdentity
-	 *            干系人身份,可以为空
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据中心工作ID,获取该中心工作信息(不包括下级工作信息)所有的干系人信息" )
-	public List<String> listIdsForCenterWorkByCenterId(String centerId, String employeeIdentity, String processIdentity,
-			List<String> statuses) throws Exception {
-		if (centerId == null || centerId.isEmpty()) {
-			throw new Exception("center is null");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.centerId), centerId);
-		p = cb.and(p, cb.or(cb.isNull(root.get(OkrWorkPerson_.workId)), cb.equal(root.get(OkrWorkPerson_.workId), "")));
-		if (employeeIdentity != null && !employeeIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), employeeIdentity));
-		}
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		cq.select(root.get(OkrWorkPerson_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,获取该中心工作信息(不包括下级工作信息)所有的干系人身份
-	 * 
-	 * @param centerId
-	 *            中心工作ID
-	 * @param processIdentity
-	 *            干系人身份,可以为空
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据中心工作ID,获取该中心工作信息(不包括下级工作信息)所有的干系人信息" )
-	public List<String> listUserIdentityForCenterWork(String centerId, String processIdentity, List<String> statuses)
-			throws Exception {
-		if (centerId == null || centerId.isEmpty()) {
-			throw new Exception("center is null");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.centerId), centerId);
-		p = cb.and(p, cb.or(cb.isNull(root.get(OkrWorkPerson_.workId)), cb.equal(root.get(OkrWorkPerson_.workId), "")));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		cq.select(root.get(OkrWorkPerson_.employeeIdentity));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * 
-	 * @param centerId
-	 *            中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	// @MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId, List<String> statuses) throws Exception {
-		if (centerId == null || centerId.isEmpty()) {
-			throw new Exception(" centerId is null!");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.centerId), centerId);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		cq.select(root.get(OkrWorkPerson_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkPerson> listNextWithFilter(String id, Integer count, Object sequence,
-			WorkCommonSearchFilter wrapIn) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		String order = wrapIn.getOrder(); // 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-		sql_stringBuffer.append("SELECT o FROM " + OkrWorkPerson.class.getCanonicalName() + " o where 1=1");
-		if ((null != sequence)) {
-			sql_stringBuffer.append(" and o." + wrapIn.getSequenceField() + " "
-					+ (StringUtils.equalsIgnoreCase(order, "DESC") ? "<" : ">") + (" ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		// 对象类别,是中心工作,还是普通工作,如果是中心工作,那么普通的工作ID应该是为空的
-		if (null != wrapIn.getInfoType() && "CENTERWORK".equals(wrapIn.getInfoType())) {
-			sql_stringBuffer.append(" and o.recordType = '中心工作' ");
-			if (null != wrapIn.getWorkTitle() && !wrapIn.getWorkTitle().isEmpty()) {
-				sql_stringBuffer.append(" and o.centerTitle like  ?" + (index));
-				vs.add("%" + wrapIn.getWorkTitle() + "%");
-				index++;
-			}
-		} else {
-			sql_stringBuffer.append(" and o.recordType = '具体工作' ");
-			if (null != wrapIn.getWorkTitle() && !wrapIn.getWorkTitle().isEmpty()) {
-				sql_stringBuffer.append(" and o.workTitle like  ?" + (index));
-				vs.add("%" + wrapIn.getWorkTitle() + "%");
-				index++;
-			}
-		}
-		// 干系人姓名列表
-		if ((null != wrapIn.getEmployeeNames()) && wrapIn.getEmployeeNames().size() > 0) {
-			sql_stringBuffer.append(" and o.employeeName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getEmployeeNames());
-			index++;
-		}
-		// 干系人姓名列表
-		if ((null != wrapIn.getEmployeeIdentities()) && wrapIn.getEmployeeIdentities().size() > 0) {
-			sql_stringBuffer.append(" and o.employeeIdentity in ( ?" + (index) + " )");
-			vs.add(wrapIn.getEmployeeIdentities());
-			index++;
-		}
-		// 处理身份
-		if (null != wrapIn.getProcessIdentities() && wrapIn.getProcessIdentities().size() > 0) {
-			sql_stringBuffer.append(" and o.processIdentity in ( ?" + (index) + " )");
-			vs.add(wrapIn.getProcessIdentities());
-			index++;
-		}
-		// 干系人所属组织名称列表
-		if (null != wrapIn.getUnitNames() && wrapIn.getUnitNames().size() > 0) {
-			sql_stringBuffer.append(" and o.unitName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getUnitNames());
-			index++;
-		}
-		// 干系人所属顶层组织名称列表
-		if ((null != wrapIn.getTopUnitNames()) && wrapIn.getTopUnitNames().size() > 0) {
-			sql_stringBuffer.append(" and o.topUnitName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getTopUnitNames());
-			index++;
-		}
-		// 工作类别
-		if (null != wrapIn.getWorkTypes() && wrapIn.getWorkTypes().size() > 0) {
-			sql_stringBuffer.append(" and o.workType in ( ?" + (index) + " )");
-			vs.add(wrapIn.getWorkTypes());
-			index++;
-		}
-		// 部署年份
-		if (null != wrapIn.getDeployYear() && !wrapIn.getDeployYear().isEmpty()) {
-			sql_stringBuffer.append(" and o.deployYear = ?" + (index));
-			vs.add(wrapIn.getDeployYear());
-			index++;
-		}
-		// 部署月份
-		if (null != wrapIn.getDeployMonth() && !wrapIn.getDeployMonth().isEmpty()) {
-			sql_stringBuffer.append(" and o.deployMonth = ?" + (index));
-			vs.add(wrapIn.getDeployMonth());
-			index++;
-		}
-		// 工作时长类型:短期工作|长期工作
-		if (null != wrapIn.getWorkDateTimeType() && wrapIn.getWorkDateTimeType().isEmpty()) {
-			sql_stringBuffer.append(" and o.workDateTimeType = ?" + (index));
-			vs.add(wrapIn.getWorkDateTimeType());
-			index++;
-		}
-		// 工作处理状态
-		if (null != wrapIn.getWorkProcessStatuses() && wrapIn.getWorkProcessStatuses().size() > 0) {
-			sql_stringBuffer.append(" and o.workProcessStatus in ( ?" + (index) + " )");
-			vs.add(wrapIn.getWorkProcessStatuses());
-			index++;
-		}
-		if (null != wrapIn.getInfoStatuses() && wrapIn.getInfoStatuses().size() > 0) {
-			sql_stringBuffer.append(" and o.status in ( ?" + (index) + " )");
-			vs.add(wrapIn.getInfoStatuses());
-			index++;
-		}
-		sql_stringBuffer.append(" order by o." + wrapIn.getSequenceField() + " "
-				+ (StringUtils.equalsIgnoreCase(order, "DESC") ? "DESC" : "ASC"));
-
-		Query query = em.createQuery(sql_stringBuffer.toString(), OkrWorkPerson.class);
-		// 为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults(count).getResultList();
-	}
-
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkPerson> listPrevWithFilter(String id, Integer count, Object sequence,
-			WorkCommonSearchFilter wrapIn) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		String order = wrapIn.getOrder(); // 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-		sql_stringBuffer.append("SELECT o FROM " + OkrWorkPerson.class.getCanonicalName() + " o where 1=1");
-		if ((null != sequence)) {
-			sql_stringBuffer.append(" and o." + wrapIn.getSequenceField() + " "
-					+ (StringUtils.equalsIgnoreCase(order, "DESC") ? ">" : "<") + (" ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		// 对象类别,是中心工作,还是普通工作,如果是中心工作,那么普通的工作ID应该是为空的
-		if (null != wrapIn.getInfoType() && "CENTERWORK".equals(wrapIn.getInfoType())) {
-			sql_stringBuffer.append(" and o.recordType = '中心工作' ");
-			if (null != wrapIn.getWorkTitle() && !wrapIn.getWorkTitle().isEmpty()) {
-				sql_stringBuffer.append(" and o.centerTitle like  ?" + (index));
-				vs.add("%" + wrapIn.getWorkTitle() + "%");
-				index++;
-			}
-		} else {
-			sql_stringBuffer.append(" and o.recordType = '具体工作' ");
-			if (null != wrapIn.getWorkTitle() && !wrapIn.getWorkTitle().isEmpty()) {
-				sql_stringBuffer.append(" and o.workTitle like  ?" + (index));
-				vs.add("%" + wrapIn.getWorkTitle() + "%");
-				index++;
-			}
-		}
-		// 干系人姓名列表
-		if ((null != wrapIn.getEmployeeNames()) && wrapIn.getEmployeeNames().size() > 0) {
-			sql_stringBuffer.append(" and o.employeeName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getEmployeeNames());
-			index++;
-		}
-		// 干系人姓名列表
-		if ((null != wrapIn.getEmployeeIdentities()) && wrapIn.getEmployeeIdentities().size() > 0) {
-			sql_stringBuffer.append(" and o.employeeIdentity in ( ?" + (index) + " )");
-			vs.add(wrapIn.getEmployeeIdentities());
-			index++;
-		}
-		// 处理身份
-		if (null != wrapIn.getProcessIdentities() && wrapIn.getProcessIdentities().size() > 0) {
-			sql_stringBuffer.append(" and o.processIdentity in ( ?" + (index) + " )");
-			vs.add(wrapIn.getProcessIdentities());
-			index++;
-		}
-		// 干系人所属组织名称列表
-		if (null != wrapIn.getUnitNames() && wrapIn.getUnitNames().size() > 0) {
-			sql_stringBuffer.append(" and o.unitName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getUnitNames());
-			index++;
-		}
-		// 干系人所属顶层组织名称列表
-		if ((null != wrapIn.getTopUnitNames()) && wrapIn.getTopUnitNames().size() > 0) {
-			sql_stringBuffer.append(" and o.topUnitName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getTopUnitNames());
-			index++;
-		}
-		// 工作类别
-		if (null != wrapIn.getWorkTypes() && wrapIn.getWorkTypes().size() > 0) {
-			sql_stringBuffer.append(" and o.workType in ( ?" + (index) + " )");
-			vs.add(wrapIn.getWorkTypes());
-			index++;
-		}
-		// 部署年份
-		if (null != wrapIn.getDeployYear() && !wrapIn.getDeployYear().isEmpty()) {
-			sql_stringBuffer.append(" and o.deployYear = ?" + (index));
-			vs.add(wrapIn.getDeployYear());
-			index++;
-		}
-		// 部署月份
-		if (null != wrapIn.getDeployMonth() && !wrapIn.getDeployMonth().isEmpty()) {
-			sql_stringBuffer.append(" and o.deployMonth = ?" + (index));
-			vs.add(wrapIn.getDeployMonth());
-			index++;
-		}
-		// 工作时长类型:短期工作|长期工作
-		if (null != wrapIn.getWorkDateTimeType() && wrapIn.getWorkDateTimeType().isEmpty()) {
-			sql_stringBuffer.append(" and o.workDateTimeType = ?" + (index));
-			vs.add(wrapIn.getWorkDateTimeType());
-			index++;
-		}
-		// 工作处理状态
-		if (null != wrapIn.getWorkProcessStatuses() && wrapIn.getWorkProcessStatuses().size() > 0) {
-			sql_stringBuffer.append(" and o.workProcessStatus in ( ?" + (index) + " )");
-			vs.add(wrapIn.getWorkProcessStatuses());
-			index++;
-		}
-		if (null != wrapIn.getInfoStatuses() && wrapIn.getInfoStatuses().size() > 0) {
-			sql_stringBuffer.append(" and o.status in ( ?" + (index) + " )");
-			vs.add(wrapIn.getInfoStatuses());
-			index++;
-		}
-		sql_stringBuffer.append(" order by o." + wrapIn.getSequenceField() + " "
-				+ (StringUtils.equalsIgnoreCase(order, "DESC") ? "DESC" : "ASC"));
-		Query query = em.createQuery(sql_stringBuffer.toString(), OkrWorkPerson.class);
-		// 为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults(count).getResultList();
-	}
-
-	/**
-	 * 查询符合的信息总数
-	 * 
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountWithFilter(WorkCommonSearchFilter wrapIn) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-
-		sql_stringBuffer.append("SELECT count(o.id) FROM " + OkrWorkPerson.class.getCanonicalName() + " o where 1=1");
-
-		// 对象类别,是中心工作,还是普通工作,如果是中心工作,那么普通的工作ID应该是为空的
-		if (null != wrapIn.getInfoType() && "CENTERWORK".equals(wrapIn.getInfoType())) {
-			sql_stringBuffer.append(" and o.recordType = '中心工作' ");
-			if (null != wrapIn.getWorkTitle() && !wrapIn.getWorkTitle().isEmpty()) {
-				sql_stringBuffer.append(" and o.centerTitle like  ?" + (index));
-				vs.add("%" + wrapIn.getWorkTitle() + "%");
-				index++;
-			}
-		} else {
-			sql_stringBuffer.append(" and o.recordType = '具体工作' ");
-			if (null != wrapIn.getWorkTitle() && !wrapIn.getWorkTitle().isEmpty()) {
-				sql_stringBuffer.append(" and o.workTitle like  ?" + (index));
-				vs.add("%" + wrapIn.getWorkTitle() + "%");
-				index++;
-			}
-		}
-		// 干系人姓名列表
-		if ((null != wrapIn.getEmployeeNames()) && wrapIn.getEmployeeNames().size() > 0) {
-			sql_stringBuffer.append(" and o.employeeName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getEmployeeNames());
-			index++;
-		}
-		// 干系人姓名列表
-		if ((null != wrapIn.getEmployeeIdentities()) && wrapIn.getEmployeeIdentities().size() > 0) {
-			sql_stringBuffer.append(" and o.employeeIdentity in ( ?" + (index) + " )");
-			vs.add(wrapIn.getEmployeeIdentities());
-			index++;
-		}
-		// 处理身份
-		if (null != wrapIn.getProcessIdentities() && wrapIn.getProcessIdentities().size() > 0) {
-			sql_stringBuffer.append(" and o.processIdentity in ( ?" + (index) + " )");
-			vs.add(wrapIn.getProcessIdentities());
-			index++;
-		}
-		// 干系人所属组织名称列表
-		if (null != wrapIn.getUnitNames() && wrapIn.getUnitNames().size() > 0) {
-			sql_stringBuffer.append(" and o.unitName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getUnitNames());
-			index++;
-		}
-		// 干系人所属顶层组织名称列表
-		if ((null != wrapIn.getTopUnitNames()) && wrapIn.getTopUnitNames().size() > 0) {
-			sql_stringBuffer.append(" and o.topUnitName in ( ?" + (index) + " )");
-			vs.add(wrapIn.getTopUnitNames());
-			index++;
-		}
-		// 工作类别
-		if (null != wrapIn.getWorkTypes() && wrapIn.getWorkTypes().size() > 0) {
-			sql_stringBuffer.append(" and o.workType in ( ?" + (index) + " )");
-			vs.add(wrapIn.getWorkTypes());
-			index++;
-		}
-		// 部署年份
-		if (null != wrapIn.getDeployYear() && !wrapIn.getDeployYear().isEmpty()) {
-			sql_stringBuffer.append(" and o.deployYear = ?" + (index));
-			vs.add(wrapIn.getDeployYear());
-			index++;
-		}
-		// 部署月份
-		if (null != wrapIn.getDeployMonth() && !wrapIn.getDeployMonth().isEmpty()) {
-			sql_stringBuffer.append(" and o.deployMonth = ?" + (index));
-			vs.add(wrapIn.getDeployMonth());
-			index++;
-		}
-		// 工作时长类型:短期工作|长期工作
-		if (null != wrapIn.getWorkDateTimeType() && wrapIn.getWorkDateTimeType().isEmpty()) {
-			sql_stringBuffer.append(" and o.workDateTimeType = ?" + (index));
-			vs.add(wrapIn.getWorkDateTimeType());
-			index++;
-		}
-		// 工作处理状态
-		if (null != wrapIn.getWorkProcessStatuses() && wrapIn.getWorkProcessStatuses().size() > 0) {
-			sql_stringBuffer.append(" and o.workProcessStatus in ( ?" + (index) + " )");
-			vs.add(wrapIn.getWorkProcessStatuses());
-			index++;
-		}
-		if (null != wrapIn.getInfoStatuses() && wrapIn.getInfoStatuses().size() > 0) {
-			sql_stringBuffer.append(" and o.status in ( ?" + (index) + " )");
-			vs.add(wrapIn.getInfoStatuses());
-			index++;
-		}
-		Query query = em.createQuery(sql_stringBuffer.toString(), OkrWorkPerson.class);
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return (Long) query.getSingleResult();
-	}
-
-	public List<String> listDistinctIdentity() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.employeeIdentity));
-		return em.createQuery(cq).setMaxResults(10000).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据工作类别和登录身份来查询用户可以访问到的所有中心工作数量
-	 * @param workTypeNames
-	 * @param loginIdentity
-	 * @param processIdentity
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listCenterWorkIdsByWorkType(List<String> workTypeNames, String loginIdentity,
-			String processIdentity) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.isNotNull(root.get(OkrWorkPerson_.id));
-		if (workTypeNames != null && !workTypeNames.isEmpty()) {
-			p = cb.and(p, root.get(OkrWorkPerson_.workType).in(workTypeNames));
-		}
-		if (loginIdentity != null && !loginIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), loginIdentity));
-		}
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		cq.select(root.get(OkrWorkPerson_.centerId));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	public List<String> listByAuthorizeRecordIds(List<String> authorizeRecordIds, List<String> statuses)
-			throws Exception {
-		if (authorizeRecordIds == null || authorizeRecordIds.isEmpty()) {
-			logger.warn("authorizeRecordIds is null!");
-			return null;
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		cq.select(root.get(OkrWorkPerson_.id));
-
-		Predicate p = root.get(OkrWorkPerson_.authorizeRecordId).in(authorizeRecordIds);
-		if (statuses != null && statuses.size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(statuses));
-		}
-		return em.createQuery(cq.where(p)).setMaxResults(1000).getResultList();
-	}
-
-	public Long getProcessingWorkCountByCenterId(String identity, List<String> status, String processIdentity)
-			throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			throw new Exception("identity is null.");
-		}
-		if (status == null || status.isEmpty()) {
-			throw new Exception("status is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = root.get(OkrWorkPerson_.status).in(status);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workProcessStatus), "执行中"));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		// 查询总数
-		cq.select(cb.count(root));
-		// logger.info( ">>>>getProcessingWorkCountByCenterId-SQL:" +
-		// em.createQuery(cq.where(p)).toString() );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getWorkTotalByCenterId(String identity, List<String> status, String processIdentity) throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			throw new Exception("identity is null.");
-		}
-		if (status == null || status.isEmpty()) {
-			throw new Exception("status is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = root.get(OkrWorkPerson_.status).in(status);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		// 查询总数
-		cq.select(cb.count(root));
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getCompletedWorkCountByCenterId(String identity, List<String> status, String processIdentity)
-			throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			throw new Exception("identity is null.");
-		}
-		if (status == null || status.isEmpty()) {
-			throw new Exception("status is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = root.get(OkrWorkPerson_.status).in(status);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workProcessStatus), "已完成"));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		// 查询总数
-		cq.select(cb.count(root));
-		// logger.info( ">>>>getCompletedWorkCountByCenterId-SQL:" +
-		// em.createQuery(cq.where(p)).toString() );
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getOvertimeWorkCountByCenterId(String identity, List<String> status, String processIdentity)
-			throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			throw new Exception("identity is null.");
-		}
-		if (status == null || status.isEmpty()) {
-			throw new Exception("status is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = root.get(OkrWorkPerson_.status).in(status);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-		p = cb.and(p, cb.isTrue(root.get(OkrWorkPerson_.isOverTime)));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		// 查询总数
-		cq.select(cb.count(root));
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getOvertimenessWorkCountByCenterId(String identity, List<String> status, String processIdentity)
-			throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			throw new Exception("identity is null.");
-		}
-		if (status == null || status.isEmpty()) {
-			throw new Exception("status is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = root.get(OkrWorkPerson_.status).in(status);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-		p = cb.and(p, cb.isFalse(root.get(OkrWorkPerson_.isOverTime)));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		// 查询总数
-		cq.select(cb.count(root));
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public Long getDraftWorkCountByCenterId(String identity, List<String> status, String processIdentity)
-			throws Exception {
-		if (identity == null || identity.isEmpty()) {
-			throw new Exception("identity is null.");
-		}
-		if (status == null || status.isEmpty()) {
-			throw new Exception("status is null.");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = root.get(OkrWorkPerson_.status).in(status);
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workProcessStatus), "草稿"));
-		if (processIdentity != null && !processIdentity.isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.processIdentity), processIdentity));
-		}
-		// 查询总数
-		cq.select(cb.count(root));
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	public List<OkrWorkPerson> listCenterWorkPerson(String id, WorkCommonSearchFilter wrapIn) throws Exception {
-		if (id == null || id.isEmpty()) {
-			throw new Exception("id is null!");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkPerson> cq = cb.createQuery(OkrWorkPerson.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.recordType), "中心工作");
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.centerId), id));
-		// 干系人姓名列表
-		if (null != wrapIn.getEmployeeNames() && wrapIn.getEmployeeNames().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.employeeName).in(wrapIn.getEmployeeNames()));
-		}
-		// 干系人姓名列表
-		if (null != wrapIn.getEmployeeIdentities() && wrapIn.getEmployeeIdentities().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.employeeIdentity).in(wrapIn.getEmployeeIdentities()));
-		}
-		// 处理身份
-		if (null != wrapIn.getProcessIdentities() && wrapIn.getProcessIdentities().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.processIdentity).in(wrapIn.getProcessIdentities()));
-		}
-		// 干系人所属组织名称列表
-		if (null != wrapIn.getUnitNames() && wrapIn.getUnitNames().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.unitName).in(wrapIn.getUnitNames()));
-		}
-		// 干系人所属顶层组织名称列表
-		if (null != wrapIn.getTopUnitNames() && wrapIn.getTopUnitNames().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.topUnitName).in(wrapIn.getTopUnitNames()));
-		}
-		// 工作类别
-		if (null != wrapIn.getWorkTypes() && wrapIn.getWorkTypes().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.workType).in(wrapIn.getWorkTypes()));
-		}
-		// 工作时长类型:短期工作|长期工作
-		if (null != wrapIn.getWorkDateTimeType() && wrapIn.getWorkDateTimeType().isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workDateTimeType), wrapIn.getWorkDateTimeType()));
-		}
-		// 工作处理状态
-		if (null != wrapIn.getWorkProcessStatuses() && wrapIn.getWorkProcessStatuses().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.workProcessStatus).in(wrapIn.getWorkProcessStatuses()));
-		}
-		if (null != wrapIn.getInfoStatuses() && wrapIn.getInfoStatuses().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(wrapIn.getInfoStatuses()));
-		}
-		// 部署年份
-		if (null != wrapIn.getDeployYear() && !wrapIn.getDeployYear().isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.deployYear), wrapIn.getDeployYear()));
-		}
-		// 部署月份
-		if (null != wrapIn.getDeployMonth() && !wrapIn.getDeployMonth().isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.deployMonth), wrapIn.getDeployMonth()));
-		}
-
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<OkrWorkPerson> listDetailWorkPerson(String id, WorkCommonSearchFilter wrapIn) throws Exception {
-		if (id == null || id.isEmpty()) {
-			throw new Exception("id is null!");
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkPerson> cq = cb.createQuery(OkrWorkPerson.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal(root.get(OkrWorkPerson_.recordType), "具体工作");
-		p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workId), id));
-		// 干系人姓名列表
-		if (null != wrapIn.getEmployeeNames() && wrapIn.getEmployeeNames().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.employeeName).in(wrapIn.getEmployeeNames()));
-		}
-		// 干系人姓名列表
-		if (null != wrapIn.getEmployeeIdentities() && wrapIn.getEmployeeIdentities().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.employeeIdentity).in(wrapIn.getEmployeeIdentities()));
-		}
-		// 处理身份
-		if (null != wrapIn.getProcessIdentities() && wrapIn.getProcessIdentities().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.processIdentity).in(wrapIn.getProcessIdentities()));
-		}
-		// 干系人所属组织名称列表
-		if (null != wrapIn.getUnitNames() && wrapIn.getUnitNames().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.unitName).in(wrapIn.getUnitNames()));
-		}
-		// 干系人所属顶层组织名称列表
-		if (null != wrapIn.getTopUnitNames() && wrapIn.getTopUnitNames().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.topUnitName).in(wrapIn.getTopUnitNames()));
-		}
-		// 工作类别
-		if (null != wrapIn.getWorkTypes() && wrapIn.getWorkTypes().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.workType).in(wrapIn.getWorkTypes()));
-		}
-		// 工作时长类型:短期工作|长期工作
-		if (null != wrapIn.getWorkDateTimeType() && wrapIn.getWorkDateTimeType().isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.workDateTimeType), wrapIn.getWorkDateTimeType()));
-		}
-		// 工作处理状态
-		if (null != wrapIn.getWorkProcessStatuses() && wrapIn.getWorkProcessStatuses().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.workProcessStatus).in(wrapIn.getWorkProcessStatuses()));
-		}
-		if (null != wrapIn.getInfoStatuses() && wrapIn.getInfoStatuses().size() > 0) {
-			p = cb.and(p, root.get(OkrWorkPerson_.status).in(wrapIn.getInfoStatuses()));
-		}
-		// 部署年份
-		if (null != wrapIn.getDeployYear() && !wrapIn.getDeployYear().isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.deployYear), wrapIn.getDeployYear()));
-		}
-		// 部署月份
-		if (null != wrapIn.getDeployMonth() && !wrapIn.getDeployMonth().isEmpty()) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.deployMonth), wrapIn.getDeployMonth()));
-		}
-
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 查询工作干系人身份列表(去重复)
-	 * 
-	 * @param identities_ok
-	 *            排除身份
-	 * @param identities_error
-	 *            排除身份
-	 * @return
-	 * @throws Exception
-	 */
-	public List<String> listAllDistinctEmployeeIdentity(List<String> identities_ok, List<String> identities_error)
-			throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-
-		Predicate p = cb.isNotNull(root.get(OkrWorkPerson_.id));
-		if (identities_ok != null && identities_ok.size() > 0) {
-			p = cb.and(p, cb.not(root.get(OkrWorkPerson_.employeeIdentity).in(identities_ok)));
-		}
-		if (identities_error != null && identities_error.size() > 0) {
-			p = cb.and(p, cb.not(root.get(OkrWorkPerson_.employeeIdentity).in(identities_error)));
-		}
-		cq.select(root.get(OkrWorkPerson_.employeeIdentity));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据身份名称,从工作干系人信息中查询与该身份有关的所有信息列表
-	 * 
-	 * @param identity
-	 * @param recordId
-	 * @return
-	 * @throws Exception
-	 */
-	public List<OkrWorkPerson> listErrorIdentitiesInWorkPerson(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkPerson> cq = cb.createQuery(OkrWorkPerson.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.isNotNull(root.get(OkrWorkPerson_.id));
-
-		if (recordId != null && !recordId.isEmpty() && !"all".equals(recordId)) {
-			p = cb.and(p, cb.equal(root.get(OkrWorkPerson_.id), recordId));
-		}
-
-		Predicate p_employeeIdentity = cb.isNotNull(root.get(OkrWorkPerson_.employeeIdentity));
-		p_employeeIdentity = cb.and(p_employeeIdentity, cb.equal(root.get(OkrWorkPerson_.employeeIdentity), identity));
-
-		p = cb.and(p, p_employeeIdentity);
-
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listAllDistinctIdentityWithWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkPerson.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkPerson> root = cq.from(OkrWorkPerson.class);
-		Predicate p = cb.equal( root.get(OkrWorkPerson_.workId), workId);
-		cq.select(root.get(OkrWorkPerson_.employeeIdentity));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-}

+ 0 - 211
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkPersonSearchFactory.java

@@ -1,211 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrWorkPerson;
-
-public class OkrWorkPersonSearchFactory extends AbstractFactory {
-
-	public OkrWorkPersonSearchFactory(Business business) throws Exception {
-		super(business);
-	}
-
-	/**
-	 * 根据条件搜索中心工作ID
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.WrapInFilter wrapIn
-	 * @return
-	 * @throws Exception 
-	 */
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkPerson> listCenterWorkPersonNextWithFilter(String id, Integer count, Object sequence,
-			com.x.okr.assemble.control.jaxrs.WorkCommonQueryFilter wrapIn) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkPerson.class );
-		String order = wrapIn.getOrder();// 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-
-		Integer index = 1;
-		sql_stringBuffer.append("SELECT o FROM " + OkrWorkPerson.class.getCanonicalName() + " o where o.workId is null and o.processIdentity = '观察者' ");
-
-		if ((null != sequence)) {
-			sql_stringBuffer.append(" and o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC") ? "<" : ">") + (" ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		
-		//根据标题模糊查询
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty()) {
-			sql_stringBuffer.append(" and o.centerTitle like ?" + (index));
-			vs.add("%" + wrapIn.getTitle() + "%");
-			index++;
-		}
-		
-		//根据信息状态查询,比如:正常,已删除
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append(" and o.status in ( ?" + (index) + " )");
-			vs.add(wrapIn.getQ_statuses());
-			index++;
-		}
-		
-		//根据默认的工作类别查询
-		if (null != wrapIn.getDefaultWorkTypes() && wrapIn.getDefaultWorkTypes().size() > 0) {
-			sql_stringBuffer.append(" and o.workType in ( ?" + (index) + " )");
-			vs.add(wrapIn.getDefaultWorkTypes());
-			index++;
-		}
-		
-		//根据用户身份查询查询
-		if (null != wrapIn.getIdentity() && !wrapIn.getIdentity().isEmpty() ) {
-			sql_stringBuffer.append(" and o.employeeIdentity = ?" + (index) );
-			vs.add(wrapIn.getIdentity());
-			index++;
-		}
-		
-		sql_stringBuffer.append(" order by o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC") ? "DESC" : "ASC"));
-
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkPerson.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults(count).getResultList();
-	}
-	
-	/**
-	 * 根据条件搜索中心工作ID
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.WrapInFilter wrapIn
-	 * @return
-	 * @throws Exception 
-	 */
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkPerson> listCenterWorkPersonPrevWithFilter(String id, Integer count, Object sequence,
-			com.x.okr.assemble.control.jaxrs.WorkCommonQueryFilter wrapIn) throws Exception {
-		// 先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkPerson.class );
-		String order = wrapIn.getOrder();// 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-
-		Integer index = 1;
-		sql_stringBuffer.append("SELECT o FROM " + OkrWorkPerson.class.getCanonicalName() + " o where o.workId is null and o.processIdentity = '观察者' ");
-
-		if ((null != sequence)) {
-			sql_stringBuffer.append(" and o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC") ? ">" : "<") + (" ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		
-		//根据标题模糊查询
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty()) {
-			sql_stringBuffer.append(" and o.centerTitle like ?" + (index));
-			vs.add("%" + wrapIn.getTitle() + "%");
-			index++;
-		}
-		
-		//根据信息状态查询,比如:正常,已删除
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append(" and o.status in ( ?" + (index) + " )");
-			vs.add(wrapIn.getQ_statuses());
-			index++;
-		}
-		
-		//根据默认的工作类别查询
-		if (null != wrapIn.getDefaultWorkTypes() && wrapIn.getDefaultWorkTypes().size() > 0) {
-			sql_stringBuffer.append(" and o.workType in ( ?" + (index) + " )");
-			vs.add(wrapIn.getDefaultWorkTypes());
-			index++;
-		}
-		
-		//根据用户身份查询查询
-		if (null != wrapIn.getIdentity() && !wrapIn.getIdentity().isEmpty() ) {
-			sql_stringBuffer.append(" and o.employeeIdentity = ?" + (index) );
-			vs.add(wrapIn.getIdentity());
-			index++;
-		}
-		
-		sql_stringBuffer.append(" order by o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC") ? "DESC" : "ASC"));
-
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkPerson.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults(count).getResultList();
-	}
-	
-	/**
-	 * 查询符合的中心工作信息总数
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.WrapInFilter wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountForCenterInfoWithFilter( com.x.okr.assemble.control.jaxrs.WorkCommonQueryFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkPerson.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		sql_stringBuffer.append( "SELECT count( o.id ) FROM "+OkrWorkPerson.class.getCanonicalName()+" o where o.workId is null and o.processIdentity = '观察者'  " );
-		
-		// 根据标题模糊查询
-		if (null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty()) {
-			sql_stringBuffer.append(" and o.centerTitle like ?" + (index));
-			vs.add("%" + wrapIn.getTitle() + "%");
-			index++;
-		}
-
-		// 根据信息状态查询,比如:正常,已删除
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append(" and o.status in ( ?" + (index) + " )");
-			vs.add(wrapIn.getQ_statuses());
-			index++;
-		}
-
-		// 根据默认的工作类别查询
-		if (null != wrapIn.getDefaultWorkTypes() && wrapIn.getDefaultWorkTypes().size() > 0) {
-			sql_stringBuffer.append(" and o.workType in ( ?" + (index) + " )");
-			vs.add(wrapIn.getDefaultWorkTypes());
-			index++;
-		}
-		
-		//根据用户身份查询查询
-		if (null != wrapIn.getIdentity() && !wrapIn.getIdentity().isEmpty()) {
-			sql_stringBuffer.append(" and o.employeeIdentity = ?" + (index));
-			vs.add(wrapIn.getIdentity());
-			index++;
-		}
-
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkPerson.class );
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return (Long) query.getSingleResult();
-	}
-}

+ 0 - 666
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportBaseInfoFactory.java

@@ -1,666 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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.entity.JpaObject;
-import com.x.base.core.project.exception.ExceptionWhen;
-import com.x.base.core.project.tools.ListTools;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.assemble.control.jaxrs.okrworkreportbaseinfo.WrapInFilter;
-import com.x.okr.entity.OkrWorkBaseInfo;
-import com.x.okr.entity.OkrWorkReportBaseInfo;
-import com.x.okr.entity.OkrWorkReportBaseInfo_;
-
-/**
- * 类   名:OkrWorkReportBaseInfoFactory<br/>
- * 实体类:OkrWorkReportBaseInfo<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:27
-**/
-public class OkrWorkReportBaseInfoFactory extends AbstractFactory {
-
-	public OkrWorkReportBaseInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrWorkReportBaseInfo实体信息对象" )
-	public OkrWorkReportBaseInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkReportBaseInfo.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrWorkReportBaseInfo实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from( OkrWorkReportBaseInfo.class);
-		cq.select(root.get(OkrWorkReportBaseInfo_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkReportBaseInfo实体信息列表" )
-	public List<OkrWorkReportBaseInfo> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkReportBaseInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery(OkrWorkReportBaseInfo.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		Predicate p = root.get(OkrWorkReportBaseInfo_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作ID,查询该工作的最大汇报次序
-	 * @param id
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作ID,查询该工作的最大汇报次序" )
-	public Integer getMaxReportCount( String workId ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();		
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery( OkrWorkReportBaseInfo.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from( OkrWorkReportBaseInfo.class);		
-		cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.reportCount) ) );	
-		
-		Predicate p = cb.equal( root.get( OkrWorkReportBaseInfo_.workId), workId);
-		
-		List<OkrWorkReportBaseInfo> resultList = em.createQuery(cq.where(p)).getResultList();
-		if( resultList == null || resultList.size() == 0 ){
-			return 0;
-		}else{
-			return resultList.get(0).getReportCount();
-		}
-	}
-
-	/**
-	 * 根据工作信息ID,获取汇报基础信息ID列表
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作信息ID,获取汇报基础信息ID列表" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from( OkrWorkReportBaseInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkReportBaseInfo_.workId), workId );
-		cq.select(root.get( OkrWorkReportBaseInfo_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportBaseInfo_.centerId ), centerId );
-		cq.select(root.get( OkrWorkReportBaseInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	public List<OkrWorkReportBaseInfo> listNextWithFilter(String id,  Integer count, Object sequence, WrapInFilter wrapIn) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportBaseInfo.class);
-		String sequenceField = wrapIn.getSequenceField();
-		String order = wrapIn.getOrder(); // 排序方式
-		if ( StringUtils.isEmpty( order ) ) {
-			order = "DESC";
-		}
-		if ( StringUtils.isEmpty( sequenceField ) ) {
-			sequenceField =  JpaObject.sequence_FIELDNAME;
-		}
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery(OkrWorkReportBaseInfo.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		Predicate p = cb.isNotNull( root.get( OkrWorkReportBaseInfo_.id ) );
-		if( sequence != null ) {
-			if( StringUtils.equalsIgnoreCase(order, "DESC" )) {
-				if( "createTime".equals( sequenceField )) {
-					p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.createTime ), (Date)sequence));
-				}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-					p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.sequence ), sequence.toString()));
-				}else if( "workTitle".equals( sequenceField )) {
-					p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.workTitle ), sequence.toString()));
-				}else if( "activityName".equals( sequenceField )) {
-					p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.activityName ), sequence.toString()));
-				}else if( "centerTitle".equals( sequenceField )) {
-					p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.centerTitle ), sequence.toString()));
-				}else if( "workType".equals( sequenceField )) {
-					p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.workType ), sequence.toString()));
-				}
-			}else {
-				if( "createTime".equals( sequenceField )) {
-					p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.createTime ), (Date)sequence));
-				}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-					p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.sequence ), sequence.toString()));
-				}else if( "workTitle".equals( sequenceField )) {
-					p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.workTitle ), sequence.toString()));
-				}else if( "activityName".equals( sequenceField )) {
-					p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.activityName ), sequence.toString()));
-				}else if( "centerTitle".equals( sequenceField )) {
-					p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.centerTitle ), sequence.toString()));
-				}else if( "workType".equals( sequenceField )) {
-					p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.workType ), sequence.toString()));
-				}
-			}
-		}
-		
-		if( StringUtils.isNotEmpty( wrapIn.getTitle() )) {
-			p = cb.and( p, cb.like(root.get( OkrWorkReportBaseInfo_.centerTitle ), wrapIn.getTitle()));
-		}
-		//当前处理人身份
-		if( StringUtils.isNotEmpty( wrapIn.getProcessIdentity() )) {
-			p = cb.and( p, cb.isMember(wrapIn.getProcessIdentity(), root.get( OkrWorkReportBaseInfo_.currentProcessorIdentityList )));
-		}		
-		//工作处理状态
-		if( ListTools.isNotEmpty( wrapIn.getProcessStatusList() )) {
-			p = cb.and( p,  root.get( OkrWorkReportBaseInfo_.processStatus).in( wrapIn.getProcessStatusList() ));
-		}
-
-		if( ListTools.isNotEmpty( wrapIn.getQ_statuses() )) {
-			p = cb.and( p,  root.get( OkrWorkReportBaseInfo_.status).in( wrapIn.getQ_statuses() ));
-		}
-		
-		if(StringUtils.equalsIgnoreCase(order, "DESC" )) {
-			if( "createTime".equals( sequenceField )) {
-				cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.createTime) ) );	
-			}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-				cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.sequence) ) );	
-			}else if( "workTitle".equals( sequenceField )) {
-				cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.workTitle) ) );	
-			}else if( "activityName".equals( sequenceField )) {
-				cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.activityName) ) );	
-			}else if( "centerTitle".equals( sequenceField )) {
-				cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.centerTitle) ) );	
-			}else if( "workType".equals( sequenceField )) {
-				cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.workType) ) );	
-			}
-		}else {
-			if( "createTime".equals( sequenceField )) {
-				cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.createTime) ) );	
-			}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-				cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.sequence) ) );	
-			}else if( "workTitle".equals( sequenceField )) {
-				cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.workTitle) ) );	
-			}else if( "activityName".equals( sequenceField )) {
-				cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.activityName) ) );	
-			}else if( "centerTitle".equals( sequenceField )) {
-				cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.centerTitle) ) );	
-			}else if( "workType".equals( sequenceField )) {
-				cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.workType) ) );	
-			}
-		}
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	public List<OkrWorkReportBaseInfo> listPrevWithFilter( String id, Integer count, Object sequence, WrapInFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-				EntityManager em = this.entityManagerContainer().get( OkrWorkReportBaseInfo.class);
-				String sequenceField = wrapIn.getSequenceField();
-				String order = wrapIn.getOrder(); // 排序方式
-				if ( StringUtils.isEmpty( order ) ) {
-					order = "DESC";
-				}
-				if ( StringUtils.isEmpty( sequenceField ) ) {
-					sequenceField =  JpaObject.sequence_FIELDNAME;
-				}
-				CriteriaBuilder cb = em.getCriteriaBuilder();
-				CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery(OkrWorkReportBaseInfo.class);
-				Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-				Predicate p = cb.isNotNull( root.get( OkrWorkReportBaseInfo_.id ) );
-				if( sequence != null ) {
-					if( StringUtils.equalsIgnoreCase(order, "DESC" )) {
-						if( "createTime".equals( sequenceField )) {
-							p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.createTime ), (Date)sequence));
-						}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-							p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.sequence ), sequence.toString()));
-						}else if( "workTitle".equals( sequenceField )) {
-							p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.workTitle ), sequence.toString()));
-						}else if( "activityName".equals( sequenceField )) {
-							p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.activityName ), sequence.toString()));
-						}else if( "centerTitle".equals( sequenceField )) {
-							p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.centerTitle ), sequence.toString()));
-						}else if( "workType".equals( sequenceField )) {
-							p = cb.and( p, cb.greaterThan(root.get( OkrWorkReportBaseInfo_.workType ), sequence.toString()));
-						}
-					}else {
-						if( "createTime".equals( sequenceField )) {
-							p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.createTime ), (Date)sequence));
-						}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-							p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.sequence ), sequence.toString()));
-						}else if( "workTitle".equals( sequenceField )) {
-							p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.workTitle ), sequence.toString()));
-						}else if( "activityName".equals( sequenceField )) {
-							p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.activityName ), sequence.toString()));
-						}else if( "centerTitle".equals( sequenceField )) {
-							p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.centerTitle ), sequence.toString()));
-						}else if( "workType".equals( sequenceField )) {
-							p = cb.and( p, cb.lessThan(root.get( OkrWorkReportBaseInfo_.workType ), sequence.toString()));
-						}
-					}
-				}
-				
-				if( StringUtils.isNotEmpty( wrapIn.getTitle() )) {
-					p = cb.and( p, cb.like(root.get( OkrWorkReportBaseInfo_.centerTitle ), wrapIn.getTitle()));
-				}
-				//当前处理人身份
-				if( StringUtils.isNotEmpty( wrapIn.getProcessIdentity() )) {
-					p = cb.and( p, cb.isMember(wrapIn.getProcessIdentity(), root.get( OkrWorkReportBaseInfo_.currentProcessorIdentityList )));
-				}		
-				//工作处理状态
-				if( ListTools.isNotEmpty( wrapIn.getProcessStatusList() )) {
-					p = cb.and( p,  root.get( OkrWorkReportBaseInfo_.processStatus).in( wrapIn.getProcessStatusList() ));
-				}
-
-				if( ListTools.isNotEmpty( wrapIn.getQ_statuses() )) {
-					p = cb.and( p,  root.get( OkrWorkReportBaseInfo_.status).in( wrapIn.getQ_statuses() ));
-				}
-				
-				if(StringUtils.equalsIgnoreCase(order, "DESC" )) {
-					if( "createTime".equals( sequenceField )) {
-						cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.createTime) ) );	
-					}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-						cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.sequence) ) );	
-					}else if( "workTitle".equals( sequenceField )) {
-						cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.workTitle) ) );	
-					}else if( "activityName".equals( sequenceField )) {
-						cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.activityName) ) );	
-					}else if( "centerTitle".equals( sequenceField )) {
-						cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.centerTitle) ) );	
-					}else if( "workType".equals( sequenceField )) {
-						cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.workType) ) );	
-					}
-				}else {
-					if( "createTime".equals( sequenceField )) {
-						cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.createTime) ) );	
-					}else if(  JpaObject.sequence_FIELDNAME.equals( sequenceField )) {
-						cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.sequence) ) );	
-					}else if( "workTitle".equals( sequenceField )) {
-						cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.workTitle) ) );	
-					}else if( "activityName".equals( sequenceField )) {
-						cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.activityName) ) );	
-					}else if( "centerTitle".equals( sequenceField )) {
-						cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.centerTitle) ) );	
-					}else if( "workType".equals( sequenceField )) {
-						cq.orderBy( cb.asc( root.get( OkrWorkReportBaseInfo_.workType) ) );	
-					}
-				}
-				return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 查询符合的信息总数
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public Long getCountWithFilter( WrapInFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportBaseInfo.class);
-		String sequenceField = wrapIn.getSequenceField();
-		String order = wrapIn.getOrder(); // 排序方式
-		if ( StringUtils.isEmpty( order ) ) {
-			order = "DESC";
-		}
-		if ( StringUtils.isEmpty( sequenceField ) ) {
-			sequenceField =  JpaObject.sequence_FIELDNAME;
-		}
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		Predicate p = cb.isNotNull( root.get( OkrWorkReportBaseInfo_.id ) );		
-		if( StringUtils.isNotEmpty( wrapIn.getTitle() )) {
-			p = cb.and( p, cb.like(root.get( OkrWorkReportBaseInfo_.centerTitle ), wrapIn.getTitle()));
-		}
-		//当前处理人身份
-		if( StringUtils.isNotEmpty( wrapIn.getProcessIdentity() )) {
-			p = cb.and( p, cb.isMember(wrapIn.getProcessIdentity(), root.get( OkrWorkReportBaseInfo_.currentProcessorIdentityList )));
-		}		
-		//工作处理状态
-		if( ListTools.isNotEmpty( wrapIn.getProcessStatusList() )) {
-			p = cb.and( p,  root.get( OkrWorkReportBaseInfo_.processStatus).in( wrapIn.getProcessStatusList() ));
-		}
-
-		if( ListTools.isNotEmpty( wrapIn.getQ_statuses() )) {
-			p = cb.and( p,  root.get( OkrWorkReportBaseInfo_.status).in( wrapIn.getQ_statuses() ));
-		}
-		cq.select( cb.count( root ) );	
-		return em.createQuery(cq.where(p)).getSingleResult();
-	}
-
-	/**
-	 * 根据WorkId查询该工作所有汇报中已经提交的最后一次汇报的内容,如果没有则返回NULL
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	public OkrWorkReportBaseInfo getLastCompletedReport( String workId ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();		
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery( OkrWorkReportBaseInfo.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from( OkrWorkReportBaseInfo.class);		
-		cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.reportCount) ) );
-		Predicate p = cb.equal( root.get( OkrWorkReportBaseInfo_.workId ), workId);
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportBaseInfo_.activityName ), "已完成" ) );
-		List<OkrWorkReportBaseInfo> resultList = em.createQuery(cq.where(p)).getResultList();
-		if( resultList == null || resultList.size() == 0 ){
-			return null;
-		}else{
-			return resultList.get(0);
-		}
-	}
-
-	/**
-	 * 根据条件查询汇报ID列表
-	 * @param workId
-	 * @param activityName
-	 * @param processStatus
-	 * @param processIdentity
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listByWorkId(String workId, String activityName, String processStatus, String processorIdentity ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from( OkrWorkReportBaseInfo.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportBaseInfo_.workId), workId );
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportBaseInfo_.status ), "正常" ) );
-		if( processorIdentity != null && !processorIdentity.isEmpty() ){
-			p = cb.and( p, cb.isMember( processorIdentity, root.get( OkrWorkReportBaseInfo_.currentProcessorIdentityList )));
-		}
-		if( activityName != null && !activityName.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkReportBaseInfo_.activityName ), activityName ) );
-		}
-		if( processStatus != null && !processStatus.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkReportBaseInfo_.processStatus ), processStatus ) );
-		}
-		cq.select(root.get( OkrWorkReportBaseInfo_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	/**
-	 * 根据工作ID获取该工作最后一次工作汇报
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	public OkrWorkReportBaseInfo getLastReportBaseInfo( String workId ) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( "workId is empty, system can not excute query!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();		
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery( OkrWorkReportBaseInfo.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from( OkrWorkReportBaseInfo.class);
-		cq.orderBy( cb.desc( root.get( OkrWorkReportBaseInfo_.submitTime ) ) );	
-		
-		Predicate p = cb.equal( root.get( OkrWorkReportBaseInfo_.workId ), workId );
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportBaseInfo_.status ), "正常" ));
-		
-		List<OkrWorkReportBaseInfo> resultList = em.createQuery(cq.where(p)).getResultList();
-		if( resultList == null || resultList.size() == 0 ){
-			return null;
-		}else{
-			return resultList.get(0);
-		}
-	}
-
-	public List<String> listProcessingReportIdsByWorkId(String workId) throws Exception {
-		if( workId == null || workId.isEmpty() ){
-			throw new Exception( " workId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportBaseInfo_.workId ), workId );
-		p = cb.and( p, cb.notEqual( root.get( OkrWorkReportBaseInfo_.activityName ), "已完成" ));
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportBaseInfo_.status ), "正常" ));
-		cq.select(root.get( OkrWorkReportBaseInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 查询工作汇报创建者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctCreatorIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkReportBaseInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportBaseInfo_.creatorIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportBaseInfo_.creatorIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkReportBaseInfo_.creatorIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询工作汇报当前处理者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctCurrentProcessorIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		/*
-		CriteriaQuery<List> cq = cb.createQuery( List.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		cq.select(root.get( OkrWorkReportBaseInfo_.currentProcessorIdentityList ));
-		List<List> allList = em.createQuery(cq).getResultList();
-		*/
-		
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery( OkrWorkReportBaseInfo.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);		
-		List<OkrWorkReportBaseInfo> os = em.createQuery(cq.select(root)).getResultList();
-		List<List> allList = new ArrayList<>();
-		for (OkrWorkReportBaseInfo o : os) {
-			allList.add(o.getCurrentProcessorIdentityList());
-		}
-		
-		if(ListTools.isNotEmpty( allList )) {
-			HashSet hashSet = new  HashSet();
-			for( List<String> identities : allList ) {
-				if(ListTools.isNotEmpty( identities )) {
-					for( String identity : identities ) {
-						if( ListTools.isNotEmpty(identities_ok) && identities_ok.contains( identity ) ){
-							continue;
-						}
-						if( ListTools.isNotEmpty(identities_error) && identities_error.contains( identity ) ){
-							continue;
-						}
-						hashSet.add( identity );
-					}
-				}
-			}
-			List<String> result = new ArrayList<>();
-			result.addAll(hashSet);
-			return result;
-		}
-		return null;
-		
-	}
-	/**
-	 * 查询工作汇报阅知领导身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctReadleadersIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		/*
-		CriteriaQuery<List> cq = cb.createQuery( List.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		cq.select(root.get( OkrWorkReportBaseInfo_.readLeadersIdentityList ));
-		List<List> allList = em.createQuery(cq).getResultList();
-		*/
-		
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery( OkrWorkReportBaseInfo.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);		
-		List<OkrWorkReportBaseInfo> os = em.createQuery(cq.select(root)).getResultList();
-		List<List> allList = new ArrayList<>();
-		for (OkrWorkReportBaseInfo o : os) {
-			allList.add(o.getReadLeadersIdentityList());
-		}
-		
-		if(ListTools.isNotEmpty( allList )) {
-			HashSet hashSet = new  HashSet();
-			for( List<String> identities : allList ) {
-				if(ListTools.isNotEmpty( identities )) {
-					for( String identity : identities ) {
-						if( ListTools.isNotEmpty(identities_ok) && identities_ok.contains( identity ) ){
-							continue;
-						}
-						if( ListTools.isNotEmpty(identities_error) && identities_error.contains( identity ) ){
-							continue;
-						}
-						hashSet.add( identity );
-					}
-				}
-			}
-			List<String> result = new ArrayList<>();
-			result.addAll(hashSet);
-			return result;
-		}
-		return null;
-	}
-	/**
-	 * 查询工作汇报者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctReporterIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkReportBaseInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportBaseInfo_.reporterIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportBaseInfo_.reporterIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkReportBaseInfo_.reporterIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 查询工作管理者,督办员身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctWorkAdminIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from(OkrWorkReportBaseInfo.class);
-		
-		Predicate p = cb.isNotNull( root.get( OkrWorkReportBaseInfo_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportBaseInfo_.workAdminIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportBaseInfo_.workAdminIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkReportBaseInfo_.workAdminIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-
-	/**
-	 * 根据身份名称,从工作汇报信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrWorkReportBaseInfo> listErrorIdentitiesInReportBaseInfo( String identity, String recordId ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportBaseInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportBaseInfo> cq = cb.createQuery( OkrWorkReportBaseInfo.class );
-		Root<OkrWorkReportBaseInfo> root = cq.from( OkrWorkReportBaseInfo.class );
-		Predicate p = cb.isNotNull(root.get( OkrWorkReportBaseInfo_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkReportBaseInfo_.id ), recordId ) );
-		}
-		
-		Predicate p_creatorIdentity = cb.isNotNull(root.get( OkrWorkReportBaseInfo_.creatorIdentity ));
-		p_creatorIdentity = cb.and( p_creatorIdentity, cb.equal( root.get( OkrWorkReportBaseInfo_.creatorIdentity ), identity ) );
-		
-		Predicate p_reporterIdentity = cb.isNotNull(root.get( OkrWorkReportBaseInfo_.reporterIdentity ));
-		p_reporterIdentity = cb.and( p_reporterIdentity, cb.equal( root.get( OkrWorkReportBaseInfo_.reporterIdentity ), identity ) );
-		
-		Predicate p_currentProcessorIdentity = cb.isNotNull(root.get( OkrWorkReportBaseInfo_.currentProcessorIdentityList ));
-		p_currentProcessorIdentity = cb.and( p_currentProcessorIdentity, cb.isMember( identity,  root.get( OkrWorkReportBaseInfo_.currentProcessorIdentityList ) ) );
-		
-		Predicate p_readleadersIdentity = cb.isNotNull(root.get( OkrWorkReportBaseInfo_.readLeadersIdentityList ));
-		p_readleadersIdentity = cb.and( p_readleadersIdentity, cb.isMember( identity, root.get( OkrWorkReportBaseInfo_.readLeadersIdentityList )) );
-		
-		Predicate p_workAdminIdentity = cb.isNotNull(root.get( OkrWorkReportBaseInfo_.workAdminIdentity ));
-		p_workAdminIdentity = cb.and( p_workAdminIdentity, cb.equal( root.get( OkrWorkReportBaseInfo_.workAdminIdentity ), identity ) );
-
-		Predicate p_identity = cb.or( p_creatorIdentity, p_reporterIdentity, p_currentProcessorIdentity, p_readleadersIdentity, p_workAdminIdentity );
-			
-		p = cb.and( p, p_identity );
-
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 95
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportDetailInfoFactory.java

@@ -1,95 +0,0 @@
-package com.x.okr.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 com.x.base.core.project.exception.ExceptionWhen;
-import com.x.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.entity.OkrWorkReportDetailInfo;
-import com.x.okr.entity.OkrWorkReportDetailInfo_;
-
-/**
- * 类   名:OkrWorkReportDetailInfoFactory<br/>
- * 实体类:OkrWorkReportDetailInfo<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:27
-**/
-public class OkrWorkReportDetailInfoFactory extends AbstractFactory {
-
-	public OkrWorkReportDetailInfoFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrWorkReportDetailInfo实体信息对象" )
-	public OkrWorkReportDetailInfo get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkReportDetailInfo.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrWorkReportDetailInfo实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportDetailInfo> root = cq.from( OkrWorkReportDetailInfo.class);
-		cq.select(root.get(OkrWorkReportDetailInfo_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkReportDetailInfo实体信息列表" )
-	public List<OkrWorkReportDetailInfo> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkReportDetailInfo>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportDetailInfo> cq = cb.createQuery(OkrWorkReportDetailInfo.class);
-		Root<OkrWorkReportDetailInfo> root = cq.from(OkrWorkReportDetailInfo.class);
-		Predicate p = root.get(OkrWorkReportDetailInfo_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,获取汇报详细信息ID列表
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作信息ID,获取汇报详细信息ID列表" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportDetailInfo> root = cq.from( OkrWorkReportDetailInfo.class);
-		Predicate p = cb.equal( root.get(OkrWorkReportDetailInfo_.workId), workId );
-		cq.select(root.get( OkrWorkReportDetailInfo_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportDetailInfo.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportDetailInfo> root = cq.from(OkrWorkReportDetailInfo.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportDetailInfo_.centerId ), centerId );
-		cq.select(root.get( OkrWorkReportDetailInfo_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 368
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportPersonLinkFactory.java

@@ -1,368 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-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.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.assemble.control.jaxrs.WorkPersonSearchFilter;
-import com.x.okr.entity.OkrWorkReportPersonLink;
-import com.x.okr.entity.OkrWorkReportPersonLink_;
-
-/**
- * 类   名:OkrWorkReportPersonLinkFactory<br/>
- * 实体类:OkrWorkReportPersonLink<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:27
-**/
-public class OkrWorkReportPersonLinkFactory extends AbstractFactory {
-
-	public OkrWorkReportPersonLinkFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-//	@MethodDescribe( "获取指定Id的OkrWorkReportPersonLink实体信息对象" )
-	public OkrWorkReportPersonLink get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkReportPersonLink.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrWorkReportPersonLink实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportPersonLink> root = cq.from( OkrWorkReportPersonLink.class);
-		cq.select(root.get(OkrWorkReportPersonLink_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkReportPersonLink实体信息列表" )
-	public List<OkrWorkReportPersonLink> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkReportPersonLink>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportPersonLink> cq = cb.createQuery(OkrWorkReportPersonLink.class);
-		Root<OkrWorkReportPersonLink> root = cq.from(OkrWorkReportPersonLink.class);
-		Predicate p = root.get(OkrWorkReportPersonLink_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIdsByReportId( String reportId ) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportPersonLink> root = cq.from( OkrWorkReportPersonLink.class);
-		Predicate p = cb.equal( root.get(OkrWorkReportPersonLink_.workReportId), reportId );
-		cq.select(root.get( OkrWorkReportPersonLink_.id) );
-		return em.createQuery(cq.where(p)).setMaxResults(5000).getResultList();
-	}
-	
-	/**
-	 * 根据工作信息ID,获取汇报处理链信息ID列表
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据工作信息ID,获取汇报处理链信息ID列表" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportPersonLink> root = cq.from( OkrWorkReportPersonLink.class);
-		Predicate p = cb.equal( root.get(OkrWorkReportPersonLink_.workId), workId );
-		cq.select(root.get( OkrWorkReportPersonLink_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-	//@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportPersonLink> root = cq.from(OkrWorkReportPersonLink.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportPersonLink_.centerId ), centerId );
-		cq.select(root.get( OkrWorkReportPersonLink_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-	
-	/**
-	 * 根据汇报ID获取该汇报的最高处理过程级别
-	 * @param reportId
-	 * @return
-	 * @throws Exception 
-	 */
-	//@MethodDescribe( "根据汇报ID获取该汇报的最高处理过程级别" )
-	public Integer getMaxProcessLevel(String reportId) throws Exception {
-		if( reportId == null || reportId.isEmpty() ){
-			throw new Exception( " reportId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportPersonLink.class );
-		CriteriaBuilder cb = em.getCriteriaBuilder();		
-		CriteriaQuery<OkrWorkReportPersonLink> cq = cb.createQuery( OkrWorkReportPersonLink.class );
-		Root<OkrWorkReportPersonLink> root = cq.from( OkrWorkReportPersonLink.class);		
-		cq.orderBy( cb.desc( root.get( OkrWorkReportPersonLink_.processLevel ) ) );	
-		Predicate p = cb.equal( root.get( OkrWorkReportPersonLink_.workReportId ), reportId );
-		List<OkrWorkReportPersonLink> resultList = em.createQuery(cq.where(p)).getResultList();
-		if( resultList == null || resultList.size() == 0 ){
-			return 0;
-		}else{
-			return resultList.get(0).getProcessLevel();
-		}
-	}
-	//@MethodDescribe( "根据汇报ID和处理等级来查询指定等级的处理人" )
-	public List<String> getProcessPersonLinkInfoByReportAndLevel(String reportId, Integer processLevel, String processorIdentity, String processStatus, String status ) throws Exception {
-		if( reportId == null || reportId.isEmpty() ){
-			throw new Exception( " reportId is null!" );
-		}
-		if( processLevel == null || processLevel < 0  ){
-			throw new Exception( " processLevel is invalid!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportPersonLink> root = cq.from(OkrWorkReportPersonLink.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportPersonLink_.workReportId ), reportId );
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportPersonLink_.processLevel ), processLevel ));
-		if( processorIdentity != null && !processorIdentity.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkReportPersonLink_.processorIdentity ), processorIdentity ));
-		}
-		if( processStatus != null && !processStatus.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkReportPersonLink_.processStatus ), processStatus ));
-		}
-		if( status != null && !status.isEmpty() ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkReportPersonLink_.status ), status ));
-		}
-		cq.select(root.get( OkrWorkReportPersonLink_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkReportPersonLink> listNextWithFilter(String id, Integer count, Object sequence, WorkPersonSearchFilter wrapIn) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportPersonLink.class);
-		String order = wrapIn.getOrder(); // 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		if ( order == null || order.isEmpty() ) {
-			order = "DESC";
-		}
-		sql_stringBuffer.append( "SELECT o FROM " + OkrWorkReportPersonLink.class.getCanonicalName() + " o where 1=1" );
-		if ((null != sequence)) {
-			sql_stringBuffer.append( " and o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "<" : ">" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ( null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like  ?" + (index) );
-			vs.add( "%" + wrapIn.getTitle() + "%" );
-			index++;
-		}
-		//当前处理人身份
-		if ( null != wrapIn.getProcessIdentity() && !wrapIn.getProcessIdentity().isEmpty() ) {
-			sql_stringBuffer.append( " and o.processorIdentity =  ?" + (index) );
-			vs.add( wrapIn.getProcessIdentity() );
-			index++;
-		}
-		//工作处理状态
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "DESC" : "ASC" ));
-		
-		//logger.debug( sql_stringBuffer.toString() );
-		//logger.debug( vs );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkReportPersonLink.class);
-		// 为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults( count ).getResultList();
-	}
-	
-	
-	@SuppressWarnings("unchecked")
-	public List<OkrWorkReportPersonLink> listPrevWithFilter( String id, Integer count, Object sequence, WorkPersonSearchFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportPersonLink.class );
-		String order = wrapIn.getOrder(); // 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-		sql_stringBuffer.append( "SELECT o FROM " + OkrWorkReportPersonLink.class.getCanonicalName() + " o where 1=1" );
-		if ((null != sequence)) {
-			sql_stringBuffer.append( " and o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? ">" : "<" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ( null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like  ?" + (index) );
-			vs.add( "%" + wrapIn.getTitle() + "%" );
-			index++;
-		}
-		//当前处理人身份
-		if ( null != wrapIn.getProcessIdentity() && !wrapIn.getProcessIdentity().isEmpty() ) {
-			sql_stringBuffer.append( " and o.processorIdentity =  ?" + (index) );
-			vs.add( wrapIn.getProcessIdentity() );
-			index++;
-		}
-		//工作处理状态
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "DESC" : "ASC" ));
-		
-		//logger.debug( sql_stringBuffer.toString() );
-		//logger.debug( vs );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkReportPersonLink.class);
-		// 为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults( count ).getResultList();
-	}
-	
-	/**
-	 * 查询符合的信息总数
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountWithFilter( WorkPersonSearchFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportPersonLink.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		sql_stringBuffer.append( "SELECT count( o.id ) FROM " + OkrWorkReportPersonLink.class.getCanonicalName() + " o where 1=1" );
-		
-		if ( null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.title like  ?" + (index) );
-			vs.add( "%" + wrapIn.getTitle() + "%" );
-			index++;
-		}
-		//当前处理人身份
-		if ( null != wrapIn.getProcessIdentity() && !wrapIn.getProcessIdentity().isEmpty() ) {
-			sql_stringBuffer.append( " and o.processorIdentity =  ?" + (index) );
-			vs.add( wrapIn.getProcessIdentity() );
-			index++;
-		}
-		//工作处理状态
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-				
-		//logger.debug( sql_stringBuffer.toString() );
-		//logger.debug( vs );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkReportPersonLink.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}		
-		return (Long) query.getSingleResult();
-	}
-
-	/**
-	 * 查询工作汇报处理者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctProcessorIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkReportPersonLink> root = cq.from(OkrWorkReportPersonLink.class);
-		Predicate p = cb.isNotNull( root.get( OkrWorkReportPersonLink_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportPersonLink_.processorIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportPersonLink_.processorIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkReportPersonLink_.processorIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从工作汇报处理者信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @param recordId 
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrWorkReportPersonLink> listErrorIdentitiesInReportPersonInfo(String identity, String recordId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportPersonLink.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportPersonLink> cq = cb.createQuery( OkrWorkReportPersonLink.class );
-		Root<OkrWorkReportPersonLink> root = cq.from( OkrWorkReportPersonLink.class );
-		Predicate p = cb.isNotNull(root.get( OkrWorkReportPersonLink_.id ));
-		
-		if( recordId != null && !recordId.isEmpty() && !"all".equals( recordId ) ){
-			p = cb.and( p, cb.equal( root.get( OkrWorkReportPersonLink_.id ), recordId ) );
-		}
-		
-		Predicate p_processorIdentity = cb.isNotNull(root.get( OkrWorkReportPersonLink_.processorIdentity ));
-		p_processorIdentity = cb.and( p_processorIdentity, cb.equal( root.get( OkrWorkReportPersonLink_.processorIdentity ), identity ) );		
-		p = cb.and( p, p_processorIdentity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	
-}

+ 0 - 341
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/factory/OkrWorkReportProcessLogFactory.java

@@ -1,341 +0,0 @@
-package com.x.okr.assemble.control.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-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.okr.assemble.control.AbstractFactory;
-import com.x.okr.assemble.control.Business;
-import com.x.okr.assemble.control.jaxrs.okrworkreportbaseinfo.WrapInFilter;
-import com.x.okr.entity.OkrWorkReportProcessLog;
-import com.x.okr.entity.OkrWorkReportProcessLog_;
-
-/**
- * 类   名:OkrWorkReportProcessLogFactory<br/>
- * 实体类:OkrWorkReportProcessLog<br/>
- * 作   者:Liyi<br/>
- * 单   位:O2 Team<br/>
- * 日   期:2016-05-20 17:17:27
-**/
-public class OkrWorkReportProcessLogFactory extends AbstractFactory {
-
-	public OkrWorkReportProcessLogFactory(Business business) throws Exception {
-		super(business);
-	}
-	
-	//@MethodDescribe( "获取指定Id的OkrWorkReportProcessLog实体信息对象" )
-	public OkrWorkReportProcessLog get( String id ) throws Exception {
-		return this.entityManagerContainer().find(id, OkrWorkReportProcessLog.class, ExceptionWhen.none);
-	}
-	
-	//@MethodDescribe( "列示全部的OkrWorkReportProcessLog实体信息列表" )
-	public List<String> listAll() throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportProcessLog> root = cq.from( OkrWorkReportProcessLog.class);
-		cq.select(root.get(OkrWorkReportProcessLog_.id));
-		return em.createQuery(cq).getResultList();
-	}
-	
-	//@MethodDescribe( "列示指定Id的OkrWorkReportProcessLog实体信息列表" )
-	public List<OkrWorkReportProcessLog> list(List<String> ids) throws Exception {
-		if( ids == null || ids.size() == 0 ){
-			return new ArrayList<OkrWorkReportProcessLog>();
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportProcessLog> cq = cb.createQuery(OkrWorkReportProcessLog.class);
-		Root<OkrWorkReportProcessLog> root = cq.from(OkrWorkReportProcessLog.class);
-		Predicate p = root.get(OkrWorkReportProcessLog_.id).in(ids);
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据工作信息ID,获取汇报处理记录信息ID列表
-	 * @param workId
-	 * @return
-	 * @throws Exception 
-	 */
-//	@MethodDescribe( "根据工作信息ID,获取汇报处理记录信息ID列表" )
-	public List<String> listByWorkId(String workId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportProcessLog> root = cq.from( OkrWorkReportProcessLog.class);
-		Predicate p = cb.equal( root.get(OkrWorkReportProcessLog_.workId), workId );
-		cq.select(root.get( OkrWorkReportProcessLog_.id) );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 根据中心工作ID,列示所有的数据信息
-	 * @param centerId 中心工作
-	 * @return
-	 * @throws Exception
-	 */
-//	@MethodDescribe( "根据中心工作ID,列示所有的信息" )
-	public List<String> listByCenterWorkId(String centerId) throws Exception {
-		if( centerId == null || centerId.isEmpty() ){
-			throw new Exception( " centerId is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportProcessLog> root = cq.from(OkrWorkReportProcessLog.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportProcessLog_.centerId ), centerId );
-		cq.select(root.get( OkrWorkReportProcessLog_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	@SuppressWarnings("unchecked")
-	public List<String> listNextWithFilter(String id, Integer count, Object sequence, WrapInFilter wrapIn) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportProcessLog.class);
-		String order = wrapIn.getOrder(); // 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		if ( order == null || order.isEmpty() ) {
-			order = "DESC";
-		}
-		sql_stringBuffer.append( "SELECT o FROM " + OkrWorkReportProcessLog.class.getCanonicalName() + " o where 1=1" );
-		if ((null != sequence)) {
-			sql_stringBuffer.append( " and o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "<" : ">" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ( null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.reportTitle like  ?" + (index) );
-			vs.add( "%" + wrapIn.getTitle() + "%" );
-			index++;
-		}
-		//当前处理人身份
-		if ( null != wrapIn.getProcessIdentity() && !wrapIn.getProcessIdentity().isEmpty() ) {
-			sql_stringBuffer.append( " and o.processorIdentity =  ?" + (index) );
-			vs.add( wrapIn.getProcessIdentity() );
-			index++;
-		}
-		//工作处理状态
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "DESC" : "ASC" ));
-		
-		//logger.debug( sql_stringBuffer.toString() );
-		//logger.debug( vs );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkReportProcessLog.class);
-		// 为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults( count ).getResultList();
-	}
-	
-	
-	@SuppressWarnings("unchecked")
-	public List<String> listPrevWithFilter( String id, Integer count, Object sequence, WrapInFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportProcessLog.class );
-		String order = wrapIn.getOrder(); // 排序方式
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		if (order == null || order.isEmpty()) {
-			order = "DESC";
-		}
-		sql_stringBuffer.append( "SELECT o FROM " + OkrWorkReportProcessLog.class.getCanonicalName() + " o where 1=1" );
-		if ((null != sequence)) {
-			sql_stringBuffer.append( " and o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? ">" : "<" ) + ( " ?" + (index)));
-			vs.add(sequence);
-			index++;
-		}
-		if ( null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.reportTitle like  ?" + (index) );
-			vs.add( "%" + wrapIn.getTitle() + "%" );
-			index++;
-		}
-		//当前处理人身份
-		if ( null != wrapIn.getProcessIdentity() && !wrapIn.getProcessIdentity().isEmpty() ) {
-			sql_stringBuffer.append( " and o.processorIdentity =  ?" + (index) );
-			vs.add( wrapIn.getProcessIdentity() );
-			index++;
-		}
-		//工作处理状态
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-		sql_stringBuffer.append( " order by o." + wrapIn.getSequenceField() + " " + (StringUtils.equalsIgnoreCase(order, "DESC" ) ? "DESC" : "ASC" ));
-		
-		//logger.debug( sql_stringBuffer.toString() );
-		//logger.debug( vs );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkReportProcessLog.class);
-		// 为查询设置所有的参数值
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}
-		return query.setMaxResults( count ).getResultList();
-	}
-	
-	/**
-	 * 查询符合的信息总数
-	 * @param id
-	 * @param count
-	 * @param sequence
-	 * @param wrapIn
-	 * @return
-	 * @throws Exception
-	 */
-	public long getCountWithFilter( WrapInFilter wrapIn ) throws Exception {
-		//先获取上一页最后一条的sequence值,如果有值的话,以此sequence值作为依据取后续的count条数据
-		EntityManager em = this.entityManagerContainer().get( OkrWorkReportProcessLog.class );
-		List<Object> vs = new ArrayList<>();
-		StringBuffer sql_stringBuffer = new StringBuffer();
-		Integer index = 1;
-		
-		sql_stringBuffer.append( "SELECT count( o.id ) FROM " + OkrWorkReportProcessLog.class.getCanonicalName() + " o where 1=1" );
-		
-		if ( null != wrapIn.getTitle() && !wrapIn.getTitle().isEmpty() ) {
-			sql_stringBuffer.append( " and o.reportTitle like  ?" + (index) );
-			vs.add( "%" + wrapIn.getTitle() + "%" );
-			index++;
-		}
-		//当前处理人身份
-		if ( null != wrapIn.getProcessIdentity() && !wrapIn.getProcessIdentity().isEmpty() ) {
-			sql_stringBuffer.append( " and o.processorIdentity =  ?" + (index) );
-			vs.add( wrapIn.getProcessIdentity() );
-			index++;
-		}
-		//工作处理状态
-		if (null != wrapIn.getProcessStatusList() && wrapIn.getProcessStatusList().size() > 0) {
-			sql_stringBuffer.append( " and o.processStatus in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getProcessStatusList() );
-			index++;
-		}
-		if (null != wrapIn.getQ_statuses() && wrapIn.getQ_statuses().size() > 0) {
-			sql_stringBuffer.append( " and o.status in ( ?" + (index) + " )" );
-			vs.add( wrapIn.getQ_statuses() );
-			index++;
-		}
-				
-		//logger.debug( sql_stringBuffer.toString() );
-		//logger.debug( vs );
-		
-		Query query = em.createQuery( sql_stringBuffer.toString(), OkrWorkReportProcessLog.class );
-
-		for (int i = 0; i < vs.size(); i++) {
-			query.setParameter(i + 1, vs.get(i));
-		}		
-		return (Long) query.getSingleResult();
-	}
-
-	/**
-	 * 根据reportId, 处理人,环节名称 以及处理状态 确定一条处理记录
-	 * @param id
-	 * @param processorIdentity
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listByReportIdAndProcessor(String reportId, String activityName, String processorIdentity, String processStatus ) throws Exception {
-		if( reportId == null || reportId.isEmpty() ){
-			throw new Exception( " reportId is null!" );
-		}
-		if( activityName == null || activityName.isEmpty() ){
-			throw new Exception( " activityName is null!" );
-		}
-		if( processorIdentity == null || processorIdentity.isEmpty() ){
-			throw new Exception( " processorIdentity is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportProcessLog> root = cq.from(OkrWorkReportProcessLog.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportProcessLog_.workReportId ), reportId );
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportProcessLog_.activityName ), activityName));
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportProcessLog_.processorIdentity ), processorIdentity));
-		p = cb.and( p, cb.equal( root.get( OkrWorkReportProcessLog_.processStatus ), processStatus));
-		
-		cq.select(root.get( OkrWorkReportProcessLog_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	public List<String> listIdsByReportId(String id) throws Exception {
-		if( id == null || id.isEmpty() ){
-			throw new Exception( " id is null!" );
-		}
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<OkrWorkReportProcessLog> root = cq.from(OkrWorkReportProcessLog.class);
-		Predicate p = cb.equal( root.get( OkrWorkReportProcessLog_.workReportId ), id );
-		cq.select(root.get( OkrWorkReportProcessLog_.id));
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-
-	/**
-	 * 查询工作汇报处理者身份列表(去重复)
-	 * @param identities_ok 排除身份
-	 * @param identities_error 排除身份
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<String> listAllDistinctProcessorIdentity(List<String> identities_ok, List<String> identities_error) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery( String.class );
-		Root<OkrWorkReportProcessLog> root = cq.from(OkrWorkReportProcessLog.class);
-		Predicate p = cb.isNotNull( root.get( OkrWorkReportProcessLog_.id ) );
-		if( identities_ok != null && identities_ok.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportProcessLog_.processorIdentity ).in( identities_ok )) );
-		}
-		if( identities_error != null && identities_error.size() > 0 ){
-			p = cb.and( p, cb.not(root.get( OkrWorkReportProcessLog_.processorIdentity ).in( identities_error )) );
-		}
-		cq.select(root.get( OkrWorkReportProcessLog_.processorIdentity ));
-		return em.createQuery(cq.where(p)).getResultList().stream().distinct().collect(Collectors.toList());
-	}
-	/**
-	 * 根据身份名称,从工作汇报处理日志信息中查询与该身份有关的所有信息列表
-	 * @param identity
-	 * @return
-	 * @throws Exception 
-	 */
-	public List<OkrWorkReportProcessLog> listErrorIdentitiesInReportProcessLog(String identity) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(OkrWorkReportProcessLog.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<OkrWorkReportProcessLog> cq = cb.createQuery( OkrWorkReportProcessLog.class );
-		Root<OkrWorkReportProcessLog> root = cq.from( OkrWorkReportProcessLog.class );
-		Predicate p = cb.isNotNull(root.get( OkrWorkReportProcessLog_.id ));		
-		Predicate p_processorIdentity = cb.isNotNull(root.get( OkrWorkReportProcessLog_.processorIdentity ));
-		p_processorIdentity = cb.and( p_processorIdentity, cb.equal( root.get( OkrWorkReportProcessLog_.processorIdentity ), identity ) );		
-		p = cb.and( p, p_processorIdentity );
-		return em.createQuery(cq.where(p)).getResultList();
-	}
-}

+ 0 - 86
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/ActionApplication.java

@@ -1,86 +0,0 @@
-package com.x.okr.assemble.control.jaxrs;
-
-import java.util.Set;
-
-import javax.ws.rs.ApplicationPath;
-
-import com.x.base.core.project.jaxrs.AbstractActionApplication;
-import com.x.okr.assemble.control.jaxrs.appraise.OkrWorkAppraiseAction;
-import com.x.okr.assemble.control.jaxrs.export.OkrExportAction;
-import com.x.okr.assemble.control.jaxrs.identity.OkrSystemErrorIdentityProcessAction;
-import com.x.okr.assemble.control.jaxrs.login.OkrLoginAction;
-import com.x.okr.assemble.control.jaxrs.login.OkrLogoutAction;
-import com.x.okr.assemble.control.jaxrs.mind.OkrWorkMindAction;
-import com.x.okr.assemble.control.jaxrs.okrattachmentfileinfo.OkrAttachmentFileInfoAction;
-import com.x.okr.assemble.control.jaxrs.okrauthorize.OkrWorkAuthorizeAction;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.OkrCenterWorkInfoAction;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.OkrCenterWorkInfoAdminAction;
-import com.x.okr.assemble.control.jaxrs.okrconfigsercretary.OkrConfigSecretaryAction;
-import com.x.okr.assemble.control.jaxrs.okrconfigsystem.OkrConfigSystemAction;
-import com.x.okr.assemble.control.jaxrs.okrconfigworklevel.OkrConfigWorkLevelAction;
-import com.x.okr.assemble.control.jaxrs.okrconfigworktype.OkrConfigWorkTypeAction;
-import com.x.okr.assemble.control.jaxrs.okrtask.OkrAnonymousTaskAction;
-import com.x.okr.assemble.control.jaxrs.okrtask.OkrTaskAction;
-import com.x.okr.assemble.control.jaxrs.okrtask.OkrTaskAdminAction;
-import com.x.okr.assemble.control.jaxrs.okrtaskhandled.OkrTaskHandledAction;
-import com.x.okr.assemble.control.jaxrs.okrworkauthorizerecord.OkrWorkAuthorizeRecordAction;
-import com.x.okr.assemble.control.jaxrs.okrworkbaseinfo.OkrWorkBaseInfoAction;
-import com.x.okr.assemble.control.jaxrs.okrworkbaseinfo.OkrWorkBaseInfoAdminAction;
-import com.x.okr.assemble.control.jaxrs.okrworkchat.OkrWorkChatAction;
-import com.x.okr.assemble.control.jaxrs.okrworkdetailinfo.OkrWorkDetailInfoAction;
-import com.x.okr.assemble.control.jaxrs.okrworkdynamics.OkrWorkDynamicsAction;
-import com.x.okr.assemble.control.jaxrs.okrworkreportbaseinfo.OkrWorkReportBaseInfoAction;
-import com.x.okr.assemble.control.jaxrs.okrworkreportbaseinfo.OkrWorkReportBaseInfoAdminAction;
-import com.x.okr.assemble.control.jaxrs.okrworkreportdetailinfo.OkrWorkReportDetailInfoAction;
-import com.x.okr.assemble.control.jaxrs.okrworkreportpersonlink.OkrWorkReportPersonLinkAction;
-import com.x.okr.assemble.control.jaxrs.okrworkreportprocesslog.OkrWorkReportProcessLogAction;
-import com.x.okr.assemble.control.jaxrs.statistic.OkrStatisticReportContentAction;
-import com.x.okr.assemble.control.jaxrs.statistic.OkrStatisticReportStatusAction;
-import com.x.okr.assemble.control.jaxrs.uuid.UUIDAction;
-import com.x.okr.assemble.control.jaxrs.workimport.OkrWorkImportAction;
-
-@ApplicationPath("jaxrs")
-public class ActionApplication extends AbstractActionApplication {
-
-	public Set<Class<?>> getClasses() {
-		this.classes.add(OkrWorkAuthorizeAction.class);
-		this.classes.add(OkrCenterWorkInfoAction.class);
-		this.classes.add(OkrWorkBaseInfoAction.class);
-		this.classes.add(OkrAttachmentFileInfoAction.class);
-		this.classes.add(OkrConfigSystemAction.class);
-		this.classes.add(OkrConfigWorkLevelAction.class);
-		this.classes.add(OkrConfigWorkTypeAction.class);
-		this.classes.add(OkrConfigSecretaryAction.class);
-		this.classes.add(OkrTaskAction.class);
-		this.classes.add(OkrAnonymousTaskAction.class);
-		this.classes.add(OkrTaskHandledAction.class);
-		this.classes.add(OkrWorkAuthorizeRecordAction.class);
-		this.classes.add(OkrWorkDetailInfoAction.class);
-		this.classes.add(OkrWorkDynamicsAction.class);
-		this.classes.add(OkrSystemErrorIdentityProcessAction.class);
-		this.classes.add(OkrWorkReportBaseInfoAction.class);
-		this.classes.add(OkrWorkReportDetailInfoAction.class);
-		this.classes.add(OkrWorkReportPersonLinkAction.class);
-		this.classes.add(OkrWorkReportProcessLogAction.class);
-		this.classes.add(OkrLoginAction.class);
-		this.classes.add(OkrLogoutAction.class);
-		this.classes.add(OkrWorkChatAction.class);		
-		this.classes.add(UUIDAction.class);
-		this.classes.add(OkrWorkMindAction.class);
-		
-		this.classes.add(OkrCenterWorkInfoAdminAction.class);
-		this.classes.add(OkrWorkBaseInfoAdminAction.class);
-		this.classes.add(OkrTaskAdminAction.class);
-		this.classes.add(OkrWorkReportBaseInfoAdminAction.class);
-		
-		this.classes.add(OkrStatisticReportContentAction.class);
-		this.classes.add(OkrStatisticReportStatusAction.class);
-		
-		this.classes.add(OkrExportAction.class);
-		this.classes.add(OkrWorkImportAction.class);
-		this.classes.add(OkrWorkAppraiseAction.class);
-
-		return this.classes;
-	}
-
-}

+ 0 - 10
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/OkrAnonyJaxrsFilter.java

@@ -1,10 +0,0 @@
-package com.x.okr.assemble.control.jaxrs;
-
-import javax.servlet.annotation.WebFilter;
-
-import com.x.base.core.project.jaxrs.AnonymousCipherManagerUserJaxrsFilter;
-
-@WebFilter(urlPatterns = { "/jaxrs/task/*" }, asyncSupported = true)
-public class OkrAnonyJaxrsFilter extends AnonymousCipherManagerUserJaxrsFilter {
-
-}

+ 0 - 48
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/OkrJaxrsFilter.java

@@ -1,48 +0,0 @@
-package com.x.okr.assemble.control.jaxrs;
-
-import javax.servlet.annotation.WebFilter;
-
-import com.x.base.core.project.jaxrs.CipherManagerUserJaxrsFilter;
-
-/**
- * web服务过滤器,将指定的URL定义为需要用户认证的服务,如果用户未登录,则无法访问该服务
- */
-@WebFilter(urlPatterns = {
-		"/jaxrs/mind/*",
-		"/jaxrs/uuid/*",
-		"/jaxrs/login/*",
-		"/jaxrs/logout/*",
-		"/jaxrs/okrauthorize/*",
-		"/jaxrs/okrworkchat/*",
-		"/jaxrs/okrattachmentfileinfo/*",
-		"/jaxrs/okrcenterworkinfo/*",
-		"/jaxrs/okrconfigsystem/*",
-		"/jaxrs/okrconfigworklevel/*",
-		"/jaxrs/okrconfigworktype/*",
-		"/jaxrs/okrconfigsecretary/*",
-		"/jaxrs/okrtask/*",
-		"/jaxrs/okrtaskhandled/*",
-		"/jaxrs/okrworkauthorizerecord/*",
-		"/jaxrs/okrworkbaseinfo/*",
-		"/jaxrs/okrworkappraise/*",
-		"/jaxrs/okrworkdetailinfo/*",
-		"/jaxrs/okrworkdynamics/*",
-		"/jaxrs/okrworkprocesslink/*",
-		"/jaxrs/okrworkreportbaseinfo/*",
-		"/jaxrs/okrworkreportdetailinfo/*",
-		"/jaxrs/okrworkreportpersonlink/*",
-		"/jaxrs/okrworkreportprocesslog/*",
-		"/jaxrs/admin/okrcenterworkinfo/*",
-		"/jaxrs/admin/okrworkbaseinfo/*",
-		"/jaxrs/admin/okrtask/*",
-		"/jaxrs/admin/okrtaskhandled/*",
-		"/jaxrs/admin/okrworkreportbaseinfo/*",
-		"/jaxrs/streportcontent/*",
-		"/jaxrs/streportstatus/*",
-		"/jaxrs/error/identity/*",
-		"/jaxrs/export/*",
-		"/jaxrs/import/*"
-}, asyncSupported = true)
-public class OkrJaxrsFilter extends CipherManagerUserJaxrsFilter {
-	
-}

+ 0 - 136
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/WorkCommonQueryFilter.java

@@ -1,136 +0,0 @@
-package com.x.okr.assemble.control.jaxrs;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.gson.GsonPropertyObject;
-
-public class WorkCommonQueryFilter extends GsonPropertyObject {
-
-	@FieldDescribe( "用于模糊查询的中心工作标题." )
-	private String title;
-	
-	@FieldDescribe( "用于查询的用户身份." )
-	private String identity;
-	
-	@FieldDescribe( "用于查询的中心工作ID列表." )
-	private List<String> centerIds; //部署时使用
-	
-	@FieldDescribe( "用于查询的中心工作信息状态列表:正常、已归档、已删除." )
-	private List<String> q_statuses;
-	
-	@FieldDescribe( "用于查询的中心工作处理状态列表:草稿、执行中、已完成." )
-	private List<String> processStatusList;
-	
-	@FieldDescribe( "用于查询的中心工作类别列表." )
-	private List<String> defaultWorkTypes;
-
-	@FieldDescribe( "用于列表排序的属性." )
-	private String sequenceField =  JpaObject.sequence_FIELDNAME;
-	
-	@FieldDescribe( "用于列表排序的方式." )
-	private String order = "DESC";
-	// 是否查询下级组织
-	private boolean querySubOrganizatin = true;
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public List<String> getCenterIds() {
-		return centerIds;
-	}
-
-	public void setCenterIds(List<String> centerIds) {
-		this.centerIds = centerIds;
-	}
-
-	public List<String> getQ_statuses() {
-		return q_statuses;
-	}
-
-	public void setQ_statuses(List<String> q_statuses) {
-		this.q_statuses = q_statuses;
-	}
-
-	public List<String> getProcessStatusList() {
-		return processStatusList;
-	}
-
-	public void setProcessStatusList(List<String> processStatusList) {
-		this.processStatusList = processStatusList;
-	}
-
-	public List<String> getDefaultWorkTypes() {
-		return defaultWorkTypes;
-	}
-
-	public void setDefaultWorkTypes(List<String> defaultWorkTypes) {
-		this.defaultWorkTypes = defaultWorkTypes;
-	}
-
-	public String getSequenceField() {
-		return sequenceField;
-	}
-
-	public void setSequenceField(String sequenceField) {
-		this.sequenceField = sequenceField;
-	}
-
-	public String getOrder() {
-		return order;
-	}
-
-	public void setOrder(String order) {
-		this.order = order;
-	}
-
-	public boolean isQuerySubOrganizatin() {
-		return querySubOrganizatin;
-	}
-
-	public void setQuerySubOrganizatin(boolean querySubOrganizatin) {
-		this.querySubOrganizatin = querySubOrganizatin;
-	}
-
-	public String getIdentity() {
-		return identity;
-	}
-
-	public void setIdentity(String identity) {
-		this.identity = identity;
-	}
-
-	/**
-	 * 添加查询的信息状态
-	 * 
-	 * @param status
-	 */
-	public void addQueryInfoStatus(String status) {
-		if (q_statuses == null) {
-			q_statuses = new ArrayList<String>();
-		}
-		if (!q_statuses.contains(status)) {
-			q_statuses.add(status);
-		}
-	}
-	
-	/**
-	 * 添加查询的部署处理状态
-	 * @param status
-	 */
-	public void addQueryWorkProcessStatus( String status ) {
-		if( processStatusList == null ){
-			processStatusList = new ArrayList<String>();
-		}
-		if( !processStatusList.contains( status )){
-			processStatusList.add( status );
-		}
-	}
-}

+ 0 - 262
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/WorkCommonSearchFilter.java

@@ -1,262 +0,0 @@
-package com.x.okr.assemble.control.jaxrs;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.gson.GsonPropertyObject;
-
-public class WorkCommonSearchFilter extends GsonPropertyObject {
-	
-	private String sequenceField =  JpaObject.sequence_FIELDNAME;
-	
-	private String order = "DESC";
-	
-	private List<String> employeeNames = null;
-	
-	private List<String> employeeIdentities = null;
-	
-	private List<String> processIdentities = null;
-	
-	private List<String> unitNames = null;
-	
-	private List<String> topUnitNames = null;
-	
-	private List<String> workTypes = null;
-	
-	private String workTitle = null;
-	
-	private String deployYear = null;
-	
-	private String deployMonth = null;
-	
-	private String workDateTimeType = null;
-	
-	private List<String> workProcessStatuses = null;
-	
-	private String infoType = "CenterWork"; // CenterWork | Work
-	
-	private List<String> infoStatuses = null;
-	
-	private Integer maxCharacterNumber = 30;
-
-	public String getSequenceField() {
-		return sequenceField;
-	}
-
-	public void setSequenceField(String sequenceField) {
-		this.sequenceField = sequenceField;
-	}
-
-	public String getOrder() {
-		return order;
-	}
-
-	public void setOrder(String order) {
-		this.order = order;
-	}
-
-	public List<String> getEmployeeNames() {
-		return employeeNames;
-	}
-
-	public void setEmployeeNames(List<String> employeeNames) {
-		this.employeeNames = employeeNames;
-	}
-
-	public List<String> getProcessIdentities() {
-		return processIdentities;
-	}
-
-	public void setProcessIdentities(List<String> processIdentities) {
-		this.processIdentities = processIdentities;
-	}
-
-	public List<String> getUnitNames() {
-		return unitNames;
-	}
-
-	public void setUnitNames(List<String> unitNames) {
-		this.unitNames = unitNames;
-	}
-
-	public List<String> getTopUnitNames() {
-		return topUnitNames;
-	}
-
-	public void setTopUnitNames(List<String> topUnitNames) {
-		this.topUnitNames = topUnitNames;
-	}
-
-	public List<String> getWorkTypes() {
-		return workTypes;
-	}
-
-	public void setWorkTypes(List<String> workTypes) {
-		this.workTypes = workTypes;
-	}
-
-	public String getWorkTitle() {
-		return workTitle;
-	}
-
-	public void setWorkTitle(String workTitle) {
-		this.workTitle = workTitle;
-	}
-
-	public String getDeployYear() {
-		return deployYear;
-	}
-
-	public void setDeployYear(String deployYear) {
-		this.deployYear = deployYear;
-	}
-
-	public String getDeployMonth() {
-		return deployMonth;
-	}
-
-	public void setDeployMonth(String deployMonth) {
-		this.deployMonth = deployMonth;
-	}
-
-	public String getWorkDateTimeType() {
-		return workDateTimeType;
-	}
-
-	public void setWorkDateTimeType(String workDateTimeType) {
-		this.workDateTimeType = workDateTimeType;
-	}
-
-	public List<String> getWorkProcessStatuses() {
-		return workProcessStatuses;
-	}
-
-	public void setWorkProcessStatuses(List<String> workProcessStatuses) {
-		this.workProcessStatuses = workProcessStatuses;
-	}
-
-	public String getInfoType() {
-		return infoType;
-	}
-
-	public void setInfoType(String infoType) {
-		this.infoType = infoType;
-	}
-	
-	
-	public List<String> getInfoStatuses() {
-		return infoStatuses;
-	}
-
-	public void setInfoStatuses(List<String> infoStatuses) {
-		this.infoStatuses = infoStatuses;
-	}
-
-	public List<String> getEmployeeIdentities() {
-		return employeeIdentities;
-	}
-
-	public void setEmployeeIdentities(List<String> employeeIdentities) {
-		this.employeeIdentities = employeeIdentities;
-	}
-
-	/**
-	 * 添加查询的信息状态
-	 * @param status
-	 */
-	public void addQueryInfoStatus( String status ) {
-		if( infoStatuses == null ){
-			infoStatuses = new ArrayList<String>();
-		}
-		if( !infoStatuses.contains( status )){
-			infoStatuses.add( status );
-		}
-	}
-	
-	/**
-	 * 添加查询的员工姓名
-	 * @param status
-	 */
-	public void addQueryEmployeeName( String employeeName ) {
-		if( employeeNames == null ){
-			employeeNames = new ArrayList<String>();
-		}
-		if( !employeeNames.contains( employeeName )){
-			employeeNames.add( employeeName );
-		}
-	}
-	
-	/**
-	 * 添加查询的员工姓名
-	 * @param status
-	 */
-	public void addQueryEmployeeIdentities( String employeeIdentity ) {
-		if( employeeIdentities == null ){
-			employeeIdentities = new ArrayList<String>();
-		}
-		if( !employeeIdentities.contains( employeeIdentity )){
-			employeeIdentities.add( employeeIdentity );
-		}
-	}
-	
-	/**
-	 * 添加查询的组织名称
-	 * @param status
-	 */
-	public void addQueryUnitName( String unitName ) {
-		if( unitNames == null ){
-			unitNames = new ArrayList<String>();
-		}
-		if( !unitNames.contains( unitName )){
-			unitNames.add( unitName );
-		}
-	}
-	
-	/**
-	 * 添加查询的组织名称
-	 * @param status
-	 */
-	public void addQueryTopUnitName( String topUnitName ) {
-		if( topUnitNames == null ){
-			topUnitNames = new ArrayList<String>();
-		}
-		if( !topUnitNames.contains( topUnitName )){
-			topUnitNames.add( topUnitName );
-		}
-	}
-	
-	/**
-	 * 添加查询的部署处理状态
-	 * @param status
-	 */
-	public void addQueryWorkProcessStatus( String status ) {
-		if( workProcessStatuses == null ){
-			workProcessStatuses = new ArrayList<String>();
-		}
-		if( !workProcessStatuses.contains( status )){
-			workProcessStatuses.add( status );
-		}
-	}
-	
-	/**
-	 * 添加查询的部署处理身份
-	 * @param status
-	 */
-	public void addQueryProcessIdentity( String identity ) {
-		if( processIdentities == null ){
-			processIdentities = new ArrayList<String>();
-		}
-		if( !processIdentities.contains( identity )){
-			processIdentities.add(identity);
-		}
-	}
-
-	public Integer getMaxCharacterNumber() {
-		return maxCharacterNumber;
-	}
-
-	public void setMaxCharacterNumber(Integer maxCharacterNumber) {
-		this.maxCharacterNumber = maxCharacterNumber;
-	}	
-}

+ 0 - 235
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/WorkPersonSearchFilter.java

@@ -1,235 +0,0 @@
-package com.x.okr.assemble.control.jaxrs;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.gson.GsonPropertyObject;
-
-public class WorkPersonSearchFilter extends GsonPropertyObject {
-	
-	private String query_deployerUnitName;
-	
-	private String query_deployerName;
-
-	private String query_deployerTopUnitName;
-	
-	private String title ;
-	
-	private String processIdentity;
-	
-	private List<String> workIds;
-	
-	private List<String> processStatusList;
-	
-	private List<String> deployerNames;
-	
-	private List<String> deployerUnitNames;
-	
-	private List<String> deployerTopUnitNames;
-	
-	private String query_creatorName;
-	
-	private String query_creatorUnitName;
-	
-	private String query_creatorTopUnitName;
-	
-	private List<String> creatorNames;
-	
-	private List<String> creatorUnitNames;
-	
-	private List<String> creatorTopUnitNames;
-	
-	private String sequenceField =  JpaObject.sequence_FIELDNAME;
-	
-	private String key;
-	
-	private String order = "DESC";
-	
-	private List<String> q_statuses;
-
-	public String getQuery_deployerName() {
-		return query_deployerName;
-	}
-
-	public void setQuery_deployerName(String query_deployerName) {
-		this.query_deployerName = query_deployerName;
-	}
-
-	public String getQuery_deployerUnitName() {
-		return query_deployerUnitName;
-	}
-
-	public void setQuery_deployerUnitName(String query_deployerUnitName) {
-		this.query_deployerUnitName = query_deployerUnitName;
-	}
-
-	public String getQuery_deployerTopUnitName() {
-		return query_deployerTopUnitName;
-	}
-
-	public void setQuery_deployerTopUnitName(String query_deployerTopUnitName) {
-		this.query_deployerTopUnitName = query_deployerTopUnitName;
-	}
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public String getProcessIdentity() {
-		return processIdentity;
-	}
-
-	public void setProcessIdentity(String processIdentity) {
-		this.processIdentity = processIdentity;
-	}
-
-	public List<String> getWorkIds() {
-		return workIds;
-	}
-
-	public void setWorkIds(List<String> workIds) {
-		this.workIds = workIds;
-	}
-		
-	public List<String> getProcessStatusList() {
-		return processStatusList;
-	}
-
-	public void setProcessStatusList(List<String> processStatusList) {
-		this.processStatusList = processStatusList;
-	}
-
-	public List<String> getDeployerNames() {
-		return deployerNames;
-	}
-
-	public void setDeployerNames(List<String> deployerNames) {
-		this.deployerNames = deployerNames;
-	}
-
-	public List<String> getDeployerUnitNames() {
-		return deployerUnitNames;
-	}
-
-	public void setDeployerUnitNames(List<String> deployerUnitNames) {
-		this.deployerUnitNames = deployerUnitNames;
-	}
-
-	public List<String> getDeployerTopUnitNames() {
-		return deployerTopUnitNames;
-	}
-
-	public void setDeployerTopUnitNames(List<String> deployerTopUnitNames) {
-		this.deployerTopUnitNames = deployerTopUnitNames;
-	}
-
-	public String getQuery_creatorName() {
-		return query_creatorName;
-	}
-
-	public void setQuery_creatorName(String query_creatorName) {
-		this.query_creatorName = query_creatorName;
-	}
-
-	public String getQuery_creatorUnitName() {
-		return query_creatorUnitName;
-	}
-
-	public void setQuery_creatorUnitName(String query_creatorUnitName) {
-		this.query_creatorUnitName = query_creatorUnitName;
-	}
-
-	public String getQuery_creatorTopUnitName() {
-		return query_creatorTopUnitName;
-	}
-
-	public void setQuery_creatorTopUnitName(String query_creatorTopUnitName) {
-		this.query_creatorTopUnitName = query_creatorTopUnitName;
-	}
-
-	public List<String> getCreatorNames() {
-		return creatorNames;
-	}
-
-	public void setCreatorNames(List<String> creatorNames) {
-		this.creatorNames = creatorNames;
-	}
-
-	public List<String> getCreatorUnitNames() {
-		return creatorUnitNames;
-	}
-
-	public void setCreatorUnitNames(List<String> creatorUnitNames) {
-		this.creatorUnitNames = creatorUnitNames;
-	}
-
-	public List<String> getCreatorTopUnitNames() {
-		return creatorTopUnitNames;
-	}
-
-	public void setCreatorTopUnitNames(List<String> creatorTopUnitNames) {
-		this.creatorTopUnitNames = creatorTopUnitNames;
-	}
-
-	public String getSequenceField() {
-		return sequenceField;
-	}
-
-	public void setSequenceField(String sequenceField) {
-		this.sequenceField = sequenceField;
-	}
-
-	public String getKey() {
-		return key;
-	}
-
-	public void setKey(String key) {
-		this.key = key;
-	}
-
-	public String getOrder() {
-		return order;
-	}
-
-	public void setOrder(String order) {
-		this.order = order;
-	}
-
-	public List<String> getQ_statuses() {
-		return q_statuses;
-	}
-
-	public void setQ_statuses(List<String> q_statuses) {
-		this.q_statuses = q_statuses;
-	}
-	
-	/**
-	 * 添加查询的信息状态
-	 * @param status
-	 */
-	public void addQueryInfoStatus( String status ) {
-		if( q_statuses == null ){
-			q_statuses = new ArrayList<String>();
-		}
-		if( !q_statuses.contains( status )){
-			q_statuses.add( status );
-		}
-	}
-	
-	/**
-	 * 添加查询的信息状态
-	 * @param status
-	 */
-	public void addQueryProcessStatus( String status ) {
-		if( processStatusList == null ){
-			processStatusList = new ArrayList<String>();
-		}
-		if( !processStatusList.contains( status )){
-			processStatusList.add( status );
-		}
-	}
-}

+ 0 - 154
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/ActionWorkAppraiseStatusSync.java

@@ -1,154 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.appraise;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.FieldDescribe;
-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.okr.assemble.control.dataadapter.workflow.WorkComplexGetter;
-import com.x.okr.assemble.control.jaxrs.appraise.exception.ExceptionWorkAppraiseProcess;
-import com.x.okr.assemble.control.jaxrs.okrworkbaseinfo.BaseAction;
-import com.x.okr.assemble.control.service.OkrWorkAppraiseSyncService;
-import com.x.okr.assemble.control.service.OkrWorkPersonService;
-
-public class ActionWorkAppraiseStatusSync extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionWorkAppraiseStatusSync.class );
-	private OkrWorkAppraiseSyncService okrWorkAppraiseSyncService = new OkrWorkAppraiseSyncService();
-	private OkrWorkPersonService okrWorkPersonService = new OkrWorkPersonService();
-	
-	protected ActionResult<Wo> execute( HttpServletRequest request,EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		WorkComplexGetter.Wo woWorkComplex =null;
-		Boolean check = true;
-		Wi wi = null;
-		String title = null;
-		String workId = null;
-		String status = null;
-		String wf_jobId = null;
-		String wf_workId = null;
-		try {
-			wi = this.convertToWrapIn( jsonElement, Wi.class );
-			title = wi.getTitle();
-			workId = wi.getWorkId();
-			status = wi.getAppraiseStatus();
-			wf_jobId = wi.getWf_jobId();
-			wf_workId = wi.getWf_workId();
-			if( title!= null && title.length() > 80 ) {
-				title = title.substring(0, 80) + "...";
-			}
-		} catch (Exception e ) {
-			check = false;
-			Exception exception = new ExceptionWorkAppraiseProcess( e, "系统在将JSON信息转换为对象时发生异常。JSON:" + jsonElement.toString() );
-			result.error( exception );
-			logger.error( e, effectivePerson, request, null);
-		}
-
-		//1、判断工作信息是否存在,如果存在则进行数据存储,如果不存在,就忽略
-		//2、根据WORKID或者JOBID,获取当前流程的信息,包括当前审核环节等信息
-		if( check ){
-			//获取流程信息
-			woWorkComplex = new WorkComplexGetter().getWorkComplex(wf_workId);
-		}
-		
-		//为新的读者添加权限
-		if( check ){
-			if( ListTools.isNotEmpty( wi.getReaderList() )) {
-				okrWorkPersonService.addWatcherForWork(workId, wi.getReaderList());
-			}
-		}
-		if( check ){
-			try {
-				okrWorkAppraiseSyncService.updateAppraiseWfInfo( effectivePerson, title, workId, wf_jobId, wf_workId, status, woWorkComplex );
-			} catch (Exception e ) {
-				check = false;
-				Exception exception = new ExceptionWorkAppraiseProcess( e, "系统在同步考核流程信息时发生异常。" );
-				result.error( exception );
-				logger.error( e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}
-
-	public static class Wi {
-
-		@FieldDescribe( "考核流程标题" )
-		private String title = null;
-
-		@FieldDescribe( "工作ID" )
-		private String workId = null;
-
-		@FieldDescribe( "流程JOBID" )
-		private String wf_jobId = null;
-
-		@FieldDescribe( "流程WORKID" )
-		private String wf_workId = null;
-
-		@FieldDescribe( "流程审核状态" )
-		private String appraiseStatus = null;
-		
-		@FieldDescribe( "需要为工作信息添加的读者权限" )
-		private List<String> readerList = null;
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public String getWorkId() {
-			return workId;
-		}
-
-		public void setWorkId(String workId) {
-			this.workId = workId;
-		}
-
-		public String getWf_jobId() {
-			return wf_jobId;
-		}
-
-		public void setWf_jobId(String wf_jobId) {
-			this.wf_jobId = wf_jobId;
-		}
-
-		public String getWf_workId() {
-			return wf_workId;
-		}
-
-		public void setWf_workId(String wf_workId) {
-			this.wf_workId = wf_workId;
-		}
-
-		public String getAppraiseStatus() {
-			return appraiseStatus;
-		}
-
-		public void setAppraiseStatus(String appraiseStatus) {
-			this.appraiseStatus = appraiseStatus;
-		}
-
-		public List<String> getReaderList() {
-			return readerList;
-		}
-
-		public void setReaderList(List<String> readerList) {
-			this.readerList = readerList;
-		}
-	}
-
-	public static class Wo extends WoId {
-		public Wo( String id ) {
-			setId( id );
-		}
-	}
-}

+ 0 - 7
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/BaseAction.java

@@ -1,7 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.appraise;
-
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-
-public class BaseAction extends StandardJaxrsAction {
-
-}

+ 0 - 56
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/OkrWorkAppraiseAction.java

@@ -1,56 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.appraise;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-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 javax.ws.rs.core.Response;
-
-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.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("okrworkappraise")
-@JaxrsDescribe("工作考核信息管理服务")
-public class OkrWorkAppraiseAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(OkrWorkAppraiseAction.class);
-
-	@JaxrsMethodDescribe(value = "通知OKR系统同步流程审批状态信息", action = ActionWorkAppraiseStatusSync.class)
-	@POST
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void syncStatus(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			JsonElement jsonElement) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<ActionWorkAppraiseStatusSync.Wo> result = new ActionResult<>();
-		Boolean check = true;
-		if (check) {
-			try {
-				result = new ActionWorkAppraiseStatusSync().execute(request, effectivePerson, jsonElement);
-			} catch (Exception e) {
-				result = new ActionResult<>();
-				logger.warn("system excute ActionWorkAppraiseStatusSync got an exception. ");
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/appraise/exception/ExceptionWorkAppraiseProcess.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.appraise.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionWorkAppraiseProcess extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionWorkAppraiseProcess(Throwable e, String message ) {
-		super( message, e );
-	}
-}

+ 0 - 90
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/ActionStatisticReportContentExport.java

@@ -1,90 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.export;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WoFile;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-public class ActionStatisticReportContentExport extends BaseAction {
-	
-	private static Logger logger = LoggerFactory.getLogger(ActionStatisticReportContentExport.class);
-
-	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson,  String flag ) {
-		ActionResult<Wo> result = new ActionResult<>();
-		File dir = new File("download/temp");
-		if (!dir.exists()) {
-			dir.mkdirs();
-		}
-		byte[] byteArray = getByteFromFile("download/temp/export_" + flag + ".xls");
-		try {
-			Wo wo = new Wo( byteArray,  this.contentType(false, "汇报内容统计.xls"),  this.contentDisposition(false, "汇报内容统计.xls"));
-			result.setData( wo );
-		} catch (Exception e) {
-			logger.warn("system export file got an exception");
-			logger.error(e);
-		}
-		return result;
-	}
-
-
-	private byte[] getByteFromFile(String fileFullName) {
-		ByteArrayOutputStream buffer = null;
-		BufferedInputStream input = null;
-		
-		File file = new File(fileFullName);
-		if (file.exists()) {
-			try {
-				input = new BufferedInputStream(new FileInputStream(file));
-				buffer = new ByteArrayOutputStream();
-			    int nRead;
-			    byte[] data = new byte[1024];
-			    while ((nRead = input.read(data, 0, data.length)) != -1) {
-			        buffer.write(data, 0, nRead);
-			    }
-			    buffer.flush();
-			} catch (FileNotFoundException e) {
-				e.printStackTrace();
-			} catch (IOException e) {
-				e.printStackTrace();
-			} finally {
-				try {
-					input.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-				try {
-					buffer.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-				try {
-					buffer.flush();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-				if (file.exists()) {
-					file.delete();
-				}
-			}	
-		    return buffer.toByteArray();
-		}
-		return null;
-	}
-
-
-	public static class Wo extends WoFile {
-		public Wo(byte[] bytes, String contentType, String contentDisposition) {
-			super(bytes, contentType, contentDisposition);
-		}
-	}
-}

+ 0 - 90
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/ActionStatisticReportStatusExport.java

@@ -1,90 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.export;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WoFile;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-public class ActionStatisticReportStatusExport extends BaseAction {
-	
-	private static Logger logger = LoggerFactory.getLogger(ActionStatisticReportStatusExport.class);
-
-	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson,  String flag ) {
-		ActionResult<Wo> result = new ActionResult<>();
-		File dir = new File("download/temp");
-		if (!dir.exists()) {
-			dir.mkdirs();
-		}
-		byte[] byteArray = getByteFromFile("download/temp/export_" + flag + ".xls");
-		try {
-			Wo wo = new Wo( byteArray,  this.contentType(false, "汇报提交情况统计.xls"),  this.contentDisposition(false, "汇报提交情况统计.xls"));
-			result.setData( wo );
-		} catch (Exception e) {
-			logger.warn("system export file got an exception");
-			logger.error(e);
-		}
-		return result;
-	}
-
-
-	private byte[] getByteFromFile(String fileFullName) {
-		ByteArrayOutputStream buffer = null;
-		BufferedInputStream input = null;
-		
-		File file = new File(fileFullName);
-		if (file.exists()) {
-			try {
-				input = new BufferedInputStream(new FileInputStream(file));
-				buffer = new ByteArrayOutputStream();
-			    int nRead;
-			    byte[] data = new byte[1024];
-			    while ((nRead = input.read(data, 0, data.length)) != -1) {
-			        buffer.write(data, 0, nRead);
-			    }
-			    buffer.flush();
-			} catch (FileNotFoundException e) {
-				e.printStackTrace();
-			} catch (IOException e) {
-				e.printStackTrace();
-			} finally {
-				try {
-					input.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-				try {
-					buffer.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-				try {
-					buffer.flush();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-				if (file.exists()) {
-					file.delete();
-				}
-			}	
-		    return buffer.toByteArray();
-		}
-		return null;
-	}
-
-
-	public static class Wo extends WoFile {
-		public Wo(byte[] bytes, String contentType, String contentDisposition) {
-			super(bytes, contentType, contentDisposition);
-		}
-	}
-}

+ 0 - 7
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/BaseAction.java

@@ -1,7 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.export;
-
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-
-public class BaseAction extends StandardJaxrsAction {
-	
-}

+ 0 - 69
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/export/OkrExportAction.java

@@ -1,69 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.export;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-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 javax.ws.rs.core.Response;
-
-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("export")
-@JaxrsDescribe("文件导出服务")
-public class OkrExportAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(OkrExportAction.class);
-
-	@JaxrsMethodDescribe(value = "导出汇报内容统计表", action = ActionStatisticReportContentExport.class)
-	@GET
-	@Path("statisticreportcontent/{flag}/stream")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void statisticReportContent(@Suspended final AsyncResponse asyncResponse,
-			@Context HttpServletRequest request, @JaxrsParameterDescribe("文件标识") @PathParam("flag") String flag) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<ActionStatisticReportContentExport.Wo> result = new ActionResult<>();
-		try {
-			result = new ActionStatisticReportContentExport().execute(request, effectivePerson, flag);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统根据中心工作ID获取中心工作所有附件信息过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "导出汇报状态统计表", action = ActionStatisticReportContentExport.class)
-	@GET
-	@Path("statisticreportstatus/{flag}/stream")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void statisticReportStatus(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("文件标识") @PathParam("flag") String flag) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<ActionStatisticReportContentExport.Wo> result = new ActionResult<>();
-		try {
-			result = new ActionStatisticReportContentExport().execute(request, effectivePerson, flag);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统根据中心工作ID获取中心工作所有附件信息过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 0 - 174
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionChangeIdentity.java

@@ -1,174 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.WrapOutString;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionIdentityCheck;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionNewIdentityEmpty;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionNewIdentityNotExists;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionOldIdentityEmpty;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionRecordIdEmpty;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionRecordTypeEmpty;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionTableNameEmpty;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.exception.ExceptionWrapInConvert;
-
-public class ActionChangeIdentity extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionChangeIdentity.class );
-	
-	protected ActionResult<WrapOutString> execute( HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<WrapOutString> result = new ActionResult<>();
-		Wi wrapIn = null;
-		Boolean identityExists = false;
-		Boolean check = true;
-
-		if (check) {
-			try {
-				wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ExceptionWrapInConvert(e, jsonElement);
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if (check) {
-			if (wrapIn.getOldIdentity() == null || wrapIn.getOldIdentity().isEmpty()) {
-				check = false;
-				Exception exception = new ExceptionOldIdentityEmpty();
-				result.error(exception);
-			}
-		}
-
-		if (check) {
-			if (wrapIn.getNewIdentity() == null || wrapIn.getNewIdentity().isEmpty()) {
-				check = false;
-				Exception exception = new ExceptionNewIdentityEmpty();
-				result.error(exception);
-			}
-		}
-
-		if (check) {
-			if (wrapIn.getRecordType() == null || wrapIn.getRecordType().isEmpty()) {
-				check = false;
-				Exception exception = new ExceptionRecordTypeEmpty();
-				result.error(exception);
-			}
-		}
-
-		if (check) {
-			if (wrapIn.getTableName() == null || wrapIn.getTableName().isEmpty()) {
-				check = false;
-				Exception exception = new ExceptionTableNameEmpty();
-				result.error(exception);
-			}
-		}
-
-		if (check) {
-			if (wrapIn.getRecordId() == null || wrapIn.getRecordId().isEmpty()) {
-				check = false;
-				Exception exception = new ExceptionRecordIdEmpty();
-				result.error(exception);
-			}
-		}
-
-		if (check) {
-			try {
-				identityExists = userManagerService.isIdentityExsits( wrapIn.getNewIdentity() );
-				if (!identityExists) {
-					check = false;
-					Exception exception = new ExceptionNewIdentityNotExists(wrapIn.getNewIdentity());
-					result.error(exception);
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ExceptionIdentityCheck(e, wrapIn.getNewIdentity());
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if (check) {
-			try {
-				WrapOutString wrapOutString = new WrapOutString();
-				okrSystemIdentityOperatorService.changeUserIdentity(wrapIn.getOldIdentity(), wrapIn.getNewIdentity(),
-						wrapIn.getRecordType(), wrapIn.getTableName(), wrapIn.getRecordId());
-				okrSystemIdentityOperatorService.checkAllAbnormalIdentityInSystem(wrapIn.getOldIdentity(), null);
-				wrapOutString.setValue("数据身份信息变更完成");
-				result.setData(wrapOutString);
-			} catch (Exception e) {
-				result = new ActionResult<>();
-				result.error(e);
-				logger.warn("system check identity got an exception.");
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}
-	
-	public static class Wi {
-		
-		@FieldDescribe( "需要变更的无效的身份名称." )
-		private String oldIdentity = "";
-		
-		@FieldDescribe( "用户更新的新的身份名称." )
-		private String newIdentity = "";
-		
-		@FieldDescribe( "需要进行变更的数据类型:工作信息|工作汇报|待办已办|交流动态|系统配置|数据统计." )
-		private String recordType = "";
-		
-		@FieldDescribe( "需要进行变更的数据所涉及的数据表中具体的数据的ID值" )
-		private String recordId = "";
-		
-		@FieldDescribe( "需要进行变更的数据所涉及的数据表." )
-		private String tableName = "";
-
-		public String getOldIdentity() {
-			return oldIdentity;
-		}
-
-		public String getNewIdentity() {
-			return newIdentity;
-		}
-
-		public void setOldIdentity(String oldIdentity) {
-			this.oldIdentity = oldIdentity;
-		}
-
-		public void setNewIdentity(String newIdentity) {
-			this.newIdentity = newIdentity;
-		}
-
-		public String getRecordType() {
-			return recordType;
-		}
-
-		public String getTableName() {
-			return tableName;
-		}
-
-		public void setRecordType(String recordType) {
-			this.recordType = recordType;
-		}
-
-		public void setTableName(String tableName) {
-			this.tableName = tableName;
-		}
-
-		public String getRecordId() {
-			return recordId;
-		}
-
-		public void setRecordId(String recordId) {
-			this.recordId = recordId;
-		}	
-
-	}
-}

+ 0 - 30
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionCheck.java

@@ -1,30 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.WrapOutString;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-public class ActionCheck extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionCheck.class );
-	
-	protected ActionResult<WrapOutString> execute( HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<WrapOutString> result = new ActionResult<>();
-		try {
-			WrapOutString wrapOutString = new WrapOutString();
-			okrSystemIdentityOperatorService.checkAllAbnormalIdentityInSystem();
-			result.setData(wrapOutString);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			result.error(e);
-			logger.warn("system check identity got an exception.");
-			logger.error(e, effectivePerson, request, null);
-		}
-		return result;
-	}
-	
-}

+ 0 - 159
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionErrorInfoFilterListNextWithFilter.java

@@ -1,159 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-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.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.EqualsTerms;
-import com.x.base.core.project.jaxrs.InTerms;
-import com.x.base.core.project.jaxrs.LikeTerms;
-import com.x.base.core.project.jaxrs.MemberTerms;
-import com.x.base.core.project.jaxrs.NotEqualsTerms;
-import com.x.base.core.project.jaxrs.NotInTerms;
-import com.x.base.core.project.jaxrs.NotMemberTerms;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.control.ThisApplication;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.exception.ExceptionInsufficientPermissions;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.exception.ExceptionOkrSystemAdminCheck;
-import com.x.okr.entity.OkrErrorSystemIdentityInfo;
-import org.apache.commons.lang3.StringUtils;
-
-public class ActionErrorInfoFilterListNextWithFilter extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionErrorInfoFilterListNextWithFilter.class);
-
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id,
-			Integer count, JsonElement jsonElement) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		String sequenceField = null;
-		EqualsTerms equalsMap = new EqualsTerms();
-		NotEqualsTerms notEqualsMap = new NotEqualsTerms();
-		InTerms insMap = new InTerms();
-		NotInTerms notInsMap = new NotInTerms();
-		MemberTerms membersMap = new MemberTerms();
-		NotMemberTerms notMembersMap = new NotMemberTerms();
-		LikeTerms likesMap = new LikeTerms();
-		EffectivePerson currentPerson = this.effectivePerson(request);
-		Wi wrapIn = null;
-		Boolean check = true;
-
-		if (check) {
-			try {
-				wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-			} catch (Exception e) {
-				wrapIn = new Wi();
-			}
-		}
-		if (check) {
-			if( !"xadmin".equalsIgnoreCase( currentPerson.getName() )) {
-				try {
-					if (!okrUserInfoService.getIsOkrManager(currentPerson.getDistinguishedName())) {
-						check = false;
-						Exception exception = new ExceptionInsufficientPermissions(currentPerson.getDistinguishedName(),
-								ThisApplication.OKRMANAGER);
-						result.error(exception);
-					}
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ExceptionOkrSystemAdminCheck(e, currentPerson.getDistinguishedName());
-					result.error(exception);
-					logger.error(e, currentPerson, request, null);
-				}
-			}
-		}
-
-		if (check) {
-			if ( StringUtils.isNotEmpty( wrapIn.getIdentity()) ) {
-				equalsMap.put("identity", wrapIn.getIdentity());
-			}
-		}
-
-		if (check) {
-			sequenceField = wrapIn.getSequenceField();
-			try {
-				result = this.standardListNext(Wo.copier, id, count, sequenceField, equalsMap, notEqualsMap, likesMap,
-						insMap, notInsMap, membersMap, notMembersMap, null, false, wrapIn.getOrder());
-			} catch (Exception e) {
-				result.error(e);
-				logger.error(e, currentPerson, request, null);
-			}
-		}
-		return result;
-	}
-
-	public static class Wi {
-
-		@FieldDescribe("用于查询身份名称.")
-		private String identity = null;
-
-		@FieldDescribe("用于列表排序的属性.")
-		private String sequenceField =  JpaObject.sequence_FIELDNAME;
-
-		@FieldDescribe("用于列表排序的方式.")
-		private String order = "DESC";
-
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getSequenceField() {
-			return sequenceField;
-		}
-
-		public void setSequenceField(String sequenceField) {
-			this.sequenceField = sequenceField;
-		}
-
-		public String getOrder() {
-			return order;
-		}
-
-		public void setOrder(String order) {
-			this.order = order;
-		}
-
-		public String getIdentity() {
-			return identity;
-		}
-
-		public void setIdentity(String identity) {
-			this.identity = identity;
-		}
-
-	}
-
-	public static class Wo extends OkrErrorSystemIdentityInfo {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		public static WrapCopier<OkrErrorSystemIdentityInfo, Wo> copier = WrapCopierFactory
-				.wo(OkrErrorSystemIdentityInfo.class, Wo.class, null, Wo.Excludes);
-
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-	}
-}

+ 0 - 156
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionGetErrorRecords.java

@@ -1,156 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.reflect.TypeToken;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.gson.XGsonBuilder;
-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.okr.assemble.control.ThisApplication;
-import com.x.okr.assemble.control.jaxrs.identity.entity.ErrorIdentityRecord;
-import com.x.okr.assemble.control.jaxrs.identity.exception.ExceptionFilterIdentityEmpty;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.exception.ExceptionInsufficientPermissions;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.exception.ExceptionOkrSystemAdminCheck;
-import com.x.okr.entity.OkrErrorIdentityRecords;
-
-public class ActionGetErrorRecords extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionGetErrorRecords.class );
-	
-	@SuppressWarnings("unchecked")
-	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		OkrErrorIdentityRecords errorIdentityRecords = new OkrErrorIdentityRecords();
-		String identity = null;
-		String content = null;
-		List<Wo> errorRecordsList = null;
-		Wi wrapIn = null;
-		Boolean check = true;
-
-		if (check) {
-			try {
-				wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-			} catch (Exception e) {
-				wrapIn = new Wi();
-			}
-		}
-		if (check) {
-			try {
-				if ( !okrUserInfoService.getIsOkrManager( effectivePerson.getDistinguishedName() ) ) {
-					check = false;
-					Exception exception = new ExceptionInsufficientPermissions(effectivePerson.getDistinguishedName(),
-							ThisApplication.OKRMANAGER);
-					result.error(exception);
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ExceptionOkrSystemAdminCheck(e, effectivePerson.getDistinguishedName());
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		if (check) {
-			identity = wrapIn.getIdentity();
-			if (identity == null || identity.isEmpty()) {
-				check = false;
-				Exception exception = new ExceptionFilterIdentityEmpty();
-				result.error(exception);
-			}
-		}
-		if (check) {
-			try {
-				errorIdentityRecords = okrSystemIdentityQueryService.getErrorIdentityRecords(identity);
-				if (errorIdentityRecords != null) {
-					content = errorIdentityRecords.getRecordsJson();
-				} else {
-					content = "{}";
-				}
-				if (content != null && !"{}".equals(content)) {
-					Gson gson = XGsonBuilder.instance();
-					errorRecordsList = (List<Wo>) gson.fromJson(content, new TypeToken<List<Wo>>() { }.getType());
-				}
-				result.setData(errorRecordsList);
-			} catch (Exception e) {
-				result.error(e);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-		return result;
-	}
-	
-	public static class Wi {
-		
-		@FieldDescribe( "用于查询身份名称." )
-		private String identity  = null;
-		
-		@FieldDescribe( "用于列表排序的属性." )
-		private String sequenceField =  JpaObject.sequence_FIELDNAME;
-		
-		@FieldDescribe( "用于列表排序的方式." )
-		private String order = "DESC";
-		
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-		public String getSequenceField() {
-			return sequenceField;
-		}
-		public void setSequenceField(String sequenceField) {
-			this.sequenceField = sequenceField;
-		}
-		public String getOrder() {
-			return order;
-		}
-		public void setOrder(String order) {
-			this.order = order;
-		}
-		public String getIdentity() {
-			return identity;
-		}
-		public void setIdentity(String identity) {
-			this.identity = identity;
-		}
-		
-	}
-	
-	public static class Wo {
-		
-		private String identity = null;
-		
-		private String recordType = "未知类别";
-		
-		private List<ErrorIdentityRecord> errorRecords = null;
-		
-		public String getIdentity() {
-			return identity;
-		}
-		public String getRecordType() {
-			return recordType;
-		}
-		public List<ErrorIdentityRecord> getErrorRecords() {
-			return errorRecords;
-		}
-		public void setIdentity(String identity) {
-			this.identity = identity;
-		}
-		public void setRecordType(String recordType) {
-			this.recordType = recordType;
-		}
-		public void setErrorRecords(List<ErrorIdentityRecord> errorRecords) {
-			this.errorRecords = errorRecords;
-		}
-	}
-}

+ 0 - 156
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionGetOkrErrorIdentityRecords.java

@@ -1,156 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-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.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.EqualsTerms;
-import com.x.base.core.project.jaxrs.InTerms;
-import com.x.base.core.project.jaxrs.LikeTerms;
-import com.x.base.core.project.jaxrs.MemberTerms;
-import com.x.base.core.project.jaxrs.NotEqualsTerms;
-import com.x.base.core.project.jaxrs.NotInTerms;
-import com.x.base.core.project.jaxrs.NotMemberTerms;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.control.ThisApplication;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.exception.ExceptionInsufficientPermissions;
-import com.x.okr.assemble.control.jaxrs.okrcenterworkinfo.exception.ExceptionOkrSystemAdminCheck;
-import com.x.okr.entity.OkrErrorSystemIdentityInfo;
-
-public class ActionGetOkrErrorIdentityRecords extends BaseAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionGetOkrErrorIdentityRecords.class);
-
-	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id,
-			Integer count, JsonElement jsonElement) throws Exception {
-		ActionResult<List<Wo>> result = new ActionResult<>();
-		String sequenceField = null;
-		EqualsTerms equalsMap = new EqualsTerms();
-		NotEqualsTerms notEqualsMap = new NotEqualsTerms();
-		InTerms insMap = new InTerms();
-		NotInTerms notInsMap = new NotInTerms();
-		MemberTerms membersMap = new MemberTerms();
-		NotMemberTerms notMembersMap = new NotMemberTerms();
-		LikeTerms likesMap = new LikeTerms();
-		EffectivePerson currentPerson = this.effectivePerson(request);
-		Wi wrapIn = null;
-		Boolean check = true;
-
-		if (check) {
-			try {
-				wrapIn = this.convertToWrapIn(jsonElement, Wi.class);
-			} catch (Exception e) {
-				wrapIn = new Wi();
-			}
-		}
-		if (check) {
-			try {
-				if (!okrUserInfoService.getIsOkrManager(currentPerson.getDistinguishedName())) {
-					check = false;
-					Exception exception = new ExceptionInsufficientPermissions(currentPerson.getDistinguishedName(),
-							ThisApplication.OKRMANAGER);
-					result.error(exception);
-				}
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ExceptionOkrSystemAdminCheck(e, currentPerson.getDistinguishedName());
-				result.error(exception);
-				logger.error(e, currentPerson, request, null);
-			}
-		}
-
-		if (check) {
-			if (wrapIn.getIdentity() != null && !wrapIn.getIdentity().isEmpty()) {
-				equalsMap.put("identity", wrapIn.getIdentity());
-			}
-		}
-
-		if (check) {
-			sequenceField = wrapIn.getSequenceField();
-			try {
-				result = this.standardListNext(Wo.copier, id, count, sequenceField, equalsMap, notEqualsMap, likesMap,
-						insMap, notInsMap, membersMap, notMembersMap, null, false, wrapIn.getOrder());
-			} catch (Exception e) {
-				result.error(e);
-				logger.error(e, currentPerson, request, null);
-			}
-		}
-		return result;
-	}
-
-	public static class Wi {
-
-		@FieldDescribe("用于查询身份名称.")
-		private String identity = null;
-
-		@FieldDescribe("用于列表排序的属性.")
-		private String sequenceField =  JpaObject.sequence_FIELDNAME;
-
-		@FieldDescribe("用于列表排序的方式.")
-		private String order = "DESC";
-
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getSequenceField() {
-			return sequenceField;
-		}
-
-		public void setSequenceField(String sequenceField) {
-			this.sequenceField = sequenceField;
-		}
-
-		public String getOrder() {
-			return order;
-		}
-
-		public void setOrder(String order) {
-			this.order = order;
-		}
-
-		public String getIdentity() {
-			return identity;
-		}
-
-		public void setIdentity(String identity) {
-			this.identity = identity;
-		}
-
-	}
-
-	public static class Wo extends OkrErrorSystemIdentityInfo {
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		public static WrapCopier<OkrErrorSystemIdentityInfo, Wo> copier = WrapCopierFactory
-				.wo(OkrErrorSystemIdentityInfo.class, Wo.class, null, Wo.Excludes);
-
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-	}
-}

+ 0 - 36
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionReplaceOrganWithCheckTable.java

@@ -1,36 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.WrapOutString;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.control.service.update.UpdateOldUnitToNewUnit;
-
-/**
- * 根据对照表,替换相关的记录中的人员、身份、组织信息
- *
- */
-public class ActionReplaceOrganWithCheckTable extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionReplaceOrganWithCheckTable.class );
-	
-	protected ActionResult<WrapOutString> execute( HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<WrapOutString> result = new ActionResult<>();
-		try {
-			WrapOutString wrapOutString = new WrapOutString();
-			UpdateOldUnitToNewUnit updateOldUnitToNewUnit = new UpdateOldUnitToNewUnit();
-			updateOldUnitToNewUnit.processReplace();
-			result.setData(wrapOutString);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			result.error(e);
-			logger.warn("system check identity got an exception.");
-			logger.error(e, effectivePerson, request, null);
-		}
-		return result;
-	}
-	
-}

+ 0 - 32
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/ActionTestReplace.java

@@ -1,32 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.WrapOutString;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.okr.assemble.control.service.update.UpdateOldUnitToNewUnit;
-
-public class ActionTestReplace extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionTestReplace.class );
-	
-	protected ActionResult<WrapOutString> execute( HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<WrapOutString> result = new ActionResult<>();
-		try {
-			WrapOutString wrapOutString = new WrapOutString();
-			UpdateOldUnitToNewUnit updateOldUnitToNewUnit = new UpdateOldUnitToNewUnit();
-			updateOldUnitToNewUnit.processReplace();
-			result.setData(wrapOutString);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			result.error(e);
-			logger.warn("system check identity got an exception.");
-			logger.error(e, effectivePerson, request, null);
-		}
-		return result;
-	}
-	
-}

+ 0 - 15
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/BaseAction.java

@@ -1,15 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.okr.assemble.control.service.OkrSystemIdentityOperatorService;
-import com.x.okr.assemble.control.service.OkrSystemIdentityQueryService;
-import com.x.okr.assemble.control.service.OkrUserInfoService;
-import com.x.okr.assemble.control.service.OkrUserManagerService;
-
-public class BaseAction extends StandardJaxrsAction {
-	
-	protected OkrSystemIdentityOperatorService okrSystemIdentityOperatorService = new OkrSystemIdentityOperatorService();
-	protected OkrSystemIdentityQueryService okrSystemIdentityQueryService = new OkrSystemIdentityQueryService();
-	protected OkrUserManagerService userManagerService = new OkrUserManagerService();
-	protected OkrUserInfoService okrUserInfoService = new OkrUserInfoService();
-}

+ 0 - 150
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/OkrSystemErrorIdentityProcessAction.java

@@ -1,150 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-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 javax.ws.rs.core.Response;
-
-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.http.WrapOutString;
-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("error/identity")
-@JaxrsDescribe("工作管理系统数据身份检查服务")
-public class OkrSystemErrorIdentityProcessAction extends StandardJaxrsAction {
-	private static Logger logger = LoggerFactory.getLogger(OkrSystemErrorIdentityProcessAction.class);
-
-	@JaxrsMethodDescribe(value = "对系统中的所有数据信息进行身份检查", action = ActionCheck.class)
-	@GET
-	@Path("check")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void check(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<WrapOutString> result = new ActionResult<>();
-		try {
-			result = new ActionCheck().execute(request, effectivePerson);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统对系统中的所有数据信息进行身份检查过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "Test对所有数据的人员姓名,身份以及组织名称进行替换", action = ActionReplaceOrganWithCheckTable.class)
-	@GET
-	@Path("test_replace")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void testReplaceAll(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<WrapOutString> result = new ActionResult<>();
-		try {
-			result = new ActionReplaceOrganWithCheckTable().execute(request, effectivePerson);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统对系统中的所有数据信息进行身份检查过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "根据要求将为指定的数据替换身份信息", action = ActionChangeIdentity.class)
-	@PUT
-	@Path("change")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void changeIdentity(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			JsonElement jsonElement) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<WrapOutString> result = new ActionResult<>();
-		try {
-			result = new ActionChangeIdentity().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统根据要求将为指定的数据替换身份信息过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "根据条件分页查询有问题的身份信息", action = ActionErrorInfoFilterListNextWithFilter.class)
-	@PUT
-	@Path("filter/list/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void errorInfoFilterListNextWithFilter(@Suspended final AsyncResponse asyncResponse,
-			@Context HttpServletRequest request, @JaxrsParameterDescribe("上一页最后一条信息的ID") @PathParam("id") String id,
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam("count") Integer count, JsonElement jsonElement) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<List<ActionErrorInfoFilterListNextWithFilter.Wo>> result = new ActionResult<>();
-		try {
-			result = new ActionErrorInfoFilterListNextWithFilter().execute(request, effectivePerson, id, count,
-					jsonElement);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统根据条件分页查询有问题的身份信息过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "根据条件查询身份有问题的工作管理数据信息", action = ActionGetErrorRecords.class)
-	@PUT
-	@Path("detail")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getErrorRecords(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			JsonElement jsonElement) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<List<ActionGetErrorRecords.Wo>> result = new ActionResult<>();
-		try {
-			result = new ActionGetErrorRecords().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统根据条件查询身份有问题的工作管理数据信息过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "根据条件分页查询身份有问题工作管理数据信息", action = ActionGetOkrErrorIdentityRecords.class)
-	@PUT
-	@Path("errorrecords/filter/list/{id}/next/{count}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getOkrErrorIdentityRecords(@Suspended final AsyncResponse asyncResponse,
-			@Context HttpServletRequest request, @JaxrsParameterDescribe("上一页最后一条信息的ID") @PathParam("id") String id,
-			@JaxrsParameterDescribe("每页显示的条目数量") @PathParam("count") Integer count, JsonElement jsonElement) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<List<ActionGetOkrErrorIdentityRecords.Wo>> result = new ActionResult<>();
-		try {
-			result = new ActionGetOkrErrorIdentityRecords().execute(request, effectivePerson, id, count, jsonElement);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统根据条件分页查询身份有问题工作管理数据信息过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 0 - 58
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/entity/ErrorIdentityRecord.java

@@ -1,58 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.entity;
-
-import java.util.Date;
-
-public class ErrorIdentityRecord {
-	private String id = null;
-	private String identity = null;
-	private String tableName = null;
-	private String title = null;
-	private Date createTime = null;	
-	
-	public ErrorIdentityRecord() {
-		super();
-	}
-
-	public ErrorIdentityRecord(String id, String identity, String tableName, String title, Date createTime) {
-		super();
-		this.id = id;
-		this.identity = identity;
-		this.tableName = tableName;
-		this.title = title;
-		this.createTime = createTime;
-	}
-	
-	public String getId() {
-		return id;
-	}
-	public String getIdentity() {
-		return identity;
-	}
-	public String getTitle() {
-		return title;
-	}
-	public Date getCreateTime() {
-		return createTime;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public void setIdentity(String identity) {
-		this.identity = identity;
-	}
-	public void setTitle(String title) {
-		this.title = title;
-	}
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	public String getTableName() {
-		return tableName;
-	}
-
-	public void setTableName(String tableName) {
-		this.tableName = tableName;
-	}
-	
-}

+ 0 - 28
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/entity/ErrorIdentityRecords.java

@@ -1,28 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.entity;
-
-import java.util.List;
-
-public class ErrorIdentityRecords {
-	private String identity = null;
-	private String recordType = "未知类别";
-	private List<ErrorIdentityRecord> errorRecords = null;
-	
-	public String getIdentity() {
-		return identity;
-	}
-	public String getRecordType() {
-		return recordType;
-	}
-	public List<ErrorIdentityRecord> getErrorRecords() {
-		return errorRecords;
-	}
-	public void setIdentity(String identity) {
-		this.identity = identity;
-	}
-	public void setRecordType(String recordType) {
-		this.recordType = recordType;
-	}
-	public void setErrorRecords(List<ErrorIdentityRecord> errorRecords) {
-		this.errorRecords = errorRecords;
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionFilterIdentityEmpty.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionFilterIdentityEmpty extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionFilterIdentityEmpty() {
-		super("进行查询的身份名称为空,无法继续进行查询操作。");
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionIdentityCheck.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionIdentityCheck extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionIdentityCheck( Throwable e, String identity ) {
-		super("身份信息检查时发生异常。identity:" + identity, e );
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionNewIdentityEmpty.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionNewIdentityEmpty extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionNewIdentityEmpty() {
-		super("旧的身份名称为空,无法继续进行身份替换操作。");
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionNewIdentityNotExists.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionNewIdentityNotExists extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionNewIdentityNotExists( String identity ) {
-		super("用户身份不存在。identity:" + identity );
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionOldIdentityEmpty.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionOldIdentityEmpty extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionOldIdentityEmpty() {
-		super("旧的身份名称为空,无法继续进行身份替换操作。");
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionRecordIdEmpty.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionRecordIdEmpty extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionRecordIdEmpty() {
-		super("需要替换的记录ID为空,无法继续进行身份替换操作。");
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionRecordTypeEmpty.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionRecordTypeEmpty extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionRecordTypeEmpty() {
-		super("需要替换的数据类别为空,无法继续进行身份替换操作。");
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/identity/exception/ExceptionTableNameEmpty.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.identity.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionTableNameEmpty extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionTableNameEmpty() {
-		super("需要替换的数据表名为空,无法继续进行身份替换操作。");
-	}
-}

+ 0 - 27
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/ActionGetLoginUser.java

@@ -1,27 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.okr.assemble.control.OkrUserCache;
-
-public class ActionGetLoginUser extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionGetLoginUser.class );
-	
-	protected ActionResult<OkrUserCache> execute( HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
-		ActionResult<OkrUserCache> result = new ActionResult<>();
-		OkrUserCache okrUserCache = null;
-		try {
-			okrUserCache = okrUserInfoService.getOkrUserCacheWithPersonName(effectivePerson.getDistinguishedName());
-			result.setData( okrUserCache );
-		} catch (Exception e) {
-			logger.warn( "获取登入用户信息时发生异常。" );
-			logger.error( e, effectivePerson, request, null);
-		}
-		return result;
-	}
-}

+ 0 - 155
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/ActionLogin.java

@@ -1,155 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login;
-
-import java.io.Serializable;
-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.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.okr.assemble.control.OkrUserCache;
-import com.x.okr.assemble.control.jaxrs.login.exception.ExceptionGetOkrUserCache;
-import com.x.okr.assemble.control.jaxrs.login.exception.ExceptionUserHasNoProxyIdentity;
-import com.x.okr.assemble.control.jaxrs.login.exception.ExceptionUserIdentityQuery;
-import com.x.okr.assemble.control.jaxrs.login.exception.ExceptionUserProxyQuery;
-
-public class ActionLogin extends BaseAction {
-
-	private static  Logger logger = LoggerFactory.getLogger( ActionLogin.class );
-	
-	protected ActionResult<OkrUserCache> execute( HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<OkrUserCache> result = new ActionResult<>();
-		List<String> ids = null;
-		String identity = null;
-		OkrUserCache okrUserCache = null;
-		boolean hasIdentity = false;
-		Wi wrapIn = null;
-		Boolean check = true;
-
-		if (check) {
-			try {//获取传入的参数,主要是loginIdentity(登录身份)
-				wrapIn = this.convertToWrapIn( jsonElement, Wi.class);
-			} catch (Exception e) {
-				wrapIn = new Wi();
-			}
-		}
-		
-		if (wrapIn != null) {
-			if ( StringUtils.isNotEmpty(wrapIn.getLoginIdentity()) ) {
-				try { //查询用户是否拥有传入的身份名称
-					hasIdentity = okrUserManagerService.hasIdentity( effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity() );
-				} catch (Exception e) {
-					check = false;
-					Exception exception = new ExceptionUserProxyQuery(e, effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity() );
-					result.error( exception );
-					logger.error( e, effectivePerson, request, null);
-				}
-				if ( hasIdentity ) {//用户拥有传入的身份, 以指定的身份登录
-					try {
-						okrUserCache = setUserLoginIdentity( request, effectivePerson, wrapIn.getLoginIdentity() );
-						result.setData(okrUserCache);
-					} catch (Exception e) {
-						Exception exception = new ExceptionGetOkrUserCache(e, effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity());
-						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
-					}
-				} else {// 用户自己没有传入的身份,查询用户是否有该身份的代理配置(秘书)
-					try {
-						ids = okrConfigSecretaryService.listIdsByLeaderIdentity(effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity());
-						if (ListTools.isEmpty(ids)) {//用户没有指定身份的代理权限,无法登录系统							
-							//以用户自己的主要身份进行登录
-							identity = okrUserManagerService.getIdentityWithPerson( effectivePerson.getDistinguishedName() );
-							if( StringUtils.isNotEmpty( identity )) {
-								System.out.println( "用户使用身份:" + identity + " 登录系统......" );
-								try {
-									okrUserCache = setUserLoginIdentity( request, effectivePerson, identity );
-									result.setData(okrUserCache);
-								} catch (Exception e) {
-									check = false;
-									Exception exception = new ExceptionGetOkrUserCache(e, effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity());
-									result.error(exception);
-									logger.error(e, effectivePerson, request, null);
-								}
-							}else {
-								check = false;
-								Exception exception = new ExceptionUserHasNoProxyIdentity( effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity());
-								result.error(exception);
-							}							
-						} else {// 顺利查询到身份代理配置信息,向cache里新增用户相关信息
-							okrUserCache = setUserLoginIdentity(request, effectivePerson, wrapIn.getLoginIdentity());
-							result.setData(okrUserCache);
-						}
-					} catch (Exception e) {
-						check = false;
-						Exception exception = new ExceptionUserProxyQuery(e, effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity());
-						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
-					}
-				}
-			} else { // 没有传入身份,即以自己的第一个身份登入系统
-				if (!"xadmin".equals( effectivePerson.getDistinguishedName().toLowerCase()) ) {//查询是不是xadmin用户,如果不是xadmin,则查询自己的第一个身份
-					try {
-						identity = okrUserManagerService.getIdentityWithPerson( effectivePerson.getDistinguishedName() );
-						if (identity != null && !identity.isEmpty()) {
-							System.out.println( "用户使用身份:" + identity + " 登录系统......" );
-							okrUserCache = setUserLoginIdentity( request, effectivePerson, identity );
-						}
-					} catch (Exception e) {
-						check = false;
-						Exception exception = new ExceptionUserIdentityQuery(e, effectivePerson.getDistinguishedName());
-						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
-					}
-				} else {
-					try {
-						okrUserCache = setUserXadmin(request, effectivePerson);
-					} catch (Exception e) {
-						Exception exception = new ExceptionGetOkrUserCache(e, effectivePerson.getDistinguishedName(), wrapIn.getLoginIdentity());
-						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
-					}
-				}
-				result.setData( okrUserCache );
-			}
-			
-			if( check &&  okrUserCache!= null ) {//判断是否拥有工作管理权限
-				if( effectivePerson.isManager() ) {
-					okrUserCache.setOkrManager( true );
-				}
-				if(okrUserManagerService.isHasPlatformRole(okrUserCache.getLoginUserName(), "OKRManager")) {
-					okrUserCache.setOkrManager( true );
-				}
-				if(okrUserManagerService.isOkrWorkManager(okrUserCache.getLoginIdentityName())) {
-					okrUserCache.setOkrManager( true );
-				}
-			}
-		} else {
-			check = false;
-			result.error(new Exception("请求传入的参数'wrapIn'为空,无法继续登录应用!"));
-		}
-		
-		return result;
-	}
-	
-	public static class Wi extends GsonPropertyObject implements Serializable{
-		private static final long serialVersionUID = -5076990764713538973L;
-		
-		@FieldDescribe( "登录身份名称" )
-		private String loginIdentity = null;
-		public String getLoginIdentity() {
-			return loginIdentity;
-		}
-		public void setLoginIdentity(String loginIdentity) {
-			this.loginIdentity = loginIdentity;
-		}
-	}
-
-}

+ 0 - 38
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/ActionLogout.java

@@ -1,38 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login;
-
-import java.io.Serializable;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gson.JsonElement;
-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.okr.assemble.control.OkrUserCache;
-
-public class ActionLogout extends BaseAction {
-	
-	protected ActionResult<OkrUserCache> execute( HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement ) throws Exception {
-		ActionResult<OkrUserCache> result = new ActionResult<>();
-		@SuppressWarnings("unused")
-		Boolean check = true;
-
-		return result;
-	}
-	
-	public static class Wi extends GsonPropertyObject implements Serializable{
-
-		private static final long serialVersionUID = -5076990764713538973L;
-
-		private String loginIdentity = null;
-
-		public String getLoginIdentity() {
-			return loginIdentity;
-		}
-
-		public void setLoginIdentity(String loginIdentity) {
-			this.loginIdentity = loginIdentity;
-		}
-	}
-
-}

+ 0 - 110
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/BaseAction.java

@@ -1,110 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.gson.Gson;
-import com.x.base.core.project.cache.ApplicationCache;
-import com.x.base.core.project.gson.XGsonBuilder;
-import com.x.base.core.project.http.EffectivePerson;
-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.okr.assemble.control.OkrUserCache;
-import com.x.okr.assemble.control.ThisApplication;
-import com.x.okr.assemble.control.service.OkrConfigSecretaryService;
-import com.x.okr.assemble.control.service.OkrUserInfoService;
-import com.x.okr.assemble.control.service.OkrUserManagerService;
-import com.x.okr.entity.OkrUserInfo;
-
-import net.sf.ehcache.Ehcache;
-
-public class BaseAction extends StandardJaxrsAction {
-	
-	private static  Logger logger = LoggerFactory.getLogger( BaseAction.class );	
-	protected OkrConfigSecretaryService okrConfigSecretaryService = new OkrConfigSecretaryService();	
-	protected OkrUserManagerService okrUserManagerService = new OkrUserManagerService();	
-	protected OkrUserInfoService okrUserInfoService = new OkrUserInfoService();
-	protected Ehcache cache = ApplicationCache.instance().getCache( OkrUserInfo.class);
-	
-	/**
-	 * 设置用户登录的代理身份,记录到数据库中并且清空相应的缓存对象
-	 * 
-	 * @param name
-	 * @throws Exception
-	 */
-	public OkrUserCache setUserLoginIdentity(HttpServletRequest request, EffectivePerson currentPerson, String identity)throws Exception {
-		Gson gson = XGsonBuilder.instance();
-		String customContent = null;
-		Boolean isOkrSystemAdmin = false;
-		OkrUserCache okrUserCache = new OkrUserCache();
-		okrUserCache.setLoginIdentityName(identity);
-		
-		// 查询name的第一个身份所属的组织和顶层组织
-		okrUserCache.setOperationUserName( currentPerson.getDistinguishedName() );
-		okrUserCache.setOperationUserUnitName( okrUserManagerService.getUnitNameWithPerson(currentPerson.getDistinguishedName()));
-		okrUserCache.setOperationUserTopUnitName( okrUserManagerService.getTopUnitNameWithPerson(currentPerson.getDistinguishedName()));
-		
-		// 查询identity所属的组织和顶层组织
-		String personName = okrUserManagerService.getPersonNameByIdentity( identity );
-		okrUserCache.setLoginUserName( personName );
-		okrUserCache.setLoginUserUnitName( okrUserManagerService.getUnitNameByIdentity(identity) );
-		okrUserCache.setLoginUserTopUnitName( okrUserManagerService.getTopUnitNameByIdentity(identity) );
-		try {
-			//查询用户是否OKR系统管理员
-			if( StringUtils.isNotEmpty( okrUserCache.getLoginUserName() )) {
-				isOkrSystemAdmin = okrUserManagerService.isHasPlatformRole( okrUserCache.getLoginUserName(), ThisApplication.OKRMANAGER );
-			}else {
-				isOkrSystemAdmin = okrUserManagerService.isHasPlatformRole( currentPerson.getDistinguishedName(), ThisApplication.OKRMANAGER );
-			}
-		} catch (Exception e) {
-			logger.error(e, currentPerson, request, null);
-		}
-		okrUserCache.setOkrManager( isOkrSystemAdmin );
-
-		//将数据存储到数据库里备用
-		customContent = gson.toJson( okrUserCache, OkrUserCache.class );
-		
-		OkrUserInfo userInfo = new OkrUserInfo();
-		userInfo.setUserName( currentPerson.getDistinguishedName() );
-		userInfo.setCustomContent( customContent );
-		okrUserInfoService.save( userInfo );
-		
-		String cacheKey = ThisApplication.getOkrUserInfoCacheKey( currentPerson.getDistinguishedName() );
-		ApplicationCache.notify( OkrUserInfo.class, cacheKey );
-		return okrUserCache;
-	}
-
-	/**
-	 * 设置用户登录的代理身份
-	 * 
-	 * @param name
-	 * @throws Exception
-	 */
-	public OkrUserCache setUserXadmin(HttpServletRequest request, EffectivePerson currentPerson) throws Exception {
-		Gson gson = XGsonBuilder.instance();
-		String customContent = null;
-		OkrUserCache okrUserCache = new OkrUserCache();
-		okrUserCache.setLoginIdentityName("xadmin");
-		// 查询name的第一个身份所属的组织和顶层组织
-		okrUserCache.setOperationUserName("xadmin");
-		okrUserCache.setOperationUserUnitName("xadmin");
-		okrUserCache.setOperationUserTopUnitName("xadmin");
-		okrUserCache.setLoginUserName("xadmin");
-		okrUserCache.setLoginUserUnitName("xadmin");
-		okrUserCache.setLoginUserTopUnitName("xadmin");
-		okrUserCache.setOkrManager(true);
-
-		customContent = gson.toJson(okrUserCache, OkrUserCache.class);
-		OkrUserInfo userInfo = new OkrUserInfo();
-		userInfo.setUserName("xadmin");
-		userInfo.setCustomContent( customContent );
-		okrUserInfoService.save(userInfo);
-		
-		String cacheKey = ThisApplication.getOkrUserInfoCacheKey( currentPerson.getDistinguishedName() );
-		ApplicationCache.notify( OkrUserInfo.class, cacheKey );
-		
-		return okrUserCache;
-	}
-}

+ 0 - 69
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/OkrLoginAction.java

@@ -1,69 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-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 javax.ws.rs.core.Response;
-
-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.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.okr.assemble.control.OkrUserCache;
-
-@Path("login")
-@JaxrsDescribe("工作管理系统登入服务")
-public class OkrLoginAction extends StandardJaxrsAction {
-	private static Logger logger = LoggerFactory.getLogger(OkrLoginAction.class);
-
-	@JaxrsMethodDescribe(value = "用户进入系统,获取并且缓存用户身份信息", action = ActionLogin.class)
-	@POST
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void login(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			JsonElement jsonElement) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<OkrUserCache> result = new ActionResult<>();
-
-		try {
-			result = new ActionLogin().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统用户登入过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "获取用户身份信息", action = ActionGetLoginUser.class)
-	@GET
-	@Path("user/get")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getLoginUserInfo(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<OkrUserCache> result = new ActionResult<>();
-		try {
-			result = new ActionGetLoginUser().execute(request, effectivePerson);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("获取用户身份信息过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-}

+ 0 - 50
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/OkrLogoutAction.java

@@ -1,50 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-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 javax.ws.rs.core.Response;
-
-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.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.okr.assemble.control.OkrUserCache;
-
-@Path("logout")
-@JaxrsDescribe("工作管理系统登出服务")
-public class OkrLogoutAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionLogin.class);
-
-	@JaxrsMethodDescribe(value = "用户登出,删除已经缓存的用户身份信息", action = ActionLogout.class)
-	@POST
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void logout(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			JsonElement jsonElement) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<OkrUserCache> result = new ActionResult<>();
-
-		try {
-			result = new ActionLogout().execute(request, effectivePerson, jsonElement);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.warn("系统用户登出过程发生异常。");
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 0 - 16
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionGetOkrUserCache.java

@@ -1,16 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionGetOkrUserCache extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionGetOkrUserCache( Throwable e, String userName, String proxyIdentity ) {
-		super("根据员工和代理员工姓名获取OKR系统登录信息对象时发生异常.!用户:'" + userName +"',代理者身份:'"+ proxyIdentity +"'.", e );
-	}
-	
-	public ExceptionGetOkrUserCache( Throwable e, String userName ) {
-		super("根据员工姓名获取OKR系统登录信息对象时发生异常!用户:'" + userName +"'.", e );
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionOkrSystemAdminCheck.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionOkrSystemAdminCheck extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionOkrSystemAdminCheck( Throwable e, String userName ) {
-		super("系统在判断用户是否是OKR系统管理员时发生异常.Name:" + userName, e );
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionUserHasNoProxyIdentity.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionUserHasNoProxyIdentity extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionUserHasNoProxyIdentity( String userName, String proxyIdentity ) {
-		super("用户'" + userName +"'没有用户'"+ proxyIdentity +"'的代理身份,无法继续登录应用." );
-	}
-}

+ 0 - 16
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionUserIdentityQuery.java

@@ -1,16 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionUserIdentityQuery extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionUserIdentityQuery( Throwable e, String userName ) {
-		super("根据员工获取员工默认身份信息时发生异常.!用户:'" + userName +"'", e );
-	}
-	
-	public ExceptionUserIdentityQuery( Throwable e, String userName, String proxyIdentity ) {
-		super("根据员工和代理员工姓名查询秘书配置信息时发生异常.!用户:'" + userName +"',代理者身份:'"+ proxyIdentity +"'.", e );
-	}
-}

+ 0 - 12
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/login/exception/ExceptionUserProxyQuery.java

@@ -1,12 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.login.exception;
-
-import com.x.base.core.project.exception.PromptException;
-
-public class ExceptionUserProxyQuery extends PromptException {
-
-	private static final long serialVersionUID = 1859164370743532895L;
-
-	public ExceptionUserProxyQuery( Throwable e, String userName, String proxyIdentity ) {
-		super("根据员工和代理员工姓名查询秘书配置信息时发生异常.!用户:'" + userName +"',代理者身份:'"+ proxyIdentity +"'.", e );
-	}
-}

+ 0 - 827
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/mind/ActionListMindForCenterId.java

@@ -1,827 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.mind;
-
-import java.util.ArrayList;
-import java.util.Date;
-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.SortTools;
-import com.x.okr.assemble.control.OkrUserCache;
-import com.x.okr.assemble.control.jaxrs.mind.exception.ExceptionCenterWorkNotExists;
-import com.x.okr.assemble.control.jaxrs.mind.exception.ExceptionDeployedWorkListAll;
-import com.x.okr.assemble.control.jaxrs.mind.exception.ExceptionGetOkrUserCache;
-import com.x.okr.assemble.control.jaxrs.mind.exception.ExceptionUserNoLogin;
-import com.x.okr.assemble.control.jaxrs.mind.exception.ExceptionViewableWorkList;
-import com.x.okr.entity.OkrCenterWorkInfo;
-import com.x.okr.entity.OkrWorkBaseInfo;
-
-public class ActionListMindForCenterId extends BaseAction {
-	protected WrapCopier<OkrCenterWorkInfo, Wo> okrCenterSimpleInfo_wrapout_copier = WrapCopierFactory
-			.wo(OkrCenterWorkInfo.class, Wo.class, null, JpaObject.FieldsInvisible);
-	private static  Logger logger = LoggerFactory.getLogger(ActionListMindForCenterId.class);
-
-	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String centerId)
-			throws Exception {
-		ActionResult<Wo> result = new ActionResult<Wo>();
-		List<WoOkrWorkBaseSimpleInfo> wrapsWorkBaseInfoList_for_center = new ArrayList<>();
-		List<WoOkrWorkBaseSimpleInfo> viewWorkBaseInfoList = new ArrayList<>();
-		WoOkrWorkBaseSimpleInfo wrapOutOkrWorkBaseSimpleInfo = null;
-		Wo center = null;
-		OkrWorkBaseInfo okrWorkBaseInfo = null;
-		OkrCenterWorkInfo okrCenterWorkInfo = null;
-		OkrUserCache okrUserCache = null;
-		Boolean check = true;
-		List<String> myWorkIds = null;
-		List<String> query_statuses = new ArrayList<String>();
-		query_statuses.add("正常");
-		query_statuses.add("已归档");
-
-		if (check) {
-			try {
-				okrUserCache = okrUserInfoService.getOkrUserCacheWithPersonName(effectivePerson.getDistinguishedName());
-			} catch (Exception e) {
-				check = false;
-				Exception exception = new ExceptionGetOkrUserCache(e, effectivePerson.getDistinguishedName());
-				result.error(exception);
-				logger.error(e, effectivePerson, request, null);
-			}
-		}
-
-		if (check && (okrUserCache == null || okrUserCache.getLoginIdentityName() == null)) {
-			check = false;
-			Exception exception = new ExceptionUserNoLogin(effectivePerson.getDistinguishedName());
-			result.error(exception);
-			// logger.error( e, effectivePerson, request, null);
-		}
-
-		if (check) {// 查询中心工作信息是否存在
-			okrCenterWorkInfo = okrCenterWorkInfoService.get(centerId);
-			if (okrCenterWorkInfo == null) {
-				check = false;
-				Exception exception = new ExceptionCenterWorkNotExists(effectivePerson.getDistinguishedName());
-				result.error(exception);
-				// logger.error( e, effectivePerson, request, null);
-			}
-		}
-
-		if (check) {// 查询中心工作信息是否存在
-			center = new Wo();
-			center.setDefaultCompleteDateLimitStr(okrCenterWorkInfo.getDefaultCompleteDateLimitStr());
-			center.setProcessStatus(okrCenterWorkInfo.getProcessStatus());
-			center.setStatus(okrCenterWorkInfo.getStatus());
-			center.setDefaultWorkType(okrCenterWorkInfo.getDefaultWorkType());
-			center.setDescription(okrCenterWorkInfo.getDescription());
-			center.setId(okrCenterWorkInfo.getId());
-			center.setTitle(okrCenterWorkInfo.getTitle());
-			center.setCreateTime(okrCenterWorkInfo.getCreateTime());
-			center.setWatch(true);
-		}
-
-		if (check) {// 获取用户可以看到的所有具体工作信息(有观察者身份的)
-			if (!okrUserCache.isOkrManager()) {
-				try {
-					myWorkIds = okrWorkPersonService.listDistinctWorkIdsWithMe(okrUserCache.getLoginIdentityName(),
-							centerId);
-				} catch (Exception e) {
-					result.error(e);
-					Exception exception = new ExceptionViewableWorkList(e, okrUserCache.getLoginIdentityName(),
-							centerId);
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			} else {
-				try {
-					myWorkIds = okrWorkBaseInfoService.listAllDeployedWorkIds(centerId, null);
-				} catch (Exception e) {
-					result.error(e);
-					Exception exception = new ExceptionDeployedWorkListAll(e, centerId);
-					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-
-		if (check) {
-			if (myWorkIds != null && !myWorkIds.isEmpty()) {
-				for (String workId : myWorkIds) {
-
-					if (workId != null && !workId.isEmpty()) {
-						okrWorkBaseInfo = okrWorkBaseInfoService.get(workId);
-						wrapOutOkrWorkBaseSimpleInfo = new WoOkrWorkBaseSimpleInfo();
-						wrapOutOkrWorkBaseSimpleInfo.setWatch(true);
-						composeWorkInfo(okrWorkBaseInfo, wrapOutOkrWorkBaseSimpleInfo);
-						if (!workContain(wrapOutOkrWorkBaseSimpleInfo, viewWorkBaseInfoList)) {
-							viewWorkBaseInfoList.add(wrapOutOkrWorkBaseSimpleInfo);
-						}
-						composeParentWork(okrWorkBaseInfo, viewWorkBaseInfoList, myWorkIds);
-					}
-				}
-			}
-		}
-
-		if (check) {
-			for (WoOkrWorkBaseSimpleInfo wrap_work : viewWorkBaseInfoList) {
-				// 判断工作是否有未提交的工作汇报
-				// hasNoneSubmitReport = false;
-				// hasNoneSubmitReport =
-				// okrWorkBaseInfoService.hasNoneSubmitReport(
-				// wrap_work.getId(), "草稿", "草稿", null );
-				// wrap_work.setHasNoneSubmitReport( hasNoneSubmitReport );
-				if (wrap_work.getParentId() == null || wrap_work.getParentId().isEmpty()) {
-					wrap_work = composeSubWork(viewWorkBaseInfoList, wrap_work);
-					wrapsWorkBaseInfoList_for_center.add(wrap_work);
-				}
-			}
-			if (wrapsWorkBaseInfoList_for_center != null && !wrapsWorkBaseInfoList_for_center.isEmpty()) {
-				try {
-					SortTools.asc(wrapsWorkBaseInfoList_for_center, "completeDateLimitStr");
-				} catch (Exception e) {
-					result.error(e);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			if (center != null) {
-				center.setWorks(wrapsWorkBaseInfoList_for_center);
-
-			}
-		}
-		result.setData(center);
-		return result;
-	}
-
-	private void composeParentWork(OkrWorkBaseInfo okrWorkBaseInfo, List<WoOkrWorkBaseSimpleInfo> viewWorkBaseInfoList,
-			List<String> myWorkIds) throws Exception {
-		if (okrWorkBaseInfo == null) {
-			return;
-		}
-		if (myWorkIds == null) {
-			return;
-		}
-		if (viewWorkBaseInfoList == null) {
-			viewWorkBaseInfoList = new ArrayList<WoOkrWorkBaseSimpleInfo>();
-		}
-		if (okrWorkBaseInfo.getParentWorkId() != null && !okrWorkBaseInfo.getParentWorkId().isEmpty()
-				&& !okrWorkBaseInfo.getId().equalsIgnoreCase(okrWorkBaseInfo.getParentWorkId())) {
-			OkrWorkBaseInfo parentWork = null;
-			WoOkrWorkBaseSimpleInfo wrapOutOkrWorkBaseSimpleInfo = null;
-			parentWork = okrWorkBaseInfoService.get(okrWorkBaseInfo.getParentWorkId());
-			if (parentWork != null) {
-				wrapOutOkrWorkBaseSimpleInfo = new WoOkrWorkBaseSimpleInfo();
-				composeWorkInfo(parentWork, wrapOutOkrWorkBaseSimpleInfo);
-				for (String id : myWorkIds) {
-					if (id != null && !id.isEmpty()) {
-						if (parentWork.getId().equalsIgnoreCase(id)) {
-							// 是用户自己可以查看的工作, 用户可以点击开
-							wrapOutOkrWorkBaseSimpleInfo.setWatch(true);
-						}
-					}
-				}
-
-				composeParentWork(parentWork, viewWorkBaseInfoList, myWorkIds);
-
-				if (!workContain(wrapOutOkrWorkBaseSimpleInfo, viewWorkBaseInfoList)) {
-					viewWorkBaseInfoList.add(wrapOutOkrWorkBaseSimpleInfo);
-				}
-			}
-		}
-	}
-
-	private void composeWorkInfo(OkrWorkBaseInfo work, WoOkrWorkBaseSimpleInfo wrapOutOkrWorkBaseSimpleInfo) {
-		if (work == null) {
-			return;
-		}
-		if (wrapOutOkrWorkBaseSimpleInfo == null) {
-			return;
-		}
-		wrapOutOkrWorkBaseSimpleInfo.setId(work.getId());
-		wrapOutOkrWorkBaseSimpleInfo.setTitle(work.getTitle());
-		wrapOutOkrWorkBaseSimpleInfo.setWorkProcessStatus(work.getWorkProcessStatus());
-		wrapOutOkrWorkBaseSimpleInfo.setParentId(work.getParentWorkId());
-		wrapOutOkrWorkBaseSimpleInfo.setIsOverTime(work.getIsOverTime());
-		wrapOutOkrWorkBaseSimpleInfo.setIsCompleted(work.getIsCompleted());
-		wrapOutOkrWorkBaseSimpleInfo.setOverallProgress(work.getOverallProgress());
-		wrapOutOkrWorkBaseSimpleInfo.setWorkType(work.getWorkType());
-		wrapOutOkrWorkBaseSimpleInfo.setCompleteDateLimitStr(work.getCompleteDateLimitStr());
-		wrapOutOkrWorkBaseSimpleInfo.setResponsibilityUnitName(work.getResponsibilityUnitName());
-		wrapOutOkrWorkBaseSimpleInfo.setResponsibilityIdentity(work.getResponsibilityIdentity());
-		wrapOutOkrWorkBaseSimpleInfo.setResponsibilityEmployeeName(work.getResponsibilityEmployeeName());
-		wrapOutOkrWorkBaseSimpleInfo.setCooperateUnitNameList(work.getCooperateUnitNameList());
-		wrapOutOkrWorkBaseSimpleInfo.setCooperateEmployeeNameList(work.getCooperateEmployeeNameList());
-		wrapOutOkrWorkBaseSimpleInfo.setCooperateIdentityList(work.getCooperateIdentityList());
-	}
-
-	private Boolean workContain(WoOkrWorkBaseSimpleInfo wrapOutOkrWorkBaseSimpleInfo,
-			List<WoOkrWorkBaseSimpleInfo> viewWorkBaseInfoList) {
-		if (wrapOutOkrWorkBaseSimpleInfo == null) {
-			return true;
-		}
-		if (viewWorkBaseInfoList == null) {
-			viewWorkBaseInfoList = new ArrayList<WoOkrWorkBaseSimpleInfo>();
-			return false;
-		}
-		for (WoOkrWorkBaseSimpleInfo info : viewWorkBaseInfoList) {
-			if (info.getId().equalsIgnoreCase(wrapOutOkrWorkBaseSimpleInfo.getId())) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	private WoOkrWorkBaseSimpleInfo composeSubWork(List<WoOkrWorkBaseSimpleInfo> viewWorkBaseInfoList,
-			WoOkrWorkBaseSimpleInfo wrap_work) {
-		if (viewWorkBaseInfoList != null && !viewWorkBaseInfoList.isEmpty()) {
-			for (WoOkrWorkBaseSimpleInfo work : viewWorkBaseInfoList) {
-				if (work.getParentId() != null && !work.getParentId().isEmpty()
-						&& work.getParentId().equalsIgnoreCase(wrap_work.getId())) {
-					// 说明该工作是wrap_work的下级工作
-					work = composeSubWork(viewWorkBaseInfoList, work);
-					wrap_work.addNewSubWorkBaseInfo(work);
-				}
-			}
-		}
-		return wrap_work;
-	}
-
-	public static class Wo {
-
-		@FieldDescribe("中心工作ID")
-		private String id = null;
-
-		@FieldDescribe("中心标题")
-		private String title = null;
-
-		@FieldDescribe("部署者姓名")
-		private String deployerName = null;
-
-		@FieldDescribe("部署者身份")
-		private String deployerIdentity = null;
-
-		@FieldDescribe("部署者所属组织")
-		private String deployerUnitName = null;
-
-		@FieldDescribe("部署者所属顶层组织")
-		private String deployerTopUnitName = null;
-
-		@FieldDescribe("审核者姓名")
-		private String auditLeaderName = null;
-
-		@FieldDescribe("审核者身份")
-		private String auditLeaderIdentity = null;
-
-		@FieldDescribe("中心工作处理状态:草稿|待审核|待确认|执行中|已完成|已撤消")
-		private String processStatus = "草稿";
-
-		@FieldDescribe("中心工作默认完成日期-字符串,显示用:yyyy-mm-dd")
-		private String defaultCompleteDateLimitStr = null;
-
-		@FieldDescribe("中心工作默认工作类别")
-		private String defaultWorkType = null;
-
-		@FieldDescribe("中心工作默认工作级别")
-		private String defaultWorkLevel = null;
-
-		@FieldDescribe("中心工作默认阅知领导(可多值,显示用)")
-		private String defaultLeader = null;
-
-		@FieldDescribe("中心工作默认阅知领导身份(可多值,计算组织和顶层组织用)")
-		private String defaultLeaderIdentity = null;
-
-		@FieldDescribe("工作汇报审批领导(可多值,显示用)")
-		private String reportAuditLeaderName = null;
-
-		@FieldDescribe("工作汇报审批领导身份(可多值,计算组织和顶层组织用)")
-		private String reportAuditLeaderIdentity = null;
-
-		@FieldDescribe("中心工作是否需要审核")
-		private Boolean isNeedAudit = false;
-
-		@FieldDescribe("处理状态:正常|已删除")
-		private String status = "正常";
-
-		@FieldDescribe("中心工作描述")
-		private String description = null;
-
-		@FieldDescribe("中心工作创建时间")
-		private Date createTime = null;
-
-		@FieldDescribe("中心工作包括的工作列表")
-		private List<WoOkrWorkBaseSimpleInfo> works = null;
-
-		private Boolean watch = false;
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public String getDeployerName() {
-			return deployerName;
-		}
-
-		public void setDeployerName(String deployerName) {
-			this.deployerName = deployerName;
-		}
-
-		public String getDeployerIdentity() {
-			return deployerIdentity;
-		}
-
-		public void setDeployerIdentity(String deployerIdentity) {
-			this.deployerIdentity = deployerIdentity;
-		}
-
-		public String getDeployerUnitName() {
-			return deployerUnitName;
-		}
-
-		public void setDeployerUnitName(String deployerUnitName) {
-			this.deployerUnitName = deployerUnitName;
-		}
-
-		public String getDeployerTopUnitName() {
-			return deployerTopUnitName;
-		}
-
-		public void setDeployerTopUnitName(String deployerTopUnitName) {
-			this.deployerTopUnitName = deployerTopUnitName;
-		}
-
-		public String getAuditLeaderName() {
-			return auditLeaderName;
-		}
-
-		public void setAuditLeaderName(String auditLeaderName) {
-			this.auditLeaderName = auditLeaderName;
-		}
-
-		public String getAuditLeaderIdentity() {
-			return auditLeaderIdentity;
-		}
-
-		public void setAuditLeaderIdentity(String auditLeaderIdentity) {
-			this.auditLeaderIdentity = auditLeaderIdentity;
-		}
-
-		public String getProcessStatus() {
-			return processStatus;
-		}
-
-		public void setProcessStatus(String processStatus) {
-			this.processStatus = processStatus;
-		}
-
-		public String getDefaultCompleteDateLimitStr() {
-			return defaultCompleteDateLimitStr;
-		}
-
-		public void setDefaultCompleteDateLimitStr(String defaultCompleteDateLimitStr) {
-			this.defaultCompleteDateLimitStr = defaultCompleteDateLimitStr;
-		}
-
-		public String getDefaultWorkType() {
-			return defaultWorkType;
-		}
-
-		public void setDefaultWorkType(String defaultWorkType) {
-			this.defaultWorkType = defaultWorkType;
-		}
-
-		public String getDefaultWorkLevel() {
-			return defaultWorkLevel;
-		}
-
-		public void setDefaultWorkLevel(String defaultWorkLevel) {
-			this.defaultWorkLevel = defaultWorkLevel;
-		}
-
-		public String getDefaultLeader() {
-			return defaultLeader;
-		}
-
-		public void setDefaultLeader(String defaultLeader) {
-			this.defaultLeader = defaultLeader;
-		}
-
-		public String getDefaultLeaderIdentity() {
-			return defaultLeaderIdentity;
-		}
-
-		public void setDefaultLeaderIdentity(String defaultLeaderIdentity) {
-			this.defaultLeaderIdentity = defaultLeaderIdentity;
-		}
-
-		public String getReportAuditLeaderName() {
-			return reportAuditLeaderName;
-		}
-
-		public void setReportAuditLeaderName(String reportAuditLeaderName) {
-			this.reportAuditLeaderName = reportAuditLeaderName;
-		}
-
-		public String getReportAuditLeaderIdentity() {
-			return reportAuditLeaderIdentity;
-		}
-
-		public void setReportAuditLeaderIdentity(String reportAuditLeaderIdentity) {
-			this.reportAuditLeaderIdentity = reportAuditLeaderIdentity;
-		}
-
-		public Boolean getIsNeedAudit() {
-			return isNeedAudit;
-		}
-
-		public void setIsNeedAudit(Boolean isNeedAudit) {
-			this.isNeedAudit = isNeedAudit;
-		}
-
-		public String getStatus() {
-			return status;
-		}
-
-		public void setStatus(String status) {
-			this.status = status;
-		}
-
-		public String getDescription() {
-			return description;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public List<WoOkrWorkBaseSimpleInfo> getWorks() {
-			return works;
-		}
-
-		public void setWorks(List<WoOkrWorkBaseSimpleInfo> works) {
-			this.works = works;
-		}
-
-		public Date getCreateTime() {
-			return createTime;
-		}
-
-		public void setCreateTime(Date createTime) {
-			this.createTime = createTime;
-		}
-
-		public Boolean getWatch() {
-			return watch;
-		}
-
-		public void setWatch(Boolean watch) {
-			this.watch = watch;
-		}
-
-	}
-
-	public static class WoOkrWorkBaseSimpleInfo {
-
-		public static List<String> Excludes = new ArrayList<String>();
-
-		@FieldDescribe("子工作信息列表")
-		private List<WoOkrWorkBaseSimpleInfo> subWorks = null;
-
-		@FieldDescribe("工作ID")
-		private String id = null;
-
-		@FieldDescribe("上级工作ID")
-		private String parentId = null;
-
-		@FieldDescribe("工作标题")
-		private String title = null;
-
-		@FieldDescribe("中心工作ID")
-		private String centerId = null;
-
-		@FieldDescribe("中心工作标题")
-		private String centerTitle = null;
-
-		@FieldDescribe("主责人姓名")
-		private String responsibilityEmployeeName = null;
-
-		@FieldDescribe("主责人身份")
-		private String responsibilityIdentity = null;
-
-		@FieldDescribe("主责人所属组织")
-		private String responsibilityUnitName = null;
-
-		@FieldDescribe("主责人所属顶层组织")
-		private String responsibilityTopUnitName = null;
-
-		@FieldDescribe("协助人姓名")
-		private List<String> cooperateEmployeeNameList = null;
-
-		@FieldDescribe("协助人所属组织")
-		private List<String> cooperateUnitNameList = null;
-
-		@FieldDescribe("协助人身份")
-		private List<String> cooperateIdentityList = null;
-
-		@FieldDescribe("工作类别")
-		private String workType = null;
-
-		@FieldDescribe("工作级别")
-		private String workLevel = null;
-
-		@FieldDescribe("工作进度")
-		private Integer overallProgress = 0;
-
-		@FieldDescribe("工作处理状态:草稿|待确认|执行中|已超期|已完成|已撤消")
-		private String workProcessStatus = "草稿";
-
-		@FieldDescribe("工作是否已超期")
-		private Boolean isOverTime = false;
-
-		@FieldDescribe("工作是否已完成")
-		private Boolean isCompleted = false;
-
-		@FieldDescribe("工作详细描述, 事项分解")
-		private String workDetail = null;
-
-		@FieldDescribe("职责描述")
-		private String dutyDescription = null;
-
-		@FieldDescribe("里程碑标志说明")
-		private String landmarkDescription = null;
-
-		@FieldDescribe("重点事项说明")
-		private String majorIssuesDescription = null;
-
-		@FieldDescribe("具体行动举措")
-		private String progressAction = null;
-
-		@FieldDescribe("进展计划时限说明")
-		private String progressPlan = null;
-
-		@FieldDescribe("交付成果说明")
-		private String resultDescription = null;
-
-		@FieldDescribe("是否可以查看工作详情")
-		private Boolean watch = false;
-
-		private String completeDateLimitStr = null;
-
-		private Long rank = 0L;
-
-		public Long getRank() {
-			return rank;
-		}
-
-		public void setRank(Long rank) {
-			this.rank = rank;
-		}
-
-		public String getWorkDetail() {
-			return workDetail;
-		}
-
-		public void setWorkDetail(String workDetail) {
-			this.workDetail = workDetail;
-		}
-
-		public String getDutyDescription() {
-			return dutyDescription;
-		}
-
-		public void setDutyDescription(String dutyDescription) {
-			this.dutyDescription = dutyDescription;
-		}
-
-		public String getLandmarkDescription() {
-			return landmarkDescription;
-		}
-
-		public void setLandmarkDescription(String landmarkDescription) {
-			this.landmarkDescription = landmarkDescription;
-		}
-
-		public String getMajorIssuesDescription() {
-			return majorIssuesDescription;
-		}
-
-		public void setMajorIssuesDescription(String majorIssuesDescription) {
-			this.majorIssuesDescription = majorIssuesDescription;
-		}
-
-		public String getProgressAction() {
-			return progressAction;
-		}
-
-		public void setProgressAction(String progressAction) {
-			this.progressAction = progressAction;
-		}
-
-		public String getProgressPlan() {
-			return progressPlan;
-		}
-
-		public void setProgressPlan(String progressPlan) {
-			this.progressPlan = progressPlan;
-		}
-
-		public String getResultDescription() {
-			return resultDescription;
-		}
-
-		public void setResultDescription(String resultDescription) {
-			this.resultDescription = resultDescription;
-		}
-
-		public String getTitle() {
-			return title;
-		}
-
-		public void setTitle(String title) {
-			this.title = title;
-		}
-
-		public String getCenterId() {
-			return centerId;
-		}
-
-		public void setCenterId(String centerId) {
-			this.centerId = centerId;
-		}
-
-		public String getCenterTitle() {
-			return centerTitle;
-		}
-
-		public void setCenterTitle(String centerTitle) {
-			this.centerTitle = centerTitle;
-		}
-
-		public List<WoOkrWorkBaseSimpleInfo> getSubWorks() {
-			return subWorks;
-		}
-
-		public void setSubWorks(List<WoOkrWorkBaseSimpleInfo> subWorks) {
-			this.subWorks = subWorks;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getResponsibilityEmployeeName() {
-			return responsibilityEmployeeName;
-		}
-
-		public void setResponsibilityEmployeeName(String responsibilityEmployeeName) {
-			this.responsibilityEmployeeName = responsibilityEmployeeName;
-		}
-
-		public String getResponsibilityIdentity() {
-			return responsibilityIdentity;
-		}
-
-		public void setResponsibilityIdentity(String responsibilityIdentity) {
-			this.responsibilityIdentity = responsibilityIdentity;
-		}
-
-		public String getResponsibilityUnitName() {
-			return responsibilityUnitName;
-		}
-
-		public void setResponsibilityUnitName(String responsibilityUnitName) {
-			this.responsibilityUnitName = responsibilityUnitName;
-		}
-
-		public String getResponsibilityTopUnitName() {
-			return responsibilityTopUnitName;
-		}
-
-		public void setResponsibilityTopUnitName(String responsibilityTopUnitName) {
-			this.responsibilityTopUnitName = responsibilityTopUnitName;
-		}
-
-		public String getWorkType() {
-			return workType;
-		}
-
-		public void setWorkType(String workType) {
-			this.workType = workType;
-		}
-
-		public String getWorkLevel() {
-			return workLevel;
-		}
-
-		public void setWorkLevel(String workLevel) {
-			this.workLevel = workLevel;
-		}
-
-		public String getWorkProcessStatus() {
-			return workProcessStatus;
-		}
-
-		public void setWorkProcessStatus(String workProcessStatus) {
-			this.workProcessStatus = workProcessStatus;
-		}
-
-		public Boolean getIsOverTime() {
-			return isOverTime;
-		}
-
-		public void setIsOverTime(Boolean isOverTime) {
-			this.isOverTime = isOverTime;
-		}
-
-		public Boolean getIsCompleted() {
-			return isCompleted;
-		}
-
-		public void setIsCompleted(Boolean isCompleted) {
-			this.isCompleted = isCompleted;
-		}
-
-		public Boolean getWatch() {
-			return watch;
-		}
-
-		public void setWatch(Boolean watch) {
-			this.watch = watch;
-		}
-
-		public String getParentId() {
-			return parentId;
-		}
-
-		public void setParentId(String parentId) {
-			this.parentId = parentId;
-		}
-
-		public void addNewSubWorkBaseInfo(WoOkrWorkBaseSimpleInfo work) {
-			if (subWorks == null) {
-				subWorks = new ArrayList<WoOkrWorkBaseSimpleInfo>();
-			}
-			subWorks.add(work);
-		}
-
-		public String getCompleteDateLimitStr() {
-			return completeDateLimitStr;
-		}
-
-		public void setCompleteDateLimitStr(String completeDateLimitStr) {
-			this.completeDateLimitStr = completeDateLimitStr;
-		}
-
-		public List<String> getCooperateEmployeeNameList() {
-			return cooperateEmployeeNameList;
-		}
-
-		public List<String> getCooperateUnitNameList() {
-			return cooperateUnitNameList;
-		}
-
-		public List<String> getCooperateIdentityList() {
-			return cooperateIdentityList;
-		}
-
-		public void setCooperateEmployeeNameList(List<String> cooperateEmployeeNameList) {
-			this.cooperateEmployeeNameList = cooperateEmployeeNameList;
-		}
-
-		public void setCooperateUnitNameList(List<String> cooperateUnitNameList) {
-			this.cooperateUnitNameList = cooperateUnitNameList;
-		}
-
-		public void setCooperateIdentityList(List<String> cooperateIdentityList) {
-			this.cooperateIdentityList = cooperateIdentityList;
-		}
-
-		public Integer getOverallProgress() {
-			return overallProgress;
-		}
-
-		public void setOverallProgress(Integer overallProgress) {
-			this.overallProgress = overallProgress;
-		}
-	}
-}

+ 0 - 14
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/mind/BaseAction.java

@@ -1,14 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.mind;
-
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.okr.assemble.control.service.OkrCenterWorkQueryService;
-import com.x.okr.assemble.control.service.OkrUserInfoService;
-import com.x.okr.assemble.control.service.OkrWorkBaseInfoQueryService;
-import com.x.okr.assemble.control.service.OkrWorkPersonService;
-
-public class BaseAction extends StandardJaxrsAction {	
-	protected OkrCenterWorkQueryService okrCenterWorkInfoService = new OkrCenterWorkQueryService();
-	protected OkrWorkBaseInfoQueryService okrWorkBaseInfoService = new OkrWorkBaseInfoQueryService();
-	protected OkrWorkPersonService okrWorkPersonService = new OkrWorkPersonService();
-	protected OkrUserInfoService okrUserInfoService = new OkrUserInfoService();
-}

+ 0 - 61
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/jaxrs/mind/OkrWorkMindAction.java

@@ -1,61 +0,0 @@
-package com.x.okr.assemble.control.jaxrs.mind;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-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 javax.ws.rs.core.Response;
-
-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("mind")
-@JaxrsDescribe("工作信息脑图展现服务")
-public class OkrWorkMindAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(OkrWorkMindAction.class);
-
-	/**
-	 * 展示与用户可视的工作有关联的工作部署线(可配置为全部显示) 用户可视的工作,可以被访问详情
-	 * 
-	 * @param request
-	 * @param centerId
-	 * @return
-	 */
-	@JaxrsMethodDescribe(value = "根据中心工作ID获取用户需要在脑图里展现的所有工作信息列表", action = ActionListMindForCenterId.class)
-	@GET
-	@Path("center/{centerId}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listMindWorkByCenterId(@Suspended final AsyncResponse asyncResponse,
-			@Context HttpServletRequest request,
-			@JaxrsParameterDescribe("中心工作ID") @PathParam("centerId") String centerId) {
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		ActionResult<ActionListMindForCenterId.Wo> result = new ActionResult<>();
-		try {
-			result = new ActionListMindForCenterId().execute(request, effectivePerson, centerId);
-		} catch (Exception e) {
-			result = new ActionResult<>();
-			logger.error(e, effectivePerson, request, null);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов