Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
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
liyuan
byit-myth-job
Commits
b9bd2440
Commit
b9bd2440
authored
Oct 14, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口 验证工作流全部完成
parent
3829d681
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
116 additions
and
1 deletion
+116
-1
RunRecordingOperatingController.java
...in/java/com/byit/api/RunRecordingOperatingController.java
+30
-0
FlowConditionDto.java
...min-core/src/main/java/com/byit/dto/FlowConditionDto.java
+5
-0
RunRecordingMapper.java
...ore/src/main/java/com/byit/mapper/RunRecordingMapper.java
+7
-0
RunRecordingService.java
...e/src/main/java/com/byit/service/RunRecordingService.java
+8
-0
RunRecordingServiceImpl.java
...n/java/com/byit/service/impl/RunRecordingServiceImpl.java
+20
-1
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+14
-0
RunRecordingStatus.java
...src/main/java/com/byit/dto/plugin/RunRecordingStatus.java
+18
-0
JobUtils.java
...xecutor-plugin/src/main/java/com/byit/utils/JobUtils.java
+14
-0
No files found.
byit-myth-admin/src/main/java/com/byit/api/RunRecordingOperatingController.java
0 → 100644
View file @
b9bd2440
package
com
.
byit
.
api
;
import
com.byit.dto.plugin.RunRecordingStatus
;
import
com.byit.service.RunRecordingService
;
import
com.byit.service.impl.RunRecordingServiceImpl
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 运行实例操作控制器
* @date 2020年10月14日21:29:34
* @author huangfu
*/
@Api
(
tags
=
"运行实例操作控制器"
)
@RestController
@RequestMapping
(
"api/operating/runRecording/"
)
public
class
RunRecordingOperatingController
{
private
final
RunRecordingService
runRecordingService
;
public
RunRecordingOperatingController
(
RunRecordingService
runRecordingService
)
{
this
.
runRecordingService
=
runRecordingService
;
}
@RequestMapping
(
"findNoEnd"
)
public
Boolean
findNoEnd
(
@RequestBody
RunRecordingStatus
runRecordingStatus
)
{
return
runRecordingService
.
findNoEnd
(
runRecordingStatus
);
}
}
byit-myth-core/myth-admin-core/src/main/java/com/byit/dto/FlowConditionDto.java
View file @
b9bd2440
package
com
.
byit
.
dto
;
package
com
.
byit
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
import
lombok.ToString
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -10,7 +12,10 @@ import java.io.Serializable;
...
@@ -10,7 +12,10 @@ import java.io.Serializable;
*/
*/
@Data
@Data
@ToString
@ToString
@AllArgsConstructor
@NoArgsConstructor
public
class
FlowConditionDto
implements
Serializable
{
public
class
FlowConditionDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
239650918380052969L
;
private
Integer
workspaceId
;
private
Integer
workspaceId
;
private
String
flowName
;
private
String
flowName
;
}
}
byit-myth-core/myth-admin-core/src/main/java/com/byit/mapper/RunRecordingMapper.java
View file @
b9bd2440
...
@@ -44,6 +44,7 @@ public interface RunRecordingMapper {
...
@@ -44,6 +44,7 @@ public interface RunRecordingMapper {
* @return
* @return
*/
*/
List
<
RunRecording
>
findAllRunIng
(
FlowConditionDto
flowConditionDto
);
List
<
RunRecording
>
findAllRunIng
(
FlowConditionDto
flowConditionDto
);
/**
/**
* 查询已经完结的,并且没有告警的任务流
* 查询已经完结的,并且没有告警的任务流
* @return
* @return
...
@@ -70,6 +71,12 @@ public interface RunRecordingMapper {
...
@@ -70,6 +71,12 @@ public interface RunRecordingMapper {
List
<
RunRecording
>
findRunningRunRecording
();
List
<
RunRecording
>
findRunningRunRecording
();
/**
/**
* 查询运行中的数据
* @return
*/
List
<
RunRecording
>
findNoEnd
(
FlowConditionDto
flowConditionDto
);
/**
* 根据工作流查询对应的实例
* 根据工作流查询对应的实例
* @param flowId
* @param flowId
* @return
* @return
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/RunRecordingService.java
View file @
b9bd2440
package
com
.
byit
.
service
;
package
com
.
byit
.
service
;
import
com.byit.dto.FlowConditionDto
;
import
com.byit.dto.FlowConditionDto
;
import
com.byit.dto.plugin.RunRecordingStatus
;
import
com.byit.model.RunRecording
;
import
com.byit.model.RunRecording
;
import
com.byit.model.vo.RunRecordingViewVo
;
import
com.byit.model.vo.RunRecordingViewVo
;
...
@@ -33,6 +34,13 @@ public interface RunRecordingService {
...
@@ -33,6 +34,13 @@ public interface RunRecordingService {
List
<
RunRecording
>
findAll
(
FlowConditionDto
flowConditionDto
);
List
<
RunRecording
>
findAll
(
FlowConditionDto
flowConditionDto
);
/**
/**
*
* @param runRecordingStatus
* @return
*/
boolean
findNoEnd
(
RunRecordingStatus
runRecordingStatus
);
/**
* 查询全部错误的节点
* 查询全部错误的节点
* @return
* @return
*/
*/
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/RunRecordingServiceImpl.java
View file @
b9bd2440
...
@@ -3,11 +3,15 @@ package com.byit.service.impl;
...
@@ -3,11 +3,15 @@ package com.byit.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.byit.dto.FlowConditionDto
;
import
com.byit.dto.FlowConditionDto
;
import
com.byit.dto.StatisticsConditionDto
;
import
com.byit.dto.StatisticsConditionDto
;
import
com.byit.dto.plugin.RunRecordingStatus
;
import
com.byit.enums.RunRecordingEnum
;
import
com.byit.enums.RunRecordingEnum
;
import
com.byit.mapper.RunRecordingMapper
;
import
com.byit.mapper.RunRecordingMapper
;
import
com.byit.model.RunRecording
;
import
com.byit.model.RunRecording
;
import
com.byit.model.Workspace
;
import
com.byit.model.vo.RunRecordingViewVo
;
import
com.byit.model.vo.RunRecordingViewVo
;
import
com.byit.service.RunRecordingService
;
import
com.byit.service.RunRecordingService
;
import
com.byit.service.WorkspaceService
;
import
com.byit.utils.ValidationUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -29,10 +33,12 @@ import java.util.stream.Collectors;
...
@@ -29,10 +33,12 @@ import java.util.stream.Collectors;
@Slf4j
@Slf4j
public
class
RunRecordingServiceImpl
implements
RunRecordingService
{
public
class
RunRecordingServiceImpl
implements
RunRecordingService
{
private
final
RunRecordingMapper
runRecordingMapper
;
private
final
RunRecordingMapper
runRecordingMapper
;
private
final
WorkspaceService
workspaceService
;
@Autowired
@Autowired
public
RunRecordingServiceImpl
(
RunRecordingMapper
runRecordingMapper
)
{
public
RunRecordingServiceImpl
(
RunRecordingMapper
runRecordingMapper
,
WorkspaceService
workspaceService
)
{
this
.
runRecordingMapper
=
runRecordingMapper
;
this
.
runRecordingMapper
=
runRecordingMapper
;
this
.
workspaceService
=
workspaceService
;
}
}
@Override
@Override
...
@@ -73,6 +79,19 @@ public class RunRecordingServiceImpl implements RunRecordingService {
...
@@ -73,6 +79,19 @@ public class RunRecordingServiceImpl implements RunRecordingService {
}
}
@Override
@Override
public
boolean
findNoEnd
(
RunRecordingStatus
runRecordingStatus
)
{
ValidationUtil
.
dataNotNull
(
runRecordingStatus
,
"查询实体不能为Null"
);
ValidationUtil
.
dataNotBank
(
runRecordingStatus
.
getFlowName
(),
"工作流名称不能为null"
);
ValidationUtil
.
dataNotBank
(
runRecordingStatus
.
getWorkspaceName
(),
"工作空间不能为Null"
);
String
workspaceName
=
runRecordingStatus
.
getWorkspaceName
();
Workspace
byName
=
workspaceService
.
getByName
(
workspaceName
);
ValidationUtil
.
dataNotNull
(
byName
,
"工作空间不存在"
);
FlowConditionDto
flowConditionDto
=
new
FlowConditionDto
(
byName
.
getWorkspaceId
(),
runRecordingStatus
.
getFlowName
());
List
<
RunRecording
>
noEnd
=
runRecordingMapper
.
findNoEnd
(
flowConditionDto
);
return
CollectionUtil
.
isNotEmpty
(
noEnd
);
}
@Override
public
List
<
RunRecordingViewVo
>
findAllError
(
FlowConditionDto
flowConditionDto
)
{
public
List
<
RunRecordingViewVo
>
findAllError
(
FlowConditionDto
flowConditionDto
)
{
List
<
RunRecording
>
allError
=
runRecordingMapper
.
findAllError
(
flowConditionDto
);
List
<
RunRecording
>
allError
=
runRecordingMapper
.
findAllError
(
flowConditionDto
);
return
allError
.
stream
().
map
(
runRecording
->
{
return
allError
.
stream
().
map
(
runRecording
->
{
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
b9bd2440
...
@@ -122,6 +122,20 @@
...
@@ -122,6 +122,20 @@
where flow_status = '2' and schedule_type != 4
where flow_status = '2' and schedule_type != 4
</select>
</select>
<select
id=
"findNoEnd"
parameterType=
"com.byit.dto.FlowConditionDto"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from run_recording
where (flow_status = '2' or flow_status = '3' or flow_status = '1')
and schedule_type != 4
<if
test=
"workspaceId != null"
>
AND workspace_id = #{workspaceId,jdbcType=INTEGER}
</if>
<if
test=
"flowName != null and flowName != ''"
>
AND flow_name = #{flowName,jdbcType=VARCHAR}
</if>
</select>
<select
id=
"findRunRecordingByFlowId"
resultMap=
"BaseResultMap"
>
<select
id=
"findRunRecordingByFlowId"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/plugin/RunRecordingStatus.java
0 → 100644
View file @
b9bd2440
package
com
.
byit
.
dto
.
plugin
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 运行实例状态长训实体
*
* @date 2020年10月14日21:23:56
* @author huangfu
*/
@Data
public
class
RunRecordingStatus
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7767046728921397387L
;
private
String
flowName
;
private
String
workspaceName
;
}
byit-myth-executor/myth-executor-plugin/src/main/java/com/byit/utils/JobUtils.java
View file @
b9bd2440
...
@@ -132,6 +132,11 @@ public class JobUtils {
...
@@ -132,6 +132,11 @@ public class JobUtils {
*/
*/
public
static
final
String
SPECIAL_REQUEST_REPAIRFLOW
=
"/api/operating/node/specialRunBatch"
;
public
static
final
String
SPECIAL_REQUEST_REPAIRFLOW
=
"/api/operating/node/specialRunBatch"
;
/**
* 查询工作流是否运行完成
*/
public
static
final
String
FIND_NOT_END_FLOW
=
"/api/operating/runRecording/findNoEnd"
;
private
static
final
String
REQUEST_REAL_EXECT
=
"/api/node/runNode"
;
private
static
final
String
REQUEST_REAL_EXECT
=
"/api/node/runNode"
;
private
static
final
String
REQUEST_RUN_HISTORY
=
"/api/node/runHistory"
;
private
static
final
String
REQUEST_RUN_HISTORY
=
"/api/node/runHistory"
;
...
@@ -232,6 +237,15 @@ public class JobUtils {
...
@@ -232,6 +237,15 @@ public class JobUtils {
}
}
public
static
ResponseResult
specialRequestRepairflow
(
RunRecordingStatus
runRecordingStatus
)
{
log
.
debug
(
"-------------查询工作流实例是否全部完结{}----------------------"
,
runRecordingStatus
);
String
response
=
createHttpRequest
(
FIND_NOT_END_FLOW
,
JSON
.
toJSONString
(
runRecordingStatus
,
WriteClassName
));
log
.
debug
(
"-------------查询工作流实例是否全部完结结束:{}----------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
public
static
ResponseResult
findFlowResult
(
List
<
JobStatusDto
>
jobStatusDtos
)
{
public
static
ResponseResult
findFlowResult
(
List
<
JobStatusDto
>
jobStatusDtos
)
{
log
.
debug
(
"-------------查询对应工作流的运行状态----------------------"
);
log
.
debug
(
"-------------查询对应工作流的运行状态----------------------"
);
String
response
=
createHttpRequest
(
FIND_FLOW_RESULT
,
"param="
+
JSON
.
toJSONString
(
jobStatusDtos
,
WriteClassName
));
String
response
=
createHttpRequest
(
FIND_FLOW_RESULT
,
"param="
+
JSON
.
toJSONString
(
jobStatusDtos
,
WriteClassName
));
...
...
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