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
e3d9cba8
Commit
e3d9cba8
authored
Jul 02, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取车型试验步骤附件列表
parent
337819d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
10 deletions
+83
-10
TestRecords.java
...ty-review/src/main/java/com/ruoyi/domain/TestRecords.java
+6
-0
AttachmentVO.java
...eview/src/main/java/com/ruoyi/domain/vo/AttachmentVO.java
+19
-0
StepResultVO.java
...eview/src/main/java/com/ruoyi/domain/vo/StepResultVO.java
+5
-0
TestRecordsServiceImpl.java
...n/java/com/ruoyi/service/impl/TestRecordsServiceImpl.java
+47
-8
TestRecordsMapper.xml
...ty-review/src/main/resources/mapper/TestRecordsMapper.xml
+6
-2
No files found.
quality-review/src/main/java/com/ruoyi/domain/TestRecords.java
View file @
e3d9cba8
...
...
@@ -56,4 +56,10 @@ public class TestRecords {
@ApiModelProperty
(
"测试详情"
)
private
String
testDetails
;
@ApiModelProperty
(
"附件id"
)
private
String
attachmentId
;
@ApiModelProperty
(
"附件名称"
)
private
String
attachmentName
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/AttachmentVO.java
0 → 100644
View file @
e3d9cba8
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"AttachmentVO"
,
description
=
"步骤附件列表VO"
)
@Data
public
class
AttachmentVO
{
@ApiModelProperty
(
"附件id"
)
private
String
id
;
@ApiModelProperty
(
"附件名称"
)
private
String
name
;
@ApiModelProperty
(
"附件url"
)
private
String
url
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/StepResultVO.java
View file @
e3d9cba8
...
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"StepResultVO"
,
description
=
"用例步骤结果VO"
)
@Data
public
class
StepResultVO
{
...
...
@@ -16,4 +18,7 @@ public class StepResultVO {
@ApiModelProperty
(
"步骤名称"
)
private
String
name
;
@ApiModelProperty
(
"步骤附件列表"
)
List
<
AttachmentVO
>
attachment_list
;
}
quality-review/src/main/java/com/ruoyi/service/impl/TestRecordsServiceImpl.java
View file @
e3d9cba8
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.domain.TestRecords
;
import
com.ruoyi.domain.vo.AttachmentVO
;
import
com.ruoyi.domain.vo.CaseResultVO
;
import
com.ruoyi.domain.vo.StepResultVO
;
import
com.ruoyi.mapper.TestRecordsMapper
;
...
...
@@ -102,7 +103,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
List
<
String
>
stepList
=
new
ArrayList
<>();
List
<
String
>
testDetailsList
=
new
ArrayList
<>();
int
index
=
1
;
// 序号从1开始
String
testDetailsVO
=
""
;
String
Builder
testDetailsVO
=
new
StringBuilder
()
;
for
(
StepResultVO
stepResultVO
:
stepResultVOS
)
{
// 测试方法
String
stepName
=
stepResultVO
.
getName
();
...
...
@@ -118,11 +119,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if
(
testDetails
!=
null
)
{
testDetails
=
convertMarkdownToHtml
(
testDetails
);
}
testDetailsVO
+=
testDetails
+
"<br> "
;
testDetailsVO
.
append
(
testDetails
).
append
(
"<br> "
);
// 步骤附件列表
List
<
AttachmentVO
>
attachmentVOS
=
stepResultVO
.
getAttachment_list
();
if
(
attachmentVOS
!=
null
&&
attachmentVOS
.
size
()
!=
0
)
{
// 附件id
StringBuilder
attachmentId
=
new
StringBuilder
();
// 附件名称
StringBuilder
attachmentName
=
new
StringBuilder
();
for
(
AttachmentVO
vo
:
attachmentVOS
)
{
attachmentId
.
append
(
vo
.
getId
()).
append
(
"、"
);
attachmentName
.
append
(
vo
.
getName
()).
append
(
"、"
);
}
attachmentId
=
new
StringBuilder
(
attachmentId
.
substring
(
0
,
attachmentId
.
length
()
-
1
));
attachmentName
=
new
StringBuilder
(
attachmentName
.
substring
(
0
,
attachmentName
.
length
()
-
1
));
testRecords
.
setAttachmentId
(
attachmentId
.
toString
());
testRecords
.
setAttachmentName
(
attachmentName
.
toString
());
}
}
testDetailsVO
=
testDetailsVO
.
substring
(
0
,
testDetailsVO
.
length
()
-
1
);
testDetailsVO
=
new
StringBuilder
(
testDetailsVO
.
substring
(
0
,
testDetailsVO
.
length
()
-
1
)
);
testRecords
.
setTestMethod
(
StringUtils
.
join
(
stepList
,
"\n"
));
testRecords
.
setTestDetails
(
testDetailsVO
);
testRecords
.
setTestDetails
(
testDetailsVO
.
toString
()
);
}
list
.
add
(
testRecords
);
...
...
@@ -188,7 +208,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
List
<
String
>
stepList
=
new
ArrayList
<>();
List
<
String
>
testDetailsList
=
new
ArrayList
<>();
int
index
=
1
;
// 序号从1开始
String
testDetailsVO
=
""
;
String
Builder
testDetailsVO
=
new
StringBuilder
()
;
for
(
StepResultVO
stepResultVO
:
stepResultVOS
)
{
// 测试方法
String
stepName
=
stepResultVO
.
getName
();
...
...
@@ -204,11 +224,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if
(
testDetails
!=
null
)
{
testDetails
=
convertMarkdownToHtml
(
testDetails
);
}
testDetailsVO
+=
testDetails
+
"<br> "
;
testDetailsVO
.
append
(
testDetails
).
append
(
"<br> "
);
// 步骤附件列表
List
<
AttachmentVO
>
attachmentVOS
=
stepResultVO
.
getAttachment_list
();
if
(
attachmentVOS
!=
null
&&
attachmentVOS
.
size
()
!=
0
)
{
// 附件id
StringBuilder
attachmentId
=
new
StringBuilder
();
// 附件名称
StringBuilder
attachmentName
=
new
StringBuilder
();
for
(
AttachmentVO
vo
:
attachmentVOS
)
{
attachmentId
.
append
(
vo
.
getId
()).
append
(
"、"
);
attachmentName
.
append
(
vo
.
getName
()).
append
(
"、"
);
}
attachmentId
=
new
StringBuilder
(
attachmentId
.
substring
(
0
,
attachmentId
.
length
()
-
1
));
attachmentName
=
new
StringBuilder
(
attachmentName
.
substring
(
0
,
attachmentName
.
length
()
-
1
));
testRecords
.
setAttachmentId
(
attachmentId
.
toString
());
testRecords
.
setAttachmentName
(
attachmentName
.
toString
());
}
}
testDetailsVO
=
testDetailsVO
.
substring
(
0
,
testDetailsVO
.
length
()
-
1
);
testDetailsVO
=
new
StringBuilder
(
testDetailsVO
.
substring
(
0
,
testDetailsVO
.
length
()
-
1
)
);
testRecords
.
setTestMethod
(
StringUtils
.
join
(
stepList
,
"\n"
));
testRecords
.
setTestDetails
(
testDetailsVO
);
testRecords
.
setTestDetails
(
testDetailsVO
.
toString
()
);
}
list
.
add
(
testRecords
);
...
...
quality-review/src/main/resources/mapper/TestRecordsMapper.xml
View file @
e3d9cba8
...
...
@@ -18,9 +18,11 @@
<result
property=
"testResult"
column=
"test_result"
jdbcType=
"VARCHAR"
/>
<result
property=
"remediation"
column=
"remediation"
jdbcType=
"LONGNVARCHAR"
/>
<result
property=
"testDetails"
column=
"test_details"
jdbcType=
"LONGNVARCHAR"
/>
<result
property=
"attachmentId"
column=
"attachment_id"
jdbcType=
"LONGNVARCHAR"
/>
<result
property=
"attachmentName"
column=
"attachment_name"
jdbcType=
"LONGNVARCHAR"
/>
</resultMap>
<select
id=
"findByTaskId"
resultType=
"com.ruoyi.domain.TestRecords"
>
SELECT id, project_id, task_id, usecase, usecase_no, usecase_id, test_time, description, risk_level, test_method, test_result, remediation, test_details
SELECT id, project_id, task_id, usecase, usecase_no, usecase_id, test_time, description, risk_level, test_method, test_result, remediation, test_details
, attachment_id, attachment_name
FROM t_test_records
WHERE project_id = #{id}
</select>
...
...
@@ -41,7 +43,9 @@
tr.test_result,
tr.remediation,
tr.test_details,
tr.usecase_no
tr.usecase_no,
tr.attachment_name,
tr.attachment_id
from
t_test_records tr
left join t_task t on tr.task_id = t.model_test_task_id
...
...
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