Commit 354b5c59 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

用户无部门创建任务

See merge request !161
parents c801ed95 01489bdc
......@@ -116,7 +116,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
Task task = new Task();
task.setTaskInitiatorId(loginUser.getUserId());
task.setTaskInitiator(initiator.getNickName());
if (initiator.getDept().getDeptName() != null) {
if (initiator.getDept() != null) {
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
}
task.setTaskStatus(Task.TASK_STATUS_NEW);
......@@ -690,7 +690,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
SystemReviewTask task = new SystemReviewTask()
.setTaskNo(request.getTaskNo())
.setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(SystemReviewTask.STATUS_NEW)
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
......@@ -700,6 +699,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
.setStandardNo(standard.getStandardNo())
.setFile(standard.getFile());
if (initiator.getDept() != null) {
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
}
systemReviewTaskService.save(task);
return task.getId();
}
......@@ -712,7 +715,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
CarReviewTask task = new CarReviewTask()
.setTaskNo(request.getTaskNo())
.setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(CarReviewTask.TASK_STATUS_NEW)
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
......@@ -722,6 +724,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
.setStandardNo(standard.getStandardNo())
.setFile(standard.getFile());
if (initiator.getDept() != null) {
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
}
carReviewTaskService.save(task);
return task.getId();
}
......
......@@ -10,6 +10,7 @@ import com.ruoyi.service.TaskState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.Objects;
@Component
......@@ -42,6 +43,10 @@ public abstract class TaskStateAdapter implements TaskState {
if (task.getPointer() + 1 <= task.getMaxPointer() ) {
task.setPointer(task.getPointer() + 1);
}
if (task.getTaskBeginTime() == null) {
task.setTaskBeginTime(new Date());
}
taskService.updateById(task);
}
......
......@@ -17,6 +17,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Objects;
......@@ -57,6 +58,7 @@ public class TaskStatePending extends TaskStateAdapter implements TaskState, Ini
task.setRunStatus(Task.RUN_STATUS_RUNNABLE);
} else {
task.setTaskStatus(Task.TASK_STATUS_FINISH);
task.setTaskEndTime(new Date());
task.setRunStatus(Task.RUN_STATUS_STATUS_RUNNING);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment