Browse Source

查询任务详情返回父任务id和名称

recovery
hyy-alt 4 years ago
parent
commit
b5487fc36c
  1. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  2. 17
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  3. 4
      tall/src/main/resources/application.yml

2
tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java

@ -93,6 +93,8 @@ public class TaskVo {
private String name; private String name;
@ApiModelProperty("详细描述") @ApiModelProperty("详细描述")
private String description; private String description;
@ApiModelProperty("父任务id")
private Long parentId;
@ApiModelProperty("父任务名称") @ApiModelProperty("父任务名称")
private String parentName; private String parentName;
@ApiModelProperty("所属项目id") @ApiModelProperty("所属项目id")

17
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -792,6 +792,16 @@ public class ProTaskDetailService implements IProTaskDetailService {
if (ObjectUtil.isNotNull(subTimeId)) { if (ObjectUtil.isNotNull(subTimeId)) {
groupTask = taskDetailDao.selectTaskByTaskId(subTimeId, detail.getId(), detail.getExecutorRole()); groupTask = taskDetailDao.selectTaskByTaskId(subTimeId, detail.getId(), detail.getExecutorRole());
if (ObjectUtil.isNotNull(groupTask)) { if (ObjectUtil.isNotNull(groupTask)) {
ProTaskDetail proTaskDetail = taskDetailDao.selectByPrimaryKey(groupTask.getDetailId());
if(ObjectUtil.isNotNull(proTaskDetail.getParentId())){
groupTask.setParentId(proTaskDetail.getParentId());
ProTaskDetail proTaskDetail1 = taskDetailDao.selectByPrimaryKey(proTaskDetail.getParentId());
groupTask.setParentName(proTaskDetail1.getName());
}else{
groupTask.setParentId(proTaskDetail.getParentId());
}
//处理查询到的任务的插件 //处理查询到的任务的插件
managePlugin(currentUserId, task.getExecutorRole(), taskDetail, imitation); managePlugin(currentUserId, task.getExecutorRole(), taskDetail, imitation);
//任务的完成状态 //任务的完成状态
@ -1507,10 +1517,9 @@ public class ProTaskDetailService implements IProTaskDetailService {
proTaskDetailExample.createCriteria().andIdEqualTo(updateTaskInfo.getParentId()).andProjectIdEqualTo(updateTaskInfo.getProjectId()); proTaskDetailExample.createCriteria().andIdEqualTo(updateTaskInfo.getParentId()).andProjectIdEqualTo(updateTaskInfo.getProjectId());
long l = taskDetailDao.countByExample(proTaskDetailExample); long l = taskDetailDao.countByExample(proTaskDetailExample);
if (l > 0) { if (l > 0) {
// throw new BaseException(CodeEnum.NOT_TASK);
taskDetail.setProjectId(updateTaskInfo.getProjectId()); taskDetail.setProjectId(updateTaskInfo.getProjectId());
taskDetail.setParentId(updateTaskInfo.getParentId()); taskDetail.setParentId(updateTaskInfo.getParentId());
} else { //在的话则修改项目信息 } else {
throw new BaseException(CodeEnum.PARENT_PROJECT_NOT_MATCHING); throw new BaseException(CodeEnum.PARENT_PROJECT_NOT_MATCHING);
} }
} else { } else {
@ -1526,6 +1535,10 @@ public class ProTaskDetailService implements IProTaskDetailService {
proTaskDetail.setParentId(0L); proTaskDetail.setParentId(0L);
taskDetailDao.updateByPrimaryKeySelective(proTaskDetail); taskDetailDao.updateByPrimaryKeySelective(proTaskDetail);
}); });
for (ProTaskDetail proTaskDetail : proTaskDetailList) {
}
} }
} else { } else {
//父任务id //父任务id

4
tall/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring: spring:
profiles: profiles:
active: test active: dev
include: util-test,common include: util-dev,common

Loading…
Cancel
Save