发布等
This commit is contained in:
22
pom.xml
22
pom.xml
@ -25,7 +25,11 @@
|
|||||||
<version>1.5.2</version>
|
<version>1.5.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>easyexcel</artifactId>
|
||||||
|
<version>3.0.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -102,10 +106,22 @@
|
|||||||
<version>3.5.5</version>
|
<version>3.5.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.baomidou</groupId>-->
|
||||||
|
<!-- <artifactId>mybatis-plus-spring-boot3-starter</artifactId>-->
|
||||||
|
<!-- <version>3.5.5</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.baomidou</groupId>-->
|
||||||
|
<!-- <artifactId>dynamic-datasource-spring-boot3-starter</artifactId>-->
|
||||||
|
<!-- <version>4.2.0</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
|
||||||
<version>3.5.5</version>
|
<version>4.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -233,6 +233,8 @@ public class ZtStoryDTO implements Serializable {
|
|||||||
|
|
||||||
private Integer execution;
|
private Integer execution;
|
||||||
|
|
||||||
|
private List<Integer> executions;
|
||||||
|
|
||||||
private Boolean psFlag;
|
private Boolean psFlag;
|
||||||
|
|
||||||
private String executionName;
|
private String executionName;
|
||||||
|
@ -24,7 +24,6 @@ public class ZtProjectstory implements Serializable {
|
|||||||
|
|
||||||
private Integer product;
|
private Integer product;
|
||||||
|
|
||||||
private Integer execution;
|
|
||||||
|
|
||||||
private Integer branch;
|
private Integer branch;
|
||||||
|
|
||||||
@ -34,6 +33,9 @@ public class ZtProjectstory implements Serializable {
|
|||||||
|
|
||||||
@TableField("`order`")
|
@TableField("`order`")
|
||||||
private Integer order;
|
private Integer order;
|
||||||
|
//execution
|
||||||
|
@TableField("`type`")
|
||||||
|
private String type;
|
||||||
|
// private Integer execution;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
41
src/main/java/com/sa/zentao/enums/ProjectTypeEnums.java
Normal file
41
src/main/java/com/sa/zentao/enums/ProjectTypeEnums.java
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package com.sa.zentao.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
|
||||||
|
public enum ProjectTypeEnums {
|
||||||
|
|
||||||
|
//产品集
|
||||||
|
program(1,"program"),
|
||||||
|
//项目
|
||||||
|
project(2, "project"),
|
||||||
|
//执行
|
||||||
|
execution(3, "execution"),
|
||||||
|
;
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
private int code;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
private ProjectTypeEnums(int code, String value) {
|
||||||
|
this.code = code;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ProjectTypeEnums transferType(Integer code){
|
||||||
|
ProjectTypeEnums[] values = values();
|
||||||
|
for (ProjectTypeEnums v:values ) {
|
||||||
|
if(v.code==code){
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -101,5 +101,5 @@ public interface IZtProjectService extends IService<ZtProject> {
|
|||||||
|
|
||||||
List<ZtProject> execListByProject(Integer project);
|
List<ZtProject> execListByProject(Integer project);
|
||||||
|
|
||||||
void removeExecutionStory(Integer id);
|
void removeExecutionStory(Integer id,Integer execution);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.sa.zentao.service;
|
|||||||
|
|
||||||
import com.sa.zentao.entity.ZtProjectstory;
|
import com.sa.zentao.entity.ZtProjectstory;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.sa.zentao.enums.ProjectTypeEnums;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -16,4 +17,10 @@ import java.util.List;
|
|||||||
public interface IZtProjectstoryService extends IService<ZtProjectstory> {
|
public interface IZtProjectstoryService extends IService<ZtProjectstory> {
|
||||||
|
|
||||||
List<ZtProjectstory> storyListPrd(Integer id);
|
List<ZtProjectstory> storyListPrd(Integer id);
|
||||||
|
//根据 项目 迭代 查找需求
|
||||||
|
List<ZtProjectstory> projectStoryList(List<Integer> projectIds, ProjectTypeEnums type);
|
||||||
|
//根据需求查找项目 或者迭代
|
||||||
|
List<ZtProjectstory> projectListByStory(List<Integer> storyIds, ProjectTypeEnums type);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import com.sa.zentao.dao.ZtStoryDTO;
|
|||||||
import com.sa.zentao.entity.*;
|
import com.sa.zentao.entity.*;
|
||||||
import com.sa.zentao.enums.ActionStatus;
|
import com.sa.zentao.enums.ActionStatus;
|
||||||
import com.sa.zentao.enums.ActionType;
|
import com.sa.zentao.enums.ActionType;
|
||||||
|
import com.sa.zentao.enums.ProjectTypeEnums;
|
||||||
import com.sa.zentao.enums.UserType;
|
import com.sa.zentao.enums.UserType;
|
||||||
import com.sa.zentao.mapper.ZtProjectMapper;
|
import com.sa.zentao.mapper.ZtProjectMapper;
|
||||||
import com.sa.zentao.qo.ZtProjectQo;
|
import com.sa.zentao.qo.ZtProjectQo;
|
||||||
@ -795,13 +796,12 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
|
|
||||||
Integer excludeId = dto.getExcludeId();
|
Integer excludeId = dto.getExcludeId();
|
||||||
|
|
||||||
ZtProject ztProject = this.baseMapper.selectById(excludeId);
|
|
||||||
|
|
||||||
|
|
||||||
List<ZtProjectstory> syncStoryList = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>()
|
List<ZtProjectstory> syncStoryList = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>()
|
||||||
.lambda().ne(ZtProjectstory::getExecution, 0)
|
.lambda().ne(ZtProjectstory::getProject, excludeId)
|
||||||
.in(ZtProjectstory::getStory, storyIds)
|
.in(ZtProjectstory::getStory, storyIds)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(syncStoryList)){
|
if(!CollectionUtils.isEmpty(syncStoryList)){
|
||||||
throw new BusinessException("当前已关联请刷新");
|
throw new BusinessException("当前已关联请刷新");
|
||||||
}
|
}
|
||||||
@ -810,7 +810,8 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
for (Integer sId:storyIds) {
|
for (Integer sId:storyIds) {
|
||||||
ZtProjectstory ztProjectstory = new ZtProjectstory();
|
ZtProjectstory ztProjectstory = new ZtProjectstory();
|
||||||
ztProjectstory.setStory(sId);
|
ztProjectstory.setStory(sId);
|
||||||
ztProjectstory.setExecution(excludeId);
|
ztProjectstory.setProject(excludeId);
|
||||||
|
ztProjectstory.setType(ProjectTypeEnums.execution.getValue());
|
||||||
saveList.add(ztProjectstory);
|
saveList.add(ztProjectstory);
|
||||||
order+=5;
|
order+=5;
|
||||||
}
|
}
|
||||||
@ -1237,17 +1238,17 @@ public class ZtProjectServiceImpl extends ServiceImpl<ZtProjectMapper, ZtProject
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeExecutionStory(Integer id) {
|
public void removeExecutionStory(Integer id,Integer execution) {
|
||||||
|
|
||||||
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
||||||
.eq(ZtProjectstory::getStory, id).ne(ZtProjectstory::getExecution, 0));
|
.eq(ZtProjectstory::getStory, id).eq(ZtProjectstory::getProject, execution));
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
|
||||||
//删除迭代
|
//删除迭代
|
||||||
this.projectstoryService.remove(new QueryWrapper<ZtProjectstory>().lambda()
|
this.projectstoryService.remove(new QueryWrapper<ZtProjectstory>().lambda()
|
||||||
.eq(ZtProjectstory::getStory,id).ne(ZtProjectstory::getExecution,0));
|
.eq(ZtProjectstory::getStory,id).eq(ZtProjectstory::getProject,execution));
|
||||||
//删除看板
|
//删除看板
|
||||||
this.kanbanlaneService.removeExecutionStory(list.get(0).getExecution(),id);
|
this.kanbanlaneService.removeExecutionStory(execution,id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
package com.sa.zentao.service.impl;
|
package com.sa.zentao.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.sa.zentao.entity.ZtProjectstory;
|
import com.sa.zentao.entity.ZtProjectstory;
|
||||||
|
import com.sa.zentao.enums.ProjectTypeEnums;
|
||||||
import com.sa.zentao.mapper.ZtProjectstoryMapper;
|
import com.sa.zentao.mapper.ZtProjectstoryMapper;
|
||||||
import com.sa.zentao.service.IZtProjectstoryService;
|
import com.sa.zentao.service.IZtProjectstoryService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,4 +27,28 @@ public class ZtProjectstoryServiceImpl extends ServiceImpl<ZtProjectstoryMapper,
|
|||||||
public List<ZtProjectstory> storyListPrd(Integer id) {
|
public List<ZtProjectstory> storyListPrd(Integer id) {
|
||||||
return this.baseMapper.storyListPrd(id);
|
return this.baseMapper.storyListPrd(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ZtProjectstory> projectStoryList(List<Integer> projectIds, ProjectTypeEnums type) {
|
||||||
|
if(CollectionUtils.isEmpty(projectIds)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
List<ZtProjectstory> ztProjectstories = this.baseMapper.selectList(new QueryWrapper<ZtProjectstory>().lambda().in(ZtProjectstory::getProject, projectIds)
|
||||||
|
.eq(ZtProjectstory::getType, type.getValue())
|
||||||
|
);
|
||||||
|
|
||||||
|
return ztProjectstories;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ZtProjectstory> projectListByStory(List<Integer> storyIds, ProjectTypeEnums type) {
|
||||||
|
if(CollectionUtils.isEmpty(storyIds)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
List<ZtProjectstory> ztProjectstories = this.baseMapper.selectList(new QueryWrapper<ZtProjectstory>().lambda().in(ZtProjectstory::getStory, storyIds)
|
||||||
|
.eq(ZtProjectstory::getType, type.getValue())
|
||||||
|
);
|
||||||
|
|
||||||
|
return ztProjectstories;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.github.pagehelper.PageInfo;
|
|||||||
import com.sa.zentao.conf.RiskUserThreadLocal;
|
import com.sa.zentao.conf.RiskUserThreadLocal;
|
||||||
import com.sa.zentao.dao.*;
|
import com.sa.zentao.dao.*;
|
||||||
import com.sa.zentao.entity.*;
|
import com.sa.zentao.entity.*;
|
||||||
|
import com.sa.zentao.enums.ProjectTypeEnums;
|
||||||
import com.sa.zentao.enums.StoryStageEnums;
|
import com.sa.zentao.enums.StoryStageEnums;
|
||||||
import com.sa.zentao.mapper.ZtReleaseMapper;
|
import com.sa.zentao.mapper.ZtReleaseMapper;
|
||||||
import com.sa.zentao.qo.ZtReleaseQo;
|
import com.sa.zentao.qo.ZtReleaseQo;
|
||||||
@ -64,7 +65,9 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
|||||||
List<String> execIds = new ArrayList<String>(Arrays.asList(execStr.split(",")));
|
List<String> execIds = new ArrayList<String>(Arrays.asList(execStr.split(",")));
|
||||||
|
|
||||||
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
||||||
.in(ZtProjectstory::getExecution, execIds));
|
.in(ZtProjectstory::getProject, execIds)
|
||||||
|
.eq(ZtProjectstory::getType, ProjectTypeEnums.execution.getValue())
|
||||||
|
);
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
List<ZtStory> sList = this.storyService.list(new QueryWrapper<ZtStory>()
|
List<ZtStory> sList = this.storyService.list(new QueryWrapper<ZtStory>()
|
||||||
.lambda().eq(ZtStory::getStatus, "active")
|
.lambda().eq(ZtStory::getStatus, "active")
|
||||||
@ -326,13 +329,13 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
|||||||
return new PageInfo<ZtStoryDTO>();
|
return new PageInfo<ZtStoryDTO>();
|
||||||
}
|
}
|
||||||
//迭代查找所有需求
|
//迭代查找所有需求
|
||||||
List<ZtProjectstory> pStorys = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda().in(ZtProjectstory::getExecution,
|
List<ZtProjectstory> execStorys = projectstoryService.projectStoryList(execList.stream().map(o -> o.getExecution()).collect(Collectors.toList()),ProjectTypeEnums.execution);
|
||||||
execList.stream().map(o -> o.getExecution()).collect(Collectors.toList())));
|
|
||||||
if(CollectionUtils.isEmpty(pStorys)){
|
if(CollectionUtils.isEmpty(execStorys)){
|
||||||
return new PageInfo<ZtStoryDTO>();
|
return new PageInfo<ZtStoryDTO>();
|
||||||
}
|
}
|
||||||
//过滤掉已关联的迭代需求
|
//过滤掉已关联的迭代需求
|
||||||
List<Integer> storyIdList = pStorys.stream().map(o -> o.getStory()).collect(Collectors.toList());
|
List<Integer> storyIdList = execStorys.stream().map(o -> o.getStory()).collect(Collectors.toList());
|
||||||
|
|
||||||
List<ZtRelease> ztReleases = this.baseMapper.selectList(new QueryWrapper<ZtRelease>().lambda().eq(ZtRelease::getProject, project));
|
List<ZtRelease> ztReleases = this.baseMapper.selectList(new QueryWrapper<ZtRelease>().lambda().eq(ZtRelease::getProject, project));
|
||||||
|
|
||||||
@ -343,7 +346,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
|||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
List<Integer> fIds = list.stream().map(o -> o.getObjectId()).collect(Collectors.toList());
|
List<Integer> fIds = list.stream().map(o -> o.getObjectId()).collect(Collectors.toList());
|
||||||
|
|
||||||
Iterator<ZtProjectstory> iterator = pStorys.iterator();
|
Iterator<ZtProjectstory> iterator = execStorys.iterator();
|
||||||
while (iterator.hasNext()){
|
while (iterator.hasNext()){
|
||||||
ZtProjectstory next = iterator.next();
|
ZtProjectstory next = iterator.next();
|
||||||
if(fIds.contains(next.getStory())){
|
if(fIds.contains(next.getStory())){
|
||||||
@ -351,7 +354,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl<ZtReleaseMapper, ZtRelease
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qo.setStoryList(pStorys.stream().map(o->o.getStory()).collect(Collectors.toList()));
|
qo.setStoryList(execStorys.stream().map(o->o.getStory()).collect(Collectors.toList()));
|
||||||
Page<ZtReleaseDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
Page<ZtReleaseDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
List<ZtStoryDTO> storyList = this.releaseDetailsService.storyPageList(qo);
|
List<ZtStoryDTO> storyList = this.releaseDetailsService.storyPageList(qo);
|
||||||
|
|
||||||
|
@ -321,18 +321,33 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
}
|
}
|
||||||
//老的迭代
|
//老的迭代
|
||||||
List<ZtProjectstory> pList = projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, ztStory.getId())
|
List<ZtProjectstory> pList = projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, ztStory.getId())
|
||||||
.ne(ZtProjectstory::getExecution, 0)
|
.eq(ZtProjectstory::getType, ProjectTypeEnums.execution.getValue())
|
||||||
);
|
);
|
||||||
|
|
||||||
Integer execution = dto.getExecution();
|
//如果关联了迭代 执行
|
||||||
if(execution!=null&&execution!=0){
|
List<Integer> executions = dto.getExecutions();
|
||||||
if(!CollectionUtils.isEmpty(pList)&&pList.get(0).getExecution().intValue()!=execution.intValue()){
|
if(!CollectionUtils.isEmpty(executions)){
|
||||||
List<ZtTask> list = this.taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, ztStory.getId()));
|
List<Integer> oldExecIds = pList.stream().map(o -> o.getProject()).collect(Collectors.toList());
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
//查找需求管理的项目 需求只会被项目关联一次
|
||||||
throw new BusinessException("当前任务已开始无法更换迭代");
|
List<ZtProjectstory> projectList = this.projectstoryService.projectListByStory(Arrays.asList(id), ProjectTypeEnums.project);
|
||||||
|
|
||||||
|
List execList=new ArrayList();
|
||||||
|
for (Integer exec:executions) {
|
||||||
|
if(!oldExecIds.contains(exec)){
|
||||||
|
//新增迭代关联
|
||||||
|
execList.add(exec);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
executionBindStory(ztStory.getId(),projectList.get(0).getProject(),execList);
|
||||||
|
execList.clear();
|
||||||
|
for (Integer oldExec:oldExecIds) {
|
||||||
|
if(!executions.contains(oldExec)){
|
||||||
|
//删除迭代关联
|
||||||
|
execList.add(oldExec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
executionUnBindStory(ztStory.getId(),projectList.get(0).getProject(),execList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -346,7 +361,6 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
this.productService.updateById(product);
|
this.productService.updateById(product);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!StringUtils.isEmpty(dto.getFileUrl())){
|
|
||||||
ZtStoryspec spec = this.storyspecService.getOne(new QueryWrapper<ZtStoryspec>().lambda().eq(ZtStoryspec::getStory, id));
|
ZtStoryspec spec = this.storyspecService.getOne(new QueryWrapper<ZtStoryspec>().lambda().eq(ZtStoryspec::getStory, id));
|
||||||
if(spec==null){
|
if(spec==null){
|
||||||
spec = new ZtStoryspec();
|
spec = new ZtStoryspec();
|
||||||
@ -358,11 +372,14 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
spec.setFiles(dto.getFileUrl());
|
spec.setFiles(dto.getFileUrl());
|
||||||
storyspecService.save(spec);
|
storyspecService.save(spec);
|
||||||
}else{
|
}else{
|
||||||
|
spec.setVersion(1);
|
||||||
|
spec.setTitle(ztStory.getTitle());
|
||||||
|
spec.setSpec(dto.getSpec());
|
||||||
|
spec.setVerify(dto.getVerify());
|
||||||
spec.setFiles(dto.getFileUrl());
|
spec.setFiles(dto.getFileUrl());
|
||||||
storyspecService.update(new UpdateWrapper<ZtStoryspec>().lambda().eq(ZtStoryspec::getStory,id).set(ZtStoryspec::getFiles,dto.getFileUrl())
|
storyspecService.update(new UpdateWrapper<ZtStoryspec>().lambda().eq(ZtStoryspec::getStory,id).set(ZtStoryspec::getFiles,dto.getFileUrl())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -406,60 +423,60 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(dto.getExecution()!=null&&dto.getExecution()!=0){
|
// if(dto.getExecution()!=null&&dto.getExecution()!=0){
|
||||||
//1.没有绑定 解绑
|
// //1.没有绑定 解绑
|
||||||
ZtProjectstory execStory = this.projectstoryService.getOne(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, ztStory.getId())
|
// ZtProjectstory execStory = this.projectstoryService.getOne(new QueryWrapper<ZtProjectstory>().lambda().eq(ZtProjectstory::getStory, ztStory.getId())
|
||||||
.ne(ZtProjectstory::getExecution, 0));
|
// .ne(ZtProjectstory::getExecution, 0));
|
||||||
//如果没有关联过迭代 去关联 第一次
|
// //如果没有关联过迭代 去关联 第一次
|
||||||
if(execStory==null){
|
// if(execStory==null){
|
||||||
//如果是产品型需求 加项目 加迭代 如果是项目型产品 加迭代
|
// //如果是产品型需求 加项目 加迭代 如果是项目型产品 加迭代
|
||||||
|
//
|
||||||
if (ztStory.getProduct() != null&&ztStory.getProduct()!=0) {
|
// if (ztStory.getProduct() != null&&ztStory.getProduct()!=0) {
|
||||||
List<ZtExecutionproject> execlist = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
// List<ZtExecutionproject> execlist = this.executionprojectService.list(new QueryWrapper<ZtExecutionproject>().lambda()
|
||||||
.eq(ZtExecutionproject::getExecution, dto.getExecution()));
|
// .eq(ZtExecutionproject::getExecution, dto.getExecution()));
|
||||||
if(CollectionUtils.isEmpty(execlist)){
|
// if(CollectionUtils.isEmpty(execlist)){
|
||||||
List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>()
|
// List<ZtProjectproduct> list = this.projectproductService.list(new QueryWrapper<ZtProjectproduct>()
|
||||||
.lambda().eq(ZtProjectproduct::getProduct, ztStory.getProduct()));
|
// .lambda().eq(ZtProjectproduct::getProduct, ztStory.getProduct()));
|
||||||
ZtProjectproduct ztProjectproduct = list.get(0);
|
// ZtProjectproduct ztProjectproduct = list.get(0);
|
||||||
|
//
|
||||||
|
//
|
||||||
ZtProjectstory ztProjectstory = new ZtProjectstory();
|
// ZtProjectstory ztProjectstory = new ZtProjectstory();
|
||||||
ztProjectstory.setOrder(1);
|
// ztProjectstory.setOrder(1);
|
||||||
ztProjectstory.setStory(ztStory.getId());
|
// ztProjectstory.setStory(ztStory.getId());
|
||||||
ztProjectstory.setProject(ztProjectproduct.getProject());
|
// ztProjectstory.setProject(ztProjectproduct.getProject());
|
||||||
this.projectstoryService.save(ztProjectstory);
|
// this.projectstoryService.save(ztProjectstory);
|
||||||
//添加执行
|
// //添加执行
|
||||||
}else{
|
// }else{
|
||||||
|
//
|
||||||
ZtProjectstory ztProjectstory = new ZtProjectstory();
|
// ZtProjectstory ztProjectstory = new ZtProjectstory();
|
||||||
ztProjectstory.setOrder(1);
|
// ztProjectstory.setOrder(1);
|
||||||
ztProjectstory.setStory(ztStory.getId());
|
// ztProjectstory.setStory(ztStory.getId());
|
||||||
ztProjectstory.setProject(execlist.get(0).getProject());
|
// ztProjectstory.setProject(execlist.get(0).getProject());
|
||||||
this.projectstoryService.save(ztProjectstory);
|
// this.projectstoryService.save(ztProjectstory);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
ZtProjectDTO d=new ZtProjectDTO();
|
// ZtProjectDTO d=new ZtProjectDTO();
|
||||||
d.setExcludeId(dto.getExecution());
|
// d.setExcludeId(dto.getExecution());
|
||||||
d.setStoryIds(new ArrayList<>(){{add(ztStory.getId());}});
|
// d.setStoryIds(new ArrayList<>(){{add(ztStory.getId());}});
|
||||||
projectService.executionSyncStory(d);
|
// projectService.executionSyncStory(d);
|
||||||
}
|
// }
|
||||||
else if(dto.getExecution().intValue()==pList.get(0).getExecution().intValue()){
|
// else if(dto.getExecution().intValue()==pList.get(0).getExecution().intValue()){
|
||||||
//编辑没动 不用管
|
// //编辑没动 不用管
|
||||||
}else{
|
// }else{
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
//2.绑定了 切换
|
// //2.绑定了 切换
|
||||||
//1. 删除projectStory 迭代的 删除看板
|
// //1. 删除projectStory 迭代的 删除看板
|
||||||
projectService.removeExecutionStory(ztStory.getId());
|
// projectService.removeExecutionStory(ztStory.getId(),dto.getExecution());
|
||||||
//2. 新增
|
// //2. 新增
|
||||||
ZtProjectDTO d=new ZtProjectDTO();
|
// ZtProjectDTO d=new ZtProjectDTO();
|
||||||
d.setExcludeId(dto.getExecution());
|
// d.setExcludeId(dto.getExecution());
|
||||||
d.setStoryIds(new ArrayList<>(){{add(ztStory.getId());}});
|
// d.setStoryIds(new ArrayList<>(){{add(ztStory.getId());}});
|
||||||
projectService.executionSyncStory(d);
|
// projectService.executionSyncStory(d);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
// else{
|
// else{
|
||||||
// List<ZtTask> list = this.taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, ztStory.getId()));
|
// List<ZtTask> list = this.taskService.list(new QueryWrapper<ZtTask>().lambda().eq(ZtTask::getStory, ztStory.getId()));
|
||||||
// if(!CollectionUtils.isEmpty(list)){
|
// if(!CollectionUtils.isEmpty(list)){
|
||||||
@ -471,6 +488,52 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executionBindStory(Integer storyId,Integer project,List<Integer> execList){
|
||||||
|
if(CollectionUtils.isEmpty(execList)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
||||||
|
.eq(ZtProjectstory::getProject, project)
|
||||||
|
.eq(ZtProjectstory::getStory, storyId)
|
||||||
|
);
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
ZtProjectDTO d=new ZtProjectDTO();
|
||||||
|
d.setStoryIds(new ArrayList<>(Arrays.asList(storyId)));
|
||||||
|
d.setProject(project);
|
||||||
|
this.projectService.projectSyncStory(d);
|
||||||
|
}
|
||||||
|
for (Integer execId:execList) {
|
||||||
|
ZtProjectDTO d=new ZtProjectDTO();
|
||||||
|
d.setStoryIds(new ArrayList<>(Arrays.asList(storyId)));
|
||||||
|
d.setExcludeId(execId);
|
||||||
|
this.projectService.executionSyncStory(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void executionUnBindStory(Integer storyId,Integer project,List<Integer> execList){
|
||||||
|
if(CollectionUtils.isEmpty(execList)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ZtProjectstory> list = this.projectstoryService.list(new QueryWrapper<ZtProjectstory>().lambda()
|
||||||
|
.eq(ZtProjectstory::getProject, project)
|
||||||
|
.eq(ZtProjectstory::getStory, storyId)
|
||||||
|
);
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
ZtProjectDTO d=new ZtProjectDTO();
|
||||||
|
d.setStoryIds(new ArrayList<>(Arrays.asList(storyId)));
|
||||||
|
d.setProject(project);
|
||||||
|
this.projectService.projectSyncStory(d);
|
||||||
|
}
|
||||||
|
for (Integer execId:execList) {
|
||||||
|
ZtProjectDTO d=new ZtProjectDTO();
|
||||||
|
d.setStoryIds(new ArrayList<>(Arrays.asList(storyId)));
|
||||||
|
d.setExcludeId(execId);
|
||||||
|
this.projectService.executionSyncStory(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRemark(ZtStoryDTO dto) {
|
public void addRemark(ZtStoryDTO dto) {
|
||||||
ZtStory ztStory = this.baseMapper.selectById(dto.getId());
|
ZtStory ztStory = this.baseMapper.selectById(dto.getId());
|
||||||
|
@ -196,7 +196,8 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|||||||
if(!CollectionUtils.isEmpty(projectList)){
|
if(!CollectionUtils.isEmpty(projectList)){
|
||||||
projectId=projectList.get(0).getProject();
|
projectId=projectList.get(0).getProject();
|
||||||
}
|
}
|
||||||
List<ZtProjectstory> executionList = list.stream().filter(o -> o.getProject() != null && o.getProject() != 0).collect(Collectors.toList());
|
List<ZtProjectstory> executionList = list.stream().filter(o -> o.getProject() != null && o.getProject() != 0)
|
||||||
|
.collect(Collectors.toList());
|
||||||
if(!CollectionUtils.isEmpty(executionList)){
|
if(!CollectionUtils.isEmpty(executionList)){
|
||||||
execution=executionList.get(0).getExecution();
|
execution=executionList.get(0).getExecution();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user