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
359c659d
Commit
359c659d
authored
Mar 22, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存问卷结果
parent
b67750d6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
249 additions
and
37 deletions
+249
-37
ResultFileRelation.java
...ew/src/main/java/com/ruoyi/domain/ResultFileRelation.java
+40
-0
CaseResultVO.java
...eview/src/main/java/com/ruoyi/domain/vo/CaseResultVO.java
+33
-0
DescribeProjectTestResultVO.java
...java/com/ruoyi/domain/vo/DescribeProjectTestResultVO.java
+21
-0
StepResultVO.java
...eview/src/main/java/com/ruoyi/domain/vo/StepResultVO.java
+19
-0
ResultFileRelationMapper.java
.../main/java/com/ruoyi/mapper/ResultFileRelationMapper.java
+14
-0
ResultFileRelationService.java
...ain/java/com/ruoyi/service/ResultFileRelationService.java
+12
-0
ResultFileRelationServiceImpl.java
...com/ruoyi/service/impl/ResultFileRelationServiceImpl.java
+24
-0
ReviewDetailsResultServiceImpl.java
...om/ruoyi/service/impl/ReviewDetailsResultServiceImpl.java
+63
-34
ResultFileRelationMapper.xml
...ew/src/main/resources/mapper/ResultFileRelationMapper.xml
+20
-0
ReviewEnterpriseArchiveMapper.xml
...c/main/resources/mapper/ReviewEnterpriseArchiveMapper.xml
+3
-3
No files found.
quality-review/src/main/java/com/ruoyi/domain/ResultFileRelation.java
0 → 100644
View file @
359c659d
package
com
.
ruoyi
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
@ApiModel
@TableName
(
value
=
"t_result_file_relation"
)
@Data
@Accessors
(
chain
=
true
)
public
class
ResultFileRelation
{
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
id
;
@ApiModelProperty
(
"任务id"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
taskId
;
@ApiModelProperty
(
"结果id"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
resultId
;
@ApiModelProperty
(
"文件id"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
fileId
;
@ApiModelProperty
(
"目录"
)
private
String
catalogue
;
@ApiModelProperty
(
"文件名称"
)
private
String
fileName
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/CaseResultVO.java
0 → 100644
View file @
359c659d
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"CaseResultVO"
,
description
=
"项目用例结果VO"
)
@Data
public
class
CaseResultVO
{
@ApiModelProperty
(
"用例描述"
)
private
String
description
;
@ApiModelProperty
(
"用例id"
)
private
String
id
;
@ApiModelProperty
(
"用例名称"
)
private
String
name
;
@ApiModelProperty
(
"用例修复建议"
)
private
String
remediation
;
@ApiModelProperty
(
"用例风险等级枚举 HIGH:高 MEDIUM:中 LOW:低 NA: 未知"
)
private
String
risk_level
;
@ApiModelProperty
(
"用例检测状态枚举 UNPROCESSED: 未处理 PASSED: 通过 FAILED: 失败 PROCESSING: 处理中 IGNORED: 已忽略"
)
private
String
status
;
@ApiModelProperty
(
"用例步骤结果列表"
)
List
<
StepResultVO
>
step_result_list
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/DescribeProjectTestResultVO.java
0 → 100644
View file @
359c659d
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"DescribeProjectTestResultVO"
,
description
=
"项目检测结果VO"
)
@Data
public
class
DescribeProjectTestResultVO
{
@ApiModelProperty
(
"检测项目id"
)
private
String
id
;
@ApiModelProperty
(
"检测项目名称"
)
private
String
name
;
@ApiModelProperty
(
"项目用例结果列表"
)
List
<
CaseResultVO
>
case_result_list
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/StepResultVO.java
0 → 100644
View file @
359c659d
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"StepResultVO"
,
description
=
"用例步骤结果VO"
)
@Data
public
class
StepResultVO
{
@ApiModelProperty
(
"步骤描述"
)
private
String
description
;
@ApiModelProperty
(
"步骤id"
)
private
String
id
;
@ApiModelProperty
(
"步骤名称"
)
private
String
name
;
}
quality-review/src/main/java/com/ruoyi/mapper/ResultFileRelationMapper.java
0 → 100644
View file @
359c659d
package
com
.
ruoyi
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.domain.ResultFileRelation
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
ResultFileRelationMapper
extends
BaseMapper
<
ResultFileRelation
>
{
List
<
ResultFileRelation
>
findByResultId
(
@Param
(
"resultId"
)
Long
resultId
);
}
quality-review/src/main/java/com/ruoyi/service/ResultFileRelationService.java
0 → 100644
View file @
359c659d
package
com
.
ruoyi
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.domain.ResultFileRelation
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
ResultFileRelationService
extends
IService
<
ResultFileRelation
>
{
List
<
ResultFileRelation
>
findByResultId
(
Long
resultId
);
}
quality-review/src/main/java/com/ruoyi/service/impl/ResultFileRelationServiceImpl.java
0 → 100644
View file @
359c659d
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.domain.ResultFileRelation
;
import
com.ruoyi.mapper.ResultFileRelationMapper
;
import
com.ruoyi.service.ResultFileRelationService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Transactional
@Service
public
class
ResultFileRelationServiceImpl
extends
ServiceImpl
<
ResultFileRelationMapper
,
ResultFileRelation
>
implements
ResultFileRelationService
{
@Autowired
private
ResultFileRelationMapper
resultFileRelationMapper
;
@Override
public
List
<
ResultFileRelation
>
findByResultId
(
Long
resultId
)
{
return
resultFileRelationMapper
.
findByResultId
(
resultId
);
}
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewDetailsResultServiceImpl.java
View file @
359c659d
...
...
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.domain.ResultFileRelation
;
import
com.ruoyi.domain.ReviewDetailsResult
;
import
com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO
;
import
com.ruoyi.mapper.ResultFileRelationMapper
;
import
com.ruoyi.service.ResultFileRelationService
;
import
com.ruoyi.service.ReviewDetailsResultService
;
import
com.ruoyi.mapper.ReviewDetailsResultMapper
;
import
com.ruoyi.web.request.ReviewDetailsResultSaveRequest
;
...
...
@@ -29,6 +32,9 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
@Autowired
private
ReviewDetailsResultMapper
reviewDetailsResultMapper
;
@Autowired
private
ResultFileRelationService
resultFileRelationService
;
@Override
public
List
<
ReviewDetailsResult
>
findByTaskId
(
Long
taskId
)
{
return
reviewDetailsResultMapper
.
findByTaskId
(
taskId
);
...
...
@@ -53,26 +59,11 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
result
.
setLastModifyTime
(
new
Date
());
result
.
setComment
(
request
.
getComment
());
// 获取文件列表
List
<
ReviewEnterpriseArchiveFileVO
>
fileList
=
request
.
getFileList
();
List
<
Long
>
idList
=
new
ArrayList
<>();
List
<
String
>
fileNameList
=
new
ArrayList
<>();
List
<
String
>
catalogueList
=
new
ArrayList
<>();
// 遍历fileList
for
(
ReviewEnterpriseArchiveFileVO
fileVO
:
fileList
)
{
// 将字段逗号分隔后存入对应的集合中
idList
.
add
(
fileVO
.
getId
());
fileNameList
.
add
(
fileVO
.
getFileName
());
catalogueList
.
add
(
fileVO
.
getCatalogue
());
}
result
.
setReviewEnterpriseArchiveId
(
StringUtils
.
join
(
idList
,
","
));
result
.
setFileName
(
StringUtils
.
join
(
fileNameList
,
","
));
result
.
setCatalogue
(
StringUtils
.
join
(
catalogueList
,
","
));
Save
(
result
,
request
);
this
.
baseMapper
.
updateById
(
result
);
SaveFileRelation
(
result
.
getId
(),
request
);
}
else
{
// 新增
ReviewDetailsResult
reviewDetailsResult
=
new
ReviewDetailsResult
();
...
...
@@ -84,27 +75,65 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
reviewDetailsResult
.
setLastModifyTime
(
new
Date
());
reviewDetailsResult
.
setComment
(
request
.
getComment
());
// 获取文件列表
List
<
ReviewEnterpriseArchiveFileVO
>
fileList
=
request
.
getFileList
();
Save
(
reviewDetailsResult
,
request
);
List
<
Long
>
idList
=
new
ArrayList
<>();
List
<
String
>
fileNameList
=
new
ArrayList
<>();
List
<
String
>
catalogueList
=
new
ArrayList
<>();
this
.
baseMapper
.
insert
(
reviewDetailsResult
);
// 遍历fileList
for
(
ReviewEnterpriseArchiveFileVO
fileVO
:
fileList
)
{
// 将字段逗号分隔后存入对应的集合中
idList
.
add
(
fileVO
.
getId
());
fileNameList
.
add
(
fileVO
.
getFileName
());
catalogueList
.
add
(
fileVO
.
getCatalogue
());
}
SaveFileRelation
(
reviewDetailsResult
.
getId
(),
request
);
reviewDetailsResult
.
setReviewEnterpriseArchiveId
(
StringUtils
.
join
(
idList
,
","
));
reviewDetailsResult
.
setFileName
(
StringUtils
.
join
(
fileNameList
,
","
));
reviewDetailsResult
.
setCatalogue
(
StringUtils
.
join
(
catalogueList
,
","
));
}
}
this
.
baseMapper
.
insert
(
reviewDetailsResult
);
private
void
Save
(
ReviewDetailsResult
result
,
ReviewDetailsResultSaveRequest
request
)
{
// 获取文件列表
List
<
ReviewEnterpriseArchiveFileVO
>
fileList
=
request
.
getFileList
();
List
<
Long
>
idList
=
new
ArrayList
<>();
List
<
String
>
fileNameList
=
new
ArrayList
<>();
List
<
String
>
catalogueList
=
new
ArrayList
<>();
// 遍历fileList
for
(
ReviewEnterpriseArchiveFileVO
fileVO
:
fileList
)
{
// 将字段逗号分隔后存入对应的集合中
idList
.
add
(
fileVO
.
getId
());
fileNameList
.
add
(
fileVO
.
getFileName
());
catalogueList
.
add
(
fileVO
.
getCatalogue
());
}
result
.
setReviewEnterpriseArchiveId
(
StringUtils
.
join
(
idList
,
","
));
result
.
setFileName
(
StringUtils
.
join
(
fileNameList
,
","
));
result
.
setCatalogue
(
StringUtils
.
join
(
catalogueList
,
","
));
}
private
void
SaveFileRelation
(
Long
resultId
,
ReviewDetailsResultSaveRequest
request
)
{
List
<
ResultFileRelation
>
relationList
=
resultFileRelationService
.
findByResultId
(
resultId
);
if
(
relationList
!=
null
&&
relationList
.
size
()
!=
0
)
{
resultFileRelationService
.
removeBatchByIds
(
relationList
);
}
// 获取文件列表
List
<
ReviewEnterpriseArchiveFileVO
>
fileList
=
request
.
getFileList
();
if
(
fileList
!=
null
&&
fileList
.
size
()
!=
0
)
{
List
<
ResultFileRelation
>
list
=
new
ArrayList
<>();
for
(
ReviewEnterpriseArchiveFileVO
file
:
fileList
)
{
ResultFileRelation
relation
=
new
ResultFileRelation
();
relation
.
setFileId
(
file
.
getId
());
relation
.
setFileName
(
file
.
getFileName
());
relation
.
setCatalogue
(
file
.
getCatalogue
());
relation
.
setResultId
(
resultId
);
relation
.
setTaskId
(
request
.
getTaskId
());
// 将relation添加到list中
list
.
add
(
relation
);
}
resultFileRelationService
.
saveBatch
(
list
);
}
}
}
...
...
quality-review/src/main/resources/mapper/ResultFileRelationMapper.xml
0 → 100644
View file @
359c659d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.mapper.ResultFileRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.domain.ResultFileRelation"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<result
property=
"taskId"
column=
"task_id"
jdbcType=
"BIGINT"
/>
<result
property=
"resultId"
column=
"result_id"
jdbcType=
"BIGINT"
/>
<result
property=
"fileId"
column=
"file_id"
jdbcType=
"BIGINT"
/>
<result
property=
"catalogue"
column=
"catalogue"
jdbcType=
"VARCHAR"
/>
<result
property=
"fileName"
column=
"file_name"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"findByResultId"
resultType=
"com.ruoyi.domain.ResultFileRelation"
>
select id,task_id,result_id,file_id,catalogue,file_name from t_result_file_relation
where result_id = #{resultId}
</select>
</mapper>
quality-review/src/main/resources/mapper/ReviewEnterpriseArchiveMapper.xml
View file @
359c659d
...
...
@@ -24,16 +24,16 @@
</select>
<select
id=
"findViewItemVOByTaskId"
resultType=
"com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO"
>
SELECT
re
sult
.catalogue AS catalogue,
re
lation
.catalogue AS catalogue,
standard.chapter AS chapter,
standard.text AS standard,
keypoint.text AS keyPoint,
archive.
id AS archiveId
relation.file_
id AS archiveId
FROM t_review_details_result result
LEFT JOIN t_review_details details ON result.review_details_id = details.id
LEFT JOIN t_review_keypoint keypoint ON details.review_keypoint_id = keypoint.id
LEFT JOIN t_review_standard standard ON keypoint.review_standard_id = standard.id
LEFT JOIN t_re
view_enterprise_archive archive ON result.review_enterprise_archive_id = archive.
id
LEFT JOIN t_re
sult_file_relation relation ON result.id = relation.result_
id
WHERE result.task_id = #{taskId} AND details.id IS NOT NULL;
</select>
<select
id=
"findFileName"
resultType=
"java.lang.Long"
>
...
...
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