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
f621ee75
Commit
f621ee75
authored
Mar 11, 2021
by
sml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码提交
parent
1e9b432d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
24 deletions
+29
-24
AzkabanApiUtils2.java
src/main/java/com/jz/common/utils/AzkabanApiUtils2.java
+4
-4
DmpDevelopTaskController.java
...m/jz/dmp/modules/controller/DmpDevelopTaskController.java
+6
-6
DmpDevelopTaskService.java
...ava/com/jz/dmp/modules/service/DmpDevelopTaskService.java
+2
-2
DmpDevelopTaskServiceImpl.java
...z/dmp/modules/service/impl/DmpDevelopTaskServiceImpl.java
+11
-10
OfflineSynchServiceImpl.java
.../jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
+6
-2
No files found.
src/main/java/com/jz/common/utils/AzkabanApiUtils2.java
View file @
f621ee75
...
...
@@ -460,7 +460,7 @@ public class AzkabanApiUtils2 {
* @param projectDesc 项目描述
* @param uploadZipPath 上传zip包的全路径
*/
public
boolean
loginCreateProjectuploadZipAndExecute
(
String
projectName
,
String
projectDesc
,
String
uploadZipPath
,
String
flowName
)
{
public
Integer
loginCreateProjectuploadZipAndExecute
(
String
projectName
,
String
projectDesc
,
String
uploadZipPath
,
String
flowName
)
{
//登录
String
sessionId
=
login
();
...
...
@@ -469,12 +469,12 @@ public class AzkabanApiUtils2 {
Map
<
String
,
Object
>
map
=
uploadZip
(
sessionId
,
projectName
,
uploadZipPath
);
if
(
map
.
containsKey
(
"error"
))
{
return
false
;
return
null
;
}
//立即执行
executeFlow
(
sessionId
,
projectName
,
flowName
);
Integer
execId
=
executeFlow
(
sessionId
,
projectName
,
flowName
);
return
true
;
return
execId
;
}
/**
...
...
src/main/java/com/jz/dmp/modules/controller/DmpDevelopTaskController.java
View file @
f621ee75
...
...
@@ -170,18 +170,18 @@ public class DmpDevelopTaskController {
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/taskAzkabanRun"
)
@ApiOperation
(
value
=
"任务立即运行接口"
,
notes
=
"任务立即运行接口"
)
@ApiImplicitParam
(
name
=
"treeId"
,
value
=
"任务树主键"
)
public
Base
Response
taskAzkabanRun
(
@RequestParam
(
value
=
"treeId"
,
required
=
true
)
Long
treeId
,
HttpServletRequest
httpRequest
){
Base
Response
baseResponse
=
new
BaseResponse
();
public
Base
BeanResponse
<
Integer
>
taskAzkabanRun
(
@RequestParam
(
value
=
"treeId"
,
required
=
true
)
Long
treeId
,
HttpServletRequest
httpRequest
){
Base
BeanResponse
<
Integer
>
baseBeanResponse
=
new
BaseBeanResponse
<
Integer
>
();
try
{
baseResponse
=
dmpDevelopTaskService
.
taskAzkabanRun
(
treeId
,
httpRequest
);
base
Bean
Response
=
dmpDevelopTaskService
.
taskAzkabanRun
(
treeId
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseResponse
.
setMessage
(
"任务运行失败"
);
baseResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
base
Bean
Response
.
setMessage
(
"任务运行失败"
);
base
Bean
Response
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseResponse
;
return
base
Bean
Response
;
}
/**任务立即运行停止
...
...
src/main/java/com/jz/dmp/modules/service/DmpDevelopTaskService.java
View file @
f621ee75
...
...
@@ -118,12 +118,12 @@ public interface DmpDevelopTaskService {
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @return Base
Bean
Response 返回类型
* @throws
* @Title: taskAzkabanRun
* @Description: TODO(运行任务)
*/
public
Base
Response
taskAzkabanRun
(
Long
treeId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
public
Base
BeanResponse
<
Integer
>
taskAzkabanRun
(
Long
treeId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @param @param treeId
...
...
src/main/java/com/jz/dmp/modules/service/impl/DmpDevelopTaskServiceImpl.java
View file @
f621ee75
...
...
@@ -1445,29 +1445,30 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
* 运行任务
*/
@Override
public
Base
Response
taskAzkabanRun
(
Long
treeId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
public
Base
BeanResponse
<
Integer
>
taskAzkabanRun
(
Long
treeId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
BaseBeanResponse
<
Integer
>
baseBeanResponse
=
new
BaseBeanResponse
<
Integer
>
();
DmpDevelopTask
developTask
=
dmpDevelopTaskDao
.
get
(
treeId
);
//先发布任务
boolean
flag
=
publishAndExecute
(
developTask
);
Integer
execId
=
publishAndExecute
(
developTask
);
if
(
flag
)
{
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"立即运行成功"
);
if
(
execId
!=
null
)
{
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"立即运行成功"
);
baseBeanResponse
.
setData
(
execId
);
}
else
{
base
Response
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
base
Response
.
setMessage
(
"立即运行失败"
);
baseBean
Response
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
baseBean
Response
.
setMessage
(
"立即运行失败"
);
}
return
baseResponse
;
return
base
Bean
Response
;
}
/**
* 发布流程
*/
private
boolean
publishAndExecute
(
DmpDevelopTask
dmpDevelopTask
)
throws
Exception
{
private
Integer
publishAndExecute
(
DmpDevelopTask
dmpDevelopTask
)
throws
Exception
{
Integer
taskId
=
dmpDevelopTask
.
getId
();
//任务id
Integer
projectId
=
dmpDevelopTask
.
getProjectId
();
//项目id
String
treeName
=
dmpDevelopTask
.
getName
();
//任务流程名称
...
...
src/main/java/com/jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
View file @
f621ee75
...
...
@@ -171,7 +171,11 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
//根据任务id,查询DMP资源导航树和DW系统配置信息
Map
<
String
,
Object
>
map
=
offlineSynchDao
.
selectNavigationTreeByTaskId
(
taskId
);
if
(
map
.
size
()
>
0
&&
map
!=
null
)
{
flag
=
this
.
publish
(
map
);
Integer
execId
=
this
.
publish
(
map
);
if
(
execId
!=
null
)
{
flag
=
true
;
}
if
(
flag
)
{
return
new
JsonResult
(
ResultCode
.
SUCCESS
,
flag
);
}
else
{
...
...
@@ -185,7 +189,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
/**
* 发布流程
*/
private
boolean
publish
(
Map
<
String
,
Object
>
map
)
throws
Exception
{
private
Integer
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
();
//任务流程名称
...
...
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