Commit 6db5389f authored by 王飞's avatar 王飞

Merge branch 'wangdingyi' into 'dev'

编辑暂存任务&创建任务

See merge request !129
parents 8f3c0eda 726a2fdf
...@@ -18,7 +18,7 @@ public interface TaskService extends IService<Task> { ...@@ -18,7 +18,7 @@ public interface TaskService extends IService<Task> {
*/ */
List<Task> findList(TaskListRequest request); List<Task> findList(TaskListRequest request);
void createTask(TaskCreateRequest request); void createTask(TaskCreateRequest request,Long userId);
/** /**
* 查询进行中的任务 * 查询进行中的任务
......
...@@ -92,7 +92,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -92,7 +92,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
} }
@Override @Override
public void createTask(TaskCreateRequest request) { public void createTask(TaskCreateRequest request,Long userId) {
// 构建任务创建者 // 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
...@@ -167,6 +167,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -167,6 +167,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
taskStateFacade.doCreate(task, request.getTaskList()); taskStateFacade.doCreate(task, request.getTaskList());
TaskGetInfoResponse temporaryStorageTask = taskService.getByUserId(userId);
taskMapper.deleteById(temporaryStorageTask.getId());
} }
@Override @Override
...@@ -492,7 +495,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -492,7 +495,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 保存关联的整车样品信息 // 保存关联的整车样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE); List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(partRelationList); taskSampleRelationService.removeBatchByIds(partRelationList);
List<TaskSampleRelation> relations = request.getSample(); List<TaskSampleRelation> relations = request.getSample();
if (relations.size() != 0 && relations != null) { if (relations.size() != 0 && relations != null) {
...@@ -504,7 +507,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -504,7 +507,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
} }
// 保存关联的零部件样品信息 // 保存关联的零部件样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE); List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(relationList); taskSampleRelationService.removeBatchByIds(relationList);
List<TaskSampleRelation> partRelations = request.getPartSample(); List<TaskSampleRelation> partRelations = request.getPartSample();
if (partRelations.size() != 0 && partRelations != null) { if (partRelations.size() != 0 && partRelations != null) {
......
...@@ -58,7 +58,7 @@ public class TaskController extends BaseController { ...@@ -58,7 +58,7 @@ public class TaskController extends BaseController {
@Log(title = "总任务", businessType = BusinessType.INSERT) @Log(title = "总任务", businessType = BusinessType.INSERT)
@RequestMapping(method = RequestMethod.POST, value = "/add") @RequestMapping(method = RequestMethod.POST, value = "/add")
public R<String> createTask(@Validated @RequestBody TaskCreateRequest request) { public R<String> createTask(@Validated @RequestBody TaskCreateRequest request) {
taskService.createTask(request); taskService.createTask(request,getUserId());
return R.ok(); return R.ok();
} }
......
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