需求任务添加bug列表

This commit is contained in:
2025-03-14 08:55:41 +08:00
parent 5496f18959
commit 11cec800ef
11 changed files with 556 additions and 407 deletions

View File

@ -3,10 +3,7 @@ package com.sa.zentao.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sa.zentao.dao.BusinessException; import com.sa.zentao.dao.*;
import com.sa.zentao.dao.Result;
import com.sa.zentao.dao.ZtProjectDTO;
import com.sa.zentao.dao.ZtStoryDTO;
import com.sa.zentao.entity.ZtProject; import com.sa.zentao.entity.ZtProject;
import com.sa.zentao.entity.ZtProjectproduct; import com.sa.zentao.entity.ZtProjectproduct;
import com.sa.zentao.qo.ZtProjectQo; import com.sa.zentao.qo.ZtProjectQo;
@ -181,6 +178,14 @@ public class ZtStoryController {
return Result.success(); return Result.success();
} }
//切换指派
@RequestMapping(value = "/storyListByUserStory", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
public Result storyListByUserStory(@RequestBody ZtStoryDTO dto){
List<ZtStoryDTO> list = ztStoryService.storyListByUserStory(dto);
return Result.success(list);
}
//迭代列表根据项目id //迭代列表根据项目id
@RequestMapping(value = "/execListByProject", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") @RequestMapping(value = "/execListByProject", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")

View File

@ -113,4 +113,5 @@ public class ZtStoryUserController {
} }
} }

View File

@ -257,4 +257,5 @@ public class ZtStoryDTO implements Serializable {
private Integer releaseFlag=0; private Integer releaseFlag=0;
private List<ZtBugDTO> bugList;
} }

View File

@ -200,5 +200,5 @@ public class ZtTaskDTO implements Serializable {
private BigDecimal useTime; private BigDecimal useTime;
private List<ZtBugDTO> bugList;
} }

View File

@ -2,6 +2,7 @@ package com.sa.zentao.service;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sa.zentao.dao.ZtStoryDTO; import com.sa.zentao.dao.ZtStoryDTO;
import com.sa.zentao.dao.ZtStoryUserDTO;
import com.sa.zentao.entity.ZtProject; import com.sa.zentao.entity.ZtProject;
import com.sa.zentao.entity.ZtStory; import com.sa.zentao.entity.ZtStory;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -83,4 +84,6 @@ public interface IZtStoryService extends IService<ZtStory> {
Map<Integer,List<ZtProject>> getExecutionMapByStory(List<ZtStoryDTO> list); Map<Integer,List<ZtProject>> getExecutionMapByStory(List<ZtStoryDTO> list);
void batchAddStory(ZtStoryDTO dto); void batchAddStory(ZtStoryDTO dto);
List<ZtStoryDTO> storyListByUserStory(ZtStoryDTO dto);
} }

View File

@ -489,7 +489,7 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
result.put("project",pList); result.put("project",pList);
if(!CollectionUtils.isEmpty(pList)){ if(!CollectionUtils.isEmpty(pList)){
List<ZtProjectproduct> productList = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>().lambda().in(ZtProjectproduct::getProject List<ZtProjectproduct> productList = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>().lambda().in(ZtProjectproduct::getProject
, pList.stream().map(o -> o.getProject()).collect(Collectors.toList()))); , pList.stream().map(o -> o.getId()).collect(Collectors.toList())));
if(CollectionUtils.isEmpty(productList)){ if(CollectionUtils.isEmpty(productList)){
result.put("product",Arrays.asList()); result.put("product",Arrays.asList());
}else{ }else{
@ -503,7 +503,7 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
Integer taskId = dto.getTaskId(); Integer taskId = dto.getTaskId();
if(taskId!=null){ if(taskId!=null){
ZtTask task = this.taskService.getById(taskId); ZtTask task = this.taskService.getById(taskId);
result.put("task",task); result.put("task",Arrays.asList(task));
Integer execution = task.getExecution(); Integer execution = task.getExecution();
Integer product = task.getProduct(); Integer product = task.getProduct();
Integer project = task.getProject(); Integer project = task.getProject();
@ -512,8 +512,10 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
result.put("project",(project==null||project==0)?Arrays.asList():Arrays.asList(this.projectService.getById(project))); result.put("project",(project==null||project==0)?Arrays.asList():Arrays.asList(this.projectService.getById(project)));
result.put("execution",(execution==null||execution==0)?Arrays.asList():Arrays.asList(this.projectService.getById(execution))); result.put("execution",(execution==null||execution==0)?Arrays.asList():Arrays.asList(this.projectService.getById(execution)));
result.put("feedback",(feedback==null||feedback==0)?Arrays.asList():Arrays.asList(this.storyFeedbackService.getById(feedback))); result.put("feedback",(feedback==null||feedback==0)?Arrays.asList():Arrays.asList(this.storyFeedbackService.getById(feedback)));
Integer story = task.getStory();
result.put("story",(story==null||story==0)?Arrays.asList():Arrays.asList(this.storyService.getById(story)));
}else{ }else{
result.put("task",null); result.put("task",Arrays.asList());
} }
@ -521,7 +523,7 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
Integer storyId = dto.getStoryId(); Integer storyId = dto.getStoryId();
if(storyId!=null){ if(storyId!=null){
ZtStory ztStory = this.storyService.getById(storyId); ZtStory ztStory = this.storyService.getById(storyId);
result.put("story",ztStory); result.put("story",Arrays.asList(ztStory));
ZtProduct product = this.baseMapper.selectById(ztStory.getProduct()); ZtProduct product = this.baseMapper.selectById(ztStory.getProduct());
result.put("product",Arrays.asList(product)); result.put("product",Arrays.asList(product));
@ -534,8 +536,9 @@ public class ZtProductServiceImpl extends ServiceImpl<ZtProductMapper, ZtProduct
List<ZtProject> execList = this.projectService.listByIds(list.stream().map(o -> o.getExecution()).collect(Collectors.toList())); List<ZtProject> execList = this.projectService.listByIds(list.stream().map(o -> o.getExecution()).collect(Collectors.toList()));
result.put("execution",execList); result.put("execution",execList);
} }
}else{ List<ZtTask> list = this.taskService.list(new QueryWrapper<ZtTask>().lambda()
result.put("story",null); .eq(ZtTask::getStory, storyId));
result.put("task",list);
} }

View File

@ -604,7 +604,32 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
//搜索执行根据产品 和 项目 //搜索执行根据产品 和 项目
@Override @Override
public List<ZtProject> executionListByProduct(ZtProjectQo qo) { public List<ZtProject> executionListByProduct(ZtProjectQo qo) {
return this.baseMapper.executionListByProduct(qo);
Integer productId = qo.getProductId();
Integer project = qo.getProject();
if(project!=null&&project!=0){
List<ZtExecutionproject> list = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().eq(ZtExecutionproject::getProject, project));
if(!CollectionUtils.isEmpty(list)){
return this.listByIds(list.stream().map(o->o.getExecution()).collect(Collectors.toList()));
}
}
if(productId!=null&&productId!=0){
List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>()
.lambda().eq(ZtProjectproduct::getProduct, productId));
if(!CollectionUtils.isEmpty(list)){
List<ZtExecutionproject> eList = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda().
in(ZtExecutionproject::getProject, list.stream().map(o->o.getProject()).collect(Collectors.toList())));
if(!CollectionUtils.isEmpty(eList)){
return this.listByIds(eList.stream().map(o->o.getExecution()).collect(Collectors.toList()));
}
}
}
return new ArrayList<>();
} }
@Override @Override

View File

@ -171,7 +171,6 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list); Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list);
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list); Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
for (ZtStoryUserDTO d : list) { for (ZtStoryUserDTO d : list) {
if(!StringUtils.isEmpty(d.getReviewedby())){ if(!StringUtils.isEmpty(d.getReviewedby())){
@ -375,6 +374,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
} }
} }
if(dto.getModule()!=null&&dto.getModule()!=0){ if(dto.getModule()!=null&&dto.getModule()!=0){
ZtModule ztModule = this.moduleService.getById(dto.getModule()); ZtModule ztModule = this.moduleService.getById(dto.getModule());
if(ztModule!=null){ if(ztModule!=null){
@ -415,7 +415,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
dto.setSList(storyDTOList); dto.setSList(storyDTOList);
} }
} }
dto.setViews(rMap.get(d.getId()));
return dto; return dto;
} }

View File

@ -72,6 +72,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
@Autowired @Autowired
private IZtExecutionprojectService executionprojectService; private IZtExecutionprojectService executionprojectService;
@Autowired
private IZtBugService bugService;
@Override @Override
public PageInfo<ZtTaskDTO> taskPageList(ZtProjectQo qo) { public PageInfo<ZtTaskDTO> taskPageList(ZtProjectQo qo) {
@ -233,6 +236,30 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
if (ztUser != null) { if (ztUser != null) {
dto.setAssignedToName(ztUser.getNickname()); dto.setAssignedToName(ztUser.getNickname());
} }
List<ZtBug> list = this.bugService.list(new QueryWrapper<ZtBug>().lambda().eq(ZtBug::getTotask, id));
if(!CollectionUtils.isEmpty(list)){
List<ZtBugDTO> ztBugDTOS = BeanCopyUtil.copyListProperties(list, ZtBugDTO::new);
for (ZtBugDTO bug:ztBugDTOS) {
ztUser = userMap.get(bug.getOpenedby());
if(ztUser!=null){
bug.setOpenedbyName(ztUser.getNickname());
}
ztUser = userMap.get(bug.getAssignedTo());
if(ztUser!=null){
bug.setAssignedToName(ztUser.getNickname());
}
ztUser = userMap.get(bug.getYsUser());
if(ztUser!=null){
bug.setYsUserName(ztUser.getNickname());
}
}
dto.setBugList(ztBugDTOS);
}else{
dto.setBugList(Arrays.asList());
}
return dto; return dto;
} }

View File

@ -175,13 +175,14 @@
select s.*,sp.spec ,sp.verify,sp.files,pt.name productName from (zt_story s,zt_projectstory ps ) left join zt_storyspec sp on s.id = sp.story select s.*,sp.spec ,sp.verify,sp.files,pt.name productName from zt_story s left join zt_storyspec sp on s.id = sp.story
left join zt_storyreview v on s.id = v.story and s.version = v.version left join zt_storyreview v on s.id = v.story and s.version = v.version
left join zt_projectstory pstory on s.id = pstory.story and pstory.execution =0 left join zt_projectstory pstory on s.id = pstory.story and pstory.execution =0
left join zt_project pj on pstory.project = pj.id left join zt_project pj on pstory.project = pj.id
left join zt_product pt on s.product = pt.id left join zt_product pt on s.product = pt.id
WHERE s.id = ps.story left join zt_projectstory ps on s.id = ps.story
WHERE 1=1
<if test="qo.startDate !=null"> <if test="qo.startDate !=null">
@ -199,9 +200,11 @@
<if test="qo.project != null "> <if test="qo.project != null ">
and ps.project =#{qo.project} and ps.project =#{qo.project}
and ps.type= 'project'
</if> </if>
<if test="qo.execution != null "> <if test="qo.execution != null ">
and ps.project =#{qo.execution} and ps.project =#{qo.execution}
and ps.type= 'execution'
</if> </if>
<if test="qo.module != null "> <if test="qo.module != null ">
and s.module =#{qo.module} and s.module =#{qo.module}
@ -271,7 +274,7 @@
</if> </if>
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' "> <if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
and s.status ='closed' and s.status ='closed'
and closedBy =#{qo.userName} and s.closedBy =#{qo.userName}
</if> </if>