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
e4d163f7
Commit
e4d163f7
authored
Mar 12, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
aaf004b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
59 deletions
+93
-59
OfflineSynchServiceImpl.java
.../jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
+93
-59
No files found.
src/main/java/com/jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
View file @
e4d163f7
...
@@ -786,6 +786,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -786,6 +786,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
}
}
List
<
SynchTableColumnsReq
>
list
=
req
.
get
(
"params"
);
List
<
SynchTableColumnsReq
>
list
=
req
.
get
(
"params"
);
for
(
SynchTableColumnsReq
str
:
list
)
{
for
(
SynchTableColumnsReq
str
:
list
)
{
if
(
null
!=
str
.
getSourceDbId
()
&&
null
!=
str
.
getTargetTableName
())
{
//通过源数据库id ,查询数据源配置
//通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo
dsInfos
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfos
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfo
=
new
DmpAgentDatasourceInfo
();
DmpAgentDatasourceInfo
dsInfo
=
new
DmpAgentDatasourceInfo
();
...
@@ -820,6 +821,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -820,6 +821,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
}
}
}
}
}
}
}
if
(
StringUtils
.
isNotEmpty
(
list
.
get
(
0
).
getFieldName
()))
{
if
(
StringUtils
.
isNotEmpty
(
list
.
get
(
0
).
getFieldName
()))
{
List
<
Map
>
searchFieldList
=
getFieldName
(
returnData
,
list
.
get
(
0
).
getFieldName
());
List
<
Map
>
searchFieldList
=
getFieldName
(
returnData
,
list
.
get
(
0
).
getFieldName
());
...
@@ -1051,6 +1053,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -1051,6 +1053,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
int
num
=
0
;
int
num
=
0
;
for
(
SynchTableColumnsReq
str
:
list
)
{
for
(
SynchTableColumnsReq
str
:
list
)
{
num
++;
num
++;
if
(
null
!=
str
.
getSourceDbId
()
&&
null
!=
str
.
getTargetTableName
())
{
//通过源数据库id ,查询数据源配置
//通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo
dsInfos
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfos
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfo
=
new
DmpAgentDatasourceInfo
();
DmpAgentDatasourceInfo
dsInfo
=
new
DmpAgentDatasourceInfo
();
...
@@ -1086,6 +1089,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -1086,6 +1089,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
}
}
}
}
}
}
}
Map
data
=
new
HashMap
();
Map
data
=
new
HashMap
();
data
.
put
(
"allTable"
,
returnData
);
data
.
put
(
"allTable"
,
returnData
);
data
.
put
(
"firstTable"
,
syncData
);
data
.
put
(
"firstTable"
,
syncData
);
...
@@ -1100,9 +1104,39 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -1100,9 +1104,39 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
*/
*/
@Override
@Override
public
JsonResult
querySyncTaskInfoById
(
String
id
)
throws
Exception
{
public
JsonResult
querySyncTaskInfoById
(
String
id
)
throws
Exception
{
Map
returnMap
=
new
HashMap
();
DmpDevelopTask
dmpDevelopTask
=
dmpDevelopTaskDao
.
selectTaskById
(
id
);
DmpDevelopTask
dmpDevelopTask
=
dmpDevelopTaskDao
.
selectTaskById
(
id
);
if
(
StringUtils
.
isNotEmpty
(
dmpDevelopTask
.
getScript
()))
{
return
JsonResult
.
ok
(
dmpDevelopTask
);
Map
map
=
(
Map
)
JSONObject
.
parse
(
dmpDevelopTask
.
getScript
());
Map
scripts
=
(
Map
)
map
.
get
(
"scripts"
);
Integer
projectId
=
Integer
.
valueOf
((
String
)
map
.
get
(
"projectId"
));
Map
reader
=
(
Map
)
scripts
.
get
(
"reader"
);
Map
writer
=
(
Map
)
scripts
.
get
(
"writer"
);
String
sourceDbType
=
String
.
valueOf
(
reader
.
get
(
"sourceDbType"
));
String
sourceDbId
=
String
.
valueOf
(
reader
.
get
(
"sourceDbId"
));
String
[]
sourceDbName
=
String
.
valueOf
(
reader
.
get
(
"dbConnection"
)).
split
(
","
);
String
targetDbType
=
String
.
valueOf
(
writer
.
get
(
"targetDbType"
));
String
targetDbId
=
String
.
valueOf
(
writer
.
get
(
"targetDbId"
));
String
targetName
=
String
.
valueOf
(
writer
.
get
(
"targetDbConnection"
));
//数据源
JsonResult
sourceDb
=
querygSourceDbList
(
projectId
,
sourceDbType
);
returnMap
.
put
(
"sourceDb"
,
sourceDb
.
getData
());
JsonResult
targetDb
=
querygSourceDbList
(
projectId
,
targetDbType
);
returnMap
.
put
(
"targetDb"
,
targetDb
.
getData
());
//表
String
[]
sourceDbIds
=
sourceDbId
.
split
(
","
);
for
(
int
i
=
0
;
i
<
sourceDbIds
.
length
;
i
++)
{
JsonResult
sourceTable
=
querygSourceTableList
(
Long
.
valueOf
(
sourceDbIds
[
i
]),
""
);
returnMap
.
put
(
sourceDbName
[
i
],
sourceTable
.
getData
());
}
JsonResult
targetTable
=
querygSourceTableList
(
Long
.
valueOf
(
targetDbId
),
""
);
returnMap
.
put
(
targetName
,
targetTable
.
getData
());
}
returnMap
.
put
(
"task"
,
dmpDevelopTask
);
return
JsonResult
.
ok
(
returnMap
);
}
}
}
}
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