Commit 0dafc58a authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents 2d015e58 6f92245e
...@@ -2,6 +2,7 @@ package com.ruoyi.service; ...@@ -2,6 +2,7 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.TestType; import com.ruoyi.domain.TestType;
import com.ruoyi.domain.vo.TestTypeVO;
import com.ruoyi.web.request.TestTypeRequest; import com.ruoyi.web.request.TestTypeRequest;
import java.util.List; import java.util.List;
...@@ -15,4 +16,10 @@ public interface ITestTypeService extends IService<TestType> { ...@@ -15,4 +16,10 @@ public interface ITestTypeService extends IService<TestType> {
* @return 测试类型库集合 * @return 测试类型库集合
*/ */
public List<TestType> selectTestTypeList(TestTypeRequest testTypeRequest); public List<TestType> selectTestTypeList(TestTypeRequest testTypeRequest);
/**
* 从科恩获取所有测试方法
* @return
*/
List<String> getTestTypeList();
} }
...@@ -7,10 +7,8 @@ import com.alibaba.fastjson2.JSONObject; ...@@ -7,10 +7,8 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.DataStatisticsUtils; import com.ruoyi.common.DataStatisticsUtils;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
...@@ -798,7 +796,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -798,7 +796,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((resultNum / useCaseNum) * 90); BigDecimal num = new BigDecimal((1.0 * resultNum / useCaseNum) * 90);
response.setTest(num.setScale(1,BigDecimal.ROUND_UP).doubleValue()); response.setTest(num.setScale(1,BigDecimal.ROUND_UP).doubleValue());
} }
......
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.TestType; import com.ruoyi.domain.TestType;
...@@ -8,11 +10,13 @@ import com.ruoyi.mapper.TestTypeMapper; ...@@ -8,11 +10,13 @@ import com.ruoyi.mapper.TestTypeMapper;
import com.ruoyi.service.ITestTypeService; import com.ruoyi.service.ITestTypeService;
import com.ruoyi.web.request.TestTypeRequest; import com.ruoyi.web.request.TestTypeRequest;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
@Transactional @Transactional
...@@ -34,4 +38,23 @@ public class TestTypeServiceImpl extends ServiceImpl<TestTypeMapper, TestType> i ...@@ -34,4 +38,23 @@ public class TestTypeServiceImpl extends ServiceImpl<TestTypeMapper, TestType> i
} }
return testTypeMapper.selectTestTypeList(testTypeRequest); return testTypeMapper.selectTestTypeList(testTypeRequest);
} }
@Override
public List<String> getTestTypeList() {
//以post形式请求接口
String result= HttpUtil.post("https://10.12.48.78:8090/DescribeScenarioTestTypeList","");
JSONObject jsonObject = JSONObject.parseObject(result);
return jsonObject.getList("test_type_list", TypeVO.class)
.stream()
.map(TypeVO::getName)
.collect(Collectors.toList());
}
@Data
public static class TypeVO {
private String name;
}
} }
...@@ -4,6 +4,7 @@ import com.ruoyi.common.core.controller.BaseController; ...@@ -4,6 +4,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.TestType; import com.ruoyi.domain.TestType;
import com.ruoyi.domain.vo.TestTypeVO;
import com.ruoyi.service.ITestTypeService; import com.ruoyi.service.ITestTypeService;
import com.ruoyi.web.request.TestTypeRequest; import com.ruoyi.web.request.TestTypeRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -51,4 +52,13 @@ public class TestTypeController extends BaseController { ...@@ -51,4 +52,13 @@ public class TestTypeController extends BaseController {
return R.ok(testTypeService.selectTestTypeList(testTypeRequest)); return R.ok(testTypeService.selectTestTypeList(testTypeRequest));
} }
// 从科恩获取所有测试方法
@ApiOperation("查询所有测试方法(科恩)")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getTestTypeList")
public R<List<String>> getTestTypeList(){
return R.ok(testTypeService.getTestTypeList());
}
} }
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "TestUserCaseListRequest", description = "查询测试用例")
public class TestUserCaseListRequest extends PageDomain {
@ApiModelProperty("测试场景")
private String testScenario;
@ApiModelProperty("测试方法")
private String testType;
@ApiModelProperty("用例编号或者名称关键字")
private String searchKeywords;
}
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "TestUserCaseListResponse", description = "查询测试用例")
@Data
public class TestUserCaseListResponse {
@ApiModelProperty("测试场景")
private String testScenario;
@ApiModelProperty("测试方法")
private String testType;
@ApiModelProperty("用例编号")
private String useCaseNo;
@ApiModelProperty("用例名称")
private String useCaseName;
@ApiModelProperty("对应输入")
private String input;
@ApiModelProperty("用例描述")
private String description;
}
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