Commit 9587d7ba authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents 9de36547 2c624f7c
......@@ -19,7 +19,7 @@ public class QuantityStatisticsVO {
@ApiModelProperty("支持标准数量")
private Long standardQuantity;
@ApiModelProperty("测试用例数量")
@ApiModelProperty("测试用例数量科恩获取")
private Long numberUseCases;
@ApiModelProperty("任务数量")
......@@ -40,10 +40,10 @@ public class QuantityStatisticsVO {
@ApiModelProperty("零部件样品数量")
private Long numberComponentSamples;
@ApiModelProperty("测试方法数量")
@ApiModelProperty("测试方法数量科恩获取")
private Long numberMethods;
@ApiModelProperty("场景数量")
@ApiModelProperty("场景数量科恩获取")
private Long numberScenes;
@ApiModelProperty("已完成任务数量")
......
......@@ -85,12 +85,6 @@ 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;
}
......
......@@ -239,12 +239,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
setCarProgress(carReviewTaskList,responses);
// 车型试验子任务列表
List<ModelTestTask> modelTestTaskList = modelTestTaskMapper.findByTaskList(responses);
setModelProgress(modelTestTaskList,responses);
// List<ModelTestTask> modelTestTaskList = modelTestTaskMapper.findByTaskList(responses);
// setModelProgress(modelTestTaskList,responses);
// 设置车型试验进度
setModelSchedule(responses);
// 任务是否有选择场景
List<TaskScenarioResponse> scenarioResponseList = taskMapper.findByTaskList(responses);
setTaskScenario(scenarioResponseList,responses);
// List<TaskScenarioResponse> scenarioResponseList = taskMapper.findByTaskList(responses);
// setTaskScenario(scenarioResponseList,responses);
for (TaskFindResponse response : responses) {
......@@ -390,8 +392,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
setCarProgress(carReviewTaskList,responses);
// 车型试验子任务列表
List<ModelTestTask> modelTestTaskList = modelTestTaskMapper.findByTaskList(responses);
setModelProgress(modelTestTaskList,responses);
// List<ModelTestTask> modelTestTaskList = modelTestTaskMapper.findByTaskList(responses);
// setModelProgress(modelTestTaskList,responses);
// 设置车型试验进度
setModelSchedule(responses);
for (TaskFindResponse response : responses) {
String[] taskList = response.getTaskList().split(",");
......@@ -762,6 +766,51 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
}
private void setModelSchedule(List<TaskFindResponse> responses) {
if (responses != null && responses.size() != 0) {
for (TaskFindResponse response : responses) {
if (response.getTestSchemeId() != null) {
// 获取任务的用例数量
Map<String, Object> map = new HashMap<>();
map.put("id", response.getTestSchemeId());
map.put("verbose", "BASIC");
//以post形式请求接口
String result= HttpUtil.post("https://10.12.48.78:8090/DescribeProjectTestResult", JSONObject.toJSONString(map));
JSONObject jsonObject = JSONObject.parseObject(result);
// 获取项目id
Integer useCaseNum = (Integer) jsonObject.get("case_count");
// 任务是否有选择用例
response.setTaskScenario(useCaseNum > 0);
// 任务用例结果数量
Long resultNum = testRecordsMapper.countResult(response.getTestSchemeId());
if (Objects.equals(response.getTestStatus(), ModelTestTask.TASK_STATUS_FINISH)) {
response.setTest(100.0);
} else if (Objects.equals(response.getTestStatus(), ModelTestTask.TASK_STATUS_SIGNED)) {
response.setTest(90.0);
} else if(resultNum == null) {
response.setTest(0.0);
} else {
BigDecimal num = new BigDecimal((resultNum / useCaseNum) * 90);
response.setTest(num.setScale(1,BigDecimal.ROUND_UP).doubleValue());
}
} else {
// 任务是否有选择用例
response.setTaskScenario(false);
}
}
}
}
private void setModelProgress(List<ModelTestTask> modelTestTaskList, List<TaskFindResponse> responses) {
if (modelTestTaskList != null && modelTestTaskList.size() != 0) {
......
......@@ -19,6 +19,7 @@
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
</resultMap>
<select id="findByTaskId" resultType="com.ruoyi.domain.ReviewEnterpriseArchive">
SELECT id, enterprise_name, file_name, version, publish_date, status, identify_number, storage, photo, task_id, create_by, create_time FROM t_review_enterprise_archive WHERE task_id = #{taskId}
</select>
......
......@@ -8,7 +8,6 @@
<select id="selectQuantityStatistics" resultType="com.ruoyi.domain.vo.QuantityStatisticsVO" parameterType="com.ruoyi.domain.vo.QuantityStatisticsVO">
SELECT
( SELECT count( id ) FROM t_standard ) AS standardQuantity,
( SELECT count( id ) FROM t_test_usecase ) AS numberUseCases,
( SELECT count( id ) FROM t_task WHERE task_status != 'TEMPORARILY' ) AS numberTasks,
( SELECT count( id ) FROM t_automobile_enterprise WHERE deleted = 0 ) AS numberCompanies,
(
......@@ -22,8 +21,6 @@
) AS numberInspectors,
( SELECT count( id ) FROM t_sample WHERE flag = '0' AND deleted = 0 ) AS numberVehicleSamples,
( SELECT count( id ) FROM t_sample WHERE flag = '1' AND deleted = 0 ) AS numberComponentSamples,
( SELECT count( id ) FROM t_test_scenario ) AS numberScenes,
( SELECT count( id ) FROM t_test_type ) AS numberMethods,
( SELECT count( id ) FROM t_task WHERE vehicle_information_url IS NOT NULL ) AS numberReports,
( SELECT count( id ) FROM t_task WHERE task_status = 'FINISH' ) AS completedTaskNumber,
( SELECT count( id ) FROM t_task WHERE task_status = 'NEW' OR task_status = 'PENDING' OR task_status = 'SIGNED') AS executeTasksNumber
......@@ -45,6 +42,8 @@
confidentiality_level AS name
FROM
t_task
WHERE
confidentiality_level IS NOT NULL AND confidentiality_level != ''
GROUP BY
confidentiality_level
</select>
......
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