Commit 8141ead7 authored by wdy's avatar wdy

查询测试方法、任务进度

parent 4c345675
...@@ -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<TestTypeVO> 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;
import com.ruoyi.domain.vo.ScenarioVO;
import com.ruoyi.domain.vo.TestTypeVO;
import com.ruoyi.mapper.TestTypeMapper; import com.ruoyi.mapper.TestTypeMapper;
import com.ruoyi.service.ITestTypeService; import com.ruoyi.service.ITestTypeService;
...@@ -34,4 +38,13 @@ public class TestTypeServiceImpl extends ServiceImpl<TestTypeMapper, TestType> i ...@@ -34,4 +38,13 @@ public class TestTypeServiceImpl extends ServiceImpl<TestTypeMapper, TestType> i
} }
return testTypeMapper.selectTestTypeList(testTypeRequest); return testTypeMapper.selectTestTypeList(testTypeRequest);
} }
@Override
public List<TestTypeVO> getTestTypeList() {
//以post形式请求接口
String result= HttpUtil.post("https://10.12.48.78:8090/DescribeScenarioTestTypeList","");
JSONObject jsonObject = JSONObject.parseObject(result);
return jsonObject.getList("test_type_list", TestTypeVO.class);
}
} }
...@@ -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<TestTypeVO>> getTestTypeList(){
return R.ok(testTypeService.getTestTypeList());
}
} }
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