Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
b2510718
o2oa
项目概览
fuyue82
/
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,发现更多精彩内容 >>
提交
b2510718
编写于
4月 07, 2020
作者:
liyi_hz2008
提交者:
liyi_hz2008
4月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增任务转移服务
上级
d54be852
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
205 addition
and
1 deletion
+205
-1
o2server/.gitignore
o2server/.gitignore
+1
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/ThisApplication.java
...java/com/x/teamwork/assemble/control/ThisApplication.java
+1
-1
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionMoveToList.java
...eamwork/assemble/control/jaxrs/task/ActionMoveToList.java
+191
-0
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/TaskListNotExistsException.java
...semble/control/jaxrs/task/TaskListNotExistsException.java
+12
-0
未找到文件。
o2server/.gitignore
0 → 100644
浏览文件 @
b2510718
/x_teamwork_assemble_control/src/main/webapp/describe/
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/ThisApplication.java
浏览文件 @
b2510718
...
...
@@ -35,7 +35,7 @@ public class ThisApplication {
context
.
schedule
(
Timertask_RefreshAllTaskReview
.
class
,
"0 0 2 * * ?"
);
//每30分钟核对一次所有的工作任务,判断工作任务是否已经超时
context
.
schedule
(
Timertask_CheckAllTaskOverTime
.
class
,
"0 0/30 * * * ?"
);
//
context.schedule( Timertask_CheckAllTaskOverTime.class, "0 0/30 * * * ?" );
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/ActionMoveToList.java
0 → 100644
浏览文件 @
b2510718
package
com.x.teamwork.assemble.control.jaxrs.task
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.teamwork.assemble.control.service.BatchOperationPersistService
;
import
com.x.teamwork.assemble.control.service.BatchOperationProcessService
;
import
com.x.teamwork.core.entity.*
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 将指定的任务移动到其他的泳道里
*/
public
class
ActionMoveToList
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionMoveToList
.
class
);
/**
* 将指定的任务移动到其他的泳道(TaskList)里
* 1、查询 参数是否合法
* 2、转移Task的泳道关联
* 3、调整TaskList和TaskGroup的相关统计数据
* 4、记录动态信息
*
* @param request
* @param effectivePerson
* @param sourceTaskId
* @return
* @throws Exception
*/
protected
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
EffectivePerson
effectivePerson
,
String
sourceTaskId
,
String
targetListId
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
Task
sourceTask
=
null
;
TaskList
targetTaskList
=
null
;
TaskDetail
taskDetail
=
null
;
TaskExtField
taskExtField
=
null
;
List
<
Dynamic
>
dynamics
=
new
ArrayList
<>();
Boolean
check
=
true
;
if
(
StringUtils
.
isEmpty
(
sourceTaskId
)
)
{
check
=
false
;
Exception
exception
=
new
TaskTransformException
(
"需要复制的工作任务ID不允许为空!"
);
result
.
error
(
exception
);
}
if
(
StringUtils
.
isEmpty
(
targetListId
)
)
{
check
=
false
;
Exception
exception
=
new
TaskTransformException
(
"需要复制到的目标任务列表ID不允许为空!"
);
result
.
error
(
exception
);
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
sourceTask
=
taskQueryService
.
get
(
sourceTaskId
);
if
(
sourceTask
==
null
)
{
check
=
false
;
Exception
exception
=
new
TaskNotExistsException
(
sourceTaskId
);
result
.
error
(
exception
);
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
TaskQueryException
(
e
,
"根据指定ID查询工作任务信息对象时发生异常。ID:"
+
sourceTaskId
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
targetTaskList
=
taskListQueryService
.
get
(
targetListId
);
if
(
targetTaskList
==
null
)
{
check
=
false
;
Exception
exception
=
new
TaskListNotExistsException
(
targetListId
);
result
.
error
(
exception
);
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
TaskQueryException
(
e
,
"根据指定ID查询工作任务列表信息对象时发生异常。ID:"
+
targetListId
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
Task
newTask
=
new
Task
();
TaskDetail
newTaskDetail
=
new
TaskDetail
();
TaskExtField
newTaskExtField
=
new
TaskExtField
();
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
//COPY对象
sourceTask
.
copyTo
(
newTask
);
taskDetail
.
copyTo
(
newTaskDetail
);
taskExtField
.
copyTo
(
newTaskExtField
);
//重新命名
newTask
.
setName
(
sourceTask
.
getName
()
+
" - 副本"
);
//调整ID
newTask
.
setId
(
Task
.
createId
()
);
newTaskDetail
.
setId
(
newTask
.
getId
()
);
newTaskExtField
.
setId
(
newTask
.
getId
()
);
try
{
newTask
=
taskPersistService
.
save
(
newTask
,
newTaskDetail
,
newTaskExtField
,
effectivePerson
);
wo
.
setId
(
newTask
.
getId
()
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
TaskPersistException
(
e
,
"工作上级任务ID信息更新时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
dynamics
=
dynamicPersistService
.
taskCopyDynamic
(
sourceTask
,
newTask
,
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
Boolean
.
TRUE
.
equals
(
check
)
){
try
{
new
BatchOperationPersistService
().
addOperation
(
BatchOperationProcessService
.
OPT_OBJ_TASK
,
BatchOperationProcessService
.
OPT_TYPE_PERMISSION
,
newTask
.
getId
(),
newTask
.
getId
(),
"刷新文档权限:ID="
+
sourceTask
.
getId
()
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
ListTools
.
isNotEmpty
(
dynamics
)
)
{
wo
.
setDynamics
(
WoDynamic
.
copier
.
copy
(
dynamics
)
);
}
// 更新缓存
ApplicationCache
.
notify
(
Task
.
class
);
ApplicationCache
.
notify
(
TaskList
.
class
);
ApplicationCache
.
notify
(
TaskView
.
class
);
ApplicationCache
.
notify
(
Review
.
class
);
ApplicationCache
.
notify
(
TaskGroup
.
class
);
ApplicationCache
.
notify
(
Dynamic
.
class
);
result
.
setData
(
wo
);
return
result
;
}
public
static
class
Wo
extends
WoId
{
@FieldDescribe
(
"操作引起的动态内容"
)
List
<
ActionSave
.
WoDynamic
>
dynamics
=
new
ArrayList
<>();
public
List
<
ActionSave
.
WoDynamic
>
getDynamics
()
{
return
dynamics
;
}
public
void
setDynamics
(
List
<
ActionSave
.
WoDynamic
>
dynamics
)
{
this
.
dynamics
=
dynamics
;
}
}
public
static
class
WoDynamic
extends
Dynamic
{
private
static
final
long
serialVersionUID
=
-
5076990764713538973L
;
public
static
WrapCopier
<
Dynamic
,
ActionSave
.
WoDynamic
>
copier
=
WrapCopierFactory
.
wo
(
Dynamic
.
class
,
ActionSave
.
WoDynamic
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
private
Long
rank
=
0L
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
}
}
\ No newline at end of file
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/jaxrs/task/TaskListNotExistsException.java
0 → 100644
浏览文件 @
b2510718
package
com.x.teamwork.assemble.control.jaxrs.task
;
import
com.x.base.core.project.exception.PromptException
;
class
TaskListNotExistsException
extends
PromptException
{
private
static
final
long
serialVersionUID
=
1859164370743532895L
;
TaskListNotExistsException
(
String
id
)
{
super
(
"指定ID的工作任务列表信息不存在。ID:"
+
id
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录