|
|
|
|
@@ -2,6 +2,7 @@ package com.sa.zentao.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
@@ -647,6 +648,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
|
throw new BusinessException("当前环境异常请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
this.baseMapper.insert(ztTask);
|
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
|
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getDevelPlanEndTime()))){
|
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
}
|
|
|
|
|
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getTestPlanEndTime()))){
|
|
|
|
|
ztStory.setTestPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
}
|
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
|
}
|
|
|
|
|
if ("wait".equals(ztTask.getStatus())) {
|
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
|
|
|
|
|
}
|
|
|
|
|
@@ -999,6 +1010,41 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
|
ztTask.setLasteditedby(RiskUserThreadLocal.get().getName());
|
|
|
|
|
ztTask.setLastediteddate(new Date());
|
|
|
|
|
this.baseMapper.updateById(ztTask);
|
|
|
|
|
|
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
|
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
|
|
|
|
|
//查找最大时间那个
|
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
|
.select(ZtTask::getDeadline)
|
|
|
|
|
.isNotNull(ZtTask::getDeadline)
|
|
|
|
|
.eq(ZtTask::getType, "devel")
|
|
|
|
|
.ne(ZtTask::getId, ztTask.getId())
|
|
|
|
|
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
|
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
|
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
|
}
|
|
|
|
|
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
|
|
|
|
|
//查找最大时间那个
|
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
|
.select(ZtTask::getDeadline)
|
|
|
|
|
.isNotNull(ZtTask::getDeadline)
|
|
|
|
|
.eq(ZtTask::getType, "test")
|
|
|
|
|
.ne(ZtTask::getId, ztTask.getId())
|
|
|
|
|
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
|
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
|
.set(ZtStory::getTestPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
|
|
|
|
|
|
|
|
|
|
//添加action
|
|
|
|
|
@@ -1018,8 +1064,6 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@@ -1046,7 +1090,37 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
|
//添加action
|
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.QX, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), ztTask.getProject(), ztTask.getExecution(),
|
|
|
|
|
RiskUserThreadLocal.get().getName(), dto.getDesc(), null);
|
|
|
|
|
|
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
|
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
|
|
|
|
|
//查找最大时间那个
|
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
|
.select(ZtTask::getDeadline)
|
|
|
|
|
.isNotNull(ZtTask::getDeadline)
|
|
|
|
|
.eq(ZtTask::getType, "devel")
|
|
|
|
|
.ne(ZtTask::getId, ztTask.getId())
|
|
|
|
|
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
|
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
|
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
|
}
|
|
|
|
|
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
|
|
|
|
|
//查找最大时间那个
|
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
|
.select(ZtTask::getDeadline)
|
|
|
|
|
.isNotNull(ZtTask::getDeadline)
|
|
|
|
|
.eq(ZtTask::getType, "test")
|
|
|
|
|
.ne(ZtTask::getId, ztTask.getId())
|
|
|
|
|
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
|
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
|
.set(ZtStory::getTestPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (ztTask.getExecution() != null && ztTask.getExecution() != 0) {
|
|
|
|
|
if (StringUtils.isEmpty(dto.getTabType())) {
|
|
|
|
|
|
|
|
|
|
@@ -1138,6 +1212,18 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
|
ztTask.setProduct(ztProjectproduct.getProduct());
|
|
|
|
|
}
|
|
|
|
|
saveList.add(ztTask);
|
|
|
|
|
|
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
|
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getDevelPlanEndTime().getTime()
|
|
|
|
|
)){
|
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
}
|
|
|
|
|
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getTestPlanEndTime().getTime())){
|
|
|
|
|
ztStory.setTestPlanEndTime(ztTask.getDeadline());
|
|
|
|
|
}
|
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|