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
688f3c6a
Commit
688f3c6a
authored
Mar 03, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据服务代码修改
parent
35a165e6
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
107 additions
and
127 deletions
+107
-127
GatewayApiConstant.java
src/main/java/com/jz/common/constant/GatewayApiConstant.java
+5
-6
SynchTableColumnsReq.java
...controller/DataIntegration/bean/SynchTableColumnsReq.java
+10
-0
DmpApiMangeController.java
...modules/controller/dataService/DmpApiMangeController.java
+21
-0
DmpApiMangeService.java
...n/java/com/jz/dmp/modules/service/DmpApiMangeService.java
+8
-0
DmpApiMangeServiceImpl.java
...m/jz/dmp/modules/service/impl/DmpApiMangeServiceImpl.java
+16
-0
DmpApiServiceMangeServiceImpl.java
...p/modules/service/impl/DmpApiServiceMangeServiceImpl.java
+1
-17
DmpOrgMangeServiceImpl.java
...m/jz/dmp/modules/service/impl/DmpOrgMangeServiceImpl.java
+6
-84
DmpRealtimeSyncInfoServiceImpl.java
.../modules/service/impl/DmpRealtimeSyncInfoServiceImpl.java
+1
-0
OfflineSynchServiceImpl.java
.../jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
+31
-5
lxTaskJson.json
src/main/resources/templates/lxTaskJson.json
+8
-15
No files found.
src/main/java/com/jz/common/constant/GatewayApiConstant.java
View file @
688f3c6a
...
@@ -74,13 +74,12 @@ public class GatewayApiConstant {
...
@@ -74,13 +74,12 @@ public class GatewayApiConstant {
public
static
final
String
listServerApplyApi
=
"/api/interface/listServerApplyApi"
;
public
static
final
String
listServerApplyApi
=
"/api/interface/listServerApplyApi"
;
//获取文件夹树
//获取文件夹树
public
static
final
String
folderTree
=
"/api/producer/getFileCatalog"
;
public
static
final
String
folderTree
=
"/api/producer/getFileCatalog"
;
//服务开发---获取ApiId
//服务开发---获取ApiId
public
static
final
String
getApiId
=
"/api/producer/getCustomApiId"
;
public
static
final
String
getApiId
=
"/api/producer/getCustomApiId"
;
//创建项目文件夹
//创建项目文件夹
public
static
final
String
createProjectFolder
=
"/api/producer/createProjectFolder"
;
public
static
final
String
createProjectFolder
=
"/api/producer/createProjectFolder"
;
//授权--组织名称查询
public
static
final
String
getOrgNameList
=
"/api/auth/get-org-list"
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
GatewayApiConstant
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
GatewayApiConstant
.
class
);
...
@@ -93,7 +92,7 @@ public class GatewayApiConstant {
...
@@ -93,7 +92,7 @@ public class GatewayApiConstant {
if
(
StringUtils
.
isEmpty
(
resultData
))
{
if
(
StringUtils
.
isEmpty
(
resultData
))
{
throw
new
RuntimeException
(
"failed!"
);
throw
new
RuntimeException
(
"failed!"
);
}
}
logger
.
info
(
"##############
###响应结果数据
{}"
+
resultData
);
logger
.
info
(
"##############
response results
{}"
+
resultData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
resultData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
resultData
);
if
(
jsonObject
.
containsKey
(
"code"
))
{
if
(
jsonObject
.
containsKey
(
"code"
))
{
...
@@ -121,7 +120,7 @@ public class GatewayApiConstant {
...
@@ -121,7 +120,7 @@ public class GatewayApiConstant {
if
(
StringUtils
.
isEmpty
(
returnData
))
{
if
(
StringUtils
.
isEmpty
(
returnData
))
{
throw
new
RuntimeException
(
"failed!"
);
throw
new
RuntimeException
(
"failed!"
);
}
}
logger
.
info
(
"##############
###响应结果
{}"
+
returnData
);
logger
.
info
(
"##############
response results
{}"
+
returnData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
returnData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
returnData
);
if
(
jsonObject
.
containsKey
(
"code"
))
{
if
(
jsonObject
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
jsonObject
.
get
(
"code"
).
toString
()))
{
if
(
"200"
.
equals
(
jsonObject
.
get
(
"code"
).
toString
()))
{
...
@@ -149,7 +148,7 @@ public class GatewayApiConstant {
...
@@ -149,7 +148,7 @@ public class GatewayApiConstant {
if
(
StringUtils
.
isEmpty
(
returnData
))
{
if
(
StringUtils
.
isEmpty
(
returnData
))
{
throw
new
RuntimeException
(
"failed!"
);
throw
new
RuntimeException
(
"failed!"
);
}
}
logger
.
info
(
"##############
###响应结果
{}"
+
returnData
);
logger
.
info
(
"##############
response results
{}"
+
returnData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
returnData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
returnData
);
if
(
jsonObject
.
containsKey
(
"code"
))
{
if
(
jsonObject
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
jsonObject
.
get
(
"code"
).
toString
()))
{
if
(
"200"
.
equals
(
jsonObject
.
get
(
"code"
).
toString
()))
{
...
...
src/main/java/com/jz/dmp/modules/controller/DataIntegration/bean/SynchTableColumnsReq.java
View file @
688f3c6a
...
@@ -28,6 +28,9 @@ public class SynchTableColumnsReq implements Serializable {
...
@@ -28,6 +28,9 @@ public class SynchTableColumnsReq implements Serializable {
@ApiModelProperty
(
value
=
"目标表名称"
)
@ApiModelProperty
(
value
=
"目标表名称"
)
private
String
targetTableName
;
private
String
targetTableName
;
@ApiModelProperty
(
value
=
"字段名称"
)
private
String
fieldName
;
public
Long
getSourceDbId
()
{
public
Long
getSourceDbId
()
{
return
sourceDbId
;
return
sourceDbId
;
}
}
...
@@ -44,4 +47,11 @@ public class SynchTableColumnsReq implements Serializable {
...
@@ -44,4 +47,11 @@ public class SynchTableColumnsReq implements Serializable {
this
.
sourceDbId
=
sourceDbId
;
this
.
sourceDbId
=
sourceDbId
;
}
}
public
String
getFieldName
()
{
return
fieldName
;
}
public
void
setFieldName
(
String
fieldName
)
{
this
.
fieldName
=
fieldName
;
}
}
}
src/main/java/com/jz/dmp/modules/controller/dataService/DmpApiMangeController.java
View file @
688f3c6a
...
@@ -370,4 +370,25 @@ public class DmpApiMangeController {
...
@@ -370,4 +370,25 @@ public class DmpApiMangeController {
return
jsonResult
;
return
jsonResult
;
}
}
/**
* 授权--组织名称查询
*
* @author Bellamy
* @since 2021-03-02
*/
@ApiOperation
(
value
=
"授权--组织名称查询"
,
notes
=
"授权--组织名称查询"
)
@GetMapping
(
value
=
"/getAuthOrgName"
)
@ApiImplicitParam
(
name
=
"orgName"
,
value
=
"组织名称"
,
required
=
true
)
public
JsonResult
getAuthOrgName
(
@RequestParam
String
orgName
)
{
JsonResult
jsonResult
=
new
JsonResult
();
try
{
jsonResult
=
dmpApiMangeService
.
getAuthOrgName
(
orgName
);
}
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/DmpApiMangeService.java
View file @
688f3c6a
...
@@ -132,4 +132,12 @@ public interface DmpApiMangeService {
...
@@ -132,4 +132,12 @@ public interface DmpApiMangeService {
* @since 2021-02-20
* @since 2021-02-20
*/
*/
JsonResult
logDetails
(
String
id
)
throws
Exception
;
JsonResult
logDetails
(
String
id
)
throws
Exception
;
/**
* 授权--组织名称查询
*
* @author Bellamy
* @since 2021-03-02
*/
JsonResult
getAuthOrgName
(
String
orgName
)
throws
Exception
;
}
}
src/main/java/com/jz/dmp/modules/service/impl/DmpApiMangeServiceImpl.java
View file @
688f3c6a
...
@@ -425,4 +425,20 @@ public class DmpApiMangeServiceImpl implements DmpApiMangeService {
...
@@ -425,4 +425,20 @@ public class DmpApiMangeServiceImpl implements DmpApiMangeService {
return
result
;
return
result
;
}
}
/**
* 授权--组织名称查询
*
* @param orgName
* @author Bellamy
* @since 2021-03-02
*/
@Override
public
JsonResult
getAuthOrgName
(
String
orgName
)
throws
Exception
{
String
url
=
gatewayUrl
+
GatewayApiConstant
.
getOrgNameList
;
Map
params
=
new
HashMap
();
params
.
put
(
"orgName"
,
orgName
);
JsonResult
result
=
GatewayApiConstant
.
getRequest2GetData
(
url
,
params
);
return
result
;
}
}
}
src/main/java/com/jz/dmp/modules/service/impl/DmpApiServiceMangeServiceImpl.java
View file @
688f3c6a
...
@@ -270,7 +270,6 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
...
@@ -270,7 +270,6 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
*/
*/
@Override
@Override
public
JsonResult
getFolderTree
(
String
projectId
,
String
orgCode
)
throws
Exception
{
public
JsonResult
getFolderTree
(
String
projectId
,
String
orgCode
)
throws
Exception
{
JsonResult
result
=
new
JsonResult
();
String
url
=
gatewayUrl
+
GatewayApiConstant
.
folderTree
;
String
url
=
gatewayUrl
+
GatewayApiConstant
.
folderTree
;
Map
params
=
new
HashMap
();
Map
params
=
new
HashMap
();
...
@@ -278,22 +277,7 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
...
@@ -278,22 +277,7 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
params
.
put
(
"projectId"
,
projectId
);
params
.
put
(
"projectId"
,
projectId
);
}
}
params
.
put
(
"orgCode"
,
orgCode
);
params
.
put
(
"orgCode"
,
orgCode
);
String
returnData
=
HttpClientUtils
.
getJsonForParam
(
url
,
params
);
JsonResult
result
=
GatewayApiConstant
.
getRequest2GetData
(
url
,
params
);
if
(
StringUtils
.
isEmpty
(
returnData
))
{
throw
new
RuntimeException
(
"查询失败!"
);
}
logger
.
info
(
"#################响应结果{}"
+
returnData
);
Map
map
=
JSONObject
.
parseObject
(
returnData
);
if
(
map
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
map
.
get
(
"code"
).
toString
()))
{
return
JsonResult
.
ok
(
map
.
get
(
"data"
));
}
}
if
(
map
.
containsKey
(
"msg"
))
{
logger
.
info
(
map
.
get
(
"msg"
).
toString
());
result
.
setMessage
(
map
.
get
(
"msg"
).
toString
());
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
}
return
result
;
return
result
;
}
}
...
...
src/main/java/com/jz/dmp/modules/service/impl/DmpOrgMangeServiceImpl.java
View file @
688f3c6a
...
@@ -41,29 +41,12 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
...
@@ -41,29 +41,12 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
*/
*/
@Override
@Override
public
JsonResult
queryOrgListPage
(
OrganizationManageListQueryReq
req
)
throws
Exception
{
public
JsonResult
queryOrgListPage
(
OrganizationManageListQueryReq
req
)
throws
Exception
{
JsonResult
result
=
new
JsonResult
();
String
url
=
gatewayUrl
+
GatewayApiConstant
.
orgListPage
;
String
url
=
gatewayUrl
+
GatewayApiConstant
.
orgListPage
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getOrgName
()))
{
if
(
StringUtils
.
isNotEmpty
(
req
.
getOrgName
()))
{
req
.
setOrgName
(
req
.
getOrgName
().
trim
());
req
.
setOrgName
(
req
.
getOrgName
().
trim
());
}
}
String
resultData
=
HttpClientUtils
.
post
(
url
,
JSONObject
.
toJSONString
(
req
));
JsonResult
result
=
GatewayApiConstant
.
postRequest2GetData
(
url
,
JSONObject
.
toJSONString
(
req
));
if
(
StringUtils
.
isEmpty
(
resultData
))
{
throw
new
RuntimeException
(
"查询失败!"
);
}
logger
.
info
(
"#################组织管理列数据{}"
+
resultData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
resultData
);
if
(
jsonObject
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
jsonObject
.
get
(
"code"
).
toString
()))
{
return
JsonResult
.
ok
(
jsonObject
.
get
(
"data"
));
}
}
if
(
jsonObject
.
containsKey
(
"msg"
))
{
logger
.
info
(
jsonObject
.
get
(
"msg"
).
toString
());
result
.
setMessage
(
jsonObject
.
get
(
"msg"
).
toString
());
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
}
return
result
;
return
result
;
}
}
...
@@ -79,18 +62,8 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
...
@@ -79,18 +62,8 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
Map
params
=
new
HashMap
();
Map
params
=
new
HashMap
();
params
.
put
(
"id"
,
id
);
params
.
put
(
"id"
,
id
);
String
url
=
gatewayUrl
+
GatewayApiConstant
.
delOrg
;
String
url
=
gatewayUrl
+
GatewayApiConstant
.
delOrg
;
String
returnData
=
HttpClientUtils
.
getJsonForParam
(
url
,
params
);
JsonResult
result
=
GatewayApiConstant
.
getRequest2GetData
(
url
,
params
);
if
(
StringUtils
.
isEmpty
(
returnData
))
{
return
result
;
throw
new
RuntimeException
(
"删除失败!"
);
}
logger
.
info
(
"#################响应结果{}"
+
returnData
);
Map
map
=
JSONObject
.
parseObject
(
returnData
);
if
(
map
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
map
.
get
(
"code"
).
toString
()))
{
return
JsonResult
.
ok
();
}
}
return
JsonResult
.
error
(
"删除失败!"
);
}
}
/**
/**
...
@@ -102,26 +75,9 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
...
@@ -102,26 +75,9 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
*/
*/
@Override
@Override
public
JsonResult
addOrg
(
OrganizationManageAddReq
req
)
throws
Exception
{
public
JsonResult
addOrg
(
OrganizationManageAddReq
req
)
throws
Exception
{
JsonResult
result
=
new
JsonResult
();
String
url
=
gatewayUrl
+
GatewayApiConstant
.
addOrg
;
String
url
=
gatewayUrl
+
GatewayApiConstant
.
addOrg
;
req
.
setCreateUser
(
SessionUtils
.
getCurrentUserName
());
req
.
setCreateUser
(
SessionUtils
.
getCurrentUserName
());
String
returnData
=
HttpClientUtils
.
post
(
url
,
JSONObject
.
toJSONString
(
req
));
JsonResult
result
=
GatewayApiConstant
.
postRequest2GetData
(
url
,
JSONObject
.
toJSONString
(
req
));
if
(
StringUtils
.
isEmpty
(
returnData
))
{
throw
new
RuntimeException
(
"新增失败!"
);
}
logger
.
info
(
"#################响应结果{}"
+
returnData
);
Map
map
=
JSONObject
.
parseObject
(
returnData
);
if
(
map
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
map
.
get
(
"code"
).
toString
()))
{
return
JsonResult
.
ok
();
}
}
if
(
map
.
containsKey
(
"msg"
))
{
logger
.
info
(
map
.
get
(
"msg"
).
toString
());
result
.
setMessage
(
map
.
get
(
"msg"
).
toString
());
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
}
return
result
;
return
result
;
}
}
...
@@ -134,27 +90,10 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
...
@@ -134,27 +90,10 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
*/
*/
@Override
@Override
public
JsonResult
updateOrg
(
OrganizationManageUpdateReq
req
)
throws
Exception
{
public
JsonResult
updateOrg
(
OrganizationManageUpdateReq
req
)
throws
Exception
{
JsonResult
result
=
new
JsonResult
();
String
url
=
gatewayUrl
+
GatewayApiConstant
.
addOrg
;
String
url
=
gatewayUrl
+
GatewayApiConstant
.
addOrg
;
req
.
setCreateUser
(
SessionUtils
.
getCurrentUserName
());
req
.
setCreateUser
(
SessionUtils
.
getCurrentUserName
());
String
returnData
=
HttpClientUtils
.
post
(
url
,
JSONObject
.
toJSONString
(
req
));
JsonResult
result
=
GatewayApiConstant
.
postRequest2GetData
(
url
,
JSONObject
.
toJSONString
(
req
));
if
(
StringUtils
.
isEmpty
(
returnData
))
{
throw
new
RuntimeException
(
"编辑失败!"
);
}
logger
.
info
(
"#################响应结果{}"
+
returnData
);
Map
map
=
JSONObject
.
parseObject
(
returnData
);
if
(
map
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
map
.
get
(
"code"
).
toString
()))
{
return
JsonResult
.
ok
();
}
}
if
(
map
.
containsKey
(
"msg"
))
{
logger
.
info
(
map
.
get
(
"msg"
).
toString
());
result
.
setMessage
(
map
.
get
(
"msg"
).
toString
());
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
}
return
result
;
return
result
;
}
}
...
@@ -166,27 +105,10 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
...
@@ -166,27 +105,10 @@ public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
*/
*/
@Override
@Override
public
JsonResult
getOrgInfoByOrgId
(
String
id
)
throws
Exception
{
public
JsonResult
getOrgInfoByOrgId
(
String
id
)
throws
Exception
{
JsonResult
result
=
new
JsonResult
();
String
url
=
gatewayUrl
+
GatewayApiConstant
.
orgDetail
;
String
url
=
gatewayUrl
+
GatewayApiConstant
.
orgDetail
;
OrganizationManageDetailQueryReq
req
=
new
OrganizationManageDetailQueryReq
();
OrganizationManageDetailQueryReq
req
=
new
OrganizationManageDetailQueryReq
();
req
.
setId
(
Long
.
valueOf
(
id
));
req
.
setId
(
Long
.
valueOf
(
id
));
String
returnData
=
HttpClientUtils
.
post
(
url
,
JSONObject
.
toJSONString
(
req
));
JsonResult
result
=
GatewayApiConstant
.
postRequest2GetData
(
url
,
JSONObject
.
toJSONString
(
req
));
if
(
StringUtils
.
isEmpty
(
returnData
))
{
throw
new
RuntimeException
(
"查询失败!"
);
}
logger
.
info
(
"#################响应结果{}"
+
returnData
);
Map
map
=
JSONObject
.
parseObject
(
returnData
);
if
(
map
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
map
.
get
(
"code"
).
toString
()))
{
return
JsonResult
.
ok
(
map
.
get
(
"data"
));
}
}
if
(
map
.
containsKey
(
"msg"
))
{
logger
.
info
(
map
.
get
(
"msg"
).
toString
());
result
.
setMessage
(
map
.
get
(
"msg"
).
toString
());
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
}
return
result
;
return
result
;
}
}
}
}
src/main/java/com/jz/dmp/modules/service/impl/DmpRealtimeSyncInfoServiceImpl.java
View file @
688f3c6a
...
@@ -1002,6 +1002,7 @@ public class DmpRealtimeSyncInfoServiceImpl implements DmpRealtimeSyncInfoServic
...
@@ -1002,6 +1002,7 @@ public class DmpRealtimeSyncInfoServiceImpl implements DmpRealtimeSyncInfoServic
OKHttpUtil
.
httpPut
(
url
,
""
);
OKHttpUtil
.
httpPut
(
url
,
""
);
//获取任务状态
//获取任务状态
String
status
=
getExecuteShellStatus
(
statusUrl
+
"/status"
,
new
HashMap
<>());
String
status
=
getExecuteShellStatus
(
statusUrl
+
"/status"
,
new
HashMap
<>());
logger
.
info
(
"response status{}"
+
status
);
//执行后任务状态 :PAUSED 暂停 , RUNNING 运行中
//执行后任务状态 :PAUSED 暂停 , RUNNING 运行中
saveBaby
.
setStatus
(
status
);
saveBaby
.
setStatus
(
status
);
saveBaby
.
setUptPerson
(
SessionUtils
.
getCurrentUserId
());
saveBaby
.
setUptPerson
(
SessionUtils
.
getCurrentUserId
());
...
...
src/main/java/com/jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
View file @
688f3c6a
...
@@ -553,7 +553,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -553,7 +553,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
task
.
setId
(
taskId
);
task
.
setId
(
taskId
);
dmpDevelopTaskDao
.
update
(
task
);
//更新任务
dmpDevelopTaskDao
.
update
(
task
);
//更新任务
logger
.
info
(
"
################################## 更新任务数据结束 ############################################
"
);
logger
.
info
(
"
======== edit sync task end ========
"
);
//更新规则信息
//更新规则信息
List
<
DvTaskRuleT
>
list
=
new
ArrayList
<>();
List
<
DvTaskRuleT
>
list
=
new
ArrayList
<>();
...
@@ -649,7 +649,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -649,7 +649,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
task
.
setCreateTime
(
new
Date
());
task
.
setCreateTime
(
new
Date
());
dmpDevelopTaskDao
.
insert
(
task
);
//新增任务数据
dmpDevelopTaskDao
.
insert
(
task
);
//新增任务数据
this
.
saveTaskHistory
(
task
);
//保存任务历史版本
this
.
saveTaskHistory
(
task
);
//保存任务历史版本
logger
.
info
(
"
################################## 新增离线任务数据结束 ############################################
"
);
logger
.
info
(
"
======== save sync task end ========
"
);
//保存dmp数据校验规则信息
//保存dmp数据校验规则信息
settRuleInfo
(
taskId
,
taskRules
,
list
);
settRuleInfo
(
taskId
,
taskRules
,
list
);
}
else
{
}
else
{
...
@@ -661,8 +661,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -661,8 +661,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
task
.
setUpdateUserId
(
SessionUtils
.
getCurrentUserId
());
task
.
setUpdateUserId
(
SessionUtils
.
getCurrentUserId
());
task
.
setId
(
Integer
.
valueOf
(
taskId
));
task
.
setId
(
Integer
.
valueOf
(
taskId
));
dmpDevelopTaskDao
.
update
(
task
);
dmpDevelopTaskDao
.
update
(
task
);
logger
.
info
(
"======== edit sync task end ========"
);
this
.
saveTaskHistory
(
task
);
//保存任务历史版本
this
.
saveTaskHistory
(
task
);
//保存任务历史版本
logger
.
info
(
"################################## 编辑离线任务数据结束 ############################################"
);
//更新规则信息
//更新规则信息
//查询TaskRuleID 集合
//查询TaskRuleID 集合
List
<
Long
>
listRules
=
dvTaskRuleTService
.
getTaskRuleIdsList
(
Integer
.
valueOf
(
taskId
));
List
<
Long
>
listRules
=
dvTaskRuleTService
.
getTaskRuleIdsList
(
Integer
.
valueOf
(
taskId
));
...
@@ -702,7 +702,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -702,7 +702,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
taskHistory
.
setCreateUserId
(
Integer
.
valueOf
(
SessionUtils
.
getCurrentUserId
()));
taskHistory
.
setCreateUserId
(
Integer
.
valueOf
(
SessionUtils
.
getCurrentUserId
()));
taskHistory
.
setDataStatus
(
DelFlagEnum
.
NO
.
getValue
());
taskHistory
.
setDataStatus
(
DelFlagEnum
.
NO
.
getValue
());
dmpDevelopTaskHistoryMapper
.
insert
(
taskHistory
);
dmpDevelopTaskHistoryMapper
.
insert
(
taskHistory
);
logger
.
info
(
"
################################## 新增离线任务版本记录结束 ############################################
"
);
logger
.
info
(
"
======== save sync task history end ========
"
);
return
JsonResult
.
ok
();
return
JsonResult
.
ok
();
}
}
...
@@ -771,7 +771,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -771,7 +771,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
if
(
req
.
size
()
==
0
||
req
==
null
)
{
if
(
req
.
size
()
==
0
||
req
==
null
)
{
throw
new
RuntimeException
(
"请求参数不能为空!"
);
throw
new
RuntimeException
(
"请求参数不能为空!"
);
}
}
for
(
SynchTableColumnsReq
str
:
req
.
get
(
"params"
))
{
List
<
SynchTableColumnsReq
>
list
=
req
.
get
(
"params"
);
for
(
SynchTableColumnsReq
str
:
list
)
{
//通过源数据库id ,查询数据源配置
//通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo
dsInfos
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfos
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
str
.
getSourceDbId
());
DmpAgentDatasourceInfo
dsInfo
=
new
DmpAgentDatasourceInfo
();
DmpAgentDatasourceInfo
dsInfo
=
new
DmpAgentDatasourceInfo
();
...
@@ -806,9 +807,34 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -806,9 +807,34 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
}
}
}
}
}
}
if
(
StringUtils
.
isNotEmpty
(
list
.
get
(
0
).
getFieldName
()))
{
List
<
Map
>
searchFieldList
=
getFieldName
(
returnData
,
list
.
get
(
0
).
getFieldName
());
return
JsonResult
.
ok
(
searchFieldList
);
}
return
JsonResult
.
ok
(
returnData
);
return
JsonResult
.
ok
(
returnData
);
}
}
/**
* 根据参数搜索表字段
*
* @return
* @author Bellamy
* @since 2021-03-02
*/
public
List
<
Map
>
getFieldName
(
List
<
Map
>
list
,
String
fieldName
)
throws
Exception
{
List
<
Map
>
returnList
=
new
ArrayList
<>();
if
(
list
.
size
()
>
0
&&
null
!=
list
)
{
for
(
Map
str
:
list
)
{
String
name
=
(
String
)
str
.
get
(
"name"
);
if
(
name
.
contains
(
fieldName
))
{
returnList
.
add
(
str
);
}
}
}
return
returnList
;
}
/**
/**
* 任务停止运行
* 任务停止运行
*
*
...
...
src/main/resources/templates/lxTaskJson.json
View file @
688f3c6a
...
@@ -82,8 +82,6 @@
...
@@ -82,8 +82,6 @@
{
{
"params"
:
{
"params"
:
{
//
"version"
:
"1.0"
,
//版本
//
"version"
:
"1.0"
,
//版本
"treeId"
:
669
,
"treeId"
:
669
,
"projectId"
:
"31"
,
"projectId"
:
"31"
,
"taskId"
:
""
,
//任务id
"taskId"
:
""
,
//任务id
...
@@ -103,7 +101,6 @@
...
@@ -103,7 +101,6 @@
"driverMemory"
:
""
,
//分配任务内存
"driverMemory"
:
""
,
//分配任务内存
"executorCore"
:
"1"
,
//单executor的cpu数
"executorCore"
:
"1"
,
//单executor的cpu数
"driverCore"
:
"1"
//单executor的cpu数
"driverCore"
:
"1"
//单executor的cpu数
//
"fieldMapping"
:
""
//字段映射关系
},
},
"reader"
:
{
"reader"
:
{
"sourceDbId"
:
""
,
"sourceDbId"
:
""
,
...
@@ -130,19 +127,13 @@
...
@@ -130,19 +127,13 @@
"column"
:
[
"column"
:
[
{
{
"name"
:
"host"
,
"name"
:
"host"
,
"type"
:
"VARCHAR"
"type"
:
"VARCHAR"
,
"fieldAlias"
:
""
},
},
{
{
"name"
:
"port"
,
"name"
:
"port"
,
"type"
:
"VARCHAR"
"type"
:
"VARCHAR"
,
},
"fieldAlias"
:
""
{
"name"
:
"user_name"
,
"type"
:
"VARCHAR"
},
{
"name"
:
"pass_word"
,
"type"
:
"VARCHAR"
}
}
]
]
},
},
...
@@ -219,7 +210,9 @@
...
@@ -219,7 +210,9 @@
},
},
"mappingRelation"
:[
"mappingRelation"
:[
{
{
"sourceFieldId"
:
""
,
"sourceField"
:
""
,
"sourceField"
:
""
,
"targetFieldId"
:
""
,
"targetField"
:
""
"targetField"
:
""
}
}
]
]
...
...
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