Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-api
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
中汽研标准应用数据库
car-database-api
Commits
95bd1d0a
Commit
95bd1d0a
authored
Sep 12, 2024
by
yuanshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.发布评审时进行验重
2.ReviewSceneChangeTask的reviewUsecaseId改为String类型
parent
beb1b944
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
138 additions
and
79 deletions
+138
-79
ReviewSceneChangeTask.java
...src/main/java/com/ruoyi/domain/ReviewSceneChangeTask.java
+1
-1
ReviewSceneChangeTaskService.java
.../java/com/ruoyi/service/ReviewSceneChangeTaskService.java
+2
-1
ReviewSceneChangeTaskServiceImpl.java
.../ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
+51
-5
ReviewStandardServiceImpl.java
...ava/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
+54
-47
StrategyReviewSceneChangeAdd.java
.../com/ruoyi/service/impl/StrategyReviewSceneChangeAdd.java
+0
-12
StrategyReviewSceneChangeDelete.java
...m/ruoyi/service/impl/StrategyReviewSceneChangeDelete.java
+0
-4
StrategyReviewSceneChangeUpdate.java
...m/ruoyi/service/impl/StrategyReviewSceneChangeUpdate.java
+0
-8
ReviewSceneChangeTaskController.java
...n/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
+2
-1
GetSerialNumberRequest.java
...in/java/com/ruoyi/web/request/GetSerialNumberRequest.java
+13
-0
UseCaseRequestNew.java
...rc/main/java/com/ruoyi/web/request/UseCaseRequestNew.java
+15
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/ReviewSceneChangeTask.java
View file @
95bd1d0a
...
...
@@ -235,6 +235,6 @@ public class ReviewSceneChangeTask {
private
String
usecaseDescribe
;
@ApiModelProperty
(
"评审用例id"
)
private
Lo
ng
reviewUsecaseId
;
private
Stri
ng
reviewUsecaseId
;
}
quality-review/src/main/java/com/ruoyi/service/ReviewSceneChangeTaskService.java
View file @
95bd1d0a
...
...
@@ -9,6 +9,7 @@ import com.ruoyi.web.response.ReviewKeyPointListResponse;
import
com.ruoyi.web.response.ReviewOpinionResponse
;
import
com.ruoyi.web.response.ReviewSceneChangeTaskResponse
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -22,7 +23,7 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
/**
* 新建一个任务
*/
void
create
(
ReviewSceneChangeTask
reviewSceneChangeTask
);
void
create
(
ReviewSceneChangeTask
reviewSceneChangeTask
)
throws
IOException
;
/**
* 审核通过一个任务
...
...
quality-review/src/main/java/com/ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
View file @
95bd1d0a
package
com
.
ruoyi
.
service
.
impl
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.toolkit.Db
;
import
com.ruoyi.common.constant.HttpStatus
;
...
...
@@ -10,11 +11,8 @@ import com.ruoyi.domain.ReviewSceneChangeTask;
import
com.ruoyi.domain.ReviewSceneChangeTaskUserRelation
;
import
com.ruoyi.framework.web.domain.server.Sys
;
import
com.ruoyi.mapper.ReviewKeyPointMapper
;
import
com.ruoyi.service.
ReviewSceneChangeTaskService
;
import
com.ruoyi.service.
*
;
import
com.ruoyi.mapper.ReviewSceneChangeTaskMapper
;
import
com.ruoyi.service.ReviewSceneChangeTaskUserRelationService
;
import
com.ruoyi.service.ReviewSceneService
;
import
com.ruoyi.service.ReviewTaskInboxService
;
import
com.ruoyi.system.mapper.SysUserRoleMapper
;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.system.service.ISysUserService
;
...
...
@@ -24,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.IOException
;
import
java.util.*
;
/**
...
...
@@ -61,9 +60,56 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired
private
ReviewKeyPointMapper
reviewKeyPointMapper
;
@Autowired
private
TestUseCaseService
testUseCaseService
;
@Override
public
void
create
(
ReviewSceneChangeTask
reviewSceneChangeTask
)
{
public
void
create
(
ReviewSceneChangeTask
reviewSceneChangeTask
)
throws
IOException
{
//若是新增测试用例 则需要去查看科恩数据库,进行验重
if
(
Objects
.
equals
(
reviewSceneChangeTask
.
getOperationSort
(),
"ADD_USECASE"
)){
GetSerialNumberRequest
getSerialNumberRequest
=
new
GetSerialNumberRequest
();
Offset
offset
=
new
Offset
();
offset
.
setOffset
(
0
);
offset
.
setLimit
(
9999
);
getSerialNumberRequest
.
setOffset
(
offset
);
getSerialNumberRequest
.
setName
(
reviewSceneChangeTask
.
getStandard
());
String
s
=
JSONUtil
.
toJsonStr
(
getSerialNumberRequest
);
List
<
SerialNumberResponse
>
list
=
testUseCaseService
.
getSerialNumberList
(
s
);
for
(
SerialNumberResponse
serialNumberResponse
:
list
){
if
(
Objects
.
equals
(
serialNumberResponse
.
getSerialNumber
(),
reviewSceneChangeTask
.
getUsecaseId
())){
throw
new
ServiceException
(
"用例编号重复"
,
HttpStatus
.
ERROR
);
}
}
}
//若是修改测试用例 则需要去查看科恩数据库去验重
if
(
Objects
.
equals
(
reviewSceneChangeTask
.
getOperationSort
(),
"UPDATE_USECASE"
)){
GetSerialNumberRequest
getSerialNumberRequest
=
new
GetSerialNumberRequest
();
Offset
offset
=
new
Offset
();
offset
.
setOffset
(
0
);
offset
.
setLimit
(
9999
);
getSerialNumberRequest
.
setOffset
(
offset
);
getSerialNumberRequest
.
setName
(
reviewSceneChangeTask
.
getStandard
());
String
s
=
JSONUtil
.
toJsonStr
(
getSerialNumberRequest
);
List
<
SerialNumberResponse
>
list
=
testUseCaseService
.
getSerialNumberList
(
s
);
//先判断用例编号是否有
for
(
SerialNumberResponse
serialNumberResponse
:
list
){
if
(
Objects
.
equals
(
serialNumberResponse
.
getSerialNumber
(),
reviewSceneChangeTask
.
getUsecaseId
())){
if
(!
Objects
.
equals
(
serialNumberResponse
.
getSerialNumber
(),
reviewSceneChangeTask
.
getReviewUsecaseId
())){
throw
new
ServiceException
(
"当前用例编号对象已存在"
,
HttpStatus
.
ERROR
);
}
}
}
}
// 获取当前登陆人
SysUser
loginUser
=
SecurityUtils
.
getLoginUser
().
getUser
();
...
...
quality-review/src/main/java/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
View file @
95bd1d0a
...
...
@@ -113,63 +113,70 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
public
List
<
ReviewStandardResponseAll
>
listByPageAllUseCase
(
ReviewStandardListByPageRequest
request
)
throws
IOException
{
// 创建查询请求对象
UseCaseRequest
useCaseRequest
=
new
UseCaseRequest
();
UseCaseRequest
New
useCaseRequestNew
=
new
UseCaseRequestNew
();
Offset
offset
=
new
Offset
();
offset
.
setOffset
(
0
);
offset
.
setLimit
(
9999
);
useCaseRequest
.
setOffset
(
offset
);
useCaseRequest
.
setName
(
request
.
getName
()
);
offset
.
setOffset
(
(
request
.
getPageNum
()/
request
.
getPageSize
())+
1
);
// offset.setOffset(request.getPageNum()
);
offset
.
setLimit
(
request
.
getPageSize
()
);
useCaseRequest
New
.
setOffset
(
offset
);
useCaseRequestNew
.
setName
(
request
.
getName
());
SearchFields
searchFields
=
new
SearchFields
();
searchFields
.
setSerialNumber
(
request
.
getChapter
());
searchFields
.
setRequirements
(
request
.
getText
());
useCaseRequestNew
.
setSearchFields
(
searchFields
);
// 将请求转换为JSON格式
String
requestJson
=
JSONUtil
.
toJsonStr
(
useCaseRequest
);
String
requestJson
=
JSONUtil
.
toJsonStr
(
useCaseRequest
New
);
// 获取新的测试用例列表响应
TestUserCaseListNewResponse
useCaseListNew
=
testUseCaseService
.
getUseCaseListNew
(
requestJson
);
// 初始化返回的 ReviewStandardResponseAll 列表
List
<
ReviewStandardResponseAll
>
reviewStandardResponseAllList
=
new
ArrayList
<>();
// 如果获取的用例列表不为空
if
(
useCaseListNew
!=
null
&&
useCaseListNew
.
getUseCases
()
!=
null
)
{
// 遍历每个标准要求(StandardNewVO)
for
(
StandardNewVO
standard
:
useCaseListNew
.
getUseCases
())
{
// 创建新的 ReviewStandardResponseAll 对象
ReviewStandardResponseAll
reviewStandard
=
new
ReviewStandardResponseAll
();
// 将 StandardNewVO 的字段映射到 ReviewStandardResponseAll
// ID 转换为 Long
reviewStandard
.
setChapter
(
standard
.
getSerialNumber
());
// 章节号映射
reviewStandard
.
setText
(
standard
.
getRequirements
());
// 标准要求映射为文本内容
reviewStandard
.
setName
(
null
);
// 标准名称(如果需要,手动设置)
reviewStandard
.
setStandardNo
(
null
);
// 标准号(可以手动设置或从其他地方获取)
reviewStandard
.
setType
(
null
);
// 类型字段(可以根据需要填充)
// 处理 UseCaseNewVO 映射到 ReviewKeyPoint 列表
NewTestUserCaseListResponse
caseListNew
=
testUseCaseService
.
getCaseListNew
(
requestJson
);
List
<
ReviewStandardResponseAll
>
reviewStandardResponses
=
new
ArrayList
<>();
// 遍历所有用例
for
(
NewStandardVO
newStandardVO
:
caseListNew
.
getUseCases
())
{
ReviewStandardResponseAll
reviewStandardResponse
=
new
ReviewStandardResponseAll
();
// 处理标准相关信息
/*reviewStandardResponse.setId(Long.parseLong(newStandardVO.getId()));*/
reviewStandardResponse
.
setChapter
(
newStandardVO
.
getSerialNumber
());
reviewStandardResponse
.
setText
(
newStandardVO
.
getRequirements
());
reviewStandardResponse
.
setName
(
request
.
getName
());
// 假设没有提供此信息
reviewStandardResponse
.
setStandardNo
(
request
.
getStandardNo
());
// 假设没有提供此信息
reviewStandardResponse
.
setType
(
"test"
);
// 假设没有提供此信息
// 处理检验内容集合
List
<
ReviewKeyPointNew
>
keyPointList
=
new
ArrayList
<>();
for
(
UseCaseNewVO
useCase
:
standard
.
getUseCases
())
{
// 创建新的 ReviewKeyPoint 对象
ReviewKeyPointNew
reviewKeyPoint
=
new
ReviewKeyPointNew
();
/*reviewKeyPoint.setId(Long.parseLong(useCase.getId())); */
// 用例ID
reviewKeyPoint
.
setText
(
useCase
.
getDescription
());
// 用例描述映射到文本内容
/*reviewKeyPoint.setReviewStandardId(Long.parseLong(standard.getId()));*/
// 设置审查标准ID
reviewKeyPoint
.
setId
(
useCase
.
getCustomizedID
());
// 审查细则列表暂时设置为空,后续可根据需求填充
reviewKeyPoint
.
setReviewDetailsList
(
new
ArrayList
<>());
for
(
NewScenarioUseCasesVO
scenarioUseCaseVO
:
newStandardVO
.
getScenarioUseCases
())
{
ReviewKeyPointNew
keyPoint
=
new
ReviewKeyPointNew
();
// keyPoint.setId(UUID.randomUUID().toString()); // 假设没有id,使用UUID生成
keyPoint
.
setText
(
scenarioUseCaseVO
.
getTestScenario
());
// 将 ReviewKeyPoint 添加到列表
keyPointList
.
add
(
reviewKeyPoint
);
}
// 处理审查细则列表
List
<
ReviewDetails
>
reviewDetailsList
=
new
ArrayList
<>();
for
(
UseCaseNewVO
useCase
:
scenarioUseCaseVO
.
getUseCases
())
{
ReviewDetails
reviewDetails
=
new
ReviewDetails
();
// reviewDetails.setId(Long.parseLong(useCase.getId()));
reviewDetails
.
setText
(
useCase
.
getDescription
());
// 设置检验内容集合(keyPointList)
reviewStandard
.
setKeyPointList
(
keyPointList
);
// 设置冗余信息便于前端显示
reviewDetails
.
setChapter
(
useCase
.
getCustomizedID
());
reviewDetails
.
setStandardText
(
useCase
.
getDescription
());
// 将转换后的 ReviewStandardResponseAll 添加到结果列表中
reviewStandardResponseAllList
.
add
(
reviewStandard
);
reviewDetailsList
.
add
(
reviewDetails
);
}
keyPoint
.
setReviewDetailsList
(
reviewDetailsList
);
keyPointList
.
add
(
keyPoint
);
}
reviewStandardResponse
.
setKeyPointList
(
keyPointList
);
reviewStandardResponses
.
add
(
reviewStandardResponse
);
}
// 返回转换后的 ReviewStandardResponseAll 列表
return
reviewStandardResponseAllList
;
return
reviewStandardResponses
;
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyReviewSceneChangeAdd.java
View file @
95bd1d0a
...
...
@@ -98,18 +98,6 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange,
reviewSceneChangeTaskService
.
updateById
(
reviewSceneChangeTask
);
}
//新增测试用例评审
if
(
Objects
.
equals
(
reviewSceneChangeTask
.
getOperationSort
(),
"ADD_USECASE"
)){
//保存新增的测试用例
ReviewUsecase
reviewUsecase
=
new
ReviewUsecase
();
reviewUsecase
.
setUsecaseDescribe
(
reviewSceneChangeTask
.
getUsecaseDescribe
());
reviewUsecase
.
setUsecaseId
(
reviewSceneChangeTask
.
getUsecaseId
());
reviewUsecase
.
setReviewStandardId
(
reviewSceneChangeTask
.
getStandardId
());
reviewUsecaseMapper
.
insert
(
reviewUsecase
);
//为用例变更任务的场景关联字段赋值
reviewSceneChangeTask
.
setReviewUsecaseId
(
reviewUsecase
.
getId
());
reviewSceneChangeTaskService
.
updateById
(
reviewSceneChangeTask
);
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyReviewSceneChangeDelete.java
View file @
95bd1d0a
...
...
@@ -97,10 +97,6 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
reviewSceneService
.
removeBatchByIds
(
reviewScenesList
);
}
//删除用例
if
(
Objects
.
equals
(
reviewSceneChangeTask
.
getOperationSort
(),
"DELETE_USECASE"
)){
reviewUsecaseMapper
.
deleteById
(
reviewSceneChangeTask
.
getReviewUsecaseId
());
}
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyReviewSceneChangeUpdate.java
View file @
95bd1d0a
...
...
@@ -37,14 +37,6 @@ public class StrategyReviewSceneChangeUpdate implements StrategyReviewSceneChang
reviewSceneService
.
updateById
(
reviewScene
);
}
if
(
Objects
.
equals
(
reviewSceneChangeTask
.
getOperationSort
(),
"UPDATE_USECASE"
)){
ReviewUsecase
reviewUsecase
=
reviewUsecaseMapper
.
getById
(
reviewSceneChangeTask
.
getReviewUsecaseId
());
reviewUsecase
.
setUsecaseDescribe
(
reviewSceneChangeTask
.
getUsecaseDescribe
());
reviewUsecase
.
setUsecaseId
(
reviewSceneChangeTask
.
getNewText
());
reviewUsecaseMapper
.
updateById
(
reviewUsecase
);
}
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
View file @
95bd1d0a
...
...
@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -55,7 +56,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"场景变更任务"
,
businessType
=
BusinessType
.
INSERT
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/add"
)
public
R
<
String
>
create
(
@Validated
@RequestBody
ReviewSceneChangeTaskCreateRequest
request
)
{
public
R
<
String
>
create
(
@Validated
@RequestBody
ReviewSceneChangeTaskCreateRequest
request
)
throws
IOException
{
ReviewSceneChangeTask
reviewSceneChangeTask
=
new
ReviewSceneChangeTask
();
BeanUtils
.
copyBeanProp
(
reviewSceneChangeTask
,
request
);
...
...
quality-review/src/main/java/com/ruoyi/web/request/GetSerialNumberRequest.java
0 → 100644
View file @
95bd1d0a
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GetSerialNumberRequest"
,
description
=
"获取科恩编号id数组"
)
public
class
GetSerialNumberRequest
{
private
Offset
offset
;
private
String
name
;
}
quality-review/src/main/java/com/ruoyi/web/request/UseCaseRequestNew.java
0 → 100644
View file @
95bd1d0a
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
@Data
@ApiModel
public
class
UseCaseRequestNew
{
private
Offset
offset
;
private
SearchFields
searchFields
;
private
String
name
;
}
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