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
da644070
Commit
da644070
authored
Jan 13, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
2e1988ce
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
115 additions
and
34 deletions
+115
-34
DmpDevExamplesController.java
...es/controller/dataOperation/DmpDevExamplesController.java
+60
-0
DmpDevTaskController.java
...odules/controller/dataOperation/DmpDevTaskController.java
+20
-4
DmpDevelopTaskService.java
...ava/com/jz/dmp/modules/service/DmpDevelopTaskService.java
+8
-0
DmpDevelopTaskServiceImpl.java
...z/dmp/modules/service/impl/DmpDevelopTaskServiceImpl.java
+16
-1
OfflineSynchServiceImpl.java
.../jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
+2
-2
DmpDevelopTaskMapper.xml
src/main/resources/mapper/dmp/DmpDevelopTaskMapper.xml
+7
-25
OfflineSynchMapper.xml
src/main/resources/mapper/dmp/OfflineSynchMapper.xml
+2
-2
No files found.
src/main/java/com/jz/dmp/modules/controller/dataOperation/DmpDevExamplesController.java
0 → 100644
View file @
da644070
package
com
.
jz
.
dmp
.
modules
.
controller
.
dataOperation
;
import
com.jz.common.constant.JsonResult
;
import
com.jz.common.constant.ResultCode
;
import
com.jz.common.page.PageInfoResponse
;
import
com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto
;
import
com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq
;
import
com.jz.dmp.modules.service.DmpDevelopTaskService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
/**
* 数据运维-数据开发实例
*
* @author Bellamy
* @since 2021-01-13 10:56:18
*/
@RestController
@RequestMapping
(
"/dataDevExamples"
)
@Api
(
tags
=
"数据运维-数据开发实例"
)
public
class
DmpDevExamplesController
{
@Autowired
private
DmpDevelopTaskService
dmpDevelopTaskService
;
/**
* 列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
@ApiOperation
(
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
@PostMapping
(
value
=
"/listPage"
)
public
PageInfoResponse
<
DataDevTaskListDto
>
getDevTaskListPage
(
@RequestBody
@Validated
DataDevTaskListReq
req
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DataDevTaskListDto
>
pageInfo
=
new
PageInfoResponse
<
DataDevTaskListDto
>();
if
(
StringUtils
.
isEmpty
(
req
.
getProjectId
()))
{
pageInfo
.
setMessage
(
"项目id不能为空!"
);
pageInfo
.
setCode
(
ResultCode
.
PARAMS_ERROR
);
return
pageInfo
;
}
try
{
pageInfo
=
dmpDevelopTaskService
.
queryDevTaskListPage
(
req
);
}
catch
(
Exception
e
)
{
pageInfo
.
setMessage
(
"查询失败"
);
pageInfo
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
e
.
printStackTrace
();
}
return
pageInfo
;
}
}
src/main/java/com/jz/dmp/modules/controller/dataOperation/DmpDevTaskController.java
View file @
da644070
package
com
.
jz
.
dmp
.
modules
.
controller
.
dataOperation
;
import
com.jz.common.constant.JsonResult
;
import
com.jz.common.constant.ResultCode
;
import
com.jz.common.page.PageInfoResponse
;
import
com.jz.dmp.modules.controller.DataIntegration.bean.RealTimeSyncListDto
;
...
...
@@ -8,14 +9,12 @@ import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import
com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq
;
import
com.jz.dmp.modules.service.DmpDevelopTaskService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -58,4 +57,21 @@ public class DmpDevTaskController {
}
return
pageInfo
;
}
/**
* 执行任务
*
* @return
* @author Bellamy
*/
@ApiOperation
(
value
=
"执行"
,
notes
=
"执行"
)
@GetMapping
(
value
=
"/runTask"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"任务id"
)
public
JsonResult
runTaskByTaskId
(
@RequestParam
(
value
=
"taskId"
)
String
taskId
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
taskId
))
{
return
new
JsonResult
(
ResultCode
.
PARAMS_ERROR
,
"任务id不能为空!"
);
}
JsonResult
list
=
dmpDevelopTaskService
.
runTaskByTaskId
(
taskId
);
return
list
;
}
}
src/main/java/com/jz/dmp/modules/service/DmpDevelopTaskService.java
View file @
da644070
...
...
@@ -25,4 +25,12 @@ public interface DmpDevelopTaskService {
* @since 2021-01-13
*/
PageInfoResponse
<
DataDevTaskListDto
>
queryDevTaskListPage
(
DataDevTaskListReq
req
)
throws
Exception
;
/**
* 数据运维-执行任务
*
* @return
* @author Bellamy
*/
JsonResult
runTaskByTaskId
(
String
taskId
)
throws
Exception
;
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpDevelopTaskServiceImpl.java
View file @
da644070
...
...
@@ -18,6 +18,7 @@ import com.jz.dmp.modules.dao.DmpSyncingDatasourceTypeDao;
import
com.jz.dmp.modules.model.*
;
import
com.jz.dmp.modules.service.DmpDevelopTaskService
;
import
com.jz.dmp.modules.service.DmpSyncingDatasourceService
;
import
com.jz.dmp.modules.service.OfflineSynchService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -57,6 +58,9 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
@Autowired
private
DmpSyncingDatasourceService
dmpSyncingDatasourceService
;
@Autowired
private
OfflineSynchService
offlineSynchService
;
/**
* 添加保存dmp数据(包含校验数据)
*
...
...
@@ -733,9 +737,9 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
Pattern
pattern
=
Pattern
.
compile
(
"^[-\\+]?[\\d]*$"
);
if
(
pattern
.
matcher
(
req
.
getTreeIdOrName
().
trim
()).
matches
())
{
req
.
setTreeId
(
req
.
getTreeIdOrName
());
//id
req
.
setTreeIdOrName
(
null
);
}
else
{
req
.
setTreeIdOrName
(
req
.
getTreeIdOrName
().
trim
());
//节点名称
req
.
setTreeId
(
null
);
}
}
...
...
@@ -748,4 +752,15 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
/**
* 数据运维-执行任务
*
* @return
* @author Bellamy
*/
@Override
public
JsonResult
runTaskByTaskId
(
String
taskId
)
throws
Exception
{
return
offlineSynchService
.
taskRunNowByTaskId
(
taskId
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
View file @
da644070
...
...
@@ -161,10 +161,10 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
/**
* 发布流程
*/
private
boolean
publish
(
Map
<
String
,
Object
>
map
)
{
private
boolean
publish
(
Map
<
String
,
Object
>
map
)
throws
Exception
{
String
taskId
=
map
.
get
(
"taskId"
).
toString
();
//任务id
String
projectId
=
map
.
get
(
"projectId"
).
toString
();
//项目id
String
treeName
=
map
.
get
(
"treeName"
).
toString
();
//流程名称
String
treeName
=
map
.
get
(
"treeName"
).
toString
();
//
任务
流程名称
String
azkabanExectorXmlExec
=
map
.
get
(
"azkabanExectorXmlExec"
).
toString
();
//执行数据同步任务命令
String
azkabanLocalTaskFilePath
=
map
.
get
(
"azkabanLocalTaskFilePath"
).
toString
();
//文件路径
String
azkabanMonitorUrl
=
map
.
get
(
"azkabanMonitorUrl"
).
toString
();
//AZKABAN WEB服务地址
...
...
src/main/resources/mapper/dmp/DmpDevelopTaskMapper.xml
View file @
da644070
...
...
@@ -119,41 +119,23 @@
<!--数据运维-数据开发任务列表分页查询-->
<select
id=
"queryDevTaskListPage"
resultType=
"com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto"
parameterType=
"com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq"
>
select
a.*,
b.real_name as userName
from(
select
t1.id as taskId,
t1.name as taskName,
t1.type,
t1.create_user_id as createUserId,
date_format(t1.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
date_format(t1.update_time,'%Y-%m-%d %H:%i:%s') as updateTime
from
dmp_navigation_tree t1
left join dmp_develop_task t2 on t2.TREE_ID=t1.ID
where 1=1
and t1.project_id = #{projectId}
union all
select
t1.id as taskId,
t1.name as taskName,
t1.type,
t1.create_user_id as createUserId,
t1.create_time as createTime,
t1.update_time as updateTime
date_format(t1.update_time,'%Y-%m-%d %H:%i:%s') as updateTime,
t3.real_name as userName
from
dmp_navigation_tree t1
left join dmp_develop_task t2 on t2.TREE_ID=t1.ID
where 1=1
left join dmp_member t3 on t1.create_user_id=t3.user_id
where 1=1 and t1.type='01'
and t1.project_id = #{projectId}
) a
left join dmp_member b on a.createUserId=b.user_id
where 1=1
<if
test=
"treeId != null and treeId != ''"
>
and a.taskId =#{treeId}
</if>
<if
test=
"treeIdOrName != null and treeIdOrName != ''"
>
and a.taskName like concat('%',#{treeIdOrName},'%')
</if>
<if
test=
"taskType != null and taskType!= ''"
>
and a.type=#{taskType}
</if>
<if
test=
"treeId != null and treeId != ''"
>
and t1.id =#{treeId}
</if>
<if
test=
"treeIdOrName != null and treeIdOrName != ''"
>
and t1.name like concat('%',#{treeIdOrName},'%')
</if>
<if
test=
"taskType != null and taskType!= ''"
>
and t1.type=#{taskType}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/dmp/OfflineSynchMapper.xml
View file @
da644070
...
...
@@ -142,9 +142,9 @@
t3.AZKABAN_LOCAL_TASK_FILE_PATH as azkabanLocalTaskFilePath,
t3.AZKABAN_MONITOR_URL as azkabanMonitorUrl
from dmp_develop_task t1
left
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_project_system_info t3 on t2.PROJECT_ID=t3.PROJECT_ID and t3.data_status = '1'
where 1=1 and t
1
.id = #{taskId}
where 1=1 and t
2
.id = #{taskId}
</select>
<!-- 根据执行实例id查询规则执行结果表 -->
...
...
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