Commit 3497143c authored by wdy's avatar wdy

车型试验任务进度

parent 6945de80
package com.ruoyi.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "CaseStatisticsVO", description = "项目用例统计列表VO")
@Data
public class CaseStatisticsVO {
@ApiModelProperty("用例检测状态枚举")
private String status;
@ApiModelProperty("用例数量")
private Integer count;
}
...@@ -15,6 +15,7 @@ import com.ruoyi.common.utils.SecurityUtils; ...@@ -15,6 +15,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.domain.vo.CaseStatisticsVO;
import com.ruoyi.mapper.*; import com.ruoyi.mapper.*;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
...@@ -864,6 +865,18 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -864,6 +865,18 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 获取项目id // 获取项目id
Integer useCaseNum = (Integer) jsonObject.get("case_count"); Integer useCaseNum = (Integer) jsonObject.get("case_count");
// 获取已忽略用例数
List<CaseStatisticsVO> statisticsVOList = jsonObject.getList("case_statistics",CaseStatisticsVO.class);
Integer ignoredNum = 0;
for (CaseStatisticsVO vo : statisticsVOList) {
if (Objects.equals(vo.getStatus(), "IGNORED")) {
ignoredNum = vo.getCount();
break;
}
}
// 任务是否有选择用例 // 任务是否有选择用例
response.setTaskScenario(useCaseNum > 0); response.setTaskScenario(useCaseNum > 0);
...@@ -877,7 +890,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -877,7 +890,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
} else if(resultNum == null) { } else if(resultNum == null) {
response.setTest(0.0); response.setTest(0.0);
} else { } else {
BigDecimal num = new BigDecimal((1.0 * resultNum / useCaseNum) * 90); BigDecimal num = new BigDecimal((1.0 * resultNum / (useCaseNum - ignoredNum)) * 90);
response.setTest(num.setScale(1,BigDecimal.ROUND_UP).doubleValue()); response.setTest(num.setScale(1,BigDecimal.ROUND_UP).doubleValue());
} }
......
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