Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
8ebef04a
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
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,发现更多精彩内容 >>
提交
8ebef04a
编写于
4月 21, 2020
作者:
L
luojing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
teamwork功能修改及优化
上级
ec12eaa5
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
648 addition
and
71 deletion
+648
-71
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectFactory.java
...m/x/teamwork/assemble/control/factory/ProjectFactory.java
+5
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ReviewFactory.java
...om/x/teamwork/assemble/control/factory/ReviewFactory.java
+4
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/list/ActionListWithTaskGroup.java
.../assemble/control/jaxrs/list/ActionListWithTaskGroup.java
+5
-5
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionListPageWithFilter.java
...emble/control/jaxrs/project/ActionListPageWithFilter.java
+2
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjects.java
...mble/control/jaxrs/project/ActionStatisticMyProjects.java
+2
-1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionTemplateSave.java
...rk/assemble/control/jaxrs/project/ActionTemplateSave.java
+235
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/BaseAction.java
...x/teamwork/assemble/control/jaxrs/project/BaseAction.java
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionCopyTask.java
.../teamwork/assemble/control/jaxrs/task/ActionCopyTask.java
+23
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionDelete.java
.../x/teamwork/assemble/control/jaxrs/task/ActionDelete.java
+1
-1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionGet.java
...com/x/teamwork/assemble/control/jaxrs/task/ActionGet.java
+10
-46
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListNextWithFilter.java
...assemble/control/jaxrs/task/ActionListNextWithFilter.java
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListPageWithFilter.java
...assemble/control/jaxrs/task/ActionListPageWithFilter.java
+1
-1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionStatisticMyTasks.java
...k/assemble/control/jaxrs/task/ActionStatisticMyTasks.java
+1
-1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewAllListNextWithFilter.java
...e/control/jaxrs/task/ActionViewAllListNextWithFilter.java
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewCompletedListNextWithFilter.java
...rol/jaxrs/task/ActionViewCompletedListNextWithFilter.java
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewMyExecutListNextWithFilter.java
...trol/jaxrs/task/ActionViewMyExecutListNextWithFilter.java
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewOverTimeListNextWithFilter.java
...trol/jaxrs/task/ActionViewOverTimeListNextWithFilter.java
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewUncompletedListNextWithFilter.java
...l/jaxrs/task/ActionViewUncompletedListNextWithFilter.java
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/TaskGroupWithProjectNotExistsException.java
...ol/jaxrs/task/TaskGroupWithProjectNotExistsException.java
+12
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectQueryService.java
...eamwork/assemble/control/service/ProjectQueryService.java
+2
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectService.java
...m/x/teamwork/assemble/control/service/ProjectService.java
+90
-3
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ReviewService.java
...om/x/teamwork/assemble/control/service/ReviewService.java
+4
-1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskGroupQueryService.java
...mwork/assemble/control/service/TaskGroupQueryService.java
+29
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskListQueryService.java
...amwork/assemble/control/service/TaskListQueryService.java
+8
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskPersistService.java
...teamwork/assemble/control/service/TaskPersistService.java
+11
-7
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskService.java
.../com/x/teamwork/assemble/control/service/TaskService.java
+9
-3
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/timertask/Timertask_CheckAllTaskOverTime.java
...ble/control/timertask/Timertask_CheckAllTaskOverTime.java
+2
-1
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/PersistenceProperties.java
...ava/com/x/teamwork/core/entity/PersistenceProperties.java
+4
-0
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/ProjectTemplate.java
...main/java/com/x/teamwork/core/entity/ProjectTemplate.java
+180
-0
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/TaskView.java
...ty/src/main/java/com/x/teamwork/core/entity/TaskView.java
+1
-1
未找到文件。
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ProjectFactory.java
浏览文件 @
8ebef04a
...
...
@@ -238,6 +238,11 @@ public class ProjectFactory extends AbstractFactory {
Root
<
Project
>
root
=
cq
.
from
(
Project
.
class
);
Predicate
p_permission
=
null
;
System
.
out
.
println
(
"personName="
+
personName
);
System
.
out
.
println
(
"identityNames="
+
identityNames
);
System
.
out
.
println
(
"unitNames="
+
unitNames
);
System
.
out
.
println
(
"groupNames="
+
groupNames
);
if
(
StringUtils
.
isNotEmpty
(
personName
))
{
//可以管理的栏目,肯定可以发布信息
p_permission
=
CriteriaBuilderTools
.
predicate_or
(
cb
,
p_permission
,
cb
.
isMember
(
personName
,
root
.
get
(
Project_
.
participantPersonList
))
);
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/factory/ReviewFactory.java
浏览文件 @
8ebef04a
...
...
@@ -51,6 +51,7 @@ public class ReviewFactory extends AbstractFactory {
Root
<
Review
>
root
=
cq
.
from
(
Review
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Review_
.
permissionObj
),
person
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Review_
.
project
),
project
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Review_
.
deleted
),
false
));
cq
.
select
(
root
.
get
(
Review_
.
taskId
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
();
}
...
...
@@ -65,6 +66,7 @@ public class ReviewFactory extends AbstractFactory {
Root
<
Review
>
root
=
cq
.
from
(
Review
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Review_
.
project
),
project
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Review_
.
permissionObj
),
person
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Review_
.
deleted
),
false
));
cq
.
select
(
root
.
get
(
Review_
.
taskId
)
).
where
(
p
);
return
em
.
createQuery
(
cq
).
setMaxResults
(
maxCount
).
getResultList
();
}
...
...
@@ -184,6 +186,7 @@ public class ReviewFactory extends AbstractFactory {
Root
<
Review
>
root
=
cq
.
from
(
Review
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Review_
.
permissionObj
),
personName
);
p
=
cb
.
and
(
p
,
root
.
get
(
Review_
.
taskId
).
in
(
taskIds
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Review_
.
deleted
),
false
));
cq
.
select
(
root
.
get
(
Review_
.
taskId
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
();
}
...
...
@@ -201,6 +204,7 @@ public class ReviewFactory extends AbstractFactory {
Root
<
Review
>
root
=
cq
.
from
(
Review
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Review_
.
permissionObj
),
person
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Review_
.
parent
),
taskId
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Review_
.
deleted
),
false
));
return
em
.
createQuery
(
cq
.
where
(
p
)
).
getResultList
();
}
}
\ No newline at end of file
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/list/ActionListWithTaskGroup.java
浏览文件 @
8ebef04a
...
...
@@ -29,14 +29,14 @@ public class ActionListWithTaskGroup extends BaseAction {
List
<
Wo
>
wos
=
null
;
List
<
TaskList
>
taskLists
=
null
;
Boolean
check
=
true
;
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"list.my.taskgroup"
,
taskGroupId
,
effectivePerson
.
getDistinguishedName
()
);
/*String cacheKey = ApplicationCache.concreteCacheKey( "list.my.taskgroup", taskGroupId, effectivePerson.getDistinguishedName() );
Element element = taskListCache.get( cacheKey );
if ((null != element) && (null != element.getObjectValue())) {
System.out.println("111");
wos = (List<Wo>) element.getObjectValue();
result.setData( wos );
}
else
{
} else {
*/
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
taskLists
=
taskListQueryService
.
listWithTaskGroup
(
effectivePerson
.
getDistinguishedName
(),
taskGroupId
);
...
...
@@ -53,7 +53,7 @@ public class ActionListWithTaskGroup extends BaseAction {
}
}
}
taskListCache
.
put
(
new
Element
(
cacheKey
,
wos
));
//
taskListCache.put(new Element(cacheKey, wos));
result
.
setData
(
wos
);
}
}
catch
(
Exception
e
)
{
...
...
@@ -63,7 +63,7 @@ public class ActionListWithTaskGroup 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/ActionListPageWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -51,6 +51,8 @@ public class ActionListPageWithFilter extends BaseAction {
if
(
wrapIn
==
null
)
{
wrapIn
=
new
Wi
();
}
//添加过滤条件未删除状态才被查询
wrapIn
.
setDeleted
(
"false"
);
queryFilter
=
wrapIn
.
getQueryFilter
();
if
(
StringUtils
.
isNotEmpty
(
wrapIn
.
getGroup
()
))
{
//如果项目分组不为空,那么需要先根据项目分组来查询这个分组下的所有项目ID集合
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionStatisticMyProjects.java
浏览文件 @
8ebef04a
...
...
@@ -18,6 +18,7 @@ import com.x.base.core.project.tools.SortTools;
import
com.x.teamwork.core.entity.Project
;
import
com.x.teamwork.core.entity.ProjectGroup
;
import
com.x.teamwork.core.entity.tools.filter.QueryFilter
;
import
com.x.teamwork.core.entity.tools.filter.term.EqualsTerm
;
import
net.sf.ehcache.Element
;
...
...
@@ -52,7 +53,7 @@ public class ActionStatisticMyProjects extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
//查询我参与的所有项目
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
new
QueryFilter
()
);
projectIds
=
projectQueryService
.
listAllViewableProjectIds
(
effectivePerson
,
2000
,
new
QueryFilter
()
);
if
(
ListTools
.
isNotEmpty
(
projectIds
))
{
projectList
=
projectQueryService
.
list
(
projectIds
);
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/ActionTemplateSave.java
0 → 100644
浏览文件 @
8ebef04a
package
com.x.teamwork.assemble.control.jaxrs.project
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.teamwork.assemble.control.service.BatchOperationPersistService
;
import
com.x.teamwork.assemble.control.service.BatchOperationProcessService
;
import
com.x.teamwork.core.entity.Dynamic
;
import
com.x.teamwork.core.entity.Project
;
import
com.x.teamwork.core.entity.ProjectDetail
;
import
com.x.teamwork.core.entity.ProjectGroup
;
import
com.x.teamwork.core.entity.ProjectTemplate
;
import
com.x.teamwork.core.entity.Task
;
public
class
ActionTemplateSave
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionTemplateSave
.
class
);
protected
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ProjectTemplate
template
=
null
;
ProjectTemplate
old_template
=
null
;
Wi
wi
=
null
;
Wo
wo
=
new
Wo
();
Boolean
check
=
true
;
try
{
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ProjectPersistException
(
e
,
"系统在将JSON信息转换为对象时发生异常。JSON:"
+
jsonElement
.
toString
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
/*if( Boolean.TRUE.equals( check ) ){
old_template = projectQueryService.get( wi.getId() );
}
if( Boolean.TRUE.equals( check ) ){
ProjectDetail projectDetail = new ProjectDetail();
projectDetail.setDescription( wi.getDescription() );
try {
if( ListTools.isNotEmpty( wi.getGroups() )) {
wi.setGroupCount( wi.getGroups().size() );
}
template = projectPersistService.save( Wi.copier.copy(wi), projectDetail, effectivePerson );
//将项目添加到指定的项目组
projectGroupPersistService.releProjectToGroup( template.getId(), wi.getGroups() );
// 更新缓存
ApplicationCache.notify( Project.class );
ApplicationCache.notify( ProjectGroup.class );
ApplicationCache.notify( Task.class, ApplicationCache.concreteCacheKey( "ActionStatisticMyTasks", template.getId(), effectivePerson.getDistinguishedName() ) );
ApplicationCache.notify( Task.class, ApplicationCache.concreteCacheKey( "ActionStatisticMyTaskViews", template.getId(), effectivePerson.getDistinguishedName() ) );
wo.setId( template.getId() );
} catch (Exception e) {
check = false;
Exception exception = new ProjectPersistException(e, "项目信息保存时发生异常。");
result.error(exception);
logger.error(e, effectivePerson, request, null);
}
}
*/
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
new
BatchOperationPersistService
().
addOperation
(
BatchOperationProcessService
.
OPT_OBJ_PROJECT
,
BatchOperationProcessService
.
OPT_TYPE_PERMISSION
,
template
.
getId
(),
template
.
getId
(),
"刷新文档权限:ID="
+
template
.
getId
()
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
/*if( Boolean.TRUE.equals( check ) ){
try {
List<Dynamic> dynamics = dynamicPersistService.projectSaveDynamic(old_template, template, effectivePerson, jsonElement.toString() );
if( dynamics == null ) {
dynamics = new ArrayList<>();
}
if( wo != null ) {
wo.setDynamics(WoDynamic.copier.copy(dynamics));
}
} catch (Exception e) {
logger.error(e, effectivePerson, request, null);
}
}*/
result
.
setData
(
wo
);
return
result
;
}
public
static
class
Wi
{
@FieldDescribe
(
"数据库主键,自动生成,非必填."
)
private
String
id
;
@FieldDescribe
(
"模板名称,必填"
)
private
String
title
;
@FieldDescribe
(
"排序号,非必填"
)
private
Integer
order
;
@FieldDescribe
(
"模板类型,非必填"
)
private
String
type
;
@FieldDescribe
(
"图标文件ID,非必填"
)
private
String
icon
=
null
;
@FieldDescribe
(
"说明信息(1M),非必填"
)
private
String
description
;
@FieldDescribe
(
"模板包含的默认永道,可多值,非必填."
)
private
List
<
String
>
taskList
=
null
;
private
String
owner
=
null
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Integer
getOrder
()
{
return
order
;
}
public
void
setOrder
(
Integer
order
)
{
this
.
order
=
order
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
public
String
getOwner
()
{
return
owner
;
}
public
void
setOwner
(
String
owner
)
{
this
.
owner
=
owner
;
}
public
List
<
String
>
getTaskList
()
{
return
taskList
;
}
public
void
setTaskList
(
List
<
String
>
taskList
)
{
this
.
taskList
=
taskList
;
}
}
public
static
class
Wo
extends
WoId
{
@FieldDescribe
(
"操作引起的动态内容"
)
List
<
WoDynamic
>
dynamics
=
new
ArrayList
<>();
public
List
<
WoDynamic
>
getDynamics
()
{
return
dynamics
;
}
public
void
setDynamics
(
List
<
WoDynamic
>
dynamics
)
{
this
.
dynamics
=
dynamics
;
}
}
public
static
class
WoDynamic
extends
Dynamic
{
private
static
final
long
serialVersionUID
=
-
5076990764713538973L
;
public
static
WrapCopier
<
Dynamic
,
WoDynamic
>
copier
=
WrapCopierFactory
.
wo
(
Dynamic
.
class
,
WoDynamic
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
private
Long
rank
=
0L
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
}
}
\ No newline at end of file
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/project/BaseAction.java
浏览文件 @
8ebef04a
...
...
@@ -8,6 +8,7 @@ import com.x.teamwork.assemble.control.service.ProjectGroupQueryService;
import
com.x.teamwork.assemble.control.service.ProjectPersistService
;
import
com.x.teamwork.assemble.control.service.ProjectQueryService
;
import
com.x.teamwork.assemble.control.service.SystemConfigQueryService
;
import
com.x.teamwork.assemble.control.service.TaskPersistService
;
import
com.x.teamwork.core.entity.Project
;
import
net.sf.ehcache.Ehcache
;
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionCopyTask.java
浏览文件 @
8ebef04a
...
...
@@ -13,6 +13,7 @@ import com.x.base.core.project.logger.LoggerFactory;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.teamwork.assemble.control.service.BatchOperationPersistService
;
import
com.x.teamwork.assemble.control.service.BatchOperationProcessService
;
import
com.x.teamwork.assemble.control.service.UserManagerService
;
import
com.x.teamwork.core.entity.*
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -26,6 +27,7 @@ import java.util.List;
public
class
ActionCopyTask
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionCopyTask
.
class
);
private
UserManagerService
userManagerService
=
new
UserManagerService
();
/**
* 将指定的任务复制为新的工作任务
...
...
@@ -48,6 +50,8 @@ public class ActionCopyTask extends BaseAction {
TaskExtField
taskExtField
=
null
;
List
<
Dynamic
>
dynamics
=
new
ArrayList
<>();
Boolean
check
=
true
;
List
<
String
>
groupIds
=
null
;
List
<
String
>
listIds
=
null
;
if
(
StringUtils
.
isEmpty
(
sourceTaskId
)
)
{
check
=
false
;
...
...
@@ -63,6 +67,8 @@ public class ActionCopyTask extends BaseAction {
Exception
exception
=
new
TaskNotExistsException
(
sourceTaskId
);
result
.
error
(
exception
);
}
groupIds
=
taskGroupQueryService
.
listGroupIdsByTask
(
sourceTask
.
getId
()
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
TaskQueryException
(
e
,
"根据指定ID查询工作任务信息对象时发生异常。ID:"
+
sourceTaskId
);
...
...
@@ -96,6 +102,7 @@ public class ActionCopyTask extends BaseAction {
Task
newTask
=
new
Task
();
TaskDetail
newTaskDetail
=
new
TaskDetail
();
TaskExtField
newTaskExtField
=
new
TaskExtField
();
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
//COPY对象
sourceTask
.
copyTo
(
newTask
);
...
...
@@ -104,6 +111,10 @@ public class ActionCopyTask extends BaseAction {
//重新命名
newTask
.
setName
(
sourceTask
.
getName
()
+
" - 副本"
);
//调整负责人为当前用户
newTask
.
setExecutor
(
effectivePerson
.
getDistinguishedName
());
newTask
.
setExecutorIdentity
(
userManagerService
.
getIdentityWithPerson
(
newTask
.
getExecutor
(),
"min"
));
//调整ID
newTask
.
setId
(
Task
.
createId
()
);
...
...
@@ -113,6 +124,18 @@ public class ActionCopyTask extends BaseAction {
try
{
newTask
=
taskPersistService
.
save
(
newTask
,
newTaskDetail
,
newTaskExtField
,
effectivePerson
);
wo
.
setId
(
newTask
.
getId
()
);
if
(
ListTools
.
isNotEmpty
(
groupIds
)){
if
(
!
taskGroupQueryService
.
existsWithTaskAndGroup
(
groupIds
.
get
(
0
),
newTask
.
getId
()
)){
//添加任务和任务组的关联
taskGroupPersistService
.
addTaskToGroup
(
newTask
.
getId
(),
groupIds
.
get
(
0
)
);
taskGroupPersistService
.
refreshTaskCountInTaskGroupWithTaskId
(
effectivePerson
.
getDistinguishedName
(),
newTask
.
getId
()
);
listIds
=
taskListQueryService
.
listTaskListIdWithTaskId
(
sourceTask
.
getId
(),
groupIds
.
get
(
0
));
}
}
if
(
ListTools
.
isNotEmpty
(
listIds
)){
taskListPersistService
.
addTaskToTaskListWithOrderNumber
(
newTask
.
getId
(),
listIds
.
get
(
0
),
null
,
effectivePerson
);
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
TaskPersistException
(
e
,
"工作上级任务ID信息更新时发生异常。"
);
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionDelete.java
浏览文件 @
8ebef04a
...
...
@@ -61,7 +61,7 @@ public class ActionDelete extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
taskPersistService
.
delete
(
flag
,
effectivePerson
);
//
taskGroupPersistService.refreshTaskCountInTaskGroupWithTaskId( effectivePerson.getDistinguishedName(), flag );
taskGroupPersistService
.
refreshTaskCountInTaskGroupWithTaskId
(
effectivePerson
.
getDistinguishedName
(),
flag
);
// 更新缓存
ApplicationCache
.
notify
(
Task
.
class
);
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionGet.java
浏览文件 @
8ebef04a
...
...
@@ -41,7 +41,7 @@ public class ActionGet extends BaseAction {
result
.
error
(
exception
);
}
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
flag
);
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
flag
,
effectivePerson
);
Element
element
=
taskCache
.
get
(
cacheKey
);
if
((
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()))
{
...
...
@@ -133,7 +133,8 @@ public class ActionGet extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
List
<
String
>
groupIds
=
null
;
try
{
groupIds
=
taskGroupQueryService
.
listGroupIdsByTask
(
task
.
getId
()
);
//groupIds = taskGroupQueryService.listGroupIdsByTask( task.getId() );
groupIds
=
taskGroupQueryService
.
listGroupIdsByPersonAndProject
(
effectivePerson
,
task
.
getProject
());
if
(
ListTools
.
isNotEmpty
(
groupIds
)){
wo
.
setTaskGroupId
(
groupIds
.
get
(
0
)
);
}
...
...
@@ -153,6 +154,13 @@ public class ActionGet extends BaseAction {
listIds
=
taskListQueryService
.
listTaskListIdWithTaskId
(
task
.
getId
(),
wo
.
getTaskGroupId
()
);
if
(
ListTools
.
isNotEmpty
(
listIds
)){
wo
.
setTaskListId
(
listIds
.
get
(
0
)
);
}
else
{
//返回当前项目的未分类taskListId
List
<
TaskList
>
taskList
=
null
;
taskList
=
taskListQueryService
.
listWithTaskGroup
(
effectivePerson
.
getDistinguishedName
(),
wo
.
getTaskGroupId
()
);
if
(
taskList
!=
null
){
wo
.
setTaskListId
(
taskList
.
get
(
0
).
getId
());
}
}
}
catch
(
Exception
e
)
{
Exception
exception
=
new
TaskQueryException
(
e
,
"根据指定projectId查询项目扩展列配置信息对象时发生异常。projectId:"
+
task
.
getProject
());
...
...
@@ -161,50 +169,6 @@ public class ActionGet extends BaseAction {
}
}
}
// //查询任务所在的Group信息
// if( Boolean.TRUE.equals( check ) ){
// List<String> groupIds = null;
// List<TaskGroup> groupList = null;
// List<WoTaskGroup> woGroupList = new ArrayList<>();
// try {
// groupIds = taskGroupQueryService.listGroupIdsByTask( task.getId() );
// groupList = taskGroupQueryService.list( groupIds );
// if( ListTools.isNotEmpty( groupList )){
// woGroupList = WoTaskGroup.copier.copy( groupList );
// }
// wo.setTaskgroups( woGroupList );
// } catch (Exception e) {
// check = false;
// Exception exception = new TaskQueryException(e, "根据指定projectId查询项目扩展列配置信息对象时发生异常。projectId:" + task.getProject());
// result.error(exception);
// logger.error(e, effectivePerson, request, null);
// }
// }
//
// //查询任务所在的List信息
// if( Boolean.TRUE.equals( check ) ){
// if( ListTools.isNotEmpty(wo.getTaskgroups() )){
// List<String> listIds = null;
// List<TaskList> taskLists = null;
// List<WoTaskList> woTaskLists = new ArrayList<>();
// for( WoTaskGroup woGroup : wo.getTaskgroups() ){
// try {
// listIds = taskListQueryService.listTaskListIdWithTaskId( task.getId(), woGroup.getId() );
// taskLists = taskListQueryService.list( listIds );
// if( ListTools.isNotEmpty( taskLists )){
// woTaskLists = WoTaskList.copier.copy( taskLists );
// }
// woGroup.setTaskLists( woTaskLists );
// } catch (Exception e) {
// check = false;
// Exception exception = new TaskQueryException(e, "根据指定projectId查询项目扩展列配置信息对象时发生异常。projectId:" + task.getProject());
// result.error(exception);
// logger.error(e, effectivePerson, request, null);
// }
// }
// }
// }
}
taskCache
.
put
(
new
Element
(
cacheKey
,
wo
));
result
.
setData
(
wo
);
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListNextWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -54,6 +54,7 @@ public class ActionListNextWithFilter extends BaseAction {
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
wrapIn
.
setDeleted
(
"false"
);
queryFilter
=
wrapIn
.
getQueryFilter
();
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionListPageWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -48,7 +48,7 @@ public class ActionListPageWithFilter extends BaseAction {
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
wrapIn
.
setDeleted
(
"false"
);
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
queryFilter
=
wrapIn
.
getQueryFilter
();
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionStatisticMyTasks.java
浏览文件 @
8ebef04a
...
...
@@ -82,7 +82,7 @@ public class ActionStatisticMyTasks extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
taskList
))
{
for
(
Task
task
:
taskList
)
{
taskTotal
++;
if
(
task
.
getCompleted
(
)
)
{
if
(
"completed"
.
equalsIgnoreCase
(
task
.
getWorkStatus
()
)
)
{
completedTotal
++;
}
if
(
task
.
getOvertime
()
)
{
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewAllListNextWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -64,6 +64,7 @@ public class ActionViewAllListNextWithFilter extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
wrapIn
.
setProject
(
projectId
);
wrapIn
.
setDeleted
(
"false"
);
queryFilter
=
wrapIn
.
getQueryFilter
();
}
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewCompletedListNextWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -65,6 +65,7 @@ public class ActionViewCompletedListNextWithFilter extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
wrapIn
.
setProject
(
projectId
);
wrapIn
.
setWorkStatus
(
"completed"
);
wrapIn
.
setDeleted
(
"false"
);
queryFilter
=
wrapIn
.
getQueryFilter
();
}
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewMyExecutListNextWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -64,6 +64,7 @@ public class ActionViewMyExecutListNextWithFilter extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
wrapIn
.
setProject
(
projectId
);
wrapIn
.
setExecutor
(
effectivePerson
.
getDistinguishedName
());
wrapIn
.
setDeleted
(
"false"
);
queryFilter
=
wrapIn
.
getQueryFilter
();
//queryFilter.addEqualsTerm( new EqualsTerm( "executor", effectivePerson.getDistinguishedName() ) );
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewOverTimeListNextWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -65,6 +65,7 @@ public class ActionViewOverTimeListNextWithFilter extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
wrapIn
.
setProject
(
projectId
);
wrapIn
.
setOvertime
(
"true"
);
wrapIn
.
setDeleted
(
"false"
);
queryFilter
=
wrapIn
.
getQueryFilter
();
}
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionViewUncompletedListNextWithFilter.java
浏览文件 @
8ebef04a
...
...
@@ -66,6 +66,7 @@ public class ActionViewUncompletedListNextWithFilter extends BaseAction {
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
wrapIn
.
setProject
(
projectId
);
wrapIn
.
setWorkStatus
(
"processing"
);
wrapIn
.
setDeleted
(
"false"
);
queryFilter
=
wrapIn
.
getQueryFilter
();
}
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/TaskGroupWithProjectNotExistsException.java
0 → 100644
浏览文件 @
8ebef04a
package
com.x.teamwork.assemble.control.jaxrs.task
;
import
com.x.base.core.project.exception.PromptException
;
class
TaskGroupWithProjectNotExistsException
extends
PromptException
{
private
static
final
long
serialVersionUID
=
1859164370743532895L
;
TaskGroupWithProjectNotExistsException
(
String
id
)
{
super
(
"指定项目的工作任务组信息不存在。ID:"
+
id
);
}
}
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectQueryService.java
浏览文件 @
8ebef04a
...
...
@@ -12,6 +12,7 @@ import com.x.base.core.project.tools.ListTools;
import
com.x.teamwork.core.entity.Project
;
import
com.x.teamwork.core.entity.ProjectDetail
;
import
com.x.teamwork.core.entity.tools.filter.QueryFilter
;
import
com.x.teamwork.core.entity.tools.filter.term.EqualsTerm
;
import
com.x.teamwork.core.entity.tools.filter.term.InTerm
;
/**
...
...
@@ -311,6 +312,7 @@ public class ProjectQueryService {
unitNames
=
userManagerService
.
listUnitNamesWithPerson
(
personName
);
groupNames
=
userManagerService
.
listGroupNamesByPerson
(
personName
);
identityNames
=
userManagerService
.
listIdentitiesWithPerson
(
personName
);
queryFilter
.
addEqualsTerm
(
new
EqualsTerm
(
"deleted"
,
false
)
);
return
projectService
.
listAllViewableProjectIds
(
emc
,
maxCount
,
personName
,
identityNames
,
unitNames
,
groupNames
,
queryFilter
);
}
catch
(
Exception
e
)
{
throw
e
;
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ProjectService.java
浏览文件 @
8ebef04a
...
...
@@ -13,7 +13,11 @@ import com.x.teamwork.assemble.control.Business;
import
com.x.teamwork.core.entity.Project
;
import
com.x.teamwork.core.entity.ProjectDetail
;
import
com.x.teamwork.core.entity.ProjectExtFieldRele
;
import
com.x.teamwork.core.entity.Review
;
import
com.x.teamwork.core.entity.Task
;
import
com.x.teamwork.core.entity.TaskDetail
;
import
com.x.teamwork.core.entity.TaskGroupRele
;
import
com.x.teamwork.core.entity.TaskListRele
;
import
com.x.teamwork.core.entity.tools.filter.QueryFilter
;
class
ProjectService
{
...
...
@@ -149,7 +153,7 @@ class ProjectService {
* @param id
* @throws Exception
*/
protected
void
delete
(
EntityManagerContainer
emc
,
String
id
)
throws
Exception
{
protected
void
delete
(
EntityManagerContainer
emc
,
String
id
)
throws
Exception
{
Business
business
=
new
Business
(
emc
);
Project
project
=
emc
.
find
(
id
,
Project
.
class
);
ProjectDetail
projectDetail
=
emc
.
find
(
id
,
ProjectDetail
.
class
);
...
...
@@ -160,7 +164,10 @@ class ProjectService {
emc
.
beginTransaction
(
ProjectDetail
.
class
);
emc
.
beginTransaction
(
ProjectExtFieldRele
.
class
);
if
(
project
!=
null
)
{
emc
.
remove
(
project
,
CheckRemoveType
.
all
);
//emc.remove( project , CheckRemoveType.all );
//改为软删除
project
.
setDeleted
(
true
);
emc
.
check
(
project
,
CheckPersistType
.
all
);
}
if
(
projectDetail
!=
null
)
{
emc
.
remove
(
projectDetail
,
CheckRemoveType
.
all
);
...
...
@@ -170,7 +177,8 @@ class ProjectService {
List
<
Task
>
tasks
=
business
.
taskFactory
().
list
(
ids
);
if
(
ListTools
.
isNotEmpty
(
tasks
))
{
for
(
Task
task
:
tasks
)
{
emc
.
remove
(
task
,
CheckRemoveType
.
all
);
//emc.remove( task , CheckRemoveType.all );
this
.
remove
(
emc
,
task
.
getId
()
);
}
}
//还需要删除所有的ProjectExtFieldRele
...
...
@@ -183,6 +191,85 @@ class ProjectService {
emc
.
commit
();
}
}
/**
* 根据工作任务标识删除工作任务信息(物理删除)
* @param emc
* @param flag 主要是ID
* @throws Exception
*/
public
void
remove
(
EntityManagerContainer
emc
,
String
flag
)
throws
Exception
{
emc
.
beginTransaction
(
Task
.
class
);
emc
.
beginTransaction
(
Review
.
class
);
emc
.
beginTransaction
(
TaskDetail
.
class
);
emc
.
beginTransaction
(
TaskListRele
.
class
);
emc
.
beginTransaction
(
TaskGroupRele
.
class
);
removeTaskWithChildren
(
emc
,
flag
);
emc
.
commit
();
}
/**
* 根据工作任务标识删除工作任务信息( 物理删除 )
* @param emc
* @param id
* @throws Exception
*/
private
void
removeTaskWithChildren
(
EntityManagerContainer
emc
,
String
id
)
throws
Exception
{
Business
business
=
new
Business
(
emc
);
//还需要递归删除所有的下级Task
List
<
String
>
childrenIds
=
business
.
taskFactory
().
listByParent
(
id
);
if
(
ListTools
.
isNotEmpty
(
childrenIds
))
{
for
(
String
_id
:
childrenIds
)
{
removeTaskWithChildren
(
emc
,
_id
);
}
}
//任务列表中的关联信息
List
<
TaskListRele
>
listReles
=
business
.
taskListFactory
().
listReleWithTask
(
id
);
if
(
ListTools
.
isNotEmpty
(
listReles
))
{
for
(
TaskListRele
taskListRele
:
listReles
)
{
emc
.
remove
(
taskListRele
,
CheckRemoveType
.
all
);
}
}
//删除任务组关联信息
List
<
TaskGroupRele
>
groupReles
=
business
.
taskGroupReleFactory
().
listTaskReleWithTask
(
id
);
if
(
ListTools
.
isNotEmpty
(
groupReles
))
{
for
(
TaskGroupRele
taskGroupRele
:
groupReles
)
{
emc
.
remove
(
taskGroupRele
,
CheckRemoveType
.
all
);
}
}
Task
task
=
emc
.
find
(
id
,
Task
.
class
);
TaskDetail
taskDetail
=
emc
.
find
(
id
,
TaskDetail
.
class
);
List
<
Review
>
reviewList
=
null
;
List
<
List
<
String
>>
reviewIdBatchs
=
null
;
List
<
String
>
reviewIds
=
business
.
reviewFactory
().
listReviewByTask
(
id
,
9999
);
if
(
ListTools
.
isNotEmpty
(
reviewIds
))
{
reviewIdBatchs
=
ListTools
.
batch
(
reviewIds
,
1000
);
}
if
(
ListTools
.
isNotEmpty
(
reviewIdBatchs
))
{
for
(
List
<
String
>
batch
:
reviewIdBatchs
)
{
reviewList
=
emc
.
list
(
Review
.
class
,
batch
);
if
(
ListTools
.
isNotEmpty
(
reviewList
))
{
for
(
Review
review
:
reviewList
)
{
//emc.remove( review, CheckRemoveType.all );
//改为软删除
review
.
setDeleted
(
true
);
emc
.
check
(
review
,
CheckPersistType
.
all
);
}
}
}
}
if
(
task
!=
null
)
{
//emc.remove( task , CheckRemoveType.all );
//改为软删除
task
.
setDeleted
(
true
);
emc
.
check
(
task
,
CheckPersistType
.
all
);
}
if
(
taskDetail
!=
null
)
{
emc
.
remove
(
taskDetail
,
CheckRemoveType
.
all
);
}
}
/**
* 根据条件查询项目ID列表,最大查询2000条
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/ReviewService.java
浏览文件 @
8ebef04a
...
...
@@ -62,7 +62,10 @@ public class ReviewService {
if
(
ListTools
.
isNotEmpty
(
reviewList
))
{
emc
.
beginTransaction
(
Review
.
class
);
for
(
Review
review
:
reviewList
)
{
emc
.
remove
(
review
);
//emc.remove( review );
//改为软删除-lj
review
.
setDeleted
(
true
);
emc
.
check
(
review
,
CheckPersistType
.
all
);
}
emc
.
commit
();
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskGroupQueryService.java
浏览文件 @
8ebef04a
...
...
@@ -78,6 +78,35 @@ public class TaskGroupQueryService {
}
return
taskGroupList
;
}
/**
* 根据用户列示所有的工作任务组信息ID列表
* @param person
* @param project
* @return
* @throws Exception
*/
public
List
<
String
>
listGroupIdsByPersonAndProject
(
EffectivePerson
effectivePerson
,
String
project
)
throws
Exception
{
if
(
effectivePerson
==
null
)
{
return
new
ArrayList
<>();
}
if
(
StringUtils
.
isEmpty
(
project
)
)
{
return
new
ArrayList
<>();
}
List
<
String
>
taskGroupListIds
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
taskGroupListIds
=
taskGroupService
.
listGroupIdsByPersonAndProject
(
emc
,
effectivePerson
.
getDistinguishedName
(),
project
);
//如果用户在该项目中没有工作任务组,则需要创建一个默认的工作任务组
if
(
ListTools
.
isEmpty
(
taskGroupListIds
))
{
List
<
TaskGroup
>
taskGroupList
=
null
;
taskGroupList
=
createDefaultTaskGroupForPerson
(
emc
,
effectivePerson
,
project
);
taskGroupListIds
.
add
(
taskGroupList
.
get
(
0
).
getId
());
}
}
catch
(
Exception
e
)
{
throw
e
;
}
return
taskGroupListIds
;
}
/**
* 为指定项目初始化一个工作任务组,并且将所有的工作任务加入到工作任务组中
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskListQueryService.java
浏览文件 @
8ebef04a
...
...
@@ -119,6 +119,7 @@ public class TaskListQueryService {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
TaskGroup
taskGroup
=
emc
.
find
(
taskGroupId
,
TaskGroup
.
class
);
System
.
out
.
println
(
"taskGroupId="
+
taskGroupId
);
List
<
TaskList
>
taskLists
=
taskListService
.
listWithTaskGroup
(
emc
,
taskGroupId
);
if
(
ListTools
.
isEmpty
(
taskLists
))
{
//没有任何工作任务列表,需要新建一组默认的工作任务列表
...
...
@@ -129,20 +130,27 @@ public class TaskListQueryService {
if
(
taskGroup
!=
null
)
{
//查询用户所有的工作ID列表
List
<
String
>
taskIds_all_temp
=
reviewService
.
listTaskIdsWithPerson
(
emc
,
person
,
taskGroup
.
getProject
()
);
System
.
out
.
println
(
"taskIds_all_temp="
+
taskIds_all_temp
.
size
());
taskIds_all
.
addAll
(
taskIds_all_temp
);
System
.
out
.
println
(
"taskIds_all="
+
taskIds_all
.
size
());
}
if
(
ListTools
.
isNotEmpty
(
taskIds_all
))
{
//查询该用户所有的TaskList的ID列表
taskListIds
=
taskListService
.
listTaskListIdsWithGroup
(
emc
,
taskGroupId
,
person
);
System
.
out
.
println
(
"taskListIds="
+
taskListIds
.
size
());
if
(
ListTools
.
isNotEmpty
(
taskListIds
))
{
//看看这些TaskList所关联的所有的TaskId列表
taskIds_forTaskList
=
taskListService
.
listTaskIdsWithTaskListIds
(
emc
,
taskListIds
);
System
.
out
.
println
(
"根据taskListIds计算出的task="
+
taskIds_forTaskList
.
size
());
taskIds_all
.
removeAll
(
taskIds_forTaskList
);
if
(
ListTools
.
isNotEmpty
(
taskIds_all
))
{
System
.
out
.
println
(
"存在未分类的任务"
);
//存在未分类的任务
hasTaskWithNoList
=
true
;
}
}
else
{
System
.
out
.
println
(
"不存在taskListIds"
);
//存在未分类的任务
hasTaskWithNoList
=
true
;
}
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskPersistService.java
浏览文件 @
8ebef04a
...
...
@@ -110,11 +110,13 @@ public class TaskPersistService {
task
.
setCompleted
(
true
);
task
.
setArchive
(
true
);
}
String
executor
=
null
;
String
executorIdentity
=
null
;
String
executorUnit
=
null
;
//前端可能传身份,也可以直接传Person
//前端可能传身份,也可以直接传Person
if
(
StringUtils
.
isNotEmpty
(
task
.
getExecutorIdentity
()
)
)
{
executor
=
userManagerService
.
getPersonNameWithIdentity
(
task
.
getExecutorIdentity
()
);
if
(
StringUtils
.
isEmpty
(
executor
))
{
...
...
@@ -156,7 +158,7 @@ public class TaskPersistService {
task
.
setStartTime
(
new
Date
()
);
}
if
(
task
.
getEndTime
()
==
null
)
{
task
.
setEndTime
(
new
Date
(
(
task
.
getStartTime
().
getTime
()
+
3
0
*
60
*
1000
)
)
);
//30分钟之后
task
.
setEndTime
(
new
Date
(
(
task
.
getStartTime
().
getTime
()
+
7
*
144
0
*
60
*
1000
)
)
);
//30分钟之后
}
if
(
ListTools
.
isEmpty
(
task
.
getParticipantList
()
))
{
...
...
@@ -472,7 +474,7 @@ public class TaskPersistService {
if
(
Task
.
name_FIELDNAME
.
equalsIgnoreCase
(
property
))
{
task
.
setName
(
mainValue
);
}
else
if
(
Task
.
workStatus_FIELDNAME
.
equalsIgnoreCase
(
property
))
{
task
.
setWorkStatus
(
mainValue
);
task
.
setWorkStatus
(
mainValue
);
}
else
if
(
Task
.
priority_FIELDNAME
.
equalsIgnoreCase
(
property
))
{
task
.
setPriority
(
mainValue
);
}
else
if
(
Task
.
executor_FIELDNAME
.
equalsIgnoreCase
(
property
))
{
...
...
@@ -482,13 +484,14 @@ public class TaskPersistService {
personName
=
userManagerService
.
getPersonNameWithIdentity
(
mainValue
);
personUnit
=
userManagerService
.
getUnitNameByIdentity
(
mainValue
);
task
.
setExecutor
(
personName
);
task
.
setExecutorIdentity
(
property
);
task
.
setExecutorIdentity
(
mainValue
);
task
.
setExecutorUnit
(
personUnit
);
}
else
if
(
mainValue
.
endsWith
(
"@P"
)
)
{
personName
=
mainValue
;
personIdentity
=
userManagerService
.
getIdentityWithPerson
(
personName
,
"min"
);
personUnit
=
userManagerService
.
getUnitNameByIdentity
(
personIdentity
);
task
.
setExecutor
(
personName
);
task
.
setExecutorIdentity
(
p
roper
ty
);
task
.
setExecutorIdentity
(
p
ersonIdenti
ty
);
task
.
setExecutorUnit
(
personUnit
);
}
}
else
{
...
...
@@ -501,13 +504,14 @@ public class TaskPersistService {
personName
=
userManagerService
.
getPersonNameWithIdentity
(
mainValue
);
personUnit
=
userManagerService
.
getUnitNameByIdentity
(
mainValue
);
task
.
setExecutor
(
personName
);
task
.
setExecutorIdentity
(
property
);
task
.
setExecutorIdentity
(
mainValue
);
task
.
setExecutorUnit
(
personUnit
);
}
else
if
(
mainValue
.
endsWith
(
"@P"
)
)
{
personName
=
mainValue
;
personIdentity
=
userManagerService
.
getIdentityWithPerson
(
personName
,
"min"
);
personUnit
=
userManagerService
.
getUnitNameByIdentity
(
personIdentity
);
task
.
setExecutor
(
personName
);
task
.
setExecutorIdentity
(
p
roper
ty
);
task
.
setExecutorIdentity
(
p
ersonIdenti
ty
);
task
.
setExecutorUnit
(
personUnit
);
}
}
else
{
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/service/TaskService.java
浏览文件 @
8ebef04a
...
...
@@ -221,7 +221,7 @@ class TaskService {
* @param flag 主要是ID
* @throws Exception
*/
p
rotected
void
remove
(
EntityManagerContainer
emc
,
String
flag
)
throws
Exception
{
p
ublic
void
remove
(
EntityManagerContainer
emc
,
String
flag
)
throws
Exception
{
emc
.
beginTransaction
(
Task
.
class
);
emc
.
beginTransaction
(
Review
.
class
);
emc
.
beginTransaction
(
TaskDetail
.
class
);
...
...
@@ -277,13 +277,19 @@ class TaskService {
reviewList
=
emc
.
list
(
Review
.
class
,
batch
);
if
(
ListTools
.
isNotEmpty
(
reviewList
))
{
for
(
Review
review
:
reviewList
)
{
emc
.
remove
(
review
,
CheckRemoveType
.
all
);
//emc.remove( review, CheckRemoveType.all );
//改为软删除
review
.
setDeleted
(
true
);
emc
.
check
(
review
,
CheckPersistType
.
all
);
}
}
}
}
if
(
task
!=
null
)
{
emc
.
remove
(
task
,
CheckRemoveType
.
all
);
//emc.remove( task , CheckRemoveType.all );
//改为软删除
task
.
setDeleted
(
true
);
emc
.
check
(
task
,
CheckPersistType
.
all
);
}
if
(
taskDetail
!=
null
)
{
emc
.
remove
(
taskDetail
,
CheckRemoveType
.
all
);
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/timertask/Timertask_CheckAllTaskOverTime.java
浏览文件 @
8ebef04a
...
...
@@ -19,6 +19,7 @@ import com.x.teamwork.assemble.control.service.ProjectQueryService;
import
com.x.teamwork.assemble.control.service.TaskQueryService
;
import
com.x.teamwork.core.entity.Review
;
import
com.x.teamwork.core.entity.Task
;
import
com.x.teamwork.core.entity.TaskStatuType
;
/**
* 定时代理: 定期将所有的工作任务的截止时间核对一次,标识超时的工作任务
...
...
@@ -54,7 +55,7 @@ public class Timertask_CheckAllTaskOverTime extends AbstractJob {
if
(
task
!=
null
)
{
logger
.
debug
(
"Timertask_CheckAllTaskOverTime check task:"
+
task
.
getName
());
if
(
task
.
getEndTime
()
!=
null
)
{
if
(
task
.
getEndTime
()
!=
null
&&
!
TaskStatuType
.
completed
.
name
().
equalsIgnoreCase
(
task
.
getWorkStatus
()
)
)
{
if
(
task
.
getEndTime
().
before
(
now
)
&&
!
task
.
getOvertime
())
{
//超时了,打上标识,并且发送提醒
emc
.
beginTransaction
(
Task
.
class
);
...
...
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/PersistenceProperties.java
浏览文件 @
8ebef04a
...
...
@@ -16,6 +16,10 @@ public final class PersistenceProperties extends AbstractPersistenceProperties {
public
static
final
String
table
=
"TEW_PROJECTDETAIL"
;
}
public
static
class
ProjectTemplate
{
public
static
final
String
table
=
"TEW_PROJECTTEMPLATE"
;
}
public
static
class
TaskExtField
{
public
static
final
String
table
=
"TEW_TASKEXTFIELD"
;
}
...
...
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/ProjectTemplate.java
0 → 100644
浏览文件 @
8ebef04a
package
com.x.teamwork.core.entity
;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.Id
;
import
javax.persistence.Inheritance
;
import
javax.persistence.InheritanceType
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
org.apache.openjpa.persistence.PersistentCollection
;
import
org.apache.openjpa.persistence.jdbc.ContainerTable
;
import
org.apache.openjpa.persistence.jdbc.ElementColumn
;
import
org.apache.openjpa.persistence.jdbc.ElementIndex
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
org.apache.openjpa.persistence.jdbc.OrderColumn
;
import
com.x.base.core.entity.AbstractPersistenceProperties
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.project.annotation.FieldDescribe
;
/**
* 项目模板信息
*
* @author O2LJ
*
*/
@ContainerEntity
@Entity
@Table
(
name
=
PersistenceProperties
.
ProjectTemplate
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
ProjectTemplate
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
JpaObject
.
CREATETIMECOLUMN
,
JpaObject
.
UPDATETIMECOLUMN
,
JpaObject
.
SEQUENCECOLUMN
})
})
@Inheritance
(
strategy
=
InheritanceType
.
TABLE_PER_CLASS
)
public
class
ProjectTemplate
extends
SliceJpaObject
{
private
static
final
long
serialVersionUID
=
3856138316794473794L
;
private
static
final
String
TABLE
=
PersistenceProperties
.
ProjectTemplate
.
table
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@FieldDescribe
(
"数据库主键,自动生成."
)
@Id
@Column
(
length
=
length_id
,
name
=
ColumnNamePrefix
+
id_FIELDNAME
)
private
String
id
=
createId
();
public
void
onPersist
()
throws
Exception
{
}
/*
* =========================================================================
* ========= 以上为 JpaObject 默认字段
* =========================================================================
* =========
*/
/*
* =========================================================================
* ========= 以下为具体不同的业务及数据表字段要求
* =========================================================================
* =========
*/
public
static
final
String
title_FIELDNAME
=
"title"
;
@FieldDescribe
(
"模板名称"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
title_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
title_FIELDNAME
)
private
String
title
;
public
static
final
String
order_FIELDNAME
=
"order"
;
@FieldDescribe
(
"排序号"
)
@Column
(
name
=
ColumnNamePrefix
+
order_FIELDNAME
)
private
Integer
order
;
public
static
final
String
type_FIELDNAME
=
"type"
;
@FieldDescribe
(
"模板类型"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
type_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
type_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
type
;
public
static
final
String
icon_FIELDNAME
=
"icon"
;
@FieldDescribe
(
"图标文件ID"
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
icon_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
icon
=
null
;
public
static
final
String
description_FIELDNAME
=
"description"
;
@FieldDescribe
(
"模板类型"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
description_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
description_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
description
;
public
static
final
String
owner_FIELDNAME
=
"owner"
;
@FieldDescribe
(
"创建者"
)
@Column
(
length
=
AbstractPersistenceProperties
.
organization_name_length
,
name
=
ColumnNamePrefix
+
owner_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
owner_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
owner
;
public
static
final
String
taskList_FIELDNAME
=
"taskList"
;
@FieldDescribe
(
"默认永道"
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
taskList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
taskList_FIELDNAME
+
JoinIndexNameSuffix
))
@ElementColumn
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
taskList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
taskList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
private
List
<
String
>
taskList
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Integer
getOrder
()
{
return
order
;
}
public
void
setOrder
(
Integer
order
)
{
this
.
order
=
order
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getOwner
()
{
return
owner
;
}
public
void
setOwner
(
String
owner
)
{
this
.
owner
=
owner
;
}
public
List
<
String
>
getTaskList
()
{
return
taskList
;
}
public
void
setTaskList
(
List
<
String
>
taskList
)
{
this
.
taskList
=
taskList
;
}
}
\ No newline at end of file
o2server/x_teamwork_core_entity/src/main/java/com/x/teamwork/core/entity/TaskView.java
浏览文件 @
8ebef04a
...
...
@@ -86,7 +86,7 @@ public class TaskView extends SliceJpaObject {
public
static
final
String
executeCode_FIELDNAME
=
"executeCode"
;
@FieldDescribe
(
"任务视图执行代号,系统视图使用,自定义视图不使用"
)
@Column
(
length
=
JpaObject
.
length_
16
B
,
name
=
ColumnNamePrefix
+
executeCode_FIELDNAME
)
@Column
(
length
=
JpaObject
.
length_
255
B
,
name
=
ColumnNamePrefix
+
executeCode_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
executeCode_FIELDNAME
)
private
String
executeCode
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录