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
6388f8fc
Commit
6388f8fc
authored
Mar 27, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检验内容库 - 检验内容 - 关联测试用例
parent
209a7e09
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
225 additions
and
15 deletions
+225
-15
TestUseCase.java
...ty-review/src/main/java/com/ruoyi/domain/TestUseCase.java
+9
-0
OptionalUseCasesVO.java
...src/main/java/com/ruoyi/domain/vo/OptionalUseCasesVO.java
+31
-0
TestUseCaseMapper.java
...iew/src/main/java/com/ruoyi/mapper/TestUseCaseMapper.java
+8
-0
ReviewStandardService.java
...rc/main/java/com/ruoyi/service/ReviewStandardService.java
+15
-4
ReviewStandardServiceImpl.java
...ava/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
+41
-7
ReviewStandardController.java
...src/main/java/com/ruoyi/web/ReviewStandardController.java
+27
-4
ReviewStandardSaveStandardUsecaseRequest.java
...web/request/ReviewStandardSaveStandardUsecaseRequest.java
+31
-0
ReviewStandardStandardUsecaseRequest.java
...oyi/web/request/ReviewStandardStandardUsecaseRequest.java
+24
-0
ReviewStandardStandardUsecaseResponse.java
...i/web/response/ReviewStandardStandardUsecaseResponse.java
+30
-0
TestUseCaseMapper.xml
...ty-review/src/main/resources/mapper/TestUseCaseMapper.xml
+9
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/TestUseCase.java
View file @
6388f8fc
...
...
@@ -7,7 +7,10 @@ import java.util.Date;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 测试用例
...
...
@@ -15,6 +18,9 @@ import lombok.Data;
*/
@TableName
(
value
=
"t_test_usecase"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
TestUseCase
implements
Serializable
{
/**
* 主键
...
...
@@ -90,6 +96,9 @@ public class TestUseCase implements Serializable {
@ApiModelProperty
(
"用例ID"
)
private
String
caseId
;
@ApiModelProperty
(
"标准条款ID"
)
private
Long
reviewStandardId
;
/**
* 返回用例在矩阵中的坐标
* @return
...
...
quality-review/src/main/java/com/ruoyi/domain/vo/OptionalUseCasesVO.java
0 → 100644
View file @
6388f8fc
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 可显示用例
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
OptionalUseCasesVO
{
@ApiModelProperty
(
"禁用"
)
private
Boolean
disabled
;
@ApiModelProperty
(
"值"
)
private
Long
key
;
@ApiModelProperty
(
"键"
)
private
String
label
;
@ApiModelProperty
(
"标准ID"
)
private
Long
standardId
;
}
quality-review/src/main/java/com/ruoyi/mapper/TestUseCaseMapper.java
View file @
6388f8fc
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.mapper;
import
com.ruoyi.domain.TestUseCase
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.domain.vo.OptionalUseCasesVO
;
import
com.ruoyi.domain.vo.TestUsecaseVO
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -31,6 +32,13 @@ public interface TestUseCaseMapper extends BaseMapper<TestUseCase> {
* @return
*/
List
<
TestUsecaseVO
>
selectListByTaskId
(
Long
id
);
/**
* 查询测试用例列表
* @return
*/
List
<
OptionalUseCasesVO
>
selectOptionalUsecase
();
}
...
...
quality-review/src/main/java/com/ruoyi/service/ReviewStandardService.java
View file @
6388f8fc
...
...
@@ -5,10 +5,8 @@ import com.ruoyi.domain.ReviewStandard;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.response.ReviewStandardInspectionContentResponse
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.response.ReviewStandardResponse
;
import
com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse
;
import
com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest
;
import
com.ruoyi.web.response.*
;
import
java.util.List
;
...
...
@@ -59,4 +57,17 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
// 标准-要点-细则
List
<
ReviewStandard
>
findDetailsList
(
ReviewFindListRequest
request
);
/**
* 选择标准-测试用例
* @param standardId
* @return
*/
ReviewStandardStandardUsecaseResponse
selectStandardUsecase
(
Long
standardId
);
/**
* 保存 标准-检验内容-用例
* @param request
*/
void
saveStandardUsecase
(
ReviewStandardSaveStandardUsecaseRequest
request
);
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
View file @
6388f8fc
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.utils.SnowflakeUtil
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.mapper.ReviewDetailsMapper
;
import
com.ruoyi.mapper.ReviewKeyPointMapper
;
import
com.ruoyi.mapper.ReviewStandardMapper
;
import
com.ruoyi.domain.vo.OptionalUseCasesVO
;
import
com.ruoyi.mapper.*
;
import
com.ruoyi.service.*
;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.response.ReviewStandardInspectionContentResponse
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.response.ReviewStandardResponse
;
import
com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse
;
import
com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest
;
import
com.ruoyi.web.response.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -21,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Transactional
@Service
...
...
@@ -44,6 +44,9 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
@Autowired
private
ReviewDetailsMapper
reviewDetailsMapper
;
@Autowired
private
TestUseCaseMapper
testUseCaseMapper
;
/**
* 查询所有审查 标准、要点、细则、场景 并组织成树状结构返回
* @param standardId 关联到标准库中的id
...
...
@@ -140,6 +143,37 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
return
buildStandard
(
standardList
,
keyPointListTree
);
}
/**
* 选择 标准-用例
* @param standardId
* @return
*/
@Override
public
ReviewStandardStandardUsecaseResponse
selectStandardUsecase
(
Long
standardId
)
{
ReviewStandardStandardUsecaseResponse
response
=
new
ReviewStandardStandardUsecaseResponse
();
// 查询当前所有的测试用例
List
<
OptionalUseCasesVO
>
testUseCases
=
testUseCaseMapper
.
selectOptionalUsecase
();
// 查看此标准下所有的测试用例
List
<
TestUseCase
>
usecaseRelationList
=
testUseCaseMapper
.
selectList
(
new
QueryWrapper
<
TestUseCase
>().
eq
(
"review_standard_id"
,
standardId
));
// 此标准还可以选择的用例
List
<
OptionalUseCasesVO
>
optionalUseCasesVOList
=
testUseCases
.
stream
().
filter
(
a
->
!
a
.
getStandardId
().
equals
(
standardId
)).
collect
(
Collectors
.
toList
());
optionalUseCasesVOList
.
stream
().
forEach
(
obj
->
obj
.
setDisabled
(
false
));
response
.
setOptionalUseCasesList
(
optionalUseCasesVOList
);
response
.
setSelectedUseCaseList
(
usecaseRelationList
.
stream
().
map
(
TestUseCase:
:
getId
).
collect
(
Collectors
.
toList
()));
return
response
;
}
/**
* 保存 标准-用例
* @param request
*/
@Override
public
void
saveStandardUsecase
(
ReviewStandardSaveStandardUsecaseRequest
request
)
{
testUseCaseMapper
.
update
(
TestUseCase
.
builder
().
reviewStandardId
(
request
.
getStandardId
()).
build
(),
new
UpdateWrapper
<
TestUseCase
>().
in
(
"id"
,
request
.
getUsecaseIdList
()));
}
/**
* 将审查 标准、要点、细则、场景 按照父子关系拆分写入到各自的表中
* @param reviewStandardList
...
...
quality-review/src/main/java/com/ruoyi/web/ReviewStandardController.java
View file @
6388f8fc
...
...
@@ -8,10 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
import
com.ruoyi.domain.ReviewStandard
;
import
com.ruoyi.service.ReviewStandardService
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.response.ReviewStandardInspectionContentResponse
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.response.ReviewStandardResponse
;
import
com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse
;
import
com.ruoyi.web.response.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
...
...
@@ -72,6 +69,32 @@ public class ReviewStandardController extends BaseController {
return
R
.
ok
(
response
);
}
/**
* 查询 标准-检验内容-用例
* @param request
* @return
*/
@Anonymous
@ApiOperation
(
"查询 标准-检验内容-用例"
)
@PostMapping
(
"/test/getStandardUsecase"
)
public
R
<
ReviewStandardStandardUsecaseResponse
>
getStandardUsecase
(
@Validated
@RequestBody
ReviewStandardStandardUsecaseRequest
request
)
{
ReviewStandardStandardUsecaseResponse
response
=
reviewStandardService
.
selectStandardUsecase
(
request
.
getStandardId
());
return
R
.
ok
(
response
);
}
/**
* 保存 标准-检验内容-用例
* @param request
* @return
*/
@Anonymous
@ApiOperation
(
"保存 标准-检验内容-用例"
)
@PostMapping
(
"/test/saveStandardUsecase"
)
public
R
<
Boolean
>
saveStandardUsecase
(
@Validated
@RequestBody
ReviewStandardSaveStandardUsecaseRequest
request
)
{
reviewStandardService
.
saveStandardUsecase
(
request
);
return
R
.
ok
(
true
);
}
@ApiOperation
(
"查询标注要求列表"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
...
...
quality-review/src/main/java/com/ruoyi/web/request/ReviewStandardSaveStandardUsecaseRequest.java
0 → 100644
View file @
6388f8fc
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* 保存标准用例请求DTO
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"保存标准用例请求DTO"
)
public
class
ReviewStandardSaveStandardUsecaseRequest
{
@ApiModelProperty
(
"标准ID"
)
@NotNull
(
message
=
"标准ID不能为空"
)
private
Long
standardId
;
@ApiModelProperty
(
"用例ID集合"
)
private
List
<
Long
>
usecaseIdList
;
}
quality-review/src/main/java/com/ruoyi/web/request/ReviewStandardStandardUsecaseRequest.java
0 → 100644
View file @
6388f8fc
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 标准-用例 请求
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"标准-用例 请求"
)
public
class
ReviewStandardStandardUsecaseRequest
{
@ApiModelProperty
(
"标准ID"
)
private
Long
standardId
;
}
quality-review/src/main/java/com/ruoyi/web/response/ReviewStandardStandardUsecaseResponse.java
0 → 100644
View file @
6388f8fc
package
com
.
ruoyi
.
web
.
response
;
import
com.ruoyi.domain.vo.OptionalUseCasesVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* 标准-用例 返回 DTO
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"标准-用例 返回 DTO"
)
public
class
ReviewStandardStandardUsecaseResponse
{
@ApiModelProperty
(
"可选择用例"
)
private
List
<
OptionalUseCasesVO
>
optionalUseCasesList
;
@ApiModelProperty
(
"已选择用例"
)
private
List
<
Long
>
selectedUseCaseList
;
}
quality-review/src/main/resources/mapper/TestUseCaseMapper.xml
View file @
6388f8fc
...
...
@@ -76,4 +76,13 @@
where
mtt.id = #{id}
</select>
<select
id=
"selectOptionalUsecase"
resultType=
"com.ruoyi.domain.vo.OptionalUseCasesVO"
>
select
id AS `key`,
CONCAT('(', usecase_no, ')', name) AS label,
review_standard_id AS standardId
from
t_test_usecase
</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