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
6044bc64
Commit
6044bc64
authored
Jul 02, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangdingyi' into 'dev'
获取车型试验步骤附件列表 See merge request
!387
parents
337819d0
e3d9cba8
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 @
6044bc64
...
@@ -56,4 +56,10 @@ public class TestRecords {
...
@@ -56,4 +56,10 @@ public class TestRecords {
@ApiModelProperty
(
"测试详情"
)
@ApiModelProperty
(
"测试详情"
)
private
String
testDetails
;
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 @
6044bc64
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 @
6044bc64
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"StepResultVO"
,
description
=
"用例步骤结果VO"
)
@ApiModel
(
value
=
"StepResultVO"
,
description
=
"用例步骤结果VO"
)
@Data
@Data
public
class
StepResultVO
{
public
class
StepResultVO
{
...
@@ -16,4 +18,7 @@ public class StepResultVO {
...
@@ -16,4 +18,7 @@ public class StepResultVO {
@ApiModelProperty
(
"步骤名称"
)
@ApiModelProperty
(
"步骤名称"
)
private
String
name
;
private
String
name
;
@ApiModelProperty
(
"步骤附件列表"
)
List
<
AttachmentVO
>
attachment_list
;
}
}
quality-review/src/main/java/com/ruoyi/service/impl/TestRecordsServiceImpl.java
View file @
6044bc64
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.domain.TestRecords
;
import
com.ruoyi.domain.TestRecords
;
import
com.ruoyi.domain.vo.AttachmentVO
;
import
com.ruoyi.domain.vo.CaseResultVO
;
import
com.ruoyi.domain.vo.CaseResultVO
;
import
com.ruoyi.domain.vo.StepResultVO
;
import
com.ruoyi.domain.vo.StepResultVO
;
import
com.ruoyi.mapper.TestRecordsMapper
;
import
com.ruoyi.mapper.TestRecordsMapper
;
...
@@ -102,7 +103,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
...
@@ -102,7 +103,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
List
<
String
>
stepList
=
new
ArrayList
<>();
List
<
String
>
stepList
=
new
ArrayList
<>();
List
<
String
>
testDetailsList
=
new
ArrayList
<>();
List
<
String
>
testDetailsList
=
new
ArrayList
<>();
int
index
=
1
;
// 序号从1开始
int
index
=
1
;
// 序号从1开始
String
testDetailsVO
=
""
;
String
Builder
testDetailsVO
=
new
StringBuilder
()
;
for
(
StepResultVO
stepResultVO
:
stepResultVOS
)
{
for
(
StepResultVO
stepResultVO
:
stepResultVOS
)
{
// 测试方法
// 测试方法
String
stepName
=
stepResultVO
.
getName
();
String
stepName
=
stepResultVO
.
getName
();
...
@@ -118,11 +119,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
...
@@ -118,11 +119,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if
(
testDetails
!=
null
)
{
if
(
testDetails
!=
null
)
{
testDetails
=
convertMarkdownToHtml
(
testDetails
);
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
.
setTestMethod
(
StringUtils
.
join
(
stepList
,
"\n"
));
testRecords
.
setTestDetails
(
testDetailsVO
);
testRecords
.
setTestDetails
(
testDetailsVO
.
toString
()
);
}
}
list
.
add
(
testRecords
);
list
.
add
(
testRecords
);
...
@@ -188,7 +208,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
...
@@ -188,7 +208,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
List
<
String
>
stepList
=
new
ArrayList
<>();
List
<
String
>
stepList
=
new
ArrayList
<>();
List
<
String
>
testDetailsList
=
new
ArrayList
<>();
List
<
String
>
testDetailsList
=
new
ArrayList
<>();
int
index
=
1
;
// 序号从1开始
int
index
=
1
;
// 序号从1开始
String
testDetailsVO
=
""
;
String
Builder
testDetailsVO
=
new
StringBuilder
()
;
for
(
StepResultVO
stepResultVO
:
stepResultVOS
)
{
for
(
StepResultVO
stepResultVO
:
stepResultVOS
)
{
// 测试方法
// 测试方法
String
stepName
=
stepResultVO
.
getName
();
String
stepName
=
stepResultVO
.
getName
();
...
@@ -204,11 +224,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
...
@@ -204,11 +224,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if
(
testDetails
!=
null
)
{
if
(
testDetails
!=
null
)
{
testDetails
=
convertMarkdownToHtml
(
testDetails
);
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
.
setTestMethod
(
StringUtils
.
join
(
stepList
,
"\n"
));
testRecords
.
setTestDetails
(
testDetailsVO
);
testRecords
.
setTestDetails
(
testDetailsVO
.
toString
()
);
}
}
list
.
add
(
testRecords
);
list
.
add
(
testRecords
);
...
...
quality-review/src/main/resources/mapper/TestRecordsMapper.xml
View file @
6044bc64
...
@@ -18,9 +18,11 @@
...
@@ -18,9 +18,11 @@
<result
property=
"testResult"
column=
"test_result"
jdbcType=
"VARCHAR"
/>
<result
property=
"testResult"
column=
"test_result"
jdbcType=
"VARCHAR"
/>
<result
property=
"remediation"
column=
"remediation"
jdbcType=
"LONGNVARCHAR"
/>
<result
property=
"remediation"
column=
"remediation"
jdbcType=
"LONGNVARCHAR"
/>
<result
property=
"testDetails"
column=
"test_details"
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>
</resultMap>
<select
id=
"findByTaskId"
resultType=
"com.ruoyi.domain.TestRecords"
>
<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
FROM t_test_records
WHERE project_id = #{id}
WHERE project_id = #{id}
</select>
</select>
...
@@ -41,7 +43,9 @@
...
@@ -41,7 +43,9 @@
tr.test_result,
tr.test_result,
tr.remediation,
tr.remediation,
tr.test_details,
tr.test_details,
tr.usecase_no
tr.usecase_no,
tr.attachment_name,
tr.attachment_id
from
from
t_test_records tr
t_test_records tr
left join t_task t on tr.task_id = t.model_test_task_id
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