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
12dfe673
Commit
12dfe673
authored
Oct 24, 2024
by
yuanshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.添加新接口/home/statistics/quantityStatisticsNew用于标准应用数据库首页数据获取
parent
57992389
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
156 additions
and
2 deletions
+156
-2
NumberStatistics.java
...w/src/main/java/com/ruoyi/domain/vo/NumberStatistics.java
+28
-0
QuantityStatisticsNewVO.java
...ain/java/com/ruoyi/domain/vo/QuantityStatisticsNewVO.java
+20
-0
StatisticsHomeMapper.java
.../src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
+7
-1
StatisticsHomeService.java
...rc/main/java/com/ruoyi/service/StatisticsHomeService.java
+7
-0
StatisticsHomeServiceImpl.java
...ava/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
+59
-0
StatisticsHomeController.java
...src/main/java/com/ruoyi/web/StatisticsHomeController.java
+7
-0
StatisticsHomeMapper.xml
...review/src/main/resources/mapper/StatisticsHomeMapper.xml
+28
-1
No files found.
quality-review/src/main/java/com/ruoyi/domain/vo/NumberStatistics.java
0 → 100644
View file @
12dfe673
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
value
=
"标准应用数据库—首页数量统计—对象vo"
)
public
class
NumberStatistics
{
private
Long
standardId
;
private
String
standardName
;
private
Long
keypointNum
;
private
Long
detailsNum
;
private
Long
sceneNum
;
private
Integer
usecaseNum
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/QuantityStatisticsNewVO.java
0 → 100644
View file @
12dfe673
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
value
=
"标准应用数据库—首页数量统计"
)
public
class
QuantityStatisticsNewVO
{
private
List
<
NumberStatistics
>
numberStatisticsList
;
}
quality-review/src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
View file @
12dfe673
package
com
.
ruoyi
.
mapper
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.domain.vo.*
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -21,5 +22,10 @@ public interface StatisticsHomeMapper {
// 参与任务情况统计
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
();
//获取当前标准下的要点数
Long
selectKeypointNum
(
Standard
standard
);
//获取当前标准下的细则数
Long
selectDetailsNum
(
Standard
standard
);
//获取当前标准下的场景数
Long
selectSceneNum
(
Standard
standard
);
}
quality-review/src/main/java/com/ruoyi/service/StatisticsHomeService.java
View file @
12dfe673
package
com
.
ruoyi
.
service
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.domain.vo.*
;
import
java.io.IOException
;
import
java.util.List
;
public
interface
StatisticsHomeService
{
...
...
@@ -19,4 +21,9 @@ public interface StatisticsHomeService {
// 参与任务情况统计
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
();
/*
* 标准应用数据库—首页—要点细则场景用例数量统计
* */
QuantityStatisticsNewVO
selectQuantityStatisticsNew
()
throws
IOException
;
}
quality-review/src/main/java/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
View file @
12dfe673
package
com
.
ruoyi
.
service
.
impl
;
import
cn.hutool.json.JSONUtil
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.mapper.ReviewStandardMapper
;
import
com.ruoyi.mapper.StandardMapper
;
import
com.ruoyi.mapper.StatisticsHomeMapper
;
import
com.ruoyi.service.StatisticsHomeService
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.web.request.GetSerialNumberRequest
;
import
com.ruoyi.web.request.Offset
;
import
com.ruoyi.web.response.TestUserCaseListNewResponse
;
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.ArrayList
;
import
java.util.List
;
...
...
@@ -21,6 +29,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
@Autowired
private
StandardMapper
standardMapper
;
@Autowired
private
TestUseCaseService
testUseCaseService
;
@Override
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
){
...
...
@@ -72,6 +83,54 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
return
statisticsHomeMapper
.
selectTaskParticipationStatistics
();
}
/*
*
* 标准应用数据库—首页—要点细则场景用例数量统计
* */
@Override
public
QuantityStatisticsNewVO
selectQuantityStatisticsNew
()
throws
IOException
{
//创建对象
QuantityStatisticsNewVO
quantityStatisticsNewVO
=
new
QuantityStatisticsNewVO
();
List
<
NumberStatistics
>
numberStatisticsList
=
new
ArrayList
<>();
//获取当前库里所有标准
List
<
Standard
>
standardList
=
standardMapper
.
selectListAll
();
//准备调用科恩接口的请求参数
Offset
offset
=
new
Offset
();
offset
.
setOffset
(
0
);
offset
.
setLimit
(
9999
);
for
(
Standard
standard
:
standardList
){
NumberStatistics
numberStatistics
=
new
NumberStatistics
();
numberStatistics
.
setStandardName
(
standard
.
getName
());
numberStatistics
.
setStandardId
(
standard
.
getId
());
//获取当前标准下的要点数
numberStatistics
.
setKeypointNum
(
statisticsHomeMapper
.
selectKeypointNum
(
standard
));
//获取当前标准下的细则数
numberStatistics
.
setDetailsNum
(
statisticsHomeMapper
.
selectDetailsNum
(
standard
));
//获取当前标准下的场景数
numberStatistics
.
setSceneNum
(
statisticsHomeMapper
.
selectSceneNum
(
standard
));
//窜 调用科恩接口的 request
GetSerialNumberRequest
getSerialNumberRequest
=
new
GetSerialNumberRequest
();
getSerialNumberRequest
.
setOffset
(
offset
);
getSerialNumberRequest
.
setName
(
standard
.
getName
());
String
request
=
JSONUtil
.
toJsonStr
(
getSerialNumberRequest
);
//获取当前标准下的用例数
TestUserCaseListNewResponse
useCaseListNew
=
testUseCaseService
.
getUseCaseListNew
(
request
);
Integer
usecaseNum
=
useCaseListNew
.
getUseCaseNum
();
if
(
usecaseNum
==
null
){
usecaseNum
=
0
;
}
numberStatistics
.
setUsecaseNum
(
usecaseNum
);
numberStatisticsList
.
add
(
numberStatistics
);
}
quantityStatisticsNewVO
.
setNumberStatisticsList
(
numberStatisticsList
);
return
quantityStatisticsNewVO
;
}
// 计算两个数各占比
public
int
percentageCalculation
(
Integer
a
,
Integer
b
){
int
total
=
a
+
b
;
...
...
quality-review/src/main/java/com/ruoyi/web/StatisticsHomeController.java
View file @
12dfe673
...
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.IOException
;
import
java.util.List
;
@Api
(
tags
=
{
"首页统计"
})
...
...
@@ -46,4 +47,10 @@ public class StatisticsHomeController {
public
R
<
List
<
TaskParticipationStatisticsVO
>>
selectTaskParticipationStatistics
(){
return
R
.
ok
(
statisticsHomeService
.
selectTaskParticipationStatistics
());
}
@ApiOperation
(
"标准应用数据库—首页—要点细则场景用例数量统计"
)
@PostMapping
(
"/quantityStatisticsNew"
)
public
R
<
QuantityStatisticsNewVO
>
selectQuantityStatisticsNew
()
throws
IOException
{
return
R
.
ok
(
statisticsHomeService
.
selectQuantityStatisticsNew
());
}
}
quality-review/src/main/resources/mapper/StatisticsHomeMapper.xml
View file @
12dfe673
...
...
@@ -70,4 +70,31 @@
GROUP BY
tur.user_id
</select>
<select
id=
"selectKeypointNum"
resultType=
"java.lang.Long"
>
select
count(trk.text)
from t_review_keypoint trk
left join t_review_standard trs on trk.review_standard_id = trs.id
left join t_standard ts on trs.standard_id = ts.id
where ts.id = #{id} and ts.name =#{name}
</select>
<select
id=
"selectDetailsNum"
resultType=
"java.lang.Long"
>
select
count(trs.text)
from t_review_details trd
left join t_review_keypoint trk on trd.review_keypoint_id = trk.id
left join t_review_standard trs on trk.review_standard_id = trs.id
left join t_standard ts on trs.standard_id = ts.id
where ts.id = #{id} and ts.name =#{name}
</select>
<select
id=
"selectSceneNum"
resultType=
"java.lang.Long"
>
select
count(trsc.text)
from t_review_scene trsc
left join t_review_details trd on trsc.review_details_id = trd.id
left join t_review_keypoint trk on trd.review_keypoint_id = trk.id
left join t_review_standard trs on trk.review_standard_id = trs.id
left join t_standard ts on trs.standard_id = ts.id
where ts.id = #{id} and ts.name =#{name}
</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