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
14910f3f
Commit
14910f3f
authored
Mar 08, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
c87590f0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
5 deletions
+83
-5
DmpDevTaskController.java
...odules/controller/dataOperation/DmpDevTaskController.java
+25
-0
DmpNavigationTreeDao.java
...ain/java/com/jz/dmp/modules/dao/DmpNavigationTreeDao.java
+9
-0
DmpDevelopTaskService.java
...ava/com/jz/dmp/modules/service/DmpDevelopTaskService.java
+9
-0
DmpDevelopTaskServiceImpl.java
...z/dmp/modules/service/impl/DmpDevelopTaskServiceImpl.java
+29
-5
DmpNavigationTreeMapper.xml
src/main/resources/mapper/dmp/DmpNavigationTreeMapper.xml
+11
-0
No files found.
src/main/java/com/jz/dmp/modules/controller/dataOperation/DmpDevTaskController.java
View file @
14910f3f
...
...
@@ -152,4 +152,29 @@ public class DmpDevTaskController {
}
return
result
;
}
/**
* 获取 flowId/任务名称
*
* @return
* @author Bellamy
* @since 2021-03-08
*/
@ApiOperation
(
value
=
"设置SLA--获取flowId/任务名称"
,
notes
=
"获取flowId/任务名称"
)
@GetMapping
(
value
=
"/getTaskFlowId"
)
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"projectId"
,
required
=
true
)
public
JsonResult
getTaskFlowId
(
@RequestParam
String
projectId
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
projectId
))
{
return
new
JsonResult
(
ResultCode
.
PARAMS_ERROR
,
"projectId不能为空!"
);
}
JsonResult
result
=
new
JsonResult
();
try
{
result
=
dmpDevelopTaskService
.
getTaskFlowId
(
projectId
);
}
catch
(
Exception
e
)
{
result
.
setMessage
(
"failed"
);
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
e
.
printStackTrace
();
}
return
result
;
}
}
src/main/java/com/jz/dmp/modules/dao/DmpNavigationTreeDao.java
View file @
14910f3f
...
...
@@ -122,4 +122,13 @@ public interface DmpNavigationTreeDao {
* @Date 2021/02/03
*/
int
deleteByTreeId
(
Map
params
)
throws
Exception
;
/**
* 获取 flowId/任务名称
*
* @return
* @author Bellamy
* @since 2021-03-08
*/
List
<
Map
>
queryTaskFlowId
(
String
projectId
)
throws
Exception
;
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/DmpDevelopTaskService.java
View file @
14910f3f
...
...
@@ -215,4 +215,13 @@ public interface DmpDevelopTaskService {
* @since 2021-03-08
*/
JsonResult
getSlaInfo
(
String
scheduleId
,
String
projectId
)
throws
Exception
;
/**
* 获取 flowId/任务名称
*
* @return
* @author Bellamy
* @since 2021-03-08
*/
JsonResult
getTaskFlowId
(
String
projectId
)
throws
Exception
;
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpDevelopTaskServiceImpl.java
View file @
14910f3f
...
...
@@ -822,22 +822,33 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
for
(
Map
strFlow
:
flowList
)
{
String
projectId
=
String
.
valueOf
(
strFlow
.
get
(
"projectId"
));
String
flowId
=
String
.
valueOf
(
strFlow
.
get
(
"taskName"
));
//获取调度配置
Map
responseData
=
(
Map
)
JSONObject
.
parse
(
azkabanApiUtils
.
getSchedule
(
projectId
,
flowId
));
if
(
responseData
!=
null
&&
responseData
.
size
()
>
0
)
{
Map
schedule
=
(
Map
)
responseData
.
get
(
"schedule"
);
strFlow
.
put
(
"scheduleId"
,
schedule
.
get
(
"scheduleId"
));
strFlow
.
put
(
"cronExpression"
,
schedule
.
get
(
"cronExpression"
));
strFlow
.
put
(
"scheduleId"
,
schedule
.
get
(
"scheduleId"
));
strFlow
.
put
(
"cronExpression"
,
schedule
.
get
(
"cronExpression"
));
//调度周期
//获取sla 是否已配置 状态
if
(
null
==
schedule
.
get
(
"scheduleId"
))
{
strFlow
.
put
(
"slaStatus"
,
"N"
);
}
else
{
JsonResult
jsonResult
=
getSlaInfo
(
String
.
valueOf
(
schedule
.
get
(
"scheduleId"
)),
""
);
Map
s
=
(
Map
)
jsonResult
.
getData
();
if
(
s
.
size
()
>
0
&&
s
!=
null
)
{
strFlow
.
put
(
"slaStatus"
,
"Y"
);
}
}
}
}
if
(
flowList
.
size
()
>
0
&&
flowList
!=
null
)
{
for
(
DataDevTaskListDto
str
:
listObj
)
{
for
(
Map
strFlow
:
flowList
)
{
if
(
str
.
getTaskName
().
equals
(
strFlow
.
get
(
"taskName"
)))
{
str
.
setStatus
(
String
.
valueOf
(
strFlow
.
get
(
"status"
)));
if
(
null
!=
strFlow
.
get
(
"cronExpression"
)){
str
.
setStatus
(
String
.
valueOf
(
strFlow
.
get
(
"status"
)));
//实例执行最后状态
if
(
null
!=
strFlow
.
get
(
"cronExpression"
))
{
//调度周期
str
.
setSchedulinCycle
(
String
.
valueOf
(
strFlow
.
get
(
"cronExpression"
)));
}
if
(
null
!=
strFlow
.
get
(
"scheduleId"
))
{
if
(
null
!=
strFlow
.
get
(
"scheduleId"
))
{
str
.
setScheduleId
(
String
.
valueOf
(
strFlow
.
get
(
"scheduleId"
)));
}
}
...
...
@@ -1754,4 +1765,17 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
return
JsonResult
.
ok
(
JSONObject
.
parse
(
azkabanApiUtils
.
getSlaInfo
(
scheduleId
)));
}
/**
* 获取 flowId/任务名称
*
* @return
* @author Bellamy
* @since 2021-03-08
*/
@Override
public
JsonResult
getTaskFlowId
(
String
projectId
)
throws
Exception
{
List
<
Map
>
list
=
dmpNavigationTreeDao
.
queryTaskFlowId
(
projectId
);
return
JsonResult
.
ok
(
list
);
}
}
\ No newline at end of file
src/main/resources/mapper/dmp/DmpNavigationTreeMapper.xml
View file @
14910f3f
...
...
@@ -308,4 +308,15 @@
and t1.parent_id = #{parentId}
</select>
<select
id=
"queryTaskFlowId"
resultType=
"java.util.Map"
>
SELECT
id,
name
FROM
dmp_navigation_tree
WHERE
1 = 1 AND DATA_STATUS = '1' AND IS_LEVEL = '1' AND type != '02'
and project_id = #{projectId}
</select>
</mapper>
\ No newline at end of file
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