|
|
|
@@ -518,7 +518,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
|
|
|
|
List<String> userIds = list.stream().map(o -> o.getFinishedby()).collect(Collectors.toList());
|
|
|
|
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
|
|
|
|
userIds.addAll(list.stream().map(o -> o.getAssignedTo()).collect(Collectors.toList()));
|
|
|
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
|
|
|
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
|
|
|
|
Date d = new Date();
|
|
|
|
Date d=new Date();
|
|
|
|
for (ZtTaskDTO task : list) {
|
|
|
|
for (ZtTaskDTO task : list) {
|
|
|
|
ZtUser ztUser = userMap.get(task.getFinishedby());
|
|
|
|
ZtUser ztUser = userMap.get(task.getFinishedby());
|
|
|
|
if (ztUser != null) {
|
|
|
|
if (ztUser != null) {
|
|
|
|
@@ -531,16 +531,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
if (task.getDeadline() != null) {
|
|
|
|
if (task.getDeadline() != null) {
|
|
|
|
task.setDeadline(DateUtils.getDayLast(task.getDeadline()));
|
|
|
|
task.setDeadline(DateUtils.getDayLast(task.getDeadline()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (task.getFinishedDate() != null) {
|
|
|
|
if(task.getFinishedDate()!=null){
|
|
|
|
if (task.getFinishedDate().getTime() > DateUtils.getDayLast(task.getDeadline()).getTime()) {
|
|
|
|
if(task.getFinishedDate().getTime()>DateUtils.getDayLast(task.getDeadline()).getTime()){
|
|
|
|
task.setDelayFlag(1);
|
|
|
|
task.setDelayFlag(1);
|
|
|
|
} else {
|
|
|
|
}else{
|
|
|
|
task.setDelayFlag(2);
|
|
|
|
task.setDelayFlag(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
}else{
|
|
|
|
if (d.getTime() > DateUtils.getDayLast(task.getDeadline()).getTime()) {
|
|
|
|
if(d.getTime()>DateUtils.getDayLast(task.getDeadline()).getTime()){
|
|
|
|
task.setDelayFlag(1);
|
|
|
|
task.setDelayFlag(1);
|
|
|
|
} else {
|
|
|
|
}else{
|
|
|
|
task.setDelayFlag(2);
|
|
|
|
task.setDelayFlag(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -644,16 +644,16 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
ztTask.setEstimate(ztTask.getUseTime().floatValue());
|
|
|
|
ztTask.setEstimate(ztTask.getUseTime().floatValue());
|
|
|
|
ztTask.setLeft(ztTask.getUseTime().floatValue());
|
|
|
|
ztTask.setLeft(ztTask.getUseTime().floatValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getDeadline() == null) {
|
|
|
|
if(ztTask.getDeadline()==null){
|
|
|
|
throw new BusinessException("当前环境异常请联系管理员");
|
|
|
|
throw new BusinessException("当前环境异常请联系管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.baseMapper.insert(ztTask);
|
|
|
|
this.baseMapper.insert(ztTask);
|
|
|
|
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
if (ztTask.getType().equals("devel") && (ztStory.getDevelPlanEndTime() == null || ztTask.getDeadline().after(ztStory.getDevelPlanEndTime()))) {
|
|
|
|
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getDevelPlanEndTime()))){
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getType().equals("test") && (ztStory.getTestPlanEndTime() == null || ztTask.getDeadline().after(ztStory.getTestPlanEndTime()))) {
|
|
|
|
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().after(ztStory.getTestPlanEndTime()))){
|
|
|
|
ztStory.setTestPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setTestPlanEndTime(ztTask.getDeadline());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
@@ -703,7 +703,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public void modifyTask(ZtTaskDTO dto) {
|
|
|
|
public void modifyTask(ZtTaskDTO dto) {
|
|
|
|
if (dto.getDeadline() == null || dto.getEstStarted() == null) {
|
|
|
|
if(dto.getDeadline()==null||dto.getEstStarted()==null){
|
|
|
|
throw new BusinessException("请录入开始结束日期");
|
|
|
|
throw new BusinessException("请录入开始结束日期");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ZtTask ztTask = this.baseMapper.selectById(dto.getId());
|
|
|
|
ZtTask ztTask = this.baseMapper.selectById(dto.getId());
|
|
|
|
@@ -850,7 +850,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtils.notEqual(oldExecution, newExecution)) {
|
|
|
|
if(ObjectUtils.notEqual(oldExecution,newExecution)){
|
|
|
|
//迭代切换了
|
|
|
|
//迭代切换了
|
|
|
|
this.kanbanlaneService.removeKanbanCell(oldExecution, ztTask.getId(), KanbanCellType.TASK);
|
|
|
|
this.kanbanlaneService.removeKanbanCell(oldExecution, ztTask.getId(), KanbanCellType.TASK);
|
|
|
|
//添加新的看板迭代
|
|
|
|
//添加新的看板迭代
|
|
|
|
@@ -927,26 +927,26 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
|
|
|
|
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.KS, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.KS, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
RiskUserThreadLocal.get().getName(), "", null);
|
|
|
|
RiskUserThreadLocal.get().getName(), "", null);
|
|
|
|
if ("done".equals(ztTask.getStatus())) {
|
|
|
|
if("done".equals(ztTask.getStatus())){
|
|
|
|
String finishBy = StringUtils.isEmpty(ztTask.getFinishedby()) ? RiskUserThreadLocal.get().getName() : ztTask.getFinishedby();
|
|
|
|
String finishBy = StringUtils.isEmpty(ztTask.getFinishedby())?RiskUserThreadLocal.get().getName():ztTask.getFinishedby();
|
|
|
|
//如果是测试任务 提交交付物
|
|
|
|
//如果是测试任务 提交交付物
|
|
|
|
if ("test".equals(ztTask.getType()) && !StringUtils.isEmpty(ztTask.getDeliverContent())) {
|
|
|
|
if("test".equals(ztTask.getType())&&!StringUtils.isEmpty(ztTask.getDeliverContent())){
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, ztTask.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
|
|
|
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, ztTask.getStory(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
|
|
|
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
//更新需求交付物
|
|
|
|
//更新需求交付物
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
if (ztStory != null) {
|
|
|
|
if(ztStory!=null){
|
|
|
|
ztStory.setDeliverContent(ztTask.getDeliverContent());
|
|
|
|
ztStory.setDeliverContent(ztTask.getDeliverContent());
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!StringUtils.isEmpty(dto.getRemark())) {
|
|
|
|
if(!StringUtils.isEmpty(dto.getRemark())){
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -1030,15 +1030,21 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
//添加action
|
|
|
|
//添加action
|
|
|
|
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
|
|
|
|
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
|
|
|
|
//如果是测试任务 提交交付物
|
|
|
|
//如果是测试任务 提交交付物
|
|
|
|
if ("test".equals(ztTask.getType()) && !StringUtils.isEmpty(ztTask.getDeliverContent())) {
|
|
|
|
if("test".equals(ztTask.getType())&&!StringUtils.isEmpty(ztTask.getDeliverContent())){
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
if (ztTask.getStory() != null && ztTask.getStory() != 0) {
|
|
|
|
if(ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, ztTask.getStory(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
//更新需求交付物
|
|
|
|
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
|
|
|
|
if(ztStory!=null){
|
|
|
|
|
|
|
|
ztStory.setDeliverContent(ztTask.getDeliverContent());
|
|
|
|
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
actionService.addAction(ActionType.XQ, ActionStatus.TJJFW, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getDeliverContent(), null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!StringUtils.isEmpty(dto.getRemark())) {
|
|
|
|
if(!StringUtils.isEmpty(dto.getRemark())){
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.TJBZ, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), projectproduct == null ? null : projectproduct.getProject(), ztTask.getExecution(),
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
|
|
|
|
StringUtils.isEmpty(finishBy) ? RiskUserThreadLocal.get().getName() : finishBy, dto.getRemark(), null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -1071,7 +1077,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), finishBy, TaskType.transferType(type), false);
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), finishBy, TaskType.transferType(type), false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getFeedback() != null && ztTask.getFeedback() != 0) {
|
|
|
|
if (ztTask.getFeedback() != null && ztTask.getFeedback() != 0) {
|
|
|
|
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(), ztTask.getFeedbackRemark());
|
|
|
|
this.storyFeedbackService.feedbackFinished(ztTask.getFeedback(),ztTask.getFeedbackRemark());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -1090,9 +1096,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
ztTask.setLastediteddate(new Date());
|
|
|
|
ztTask.setLastediteddate(new Date());
|
|
|
|
this.baseMapper.updateById(ztTask);
|
|
|
|
this.baseMapper.updateById(ztTask);
|
|
|
|
|
|
|
|
|
|
|
|
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
if (ztTask.getType().equals("devel") && ztStory.getDevelPlanEndTime() != null) {
|
|
|
|
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
|
|
|
|
//查找最大时间那个
|
|
|
|
//查找最大时间那个
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
@@ -1103,10 +1109,10 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
|
|
|
|
.in(ZtTask::getStatus, "pause", "done", "wait", "reviewing", "doing", "draft")
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.set(ZtStory::getDevelPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getType().equals("test") && ztStory.getTestPlanEndTime() != null) {
|
|
|
|
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
|
|
|
|
//查找最大时间那个
|
|
|
|
//查找最大时间那个
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
@@ -1118,11 +1124,12 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.set(ZtStory::getTestPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
.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()));
|
|
|
|
ZtProjectproduct projectproduct = projectproductService.getOne(new QueryWrapper<ZtProjectproduct>().lambda().eq(ZtProjectproduct::getProject, ztTask.getProject()));
|
|
|
|
|
|
|
|
|
|
|
|
//添加action
|
|
|
|
//添加action
|
|
|
|
@@ -1168,9 +1175,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
//添加action
|
|
|
|
//添加action
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.QX, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), ztTask.getProject(), ztTask.getExecution(),
|
|
|
|
actionService.addAction(ActionType.RW, ActionStatus.QX, dto.getId(), projectproduct == null ? null : projectproduct.getProduct().toString(), ztTask.getProject(), ztTask.getExecution(),
|
|
|
|
RiskUserThreadLocal.get().getName(), dto.getDesc(), null);
|
|
|
|
RiskUserThreadLocal.get().getName(), dto.getDesc(), null);
|
|
|
|
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
if (ztTask.getType().equals("devel") && ztStory.getDevelPlanEndTime() != null) {
|
|
|
|
if(ztTask.getType().equals("devel")&&ztStory.getDevelPlanEndTime()!=null){
|
|
|
|
//查找最大时间那个
|
|
|
|
//查找最大时间那个
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
@@ -1182,9 +1189,9 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.set(ZtStory::getDevelPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
.set(ZtStory::getDevelPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getType().equals("test") && ztStory.getTestPlanEndTime() != null) {
|
|
|
|
if(ztTask.getType().equals("test")&&ztStory.getTestPlanEndTime()!=null){
|
|
|
|
//查找最大时间那个
|
|
|
|
//查找最大时间那个
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
List<ZtTask> ztTasks = this.baseMapper.selectList(new QueryWrapper<ZtTask>().lambda()
|
|
|
|
@@ -1196,7 +1203,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
.eq(ZtTask::getStory, ztTask.getStory()).orderByDesc(ZtTask::getDeadline));
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
this.storyService.update(new UpdateWrapper<ZtStory>().lambda()
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.eq(ZtStory::getId, ztTask.getStory())
|
|
|
|
.set(ZtStory::getTestPlanEndTime, CollectionUtils.isEmpty(ztTasks) ? null : DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
.set(ZtStory::getTestPlanEndTime,CollectionUtils.isEmpty(ztTasks)?null:DateUtils.getDayLast(ztTasks.get(0).getDeadline())));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getExecution() != null && ztTask.getExecution() != 0) {
|
|
|
|
if (ztTask.getExecution() != null && ztTask.getExecution() != 0) {
|
|
|
|
@@ -1244,7 +1251,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
List<ZtTaskDTO> list = dto.getList();
|
|
|
|
List<ZtTaskDTO> list = dto.getList();
|
|
|
|
long nullDeadlineCount = list.stream().filter(o -> o.getDeadline() == null || o.getEstStarted() == null).count();
|
|
|
|
long nullDeadlineCount = list.stream().filter(o -> o.getDeadline() == null || o.getEstStarted() == null).count();
|
|
|
|
|
|
|
|
|
|
|
|
if (nullDeadlineCount > 0) {
|
|
|
|
if(nullDeadlineCount>0){
|
|
|
|
throw new BusinessException("请录入开始结束日期");
|
|
|
|
throw new BusinessException("请录入开始结束日期");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1291,13 +1298,13 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
}
|
|
|
|
}
|
|
|
|
saveList.add(ztTask);
|
|
|
|
saveList.add(ztTask);
|
|
|
|
|
|
|
|
|
|
|
|
if (ztTask.getDeadline() != null && ztTask.getStory() != null && ztTask.getStory() != 0) {
|
|
|
|
if(ztTask.getDeadline()!=null&&ztTask.getStory()!=null&&ztTask.getStory()!=0){
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
ZtStory ztStory = this.storyService.getById(ztTask.getStory());
|
|
|
|
if (ztTask.getType().equals("devel") && (ztStory.getDevelPlanEndTime() == null || ztTask.getDeadline().getTime() >= ztStory.getDevelPlanEndTime().getTime()
|
|
|
|
if(ztTask.getType().equals("devel")&&(ztStory.getDevelPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getDevelPlanEndTime().getTime()
|
|
|
|
)) {
|
|
|
|
)){
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setDevelPlanEndTime(ztTask.getDeadline());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ztTask.getType().equals("test") && (ztStory.getTestPlanEndTime() == null || ztTask.getDeadline().getTime() >= ztStory.getTestPlanEndTime().getTime())) {
|
|
|
|
if(ztTask.getType().equals("test")&&(ztStory.getTestPlanEndTime()==null||ztTask.getDeadline().getTime()>=ztStory.getTestPlanEndTime().getTime())){
|
|
|
|
ztStory.setTestPlanEndTime(ztTask.getDeadline());
|
|
|
|
ztStory.setTestPlanEndTime(ztTask.getDeadline());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
this.storyService.updateById(ztStory);
|
|
|
|
@@ -1312,7 +1319,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
|
|
|
|
this.storyService.taskFinishChangeStatus(ztTask.getStory(), null, TaskType.transferType(ztTask.getType()), false);
|
|
|
|
taskSendZpMessage(ztTask.getId(), null, ztTask.getAssignedTo());
|
|
|
|
taskSendZpMessage(ztTask.getId(), null, ztTask.getAssignedTo());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
taskSendPsMessage(ztTask.getId(), ztProject.getPm(), ztTask.getOpenedby());
|
|
|
|
taskSendPsMessage(ztTask.getId(), ztProject.getPm(),ztTask.getOpenedby());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|