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
30c41068
Commit
30c41068
authored
Nov 21, 2024
by
宋源硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
2024/11/18修改方法 See merge request
!464
parents
f52b10da
360fccb7
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
168 additions
and
8 deletions
+168
-8
NewScenarioUseCasesVO.java
.../main/java/com/ruoyi/domain/vo/NewScenarioUseCasesVO.java
+15
-0
NewStandardVO.java
...view/src/main/java/com/ruoyi/domain/vo/NewStandardVO.java
+21
-0
UseCaseNewVO.java
...eview/src/main/java/com/ruoyi/domain/vo/UseCaseNewVO.java
+17
-0
TaskMapper.java
...ity-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
+5
-0
TestUseCaseService.java
...w/src/main/java/com/ruoyi/service/TestUseCaseService.java
+6
-0
StrategyCarReviewTaskFinish.java
...a/com/ruoyi/service/impl/StrategyCarReviewTaskFinish.java
+5
-4
StrategyCarReviewTaskNew.java
...java/com/ruoyi/service/impl/StrategyCarReviewTaskNew.java
+10
-0
StrategyCarReviewTaskSigned.java
...a/com/ruoyi/service/impl/StrategyCarReviewTaskSigned.java
+4
-0
TestUseCaseServiceImpl.java
...n/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
+47
-4
TestUserCaseController.java
...w/src/main/java/com/ruoyi/web/TestUserCaseController.java
+10
-0
NewTestUserCaseListResponse.java
...a/com/ruoyi/web/response/NewTestUserCaseListResponse.java
+23
-0
TaskMapper.xml
quality-review/src/main/resources/mapper/TaskMapper.xml
+5
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/vo/NewScenarioUseCasesVO.java
0 → 100644
View file @
30c41068
package
com
.
ruoyi
.
domain
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
NewScenarioUseCasesVO
{
// 场景
private
String
testScenario
;
// 用例VO
List
<
UseCaseNewVO
>
useCases
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/NewStandardVO.java
0 → 100644
View file @
30c41068
package
com
.
ruoyi
.
domain
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
NewStandardVO
{
// 标准要求id
private
String
id
;
// 标准要求章节号
private
String
serialNumber
;
// 标准要求
private
String
requirements
;
// 场景及其所属用例VO
List
<
NewScenarioUseCasesVO
>
scenarioUseCases
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/UseCaseNewVO.java
0 → 100644
View file @
30c41068
package
com
.
ruoyi
.
domain
.
vo
;
import
lombok.Data
;
@Data
public
class
UseCaseNewVO
{
// 用例id
private
String
id
;
// 用例编号
private
String
customizedID
;
// 用例描述
private
String
description
;
}
quality-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
View file @
30c41068
...
...
@@ -94,4 +94,9 @@ public interface TaskMapper extends BaseMapper<Task> {
* 获取任务企业名称
* */
Task
getTaskBySystemTaskId
(
Long
id
);
/*
* 获取任务企业名称
* */
Task
getTaskByCarTaskId
(
Long
id
);
}
quality-review/src/main/java/com/ruoyi/service/TestUseCaseService.java
View file @
30c41068
...
...
@@ -7,6 +7,7 @@ import com.ruoyi.domain.vo.UseCaseUrlVO;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.response.NewTestUserCaseListResponse
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.UseCaseResponse
;
...
...
@@ -81,4 +82,9 @@ public interface TestUseCaseService extends IService<TestUseCase> {
* @throws IOException
*/
List
<
String
>
selectCaseListByScenario
(
String
request
)
throws
IOException
;
/*
* 获取科恩数据
**/
NewTestUserCaseListResponse
getCaseListNew
(
String
request
)
throws
IOException
;
}
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskFinish.java
View file @
30c41068
...
...
@@ -3,10 +3,7 @@ package com.ruoyi.service.impl;
import
com.ruoyi.common.DataStatisticsUtils
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.CarReviewTask
;
import
com.ruoyi.domain.ReviewDetailsResult
;
import
com.ruoyi.domain.ReviewStandard
;
import
com.ruoyi.domain.TaskUserRelation
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.mapper.TaskMapper
;
import
com.ruoyi.mapper.TaskUserRelationMapper
;
import
com.ruoyi.service.ReviewDetailsResultService
;
...
...
@@ -64,6 +61,10 @@ public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, Initi
// 获取当前问卷答案
List
<
ReviewDetailsResult
>
carResults
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
//设置企业名称
Task
task
=
taskMapper
.
getTaskByCarTaskId
(
carReviewTask
.
getId
());
carReviewTask
.
setEnterpriseName
(
task
.
getEnterpriseName
());
// 车型审查
setCarDataStatistics
(
carStandardTree
,
carResults
,
carReviewTask
);
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskNew.java
View file @
30c41068
...
...
@@ -4,7 +4,10 @@ import com.ruoyi.common.constant.HttpStatus;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.CarReviewTask
;
import
com.ruoyi.domain.ReviewStandard
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.mapper.CarReviewTaskMapper
;
import
com.ruoyi.mapper.ReviewStandardMapper
;
import
com.ruoyi.mapper.TaskMapper
;
import
com.ruoyi.service.ReviewStandardService
;
import
com.ruoyi.service.StrategyCarReviewTask
;
import
com.ruoyi.web.response.CarReviewTaskViewResponse
;
...
...
@@ -34,6 +37,9 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
@Autowired
private
CarReviewTaskMapper
carReviewTaskMapper
;
@Autowired
private
TaskMapper
taskMapper
;
// NEW状态下
// 1.standard字段查询当前最新问卷
...
...
@@ -48,6 +54,10 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
// 将问卷赋值到任务
carReviewTask
.
setStandard
(
standardTree
);
//设置企业名称
Task
task
=
taskMapper
.
getTaskByCarTaskId
(
carReviewTask
.
getId
());
carReviewTask
.
setEnterpriseName
(
task
.
getEnterpriseName
());
// 生成返回结果
CarReviewTaskViewResponse
response
=
new
CarReviewTaskViewResponse
();
response
.
setCarReviewTask
(
carReviewTask
);
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskSigned.java
View file @
30c41068
...
...
@@ -79,6 +79,10 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
// 获取当前问卷答案
List
<
ReviewDetailsResult
>
carResults
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
//设置企业名称
Task
task
=
taskMapper
.
getTaskByCarTaskId
(
carReviewTask
.
getId
());
carReviewTask
.
setEnterpriseName
(
task
.
getEnterpriseName
());
// 车型审查
setCarDataStatistics
(
carStandardTree
,
carResults
,
carReviewTask
);
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
View file @
30c41068
...
...
@@ -4,15 +4,13 @@ import cn.hutool.http.HttpUtil;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.domain.TestUseCase
;
import
com.ruoyi.domain.vo.CaseResultVO
;
import
com.ruoyi.domain.vo.CountVO
;
import
com.ruoyi.domain.vo.TestUsecaseVO
;
import
com.ruoyi.domain.vo.UseCaseUrlVO
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.mapper.TestUseCaseMapper
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.response.NewTestUserCaseListResponse
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.UseCaseResponse
;
import
okhttp3.*
;
...
...
@@ -272,6 +270,51 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
.
collect
(
Collectors
.
toList
());
}
/*
* 获取科恩数据
* */
@Override
public
NewTestUserCaseListResponse
getCaseListNew
(
String
request
)
throws
IOException
{
NewTestUserCaseListResponse
caseResponse
=
new
NewTestUserCaseListResponse
();
OkHttpClient
client
=
new
OkHttpClient
().
newBuilder
().
build
();
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"query\":\"query regulationItems($name:String!$offset:OffsetConnectionInput$orderBy:OrderByInput$searchFields:Map$withScenarioUseCases:Boolean=true){regulationByName(name:$name){items(offset:$offset orderBy:$orderBy searchFields:$searchFields){totalCount nodes{id serialNumber requirements scenarioUseCases@include(if:$withScenarioUseCases){testScenario useCases{id customizedID description}}}}}}\",\"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
(
"Authorization"
,
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjAsInRva2VuaWQiOjYxLCJ0eXBlIjoiYXBpIiwidXNlcm5hbWUiOiJhZG1pbiJ9.48Ggjx-FtOcecf73vAHn0XglwgLXZlfXxhXiLDHWWQE"
)
// .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
);
// 获取测试标准
if
(
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"regulationByName"
)
!=
null
)
{
List
<
NewStandardVO
>
list
=
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"regulationByName"
).
getJSONObject
(
"items"
).
getList
(
"nodes"
,
NewStandardVO
.
class
);
caseResponse
.
setUseCases
(
list
);
// 获取总条数
Integer
totalCount
=
(
Integer
)
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"regulationByName"
).
getJSONObject
(
"items"
).
get
(
"totalCount"
);
caseResponse
.
setTotalCount
(
totalCount
);
}
else
{
caseResponse
.
setUseCases
(
new
ArrayList
<>());
caseResponse
.
setTotalCount
(
0
);
}
return
caseResponse
;
}
}
...
...
quality-review/src/main/java/com/ruoyi/web/TestUserCaseController.java
View file @
30c41068
...
...
@@ -8,6 +8,7 @@ import com.ruoyi.service.TestUseCaseService;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
com.ruoyi.web.response.NewTestUserCaseListResponse
;
import
com.ruoyi.web.response.TestUserCaseListResponse
;
import
com.ruoyi.web.response.UseCaseResponse
;
import
io.swagger.annotations.Api
;
...
...
@@ -124,4 +125,13 @@ public class TestUserCaseController extends BaseController{
}
@ApiOperation
(
"查询测试用例(科恩)改版"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getUseCaseListNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
R
<
NewTestUserCaseListResponse
>
getUseCaseListNew
(
@Validated
@RequestBody
String
request
)
throws
IOException
{
return
R
.
ok
(
testUseCaseService
.
getCaseListNew
(
request
));
}
}
quality-review/src/main/java/com/ruoyi/web/response/NewTestUserCaseListResponse.java
0 → 100644
View file @
30c41068
package
com
.
ruoyi
.
web
.
response
;
import
com.ruoyi.domain.vo.NewStandardVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"NewTestUserCaseListResponse"
,
description
=
"查询测试用例"
)
@Data
public
class
NewTestUserCaseListResponse
{
@ApiModelProperty
(
"测试用例"
)
List
<
NewStandardVO
>
useCases
;
@ApiModelProperty
(
"总条数"
)
Integer
totalCount
;
@ApiModelProperty
(
"用例总条数"
)
Integer
useCaseNum
;
}
quality-review/src/main/resources/mapper/TaskMapper.xml
View file @
30c41068
...
...
@@ -443,6 +443,11 @@
from t_task
where system_review_task_id = #{id}
</select>
<select
id=
"getTaskByCarTaskId"
resultType=
"com.ruoyi.domain.Task"
>
select *
from t_task
where car_review_task_id = #{id}
</select>
</mapper>
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