Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
ea75a6a7
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ea75a6a7
编写于
4月 30, 2020
作者:
L
luojing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
teamWork服务接口
上级
8d72316c
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
427 addition
and
93 deletion
+427
-93
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectTemplateFactory.java
...work/assemble/control/factory/ProjectTemplateFactory.java
+33
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionGet.java
.../x/teamwork/assemble/control/jaxrs/project/ActionGet.java
+4
-4
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListArchiveNextWithFilter.java
...ontrol/jaxrs/project/ActionListArchiveNextWithFilter.java
+6
-6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListCompletedNextWithFilter.java
...trol/jaxrs/project/ActionListCompletedNextWithFilter.java
+6
-6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListMyNextWithFilter.java
...ble/control/jaxrs/project/ActionListMyNextWithFilter.java
+6
-6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextInGroupWithFilter.java
...ontrol/jaxrs/project/ActionListNextInGroupWithFilter.java
+6
-6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextWithFilter.java
...emble/control/jaxrs/project/ActionListNextWithFilter.java
+5
-4
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNoGroupNextWithFilter.java
...ontrol/jaxrs/project/ActionListNoGroupNextWithFilter.java
+6
-6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageInGroupWithFilter.java
...ontrol/jaxrs/project/ActionListPageInGroupWithFilter.java
+8
-8
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageWithFilter.java
...emble/control/jaxrs/project/ActionListPageWithFilter.java
+8
-8
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListRecycleNextWithFilter.java
...ontrol/jaxrs/project/ActionListRecycleNextWithFilter.java
+6
-6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListStarNextWithFilter.java
...e/control/jaxrs/project/ActionListStarNextWithFilter.java
+6
-6
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionSave.java
...x/teamwork/assemble/control/jaxrs/project/ActionSave.java
+11
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjects.java
...mble/control/jaxrs/project/ActionStatisticMyProjects.java
+4
-4
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjectsGroups.java
...ontrol/jaxrs/project/ActionStatisticMyProjectsGroups.java
+4
-4
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionStatisticProjectTemplates.java
...axrs/projectTemplate/ActionStatisticProjectTemplates.java
+220
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ProjectTemplateAction.java
.../control/jaxrs/projectTemplate/ProjectTemplateAction.java
+18
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectTemplateQueryService.java
...assemble/control/service/ProjectTemplateQueryService.java
+12
-4
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskListService.java
.../x/teamwork/assemble/control/service/TaskListService.java
+43
-15
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/Project.java
...ity/src/main/java/com/x/teamwork/core/entity/Project.java
+15
-0
未找到文件。
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectTemplateFactory.java
浏览文件 @
ea75a6a7
...
...
@@ -14,6 +14,8 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.entity.PersonCard
;
import
com.x.organization.core.entity.PersonCard_
;
import
com.x.teamwork.assemble.control.AbstractFactory
;
import
com.x.teamwork.assemble.control.Business
;
import
com.x.teamwork.core.entity.Dynamic_
;
...
...
@@ -241,5 +243,36 @@ public class ProjectTemplateFactory extends AbstractFactory {
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
}
/**
* 列示所有模板的分类信息
* @param distinguishName
* @return
* @throws Exception
*/
public
List
<
String
>
fetchAllGroupType
(
String
distinguishName
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
ProjectTemplate
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ProjectTemplate
>
root
=
cq
.
from
(
ProjectTemplate
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ProjectTemplate_
.
deleted
),
false
);
cq
.
select
(
root
.
get
(
ProjectTemplate_
.
type
)).
where
(
p
).
distinct
(
true
);
return
em
.
createQuery
(
cq
).
getResultList
();
}
/**
* 根据模板类型列示模板信息
* @param type
* @return
* @throws Exception
*/
public
List
<
ProjectTemplate
>
ListProjectTemplateWithType
(
String
type
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
ProjectTemplate
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
ProjectTemplate
>
cq
=
cb
.
createQuery
(
ProjectTemplate
.
class
);
Root
<
ProjectTemplate
>
root
=
cq
.
from
(
ProjectTemplate
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ProjectTemplate_
.
deleted
),
false
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ProjectTemplate_
.
type
),
type
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
}
}
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionGet.java
浏览文件 @
ea75a6a7
...
...
@@ -45,13 +45,13 @@ public class ActionGet extends BaseAction {
result
.
error
(
exception
);
}
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
flag
);
/*String cacheKey = ApplicationCache.concreteCacheKey( flag,effectivePerson
);
Element element = projectCache.get( cacheKey );
if ((null != element) && (null != element.getObjectValue())) {
wo = (Wo) element.getObjectValue();
result.setData( wo );
}
else
{
} else {
*/
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
project
=
projectQueryService
.
get
(
flag
);
...
...
@@ -107,7 +107,7 @@ public class ActionGet extends BaseAction {
control
.
setFounder
(
false
);
}
wo
.
setControl
(
control
);
projectCache
.
put
(
new
Element
(
cacheKey
,
wo
));
//
projectCache.put(new Element(cacheKey, wo));
result
.
setData
(
wo
);
}
catch
(
Exception
e
)
{
Exception
exception
=
new
ProjectQueryException
(
e
,
"将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。"
);
...
...
@@ -115,7 +115,7 @@ public class ActionGet extends BaseAction {
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
}
//
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListArchiveNextWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -37,8 +37,8 @@ public class ActionListArchiveNextWithFilter extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -77,7 +77,7 @@ public class ActionListArchiveNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListArchiveNextWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*
cacheKey = ApplicationCache.concreteCacheKey( "ActionListArchiveNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -85,7 +85,7 @@ public class ActionListArchiveNextWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -129,7 +129,7 @@ public class ActionListArchiveNextWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -140,7 +140,7 @@ public class ActionListArchiveNextWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListCompletedNextWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -37,8 +37,8 @@ public class ActionListCompletedNextWithFilter extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -77,7 +77,7 @@ public class ActionListCompletedNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListCompletedNextWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*
cacheKey = ApplicationCache.concreteCacheKey( "ActionListCompletedNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -85,7 +85,7 @@ public class ActionListCompletedNextWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -129,7 +129,7 @@ public class ActionListCompletedNextWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -140,7 +140,7 @@ public class ActionListCompletedNextWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListMyNextWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -37,8 +37,8 @@ public class ActionListMyNextWithFilter extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -77,7 +77,7 @@ public class ActionListMyNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListMyNextWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*
cacheKey = ApplicationCache.concreteCacheKey( "ActionListMyNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -85,7 +85,7 @@ public class ActionListMyNextWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -129,7 +129,7 @@ public class ActionListMyNextWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -140,7 +140,7 @@ public class ActionListMyNextWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextInGroupWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -36,8 +36,8 @@ public class ActionListNextInGroupWithFilter extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -71,7 +71,7 @@ public class ActionListNextInGroupWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListNextInGroupWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*
cacheKey = ApplicationCache.concreteCacheKey( "ActionListNextInGroupWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -79,7 +79,7 @@ public class ActionListNextInGroupWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -123,7 +123,7 @@ public class ActionListNextInGroupWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -134,7 +134,7 @@ public class ActionListNextInGroupWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNextWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -74,7 +74,8 @@ public class ActionListNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListNextWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*采用缓存
* cacheKey = ApplicationCache.concreteCacheKey( "ActionListNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -82,7 +83,7 @@ public class ActionListNextWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -126,7 +127,7 @@ public class ActionListNextWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -137,7 +138,7 @@ public class ActionListNextWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListNoGroupNextWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -37,8 +37,8 @@ public class ActionListNoGroupNextWithFilter extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -77,7 +77,7 @@ public class ActionListNoGroupNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListNoGroupNextWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*
cacheKey = ApplicationCache.concreteCacheKey( "ActionListNoGroupNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -85,7 +85,7 @@ public class ActionListNoGroupNextWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -129,7 +129,7 @@ public class ActionListNoGroupNextWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -140,7 +140,7 @@ public class ActionListNoGroupNextWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageInGroupWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -34,8 +34,8 @@ public class ActionListPageInGroupWithFilter extends BaseAction {
ResultObject
resultObject
=
null
;
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -64,19 +64,19 @@ public class ActionListPageInGroupWithFilter extends BaseAction {
queryFilter
.
addInTerm
(
new
InTerm
(
"id"
,
new
ArrayList
<
Object
>(
queryProjectIds
)
));
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
/*
if( Boolean.TRUE.equals( check ) ){
cacheKey = ApplicationCache.concreteCacheKey( "ActionListPageWithFilter", effectivePerson.getDistinguishedName(),
pageNum, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
}
}
*/
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
if
((
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()))
{
/*
if ((null != element) && (null != element.getObjectValue())) {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -120,7 +120,7 @@ public class ActionListPageInGroupWithFilter extends BaseAction {
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
}
...
...
@@ -130,7 +130,7 @@ public class ActionListPageInGroupWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -36,8 +36,8 @@ public class ActionListPageWithFilter extends BaseAction {
ResultObject
resultObject
=
null
;
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -71,19 +71,19 @@ public class ActionListPageWithFilter extends BaseAction {
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
/*
if( Boolean.TRUE.equals( check ) ){
cacheKey = ApplicationCache.concreteCacheKey( "ActionListPageWithFilter", effectivePerson.getDistinguishedName(),
pageNum, count, wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
}
}
*/
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
if
((
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()))
{
/*
if ((null != element) && (null != element.getObjectValue())) {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -127,7 +127,7 @@ public class ActionListPageWithFilter extends BaseAction {
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
}
...
...
@@ -137,7 +137,7 @@ public class ActionListPageWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListRecycleNextWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -32,8 +32,8 @@ public class ActionListRecycleNextWithFilter extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -73,7 +73,7 @@ public class ActionListRecycleNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
)
{
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListRecycleNextWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*
cacheKey = ApplicationCache.concreteCacheKey( "ActionListRecycleNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -81,7 +81,7 @@ public class ActionListRecycleNextWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -125,7 +125,7 @@ public class ActionListRecycleNextWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -135,7 +135,7 @@ public class ActionListRecycleNextWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListStarNextWithFilter.java
浏览文件 @
ea75a6a7
...
...
@@ -37,8 +37,8 @@ public class ActionListStarNextWithFilter extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
Wi
wrapIn
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
null
;
Element
element
=
null
;
//
String cacheKey = null;
//
Element element = null;
QueryFilter
queryFilter
=
null
;
List
<
String
>
queryProjectIds
=
new
ArrayList
<>();
...
...
@@ -77,7 +77,7 @@ public class ActionListStarNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionListStarNextWithFilter"
,
effectivePerson
.
getDistinguishedName
(),
flag
,
count
,
/*
cacheKey = ApplicationCache.concreteCacheKey( "ActionListStarNextWithFilter", effectivePerson.getDistinguishedName(), flag, count,
wrapIn.getOrderField(), wrapIn.getOrderType(), queryFilter.getContentSHA1() );
element = projectCache.get( cacheKey );
...
...
@@ -85,7 +85,7 @@ public class ActionListStarNextWithFilter extends BaseAction {
resultObject = (ResultObject) element.getObjectValue();
result.setCount( resultObject.getTotal() );
result.setData( resultObject.getWos() );
}
else
{
} else {
*/
try
{
//获取用户能查看的所有的项目信息ID列表,最多查询2000条数据
List
<
String
>
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
queryFilter
);
...
...
@@ -129,7 +129,7 @@ public class ActionListStarNextWithFilter extends BaseAction {
}
}
resultObject
=
new
ResultObject
(
total
,
wos
);
projectCache
.
put
(
new
Element
(
cacheKey
,
resultObject
));
//
projectCache.put(new Element( cacheKey, resultObject ));
result
.
setCount
(
resultObject
.
getTotal
()
);
result
.
setData
(
resultObject
.
getWos
()
);
...
...
@@ -140,7 +140,7 @@ public class ActionListStarNextWithFilter extends BaseAction {
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
//
}
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionSave.java
浏览文件 @
ea75a6a7
...
...
@@ -136,6 +136,9 @@ public class ActionSave extends BaseAction {
@FieldDescribe
(
"执行者|负责人,非必填"
)
private
String
executor
;
@FieldDescribe
(
"模板id"
)
private
String
templateId
;
@FieldDescribe
(
"管理者,非必填"
)
private
List
<
String
>
manageablePersonList
;
...
...
@@ -220,6 +223,14 @@ public class ActionSave extends BaseAction {
public
void
setExecutor
(
String
executor
)
{
this
.
executor
=
executor
;
}
public
String
getTemplateId
()
{
return
templateId
;
}
public
void
setTemplateId
(
String
templateId
)
{
this
.
templateId
=
templateId
;
}
public
List
<
String
>
getManageablePersonList
()
{
return
manageablePersonList
;
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjects.java
浏览文件 @
ea75a6a7
...
...
@@ -43,13 +43,13 @@ public class ActionStatisticMyProjects extends BaseAction {
Integer
archiveCount
=
0
;
Integer
deleteCount
=
0
;
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionStatisticMyProjects"
,
effectivePerson
.
getDistinguishedName
()
);
/*
String cacheKey = ApplicationCache.concreteCacheKey( "ActionStatisticMyProjects", effectivePerson.getDistinguishedName() );
Element element = projectCache.get( cacheKey );
if ((null != element) && (null != element.getObjectValue())) {
wo = (Wo) element.getObjectValue();
result.setData( wo );
}
else
{
} else {
*/
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
//查询我参与的所有项目
...
...
@@ -127,7 +127,7 @@ public class ActionStatisticMyProjects extends BaseAction {
SortTools
.
asc
(
woGroupList
,
"createTime"
);
}
wo
.
setGroups
(
woGroupList
);
projectCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
//
projectCache.put( new Element(cacheKey, wo) );
result
.
setData
(
wo
);
}
catch
(
Exception
e
)
{
Exception
exception
=
new
ProjectQueryException
(
e
,
"将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。"
);
...
...
@@ -135,7 +135,7 @@ public class ActionStatisticMyProjects extends BaseAction {
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
}
//
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjectsGroups.java
浏览文件 @
ea75a6a7
...
...
@@ -34,13 +34,13 @@ public class ActionStatisticMyProjectsGroups extends BaseAction {
List
<
WoGroup
>
woGroupList
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionStatisticMyProjectsGroups"
,
effectivePerson
.
getDistinguishedName
()
);
/*
String cacheKey = ApplicationCache.concreteCacheKey( "ActionStatisticMyProjectsGroups", effectivePerson.getDistinguishedName() );
Element element = projectCache.get( cacheKey );
if ((null != element) && (null != element.getObjectValue())) {
wo = (Wo) element.getObjectValue();
result.setData( wo );
}
else
{
} else {
*/
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
//查询我参与的所有项目
...
...
@@ -92,14 +92,14 @@ public class ActionStatisticMyProjectsGroups extends BaseAction {
wo
.
setGroups
(
woGroupList
);
result
.
setData
(
wo
);
projectCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
//
projectCache.put( new Element(cacheKey, wo) );
}
catch
(
Exception
e
)
{
Exception
exception
=
new
ProjectQueryException
(
e
,
"将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
}
//
}
return
result
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ActionStatisticProjectTemplates.java
0 → 100644
浏览文件 @
ea75a6a7
package
com.x.teamwork.assemble.control.jaxrs.projectTemplate
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.teamwork.assemble.control.Business
;
import
com.x.teamwork.core.entity.ProjectTemplate
;
import
com.x.teamwork.core.entity.tools.filter.QueryFilter
;
import
net.sf.ehcache.Element
;
public
class
ActionStatisticProjectTemplates
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionStatisticProjectTemplates
.
class
);
protected
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
EffectivePerson
effectivePerson
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
List
<
String
>
projectTemplateIds
=
null
;
List
<
ProjectTemplate
>
projectTemplateList
=
null
;
List
<
String
>
projectGroupList
=
null
;
List
<
WoGroup
>
woGroupList
=
new
ArrayList
<>();
Business
business
=
null
;
Boolean
check
=
true
;
Integer
allCount
=
0
;
Integer
myCount
=
0
;
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"ActionStatisticProjectTemplates"
,
effectivePerson
.
getDistinguishedName
()
);
Element
element
=
projectTemplateCache
.
get
(
cacheKey
);
if
((
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
result
.
setData
(
wo
);
}
else
{
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
//查询所有模板
projectTemplateIds
=
projectTemplateQueryService
.
listAllProjectTemplateIds
(
effectivePerson
,
2000
,
new
QueryFilter
()
);
if
(
ListTools
.
isNotEmpty
(
projectTemplateIds
))
{
projectTemplateList
=
projectTemplateQueryService
.
list
(
projectTemplateIds
);
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ProjectTemplateQueryException
(
e
,
"查询所有项目模板信息列表时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
//查询我所有的项目组列表
//projectGroupList = projectGroupQueryService.listGroupByPerson( effectivePerson.getDistinguishedName() );
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
business
=
new
Business
(
emc
);
projectGroupList
=
business
.
projectTemplateFactory
().
fetchAllGroupType
(
effectivePerson
.
getDistinguishedName
());
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ProjectTemplateQueryException
(
e
,
"查询用户所有项目模板信息列表时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
if
(
ListTools
.
isNotEmpty
(
projectTemplateList
))
{
for
(
ProjectTemplate
projectTemplate
:
projectTemplateList
)
{
allCount
++;
if
(
projectTemplate
.
getOwner
().
equalsIgnoreCase
(
effectivePerson
.
getDistinguishedName
()
))
{
myCount
++;
}
}
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)){
if
(
ListTools
.
isNotEmpty
(
projectGroupList
))
{
for
(
String
projectGroup
:
projectGroupList
)
{
List
<
ProjectTemplate
>
templateLists
=
business
.
projectTemplateFactory
().
ListProjectTemplateWithType
(
projectGroup
);
if
(
ListTools
.
isNotEmpty
(
templateLists
)){
List
<
WoTemplate
>
woTemplate
=
new
ArrayList
<>();
WoGroup
woGroup
=
new
WoGroup
();
String
type
=
""
;
woTemplate
=
WoTemplate
.
copier
.
copy
(
templateLists
);
for
(
ProjectTemplate
templateList
:
templateLists
){
woGroup
.
addProjectTemplateTypeCount
(
1
);
type
=
templateList
.
getType
();
}
woGroup
.
setProjecTemplatetTypeName
(
type
);
woGroup
.
setWoTemplate
(
woTemplate
);
woGroupList
.
add
(
woGroup
);
}
}
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
wo
=
new
Wo
();
wo
.
setAllCount
(
allCount
);
wo
.
setMyCount
(
myCount
);
//SortTools.asc( woGroupList, "projectTemplateTypeCount");
wo
.
setGroups
(
woGroupList
);
projectTemplateCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
result
.
setData
(
wo
);
}
catch
(
Exception
e
)
{
Exception
exception
=
new
ProjectTemplateQueryException
(
e
,
"将查询出来的应用项目模板信息对象转换为可输出的数据信息时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
}
return
result
;
}
public
static
class
Wo
{
@FieldDescribe
(
"所有项目数量"
)
private
Integer
allCount
=
0
;
@FieldDescribe
(
"所有项目数量"
)
private
Integer
myCount
=
0
;
@FieldDescribe
(
"所有分组信息"
)
private
List
<
WoGroup
>
groups
=
null
;
public
List
<
WoGroup
>
getGroups
()
{
return
groups
;
}
public
void
setGroups
(
List
<
WoGroup
>
groups
)
{
this
.
groups
=
groups
;
}
public
Integer
getAllCount
()
{
return
allCount
;
}
public
void
setAllCount
(
Integer
allCount
)
{
this
.
allCount
=
allCount
;
}
public
Integer
getMyCount
()
{
return
myCount
;
}
public
void
setMyCount
(
Integer
myCount
)
{
this
.
myCount
=
myCount
;
}
}
public
static
class
WoTemplate
extends
ProjectTemplate
{
private
static
final
long
serialVersionUID
=
-
5076990764713538973L
;
public
static
WrapCopier
<
ProjectTemplate
,
WoTemplate
>
copier
=
WrapCopierFactory
.
wo
(
ProjectTemplate
.
class
,
WoTemplate
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
}
public
static
class
WoGroup
{
@FieldDescribe
(
"分组项目数量"
)
private
Integer
projectTemplateTypeCount
=
0
;
@FieldDescribe
(
"分组名称"
)
private
String
projecTemplatetTypeName
;
public
String
getProjecTemplatetName
()
{
return
projecTemplatetTypeName
;
}
public
void
setProjecTemplatetTypeName
(
String
projecTemplatetTypeName
)
{
this
.
projecTemplatetTypeName
=
projecTemplatetTypeName
;
}
public
Integer
getProjectTemplateTypeCount
()
{
return
projectTemplateTypeCount
;
}
public
void
setProjectTemplateTypeCount
(
Integer
projectTemplateTypeCount
)
{
this
.
projectTemplateTypeCount
=
projectTemplateTypeCount
;
}
public
void
addProjectTemplateTypeCount
(
Integer
count
)
{
if
(
this
.
projectTemplateTypeCount
==
null
)
{
this
.
projectTemplateTypeCount
=
0
;
}
this
.
projectTemplateTypeCount
+=
count
;
}
@FieldDescribe
(
"所有分组信息"
)
private
List
<
WoTemplate
>
woTemplate
=
null
;
public
List
<
WoTemplate
>
getWoTemplate
()
{
return
woTemplate
;
}
public
void
setWoTemplate
(
List
<
WoTemplate
>
woTemplate
)
{
this
.
woTemplate
=
woTemplate
;
}
}
}
\ No newline at end of file
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/projectTemplate/ProjectTemplateAction.java
浏览文件 @
ea75a6a7
...
...
@@ -35,6 +35,24 @@ public class ProjectTemplateAction extends StandardJaxrsAction {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectTemplateAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"查询项目模板统计信息."
,
action
=
ActionStatisticProjectTemplates
.
class
)
@GET
@Path
(
"statitic/all"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
statiticMyProject
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
ActionStatisticProjectTemplates
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionStatisticProjectTemplates
().
execute
(
request
,
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"根据ID查询项目模板信息."
,
action
=
ActionGet
.
class
)
@GET
@Path
(
"{id}"
)
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectTemplateQueryService.java
浏览文件 @
ea75a6a7
...
...
@@ -3,12 +3,20 @@ package com.x.teamwork.assemble.control.service;
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.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.entity.PersonCard
;
import
com.x.organization.core.entity.PersonCard_
;
import
com.x.teamwork.core.entity.Project
;
import
com.x.teamwork.core.entity.ProjectDetail
;
import
com.x.teamwork.core.entity.ProjectTemplate
;
...
...
@@ -47,7 +55,7 @@ public class ProjectTemplateQueryService {
}
/**
* 根据项目
的标识查询项目
信息
* 根据项目
模板的标识查询模板对应的泳道
信息
* @param id
* @return
* @throws Exception
...
...
@@ -91,17 +99,17 @@ public class ProjectTemplateQueryService {
}
/**
* 根据ID列表查询项目信息列表
* 根据ID列表查询项目
模板
信息列表
* @param ids
* @return
* @throws Exception
*/
public
List
<
Project
>
list
(
List
<
String
>
ids
)
throws
Exception
{
public
List
<
Project
Template
>
list
(
List
<
String
>
ids
)
throws
Exception
{
if
(
ListTools
.
isEmpty
(
ids
))
{
return
null
;
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
return
emc
.
list
(
Project
.
class
,
ids
);
return
emc
.
list
(
Project
Template
.
class
,
ids
);
}
catch
(
Exception
e
)
{
throw
e
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskListService.java
浏览文件 @
ea75a6a7
...
...
@@ -10,6 +10,9 @@ import com.x.base.core.entity.annotation.CheckPersistType;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.teamwork.assemble.control.Business
;
import
com.x.teamwork.assemble.control.jaxrs.list.ActionListWithTaskGroup.Wo
;
import
com.x.teamwork.core.entity.Project
;
import
com.x.teamwork.core.entity.ProjectTemplate
;
import
com.x.teamwork.core.entity.TaskGroup
;
import
com.x.teamwork.core.entity.TaskList
;
import
com.x.teamwork.core.entity.TaskListRele
;
...
...
@@ -226,23 +229,48 @@ class TaskListService {
TaskList
taskList
=
null
;
if
(
taskGroup
!=
null
)
{
emc
.
beginTransaction
(
TaskList
.
class
);
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"已规划的工作"
,
1
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"已分解的任务"
,
21
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
Project
project
=
emc
.
find
(
taskGroup
.
getProject
(),
Project
.
class
);
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"进行中的任务"
,
3
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
emc
.
beginTransaction
(
TaskList
.
class
);
if
(
project
!=
null
&&
StringUtils
.
isNotEmpty
(
project
.
getTemplateId
()
)){
//如果有模板id,则按模板创建泳道,否则创建默认的四个泳道
ProjectTemplate
projectTemplate
=
emc
.
find
(
project
.
getTemplateId
(),
ProjectTemplate
.
class
);
if
(
projectTemplate
!=
null
){
List
<
String
>
taskListNames
=
null
;
taskListNames
=
projectTemplate
.
getTaskList
();
if
(
ListTools
.
isNotEmpty
(
taskListNames
)){
int
nameCount
=
0
;
for
(
String
taskListName
:
taskListNames
)
{
nameCount
++;
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
taskListName
,
nameCount
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
}
}
else
{
throw
new
Exception
(
"TaskListTemplate not exists!ProjectTemplateID:"
+
project
.
getTemplateId
()
);
}
}
else
{
throw
new
Exception
(
"ProjectTemplate not exists!ID:"
+
project
.
getTemplateId
()
);
}
}
else
{
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"已规划的工作"
,
1
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"已分解的任务"
,
2
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"进行中的任务"
,
3
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"已完成的任务"
,
4
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
}
taskList
=
composeTaskListObject
(
taskGroup
.
getProject
(),
taskGroupId
,
"已完成的任务"
,
4
,
"SYSTEM"
,
person
,
""
);
emc
.
persist
(
taskList
,
CheckPersistType
.
all
);
taskLists
.
add
(
taskList
);
emc
.
commit
();
}
...
...
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/Project.java
浏览文件 @
ea75a6a7
...
...
@@ -133,6 +133,13 @@ public class Project extends SliceJpaObject {
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
executor_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
executor
;
public
static
final
String
templateId_FIELDNAME
=
"templateId"
;
@FieldDescribe
(
"模板id"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
templateId_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
templateId_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
templateId
;
public
static
final
String
starPersonList_FIELDNAME
=
"starPersonList"
;
@FieldDescribe
(
"标星人员"
)
...
...
@@ -255,6 +262,14 @@ public class Project extends SliceJpaObject {
public
void
setExecutor
(
String
executor
)
{
this
.
executor
=
executor
;
}
public
String
getTemplateId
()
{
return
templateId
;
}
public
void
setTemplateId
(
String
templateId
)
{
this
.
templateId
=
templateId
;
}
public
List
<
String
>
getParticipantPersonList
()
{
return
participantPersonList
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录