Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
aafe9d45
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,发现更多精彩内容 >>
提交
aafe9d45
编写于
8月 10, 2020
作者:
hlwwx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'修改了会议室分页bug,修改了调整会议室预定时间bug'
上级
38e454ec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
113 addition
and
30 deletion
+113
-30
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/building/ActionListWithStartCompletedRoom.java
...trol/jaxrs/building/ActionListWithStartCompletedRoom.java
+55
-0
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/building/BuildingAction.java
...eting/assemble/control/jaxrs/building/BuildingAction.java
+19
-0
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/meeting/ActionPaging.java
.../meeting/assemble/control/jaxrs/meeting/ActionPaging.java
+21
-15
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/meeting/ActionPagingManage.java
...ng/assemble/control/jaxrs/meeting/ActionPagingManage.java
+18
-15
未找到文件。
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/building/ActionListWithStartCompletedRoom.java
0 → 100644
浏览文件 @
aafe9d45
package
com.x.meeting.assemble.control.jaxrs.building
;
import
java.util.Date
;
import
java.util.List
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.SortTools
;
import
com.x.meeting.assemble.control.Business
;
import
com.x.meeting.assemble.control.WrapTools
;
import
com.x.meeting.assemble.control.wrapout.WrapOutBuilding
;
import
com.x.meeting.assemble.control.wrapout.WrapOutRoom
;
import
com.x.meeting.core.entity.Building
;
class
ActionListWithStartCompletedRoom
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
start
,
String
completed
,
String
currentRoom
,
String
meetingId
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
Date
startTime
=
DateTools
.
parse
(
start
,
DateTools
.
format_yyyyMMdd
+
" "
+
DateTools
.
format_HHmm
);
Date
completedTime
=
DateTools
.
parse
(
completed
,
DateTools
.
format_yyyyMMdd
+
" "
+
DateTools
.
format_HHmm
);
List
<
String
>
ids
=
business
.
building
().
list
();
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
emc
.
list
(
Building
.
class
,
ids
));
WrapTools
.
setRoom
(
business
,
wos
);
for
(
WrapOutBuilding
wo
:
wos
)
{
WrapTools
.
setFutureMeeting
(
business
,
wo
.
getRoomList
(),
true
);
for
(
WrapOutRoom
room
:
wo
.
getRoomList
())
{
if
(
currentRoom
.
equalsIgnoreCase
(
room
.
getId
()))
{
room
.
setIdle
(
business
.
room
().
checkIdle
(
room
.
getId
(),
startTime
,
completedTime
,
meetingId
));
}
else
{
WrapTools
.
checkRoomIdle
(
business
,
room
,
startTime
,
completedTime
);
}
}
}
SortTools
.
asc
(
wos
,
false
,
Building
.
name_FIELDNAME
);
result
.
setData
(
wos
);
return
result
;
}
}
public
static
class
Wo
extends
WrapOutBuilding
{
private
static
final
long
serialVersionUID
=
4609263020989488356L
;
public
static
WrapCopier
<
Building
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Building
.
class
,
Wo
.
class
,
null
,
Wo
.
Excludes
);
}
}
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/building/BuildingAction.java
浏览文件 @
aafe9d45
...
...
@@ -87,6 +87,25 @@ public class BuildingAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"列示在所有building和下属的room,和room下面将来的会议,同时判断在指定时间内room是否空闲,用于修改当前预定会议时间"
,
action
=
ActionListWithStartCompleted
.
class
)
@GET
@Path
(
"list/start/{start}/completed/{completed}/room/{room}/meeting/{meeting}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listWithStartCompletedRoom
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@PathParam
(
"start"
)
String
start
,
@PathParam
(
"completed"
)
String
completed
,
@PathParam
(
"room"
)
String
room
,
@PathParam
(
"meeting"
)
String
meetingId
)
{
ActionResult
<
List
<
ActionListWithStartCompletedRoom
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListWithStartCompletedRoom
().
execute
(
effectivePerson
,
start
,
completed
,
room
,
meetingId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"创建Building."
,
action
=
ActionCreate
.
class
)
@POST
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
...
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/meeting/ActionPaging.java
浏览文件 @
aafe9d45
...
...
@@ -8,6 +8,7 @@ import javax.persistence.EntityManager;
import
javax.persistence.TypedQuery
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Expression
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
...
...
@@ -51,8 +52,9 @@ class ActionPaging extends BaseAction {
Root
<
Meeting
>
root
=
cq
.
from
(
Meeting
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Meeting_
.
applicant
),
effectivePerson
.
getDistinguishedName
());
p
=
cb
.
or
(
p
,
cb
.
isMember
(
effectivePerson
.
getDistinguishedName
(),
root
.
get
(
Meeting_
.
invitePersonList
)));
//p = cb.or(p, cb.isMember(effectivePerson.getDistinguishedName(),root.get(Meeting_.invitePersonList)));
Expression
<
List
<
String
>>
expression
=
root
.
get
(
Meeting_
.
invitePersonList
);
p
=
cb
.
or
(
p
,
expression
.
in
(
effectivePerson
.
getDistinguishedName
()));
if
(!
StringUtils
.
isBlank
(
wi
.
getSubject
()))
{
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Meeting_
.
subject
),
"%"
+
wi
.
getSubject
()
+
"%"
));
...
...
@@ -127,28 +129,32 @@ class ActionPaging extends BaseAction {
}
cq
.
select
(
root
.
get
(
Meeting_
.
id
)).
where
(
p
).
orderBy
(
order
);
cq
.
distinct
(
true
);
TypedQuery
<
String
>
typedQuery
=
em
.
createQuery
(
cq
);
int
pageIndex
=
(
page
-
1
)*
size
;
int
pageSize
=
page
*
size
;
int
pageSize
=
size
;
typedQuery
.
setFirstResult
(
pageIndex
);
typedQuery
.
setMaxResults
(
pageSize
);
//logger.info("typedQuery="+ typedQuery.toString());
ids
=
typedQuery
.
getResultList
();
CriteriaQuery
<
Long
>
cqCount
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Meeting
>
rootCount
=
cqCount
.
from
(
Meeting
.
class
);
cqCount
.
select
(
cb
.
countDistinct
(
rootCount
)).
where
(
p
);
Long
count
=
em
.
createQuery
(
cqCount
).
getSingleResult
().
longValu
e
();
//logger.info("
count="+ count
);
//logger.info("pagingtypedQuery="+ typedQuery.toString());
TypedQuery
<
String
>
tqCount
=
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Meeting_
.
id
)).
where
(
p
).
distinct
(
true
)
);
List
<
String
>
allid
=
tqCount
.
getResultList
(
);
Long
tpsize
=
(
long
)
allid
.
siz
e
();
//logger.info("
ids count="+ tpsize
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
emc
.
list
(
Meeting
.
class
,
ids
));
CriteriaQuery
<
Meeting
>
cqMeeting
=
cb
.
createQuery
(
Meeting
.
class
);
Predicate
pMeeting
=
cb
.
isMember
(
root
.
get
(
Meeting_
.
id
),
cb
.
literal
(
ids
));
Root
<
Meeting
>
rootMeeting
=
cqMeeting
.
from
(
Meeting
.
class
);
cqMeeting
.
select
(
rootMeeting
).
where
(
pMeeting
).
orderBy
(
order
);
List
<
Meeting
>
os
=
em
.
createQuery
(
cqMeeting
).
getResultList
();
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
WrapTools
.
decorate
(
business
,
wos
,
effectivePerson
);
WrapTools
.
setAttachment
(
business
,
wos
);
SortTools
.
desc
(
wos
,
Meeting
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
count
);
result
.
setCount
(
tpsize
);
return
result
;
}
}
...
...
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/meeting/ActionPagingManage.java
浏览文件 @
aafe9d45
...
...
@@ -129,31 +129,34 @@ class ActionPagingManage extends BaseAction {
order
=
cb
.
desc
(
root
.
get
(
"startTime"
));
}
cq
.
select
(
root
.
get
(
Meeting_
.
id
)).
where
(
p
).
orderBy
(
order
);
cq
.
select
(
root
.
get
(
Meeting_
.
id
)).
where
(
p
).
orderBy
(
order
);
cq
.
distinct
(
true
);
TypedQuery
<
String
>
typedQuery
=
em
.
createQuery
(
cq
);
int
pageIndex
=
(
page
-
1
)*
size
;
int
pageSize
=
page
*
size
;
int
pageSize
=
size
;
typedQuery
.
setFirstResult
(
pageIndex
);
typedQuery
.
setMaxResults
(
pageSize
);
//logger.info("typedQuery="+ typedQuery.toString());
ids
=
typedQuery
.
getResultList
();
CriteriaQuery
<
Long
>
cqCount
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Meeting
>
rootCount
=
cqCount
.
from
(
Meeting
.
class
);
cqCount
.
select
(
cb
.
countDistinct
(
rootCount
)).
where
(
p
);
Long
count
=
em
.
createQuery
(
cqCount
).
getSingleResult
().
longValue
();
// logger.info("count="+ count);
//logger.info("pagingtypedQuery="+ typedQuery.toString());
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
emc
.
list
(
Meeting
.
class
,
ids
));
TypedQuery
<
String
>
tqCount
=
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Meeting_
.
id
)).
where
(
p
).
distinct
(
true
));
List
<
String
>
allid
=
tqCount
.
getResultList
();
Long
tpsize
=
(
long
)
allid
.
size
();
//logger.info("ids count="+ tpsize);
CriteriaQuery
<
Meeting
>
cqMeeting
=
cb
.
createQuery
(
Meeting
.
class
);
Predicate
pMeeting
=
cb
.
isMember
(
root
.
get
(
Meeting_
.
id
),
cb
.
literal
(
ids
));
Root
<
Meeting
>
rootMeeting
=
cqMeeting
.
from
(
Meeting
.
class
);
cqMeeting
.
select
(
rootMeeting
).
where
(
pMeeting
).
orderBy
(
order
);
List
<
Meeting
>
os
=
em
.
createQuery
(
cqMeeting
).
getResultList
();
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
WrapTools
.
decorate
(
business
,
wos
,
effectivePerson
);
WrapTools
.
setAttachment
(
business
,
wos
);
SortTools
.
desc
(
wos
,
Meeting
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
count
);
result
.
setCount
(
tpsize
);
return
result
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录