Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
三久
DolphinScheduler
提交
cd4c9f93
DolphinScheduler
项目概览
三久
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cd4c9f93
编写于
5月 10, 2019
作者:
B
baoliang
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/branch-1.0.2' into 102
上级
9d53ad98
2347773a
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
280 addition
and
10 deletion
+280
-10
escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java
...scheduler/api/controller/ProcessDefinitionController.java
+25
-0
escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java
...in/java/cn/escheduler/api/controller/UsersController.java
+22
-1
escheduler-api/src/main/java/cn/escheduler/api/enums/Status.java
...ler-api/src/main/java/cn/escheduler/api/enums/Status.java
+3
-0
escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java
...a/cn/escheduler/api/service/ProcessDefinitionService.java
+59
-0
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java
...src/main/java/cn/escheduler/api/service/UsersService.java
+21
-0
escheduler-api/src/test/java/cn/escheduler/api/service/ProcessDefinitionServiceTest.java
.../escheduler/api/service/ProcessDefinitionServiceTest.java
+12
-0
escheduler-common/pom.xml
escheduler-common/pom.xml
+23
-0
escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java
...src/main/java/cn/escheduler/common/utils/HadoopUtils.java
+12
-2
escheduler-common/src/main/java/cn/escheduler/common/utils/PropertyUtils.java
...c/main/java/cn/escheduler/common/utils/PropertyUtils.java
+17
-0
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ScheduleMapper.java
...rc/main/java/cn/escheduler/dao/mapper/ScheduleMapper.java
+7
-1
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ScheduleMapperProvider.java
...java/cn/escheduler/dao/mapper/ScheduleMapperProvider.java
+17
-0
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java
...ao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java
+19
-0
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
...ain/java/cn/escheduler/dao/mapper/UserMapperProvider.java
+23
-3
escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue
.../conf/home/pages/user/pages/token/_source/createToken.vue
+2
-2
escheduler-ui/src/js/conf/home/store/security/actions.js
escheduler-ui/src/js/conf/home/store/security/actions.js
+13
-1
pom.xml
pom.xml
+5
-0
未找到文件。
escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java
浏览文件 @
cd4c9f93
...
@@ -325,4 +325,29 @@ public class ProcessDefinitionController extends BaseController{
...
@@ -325,4 +325,29 @@ public class ProcessDefinitionController extends BaseController{
}
}
}
}
/**
* delete process definition by id
*
* @param loginUser
* @param projectName
* @param processDefinitionId
* @return
*/
@GetMapping
(
value
=
"/delete"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
deleteProcessDefinitionById
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
,
@PathVariable
String
projectName
,
@RequestParam
(
"processDefinitionId"
)
Integer
processDefinitionId
){
try
{
logger
.
info
(
"delete process definition by id, login user:{}, project name:{}, process definition id:{}"
,
loginUser
.
getUserName
(),
projectName
,
processDefinitionId
);
Map
<
String
,
Object
>
result
=
processDefinitionService
.
deleteProcessDefinitionById
(
loginUser
,
projectName
,
processDefinitionId
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
logger
.
error
(
DELETE_PROCESS_DEFINE_BY_ID_ERROR
.
getMsg
(),
e
);
return
error
(
Status
.
DELETE_PROCESS_DEFINE_BY_ID_ERROR
.
getCode
(),
Status
.
DELETE_PROCESS_DEFINE_BY_ID_ERROR
.
getMsg
());
}
}
}
}
escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java
浏览文件 @
cd4c9f93
...
@@ -137,7 +137,7 @@ public class UsersController extends BaseController{
...
@@ -137,7 +137,7 @@ public class UsersController extends BaseController{
logger
.
info
(
"login user {}, updateProcessInstance user, userName: {}, email: {}, tenantId: {}, userPassword: {}, phone: {}, user queue: {}"
,
logger
.
info
(
"login user {}, updateProcessInstance user, userName: {}, email: {}, tenantId: {}, userPassword: {}, phone: {}, user queue: {}"
,
loginUser
.
getUserName
(),
userName
,
email
,
tenantId
,
Constants
.
PASSWORD_DEFAULT
,
phone
,
queue
);
loginUser
.
getUserName
(),
userName
,
email
,
tenantId
,
Constants
.
PASSWORD_DEFAULT
,
phone
,
queue
);
try
{
try
{
Map
<
String
,
Object
>
result
=
usersService
.
updateUser
(
id
,
userName
,
userPassword
,
email
,
tenantId
,
phone
,
queue
);
Map
<
String
,
Object
>
result
=
usersService
.
updateUser
(
id
,
userName
,
userPassword
,
email
,
tenantId
,
phone
,
queue
);
return
returnDataList
(
result
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
error
(
UPDATE_USER_ERROR
.
getMsg
(),
e
);
logger
.
error
(
UPDATE_USER_ERROR
.
getMsg
(),
e
);
...
@@ -285,6 +285,26 @@ public class UsersController extends BaseController{
...
@@ -285,6 +285,26 @@ public class UsersController extends BaseController{
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listUser
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
public
Result
listUser
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
logger
.
info
(
"login user {}, user list"
);
try
{
Map
<
String
,
Object
>
result
=
usersService
.
queryAllGeneralUsers
(
loginUser
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
logger
.
error
(
USER_LIST_ERROR
.
getMsg
(),
e
);
return
error
(
Status
.
USER_LIST_ERROR
.
getCode
(),
Status
.
USER_LIST_ERROR
.
getMsg
());
}
}
/**
* user list no paging
*
* @param loginUser
* @return
*/
@GetMapping
(
value
=
"/list-all"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listAll
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
logger
.
info
(
"login user {}, user list"
);
logger
.
info
(
"login user {}, user list"
);
try
{
try
{
Map
<
String
,
Object
>
result
=
usersService
.
queryUserList
(
loginUser
);
Map
<
String
,
Object
>
result
=
usersService
.
queryUserList
(
loginUser
);
...
@@ -295,6 +315,7 @@ public class UsersController extends BaseController{
...
@@ -295,6 +315,7 @@ public class UsersController extends BaseController{
}
}
}
}
/**
/**
* verify username
* verify username
*
*
...
...
escheduler-api/src/main/java/cn/escheduler/api/enums/Status.java
浏览文件 @
cd4c9f93
...
@@ -201,6 +201,9 @@ public enum Status {
...
@@ -201,6 +201,9 @@ public enum Status {
DATA_IS_NULL
(
50018
,
"data %s is null"
),
DATA_IS_NULL
(
50018
,
"data %s is null"
),
PROCESS_NODE_HAS_CYCLE
(
50019
,
"process node has cycle"
),
PROCESS_NODE_HAS_CYCLE
(
50019
,
"process node has cycle"
),
PROCESS_NODE_S_PARAMETER_INVALID
(
50020
,
"process node %s parameter invalid"
),
PROCESS_NODE_S_PARAMETER_INVALID
(
50020
,
"process node %s parameter invalid"
),
PROCESS_DEFINE_STATE_ONLINE
(
50021
,
"process definition {0} is already on line"
),
DELETE_PROCESS_DEFINE_BY_ID_ERROR
(
50022
,
"delete process definition by id error"
),
SCHEDULE_CRON_STATE_ONLINE
(
50023
,
"the status of schedule {0} is already on line"
),
HDFS_NOT_STARTUP
(
60001
,
"hdfs not startup"
),
HDFS_NOT_STARTUP
(
60001
,
"hdfs not startup"
),
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java
浏览文件 @
cd4c9f93
...
@@ -336,6 +336,65 @@ public class ProcessDefinitionService extends BaseDAGService {
...
@@ -336,6 +336,65 @@ public class ProcessDefinitionService extends BaseDAGService {
return
result
;
return
result
;
}
}
/**
* delete process definition by id
*
* @param loginUser
* @param projectName
* @param processDefinitionId
* @return
*/
@Transactional
(
value
=
"TransactionManager"
,
rollbackFor
=
Exception
.
class
)
public
Map
<
String
,
Object
>
deleteProcessDefinitionById
(
User
loginUser
,
String
projectName
,
Integer
processDefinitionId
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
Project
project
=
projectMapper
.
queryByName
(
projectName
);
Map
<
String
,
Object
>
checkResult
=
projectService
.
checkProjectAndAuth
(
loginUser
,
project
,
projectName
);
Status
resultEnum
=
(
Status
)
checkResult
.
get
(
Constants
.
STATUS
);
if
(
resultEnum
!=
Status
.
SUCCESS
)
{
return
checkResult
;
}
ProcessDefinition
processDefinition
=
processDefineMapper
.
queryByDefineId
(
processDefinitionId
);
if
(
processDefinition
==
null
)
{
putMsg
(
result
,
Status
.
PROCESS_DEFINE_NOT_EXIST
,
processDefinitionId
);
return
result
;
}
// check process definition is already online
if
(
processDefinition
.
getReleaseState
()
==
ReleaseState
.
ONLINE
)
{
putMsg
(
result
,
Status
.
PROCESS_DEFINE_STATE_ONLINE
,
processDefinitionId
);
return
result
;
}
// get the timing according to the process definition
List
<
Schedule
>
schedules
=
scheduleMapper
.
selectAllByProcessDefineArray
(
new
int
[
processDefinitionId
]);
if
(!
schedules
.
isEmpty
()
&&
schedules
.
size
()
>
1
)
{
logger
.
warn
(
"scheduler num is {},Greater than 1"
,
schedules
.
size
());
putMsg
(
result
,
Status
.
DELETE_PROCESS_DEFINE_BY_ID_ERROR
);
return
result
;
}
else
if
(
schedules
.
size
()
==
1
){
Schedule
schedule
=
schedules
.
get
(
0
);
if
(
schedule
.
getReleaseState
()
==
ReleaseState
.
OFFLINE
){
scheduleMapper
.
delete
(
schedule
.
getId
());
}
else
if
(
schedule
.
getReleaseState
()
==
ReleaseState
.
ONLINE
){
putMsg
(
result
,
Status
.
SCHEDULE_CRON_STATE_ONLINE
,
schedule
.
getId
());
return
result
;
}
}
int
delete
=
processDefineMapper
.
delete
(
processDefinitionId
);
if
(
delete
>
0
)
{
putMsg
(
result
,
Status
.
SUCCESS
);
}
else
{
putMsg
(
result
,
Status
.
DELETE_PROCESS_DEFINE_BY_ID_ERROR
);
}
return
result
;
}
/**
/**
* release process definition: online / offline
* release process definition: online / offline
*
*
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java
浏览文件 @
cd4c9f93
...
@@ -518,6 +518,27 @@ public class UsersService extends BaseService {
...
@@ -518,6 +518,27 @@ public class UsersService extends BaseService {
return
result
;
return
result
;
}
}
/**
* query user list
*
* @param loginUser
* @return
*/
public
Map
<
String
,
Object
>
queryAllGeneralUsers
(
User
loginUser
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
//only admin can operate
if
(
check
(
result
,
!
isAdmin
(
loginUser
),
Status
.
USER_NO_OPERATION_PERM
,
Constants
.
STATUS
))
{
return
result
;
}
List
<
User
>
userList
=
userMapper
.
queryAllGeneralUsers
();
result
.
put
(
Constants
.
DATA_LIST
,
userList
);
putMsg
(
result
,
Status
.
SUCCESS
);
return
result
;
}
/**
/**
* query user list
* query user list
*
*
...
...
escheduler-api/src/test/java/cn/escheduler/api/service/ProcessDefinitionServiceTest.java
浏览文件 @
cd4c9f93
...
@@ -63,4 +63,16 @@ public class ProcessDefinitionServiceTest {
...
@@ -63,4 +63,16 @@ public class ProcessDefinitionServiceTest {
Assert
.
assertEquals
(
Status
.
SUCCESS
,
map
.
get
(
Constants
.
STATUS
));
Assert
.
assertEquals
(
Status
.
SUCCESS
,
map
.
get
(
Constants
.
STATUS
));
logger
.
info
(
JSON
.
toJSONString
(
map
));
logger
.
info
(
JSON
.
toJSONString
(
map
));
}
}
@Test
public
void
deleteProcessDefinitionByIdTest
()
throws
Exception
{
User
loginUser
=
new
User
();
loginUser
.
setId
(
2
);
loginUser
.
setUserType
(
UserType
.
GENERAL_USER
);
Map
<
String
,
Object
>
map
=
processDefinitionService
.
deleteProcessDefinitionById
(
loginUser
,
"li_sql_test"
,
6
);
Assert
.
assertEquals
(
Status
.
SUCCESS
,
map
.
get
(
Constants
.
STATUS
));
logger
.
info
(
JSON
.
toJSONString
(
map
));
}
}
}
\ No newline at end of file
escheduler-common/pom.xml
浏览文件 @
cd4c9f93
...
@@ -230,6 +230,29 @@
...
@@ -230,6 +230,29 @@
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.hadoop
</groupId>
<artifactId>
hadoop-aws
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.apache.hadoop
</groupId>
<artifactId>
hadoop-common
</artifactId>
</exclusion>
<exclusion>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-core
</artifactId>
</exclusion>
<exclusion>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
</exclusion>
<exclusion>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-annotations
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<artifactId>
commons-lang3
</artifactId>
...
...
escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java
浏览文件 @
cd4c9f93
...
@@ -34,12 +34,14 @@ import org.slf4j.LoggerFactory;
...
@@ -34,12 +34,14 @@ import org.slf4j.LoggerFactory;
import
java.io.*
;
import
java.io.*
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
static
cn
.
escheduler
.
common
.
Constants
.*;
import
static
cn
.
escheduler
.
common
.
Constants
.*;
import
static
cn
.
escheduler
.
common
.
utils
.
PropertyUtils
.
getInt
;
import
static
cn
.
escheduler
.
common
.
utils
.
PropertyUtils
.
getInt
;
import
static
cn
.
escheduler
.
common
.
utils
.
PropertyUtils
.
getString
;
import
static
cn
.
escheduler
.
common
.
utils
.
PropertyUtils
.
getString
;
import
static
cn
.
escheduler
.
common
.
utils
.
PropertyUtils
.
getPrefixedProperties
;
/**
/**
* hadoop utils
* hadoop utils
...
@@ -76,7 +78,9 @@ public class HadoopUtils implements Closeable {
...
@@ -76,7 +78,9 @@ public class HadoopUtils implements Closeable {
if
(
defaultFS
.
startsWith
(
"file"
)){
if
(
defaultFS
.
startsWith
(
"file"
)){
String
defaultFSProp
=
getString
(
FS_DEFAULTFS
);
String
defaultFSProp
=
getString
(
FS_DEFAULTFS
);
if
(
StringUtils
.
isNotBlank
(
defaultFSProp
)){
if
(
StringUtils
.
isNotBlank
(
defaultFSProp
)){
Map
<
String
,
String
>
fsRelatedProps
=
getPrefixedProperties
(
"fs."
);
configuration
.
set
(
FS_DEFAULTFS
,
defaultFSProp
);
configuration
.
set
(
FS_DEFAULTFS
,
defaultFSProp
);
fsRelatedProps
.
entrySet
().
stream
().
forEach
(
entry
->
configuration
.
set
(
entry
.
getKey
(),
entry
.
getValue
()));
}
else
{
}
else
{
logger
.
error
(
"property:{} can not to be empty, please set!"
);
logger
.
error
(
"property:{} can not to be empty, please set!"
);
throw
new
RuntimeException
(
"property:{} can not to be empty, please set!"
);
throw
new
RuntimeException
(
"property:{} can not to be empty, please set!"
);
...
@@ -316,7 +320,13 @@ public class HadoopUtils implements Closeable {
...
@@ -316,7 +320,13 @@ public class HadoopUtils implements Closeable {
* @return data hdfs path
* @return data hdfs path
*/
*/
public
static
String
getHdfsDataBasePath
()
{
public
static
String
getHdfsDataBasePath
()
{
return
getString
(
DATA_STORE_2_HDFS_BASEPATH
);
String
basePath
=
getString
(
DATA_STORE_2_HDFS_BASEPATH
);
if
(
"/"
.
equals
(
basePath
))
{
// if basepath is configured to /, the generated url may be //default/resources (with extra leading /)
return
""
;
}
else
{
return
basePath
;
}
}
}
/**
/**
...
@@ -365,7 +375,7 @@ public class HadoopUtils implements Closeable {
...
@@ -365,7 +375,7 @@ public class HadoopUtils implements Closeable {
* @return file directory of tenants on hdfs
* @return file directory of tenants on hdfs
*/
*/
private
static
String
getHdfsTenantDir
(
String
tenantCode
)
{
private
static
String
getHdfsTenantDir
(
String
tenantCode
)
{
return
String
.
format
(
"%s/%s"
,
get
String
(
DATA_STORE_2_HDFS_BASEPATH
),
tenantCode
);
return
String
.
format
(
"%s/%s"
,
get
HdfsDataBasePath
(
),
tenantCode
);
}
}
...
...
escheduler-common/src/main/java/cn/escheduler/common/utils/PropertyUtils.java
浏览文件 @
cd4c9f93
...
@@ -22,6 +22,8 @@ import org.slf4j.LoggerFactory;
...
@@ -22,6 +22,8 @@ import org.slf4j.LoggerFactory;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Properties
;
import
static
cn
.
escheduler
.
common
.
Constants
.
COMMON_PROPERTIES_PATH
;
import
static
cn
.
escheduler
.
common
.
Constants
.
COMMON_PROPERTIES_PATH
;
...
@@ -189,4 +191,19 @@ public class PropertyUtils {
...
@@ -189,4 +191,19 @@ public class PropertyUtils {
String
val
=
getString
(
key
);
String
val
=
getString
(
key
);
return
val
==
null
?
defaultValue
:
Enum
.
valueOf
(
type
,
val
);
return
val
==
null
?
defaultValue
:
Enum
.
valueOf
(
type
,
val
);
}
}
/**
* get all properties with specified prefix, like: fs.
* @param prefix prefix to search
* @return
*/
public
static
Map
<
String
,
String
>
getPrefixedProperties
(
String
prefix
)
{
Map
<
String
,
String
>
matchedProperties
=
new
HashMap
<>();
for
(
String
propName
:
properties
.
stringPropertyNames
())
{
if
(
propName
.
startsWith
(
prefix
))
{
matchedProperties
.
put
(
propName
,
properties
.
getProperty
(
propName
));
}
}
return
matchedProperties
;
}
}
}
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ScheduleMapper.java
浏览文件 @
cd4c9f93
...
@@ -173,6 +173,12 @@ public interface ScheduleMapper {
...
@@ -173,6 +173,12 @@ public interface ScheduleMapper {
@SelectProvider
(
type
=
ScheduleMapperProvider
.
class
,
method
=
"selectAllByProcessDefineArray"
)
@SelectProvider
(
type
=
ScheduleMapperProvider
.
class
,
method
=
"selectAllByProcessDefineArray"
)
List
<
Schedule
>
selectAllByProcessDefineArray
(
@Param
(
"processDefineIds"
)
int
[]
processDefineIds
);
List
<
Schedule
>
selectAllByProcessDefineArray
(
@Param
(
"processDefineIds"
)
int
[]
processDefineIds
);
/**
* delete schedule by id
* @param scheduleId
* @return
*/
@DeleteProvider
(
type
=
ScheduleMapperProvider
.
class
,
method
=
"delete"
)
int
delete
(
@Param
(
"scheduleId"
)
int
scheduleId
);
}
}
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ScheduleMapperProvider.java
浏览文件 @
cd4c9f93
...
@@ -180,4 +180,21 @@ public class ScheduleMapperProvider {
...
@@ -180,4 +180,21 @@ public class ScheduleMapperProvider {
WHERE
(
"release_state = 1"
);
WHERE
(
"release_state = 1"
);
}}.
toString
();
}}.
toString
();
}
}
/**
* delete schedule by id
*
* @param parameter
* @return
*/
public
String
delete
(
Map
<
String
,
Object
>
parameter
)
{
return
new
SQL
()
{
{
DELETE_FROM
(
DB_NAME
);
WHERE
(
"`id`=#{scheduleId}"
);
}
}.
toString
();
}
}
}
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java
浏览文件 @
cd4c9f93
...
@@ -76,6 +76,25 @@ public interface UserMapper {
...
@@ -76,6 +76,25 @@ public interface UserMapper {
@SelectProvider
(
type
=
UserMapperProvider
.
class
,
method
=
"queryById"
)
@SelectProvider
(
type
=
UserMapperProvider
.
class
,
method
=
"queryById"
)
User
queryById
(
@Param
(
"userId"
)
int
userId
);
User
queryById
(
@Param
(
"userId"
)
int
userId
);
/**
* query all general user list
* @return
*/
@Results
(
value
=
{
@Result
(
property
=
"id"
,
column
=
"id"
,
id
=
true
,
javaType
=
Integer
.
class
,
jdbcType
=
JdbcType
.
INTEGER
),
@Result
(
property
=
"userName"
,
column
=
"user_name"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"userPassword"
,
column
=
"user_password"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"email"
,
column
=
"email"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"phone"
,
column
=
"phone"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"userType"
,
column
=
"user_type"
,
typeHandler
=
EnumOrdinalTypeHandler
.
class
,
javaType
=
UserType
.
class
,
jdbcType
=
JdbcType
.
TINYINT
),
@Result
(
property
=
"tenantId"
,
column
=
"tenant_id"
,
javaType
=
Integer
.
class
,
jdbcType
=
JdbcType
.
INTEGER
),
@Result
(
property
=
"createTime"
,
column
=
"create_time"
,
javaType
=
Timestamp
.
class
,
jdbcType
=
JdbcType
.
DATE
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
,
javaType
=
Timestamp
.
class
,
jdbcType
=
JdbcType
.
DATE
)
})
@SelectProvider
(
type
=
UserMapperProvider
.
class
,
method
=
"queryAllGeneralUsers"
)
List
<
User
>
queryAllGeneralUsers
();
/**
/**
* query all user list
* query all user list
* @return
* @return
...
...
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
浏览文件 @
cd4c9f93
...
@@ -118,7 +118,7 @@ public class UserMapperProvider {
...
@@ -118,7 +118,7 @@ public class UserMapperProvider {
*
*
* @return
* @return
*/
*/
public
String
queryAllUsers
()
{
public
String
queryAll
General
Users
()
{
return
new
SQL
()
{
return
new
SQL
()
{
{
{
SELECT
(
"*"
);
SELECT
(
"*"
);
...
@@ -130,6 +130,22 @@ public class UserMapperProvider {
...
@@ -130,6 +130,22 @@ public class UserMapperProvider {
}.
toString
();
}.
toString
();
}
}
/**
* query all user list
*
* @return
*/
public
String
queryAllUsers
()
{
return
new
SQL
()
{
{
SELECT
(
"*"
);
FROM
(
TABLE_NAME
);
}
}.
toString
();
}
/**
/**
* check user name and password
* check user name and password
*
*
...
@@ -188,13 +204,17 @@ public class UserMapperProvider {
...
@@ -188,13 +204,17 @@ public class UserMapperProvider {
return
new
SQL
()
{
return
new
SQL
()
{
{
{
SELECT
(
"u.*,t.tenant_name as tenantName,q.queue_name as queueName"
);
SELECT
(
"u.*,t.tenant_name as tenantName,q.queue_name as queueName"
);
FROM
(
TABLE_NAME
+
" u,t_escheduler_tenant t,t_escheduler_queue q"
);
FROM
(
TABLE_NAME
+
" u "
);
WHERE
(
"u.user_type = 1 AND u.tenant_id = t.id and t.queue_id = q.id"
);
LEFT_OUTER_JOIN
(
"t_escheduler_tenant t on u.tenant_id = t.id"
);
LEFT_OUTER_JOIN
(
"t_escheduler_queue q on t.queue_id = q.id"
);
WHERE
(
"u.user_type = 1"
);
Object
searchVal
=
parameter
.
get
(
"searchVal"
);
Object
searchVal
=
parameter
.
get
(
"searchVal"
);
if
(
searchVal
!=
null
&&
StringUtils
.
isNotEmpty
(
searchVal
.
toString
())){
if
(
searchVal
!=
null
&&
StringUtils
.
isNotEmpty
(
searchVal
.
toString
())){
WHERE
(
" u.user_name like concat('%', #{searchVal}, '%') "
);
WHERE
(
" u.user_name like concat('%', #{searchVal}, '%') "
);
}
}
ORDER_BY
(
" u.update_time desc limit #{offset},#{pageSize} "
);
ORDER_BY
(
" u.update_time desc limit #{offset},#{pageSize} "
);
}
}
}.
toString
();
}.
toString
();
...
...
escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue
浏览文件 @
cd4c9f93
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
}
}
}
}
if
(
this
.
auth
)
{
if
(
this
.
auth
)
{
this
.
store
.
dispatch
(
`security/getUsers
List
`
).
then
(
res
=>
{
this
.
store
.
dispatch
(
`security/getUsers
All
`
).
then
(
res
=>
{
this
.
userIdList
=
_
.
map
(
res
,
v
=>
_
.
pick
(
v
,
[
'
id
'
,
'
userName
'
]))
this
.
userIdList
=
_
.
map
(
res
,
v
=>
_
.
pick
(
v
,
[
'
id
'
,
'
userName
'
]))
d
(
this
.
userIdList
[
0
].
id
)
d
(
this
.
userIdList
[
0
].
id
)
})
})
...
@@ -158,4 +158,4 @@
...
@@ -158,4 +158,4 @@
.create-token-model
{
.create-token-model
{
width
:
640px
;
width
:
640px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
escheduler-ui/src/js/conf/home/store/security/actions.js
浏览文件 @
cd4c9f93
...
@@ -100,7 +100,7 @@ export default {
...
@@ -100,7 +100,7 @@ export default {
})
})
},
},
/**
/**
*
Paging query user list
*
user list expect admin
*/
*/
getUsersList
({
state
},
payload
)
{
getUsersList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -111,6 +111,18 @@ export default {
...
@@ -111,6 +111,18 @@ export default {
})
})
})
})
},
},
/**
* user all list
*/
getUsersAll
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`users/list-all`
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
})
})
},
/**
/**
* Update user
* Update user
* @param "id":int,
* @param "id":int,
...
...
pom.xml
浏览文件 @
cd4c9f93
...
@@ -323,6 +323,11 @@
...
@@ -323,6 +323,11 @@
<artifactId>
hadoop-yarn-common
</artifactId>
<artifactId>
hadoop-yarn-common
</artifactId>
<version>
${hadoop.version}
</version>
<version>
${hadoop.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.hadoop
</groupId>
<artifactId>
hadoop-aws
</artifactId>
<version>
${hadoop.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<groupId>
javax.servlet
</groupId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录