Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
2eda483d
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,发现更多精彩内容 >>
提交
2eda483d
编写于
11月 21, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加回record到work
上级
cc0fbb23
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
78 addition
and
2 deletion
+78
-2
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/ActionIsHoliday.java
...eral/assemble/control/jaxrs/worktime/ActionIsHoliday.java
+26
-0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/WorkTimeAction.java
...neral/assemble/control/jaxrs/worktime/WorkTimeAction.java
+18
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2GetWorkOrWorkCompleted.java
...assemble/surface/jaxrs/work/V2GetWorkOrWorkCompleted.java
+34
-2
未找到文件。
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/ActionIsHoliday.java
0 → 100644
浏览文件 @
2eda483d
package
com.x.general.assemble.control.jaxrs.worktime
;
import
java.util.Date
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.tools.DateTools
;
public
class
ActionIsHoliday
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
date
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Date
dateObject
=
DateTools
.
parse
(
date
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(!
Config
.
workTime
().
isWorkDay
(
dateObject
));
result
.
setData
(
wo
);
return
result
;
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/WorkTimeAction.java
浏览文件 @
2eda483d
...
...
@@ -138,4 +138,22 @@ public class WorkTimeAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"返回指定时间是否是节假日."
,
action
=
ActionIsHoliday
.
class
)
@GET
@Path
(
"isholiday/{date}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
isHoliday
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"指定日期"
)
@PathParam
(
"date"
)
String
date
)
{
ActionResult
<
ActionIsHoliday
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionIsHoliday
().
execute
(
effectivePerson
,
date
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2GetWorkOrWorkCompleted.java
浏览文件 @
2eda483d
...
...
@@ -74,6 +74,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
CompletableFuture
<
Void
>
creatorPersonFuture
=
this
.
creatorPersonFuture
(
work
.
getCreatorPerson
(),
wo
);
CompletableFuture
<
Void
>
creatorUnitFuture
=
this
.
creatorUnitFuture
(
work
.
getCreatorUnit
(),
wo
);
CompletableFuture
<
Void
>
attachmentFuture
=
this
.
attachmentFuture
(
effectivePerson
,
work
.
getJob
(),
wo
);
CompletableFuture
<
Void
>
recordFuture
=
this
.
recordFuture
(
effectivePerson
,
work
.
getJob
(),
wo
);
workJsonFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
activityRouteFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
dataFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
...
...
@@ -83,6 +84,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
creatorPersonFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
creatorUnitFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
attachmentFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
recordFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
for
(
WoTask
woTask
:
wo
.
getTaskList
())
{
wo
.
getRecordList
().
add
(
taskToRecord
(
woTask
));
}
...
...
@@ -95,6 +97,8 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
CompletableFuture
<
Void
>
creatorPersonFuture
=
creatorPersonFuture
(
workCompleted
.
getCreatorPerson
(),
wo
);
CompletableFuture
<
Void
>
creatorUnitFuture
=
creatorUnitFuture
(
workCompleted
.
getCreatorUnit
(),
wo
);
CompletableFuture
<
Void
>
attachmentFuture
=
attachmentFuture
(
effectivePerson
,
workCompleted
.
getJob
(),
wo
);
CompletableFuture
<
Void
>
workCompletedRecordFuture
=
this
.
workCompletedRecordFuture
(
effectivePerson
,
workCompleted
,
wo
);
workCompletedJsonFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
workCompletedDataFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
readFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
...
...
@@ -102,6 +106,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
creatorPersonFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
creatorUnitFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
attachmentFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
workCompletedRecordFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
}
if
(
BooleanUtils
.
isFalse
(
checkControlFuture
.
get
(
10
,
TimeUnit
.
SECONDS
)))
{
...
...
@@ -146,8 +151,6 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
});
}
private
CompletableFuture
<
Void
>
taskFuture
(
EffectivePerson
effectivePerson
,
String
job
,
Wo
wo
)
{
return
CompletableFuture
.
runAsync
(()
->
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
...
...
@@ -277,6 +280,35 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
});
}
private
CompletableFuture
<
Void
>
recordFuture
(
EffectivePerson
effectivePerson
,
String
job
,
Wo
wo
)
{
return
CompletableFuture
.
runAsync
(()
->
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
wo
.
setRecordList
(
emc
.
fetchEqual
(
Record
.
class
,
WoRecord
.
copier
,
Record
.
job_FIELDNAME
,
job
).
stream
()
.
sorted
(
Comparator
.
comparing
(
WoRecord:
:
getOrder
)).
collect
(
Collectors
.
toList
()));
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
});
}
private
CompletableFuture
<
Void
>
workCompletedRecordFuture
(
EffectivePerson
effectivePerson
,
WorkCompleted
workCompleted
,
Wo
wo
)
{
return
CompletableFuture
.
runAsync
(()
->
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
if
(
ListTools
.
isNotEmpty
(
workCompleted
.
getProperties
().
getRecordList
()))
{
wo
.
setRecordList
(
WoRecord
.
copier
.
copy
(
workCompleted
.
getProperties
().
getRecordList
()).
stream
()
.
sorted
(
Comparator
.
comparing
(
WoRecord:
:
getOrder
)).
collect
(
Collectors
.
toList
()));
}
else
{
wo
.
setRecordList
(
emc
.
fetchEqual
(
Record
.
class
,
WoRecord
.
copier
,
Record
.
job_FIELDNAME
,
workCompleted
.
getJob
())
.
stream
().
sorted
(
Comparator
.
comparing
(
WoRecord:
:
getOrder
)).
collect
(
Collectors
.
toList
()));
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
});
}
private
CompletableFuture
<
Void
>
workCompletedDataFuture
(
WorkCompleted
workCompleted
,
Wo
wo
)
{
return
CompletableFuture
.
runAsync
(()
->
{
if
(
BooleanUtils
.
isTrue
(
workCompleted
.
getMerged
()))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录