Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
MaxKey
提交
3a65a666
MaxKey
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
MaxKey
10 个月 前同步成功
通知
75
Star
3
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3a65a666
编写于
5月 25, 2022
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
system logs
上级
3cabc8a7
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
519 addition
and
125 deletion
+519
-125
maxkey-core/src/main/java/org/maxkey/constants/ConstsEntryType.java
...e/src/main/java/org/maxkey/constants/ConstsEntryType.java
+15
-7
maxkey-core/src/main/java/org/maxkey/constants/ConstsOperateAction.java
...c/main/java/org/maxkey/constants/ConstsOperateAction.java
+34
-13
maxkey-core/src/main/java/org/maxkey/constants/ConstsOperateResult.java
...c/main/java/org/maxkey/constants/ConstsOperateResult.java
+4
-10
maxkey-core/src/main/java/org/maxkey/entity/HistorySystemLogs.java
...re/src/main/java/org/maxkey/entity/HistorySystemLogs.java
+20
-18
maxkey-persistence/src/main/java/org/maxkey/persistence/service/HistorySystemLogsService.java
.../maxkey/persistence/service/HistorySystemLogsService.java
+191
-1
maxkey-persistence/src/main/java/org/maxkey/persistence/service/UserInfoService.java
.../java/org/maxkey/persistence/service/UserInfoService.java
+6
-2
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/HistorySystemLogsMapper.xml
.../persistence/mapper/xml/mysql/HistorySystemLogsMapper.xml
+3
-3
maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/audit/audit-system-logs/audit-system-logs.component.html
.../audit/audit-system-logs/audit-system-logs.component.html
+23
-52
maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json
...eb-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json
+1
-1
maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json
...eb-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json
+1
-1
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ChangePasswodController.java
...va/org/maxkey/web/contorller/ChangePasswodController.java
+13
-0
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java
...c/main/java/org/maxkey/web/contorller/SafeController.java
+2
-2
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/GroupMemberController.java
...g/maxkey/web/access/contorller/GroupMemberController.java
+4
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/GroupPrivilegesController.java
...xkey/web/access/contorller/GroupPrivilegesController.java
+4
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/GroupsController.java
...va/org/maxkey/web/access/contorller/GroupsController.java
+25
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/LoginSessionController.java
.../maxkey/web/access/contorller/LoginSessionController.java
+4
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/apps/contorller/BaseAppContorller.java
...ava/org/maxkey/web/apps/contorller/BaseAppContorller.java
+4
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/config/contorller/LocalizationController.java
.../maxkey/web/config/contorller/LocalizationController.java
+5
-5
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java
...in/java/org/maxkey/web/contorller/AccountsController.java
+31
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/OrganizationsController.java
...va/org/maxkey/web/contorller/OrganizationsController.java
+25
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserAdjointController.java
...java/org/maxkey/web/contorller/UserAdjointController.java
+9
-9
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java
...in/java/org/maxkey/web/contorller/UserInfoController.java
+37
-1
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/ResourcesController.java
...axkey/web/permissions/contorller/ResourcesController.java
+25
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RoleMemberController.java
...xkey/web/permissions/contorller/RoleMemberController.java
+4
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RolePrivilegesController.java
.../web/permissions/contorller/RolePrivilegesController.java
+4
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RolesController.java
...rg/maxkey/web/permissions/contorller/RolesController.java
+25
-0
未找到文件。
maxkey-core/src/main/java/org/maxkey/constants/ConstsEntryType.java
浏览文件 @
3a65a666
/*
* Copyright [202
0
] [MaxKey of copyright http://www.maxkey.top]
* Copyright [202
2
] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -19,16 +19,24 @@ package org.maxkey.constants;
public
class
ConstsEntryType
{
public
static
int
USERINFO_TYPE
=
1
;
public
static
String
USERINFO
=
"user"
;
public
static
int
ORGANIZATION_TYPE
=
2
;
public
static
String
ORGANIZATION
=
"organization"
;
public
static
int
GROUP_TYPE
=
3
;
public
static
String
APPLICATION
=
"application"
;
public
static
int
PASSWORD_TYPE
=
4
;
public
static
String
GROUP
=
"group"
;
public
static
String
ACCOUNT
=
"account"
;
public
static
String
ROLE
=
"role"
;
public
static
String
PASSWORD
=
"password"
;
public
static
String
RESOURCE
=
"resource"
;
public
static
String
PERMISSION
=
"permission"
;
public
static
int
RESOURCES_TYPE
=
5
;
public
static
int
PERMISSIONS_TYPE
=
6
;
}
maxkey-core/src/main/java/org/maxkey/constants/ConstsOperateAction.java
浏览文件 @
3a65a666
...
...
@@ -17,20 +17,41 @@
package
org.maxkey.constants
;
public
final
class
ConstsOperateAction
{
public
static
final
int
CREATE_ACTION
=
1
;
public
static
final
int
DELETE_ACTION
=
2
;
public
static
final
int
UPDATE_ACTION
=
3
;
import
java.util.concurrent.ConcurrentHashMap
;
public
static
final
int
CHANGE_PASSWORD_ACTION
=
4
;
public
static
final
int
ADD_MEMBER_ACTION
=
5
;
public
static
final
int
DELETE_MEMBER_ACTION
=
6
;
public
final
class
ConstsOperateAction
{
public
static
final
int
VIEW_ACTION
=
7
;
public
static
final
String
CREATE
=
"create"
;
public
static
final
String
DELETE
=
"delete"
;
public
static
final
String
UPDATE
=
"update"
;
public
static
final
String
CHANGE_PASSWORD
=
"change_password"
;
public
static
final
String
ADD_MEMBER
=
"add_member"
;
public
static
final
String
DELETE_MEMBER
=
"delete_member"
;
public
static
final
String
ENABLE
=
"enable"
;
public
static
final
String
DISABLE
=
"disable"
;
public
static
final
String
LOCK
=
"lock"
;
public
static
final
String
UNLOCK
=
"unlock"
;
public
static
final
String
VIEW
=
"view"
;
public
static
ConcurrentHashMap
<
Integer
,
String
>
statusActon
;
static
{
statusActon
=
new
ConcurrentHashMap
<
Integer
,
String
>();
statusActon
.
put
(
ConstsStatus
.
ACTIVE
,
ENABLE
);
statusActon
.
put
(
ConstsStatus
.
DISABLED
,
DISABLE
);
statusActon
.
put
(
ConstsStatus
.
LOCK
,
LOCK
);
statusActon
.
put
(
ConstsStatus
.
UNLOCK
,
UNLOCK
);
statusActon
.
put
(
ConstsStatus
.
DELETE
,
DELETE
);
}
}
maxkey-core/src/main/java/org/maxkey/constants/ConstsOperate
Message
.java
→
maxkey-core/src/main/java/org/maxkey/constants/ConstsOperate
Result
.java
浏览文件 @
3a65a666
...
...
@@ -17,15 +17,9 @@
package
org.maxkey.constants
;
public
final
class
ConstsOperateMessage
{
public
static
final
String
INSERT_SUCCESS
=
"message.action.insert.success"
;
public
static
final
String
INSERT_ERROR
=
"message.action.insert.error"
;
public
static
final
String
UPDATE_SUCCESS
=
"message.action.update.success"
;
public
static
final
String
UPDATE_ERROR
=
"message.action.update.error"
;
public
static
final
String
DELETE_SUCCESS
=
"message.action.delete.success"
;
public
static
final
String
DELETE_ERROR
=
"message.action.delete.error"
;
public
final
class
ConstsOperateResult
{
public
static
final
String
SUCCESS
=
"success"
;
public
static
final
String
ERROR
=
"error"
;
public
static
final
String
FAIL
=
"fail"
;
}
maxkey-core/src/main/java/org/maxkey/entity/HistorySystemLogs.java
浏览文件 @
3a65a666
...
...
@@ -44,7 +44,7 @@ public class HistorySystemLogs extends JpaBaseEntity implements Serializable {
@Column
String
message
;
@Column
String
message
Type
;
String
message
Action
;
@Column
String
messageResult
;
@Column
...
...
@@ -58,6 +58,8 @@ public class HistorySystemLogs extends JpaBaseEntity implements Serializable {
@Column
private
String
instId
;
String
jsonCotent
;
private
String
instName
;
String
startDate
;
String
endDate
;
...
...
@@ -90,14 +92,12 @@ public class HistorySystemLogs extends JpaBaseEntity implements Serializable {
this
.
message
=
message
;
}
public
String
getMessageType
()
{
return
messageType
;
public
String
getMessageAction
()
{
return
messageAction
;
}
public
void
setMessage
Type
(
String
messageType
)
{
this
.
message
Type
=
messageType
;
public
void
setMessage
Action
(
String
messageAction
)
{
this
.
message
Action
=
messageAction
;
}
public
String
getMessageResult
()
{
...
...
@@ -172,17 +172,25 @@ public class HistorySystemLogs extends JpaBaseEntity implements Serializable {
this
.
endDate
=
endDate
;
}
public
String
getJsonCotent
()
{
return
jsonCotent
;
}
public
void
setJsonCotent
(
String
jsonCotent
)
{
this
.
jsonCotent
=
jsonCotent
;
}
@Override
public
String
toString
()
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"HistoryLogs [id="
);
builder
.
append
(
"History
System
Logs [id="
);
builder
.
append
(
id
);
builder
.
append
(
", topic="
);
builder
.
append
(
topic
);
builder
.
append
(
", message="
);
builder
.
append
(
message
);
builder
.
append
(
", message
Type
="
);
builder
.
append
(
message
Type
);
builder
.
append
(
", message
Action
="
);
builder
.
append
(
message
Action
);
builder
.
append
(
", messageResult="
);
builder
.
append
(
messageResult
);
builder
.
append
(
", userId="
);
...
...
@@ -193,14 +201,8 @@ public class HistorySystemLogs extends JpaBaseEntity implements Serializable {
builder
.
append
(
displayName
);
builder
.
append
(
", executeTime="
);
builder
.
append
(
executeTime
);
builder
.
append
(
", instId="
);
builder
.
append
(
instId
);
builder
.
append
(
", instName="
);
builder
.
append
(
instName
);
builder
.
append
(
", startDate="
);
builder
.
append
(
startDate
);
builder
.
append
(
", endDate="
);
builder
.
append
(
endDate
);
builder
.
append
(
", jsonCotent="
);
builder
.
append
(
jsonCotent
);
builder
.
append
(
"]"
);
return
builder
.
toString
();
}
...
...
maxkey-persistence/src/main/java/org/maxkey/persistence/service/HistorySystemLogsService.java
浏览文件 @
3a65a666
...
...
@@ -18,13 +18,30 @@
package
org.maxkey.persistence.service
;
import
org.apache.mybatis.jpa.persistence.JpaBaseService
;
import
org.maxkey.entity.Accounts
;
import
org.maxkey.entity.ChangePassword
;
import
org.maxkey.entity.GroupMember
;
import
org.maxkey.entity.GroupPrivileges
;
import
org.maxkey.entity.Groups
;
import
org.maxkey.entity.HistorySystemLogs
;
import
org.maxkey.entity.Organizations
;
import
org.maxkey.entity.Resources
;
import
org.maxkey.entity.RoleMember
;
import
org.maxkey.entity.RolePrivileges
;
import
org.maxkey.entity.Roles
;
import
org.maxkey.entity.SocialsProvider
;
import
org.maxkey.entity.Synchronizers
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.mapper.HistorySystemLogsMapper
;
import
org.maxkey.util.JsonUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
HistorySystemLogsService
extends
JpaBaseService
<
HistorySystemLogs
>{
final
static
Logger
_logger
=
LoggerFactory
.
getLogger
(
HistorySystemLogsService
.
class
);
public
HistorySystemLogsService
()
{
super
(
HistorySystemLogsMapper
.
class
);
...
...
@@ -37,4 +54,177 @@ public class HistorySystemLogsService extends JpaBaseService<HistorySystemLogs>
public
HistorySystemLogsMapper
getMapper
()
{
return
(
HistorySystemLogsMapper
)
super
.
getMapper
();
}
public
void
insert
(
String
topic
,
Object
entity
,
String
action
,
String
result
,
UserInfo
operator
)
{
String
message
=
""
;
if
(
entity
!=
null
)
{
if
(
entity
instanceof
UserInfo
)
{
message
=
buildMsg
((
UserInfo
)
entity
);
}
else
if
(
entity
instanceof
Organizations
)
{
message
=
buildMsg
((
Organizations
)
entity
);
}
else
if
(
entity
instanceof
ChangePassword
)
{
message
=
buildMsg
((
ChangePassword
)
entity
);
}
else
if
(
entity
instanceof
Accounts
)
{
message
=
buildMsg
((
Accounts
)
entity
);
}
else
if
(
entity
instanceof
Groups
)
{
message
=
buildMsg
((
Groups
)
entity
);
}
else
if
(
entity
instanceof
Roles
)
{
message
=
buildMsg
((
Roles
)
entity
);
}
else
if
(
entity
instanceof
GroupMember
)
{
message
=
buildMsg
((
GroupMember
)
entity
);
}
else
if
(
entity
instanceof
RoleMember
)
{
message
=
buildMsg
((
RoleMember
)
entity
);
}
else
if
(
entity
instanceof
GroupPrivileges
)
{
message
=
buildMsg
((
GroupPrivileges
)
entity
);
}
else
if
(
entity
instanceof
Resources
)
{
message
=
buildMsg
((
Resources
)
entity
);
}
else
if
(
entity
instanceof
Synchronizers
)
{
message
=
buildMsg
((
Synchronizers
)
entity
);
}
else
if
(
entity
instanceof
SocialsProvider
)
{
message
=
buildMsg
((
SocialsProvider
)
entity
);
}
else
if
(
entity
instanceof
RolePrivileges
)
{
message
=
buildMsg
((
RolePrivileges
)
entity
);
}
else
if
(
entity
instanceof
String
)
{
message
=
entity
.
toString
();
}
}
insert
(
topic
,
message
,
action
,
result
,
operator
,
entity
);
}
public
void
insert
(
String
topic
,
String
message
,
String
action
,
String
result
,
UserInfo
operator
,
Object
entity
)
{
HistorySystemLogs
systemLog
=
new
HistorySystemLogs
();
systemLog
.
setId
(
systemLog
.
generateId
());
systemLog
.
setTopic
(
topic
);
systemLog
.
setMessage
(
message
);
systemLog
.
setMessageAction
(
action
);
systemLog
.
setMessageResult
(
result
);
systemLog
.
setUserId
(
operator
.
getId
());
systemLog
.
setUsername
(
operator
.
getUsername
());
systemLog
.
setDisplayName
(
operator
.
getDisplayName
());
systemLog
.
setInstId
(
operator
.
getInstId
());
systemLog
.
setJsonCotent
(
JsonUtils
.
gson2Json
(
entity
));
_logger
.
trace
(
"System Log {}"
,
systemLog
);
getMapper
().
insert
(
systemLog
);
}
public
String
buildMsg
(
UserInfo
userInfo
)
{
return
new
StringBuilder
()
.
append
(
userInfo
.
getDisplayName
())
.
append
(
"["
)
.
append
(
userInfo
.
getUsername
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
Organizations
org
)
{
return
new
StringBuilder
()
.
append
(
org
.
getName
())
.
append
(
"["
)
.
append
(
org
.
getCode
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
Accounts
account
)
{
return
new
StringBuilder
()
.
append
(
account
.
getRelatedUsername
())
.
append
(
"["
)
.
append
(
account
.
getDisplayName
()).
append
(
","
)
.
append
(
account
.
getUsername
()).
append
(
","
)
.
append
(
account
.
getAppName
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
ChangePassword
changePassword
)
{
return
new
StringBuilder
()
.
append
(
changePassword
.
getDisplayName
())
.
append
(
"["
)
.
append
(
changePassword
.
getUsername
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
Groups
g
)
{
return
new
StringBuilder
()
.
append
(
g
.
getName
())
.
toString
();
}
public
String
buildMsg
(
Roles
r
)
{
return
new
StringBuilder
()
.
append
(
r
.
getName
())
.
toString
();
}
public
String
buildMsg
(
RoleMember
rm
)
{
return
new
StringBuilder
()
.
append
(
rm
.
getRoleName
())
.
append
(
"["
)
.
append
(
rm
.
getUsername
()).
append
(
","
)
.
append
(
rm
.
getDisplayName
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
GroupMember
gm
)
{
return
new
StringBuilder
()
.
append
(
gm
.
getGroupName
())
.
append
(
"["
)
.
append
(
gm
.
getUsername
()).
append
(
","
)
.
append
(
gm
.
getDisplayName
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
GroupPrivileges
privilege
)
{
return
new
StringBuilder
()
.
append
(
privilege
.
getGroupName
())
.
append
(
"["
)
.
append
(
privilege
.
getAppName
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
RolePrivileges
privilege
)
{
return
new
StringBuilder
()
.
append
(
privilege
.
getRoleId
())
.
append
(
"["
)
.
append
(
privilege
.
getResourceId
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
Resources
r
)
{
return
new
StringBuilder
()
.
append
(
r
.
getName
())
.
append
(
"["
)
.
append
(
r
.
getResourceType
())
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
Synchronizers
s
)
{
return
new
StringBuilder
()
.
append
(
s
.
getName
())
.
append
(
"["
)
.
append
(
s
.
getSourceType
()).
append
(
","
)
.
append
(
s
.
getScheduler
()).
append
(
","
)
.
append
(
"]"
)
.
toString
();
}
public
String
buildMsg
(
SocialsProvider
s
)
{
return
new
StringBuilder
()
.
append
(
s
.
getProviderName
())
.
append
(
"["
)
.
append
(
s
.
getProvider
())
.
append
(
"]"
)
.
toString
();
}
}
maxkey-persistence/src/main/java/org/maxkey/persistence/service/UserInfoService.java
浏览文件 @
3a65a666
...
...
@@ -100,8 +100,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
loadUserInfo
,
MqProvisionAction
.
UPDATE_ACTION
);
}
changePasswordProvisioning
(
changePassword
);
if
(
userInfo
.
getPassword
()
!=
null
)
{
changePasswordProvisioning
(
changePassword
);
}
return
true
;
}
return
false
;
...
...
@@ -211,6 +212,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
userInfo
.
setPassword
(
changePassword
.
getPassword
());
userInfo
.
setDecipherable
(
changePassword
.
getDecipherable
());
userInfo
.
setPasswordLastSetTime
(
changePassword
.
getPasswordLastSetTime
());
}
else
{
userInfo
.
setPassword
(
null
);
userInfo
.
setDecipherable
(
null
);
}
return
changePassword
;
}
...
...
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/HistorySystemLogsMapper.xml
浏览文件 @
3a65a666
...
...
@@ -21,11 +21,11 @@
<if
test=
"displayName != null and displayName != ''"
>
and lower(displayName) like lower(concat('%',#{displayName},'%'))
</if>
<if
test=
"message
Type != null and messageType
!= ''"
>
and message
Type = #{messageType
}
<if
test=
"message
Action != null and messageAction
!= ''"
>
and message
action = #{messageAction
}
</if>
<if
test=
"messageResult != null and messageResult != ''"
>
and message
R
esult = #{messageResult}
and message
r
esult = #{messageResult}
</if>
</sql>
...
...
maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/audit/audit-system-logs/audit-system-logs.component.html
浏览文件 @
3a65a666
...
...
@@ -7,7 +7,8 @@
<nz-form-item>
<nz-form-label
nzFor=
"username"
>
{{ 'mxk.users.username' | i18n }}
</nz-form-label>
<nz-form-control>
<input
nz-input
[(ngModel)]=
"query.params.username"
[ngModelOptions]=
"{ standalone: true }"
name=
"username"
id=
"username"
/>
<input
nz-input
[(ngModel)]=
"query.params.username"
[ngModelOptions]=
"{ standalone: true }"
name=
"username"
id=
"username"
/>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -15,13 +16,8 @@
<nz-form-item>
<nz-form-label
nzFor=
"displayName"
>
{{ 'mxk.users.displayName' | i18n }}
</nz-form-label>
<nz-form-control>
<input
nz-input
[(ngModel)]=
"query.params.displayName"
[ngModelOptions]=
"{ standalone: true }"
id=
"displayName"
name=
"displayName"
/>
<input
nz-input
[(ngModel)]=
"query.params.displayName"
[ngModelOptions]=
"{ standalone: true }"
id=
"displayName"
name=
"displayName"
/>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -29,13 +25,8 @@
<nz-form-item>
<nz-form-label
nzFor=
"employeeNumber"
>
{{ 'mxk.users.employeeNumber' | i18n }}
</nz-form-label>
<nz-form-control>
<input
nz-input
[(ngModel)]=
"query.params.employeeNumber"
[ngModelOptions]=
"{ standalone: true }"
id=
"employeeNumber"
name=
"employeeNumber"
/>
<input
nz-input
[(ngModel)]=
"query.params.employeeNumber"
[ngModelOptions]=
"{ standalone: true }"
id=
"employeeNumber"
name=
"employeeNumber"
/>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -43,14 +34,9 @@
<nz-form-item>
<nz-form-label
nzFor=
"startDatePicker"
>
{{ 'mxk.text.startDate' | i18n }}
</nz-form-label>
<nz-form-control>
<nz-date-picker
nzShowTime
nzFormat=
"yyyy-MM-dd HH:mm:ss"
[(ngModel)]=
"query.params.startDatePicker"
[ngModelOptions]=
"{ standalone: true }"
name=
"startDatePicker"
nzPlaceHolder=
"startDatePicker"
></nz-date-picker>
<nz-date-picker
nzShowTime
nzFormat=
"yyyy-MM-dd HH:mm:ss"
[(ngModel)]=
"query.params.startDatePicker"
[ngModelOptions]=
"{ standalone: true }"
name=
"startDatePicker"
nzPlaceHolder=
"startDatePicker"
>
</nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
...
...
@@ -58,50 +44,35 @@
<nz-form-item>
<nz-form-label
nzFor=
"endDatePicker"
>
{{ 'mxk.text.endDate' | i18n }}
</nz-form-label>
<nz-form-control>
<nz-date-picker
nzShowTime
nzFormat=
"yyyy-MM-dd HH:mm:ss"
[(ngModel)]=
"query.params.endDatePicker"
[ngModelOptions]=
"{ standalone: true }"
name=
"endDatePicker"
nzPlaceHolder=
"endDatePicker"
></nz-date-picker>
<nz-date-picker
nzShowTime
nzFormat=
"yyyy-MM-dd HH:mm:ss"
[(ngModel)]=
"query.params.endDatePicker"
[ngModelOptions]=
"{ standalone: true }"
name=
"endDatePicker"
nzPlaceHolder=
"endDatePicker"
>
</nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[nzSpan]=
"query.expandForm ? 24 : 8"
[class.text-right]=
"query.expandForm"
>
<button
nz-button
type=
"submit"
[nzType]=
"'primary'"
[nzLoading]=
"query.submitLoading"
>
{{ 'mxk.text.query' | i18n }}
</button>
<button
nz-button
type=
"submit"
[nzType]=
"'primary'"
[nzLoading]=
"query.submitLoading"
>
{{ 'mxk.text.query' |
i18n }}
</button>
<button
nz-button
type=
"reset"
(click)=
"onReset()"
class=
"mx-sm"
>
{{ 'mxk.text.reset' | i18n }}
</button>
<button
nz-button
(click)=
"query.expandForm = !query.expandForm"
class=
"mx-sm"
>
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}
</button
>
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}
</button>
</div>
</div>
</form>
</nz-card>
<nz-card>
<nz-table
#dynamicTable
nzTableLayout=
"auto"
nzSize=
"small"
nzShowSizeChanger
[nzBordered]=
"true"
[nzData]=
"query.results.rows"
[nzFrontPagination]=
"false"
[nzTotal]=
"query.results.records"
[nzPageSizeOptions]=
"query.params.pageSizeOptions"
[nzPageSize]=
"query.params.pageSize"
[nzPageIndex]=
"query.params.pageNumber"
[nzLoading]=
"this.query.tableLoading"
(nzQueryParams)=
"onQueryParamsChange($event)"
>
<nz-table
#dynamicTable
nzTableLayout=
"auto"
nzSize=
"small"
nzShowSizeChanger
[nzBordered]=
"true"
[nzData]=
"query.results.rows"
[nzFrontPagination]=
"false"
[nzTotal]=
"query.results.records"
[nzPageSizeOptions]=
"query.params.pageSizeOptions"
[nzPageSize]=
"query.params.pageSize"
[nzPageIndex]=
"query.params.pageNumber"
[nzLoading]=
"this.query.tableLoading"
(nzQueryParams)=
"onQueryParamsChange($event)"
>
<thead>
<tr>
<th
nzAlign=
"center"
style=
"display: none"
>
{{ 'mxk.history.systemlogs.id' | i18n }}
</th>
<th
nzAlign=
"center"
>
{{ 'mxk.history.systemlogs.topic' | i18n }}
</th>
<th
nzAlign=
"center"
>
{{ 'mxk.history.systemlogs.message' | i18n }}
</th>
<th
nzAlign=
"center"
>
{{ 'mxk.history.systemlogs.message
Type
' | i18n }}
</th>
<th
nzAlign=
"center"
>
{{ 'mxk.history.systemlogs.message
Action
' | i18n }}
</th>
<th
nzAlign=
"center"
>
{{ 'mxk.history.systemlogs.messageResult' | i18n }}
</th>
<th
nzAlign=
"center"
>
{{ 'mxk.history.systemlogs.displayName' | i18n }}
</th>
<th
nzAlign=
"center"
>
{{ 'mxk.history.systemlogs.executeTime' | i18n }}
</th>
...
...
@@ -114,11 +85,11 @@
</td>
<td
nzAlign=
"left"
>
{{ data.topic }}
</td>
<td
nzAlign=
"left"
>
{{ data.message }}
</td>
<td
nzAlign=
"left"
>
{{ data.message
Type
}}
</td>
<td
nzAlign=
"left"
>
{{ data.message
Action
}}
</td>
<td
nzAlign=
"left"
>
{{ data.messageResult }}
</td>
<td
nzAlign=
"left"
>
{{ data.displayName }}
</td>
<td
nzAlign=
"left"
>
{{ data.executeTime }}
</td>
</tr>
</tbody>
</nz-table>
</nz-card>
</nz-card>
\ No newline at end of file
maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json
浏览文件 @
3a65a666
...
...
@@ -604,7 +604,7 @@
"systemlogs.id"
:
"Id"
,
"systemlogs.topic"
:
"Topic"
,
"systemlogs.message"
:
"Message"
,
"systemlogs.message
Type"
:
"Type
"
,
"systemlogs.message
Action"
:
"Action
"
,
"systemlogs.messageResult"
:
"Result"
,
"systemlogs.userId"
:
"userId"
,
"systemlogs.username"
:
"username"
,
...
...
maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json
浏览文件 @
3a65a666
...
...
@@ -603,7 +603,7 @@
"systemlogs.id"
:
"编号"
,
"systemlogs.topic"
:
"主题"
,
"systemlogs.message"
:
"内容"
,
"systemlogs.message
Type"
:
"类型
"
,
"systemlogs.message
Action"
:
"操作
"
,
"systemlogs.messageResult"
:
"结果"
,
"systemlogs.userId"
:
"操作人编号"
,
"systemlogs.username"
:
"操作人登录名"
,
...
...
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ChangePasswodController.java
浏览文件 @
3a65a666
...
...
@@ -18,10 +18,14 @@
package
org.maxkey.web.contorller
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsEntryType
;
import
org.maxkey.constants.ConstsOperateAction
;
import
org.maxkey.constants.ConstsOperateResult
;
import
org.maxkey.constants.ConstsPasswordSetType
;
import
org.maxkey.entity.ChangePassword
;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.UserInfoService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -41,6 +45,9 @@ public class ChangePasswodController {
@Autowired
private
UserInfoService
userInfoService
;
@Autowired
HistorySystemLogsService
systemLog
;
@ResponseBody
@RequestMapping
(
value
=
{
"/changePassword"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
public
ResponseEntity
<?>
changePasswod
(
...
...
@@ -52,6 +59,12 @@ public class ChangePasswodController {
changePassword
.
setInstId
(
currentUser
.
getInstId
());
changePassword
.
setPasswordSetType
(
ConstsPasswordSetType
.
PASSWORD_NORMAL
);
if
(
userInfoService
.
changePassword
(
changePassword
))
{
systemLog
.
insert
(
ConstsEntryType
.
USERINFO
,
changePassword
,
ConstsOperateAction
.
CHANGE_PASSWORD
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
ChangePassword
>().
buildResponse
();
}
else
{
return
new
Message
<
ChangePassword
>(
Message
.
ERROR
).
buildResponse
();
...
...
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java
浏览文件 @
3a65a666
...
...
@@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsOperate
Message
;
import
org.maxkey.constants.ConstsOperate
Result
;
import
org.maxkey.constants.ConstsTimeInterval
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.UserInfoService
;
...
...
@@ -79,7 +79,7 @@ public class SafeController {
userInfoService
.
updateEmail
(
currentUser
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
UPDATE_
SUCCESS
),
MessageType
.
success
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
success
);
}
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/GroupMemberController.java
浏览文件 @
3a65a666
...
...
@@ -25,6 +25,7 @@ import org.maxkey.entity.Message;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.GroupMemberService
;
import
org.maxkey.persistence.service.GroupsService
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.UserInfoService
;
import
org.maxkey.util.StringUtils
;
import
org.maxkey.web.WebContext
;
...
...
@@ -55,6 +56,9 @@ public class GroupMemberController {
@Autowired
UserInfoService
userInfoService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
public
ResponseEntity
<?>
fetch
(
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/GroupPrivilegesController.java
浏览文件 @
3a65a666
...
...
@@ -23,6 +23,7 @@ import org.maxkey.entity.Message;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.entity.apps.Apps
;
import
org.maxkey.persistence.service.GroupPrivilegesService
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.web.WebContext
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -44,6 +45,9 @@ public class GroupPrivilegesController {
@Autowired
GroupPrivilegesService
groupPrivilegesService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/appsInGroup"
})
@ResponseBody
public
ResponseEntity
<?>
appsInGroup
(
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/GroupsController.java
浏览文件 @
3a65a666
...
...
@@ -19,10 +19,14 @@ package org.maxkey.web.access.contorller;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsEntryType
;
import
org.maxkey.constants.ConstsOperateAction
;
import
org.maxkey.constants.ConstsOperateResult
;
import
org.maxkey.entity.Groups
;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.GroupsService
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -45,6 +49,9 @@ public class GroupsController {
@Autowired
GroupsService
groupsService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
public
ResponseEntity
<?>
fetch
(
...
...
@@ -82,6 +89,12 @@ public class GroupsController {
group
.
setInstId
(
currentUser
.
getInstId
());
if
(
groupsService
.
insert
(
group
))
{
groupsService
.
refreshDynamicGroups
(
group
);
systemLog
.
insert
(
ConstsEntryType
.
GROUP
,
group
,
ConstsOperateAction
.
CREATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Groups
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Groups
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -98,6 +111,12 @@ public class GroupsController {
group
.
setInstId
(
currentUser
.
getInstId
());
if
(
groupsService
.
update
(
group
))
{
groupsService
.
refreshDynamicGroups
(
group
);
systemLog
.
insert
(
ConstsEntryType
.
GROUP
,
group
,
ConstsOperateAction
.
UPDATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Groups
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Groups
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -110,6 +129,12 @@ public class GroupsController {
_logger
.
debug
(
"-delete ids : {}"
,
ids
);
ids
=
ids
.
replaceAll
(
"ROLE_ALL_USER"
,
"-1"
).
replaceAll
(
"ROLE_ADMINISTRATORS"
,
"-1"
);
if
(
groupsService
.
deleteBatch
(
ids
))
{
systemLog
.
insert
(
ConstsEntryType
.
GROUP
,
ids
,
ConstsOperateAction
.
DELETE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Groups
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Groups
>(
Message
.
FAIL
).
buildResponse
();
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/access/contorller/LoginSessionController.java
浏览文件 @
3a65a666
...
...
@@ -26,6 +26,7 @@ import org.maxkey.entity.HistoryLogin;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.HistoryLoginService
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.util.DateUtils
;
import
org.maxkey.util.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -59,6 +60,9 @@ public class LoginSessionController {
@Autowired
SessionManager
sessionManager
;
@Autowired
HistorySystemLogsService
systemLog
;
/**
* 查询登录日志.
*
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/apps/contorller/BaseAppContorller.java
浏览文件 @
3a65a666
...
...
@@ -25,6 +25,7 @@ import org.maxkey.crypto.password.PasswordReciprocal;
import
org.maxkey.entity.apps.Apps
;
import
org.maxkey.persistence.service.AppsService
;
import
org.maxkey.persistence.service.FileUploadService
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.util.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -46,6 +47,9 @@ public class BaseAppContorller {
@Autowired
protected
FileUploadService
fileUploadService
;
@Autowired
HistorySystemLogsService
systemLog
;
public
void
setAppsService
(
AppsService
appsService
)
{
this
.
appsService
=
appsService
;
}
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/config/contorller/LocalizationController.java
浏览文件 @
3a65a666
...
...
@@ -19,7 +19,7 @@ package org.maxkey.web.config.contorller;
import
org.apache.commons.lang3.StringUtils
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsOperate
Message
;
import
org.maxkey.constants.ConstsOperate
Result
;
import
org.maxkey.entity.Localization
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.repository.LocalizationRepository
;
...
...
@@ -73,15 +73,15 @@ public class LocalizationController {
if
(
StringUtils
.
isBlank
(
localization
.
getId
())){
localization
.
setId
(
localization
.
generateId
());
if
(
localizationRepository
.
insert
(
localization
))
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
UPDATE_
SUCCESS
),
MessageType
.
success
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
success
);
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
UPDATE_
ERROR
),
MessageType
.
error
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
ERROR
),
MessageType
.
error
);
}
}
else
{
if
(
localizationRepository
.
update
(
localization
))
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
UPDATE_
SUCCESS
),
MessageType
.
success
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
success
);
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
UPDATE_
ERROR
),
MessageType
.
error
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
ERROR
),
MessageType
.
error
);
}
}
}
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java
浏览文件 @
3a65a666
...
...
@@ -19,6 +19,9 @@ package org.maxkey.web.contorller;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsEntryType
;
import
org.maxkey.constants.ConstsOperateAction
;
import
org.maxkey.constants.ConstsOperateResult
;
import
org.maxkey.crypto.password.PasswordReciprocal
;
import
org.maxkey.entity.Accounts
;
import
org.maxkey.entity.AccountsStrategy
;
...
...
@@ -27,6 +30,7 @@ import org.maxkey.entity.UserInfo;
import
org.maxkey.persistence.service.AccountsService
;
import
org.maxkey.persistence.service.AccountsStrategyService
;
import
org.maxkey.persistence.service.AppsService
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.UserInfoService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -59,6 +63,9 @@ public class AccountsController {
@Autowired
UserInfoService
userInfoService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
public
ResponseEntity
<?>
fetch
(
@ModelAttribute
Accounts
accounts
,
@CurrentUser
UserInfo
currentUser
)
{
...
...
@@ -94,6 +101,12 @@ public class AccountsController {
account
.
setInstId
(
currentUser
.
getInstId
());
account
.
setRelatedPassword
(
PasswordReciprocal
.
getInstance
().
encode
(
account
.
getRelatedPassword
()));
if
(
accountsService
.
insert
(
account
))
{
systemLog
.
insert
(
ConstsEntryType
.
ACCOUNT
,
account
,
ConstsOperateAction
.
CREATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Accounts
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Accounts
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -107,6 +120,12 @@ public class AccountsController {
account
.
setInstId
(
currentUser
.
getInstId
());
account
.
setRelatedPassword
(
PasswordReciprocal
.
getInstance
().
encode
(
account
.
getRelatedPassword
()));
if
(
accountsService
.
update
(
account
))
{
systemLog
.
insert
(
ConstsEntryType
.
ACCOUNT
,
account
,
ConstsOperateAction
.
UPDATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Accounts
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Accounts
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -120,6 +139,12 @@ public class AccountsController {
_logger
.
debug
(
""
+
accounts
);
accounts
.
setInstId
(
currentUser
.
getInstId
());
if
(
accountsService
.
updateStatus
(
accounts
))
{
systemLog
.
insert
(
ConstsEntryType
.
ACCOUNT
,
accounts
,
ConstsOperateAction
.
statusActon
.
get
(
accounts
.
getStatus
()),
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Accounts
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Accounts
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -132,6 +157,12 @@ public class AccountsController {
_logger
.
debug
(
"-delete ids : {} "
,
ids
);
if
(
accountsService
.
deleteBatch
(
ids
))
{
systemLog
.
insert
(
ConstsEntryType
.
ACCOUNT
,
ids
,
ConstsOperateAction
.
DELETE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Accounts
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Accounts
>(
Message
.
FAIL
).
buildResponse
();
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/OrganizationsController.java
浏览文件 @
3a65a666
...
...
@@ -29,10 +29,14 @@ import org.apache.poi.ss.usermodel.Row;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsEntryType
;
import
org.maxkey.constants.ConstsOperateAction
;
import
org.maxkey.constants.ConstsOperateResult
;
import
org.maxkey.entity.ExcelImport
;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.Organizations
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.OrganizationsService
;
import
org.maxkey.util.ExcelUtils
;
import
org.maxkey.web.component.TreeAttributes
;
...
...
@@ -60,6 +64,9 @@ public class OrganizationsController {
@Autowired
OrganizationsService
organizationsService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
...
...
@@ -95,6 +102,12 @@ public class OrganizationsController {
_logger
.
debug
(
"-Add :"
+
org
);
org
.
setInstId
(
currentUser
.
getInstId
());
if
(
organizationsService
.
insert
(
org
))
{
systemLog
.
insert
(
ConstsEntryType
.
ORGANIZATION
,
org
,
ConstsOperateAction
.
CREATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Organizations
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Organizations
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -107,6 +120,12 @@ public class OrganizationsController {
_logger
.
debug
(
"-update :"
+
org
);
org
.
setInstId
(
currentUser
.
getInstId
());
if
(
organizationsService
.
update
(
org
))
{
systemLog
.
insert
(
ConstsEntryType
.
ORGANIZATION
,
org
,
ConstsOperateAction
.
UPDATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Organizations
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Organizations
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -118,6 +137,12 @@ public class OrganizationsController {
public
ResponseEntity
<?>
delete
(
@RequestParam
(
"ids"
)
String
ids
,
@CurrentUser
UserInfo
currentUser
)
{
_logger
.
debug
(
"-delete ids : {} "
,
ids
);
if
(
organizationsService
.
deleteBatch
(
ids
))
{
systemLog
.
insert
(
ConstsEntryType
.
ORGANIZATION
,
ids
,
ConstsOperateAction
.
DELETE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Organizations
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Organizations
>(
Message
.
FAIL
).
buildResponse
();
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserAdjointController.java
浏览文件 @
3a65a666
...
...
@@ -19,7 +19,7 @@ package org.maxkey.web.contorller;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsOperate
Message
;
import
org.maxkey.constants.ConstsOperate
Result
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.entity.UserInfoAdjoint
;
import
org.maxkey.persistence.service.UserInfoAdjointService
;
...
...
@@ -88,10 +88,10 @@ public class UserAdjointController {
_logger
.
debug
(
"-Add :"
+
userInfoAdjoint
);
userInfoAdjoint
.
setInstId
(
currentUser
.
getInstId
());
if
(
userInfoAdjointService
.
insert
(
userInfoAdjoint
))
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
INSERT_
SUCCESS
),
MessageType
.
success
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
success
);
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
INSERT_
SUCCESS
),
MessageType
.
error
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
error
);
}
}
...
...
@@ -109,10 +109,10 @@ public class UserAdjointController {
_logger
.
debug
(
"-query :"
+
userInfoAdjoint
);
userInfoAdjoint
.
setInstId
(
currentUser
.
getInstId
());
if
(
userInfoAdjointService
.
load
(
userInfoAdjoint
)!=
null
)
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
INSERT_
SUCCESS
),
MessageType
.
success
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
success
);
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
INSERT_ERROR
),
MessageType
.
error
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
error
);
}
}
...
...
@@ -130,10 +130,10 @@ public class UserAdjointController {
_logger
.
debug
(
"-update userInfoAdjoint :"
+
userInfoAdjoint
);
userInfoAdjoint
.
setInstId
(
currentUser
.
getInstId
());
if
(
userInfoAdjointService
.
update
(
userInfoAdjoint
))
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
UPDATE_
SUCCESS
),
MessageType
.
success
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
success
);
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
UPDATE_
ERROR
),
MessageType
.
error
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
ERROR
),
MessageType
.
error
);
}
}
...
...
@@ -145,9 +145,9 @@ public class UserAdjointController {
_logger
.
debug
(
"-delete group :"
+
userInfoAdjoint
);
if
(
userInfoAdjointService
.
deleteBatch
(
userInfoAdjoint
.
getId
()))
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
DELETE_
SUCCESS
),
MessageType
.
success
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
SUCCESS
),
MessageType
.
success
);
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Message
.
DELETE_SUCCESS
),
MessageType
.
error
);
return
new
Message
(
WebContext
.
getI18nValue
(
ConstsOperate
Result
.
ERROR
),
MessageType
.
error
);
}
}
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java
浏览文件 @
3a65a666
...
...
@@ -34,12 +34,16 @@ import org.apache.poi.ss.usermodel.Row;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsEntryType
;
import
org.maxkey.constants.ConstsOperateAction
;
import
org.maxkey.constants.ConstsOperateResult
;
import
org.maxkey.constants.ConstsPasswordSetType
;
import
org.maxkey.entity.ChangePassword
;
import
org.maxkey.entity.ExcelImport
;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.FileUploadService
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.UserInfoService
;
import
org.maxkey.util.DateUtils
;
import
org.maxkey.util.ExcelUtils
;
...
...
@@ -79,6 +83,8 @@ public class UserInfoController {
@Autowired
FileUploadService
fileUploadService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
...
...
@@ -125,6 +131,12 @@ public class UserInfoController {
fileUploadService
.
remove
(
userInfo
.
getPictureId
());
}
if
(
userInfoService
.
insert
(
userInfo
))
{
systemLog
.
insert
(
ConstsEntryType
.
USERINFO
,
userInfo
,
ConstsOperateAction
.
CREATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
UserInfo
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
UserInfo
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -147,6 +159,12 @@ public class UserInfoController {
fileUploadService
.
remove
(
userInfo
.
getPictureId
());
}
if
(
userInfoService
.
update
(
userInfo
))
{
systemLog
.
insert
(
ConstsEntryType
.
USERINFO
,
userInfo
,
ConstsOperateAction
.
UPDATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
UserInfo
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
UserInfo
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -157,7 +175,14 @@ public class UserInfoController {
@RequestMapping
(
value
={
"/delete"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
public
ResponseEntity
<?>
delete
(
@RequestParam
(
"ids"
)
String
ids
,
@CurrentUser
UserInfo
currentUser
)
{
_logger
.
debug
(
"-delete ids : {} "
,
ids
);
if
(
userInfoService
.
deleteBatch
(
ids
))
{
systemLog
.
insert
(
ConstsEntryType
.
USERINFO
,
ids
,
ConstsOperateAction
.
DELETE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
UserInfo
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
UserInfo
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -197,8 +222,13 @@ public class UserInfoController {
_logger
.
debug
(
"UserId {}"
,
changePassword
.
getUserId
());
changePassword
.
setPasswordSetType
(
ConstsPasswordSetType
.
PASSWORD_NORMAL
);
if
(
userInfoService
.
changePassword
(
changePassword
,
true
))
{
systemLog
.
insert
(
ConstsEntryType
.
USERINFO
,
changePassword
,
ConstsOperateAction
.
CHANGE_PASSWORD
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
UserInfo
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
UserInfo
>(
Message
.
FAIL
).
buildResponse
();
}
...
...
@@ -210,6 +240,12 @@ public class UserInfoController {
_logger
.
debug
(
""
+
userInfo
);
userInfo
.
setInstId
(
currentUser
.
getInstId
());
if
(
userInfoService
.
updateStatus
(
userInfo
))
{
systemLog
.
insert
(
ConstsEntryType
.
USERINFO
,
userInfo
,
ConstsOperateAction
.
statusActon
.
get
(
userInfo
.
getStatus
()),
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
UserInfo
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
UserInfo
>(
Message
.
FAIL
).
buildResponse
();
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/ResourcesController.java
浏览文件 @
3a65a666
...
...
@@ -21,9 +21,13 @@ import java.util.List;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsEntryType
;
import
org.maxkey.constants.ConstsOperateAction
;
import
org.maxkey.constants.ConstsOperateResult
;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.Resources
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.ResourcesService
;
import
org.maxkey.web.component.TreeAttributes
;
import
org.maxkey.web.component.TreeNode
;
...
...
@@ -48,6 +52,9 @@ public class ResourcesController {
@Autowired
ResourcesService
resourcesService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
...
...
@@ -83,6 +90,12 @@ public class ResourcesController {
_logger
.
debug
(
"-Add :"
+
resource
);
resource
.
setInstId
(
currentUser
.
getInstId
());
if
(
resourcesService
.
insert
(
resource
))
{
systemLog
.
insert
(
ConstsEntryType
.
RESOURCE
,
resource
,
ConstsOperateAction
.
CREATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Resources
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Resources
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -95,6 +108,12 @@ public class ResourcesController {
_logger
.
debug
(
"-update :"
+
resource
);
resource
.
setInstId
(
currentUser
.
getInstId
());
if
(
resourcesService
.
update
(
resource
))
{
systemLog
.
insert
(
ConstsEntryType
.
RESOURCE
,
resource
,
ConstsOperateAction
.
UPDATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Resources
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Resources
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -106,6 +125,12 @@ public class ResourcesController {
public
ResponseEntity
<?>
delete
(
@RequestParam
(
"ids"
)
String
ids
,
@CurrentUser
UserInfo
currentUser
)
{
_logger
.
debug
(
"-delete ids : {} "
,
ids
);
if
(
resourcesService
.
deleteBatch
(
ids
))
{
systemLog
.
insert
(
ConstsEntryType
.
RESOURCE
,
ids
,
ConstsOperateAction
.
DELETE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Resources
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Resources
>(
Message
.
FAIL
).
buildResponse
();
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RoleMemberController.java
浏览文件 @
3a65a666
...
...
@@ -23,6 +23,7 @@ import org.maxkey.entity.Message;
import
org.maxkey.entity.RoleMember
;
import
org.maxkey.entity.Roles
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.RoleMemberService
;
import
org.maxkey.persistence.service.RolesService
;
import
org.maxkey.persistence.service.UserInfoService
;
...
...
@@ -55,6 +56,9 @@ public class RoleMemberController {
@Autowired
UserInfoService
userInfoService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
public
ResponseEntity
<?>
fetch
(
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RolePrivilegesController.java
浏览文件 @
3a65a666
...
...
@@ -25,6 +25,7 @@ import org.maxkey.authn.annotation.CurrentUser;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.RolePrivileges
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.RolesService
;
import
org.maxkey.util.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -47,6 +48,9 @@ public class RolePrivilegesController {
@Autowired
RolesService
rolesService
;
@Autowired
HistorySystemLogsService
systemLog
;
@ResponseBody
@RequestMapping
(
value
={
"/update"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
public
ResponseEntity
<?>
update
(
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/permissions/contorller/RolesController.java
浏览文件 @
3a65a666
...
...
@@ -19,9 +19,13 @@ package org.maxkey.web.permissions.contorller;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.authn.annotation.CurrentUser
;
import
org.maxkey.constants.ConstsEntryType
;
import
org.maxkey.constants.ConstsOperateAction
;
import
org.maxkey.constants.ConstsOperateResult
;
import
org.maxkey.entity.Message
;
import
org.maxkey.entity.Roles
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.HistorySystemLogsService
;
import
org.maxkey.persistence.service.RolesService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -45,6 +49,9 @@ public class RolesController {
@Autowired
RolesService
rolesService
;
@Autowired
HistorySystemLogsService
systemLog
;
@RequestMapping
(
value
=
{
"/fetch"
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
public
ResponseEntity
<?>
fetch
(
@ModelAttribute
Roles
roles
,
@CurrentUser
UserInfo
currentUser
)
{
...
...
@@ -80,6 +87,12 @@ public class RolesController {
role
.
setInstId
(
currentUser
.
getInstId
());
if
(
rolesService
.
insert
(
role
))
{
rolesService
.
refreshDynamicRoles
(
role
);
systemLog
.
insert
(
ConstsEntryType
.
ROLE
,
role
,
ConstsOperateAction
.
CREATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Roles
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Roles
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -93,6 +106,12 @@ public class RolesController {
role
.
setInstId
(
currentUser
.
getInstId
());
if
(
rolesService
.
update
(
role
))
{
rolesService
.
refreshDynamicRoles
(
role
);
systemLog
.
insert
(
ConstsEntryType
.
ROLE
,
role
,
ConstsOperateAction
.
UPDATE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Roles
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Roles
>(
Message
.
FAIL
).
buildResponse
();
...
...
@@ -105,6 +124,12 @@ public class RolesController {
_logger
.
debug
(
"-delete ids : {} "
,
ids
);
if
(
rolesService
.
deleteBatch
(
ids
))
{
systemLog
.
insert
(
ConstsEntryType
.
ROLE
,
ids
,
ConstsOperateAction
.
DELETE
,
ConstsOperateResult
.
SUCCESS
,
currentUser
);
return
new
Message
<
Roles
>(
Message
.
SUCCESS
).
buildResponse
();
}
else
{
return
new
Message
<
Roles
>(
Message
.
FAIL
).
buildResponse
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录