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
2ba126fc
Commit
2ba126fc
authored
Aug 30, 2024
by
yuanshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改解析Excel文件代码,新增获取场景列表集合接口
parent
b47e3b9c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
20 deletions
+63
-20
ReviewKeyPointMapper.java
.../src/main/java/com/ruoyi/mapper/ReviewKeyPointMapper.java
+12
-0
ReviewSceneChangeTaskService.java
.../java/com/ruoyi/service/ReviewSceneChangeTaskService.java
+5
-0
ReviewSceneChangeTaskServiceImpl.java
.../ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
+9
-4
ReviewSceneChangeTaskController.java
...n/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
+20
-10
TaskController.java
...ty-review/src/main/java/com/ruoyi/web/TaskController.java
+12
-5
ReviewDetailsListResponse.java
...ava/com/ruoyi/web/response/ReviewDetailsListResponse.java
+1
-1
ReviewKeyPointMapper.xml
...review/src/main/resources/mapper/ReviewKeyPointMapper.xml
+4
-0
No files found.
quality-review/src/main/java/com/ruoyi/mapper/ReviewKeyPointMapper.java
View file @
2ba126fc
...
...
@@ -7,6 +7,7 @@ import com.ruoyi.domain.ReviewStandard;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.response.ReviewDetailsListResponse
;
import
com.ruoyi.web.response.ReviewKeyPointListResponse
;
import
com.ruoyi.web.response.ReviewSceneListResponse
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -23,7 +24,18 @@ public interface ReviewKeyPointMapper extends BaseMapper<ReviewKeyPoint> {
// 根据细则列表查询要点列表
List
<
ReviewKeyPoint
>
findByDetailsList
(
@Param
(
"detailsList"
)
List
<
ReviewDetails
>
detailsList
);
/*
* 发起评审-获取要点列表
* */
List
<
ReviewKeyPointListResponse
>
getKeyPointList
(
@Param
(
"standardId"
)
Long
standardId
);
/*
* 发起评审-获取细则列表
* */
List
<
ReviewDetailsListResponse
>
getDetailsList
(
@Param
(
"keypointId"
)
Long
keypointId
);
/*
* 发起评审-获取场景列表
* */
List
<
ReviewSceneListResponse
>
getSceneList
(
@Param
(
"detailsId"
)
Long
detailsId
);
}
quality-review/src/main/java/com/ruoyi/service/ReviewSceneChangeTaskService.java
View file @
2ba126fc
...
...
@@ -9,6 +9,7 @@ import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import
com.ruoyi.web.response.ReviewDetailsListResponse
;
import
com.ruoyi.web.response.ReviewKeyPointListResponse
;
import
com.ruoyi.web.response.ReviewSceneChangeTaskResponse
;
import
com.ruoyi.web.response.ReviewSceneListResponse
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -115,4 +116,8 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
* */
List
<
ReviewDetailsListResponse
>
getDetailsList
(
Long
keypointId
);
/*
* 发起评审-获取场景列表
* */
List
<
ReviewSceneListResponse
>
getSceneList
(
Long
detailsId
);
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
View file @
2ba126fc
...
...
@@ -22,10 +22,7 @@ import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import
com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest
;
import
com.ruoyi.web.response.ReviewDetailsListResponse
;
import
com.ruoyi.web.response.ReviewKeyPointListResponse
;
import
com.ruoyi.web.response.ReviewSceneChangeTaskResponse
;
import
com.ruoyi.web.response.ReviewerListResponse
;
import
com.ruoyi.web.response.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -497,6 +494,14 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
public
List
<
ReviewDetailsListResponse
>
getDetailsList
(
Long
keypointId
)
{
return
reviewKeyPointMapper
.
getDetailsList
(
keypointId
);
}
/*
* 发起评审-获取场景列表
* */
@Override
public
List
<
ReviewSceneListResponse
>
getSceneList
(
Long
detailsId
)
{
return
reviewKeyPointMapper
.
getSceneList
(
detailsId
);
}
}
...
...
quality-review/src/main/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
View file @
2ba126fc
...
...
@@ -11,11 +11,8 @@ import com.ruoyi.domain.ReviewSceneChangeTask;
import
com.ruoyi.service.ReviewSceneChangeTaskService
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskCreateRequest
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest
;
import
com.ruoyi.web.response.ReviewDetailsListResponse
;
import
com.ruoyi.web.response.ReviewKeyPointListResponse
;
import
com.ruoyi.web.response.ReviewSceneChangeTaskResponse
;
import
com.ruoyi.web.response.*
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.response.ReviewSceneChangeTaskResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -167,12 +164,12 @@ public class ReviewSceneChangeTaskController extends BaseController {
}
/*
* 发起评审-
新增审查场景-
获取要点列表
* 发起评审-获取要点列表
* */
@ApiOperation
(
"发起评审-
新增审查场景-
获取要点列表"
)
@ApiOperation
(
"发起评审-获取要点列表"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"发起评审-
新增审查场景-
获取要点列表"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"发起评审-获取要点列表"
,
businessType
=
BusinessType
.
UPDATE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getKeyPointList"
)
public
R
<
List
<
ReviewKeyPointListResponse
>>
getKeyPointList
(
@Validated
@RequestBody
ReviewKeyPointListRequest
request
){
Long
id
=
Long
.
parseLong
(
request
.
getStandardId
());
...
...
@@ -181,12 +178,12 @@ public class ReviewSceneChangeTaskController extends BaseController {
}
/*
* 发起评审-
新增审查场景-
获取细则列表
* 发起评审-获取细则列表
* */
@ApiOperation
(
"发起评审-
新增审查场景-
获取细则列表"
)
@ApiOperation
(
"发起评审-获取细则列表"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"发起评审-
新增审查场景-
获取细则列表"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"发起评审-获取细则列表"
,
businessType
=
BusinessType
.
UPDATE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getDetailsList"
)
public
R
<
List
<
ReviewDetailsListResponse
>>
getKeyPointList
(
@Validated
@RequestBody
ReviewDetailsListRequest
request
){
Long
id
=
Long
.
parseLong
(
request
.
getKeypointId
());
...
...
@@ -194,4 +191,17 @@ public class ReviewSceneChangeTaskController extends BaseController {
return
R
.
ok
(
list
);
}
/*
* 发起评审-获取场景列表
* */
@ApiOperation
(
"发起评审-获取场景列表"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"发起评审-获取场景列表"
,
businessType
=
BusinessType
.
UPDATE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getSceneList"
)
public
R
<
List
<
ReviewSceneListResponse
>>
getSceneList
(
@Validated
@RequestBody
ReviewSceneListRequest
request
){
Long
id
=
Long
.
parseLong
(
request
.
getDetailsId
());
List
<
ReviewSceneListResponse
>
list
=
reviewSceneChangeTaskService
.
getSceneList
(
id
);
return
R
.
ok
(
list
);
}
}
quality-review/src/main/java/com/ruoyi/web/TaskController.java
View file @
2ba126fc
...
...
@@ -188,6 +188,7 @@ public class TaskController extends BaseController {
return
R
.
ok
(
response
);
}
/*
* 开启车型实验任务时-上传文件
* */
...
...
@@ -205,7 +206,7 @@ public class TaskController extends BaseController {
Workbook
workbook
=
WorkbookFactory
.
create
(
file
.
getInputStream
());
Sheet
sheet
=
workbook
.
getSheetAt
(
3
);
// 获取第4个工作表
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
String
>
u
seCaseList
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
duplicatedU
seCaseList
=
new
ArrayList
<>();
// 获取第一行并查找“用例编号”所在的列
Row
headerRow
=
sheet
.
getRow
(
0
);
...
...
@@ -222,26 +223,32 @@ public class TaskController extends BaseController {
}
if
(
targetColumnIndex
==
-
1
)
{
workbook
.
close
();
return
R
.
fail
(
"没找到测试用例列"
);
}
// 设置 "name" 为 "用例编号"
result
.
put
(
"name"
,
"用例编号"
);
// 遍历行,提取“用例编号”列的数据
// 遍历行,提取“用例编号”列的数据
并构造新格式
for
(
int
i
=
1
;
i
<=
sheet
.
getLastRowNum
();
i
++)
{
Row
row
=
sheet
.
getRow
(
i
);
if
(
row
!=
null
)
{
Cell
cell
=
row
.
getCell
(
targetColumnIndex
);
// 获取“用例编号”列的单元格
if
(
cell
!=
null
&&
!
cell
.
toString
().
trim
().
isEmpty
())
{
useCaseList
.
add
(
cell
.
toString
().
trim
());
// 将非空的单元格数据添加到列表
Map
<
String
,
String
>
useCaseMap
=
new
HashMap
<>();
useCaseMap
.
put
(
"useCaseDisplayOrCustomizedID"
,
cell
.
toString
().
trim
());
// 将用例编号作为新的Map的值
duplicatedUseCaseList
.
add
(
useCaseMap
);
// 添加到列表
}
}
}
if
(
useCaseList
.
isEmpty
()){
if
(
duplicatedUseCaseList
.
isEmpty
())
{
workbook
.
close
();
return
R
.
fail
(
"测试用例id不能为空"
);
}
result
.
put
(
"useCaseList"
,
useCaseList
);
// 设置 "useCaseList" 为解析的数据列表
result
.
put
(
"duplicatedUseCaseList"
,
duplicatedUseCaseList
);
// 使用新的格式存储数据
workbook
.
close
();
return
R
.
ok
(
result
);
...
...
quality-review/src/main/java/com/ruoyi/web/response/ReviewDetailsListResponse.java
View file @
2ba126fc
...
...
@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"Review
KeyPoint
ListResponse"
,
description
=
"查询细则列表返回结果"
)
@ApiModel
(
value
=
"Review
Details
ListResponse"
,
description
=
"查询细则列表返回结果"
)
@Data
public
class
ReviewDetailsListResponse
{
...
...
quality-review/src/main/resources/mapper/ReviewKeyPointMapper.xml
View file @
2ba126fc
...
...
@@ -34,5 +34,9 @@
select id, text from t_review_details
where review_keypoint_id = #{keypointId}
</select>
<select
id=
"getSceneList"
resultType=
"com.ruoyi.web.response.ReviewSceneListResponse"
>
select id,text from t_review_scene
where review_details_id = #{detailsId}
</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