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
dcdc961e
Commit
dcdc961e
authored
Jan 29, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
01893647
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
OfflineSynchController.java
...es/controller/DataIntegration/OfflineSynchController.java
+7
-6
OfflineSynchService.java
.../java/com/jz/dmp/modules/service/OfflineSynchService.java
+2
-2
OfflineSynchServiceImpl.java
.../jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
+8
-4
No files found.
src/main/java/com/jz/dmp/modules/controller/DataIntegration/OfflineSynchController.java
View file @
dcdc961e
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @Description:离线同步
* @Description:离线同步
...
@@ -66,11 +67,11 @@ public class OfflineSynchController {
...
@@ -66,11 +67,11 @@ public class OfflineSynchController {
@ApiOperation
(
value
=
"获取源数据库名称-下拉框"
,
notes
=
"获取源数据库名称"
)
@ApiOperation
(
value
=
"获取源数据库名称-下拉框"
,
notes
=
"获取源数据库名称"
)
@GetMapping
(
value
=
"/sourceDbList"
)
@GetMapping
(
value
=
"/sourceDbList"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目id"
,
required
=
true
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目id"
,
required
=
true
)
,
@ApiImplicitParam
(
name
=
"datasourceTypeId"
,
value
=
"数据源类型id"
)
,
@ApiImplicitParam
(
name
=
"datasourceTypeId"
,
value
=
"数据源类型id"
)
,
@ApiImplicitParam
(
name
=
"type"
,
value
=
"01:来源,02目标"
)
,
@ApiImplicitParam
(
name
=
"type"
,
value
=
"01:来源,02目标"
)
})
})
public
JsonResult
<
List
<
SourceDbNameListDto
>>
getSourceDbList
(
@RequestParam
Integer
projectId
,
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
String
datasourceTypeId
)
throws
Exception
{
public
JsonResult
<
List
<
SourceDbNameListDto
>>
getSourceDbList
(
@RequestParam
Integer
projectId
,
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
String
datasourceTypeId
)
throws
Exception
{
JsonResult
<
List
<
SourceDbNameListDto
>>
jsonResult
=
offlineSynchService
.
querygSourceDbList
(
projectId
,
datasourceTypeId
);
JsonResult
<
List
<
SourceDbNameListDto
>>
jsonResult
=
offlineSynchService
.
querygSourceDbList
(
projectId
,
datasourceTypeId
);
return
jsonResult
;
return
jsonResult
;
}
}
...
@@ -78,8 +79,8 @@ public class OfflineSynchController {
...
@@ -78,8 +79,8 @@ public class OfflineSynchController {
* 获取数据源——下拉框
* 获取数据源——下拉框
*
*
* @return
* @return
* @since 2021-01-21
* @author Bellamy
* @author Bellamy
* @since 2021-01-21
*/
*/
@ApiOperation
(
value
=
"获取数据源—下拉框"
,
notes
=
"获取数据源—下拉框"
)
@ApiOperation
(
value
=
"获取数据源—下拉框"
,
notes
=
"获取数据源—下拉框"
)
@GetMapping
(
value
=
"/datasourceList"
)
@GetMapping
(
value
=
"/datasourceList"
)
...
@@ -202,7 +203,7 @@ public class OfflineSynchController {
...
@@ -202,7 +203,7 @@ public class OfflineSynchController {
*/
*/
@ApiOperation
(
value
=
"获取数据源表字段"
,
notes
=
"获取数据源表字段"
)
@ApiOperation
(
value
=
"获取数据源表字段"
,
notes
=
"获取数据源表字段"
)
@PostMapping
(
value
=
"/getSoureAndTargetColumns"
)
@PostMapping
(
value
=
"/getSoureAndTargetColumns"
)
public
JsonResult
getSoureAndTargetColumns
(
@RequestBody
@Validated
List
<
SynchTableColumnsReq
>
req
)
throws
Exception
{
public
JsonResult
getSoureAndTargetColumns
(
@RequestBody
@Validated
Map
<
String
,
List
<
SynchTableColumnsReq
>
>
req
)
throws
Exception
{
JsonResult
jsonResult
=
new
JsonResult
();
JsonResult
jsonResult
=
new
JsonResult
();
try
{
try
{
jsonResult
=
offlineSynchService
.
querySoureTableColumns
(
req
);
jsonResult
=
offlineSynchService
.
querySoureTableColumns
(
req
);
...
...
src/main/java/com/jz/dmp/modules/service/OfflineSynchService.java
View file @
dcdc961e
...
@@ -32,7 +32,7 @@ public interface OfflineSynchService {
...
@@ -32,7 +32,7 @@ public interface OfflineSynchService {
* @return
* @return
* @author Bellamy
* @author Bellamy
*/
*/
JsonResult
querygSourceDbList
(
Integer
projectId
,
String
databaseTypeName
)
throws
Exception
;
JsonResult
querygSourceDbList
(
Integer
projectId
,
String
databaseTypeName
)
throws
Exception
;
/**
/**
* 根据源数据库id,获取源数据表——下拉框
* 根据源数据库id,获取源数据表——下拉框
...
@@ -101,7 +101,7 @@ public interface OfflineSynchService {
...
@@ -101,7 +101,7 @@ public interface OfflineSynchService {
* @author Bellamy
* @author Bellamy
* @since 2021-01-21
* @since 2021-01-21
*/
*/
JsonResult
querySoureTableColumns
(
List
<
SynchTableColumnsReq
>
req
)
throws
Exception
;
JsonResult
querySoureTableColumns
(
Map
<
String
,
List
<
SynchTableColumnsReq
>
>
req
)
throws
Exception
;
/**
/**
* 任务停止运行
* 任务停止运行
...
...
src/main/java/com/jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
View file @
dcdc961e
...
@@ -28,6 +28,7 @@ import org.apache.commons.collections.CollectionUtils;
...
@@ -28,6 +28,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -639,11 +640,12 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -639,11 +640,12 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
task
.
setTargetTableName
(
targetTable
);
task
.
setTargetTableName
(
targetTable
);
task
.
setSourceTableName
(
sourceTableName
);
task
.
setSourceTableName
(
sourceTableName
);
task
.
setSourceDbName
(
sourceDbName
);
task
.
setSourceDbName
(
sourceDbName
);
task
.
setCreateUserId
(
SessionUtils
.
getCurrentUserId
());
task
.
setCreateTime
(
new
Date
());
dmpDevelopTaskDao
.
insert
(
task
);
//保存任务数据
dmpDevelopTaskDao
.
insert
(
task
);
//保存任务数据
logger
.
info
(
"################################## 新增任务数据结束 ############################################"
);
logger
.
info
(
"################################## 新增任务数据结束 ############################################"
);
//保存时提交XML
//保存时提交XML
dmpDevelopTaskService
.
submitSyncing
(
task
);
dmpDevelopTaskService
.
submitSyncing
(
task
);
return
new
JsonResult
(
ResultCode
.
SUCCESS
,
task
);
return
new
JsonResult
(
ResultCode
.
SUCCESS
,
task
);
}
}
...
@@ -702,15 +704,17 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -702,15 +704,17 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
* @since 2021-01-21
* @since 2021-01-21
*/
*/
@Override
@Override
public
JsonResult
querySoureTableColumns
(
List
<
SynchTableColumnsReq
>
req
)
throws
Exception
{
public
JsonResult
querySoureTableColumns
(
Map
<
String
,
List
<
SynchTableColumnsReq
>
>
req
)
throws
Exception
{
List
<
Map
>
returnData
=
new
ArrayList
<>();
List
<
Map
>
returnData
=
new
ArrayList
<>();
int
len
=
0
;
int
len
=
0
;
if
(
req
.
size
()
==
0
||
req
==
null
)
{
if
(
req
.
size
()
==
0
||
req
==
null
)
{
throw
new
RuntimeException
(
"请求参数不能为空!"
);
throw
new
RuntimeException
(
"请求参数不能为空!"
);
}
}
for
(
SynchTableColumnsReq
str
:
req
)
{
for
(
SynchTableColumnsReq
str
:
req
.
get
(
"params"
)
)
{
//通过源数据库id ,查询数据源配置
//通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo
dsInfo
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfos
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfo
=
new
DmpAgentDatasourceInfo
();
BeanUtils
.
copyProperties
(
dsInfos
,
dsInfo
);
if
(
dsInfo
==
null
)
{
if
(
dsInfo
==
null
)
{
throw
new
RuntimeException
(
"数据源配置信息不存在!"
);
throw
new
RuntimeException
(
"数据源配置信息不存在!"
);
}
}
...
...
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