Skip to content

Commit

Permalink
Merge pull request #6 from jet2007/feature-job-display
Browse files Browse the repository at this point in the history
任务详情页面布局
  • Loading branch information
jet2007 committed Dec 27, 2019
2 parents 986d46e + ab024ba commit 38a78a5
Show file tree
Hide file tree
Showing 21 changed files with 697 additions and 1,589 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/feature/feature-job-display/job-job-list.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/feature/feature-job-display/job-operate.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions doc/feature/feature-job-display/readme.md
@@ -0,0 +1,48 @@
[TOC]



## 任务详情模块

### 任务详情-主页面

- 任务组与任务的展开子页面内容不一样
- 筛选条件,增加开始日期与结束日期

![](job-main-list.jpg)



### 任务详情-组子页面

- 组下的任务执行历史情况(点击主页面的任务组,按开始时间升序)

![](job-group-list.jpg)

### 任务详情-任务子页面

- 同一个任务执行历史情况(点击主页面的任务,按开始时间降序)

![](job-job-list.jpg)

### 子页面的功能说明

#### 时间轴

- 当前任务的执行的时间区间

#### 操作

说明:对于当前任务的手动可操作的一系列动作。

- 重做:包含【重做当前】和【重做后续】,相当于之前版本的【手动执行】与【手动恢复】
- 取消:取消正在执行的任务
- 强制:直接将任务的状态值,强制设置为【失败】、【成功】、【等待】

备注:3个选项的可见性,较为简单,未细分,可进一步优化(如若当前状=成功,则强制成功为不可见,目前就未实现)

![](job-operate.jpg)




Expand Up @@ -43,18 +43,18 @@ public class JobManageController extends BaseHeraController {
@Qualifier("heraJobMemoryService")
private HeraJobService heraJobService;


/**
* 今日任务详情
*
* @param status 任务状态
* @param dt 日志
* 任务详情
* @return 历史结果
*/
@RequestMapping(value = "history", method = RequestMethod.GET)
@ResponseBody
public JsonResponse findJobHistoryByStatus(@RequestParam("status") String status, String dt) {
return jobManageService.findJobHistoryByStatus(status, dt);
public JsonResponse findJobHistoryByStatus(@RequestParam("status") String status, @RequestParam("begindt") String begindt, @RequestParam("enddt") String enddt) {
return jobManageService.findJobHistoryByStatus(status, begindt,enddt);
}



@RequestMapping(value = "search", method = RequestMethod.GET)
@ResponseBody
Expand Down
Expand Up @@ -11,6 +11,7 @@
import com.dfire.common.entity.vo.HeraGroupVo;
import com.dfire.common.entity.vo.HeraJobVo;
import com.dfire.common.entity.vo.PageHelper;
import com.dfire.common.entity.vo.PageHelperTimeRange;
import com.dfire.common.enums.*;
import com.dfire.common.exception.NoPermissionException;
import com.dfire.common.service.*;
Expand Down Expand Up @@ -290,7 +291,7 @@ public JsonResponse execute(String actionId, Integer triggerType, @RequestParam(
checkPermission(Integer.parseInt(actionId.substring(actionId.length() - 4)), RunAuthType.JOB);
}
TriggerTypeEnum triggerTypeEnum;
if (triggerType == 2) {
if (triggerType == TriggerTypeEnum.MANUAL_RECOVER.getId()) {
triggerTypeEnum = TriggerTypeEnum.MANUAL_RECOVER;
} else {
triggerTypeEnum = TriggerTypeEnum.MANUAL;
Expand Down Expand Up @@ -662,8 +663,8 @@ public JsonResponse generateAllVersion() throws ExecutionException, InterruptedE
*/
@RequestMapping(value = "/getJobHistory", method = RequestMethod.GET)
@ResponseBody
public JsonResponse getJobHistory(PageHelper pageHelper) {
return new JsonResponse(true, heraJobHistoryService.findLogByPage(pageHelper));
public JsonResponse getJobHistory(PageHelperTimeRange pageHelperTimeRange) {
return new JsonResponse(true, heraJobHistoryService.findLogByPage(pageHelperTimeRange));
}

@RequestMapping(value = "/getHostGroupIds", method = RequestMethod.GET)
Expand Down Expand Up @@ -993,6 +994,39 @@ public JsonResponse moveNode(String id, String parent, String lastParent) throws
return new JsonResponse(result, result ? "处理成功" : "移动失败");
}
}

/**
*
* @param jobHisId
* @param status
* @return
*/
@RequestMapping(value = "/forceJobHisStatus", method = RequestMethod.GET)
@ResponseBody
public JsonResponse forceJobHisStatus(Integer jobHisId, String status ){

String info="";
if(status.equals(StatusEnum.WAIT.toString())){
info="手动强制等待状态";
}else if(status.equals(StatusEnum.FAILED.toString())){
info="手动强制失败状态";
}else if(status.equals(StatusEnum.SUCCESS.toString())){
info="手动强制成功状态";
}else if(status.equals(StatusEnum.RUNNING.toString())){
info="手动强制运行中状态";
}


String illustrate=heraJobHistoryService.findById(jobHisId.toString()).getIllustrate();
if(StringUtils.isNotBlank(illustrate)){
illustrate+=";"+info;
}else{
illustrate=info;
}

heraJobHistoryService.updateStatusAndIllustrate(jobHisId, status, illustrate, new Date());
return null;
}


}

0 comments on commit 38a78a5

Please sign in to comment.