Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
dceea5f1
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,发现更多精彩内容 >>
提交
dceea5f1
编写于
6月 12, 2020
作者:
liyi_hz2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复在某些特殊情况下,日程管理编辑时报错的问题以及对可见日程列表查询的相关优化
上级
77fcc23a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
79 addition
and
27 deletion
+79
-27
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/jaxrs/calendar/ActionFollowCalendar.java
...assemble/control/jaxrs/calendar/ActionFollowCalendar.java
+13
-1
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/jaxrs/calendar/ActionGet.java
...x/calendar/assemble/control/jaxrs/calendar/ActionGet.java
+35
-2
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/jaxrs/calendar/ActionListWhatICanView.java
...semble/control/jaxrs/calendar/ActionListWhatICanView.java
+21
-17
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/service/CalendarServiceAdv.java
...calendar/assemble/control/service/CalendarServiceAdv.java
+10
-7
未找到文件。
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/jaxrs/calendar/ActionFollowCalendar.java
浏览文件 @
dceea5f1
...
...
@@ -57,7 +57,19 @@ public class ActionFollowCalendar extends BaseAction {
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
check
){
if
(
(
StringUtils
.
equalsAnyIgnoreCase
(
calendar
.
getCreateor
(),
effectivePerson
.
getDistinguishedName
()
)
)
||
(
StringUtils
.
equalsAnyIgnoreCase
(
calendar
.
getTarget
(),
effectivePerson
.
getDistinguishedName
()
)
)
||
(
StringUtils
.
equalsAnyIgnoreCase
(
calendar
.
getCreateor
(),
"SYSTEM"
)
)
){
check
=
false
;
Exception
exception
=
new
ExceptionCalendarInfoProcess
(
"不需要关注自己的日历.ID:"
+
id
);
result
.
error
(
exception
);
}
}
if
(
check
){
try
{
check
=
calendarServiceAdv
.
follow
(
effectivePerson
,
id
);
...
...
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/jaxrs/calendar/ActionGet.java
浏览文件 @
dceea5f1
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
com.x.base.core.project.tools.ListTools
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.annotation.FieldDescribe
;
...
...
@@ -68,10 +69,42 @@ public class ActionGet extends BaseAction {
if
(
check
){
try
{
wrap
=
Wo
.
copier
.
copy
(
calendar
);
if
(
StringUtils
.
equalsAnyIgnoreCase
(
"SYSTEM"
,
calendar
.
getCreateor
()
)){
wrap
.
setCreateor
(
effectivePerson
.
getDistinguishedName
()
);
}
wrap
.
setManageable
(
ThisApplication
.
isCalendarManager
(
effectivePerson
,
wrap
)
);
wrap
.
setPublishable
(
ThisApplication
.
isCalendarPublisher
(
effectivePerson
,
unitNames
,
groupNames
,
wrap
)
);
wrap
.
setPublishable
(
ThisApplication
.
isCalendarPublisher
(
effectivePerson
,
unitNames
,
groupNames
,
wrap
)
);
if
(
ListTools
.
isNotEmpty
(
wrap
.
getManageablePersonList
()
)){
for
(
String
person
:
wrap
.
getManageablePersonList
()
){
if
(
StringUtils
.
equalsAnyIgnoreCase
(
person
,
"SYSTEM"
)){
if
(
!
wrap
.
getManageablePersonList
().
contains
(
effectivePerson
.
getDistinguishedName
()
)){
wrap
.
getManageablePersonList
().
add
(
effectivePerson
.
getDistinguishedName
()
);
}
}
}
}
if
(
ListTools
.
isNotEmpty
(
wrap
.
getViewablePersonList
()
)){
for
(
String
person
:
wrap
.
getViewablePersonList
()
){
if
(
StringUtils
.
equalsAnyIgnoreCase
(
person
,
"SYSTEM"
)){
if
(
!
wrap
.
getViewablePersonList
().
contains
(
effectivePerson
.
getDistinguishedName
()
)){
wrap
.
getViewablePersonList
().
add
(
effectivePerson
.
getDistinguishedName
()
);
}
}
}
}
if
(
ListTools
.
isNotEmpty
(
wrap
.
getViewablePersonList
()
)){
for
(
String
person
:
wrap
.
getViewablePersonList
()
){
if
(
StringUtils
.
equalsAnyIgnoreCase
(
person
,
"SYSTEM"
)){
if
(
!
wrap
.
getViewablePersonList
().
contains
(
effectivePerson
.
getDistinguishedName
()
)){
wrap
.
getViewablePersonList
().
add
(
effectivePerson
.
getDistinguishedName
()
);
}
}
}
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionCalendarInfoProcess
(
e
,
"将所有查询到的日历信息对象转换为可以输出的信息时发生异常."
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
...
...
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/jaxrs/calendar/ActionListWhatICanView.java
浏览文件 @
dceea5f1
...
...
@@ -78,13 +78,21 @@ public class ActionListWhatICanView extends BaseAction {
woCalendar
.
setPublishable
(
ThisApplication
.
isCalendarPublisher
(
effectivePerson
,
unitNames
,
groupNames
,
calendar
)
);
//将所有的日历分为三类,放在三个不同的LIST里
//组织日历
if
(
"UNIT"
.
equalsIgnoreCase
(
calendar
.
getType
()
)
)
{
wo
.
addUnitCalendar
(
woCalendar
);
}
else
{
if
(
calendar
.
getCreateor
().
equalsIgnoreCase
(
effectivePerson
.
getDistinguishedName
()
)
||
StringUtils
.
equalsAnyIgnoreCase
(
"SYSTEM"
,
calendar
.
getCreateor
()
))
{
if
(
StringUtils
.
equalsAnyIgnoreCase
(
"SYSTEM"
,
calendar
.
getCreateor
()
))
{
if
(
ListTools
.
isNotEmpty
(
calendar
.
getFollowers
()
)
&&
calendar
.
getFollowers
().
contains
(
effectivePerson
.
getDistinguishedName
()
)){
//我关注的日历
wo
.
addFollowCalendar
(
woCalendar
);
}
else
{
//个人或者组织日历
if
(
"UNIT"
.
equalsIgnoreCase
(
calendar
.
getType
()
)
)
{
//组织日历
wo
.
addUnitCalendar
(
woCalendar
);
}
else
{
//个人日历
// Boolean isMineCalendar = calendar.getCreateor().equalsIgnoreCase( effectivePerson.getDistinguishedName() );
Boolean
isSystemCreate
=
StringUtils
.
equalsAnyIgnoreCase
(
"SYSTEM"
,
calendar
.
getCreateor
()
);
if
(
isSystemCreate
)
{
if
(
!
existsSystemDefaultCalendar
){
woCalendar
.
setCreateor
(
effectivePerson
.
getDistinguishedName
()
);
wo
.
addMyCalendar
(
woCalendar
);
existsSystemDefaultCalendar
=
true
;
}
else
{
...
...
@@ -94,9 +102,6 @@ public class ActionListWhatICanView extends BaseAction {
}
else
{
wo
.
addMyCalendar
(
woCalendar
);
}
}
else
{
wo
.
addFollowCalendar
(
woCalendar
);
}
}
}
...
...
@@ -173,7 +178,7 @@ public class ActionListWhatICanView extends BaseAction {
static
{
Excludes
.
add
(
JpaObject
.
sequence_FIELDNAME
);
Excludes
.
add
(
"updateTime"
);
//
Excludes.add( "updateTime" );
Excludes
.
add
(
"manageablePersonList"
);
Excludes
.
add
(
"viewablePersonList"
);
Excludes
.
add
(
"viewableUnitList"
);
...
...
@@ -183,13 +188,13 @@ public class ActionListWhatICanView extends BaseAction {
Excludes
.
add
(
"publishableGroupList"
);
Excludes
.
add
(
"status"
);
Excludes
.
add
(
"distributeFactor"
);
Excludes
.
add
(
"isPublic"
);
//
Excludes.add( "isPublic" );
Excludes
.
add
(
"followers"
);
Excludes
.
add
(
"description"
);
Excludes
.
add
(
"target"
);
Excludes
.
add
(
"createor"
);
Excludes
.
add
(
"source"
);
Excludes
.
add
(
"createTime"
);
//
Excludes.add( "description" );
//
Excludes.add( "target" );
//
Excludes.add( "createor" );
//
Excludes.add( "source" );
// Excludes.add( "createTime" );
}
@FieldDescribe
(
"用户是否可以对该日历进行管理."
)
...
...
@@ -215,6 +220,5 @@ public class ActionListWhatICanView extends BaseAction {
public
void
setPublishable
(
Boolean
publishable
)
{
this
.
publishable
=
publishable
;
}
}
}
\ No newline at end of file
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/service/CalendarServiceAdv.java
浏览文件 @
dceea5f1
...
...
@@ -74,23 +74,23 @@ public class CalendarServiceAdv{
//管理者应该都有可见权限
if
(
ListTools
.
isNotEmpty
(
calendar
.
getManageablePersonList
()
))
{
for
(
String
managerName
:
calendar
.
getManageablePersonList
()
)
{
addStringToList
(
managerName
,
calendar
.
getViewablePersonList
()
);
addStringToList
(
managerName
,
effectivePerson
,
calendar
.
getViewablePersonList
()
);
}
}
//对日历信息进行权限设置,至少自己创建的日历自己可以管理 ,可以发布,可以查看
addStringToList
(
calendar
.
getCreateor
(),
calendar
.
getManageablePersonList
()
);
addStringToList
(
calendar
.
getCreateor
(),
calendar
.
getPublishablePersonList
()
);
addStringToList
(
calendar
.
getCreateor
(),
calendar
.
getViewablePersonList
()
);
addStringToList
(
calendar
.
getCreateor
(),
effectivePerson
,
calendar
.
getManageablePersonList
()
);
addStringToList
(
calendar
.
getCreateor
(),
effectivePerson
,
calendar
.
getPublishablePersonList
()
);
addStringToList
(
calendar
.
getCreateor
(),
effectivePerson
,
calendar
.
getViewablePersonList
()
);
if
(
"UNIT"
.
equals
(
calendar
.
getType
()
))
{
if
(
ListTools
.
isEmpty
(
calendar
.
getViewableUnitList
()
)
&&
ListTools
.
isEmpty
(
calendar
.
getViewableGroupList
()
)
&&
ListTools
.
isEmpty
(
calendar
.
getViewablePersonList
()
)){
addStringToList
(
calendar
.
getTarget
(),
calendar
.
getViewableUnitList
()
);
addStringToList
(
calendar
.
getTarget
(),
effectivePerson
,
calendar
.
getViewableUnitList
()
);
}
}
else
{
addStringToList
(
calendar
.
getTarget
(),
calendar
.
getViewablePersonList
()
);
addStringToList
(
calendar
.
getTarget
(),
effectivePerson
,
calendar
.
getViewablePersonList
()
);
}
if
(
StringUtils
.
isEmpty
(
calendar
.
getColor
()
))
{
...
...
@@ -130,10 +130,13 @@ public class CalendarServiceAdv{
* @param distinguishedName
* @param manageablePersonList
*/
private
void
addStringToList
(
String
distinguishedName
,
List
<
String
>
manageablePersonList
)
{
private
void
addStringToList
(
String
distinguishedName
,
EffectivePerson
effectivePerson
,
List
<
String
>
manageablePersonList
)
{
if
(
manageablePersonList
==
null
)
{
manageablePersonList
=
new
ArrayList
<>();
}
if
(
StringUtils
.
equalsAnyIgnoreCase
(
distinguishedName
,
"SYSTEM"
)){
distinguishedName
=
effectivePerson
.
getDistinguishedName
();
}
if
(
StringUtils
.
isNotEmpty
(
distinguishedName
)
)
{
if
(
!
manageablePersonList
.
contains
(
distinguishedName
))
{
manageablePersonList
.
add
(
distinguishedName
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录