Commit a64b9224 authored by wdy's avatar wdy

车型问卷确认提交

parent 2099bf60
......@@ -18,4 +18,7 @@ public interface TestScenarioMapper extends BaseMapper<TestScenario> {
* @return 测试场景库集合
*/
public List<TestScenario> selectTestScenarioList(TestScenarioRequest testScenarioRequest);
// 查询所有场景
List<TestScenario> selectAll();
}
......@@ -13,5 +13,5 @@ public interface StrategyCarReviewTask {
void doConfirmReview(CarReviewTask carReviewTask);
void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl);
void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl, List<Long> testScenarioList);
}
......@@ -133,7 +133,7 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
public void submitReviewTask(CarReviewTaskSubmitRequest request) {
CarReviewTask carReviewTask = carReviewTaskService.getById(request.getTaskId());
strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doSubmitReview(carReviewTask,request.getImagesUrl());
strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doSubmitReview(carReviewTask,request.getImagesUrl(),request.getTestScenarioList());
}
@Override
......
......@@ -81,7 +81,7 @@ public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, Initi
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl, List<Long> testScenarioList) {
throw new ServiceException("不能提交一个结束的任务", HttpStatus.ERROR);
}
......
......@@ -67,7 +67,7 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask,List<String> imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask,List<String> imagesUrl, List<Long> testScenarioList) {
throw new ServiceException("不能提交一个未开始的任务", HttpStatus.ERROR);
}
......
......@@ -155,7 +155,7 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask,List<String> imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask,List<String> imagesUrl, List<Long> testScenarioList) {
throw new ServiceException("不能提交一个未确认的任务", HttpStatus.ERROR);
......
package com.ruoyi.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.DataStatisticsUtils;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
......@@ -58,6 +59,12 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
@Autowired
private TaskUserRelationMapper taskUserRelationMapper;
@Autowired
private TaskScenarioRelationMapper taskScenarioRelationMapper;
@Autowired
private TestScenarioMapper testScenarioMapper;
// SIGNED状态下
// 1.standard字段使用task中归档的问卷
// 2.不查询场景变更任务
......@@ -78,6 +85,12 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
response.setCarReviewTask(carReviewTask);
Task task = taskMapper.getBySubtaskId(carReviewTask.getId());
if (task.getModelTestTaskId() != null) {
response.setTestScenarioList(testScenarioMapper.selectAll());
}
return response;
}
......@@ -92,7 +105,7 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl, List<Long> testScenarioList) {
// 1. 填充review_submit_time
carReviewTask.setTaskEndTime(new Date());
......@@ -117,6 +130,17 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
carReviewTaskMapper.updateById(carReviewTask);
taskMapper.updateById(task);
// 总任务包含车型试验,添加任务-场景关联信息
if (CollUtil.isNotEmpty(testScenarioList)) {
for (Long sceneId : testScenarioList) {
TaskScenarioRelation taskScenario = TaskScenarioRelation.builder()
.taskId(task.getId())
.testScenarioId(sceneId)
.build();
taskScenarioRelationMapper.insert(taskScenario);
}
}
}
private void setCarDataStatistics(List<ReviewStandard> standards, List<ReviewDetailsResult> results, CarReviewTask carReviewTask) {
......
......@@ -332,7 +332,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
Task task = new Task();
task.setTaskInitiatorId(loginUser.getUserId());
task.setTaskInitiator(initiator.getNickName());
if (initiator.getDept() != null) {
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
}
task.setTaskStatus(Task.TASK_STATUS_TEMPORARILY);
String joinTaskList = StringUtils.join(request.getTaskList(),",");
task.setTaskList(joinTaskList);
......@@ -383,9 +385,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 构建并保存任务信息
// 总任务
Task task = new Task();
task.setTaskInitiatorId(loginUser.getUserId());
task.setTaskInitiator(initiator.getNickName());
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
String joinTaskList = StringUtils.join(request.getTaskList(),",");
task.setTaskList(joinTaskList);
BeanUtils.copyBeanProp(task, request);
......
......@@ -16,4 +16,7 @@ public class CarReviewTaskSubmitRequest {
@ApiModelProperty("图片地址")
private List<String> imagesUrl;
@ApiModelProperty("选择的测试场景")
private List<Long> testScenarioList;
}
......@@ -43,4 +43,9 @@ public class CarReviewTaskViewResponse {
return detailsList;
}
@ApiModelProperty("测试场景")
private List<TestScenario> testScenarioList;
}
......@@ -26,5 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="testScenario != null and testScenario != ''"> and test_scenario like concat('%', #{testScenario}, '%')</if>
</where>
</select>
<select id="selectAll" resultType="com.ruoyi.domain.TestScenario">
select id, standard_classification, test_scenario, storage_time, create_by, create_time, update_by, update_time from t_test_scenario
</select>
</mapper>
\ No newline at end of file
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