Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue_669][taier-data-develop]show schedule job name when task is deleted; scheduling job to autoCanceled rather than submitFaild if task is deleted #905

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ private List<ReturnJobStatusStatisticsVO> mergeStatusAndShow(List<StatusCountPO>
*/
private void buildReturnJobListVO(List<ReturnJobListVO> returnJobListVOS, List<ScheduleJob> records) {
List<Long> taskIdList = records.stream().map(ScheduleJob::getTaskId).collect(Collectors.toList());
List<ScheduleTaskShade> taskShadeList = taskService.lambdaQuery().in(ScheduleTaskShade::getTaskId, taskIdList).eq(ScheduleTaskShade::getIsDeleted, Deleted.NORMAL.getStatus()).list();
List<ScheduleTaskShade> taskShadeList = taskService.lambdaQuery().in(ScheduleTaskShade::getTaskId, taskIdList).list();
Map<Long, ScheduleTaskShade> taskShadeMap = taskShadeList.stream().collect(Collectors.toMap(ScheduleTaskShade::getTaskId, g -> (g)));
Map<Long, User> userMap = userService.listAll().stream().collect(Collectors.toMap(User::getId, g -> (g)));

Expand All @@ -646,6 +646,7 @@ private void buildReturnJobListVO(List<ReturnJobListVO> returnJobListVOS, List<S
if (scheduleTaskShade != null) {
returnJobListVO.setTaskName(scheduleTaskShade.getName());
returnJobListVO.setOperatorId(scheduleTaskShade.getCreateUserId());
returnJobListVO.setIsDeleted(scheduleTaskShade.getIsDeleted());
returnJobListVO.setOperatorName(userMap.get(scheduleTaskShade.getCreateUserId()) != null ? userMap.get(scheduleTaskShade.getCreateUserId()).getUserName() : "");
}
returnJobListVOS.add(returnJobListVO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ public class ReturnJobListVO {
@ApiModelProperty(value = "责任人名称",example = "1")
private String operatorName;

/**
* 是否下线
*/
@ApiModelProperty(value = "是否下线,0 正常,1 下线",example = "0")
private Integer IsDeleted;

public Integer getIsDeleted() {
return IsDeleted;
}

public void setIsDeleted(Integer isDeleted) {
IsDeleted = isDeleted;
}

public String getJobId() {
return jobId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void scanningJob () {

if (scheduleTaskShade == null) {
String errMsg = JobCheckStatus.NO_TASK.getMsg();
scheduleJobService.updateStatusAndLogInfoById(scheduleJob.getJobId(), TaskStatus.SUBMITFAILD.getStatus(), errMsg);
scheduleJobService.updateStatusAndLogInfoById(scheduleJob.getJobId(), TaskStatus.AUTOCANCELED.getStatus(), errMsg);
LOGGER.warn("jobId:{} scheduleType:{} submit failed for taskId:{} already deleted.", scheduleJob.getJobId(), getSchedulerName(), scheduleJob.getTaskId());
continue;
}
Expand Down