Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王飞
vehicle-quality-review
Commits
6859cd85
Commit
6859cd85
authored
May 08, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取首页测试用例信息&测试用例分页查询添加字段&通过项目ID获取审查表单
parent
bd8af023
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
338 additions
and
9 deletions
+338
-9
CountVO.java
...ity-review/src/main/java/com/ruoyi/domain/vo/CountVO.java
+11
-0
ModelTestResultVO.java
.../src/main/java/com/ruoyi/domain/vo/ModelTestResultVO.java
+38
-0
ModelTestViewVO.java
...ew/src/main/java/com/ruoyi/domain/vo/ModelTestViewVO.java
+27
-0
NameVO.java
quality-review/src/main/java/com/ruoyi/domain/vo/NameVO.java
+8
-0
UseCaseUrlVO.java
...eview/src/main/java/com/ruoyi/domain/vo/UseCaseUrlVO.java
+12
-0
ModelTestTaskService.java
...src/main/java/com/ruoyi/service/ModelTestTaskService.java
+7
-0
StrategyModelTestTask.java
...rc/main/java/com/ruoyi/service/StrategyModelTestTask.java
+8
-0
TestUseCaseService.java
...w/src/main/java/com/ruoyi/service/TestUseCaseService.java
+9
-1
ModelTestTaskServiceImpl.java
...java/com/ruoyi/service/impl/ModelTestTaskServiceImpl.java
+7
-0
StrategyModelTestTaskFinish.java
...a/com/ruoyi/service/impl/StrategyModelTestTaskFinish.java
+13
-1
StrategyModelTestTaskNew.java
...java/com/ruoyi/service/impl/StrategyModelTestTaskNew.java
+40
-1
StrategyModelTestTaskPending.java
.../com/ruoyi/service/impl/StrategyModelTestTaskPending.java
+7
-0
StrategyModelTestTaskSigned.java
...a/com/ruoyi/service/impl/StrategyModelTestTaskSigned.java
+7
-0
TestUseCaseServiceImpl.java
...n/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
+56
-4
ModelTestTaskController.java
.../src/main/java/com/ruoyi/web/ModelTestTaskController.java
+14
-1
TestUserCaseController.java
...w/src/main/java/com/ruoyi/web/TestUserCaseController.java
+18
-1
ModelTestUrlResponse.java
...ain/java/com/ruoyi/web/response/ModelTestUrlResponse.java
+28
-0
UseCaseResponse.java
...src/main/java/com/ruoyi/web/response/UseCaseResponse.java
+28
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/vo/CountVO.java
0 → 100644
View file @
6859cd85
package
com
.
ruoyi
.
domain
.
vo
;
import
lombok.Data
;
@Data
public
class
CountVO
{
private
int
count
;
private
String
value
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/ModelTestResultVO.java
0 → 100644
View file @
6859cd85
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"ModelTestResultVO"
,
description
=
"结果VO"
)
public
class
ModelTestResultVO
{
// 用例描述
@ApiModelProperty
(
"用例描述"
)
private
String
description
;
// 对应输入
@ApiModelProperty
(
"对应输入"
)
private
String
requirements
;
// 用例名称
@ApiModelProperty
(
"用例名称"
)
private
String
name
;
// 测试结果
@ApiModelProperty
(
"测试结果"
)
private
String
status
;
// 测试场景
@ApiModelProperty
(
"测试场景"
)
private
String
scenario
;
// 测试类型
@ApiModelProperty
(
"测试类型"
)
private
String
test_type
;
// 用例编号
@ApiModelProperty
(
"用例编号"
)
private
String
serial_number
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/ModelTestViewVO.java
0 → 100644
View file @
6859cd85
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
value
=
"ModelTestViewVO"
,
description
=
"审查表单概要VO类"
)
public
class
ModelTestViewVO
{
// 标准技术要求
@ApiModelProperty
(
"标准技术要求"
)
private
String
requirements
;
// 章节号
@ApiModelProperty
(
"章节号"
)
private
String
serial_number
;
// 标准测试方法
@ApiModelProperty
(
"标准测试方法"
)
private
String
test_method
;
@ApiModelProperty
(
"结果列表"
)
List
<
ModelTestResultVO
>
case_result_list
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/NameVO.java
0 → 100644
View file @
6859cd85
package
com
.
ruoyi
.
domain
.
vo
;
import
lombok.Data
;
@Data
public
class
NameVO
{
private
String
name
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/UseCaseUrlVO.java
View file @
6859cd85
...
@@ -20,4 +20,16 @@ public class UseCaseUrlVO {
...
@@ -20,4 +20,16 @@ public class UseCaseUrlVO {
// 对应输入
// 对应输入
private
String
requirements
;
private
String
requirements
;
// 测试方法
private
NameVO
method
;
// 测试场景
private
NameVO
scenario
;
// 测试方法
private
String
testMethod
;
// 测试场景
private
String
testScenario
;
}
}
quality-review/src/main/java/com/ruoyi/service/ModelTestTaskService.java
View file @
6859cd85
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
/**
/**
* 车型试验任务Service接口
* 车型试验任务Service接口
...
@@ -37,4 +38,10 @@ public interface ModelTestTaskService extends IService<ModelTestTask> {
...
@@ -37,4 +38,10 @@ public interface ModelTestTaskService extends IService<ModelTestTask> {
*/
*/
void
submitModelTestTask
(
ModelTestTaskSubmitRequest
request
);
void
submitModelTestTask
(
ModelTestTaskSubmitRequest
request
);
/**
* 查看车型试验任务详情(科恩)
* @param taskId
* @return
*/
ModelTestUrlResponse
taskViewModelTestTask
(
Long
taskId
);
}
}
quality-review/src/main/java/com/ruoyi/service/StrategyModelTestTask.java
View file @
6859cd85
...
@@ -2,6 +2,7 @@ package com.ruoyi.service;
...
@@ -2,6 +2,7 @@ package com.ruoyi.service;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
import
java.util.List
;
import
java.util.List
;
...
@@ -36,4 +37,11 @@ public interface StrategyModelTestTask {
...
@@ -36,4 +37,11 @@ public interface StrategyModelTestTask {
*/
*/
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
);
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
);
/**
* 查看任务
* @param modelTestTask
* @return
*/
ModelTestUrlResponse
doTaskView
(
ModelTestTask
modelTestTask
);
}
}
quality-review/src/main/java/com/ruoyi/service/TestUseCaseService.java
View file @
6859cd85
...
@@ -5,9 +5,9 @@ import com.ruoyi.domain.TestUseCase;
...
@@ -5,9 +5,9 @@ import com.ruoyi.domain.TestUseCase;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUserCaseListRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.UseCaseResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
...
@@ -56,4 +56,12 @@ public interface TestUseCaseService extends IService<TestUseCase> {
...
@@ -56,4 +56,12 @@ public interface TestUseCaseService extends IService<TestUseCase> {
* @throws IOException
* @throws IOException
*/
*/
TestUserCaseListResponse
getUseCaseList
(
String
request
)
throws
IOException
;
TestUserCaseListResponse
getUseCaseList
(
String
request
)
throws
IOException
;
/**
* 科恩获取首页信息
* @param request
* @return
* @throws IOException
*/
UseCaseResponse
getUseCaseMsg
(
String
request
)
throws
IOException
;
}
}
quality-review/src/main/java/com/ruoyi/service/impl/ModelTestTaskServiceImpl.java
View file @
6859cd85
...
@@ -6,6 +6,7 @@ import com.ruoyi.mapper.ModelTestTaskMapper;
...
@@ -6,6 +6,7 @@ import com.ruoyi.mapper.ModelTestTaskMapper;
import
com.ruoyi.service.ModelTestTaskService
;
import
com.ruoyi.service.ModelTestTaskService
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
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
;
...
@@ -61,4 +62,10 @@ public class ModelTestTaskServiceImpl extends ServiceImpl<ModelTestTaskMapper, M
...
@@ -61,4 +62,10 @@ public class ModelTestTaskServiceImpl extends ServiceImpl<ModelTestTaskMapper, M
ModelTestTask
modelTestTask
=
modelTestTaskMapper
.
selectById
(
request
.
getTaskId
());
ModelTestTask
modelTestTask
=
modelTestTaskMapper
.
selectById
(
request
.
getTaskId
());
strategyModelTestTaskContext
.
getResource
(
modelTestTask
.
getTaskStatus
()).
doSubmitTest
(
modelTestTask
,
request
.
getImagesUrl
());
strategyModelTestTaskContext
.
getResource
(
modelTestTask
.
getTaskStatus
()).
doSubmitTest
(
modelTestTask
,
request
.
getImagesUrl
());
}
}
@Override
public
ModelTestUrlResponse
taskViewModelTestTask
(
Long
taskId
)
{
ModelTestTask
modelTestTask
=
modelTestTaskMapper
.
selectById
(
taskId
);
return
strategyModelTestTaskContext
.
getResource
(
modelTestTask
.
getTaskStatus
()).
doTaskView
(
modelTestTask
);
}
}
}
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskFinish.java
View file @
6859cd85
...
@@ -5,6 +5,7 @@ import com.ruoyi.common.exception.ServiceException;
...
@@ -5,6 +5,7 @@ import com.ruoyi.common.exception.ServiceException;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
...
@@ -23,9 +24,14 @@ public class StrategyModelTestTaskFinish implements StrategyModelTestTask, Initi
...
@@ -23,9 +24,14 @@ public class StrategyModelTestTaskFinish implements StrategyModelTestTask, Initi
@Autowired
@Autowired
private
StrategyModelTestTaskContext
strategyModelTestTaskContext
;
private
StrategyModelTestTaskContext
strategyModelTestTaskContext
;
@Autowired
private
StrategyModelTestTaskNew
strategyModelTestTaskNew
;
@Override
@Override
public
ModelTestResponse
doView
(
ModelTestTask
modelTestTask
)
{
public
ModelTestResponse
doView
(
ModelTestTask
modelTestTask
)
{
throw
new
ServiceException
(
"不能开始一个结束的任务"
,
HttpStatus
.
ERROR
);
ModelTestResponse
response
=
strategyModelTestTaskNew
.
getTestScheme
(
modelTestTask
);
return
response
;
}
}
@Override
@Override
...
@@ -43,6 +49,12 @@ public class StrategyModelTestTaskFinish implements StrategyModelTestTask, Initi
...
@@ -43,6 +49,12 @@ public class StrategyModelTestTaskFinish implements StrategyModelTestTask, Initi
throw
new
ServiceException
(
"不能提交一个结束的任务"
,
HttpStatus
.
ERROR
);
throw
new
ServiceException
(
"不能提交一个结束的任务"
,
HttpStatus
.
ERROR
);
}
}
@Override
public
ModelTestUrlResponse
doTaskView
(
ModelTestTask
modelTestTask
)
{
ModelTestUrlResponse
response
=
strategyModelTestTaskNew
.
getTestSchemeFormKe
(
modelTestTask
);
return
response
;
}
@Override
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
public
void
afterPropertiesSet
()
throws
Exception
{
strategyModelTestTaskContext
.
putResource
(
ModelTestTask
.
TASK_STATUS_FINISH
,
applicationContext
.
getBean
(
this
.
getClass
()));
strategyModelTestTaskContext
.
putResource
(
ModelTestTask
.
TASK_STATUS_FINISH
,
applicationContext
.
getBean
(
this
.
getClass
()));
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskNew.java
View file @
6859cd85
package
com
.
ruoyi
.
service
.
impl
;
package
com
.
ruoyi
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.http.HttpUtil
;
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.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.domain.vo.ModelTestResultVO
;
import
com.ruoyi.domain.vo.ModelTestViewVO
;
import
com.ruoyi.domain.vo.TestCaseVO
;
import
com.ruoyi.domain.vo.TestCaseVO
;
import
com.ruoyi.domain.vo.TestUsecaseVO
;
import
com.ruoyi.domain.vo.TestUsecaseVO
;
import
com.ruoyi.mapper.ModelTestTaskMapper
;
import
com.ruoyi.mapper.ModelTestTaskMapper
;
...
@@ -14,6 +18,7 @@ import com.ruoyi.mapper.TestUseCaseMapper;
...
@@ -14,6 +18,7 @@ import com.ruoyi.mapper.TestUseCaseMapper;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestTaskViewResponse
;
import
com.ruoyi.web.response.ModelTestTaskViewResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -60,7 +65,7 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
...
@@ -60,7 +65,7 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
/**
/**
* 获取试验方案
* 获取试验方案
* @param
taskId
* @param
modelTestTask
* @return
* @return
*/
*/
public
ModelTestResponse
getTestScheme
(
ModelTestTask
modelTestTask
)
{
public
ModelTestResponse
getTestScheme
(
ModelTestTask
modelTestTask
)
{
...
@@ -146,6 +151,40 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
...
@@ -146,6 +151,40 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
throw
new
ServiceException
(
"不能提交一个尚未开始的任务"
,
HttpStatus
.
ERROR
);
throw
new
ServiceException
(
"不能提交一个尚未开始的任务"
,
HttpStatus
.
ERROR
);
}
}
@Override
public
ModelTestUrlResponse
doTaskView
(
ModelTestTask
modelTestTask
)
{
ModelTestUrlResponse
response
=
getTestSchemeFormKe
(
modelTestTask
);
return
response
;
}
public
ModelTestUrlResponse
getTestSchemeFormKe
(
ModelTestTask
modelTestTask
)
{
ModelTestUrlResponse
response
=
new
ModelTestUrlResponse
();
if
(
modelTestTask
.
getTestSchemeId
()
!=
null
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
modelTestTask
.
getTestSchemeId
());
map
.
put
(
"verbose"
,
"DETAILED"
);
//以post形式请求接口
String
result
=
HttpUtil
.
post
(
"https://10.12.48.78:8090/DescribeProjectComplianceResult"
,
JSONObject
.
toJSONString
(
map
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
);
List
<
ModelTestViewVO
>
list
=
jsonObject
.
getList
(
"regulation_item_result_list"
,
ModelTestViewVO
.
class
);
response
.
setModelTestTaskViewResponseList
(
list
);
}
Task
task
=
taskMapper
.
selectOne
(
new
QueryWrapper
<
Task
>().
lambda
().
eq
(
Task:
:
getModelTestTaskId
,
modelTestTask
.
getId
()));
response
.
setTaskNo
(
task
.
getTaskNo
());
response
.
setTaskName
(
task
.
getTaskName
());
response
.
setEntrustedUnit
(
task
.
getEntrustedUnit
());
response
.
setTaskStatus
(
modelTestTask
.
getTaskStatus
());
return
response
;
}
/**
/**
* 根据任务状态获取对应的策略
* 根据任务状态获取对应的策略
* @throws Exception
* @throws Exception
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskPending.java
View file @
6859cd85
...
@@ -10,6 +10,7 @@ import com.ruoyi.mapper.ModelTestTaskMapper;
...
@@ -10,6 +10,7 @@ import com.ruoyi.mapper.ModelTestTaskMapper;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -92,6 +93,12 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
...
@@ -92,6 +93,12 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
throw
new
ServiceException
(
"不能提交一个进行中的任务"
,
HttpStatus
.
ERROR
);
throw
new
ServiceException
(
"不能提交一个进行中的任务"
,
HttpStatus
.
ERROR
);
}
}
@Override
public
ModelTestUrlResponse
doTaskView
(
ModelTestTask
modelTestTask
)
{
ModelTestUrlResponse
response
=
strategyModelTestTaskNew
.
getTestSchemeFormKe
(
modelTestTask
);
return
response
;
}
@Override
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
public
void
afterPropertiesSet
()
throws
Exception
{
strategyModelTestTaskContext
.
putResource
(
ModelTestTask
.
TASK_STATUS_PENDING
,
applicationContext
.
getBean
(
this
.
getClass
()));
strategyModelTestTaskContext
.
putResource
(
ModelTestTask
.
TASK_STATUS_PENDING
,
applicationContext
.
getBean
(
this
.
getClass
()));
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskSigned.java
View file @
6859cd85
...
@@ -14,6 +14,7 @@ import com.ruoyi.mapper.ModelTestTaskMapper;
...
@@ -14,6 +14,7 @@ import com.ruoyi.mapper.ModelTestTaskMapper;
import
com.ruoyi.mapper.TaskMapper
;
import
com.ruoyi.mapper.TaskMapper
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
...
@@ -81,6 +82,12 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi
...
@@ -81,6 +82,12 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi
}
}
}
}
@Override
public
ModelTestUrlResponse
doTaskView
(
ModelTestTask
modelTestTask
)
{
ModelTestUrlResponse
response
=
strategyModelTestTaskNew
.
getTestSchemeFormKe
(
modelTestTask
);
return
response
;
}
@Override
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
public
void
afterPropertiesSet
()
throws
Exception
{
strategyModelTestTaskContext
.
putResource
(
ModelTestTask
.
TASK_STATUS_SIGNED
,
applicationContext
.
getBean
(
this
.
getClass
()));
strategyModelTestTaskContext
.
putResource
(
ModelTestTask
.
TASK_STATUS_SIGNED
,
applicationContext
.
getBean
(
this
.
getClass
()));
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
View file @
6859cd85
...
@@ -3,16 +3,16 @@ package com.ruoyi.service.impl;
...
@@ -3,16 +3,16 @@ package com.ruoyi.service.impl;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.utils.bean.BeanUtils
;
import
com.ruoyi.domain.TestUseCase
;
import
com.ruoyi.domain.TestUseCase
;
import
com.ruoyi.domain.vo.CaseResultVO
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.domain.vo.TestUsecaseVO
;
import
com.ruoyi.domain.vo.UseCaseUrlVO
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.mapper.TestUseCaseMapper
;
import
com.ruoyi.mapper.TestUseCaseMapper
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.UseCaseResponse
;
import
okhttp3.*
;
import
okhttp3.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -108,7 +108,7 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
...
@@ -108,7 +108,7 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
// 创建请求体
// 创建请求体
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"query\":\"query useCases($offset:OffsetConnectionInput$orderBy:OrderByInput$filter:Map$search:String){useCases(offset:$offset orderBy:$orderBy filterFields:$filter search:$search){nodes{id displayID class name description remediation requirements riskLevel}totalCount}}\",\"variables\":"
+
request
+
"}"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"query\":\"query useCases($offset:OffsetConnectionInput$orderBy:OrderByInput$filter:Map$search:String){useCases(offset:$offset orderBy:$orderBy filterFields:$filter search:$search){nodes{id displayID class name description remediation requirements riskLevel
method{name}scenario{name}
}totalCount}}\",\"variables\":"
+
request
+
"}"
);
Request
requestKE
=
new
Request
.
Builder
()
Request
requestKE
=
new
Request
.
Builder
()
.
url
(
"http://10.12.48.80:8089/api/query"
)
.
url
(
"http://10.12.48.80:8089/api/query"
)
...
@@ -126,6 +126,15 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
...
@@ -126,6 +126,15 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
string
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
string
);
// 获取测试用例
// 获取测试用例
List
<
UseCaseUrlVO
>
list
=
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"useCases"
).
getList
(
"nodes"
,
UseCaseUrlVO
.
class
);
List
<
UseCaseUrlVO
>
list
=
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"useCases"
).
getList
(
"nodes"
,
UseCaseUrlVO
.
class
);
for
(
UseCaseUrlVO
useCaseUrlVO
:
list
)
{
if
(
useCaseUrlVO
.
getMethod
()
!=
null
)
{
useCaseUrlVO
.
setTestMethod
(
useCaseUrlVO
.
getMethod
().
getName
());
}
if
(
useCaseUrlVO
.
getScenario
()
!=
null
)
{
useCaseUrlVO
.
setTestScenario
(
useCaseUrlVO
.
getScenario
().
getName
());
}
}
userCaseResponse
.
setUseCases
(
list
);
userCaseResponse
.
setUseCases
(
list
);
// 获取总条数
// 获取总条数
Integer
totalCount
=
(
Integer
)
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"useCases"
).
get
(
"totalCount"
);
Integer
totalCount
=
(
Integer
)
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"useCases"
).
get
(
"totalCount"
);
...
@@ -134,6 +143,49 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
...
@@ -134,6 +143,49 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
return
userCaseResponse
;
return
userCaseResponse
;
}
}
/**
* 科恩获取首页信息
* @param request
* @return
* @throws IOException
*/
@Override
public
UseCaseResponse
getUseCaseMsg
(
String
request
)
throws
IOException
{
OkHttpClient
client
=
new
OkHttpClient
().
newBuilder
().
build
();
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"query\":\"query regulationStatistics($name:String!){regulationStatistics:regulationByName(name:$name){id name description useCaseCount testMethodCount testScenarioCount useCases{fieldValuesWithCount(fields:[\\\"testType\\\" \\\"riskLevel\\\"])}}}\",\"variables\":"
+
request
+
"}"
);
Request
requestKE
=
new
Request
.
Builder
()
.
url
(
"http://10.12.48.80:8089/api/query"
)
.
method
(
"POST"
,
body
)
.
addHeader
(
"Content-Type"
,
"application/json"
)
// TODO 连接
// .addHeader("Host", "10.12.48.80:8089")
// .addHeader("Origin", "http://10.12.48.80:8089")
// .addHeader("Referer", "http://10.12.48.80:8089/api/graphql/playground")
// .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")
.
build
();
Response
response
=
client
.
newCall
(
requestKE
).
execute
();
String
string
=
response
.
body
().
string
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
string
);
UseCaseResponse
caseResponse
=
jsonObject
.
getJSONObject
(
"data"
).
getObject
(
"regulationStatistics"
,
UseCaseResponse
.
class
);
List
<
CountVO
>
riskLevel
=
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"regulationStatistics"
).
getJSONObject
(
"useCases"
).
getJSONObject
(
"fieldValuesWithCount"
).
getList
(
"riskLevel"
,
CountVO
.
class
);
List
<
CountVO
>
testType
=
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"regulationStatistics"
).
getJSONObject
(
"useCases"
).
getJSONObject
(
"fieldValuesWithCount"
).
getList
(
"testType"
,
CountVO
.
class
);
caseResponse
.
setRiskLevel
(
riskLevel
);
caseResponse
.
setTestType
(
testType
);
return
caseResponse
;
}
}
}
...
...
quality-review/src/main/java/com/ruoyi/web/ModelTestTaskController.java
View file @
6859cd85
...
@@ -7,6 +7,7 @@ import com.ruoyi.web.request.CarReviewTaskViewRequest;
...
@@ -7,6 +7,7 @@ import com.ruoyi.web.request.CarReviewTaskViewRequest;
import
com.ruoyi.web.request.ModelTestTaskConfirmRequest
;
import
com.ruoyi.web.request.ModelTestTaskConfirmRequest
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestResponse
;
import
com.ruoyi.web.response.ModelTestUrlResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -35,12 +36,24 @@ public class ModelTestTaskController extends BaseController {
...
@@ -35,12 +36,24 @@ public class ModelTestTaskController extends BaseController {
* @return
* @return
*/
*/
@ApiOperation
(
"查看车型试验任务详情"
)
@ApiOperation
(
"查看车型试验任务详情"
)
@PostMapping
(
"/getById"
)
@PostMapping
(
"/getById
Old
"
)
public
R
<
ModelTestResponse
>
view
(
@Validated
@RequestBody
CarReviewTaskViewRequest
request
)
{
public
R
<
ModelTestResponse
>
view
(
@Validated
@RequestBody
CarReviewTaskViewRequest
request
)
{
ModelTestResponse
modelTestTaskList
=
modelTestTaskService
.
viewModelTestTask
(
request
.
getTaskId
());
ModelTestResponse
modelTestTaskList
=
modelTestTaskService
.
viewModelTestTask
(
request
.
getTaskId
());
return
R
.
ok
(
modelTestTaskList
);
return
R
.
ok
(
modelTestTaskList
);
}
}
/**
* 查看车型试验任务详情(科恩)
* @param request
* @return
*/
@ApiOperation
(
"查看车型试验任务详情(科恩)"
)
@PostMapping
(
"/getById"
)
public
R
<
ModelTestUrlResponse
>
taskView
(
@Validated
@RequestBody
CarReviewTaskViewRequest
request
)
{
ModelTestUrlResponse
response
=
modelTestTaskService
.
taskViewModelTestTask
(
request
.
getTaskId
());
return
R
.
ok
(
response
);
}
/**
/**
* 开始车型试验任务
* 开始车型试验任务
* @param request
* @param request
...
...
quality-review/src/main/java/com/ruoyi/web/TestUserCaseController.java
View file @
6859cd85
...
@@ -6,9 +6,9 @@ import com.ruoyi.domain.TestUseCase;
...
@@ -6,9 +6,9 @@ import com.ruoyi.domain.TestUseCase;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUserCaseListRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.UseCaseResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
...
@@ -77,4 +77,21 @@ public class TestUserCaseController extends BaseController{
...
@@ -77,4 +77,21 @@ public class TestUserCaseController extends BaseController{
}
}
/**
* 科恩获取首页信息
* @param request
* @return
* @throws IOException
*/
@ApiOperation
(
"科恩获取首页信息"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getUseCaseMsg"
,
produces
=
"application/json;charset=UTF-8"
)
public
R
<
UseCaseResponse
>
getUseCaseMsg
(
@Validated
@RequestBody
String
request
)
throws
IOException
{
return
R
.
ok
(
testUseCaseService
.
getUseCaseMsg
(
request
));
}
}
}
quality-review/src/main/java/com/ruoyi/web/response/ModelTestUrlResponse.java
0 → 100644
View file @
6859cd85
package
com
.
ruoyi
.
web
.
response
;
import
com.ruoyi.domain.vo.ModelTestViewVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
value
=
"ModelTestUrlResponse"
,
description
=
"车型试验查看VO类"
)
public
class
ModelTestUrlResponse
{
@ApiModelProperty
(
"任务编号"
)
private
String
taskNo
;
@ApiModelProperty
(
"任务名称"
)
private
String
taskName
;
@ApiModelProperty
(
"委托单位"
)
private
String
entrustedUnit
;
@ApiModelProperty
(
"子任务状态"
)
private
String
taskStatus
;
@ApiModelProperty
(
"审查表单概要"
)
private
List
<
ModelTestViewVO
>
modelTestTaskViewResponseList
;
}
quality-review/src/main/java/com/ruoyi/web/response/UseCaseResponse.java
0 → 100644
View file @
6859cd85
package
com
.
ruoyi
.
web
.
response
;
import
com.ruoyi.domain.vo.CountVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
"测试用例VO"
)
public
class
UseCaseResponse
{
@ApiModelProperty
(
"用例数量"
)
private
Integer
useCaseCount
;
@ApiModelProperty
(
"测试场景数量"
)
private
Integer
testScenarioCount
;
@ApiModelProperty
(
"测试方法数量"
)
private
Integer
testMethodCount
;
@ApiModelProperty
(
"用例风险程度"
)
List
<
CountVO
>
riskLevel
;
@ApiModelProperty
(
"用例测试类型"
)
List
<
CountVO
>
testType
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment