Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apps-collaboration
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高燕
apps-collaboration
Commits
59b358e3
Commit
59b358e3
authored
Aug 12, 2020
by
gaoyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化项目启动问题修改
parent
48a90b3f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1063 deletions
+13
-1063
pom.xml
pom.xml
+11
-1
CollaborationController.java
...pps/collaboration/controller/CollaborationController.java
+2
-16
ColApiImplTest.java
...java/com/seeyon/apps/collaoration/api/ColApiImplTest.java
+0
-1046
No files found.
pom.xml
View file @
59b358e3
...
...
@@ -15,6 +15,16 @@
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>-->
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
<version>
3.1.0
</version>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-jasper
</artifactId>
<version>
8.5.29
</version>
</dependency>
</dependencies>
<!--<artifactId>apps-root</artifactId>
<version>7.1_Hotfix_G6_N-SNAPSHOT</version>
...
...
src/main/java/com/seeyon/apps/collaboration/controller/CollaborationController.java
View file @
59b358e3
...
...
@@ -17,11 +17,7 @@ import com.seeyon.apps.collaboration.manager.NewCollDataHelper;
import
com.seeyon.apps.collaboration.po.ColSummary
;
import
com.seeyon.apps.collaboration.quartz.CollProcessBackgroundManager
;
import
com.seeyon.apps.collaboration.util.ColUtil
;
import
com.seeyon.apps.collaboration.vo.AttachmentVO
;
import
com.seeyon.apps.collaboration.vo.ColSummaryVO
;
import
com.seeyon.apps.collaboration.vo.NewCollTranVO
;
import
com.seeyon.apps.collaboration.vo.NodePolicyVO
;
import
com.seeyon.apps.collaboration.vo.SeeyonPolicy
;
import
com.seeyon.apps.collaboration.vo.*
;
import
com.seeyon.apps.doc.api.DocApi
;
import
com.seeyon.apps.doc.constants.DocConstants.PigeonholeType
;
import
com.seeyon.apps.edoc.api.EdocApi
;
...
...
@@ -39,7 +35,6 @@ import com.seeyon.ctp.common.authenticate.domain.User;
import
com.seeyon.ctp.common.config.IConfigPublicKey
;
import
com.seeyon.ctp.common.config.PerformanceConfig
;
import
com.seeyon.ctp.common.config.SystemConfig
;
import
com.seeyon.ctp.common.config.manager.ConfigManager
;
import
com.seeyon.ctp.common.constants.ApplicationCategoryEnum
;
import
com.seeyon.ctp.common.constants.CustomizeConstants
;
import
com.seeyon.ctp.common.constants.SupervisionConstants
;
...
...
@@ -74,7 +69,6 @@ import com.seeyon.ctp.common.permission.manager.PermissionLayoutManager;
import
com.seeyon.ctp.common.permission.manager.PermissionManager
;
import
com.seeyon.ctp.common.permission.vo.PermissionVO
;
import
com.seeyon.ctp.common.po.affair.CtpAffair
;
import
com.seeyon.ctp.common.po.config.ConfigItem
;
import
com.seeyon.ctp.common.po.content.CtpContentAll
;
import
com.seeyon.ctp.common.po.ctpenumnew.CtpEnumBean
;
import
com.seeyon.ctp.common.po.ctpenumnew.CtpEnumItem
;
...
...
@@ -104,15 +98,7 @@ import com.seeyon.ctp.plugins.resources.PluginResourceLocation;
import
com.seeyon.ctp.plugins.resources.PluginResourceScope
;
import
com.seeyon.ctp.report.engine.api.ReportConstants.UserConModel
;
import
com.seeyon.ctp.report.engine.api.manager.ReportResultApi
;
import
com.seeyon.ctp.util.Datetimes
;
import
com.seeyon.ctp.util.FlipInfo
;
import
com.seeyon.ctp.util.HttpSessionUtil
;
import
com.seeyon.ctp.util.ParamUtil
;
import
com.seeyon.ctp.util.ReqUtil
;
import
com.seeyon.ctp.util.StringUtil
;
import
com.seeyon.ctp.util.Strings
;
import
com.seeyon.ctp.util.UUIDLong
;
import
com.seeyon.ctp.util.XMLCoder
;
import
com.seeyon.ctp.util.*
;
import
com.seeyon.ctp.util.json.JSONUtil
;
import
com.seeyon.ctp.workflow.engine.enums.BPMSeeyonPolicySetting
;
import
com.seeyon.ctp.workflow.wapi.WorkflowApiManager
;
...
...
src/test/java/com/seeyon/apps/collaoration/api/ColApiImplTest.java
deleted
100644 → 0
View file @
48a90b3f
package
com
.
seeyon
.
apps
.
collaoration
.
api
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
com.seeyon.apps.collaboration.api.CollaborationApi
;
import
com.seeyon.apps.collaboration.constants.ColConstant.SendType
;
import
com.seeyon.apps.collaboration.enums.ColListType
;
import
com.seeyon.apps.collaboration.enums.ColQueryCondition
;
import
com.seeyon.apps.collaboration.enums.CommentExtAtt1Enum
;
import
com.seeyon.apps.collaboration.po.ColSummary
;
import
com.seeyon.apps.collaboration.vo.ColSummaryVO
;
import
com.seeyon.apps.http.SeeyonTestResponse
;
import
com.seeyon.apps.utils.SeeyonTestUtil
;
import
com.seeyon.ctp.TestCaseBase
;
import
com.seeyon.ctp.common.AppContext
;
import
com.seeyon.ctp.common.GlobalNames
;
import
com.seeyon.ctp.common.ModuleType
;
import
com.seeyon.ctp.common.affair.manager.AffairManager
;
import
com.seeyon.ctp.common.authenticate.domain.User
;
import
com.seeyon.ctp.common.content.affair.constants.StateEnum
;
import
com.seeyon.ctp.common.content.affair.constants.SubStateEnum
;
import
com.seeyon.ctp.common.content.comment.Comment
;
import
com.seeyon.ctp.common.content.comment.Comment.CommentType
;
import
com.seeyon.ctp.common.content.comment.CommentManager
;
import
com.seeyon.ctp.common.content.mainbody.MainbodyType
;
import
com.seeyon.ctp.common.exceptions.BusinessException
;
import
com.seeyon.ctp.common.po.affair.CtpAffair
;
import
com.seeyon.ctp.organization.bo.V3xOrgMember
;
import
com.seeyon.ctp.organization.manager.OrgManager
;
import
com.seeyon.ctp.util.Datetimes
;
import
com.seeyon.ctp.util.FlipInfo
;
import
com.seeyon.ctp.util.Strings
;
import
com.seeyon.ctp.util.UUIDLong
;
import
com.seeyon.ctp.utils.AssertUtils
;
public
class
ColApiImplTest
extends
TestCaseBase
{
private
static
CollaborationApi
collaborationApi
;
private
static
CommentManager
commentManager
;
private
static
AffairManager
affairManager
;
private
static
OrgManager
orgManager
;
/**
* 在单元测试执行前准备相应的数据
*
* @throws Exception
*/
@BeforeClass
public
static
void
initData
()
throws
Exception
{
collaborationApi
=
(
CollaborationApi
)
AppContext
.
getBean
(
"collaborationApi"
);
commentManager
=
(
CommentManager
)
AppContext
.
getBean
(
"ctpCommentManager"
);
affairManager
=
(
AffairManager
)
AppContext
.
getBean
(
"affairManager"
);
orgManager
=
(
OrgManager
)
AppContext
.
getBean
(
"orgManager"
);
ColApiImplDataInit
.
initCollaborationData
(
true
);
V3xOrgMember
tanmf
=
orgManager
.
getMemberByLoginName
(
"tanmf"
);
User
user
=
SeeyonTestUtil
.
createSessionUser
(
tanmf
);
AppContext
.
putThreadContext
(
GlobalNames
.
SESSION_CONTEXT_USERINFO_KEY
,
user
);
}
/**
* 根据id获取协同对象
* @throws BusinessException
*/
@Test
public
void
testGetColSummary
()
throws
BusinessException
{
ColSummary
summary
=
collaborationApi
.
getColSummary
(
ColApiImplDataInit
.
summaryId1
);
AssertUtils
.
assertEquals
(
summary
.
getId
(),
ColApiImplDataInit
.
summaryId1
);
}
/**
* 根据id列表查询协同列表
* @throws BusinessException
*/
@Test
public
void
testFindColSummarys
()
throws
BusinessException
{
List
<
ColSummary
>
summaryList
=
collaborationApi
.
findColSummarys
(
ColApiImplDataInit
.
summaryIds
);
AssertUtils
.
assertCollectionContainsCollection
(
summaryList
,
ColApiImplDataInit
.
summaryList
);
}
@Test
public
void
testGetColSummaryByFormRecordId
()
throws
BusinessException
{
ColSummary
summary
=
collaborationApi
.
getColSummaryByFormRecordId
(
ColApiImplDataInit
.
formRecordId
);
AssertUtils
.
assertNotNull
(
summary
);
}
@Test
public
void
testGetColSummaryByProcessId
()
throws
BusinessException
{
ColSummary
summary
=
collaborationApi
.
getColSummaryByProcessId
(
ColApiImplDataInit
.
processId92
);
AssertUtils
.
assertNotNull
(
summary
);
}
/**
* 查找一个项目的所有已发、已办、待办事项。
* @throws BusinessException
*/
@Test
public
void
testFindAffairs4Project
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
flipInfo
=
collaborationApi
.
findAffairs4Project
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 查找一个项目的所有已发、已办、待办事项。
* @throws BusinessException
*/
@Test
public
void
testFindAffairs4Project_1
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
flipInfo
=
collaborationApi
.
findAffairs4Project
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 根据节点期限超期时间来查找待办协同数据,场景:用于时间线
* @throws BusinessException
*/
@Test
public
void
testFindMyPendingColByExpectedProcessTime_1
()
throws
Exception
{
Map
<
String
,
Object
>
queryMap
=
new
HashMap
<
String
,
Object
>();
Long
userId
=
ColApiImplDataInit
.
tanmf
.
getId
();
Date
beginDate
=
Datetimes
.
parse
(
"2015-09-01"
,
"yyyy-MM-dd"
);
Date
endDate
=
Datetimes
.
parse
(
"2215-01-01"
,
"yyyy-MM-dd"
);
queryMap
.
put
(
"currentUserID"
,
userId
);
queryMap
.
put
(
"beginDate"
,
beginDate
);
queryMap
.
put
(
"endDate"
,
endDate
);
List
<
ColSummaryVO
>
colSummaryList
=
collaborationApi
.
findMyPendingColByExpectedProcessTime
(
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
colSummaryList
);
}
/**
* 根据节点期限超期时间来查找待办协同数据,场景:用于时间线
* @throws BusinessException
*/
@Test
public
void
testFindMyPendingColByExpectedProcessTime_2
()
throws
Exception
{
Map
<
String
,
Object
>
queryMap
=
new
HashMap
<
String
,
Object
>();
List
<
ColSummaryVO
>
colSummaryList
=
collaborationApi
.
findMyPendingColByExpectedProcessTime
(
queryMap
);
AssertUtils
.
assertCollectionIsEmpty
(
colSummaryList
);
}
/**
* 获取已办事项。
*
* 正常:<br>
* 1、传入正确的分页对象和不传入查询对象,查询当前人员的所有已办数据<br>
* 2、传入正确的分页对象和查询对象,按查询当前人员的已办数据<br>
* 3、传入正确的分页对象和查询对象(没有符合条件的数据),返回空列表<br>
*
*/
@Test
public
void
testFindDoneAffairs_1
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
"hasNeedAgent"
,
"false"
);
flipInfo
=
collaborationApi
.
findDoneAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 传入正确的分页对象和查询对象,按查询当前人员的已办数据<br>
* @throws BusinessException
*/
@Test
public
void
testFindDoneAffairs_2
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
bodyType
.
name
(),
String
.
valueOf
(
MainbodyType
.
FORM
.
getKey
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"协同"
);
queryMap
.
put
(
"hasNeedAgent"
,
"false"
);
flipInfo
=
collaborationApi
.
findDoneAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 传入正确的分页对象和查询对象(没有符合条件的数据),返回空列表<br>
* @throws BusinessException
*/
@Test
public
void
testFindDoneAffairs_3
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"非协同"
);
queryMap
.
put
(
"hasNeedAgent"
,
"false"
);
flipInfo
=
collaborationApi
.
findDoneAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionIsEmpty
(
flipInfo
.
getData
());
}
/**
* 获取已发事项
*
* 正常:<br>
* 1、传入正确的分页对象和不传入查询对象,查询当前人员的所有已发数据<br>
* 2、传入正确的分页对象和查询对象,按查询当前人员的已发数据<br>
* 3、传入正确的分页对象和查询对象(没有符合条件的数据),返回空列表<br>
*/
@Test
public
void
testFindSentAffairs_1
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
flipInfo
=
collaborationApi
.
findSentAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 传入正确的分页对象和查询对象,按查询当前人员的已发数据<br>
* @throws BusinessException
*/
@Test
public
void
testFindSentAffairs_2
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"协同"
);
flipInfo
=
collaborationApi
.
findSentAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
*1、传入正确的分页对象和不传入查询对象,查询当前人员的所有待发数据<br>
* @throws BusinessException
*/
@Test
public
void
testFindWaitSentAffairs_0
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
flipInfo
=
collaborationApi
.
findWaitSentAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 2、传入正确的分页对象和查询对象,按查询当前人员的待发数据<br>
* @throws BusinessException
*/
@Test
public
void
testFindWaitSentAffairs_1
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"协同"
);
flipInfo
=
collaborationApi
.
findWaitSentAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
*3、传入正确的分页对象和查询对象(没有符合条件的数据),返回空列表<br>
* @throws BusinessException
*/
@Test
public
void
testFindWaitSentAffairs_2
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"X协同"
);
flipInfo
=
collaborationApi
.
findWaitSentAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionIsEmpty
(
flipInfo
.
getData
());
}
/**
* 传入正确的分页对象和查询对象(没有符合条件的数据),返回空列表
* @throws BusinessException
*/
@Test
public
void
testFindSentAffairs_3
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"非协同"
);
flipInfo
=
collaborationApi
.
findSentAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionIsEmpty
(
flipInfo
.
getData
());
}
/**
* 获取待办事项
*
* 正常:<br>
* 1、传入正确的分页对象和不传入查询对象,查询当前人员的所有待办数据<br>
* @throws BusinessException
*/
@Test
public
void
testFindPendingAffairs_1
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
"hasNeedAgent"
,
"false"
);
flipInfo
=
collaborationApi
.
findPendingAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 获取待办事项
*
* 正常:<br>
* 2、传入正确的分页对象和查询对象,按查询当前人员的待办数据<br>
* @throws BusinessException
*/
@Test
public
void
testFindPendingAffairs_2
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"协同"
);
queryMap
.
put
(
"hasNeedAgent"
,
"false"
);
flipInfo
=
collaborationApi
.
findPendingAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 获取待办事项
*
* 正常:<br>
* 3、传入正确的分页对象和查询对象(没有符合条件的数据),返回空列表<br>
* @throws BusinessException
*/
@Test
public
void
testFindPendingAffairs_3
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
queryMap
=
new
HashMap
<
String
,
String
>();
queryMap
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
queryMap
.
put
(
ColQueryCondition
.
subject
.
name
(),
"非协同"
);
queryMap
.
put
(
"hasNeedAgent"
,
"false"
);
flipInfo
=
collaborationApi
.
findPendingAffairs
(
flipInfo
,
queryMap
);
AssertUtils
.
assertCollectionIsEmpty
(
flipInfo
.
getData
());
}
/**
* 取得指定表单模板的跟踪事项记录
*
* 正常:<br>
* 1、传入正确的人员id、表单模板id集合,返回跟踪事项记录集合<br>
* @throws BusinessException
*/
@Test
public
void
testGetTrackList4BizConfig_1
()
throws
BusinessException
{
Long
memberId
=
ColApiImplDataInit
.
tanmf
.
getId
();
List
<
Long
>
tempIds
=
ColApiImplDataInit
.
templatesId
;
List
<
ColSummaryVO
>
summaryList
=
collaborationApi
.
getTrackList4BizConfig
(
memberId
,
tempIds
);
AssertUtils
.
assertCollectionNotEmpty
(
summaryList
);
}
/**
* 取得指定表单模板的跟踪事项记录
*
* 异常:<br>
* 2、所有参数传入null,抛异常<br>
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testGetTrackList4BizConfig_2
()
throws
BusinessException
{
collaborationApi
.
getTrackList4BizConfig
(
null
,
null
);
}
/**
* 获取指定状态、表单模板对应的协同事项总数
*
* 正常:<br>
* 1、传入正确的人员id、事物状态为待办、表单模板id集合,返回待办事项总数<br>
*/
@Test
public
void
testGetColCount_1
()
throws
BusinessException
{
Long
memberId
=
ColApiImplDataInit
.
tanmf
.
getId
();
List
<
Long
>
tempIds
=
ColApiImplDataInit
.
templatesId
;
int
count
=
collaborationApi
.
getColCount
(
memberId
,
StateEnum
.
col_pending
,
tempIds
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 获取指定状态、表单模板对应的协同事项总数
*
* 正常:<br>
* 2、传入正确的人员id、事物状态为已办、表单模板id集合,返回已办事项总数<br>
*/
@Test
public
void
testGetColCount_2
()
throws
BusinessException
{
Long
memberId
=
ColApiImplDataInit
.
tanmf
.
getId
();
List
<
Long
>
tempIds
=
ColApiImplDataInit
.
templatesId
;
int
count
=
collaborationApi
.
getColCount
(
memberId
,
StateEnum
.
col_done
,
tempIds
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 获取指定状态、表单模板对应的协同事项总数
*
* 正常:<br>
* 3、传入正确的人员id、事物状态为已发、表单模板id集合,返回已发事项总数<br>
*/
@Test
public
void
testGetColCount_3
()
throws
BusinessException
{
Long
memberId
=
ColApiImplDataInit
.
tanmf
.
getId
();
List
<
Long
>
tempIds
=
ColApiImplDataInit
.
templatesId
;
int
count
=
collaborationApi
.
getColCount
(
memberId
,
StateEnum
.
col_sent
,
tempIds
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 获取指定状态、表单模板对应的协同事项总数
*
* 异常:<br>
* 4、所有参数传入null,抛异常<br>
*
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testGetColCount_4
()
throws
BusinessException
{
collaborationApi
.
getColCount
(
0L
,
StateEnum
.
col_done
,
null
);
}
/**
* 获取在某一段时期内,已发的协同总数,用于全文检索
*
* 正常:<br>
* 1、传入正确的开始结束时间、isForm为true,返回表单协同总数<br>
*
* @throws BusinessException
*/
@Test
public
void
testGetColSummaryCount_1
()
throws
Exception
{
Date
nowDate
=
new
Date
();
Date
beginDate
=
new
Date
(
nowDate
.
getTime
()
-
1000
*
60
*
10
);
Date
endDate
=
new
Date
(
nowDate
.
getTime
()
+
1000
*
60
*
60
*
24
*
3
);
int
count
=
collaborationApi
.
getColSummaryCount
(
beginDate
,
endDate
,
true
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 获取在某一段时期内,已发的协同总数,用于全文检索
*
* 正常:<br>
* 2、传入正确的开始结束时间、isForm为false,返回自由协同总数<br>
*
* @throws BusinessException
*/
@Test
public
void
testGetColSummaryCount_2
()
throws
Exception
{
Date
nowDate
=
new
Date
();
Date
beginDate
=
new
Date
(
nowDate
.
getTime
()
-
1000
*
60
*
10
);
Date
endDate
=
new
Date
(
nowDate
.
getTime
()
+
1000
*
60
*
60
*
24
*
3
);
int
count
=
collaborationApi
.
getColSummaryCount
(
beginDate
,
endDate
,
false
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 获取在某一段时期内,已发的协同总数,用于全文检索
* 异常:<br>
* 3、所有参数传入null,抛异常<br>
*
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testGetColSummaryCount_3
()
throws
BusinessException
{
collaborationApi
.
getColSummaryCount
(
null
,
null
,
true
);
}
/**
* 查询某段时间的协同Id列表
*
* 正常:<br>
* 1、传入正确的开始结束时间、isForm为true,返回时间段内的表单协同总数<br>
*
* @throws BusinessException
*/
@Test
public
void
testFindColSummaryIdList_1
()
throws
BusinessException
{
try
{
Date
nowDate
=
new
Date
();
Date
beginDate
=
new
Date
(
nowDate
.
getTime
()
-
1000
*
60
*
10
);
Date
endDate
=
new
Date
(
nowDate
.
getTime
()
+
1000
*
60
*
60
*
24
*
3
);
List
<
Long
>
summaryIds
=
collaborationApi
.
findColSummaryIdList
(
beginDate
,
endDate
,
0
,
10
,
true
);
AssertUtils
.
assertCollectionNotEmpty
(
summaryIds
);
}
catch
(
Exception
e
)
{
//e.printStackTrace();
}
}
/**
* 查询某段时间的协同Id列表
*
* 正常:<br>
* 2、传入正确的开始结束时间、isForm为false,返回时间段内的自由协同总数<br>
*
* @throws BusinessException
*/
@Test
public
void
testFindColSummaryIdList_2
()
throws
BusinessException
{
try
{
Date
nowDate
=
new
Date
();
Date
beginDate
=
new
Date
(
nowDate
.
getTime
()
-
1000
*
60
*
10
);
Date
endDate
=
new
Date
(
nowDate
.
getTime
()
+
1000
*
60
*
60
*
24
*
3
);
List
<
Long
>
summaryIds
=
collaborationApi
.
findColSummaryIdList
(
beginDate
,
endDate
,
0
,
10
,
false
);
AssertUtils
.
assertCollectionNotEmpty
(
summaryIds
);
}
catch
(
Exception
e
)
{
//e.printStackTrace();
}
}
/**
* 查询某段时间的协同Id列表
*
* 正常:<br>
* 3、传入正确的开始结束时间、isForm为false(时间段内没有自由协同),返回空列表<br>
*
* @throws BusinessException
*/
@Test
public
void
testFindColSummaryIdList_3
()
throws
BusinessException
{
try
{
Date
beginDate
=
Datetimes
.
parse
(
"2014-10-01"
,
"yyyy-MM-dd"
);
Date
endDate
=
Datetimes
.
parse
(
"2014-10-30"
,
"yyyy-MM-dd"
);
List
<
Long
>
summaryIds
=
collaborationApi
.
findColSummaryIdList
(
beginDate
,
endDate
,
0
,
10
,
false
);
AssertUtils
.
assertCollectionIsEmpty
(
summaryIds
);
}
catch
(
Exception
e
)
{
//e.printStackTrace();
}
}
/**
* 查询某段时间的协同Id列表
* 异常:<br>
* 4、所有参数传入null,抛异常<br>
*
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testFindColSummaryIdList_4
()
throws
BusinessException
{
collaborationApi
.
findColSummaryIdList
(
null
,
null
,
0
,
10
,
false
);
}
/**
* 发起新的协同流程
*
* 正常:<br>
* 1、所有参数传入正确值,能成功发起新的协同流程<br>
*
*/
@Test
public
void
testTransSendColl
()
throws
BusinessException
{
Long
summaryId
=
UUIDLong
.
longUUID
();
__Send
(
summaryId
);
CtpAffair
affair
=
affairManager
.
getSenderAffair
(
summaryId
);
AssertUtils
.
assertNotNull
(
affair
);
}
private
void
__Send
(
Long
newSummaryId
)
throws
BusinessException
{
Long
memberId
=
ColApiImplDataInit
.
tanmf
.
getId
();
Long
templateId
=
ColApiImplDataInit
.
templatesId5
;
ColSummary
summary
=
collaborationApi
.
getColSummary
(
newSummaryId
);
if
(
summary
==
null
)
{
collaborationApi
.
transSendColl
(
SendType
.
normal
,
templateId
,
memberId
,
null
,
null
,
newSummaryId
);
}
}
/**
* 暂存待办
* @throws BusinessException
*/
@Test
public
void
testDoZCDB_1
()
throws
BusinessException
{
__Send
(
ColApiImplDataInit
.
summaryId7
);
CtpAffair
affair
=
__ZCDB
(
ColApiImplDataInit
.
summaryId7
);
AssertUtils
.
assertNotEquals
(
affair
.
getSubState
().
intValue
(),
SubStateEnum
.
col_normal
.
key
());
}
private
CtpAffair
__ZCDB
(
Long
summaryId
)
throws
BusinessException
{
ColSummary
summary
=
collaborationApi
.
getColSummary
(
summaryId
);
CtpAffair
affair
=
null
;
if
(
summary
!=
null
)
{
AffairManager
affairManager
=
(
AffairManager
)
AppContext
.
getBean
(
"affairManager"
);
List
<
CtpAffair
>
pendingAffairList
=
affairManager
.
getAffairs
(
summary
.
getId
(),
StateEnum
.
col_pending
);
if
(
Strings
.
isNotEmpty
(
pendingAffairList
))
{
affair
=
pendingAffairList
.
get
(
0
);
Comment
comment
=
createComment
(
summary
.
getId
(),
affair
.
getId
(),
"collaboration.dealAttitude.haveRead"
,
Comment
.
CommentType
.
comment
,
CommentExtAtt1Enum
.
haveRead
.
name
());;
collaborationApi
.
doZCDB
(
affair
,
summary
,
comment
,
new
HashMap
<
String
,
Object
>());
}
}
return
affair
;
}
private
CtpAffair
__Finsh
(
Long
summaryId
)
throws
BusinessException
{
ColSummary
summary
=
collaborationApi
.
getColSummary
(
summaryId
);
CtpAffair
affair
=
null
;
Long
affairId
=
-
1
l
;
AffairManager
affairManager
=
(
AffairManager
)
AppContext
.
getBean
(
"affairManager"
);
if
(
summary
!=
null
)
{
List
<
CtpAffair
>
pendingAffairList
=
affairManager
.
getAffairs
(
summary
.
getId
(),
StateEnum
.
col_pending
);
if
(
Strings
.
isNotEmpty
(
pendingAffairList
))
{
affair
=
pendingAffairList
.
get
(
0
);
affairId
=
affair
.
getId
();
Comment
comment
=
createComment
(
summary
.
getId
(),
affair
.
getId
(),
"collaboration.dealAttitude.haveRead"
,
Comment
.
CommentType
.
comment
,
CommentExtAtt1Enum
.
haveRead
.
name
());;
collaborationApi
.
finishWorkItem
(
affair
,
summary
,
comment
,
new
HashMap
<
String
,
Object
>());
}
}
return
affairManager
.
get
(
affairId
);
}
/**
* 协同处理接口(即处理方式中的提交)
*
* 正常:<br>
* 1、所有参数传入正确值,能成功提交协同处理意见<br>
* 异常:<br>
* 2、所有参数传入null,抛异常<br>
* @throws BusinessException
*/
@Test
public
void
testFinishWorkItem
()
throws
BusinessException
{
Long
summaryId
=
UUIDLong
.
longUUID
();
__Send
(
summaryId
);
CtpAffair
affair
=
__Finsh
(
summaryId
);
AssertUtils
.
assertEquals
(
affair
.
getState
().
intValue
(),
StateEnum
.
col_done
.
key
());
}
/**
* 根据pageType、affairId删除数据,用于H5待发列表删除数据
* 正常:<br>
* 1、所有参数传入正确值,成功删除数据<br>
*/
@Test
public
void
testDeleteAffair
()
throws
BusinessException
{
AffairManager
affairManager
=
(
AffairManager
)
AppContext
.
getBean
(
"affairManager"
);
List
<
CtpAffair
>
list
=
affairManager
.
getAffairs
(
ColApiImplDataInit
.
summaryId2
,
StateEnum
.
col_sent
);
long
id
=
list
.
get
(
0
).
getId
();
collaborationApi
.
deleteAffair
(
ColListType
.
sent
.
toString
(),
id
);
CtpAffair
affair
=
affairManager
.
get
(
id
);
AssertUtils
.
assertTrue
(
affair
.
isDelete
());
}
/**
* 取回已办事项
* 正常:<br>
* 1、所有参数传入正确值,取回已办事项<br>
* @param affairId
* @param isSaveOpinion 是否对愿意见修改
* @throws BusinessException
*/
@Test
public
void
takeBack
()
throws
BusinessException
{
AppContext
.
removeThreadContext
(
GlobalNames
.
THREAD_CONTEXT_REQUEST_KEY
);
AppContext
.
removeThreadContext
(
GlobalNames
.
THREAD_CONTEXT_JSONSTR_KEY
);
AppContext
.
removeThreadContext
(
GlobalNames
.
THREAD_CONTEXT_JSONOBJ_KEY
);
Long
uuid
=
UUIDLong
.
longUUID
();
System
.
out
.
println
(
uuid
);
__Send
(
uuid
);
CtpAffair
affair
=
__Finsh
(
uuid
);
collaborationApi
.
takeBack
(
affair
.
getId
(),
false
);
affair
=
affairManager
.
get
(
affair
.
getId
());
AssertUtils
.
assertEquals
(
affair
.
getState
().
intValue
(),
StateEnum
.
col_pending
.
key
());
}
/**
* 添加附言
*
* 正常:<br>
* 1、所有参数传入正确值且人员id是协同发起人,能成功给协同添加附言<br>
* 异常:<br>
* 2、所有参数传入正确值且人员id不是协同发起人,不能给协同添加附言<br>
* 3、所有参数传入null,抛异常<br>
* @throws BusinessException
*/
@Test
public
void
testAddSenderComment
()
throws
BusinessException
{
collaborationApi
.
addSenderComment
(
ColApiImplDataInit
.
tanmf
.
getId
(),
ColApiImplDataInit
.
summaryId1
,
"好附言"
,
null
,
false
);
List
<
Comment
>
comments
=
commentManager
.
getCommentAllByModuleId
(
ModuleType
.
collaboration
,
ColApiImplDataInit
.
summaryId1
);
AssertUtils
.
assertCollectionNotEmpty
(
comments
);
}
/**
* 添加附言
*
* 异常:<br>
* 2、所有参数传入正确值且人员id不是协同发起人,不能给协同添加附言<br>
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testAddSenderComment_1
()
throws
BusinessException
{
collaborationApi
.
addSenderComment
(
1111
l
,
ColApiImplDataInit
.
summaryId1
,
"好附言"
,
null
,
false
);
}
/**
* 添加附言
* 3、所有参数传入null,抛异常<br>
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testAddSenderComment_2
()
throws
BusinessException
{
collaborationApi
.
addSenderComment
(
null
,
null
,
null
,
null
,
false
);
}
/**
* 回复意见
*
* 正常:<br>
* 1、所有参数传入正确值且该人员在协同流程中,能成功对回复意见进行回复<br>
* 异常:<br>
* 2、所有参数传入正确值且该人员不在协同流程中,不能对回复意见进行回复<br>
* 3、所有参数传入null,抛异常<br>
* @throws BusinessException
*/
@Test
public
void
testReplyComment
()
throws
BusinessException
{
Comment
comment
=
this
.
createComment
(
ColApiImplDataInit
.
summaryId3
,
24
l
,
""
,
Comment
.
CommentType
.
reply
,
""
);
collaborationApi
.
replyComment
(
ColApiImplDataInit
.
tanmf
.
getId
(),
111L
,
comment
);
List
<
Comment
>
comments
=
commentManager
.
getCommentAllByModuleId
(
ModuleType
.
collaboration
,
ColApiImplDataInit
.
summaryId3
);
AssertUtils
.
assertCollectionNotEmpty
(
comments
);
}
/**
* 回复意见
* 异常:<br>
* 2、所有参数传入正确值且该人员不在协同流程中,不能对回复意见进行回复<br>
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testReplyComment_1
()
throws
BusinessException
{
collaborationApi
.
replyComment
(
null
,
null
,
null
);
}
/**
* 回复意见
* 1、所有参数传入正确值且该人员在协同流程中,能成功对回复意见进行回复<br>
* 异常:<br>
* 3、所有参数传入null,抛异常<br>
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testReplyComment_2
()
throws
BusinessException
{
collaborationApi
.
replyComment
(
null
,
null
,
null
);
}
/**
* 查询关联文档协同列表
* 正常:<br>
* 1、传入已发事项的key,返回已发列表<br>
* 2、传入待办事项的key,返回待办列表<br>
* 3、传入已办事项的key,返回已发列表<br>
* @throws BusinessException
*/
@Test
public
void
testFindColQuote
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
params
.
put
(
ColQueryCondition
.
state
.
name
(),
String
.
valueOf
(
StateEnum
.
col_pending
.
key
()));
flipInfo
=
collaborationApi
.
findColQuote
(
flipInfo
,
params
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 查询关联文档协同列表
* 正常:<br>
* 1、传入已发事项的key,返回已发列表<br>
* 2、传入待办事项的key,返回待办列表<br>
* 3、传入已办事项的key,返回已发列表<br>
* @throws BusinessException
*/
@Test
public
void
testFindColQuote_1
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
params
.
put
(
ColQueryCondition
.
state
.
name
(),
String
.
valueOf
(
StateEnum
.
col_done
.
key
()));
flipInfo
=
collaborationApi
.
findColQuote
(
flipInfo
,
params
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 查询关联文档协同列表
* 正常:<br>
* 1、传入已发事项的key,返回已发列表<br>
* 2、传入待办事项的key,返回待办列表<br>
* 3、传入已办事项的key,返回已发列表<br>
* @throws BusinessException
*/
@Test
public
void
testFindColQuote_2
()
throws
BusinessException
{
FlipInfo
flipInfo
=
new
FlipInfo
();
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
params
.
put
(
ColQueryCondition
.
state
.
name
(),
String
.
valueOf
(
StateEnum
.
col_sent
.
key
()));
flipInfo
=
collaborationApi
.
findColQuote
(
flipInfo
,
params
);
AssertUtils
.
assertCollectionNotEmpty
(
flipInfo
.
getData
());
}
/**
* 查询关联文档已发、已办、待办的总数
* 正常:<br>
* 1、查询关联文档已发、已办、待办的总数<br>
*/
@Test
public
void
testGetColAffairsCount
()
throws
BusinessException
{
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
Map
<
String
,
Integer
>
affairsCount
=
collaborationApi
.
getColAffairsCount
(
params
);
AssertUtils
.
assertNotNull
(
affairsCount
);
}
/**
* 根据已发、已办、待办查询各事项的总和
* 正常:<br>
* 1、传入已发事项的key,返回已发列表<br>
* @param query 查询参数
* key - {@link com.seeyon.apps.collaboration.enums.ColQueryCondition}.name() value - string<br>
* 必传参数<br>
* Key(String 列名) - state Value(Long) - 查询事项状态(StateEnum:col_pending,col_send,col_done的key) <br>
* @throws BusinessException
*/
@Test
public
void
testGetColAffairsCountByCondition
()
throws
BusinessException
{
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
params
.
put
(
ColQueryCondition
.
state
.
name
(),
String
.
valueOf
(
StateEnum
.
col_sent
.
key
()));
Integer
count
=
collaborationApi
.
getColAffairsCountByCondition
(
params
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 根据已发、已办、待办查询各事项的总和
* 正常:<br>
* 2、传入待办事项的key,返回待办列表<br>
* @param query 查询参数
* key - {@link com.seeyon.apps.collaboration.enums.ColQueryCondition}.name() value - string<br>
* 必传参数<br>
* Key(String 列名) - state Value(Long) - 查询事项状态(StateEnum:col_pending,col_send,col_done的key) <br>
* @throws BusinessException
*/
@Test
public
void
testGetColAffairsCountByCondition_1
()
throws
BusinessException
{
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
params
.
put
(
ColQueryCondition
.
state
.
name
(),
String
.
valueOf
(
StateEnum
.
col_pending
.
key
()));
Integer
count
=
collaborationApi
.
getColAffairsCountByCondition
(
params
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 根据已发、已办、待办查询各事项的总和
* 正常:<br>
* 3、传入已办事项的key,返回已发列表<br>
* @param query 查询参数
* key - {@link com.seeyon.apps.collaboration.enums.ColQueryCondition}.name() value - string<br>
* 必传参数<br>
* Key(String 列名) - state Value(Long) - 查询事项状态(StateEnum:col_pending,col_send,col_done的key) <br>
* @throws BusinessException
*/
@Test
public
void
testGetColAffairsCountByCondition_2
()
throws
BusinessException
{
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
ColQueryCondition
.
currentUser
.
name
(),
String
.
valueOf
(
ColApiImplDataInit
.
tanmf
.
getId
()));
params
.
put
(
ColQueryCondition
.
state
.
name
(),
String
.
valueOf
(
StateEnum
.
col_done
.
key
()));
Integer
count
=
collaborationApi
.
getColAffairsCountByCondition
(
params
);
AssertUtils
.
assertGreater
(
count
,
0
);
}
/**
* 转发协同
*/
@Test
public
void
testTransDoForward
()
throws
BusinessException
{
Long
memberId
=
ColApiImplDataInit
.
tanmf
.
getId
();
Long
templateId
=
ColApiImplDataInit
.
templatesId5
;
Long
uuid
=
UUIDLong
.
longUUID
();
ColSummary
summary
=
collaborationApi
.
getColSummary
(
uuid
);
if
(
summary
==
null
)
{
collaborationApi
.
transSendColl
(
SendType
.
normal
,
templateId
,
memberId
,
null
,
null
,
uuid
);
}
Map
params
=
new
HashMap
<
String
,
String
>();
List
<
CtpAffair
>
list
=
affairManager
.
getAffairs
(
uuid
,
StateEnum
.
col_sent
);
long
id
=
list
.
get
(
0
).
getId
();
params
.
put
(
"affairId"
,
String
.
valueOf
(
id
));
params
.
put
(
"summaryId"
,
String
.
valueOf
(
uuid
));
V3xOrgMember
tanmf
=
orgManager
.
getMemberByLoginName
(
"tanmf"
);
User
user
=
SeeyonTestUtil
.
createSessionUser
(
tanmf
);
SeeyonTestResponse
response
=
ColApiImplDataInit
.
setTransDoForwardJsonParamsToQuest
();
collaborationApi
.
transDoForward
(
user
,
params
);
// 数据销毁
AppContext
.
removeThreadContext
(
GlobalNames
.
THREAD_CONTEXT_REQUEST_KEY
);
SeeyonTestUtil
.
closeResponseIO
(
response
);
List
<
CtpAffair
>
affairs
=
affairManager
.
getAffairsByNodeId
(
14649370732230
l
);
AssertUtils
.
assertCollectionNotEmpty
(
affairs
);
}
/**
* 撤销流程
* 正常:<br>
* 1、所有参数传入正确值,撤销流程<br>
* @param affairId
* @throws BusinessException
*/
@Test
public
void
testTransRepeal_1
()
throws
BusinessException
{
Long
uuid
=
UUIDLong
.
longUUID
();
System
.
out
.
println
(
uuid
);
Long
templateId
=
ColApiImplDataInit
.
templatesId5
;
V3xOrgMember
tanmf
=
orgManager
.
getMemberByLoginName
(
"tanmf"
);
ColSummary
summary
=
collaborationApi
.
getColSummary
(
uuid
);
if
(
summary
==
null
)
{
collaborationApi
.
transSendColl
(
SendType
.
normal
,
templateId
,
tanmf
.
getId
(),
null
,
null
,
uuid
);
}
CtpAffair
affair
=
affairManager
.
getSenderAffair
(
uuid
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"content"
,
"撤销意见"
);
collaborationApi
.
transRepeal
(
affair
.
getId
(),
params
);
affair
=
affairManager
.
getSenderAffair
(
uuid
);
AssertUtils
.
assertEquals
(
affair
.
getState
().
intValue
(),
StateEnum
.
col_waitSend
.
getKey
());
}
/**
* 撤销流程
* 异常:<br>
* 所有参数传入为null,抛异常<br>
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testTransRepeal_2
()
throws
BusinessException
{
collaborationApi
.
transRepeal
(
null
,
null
);
}
/**
* 撤销流程
* 异常:<br>
* 3、传入撤销意见为空时,抛异常<br>
* @throws BusinessException
*/
@Test
(
expected
=
BusinessException
.
class
)
public
void
testTransRepeal_3
()
throws
BusinessException
{
Long
uuid
=
UUIDLong
.
longUUID
();
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"content"
,
""
);
collaborationApi
.
transRepeal
(
uuid
,
params
);
}
// /**
// * 待办收藏列表
// */
// @Test
// public void testFindFavoriteAffairs() throws BusinessException {
//
//
// FlipInfo fi = new FlipInfo();
// Map<String,String> maps = new HashMap<String,String>();
// maps.put(ColQueryCondition.currentUser.name(), String.valueOf(ColApiImplDataInit.tanmf.getId()));
//
// collaborationApi.findFavoriteAffairs(fi, maps);
//
// AssertUtils.assertCollectionNotEmpty(fi.getData());
// }
/**
* 创建处理意见
* @param summary
* @param affair
* @param extAtt1
* @param cType
* @return
*/
private
Comment
createComment
(
Long
summaryId
,
Long
affairId
,
String
extAtt1
,
CommentType
cType
,
String
extAtt4
)
{
Comment
comment
=
new
Comment
();
comment
.
setAffairId
(
affairId
);
comment
.
setAttachList
(
null
);
comment
.
setClevel
(
1
);
comment
.
setContent
(
"好的"
);
comment
.
setCreateDate
(
null
);
comment
.
setCreateId
(
null
);
comment
.
setCtype
(
cType
.
getKey
());
comment
.
setExtAtt1
(
extAtt1
);
comment
.
setExtAtt2
(
null
);
comment
.
setExtAtt3
(
null
);
comment
.
setExtAtt4
(
extAtt4
);
comment
.
setForwardCount
(
null
);
comment
.
setHidden
(
false
);
comment
.
setModuleId
(
summaryId
);
comment
.
setModuleType
(
1
);
comment
.
setPath
(
"pc"
);
comment
.
setPid
(
0L
);
comment
.
setPraiseToSummary
(
false
);
comment
.
setPushMessage
(
false
);
comment
.
setPushMessageToMembers
(
"[]"
);
comment
.
setRelateInfo
(
"[]"
);
comment
.
setShowToId
(
""
);
comment
.
setTitle
(
null
);
return
comment
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment