Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
jz-dmp-service
Commits
6cce39b2
Commit
6cce39b2
authored
Jan 21, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
69976e70
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
4 deletions
+80
-4
update.sql
database/mcb/update.sql
+2
-0
RealTimeSyncController.java
...es/controller/DataIntegration/RealTimeSyncController.java
+27
-0
RealTimeSyncListDto.java
.../controller/DataIntegration/bean/RealTimeSyncListDto.java
+11
-0
DmpApiServiceMangeController.java
.../controller/dataService/DmpApiServiceMangeController.java
+9
-2
DmpRealtimeSyncInfoService.java
...om/jz/dmp/modules/service/DmpRealtimeSyncInfoService.java
+9
-0
DmpRealtimeSyncInfoServiceImpl.java
.../modules/service/impl/DmpRealtimeSyncInfoServiceImpl.java
+16
-0
DmpRealtimeSyncInfoMapper.xml
src/main/resources/mapper/dmp/DmpRealtimeSyncInfoMapper.xml
+6
-2
No files found.
database/mcb/update.sql
View file @
6cce39b2
...
@@ -17,3 +17,5 @@ add jaas_address varchar(128) DEFAULT NULL COMMENT 'jaas地址(Kafka)',
...
@@ -17,3 +17,5 @@ add jaas_address varchar(128) DEFAULT NULL COMMENT 'jaas地址(Kafka)',
add
krb5_address
varchar
(
128
)
DEFAULT
NULL
COMMENT
'krb5地址(Kafka)'
,
add
krb5_address
varchar
(
128
)
DEFAULT
NULL
COMMENT
'krb5地址(Kafka)'
,
add
kudu_master
varchar
(
128
)
DEFAULT
NULL
COMMENT
'kkudu_master(Kudu)'
,
add
kudu_master
varchar
(
128
)
DEFAULT
NULL
COMMENT
'kkudu_master(Kudu)'
,
add
impala_master_fqdn
varchar
(
128
)
DEFAULT
NULL
COMMENT
'impala_master_fqdn(Kudu)'
;
add
impala_master_fqdn
varchar
(
128
)
DEFAULT
NULL
COMMENT
'impala_master_fqdn(Kudu)'
;
alter
table
dmp_realtime_sync_info
add
online_status
char
(
1
)
default
'N'
comment
'上下线状态:Y 上线,N 下线'
;
src/main/java/com/jz/dmp/modules/controller/DataIntegration/RealTimeSyncController.java
View file @
6cce39b2
...
@@ -302,4 +302,31 @@ public class RealTimeSyncController {
...
@@ -302,4 +302,31 @@ public class RealTimeSyncController {
JsonResult
<
RealTimeEditDataEchoDto
>
jsonResult
=
dmpRealtimeSyncInfoService
.
selectRealtimeTaskById
(
taskId
);
JsonResult
<
RealTimeEditDataEchoDto
>
jsonResult
=
dmpRealtimeSyncInfoService
.
selectRealtimeTaskById
(
taskId
);
return
jsonResult
;
return
jsonResult
;
}
}
/**
* 批量上下线
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
@ApiOperation
(
value
=
"批量上下线"
,
notes
=
"批量上下线"
)
@GetMapping
(
value
=
"/batchUptOnlineStatus"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"realTaskId"
,
value
=
"任务id"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"onlineStatus"
,
value
=
"上下线状态:Y 上线,N 下线"
,
required
=
true
)})
public
JsonResult
batchUptOnlineStatus
(
@RequestParam
String
realTaskId
,
@RequestParam
String
onlineStatus
)
throws
Exception
{
logger
.
info
(
"###################请求参数{}taskId="
+
realTaskId
+
"###################"
);
if
(
StringUtils
.
isEmpty
(
realTaskId
))
{
return
new
JsonResult
(
ResultCode
.
PARAMS_ERROR
,
"任务id不能为空!"
);
}
if
(
StringUtils
.
isEmpty
(
onlineStatus
))
{
return
new
JsonResult
(
ResultCode
.
PARAMS_ERROR
,
"状态不能为空!"
);
}
boolean
jsonResult
=
dmpRealtimeSyncInfoService
.
batchUptOnlineStatus
(
realTaskId
,
onlineStatus
);
if
(
jsonResult
)
{
return
JsonResult
.
ok
();
}
else
{
return
JsonResult
.
error
(
"删除失败!"
);
}
}
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DataIntegration/bean/RealTimeSyncListDto.java
View file @
6cce39b2
...
@@ -80,6 +80,9 @@ public class RealTimeSyncListDto {
...
@@ -80,6 +80,9 @@ public class RealTimeSyncListDto {
@ApiModelProperty
(
value
=
"去向数据源类型"
)
@ApiModelProperty
(
value
=
"去向数据源类型"
)
private
String
targetDatabaseType
;
private
String
targetDatabaseType
;
@ApiModelProperty
(
value
=
"上下线状态:Y 上线,N 下线"
)
private
String
onlineStatus
;
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -167,4 +170,12 @@ public class RealTimeSyncListDto {
...
@@ -167,4 +170,12 @@ public class RealTimeSyncListDto {
public
void
setTargetDatabaseType
(
String
targetDatabaseType
)
{
public
void
setTargetDatabaseType
(
String
targetDatabaseType
)
{
this
.
targetDatabaseType
=
targetDatabaseType
;
this
.
targetDatabaseType
=
targetDatabaseType
;
}
}
public
String
getOnlineStatus
()
{
return
onlineStatus
;
}
public
void
setOnlineStatus
(
String
onlineStatus
)
{
this
.
onlineStatus
=
onlineStatus
;
}
}
}
src/main/java/com/jz/dmp/modules/controller/dataService/DmpApiServiceMangeController.java
View file @
6cce39b2
...
@@ -235,8 +235,15 @@ public class DmpApiServiceMangeController {
...
@@ -235,8 +235,15 @@ public class DmpApiServiceMangeController {
@ApiOperation
(
value
=
"获取数据源表字段"
,
notes
=
"获取数据源表字段"
)
@ApiOperation
(
value
=
"获取数据源表字段"
,
notes
=
"获取数据源表字段"
)
@PostMapping
(
value
=
"/getTableColumns"
)
@PostMapping
(
value
=
"/getTableColumns"
)
public
JsonResult
getTableColumns
(
@RequestBody
@Validated
SoureTableColumnsReq
req
)
throws
Exception
{
public
JsonResult
getTableColumns
(
@RequestBody
@Validated
SoureTableColumnsReq
req
)
throws
Exception
{
JsonResult
list
=
offlineSynchService
.
querySoureTableColumns
(
req
);
JsonResult
jsonResult
=
new
JsonResult
();
return
list
;
try
{
jsonResult
=
offlineSynchService
.
querySoureTableColumns
(
req
);
}
catch
(
Exception
e
)
{
jsonResult
.
setMessage
(
e
.
getMessage
());
jsonResult
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
e
.
printStackTrace
();
}
return
jsonResult
;
}
}
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/DmpRealtimeSyncInfoService.java
View file @
6cce39b2
...
@@ -135,4 +135,13 @@ public interface DmpRealtimeSyncInfoService {
...
@@ -135,4 +135,13 @@ public interface DmpRealtimeSyncInfoService {
* @author Bellamy
* @author Bellamy
*/
*/
boolean
deleteByrealTaskId
(
String
realTaskId
)
throws
Exception
;
boolean
deleteByrealTaskId
(
String
realTaskId
)
throws
Exception
;
/**
* 批量上下线
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
boolean
batchUptOnlineStatus
(
String
realTaskId
,
String
onlineStatus
)
throws
Exception
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpRealtimeSyncInfoServiceImpl.java
View file @
6cce39b2
...
@@ -838,4 +838,20 @@ public class DmpRealtimeSyncInfoServiceImpl implements DmpRealtimeSyncInfoServic
...
@@ -838,4 +838,20 @@ public class DmpRealtimeSyncInfoServiceImpl implements DmpRealtimeSyncInfoServic
map
.
put
(
"dataStatus"
,
DelFlagEnum
.
YES
.
getValue
());
map
.
put
(
"dataStatus"
,
DelFlagEnum
.
YES
.
getValue
());
return
dmpRealtimeSyncInfoDao
.
deleteByrealTaskId
(
map
)
>
0
;
return
dmpRealtimeSyncInfoDao
.
deleteByrealTaskId
(
map
)
>
0
;
}
}
/**
* 批量上下线
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
@Override
public
boolean
batchUptOnlineStatus
(
String
realTaskId
,
String
onlineStatus
)
throws
Exception
{
Map
map
=
new
HashMap
();
String
[]
ids
=
realTaskId
.
split
(
","
);
map
.
put
(
"ids"
,
ids
);
map
.
put
(
"onlineStatus"
,
onlineStatus
);
return
dmpRealtimeSyncInfoDao
.
deleteByrealTaskId
(
map
)
>
0
;
}
}
}
\ No newline at end of file
src/main/resources/mapper/dmp/DmpRealtimeSyncInfoMapper.xml
View file @
6cce39b2
...
@@ -321,7 +321,8 @@
...
@@ -321,7 +321,8 @@
t1.src_database_type as srcDatabaseType,
t1.src_database_type as srcDatabaseType,
t1.target_datasource_id as targetDatasourceId,
t1.target_datasource_id as targetDatasourceId,
t1.target_datasource_name as targetDatasourceName,
t1.target_datasource_name as targetDatasourceName,
t1.target_database_type as targetDatabaseType
t1.target_database_type as targetDatabaseType,
t1.online_status as onlineStatus
FROM dmp_realtime_sync_info t1
FROM dmp_realtime_sync_info t1
inner join dmp_navigation_tree t2 on t1.tree_id=t2.id
inner join dmp_navigation_tree t2 on t1.tree_id=t2.id
left join dmp_syncing_datasource t3 ON t1.src_datasource_id = t3.ID
left join dmp_syncing_datasource t3 ON t1.src_datasource_id = t3.ID
...
@@ -516,13 +517,16 @@
...
@@ -516,13 +517,16 @@
1 = 1 and t1.data_status='1' and id = #{taskId}
1 = 1 and t1.data_status='1' and id = #{taskId}
</select>
</select>
<!--批量删除-->
<!--批量删除
或 批量上下线
-->
<update
id=
"deleteByrealTaskId"
parameterType=
"java.util.Map"
>
<update
id=
"deleteByrealTaskId"
parameterType=
"java.util.Map"
>
update dmp_realtime_sync_info
update dmp_realtime_sync_info
<trim
prefix=
"SET"
suffixOverrides=
","
>
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"dataStatus != null"
>
<if
test=
"dataStatus != null"
>
data_status = #{dataStatus},
data_status = #{dataStatus},
</if>
</if>
<if
test=
"onlineStatus != null and onlineStatus != ''"
>
online_status = #{onlineStatus},
</if>
</trim>
</trim>
where id in
where id in
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"ids"
item=
"item"
open=
"("
separator=
","
close=
")"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment