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
bb202591
Commit
bb202591
authored
Mar 27, 2024
by
高滢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页平均检验通过率
parent
84f8045b
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
165 additions
and
3 deletions
+165
-3
AverageInspectionRateVO.java
...ain/java/com/ruoyi/domain/vo/AverageInspectionRateVO.java
+19
-0
ConfidentialityLevelProportionVO.java
...com/ruoyi/domain/vo/ConfidentialityLevelProportionVO.java
+15
-0
InspectionItemPassedNumVO.java
...n/java/com/ruoyi/domain/vo/InspectionItemPassedNumVO.java
+27
-0
StandardMapper.java
...review/src/main/java/com/ruoyi/mapper/StandardMapper.java
+3
-0
StatisticsHomeMapper.java
.../src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
+8
-0
StatisticsHomeService.java
...rc/main/java/com/ruoyi/service/StatisticsHomeService.java
+8
-0
StatisticsHomeServiceImpl.java
...ava/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
+50
-3
StatisticsHomeController.java
...src/main/java/com/ruoyi/web/StatisticsHomeController.java
+12
-0
StandardMapper.xml
quality-review/src/main/resources/mapper/StandardMapper.xml
+3
-0
StatisticsHomeMapper.xml
...review/src/main/resources/mapper/StatisticsHomeMapper.xml
+20
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/vo/AverageInspectionRateVO.java
0 → 100644
View file @
bb202591
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"平均检验通过率"
)
public
class
AverageInspectionRateVO
{
@ApiModelProperty
(
"检验项目"
)
private
String
inspectionItems
;
@ApiModelProperty
(
"通过率"
)
private
Integer
passingRate
;
@ApiModelProperty
(
"标准号"
)
private
String
standardNumber
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/ConfidentialityLevelProportionVO.java
0 → 100644
View file @
bb202591
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"首页任务保密等级占比"
)
public
class
ConfidentialityLevelProportionVO
{
@ApiModelProperty
(
"任务等级数量"
)
private
Long
value
;
@ApiModelProperty
(
"任务等级"
)
private
String
name
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/InspectionItemPassedNumVO.java
0 → 100644
View file @
bb202591
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"三个子项目检验通过个数"
)
public
class
InspectionItemPassedNumVO
{
@ApiModelProperty
(
"体系审查已完成个数"
)
private
Integer
sysReviewcompletedNum
;
@ApiModelProperty
(
"体系审查已通过个数"
)
private
Integer
sysReviewPassedNum
;
@ApiModelProperty
(
"车型审查已完成个数"
)
private
Integer
carReviewcompletedNum
;
@ApiModelProperty
(
"车型审查已通过个数"
)
private
Integer
carReviewPassedNum
;
@ApiModelProperty
(
"车型实验已完成个数"
)
private
Integer
modelTestCompletedNum
;
@ApiModelProperty
(
"车型实验已通过个数"
)
private
Integer
modelTestPassedNum
;
}
quality-review/src/main/java/com/ruoyi/mapper/StandardMapper.java
View file @
bb202591
...
@@ -16,4 +16,7 @@ public interface StandardMapper extends BaseMapper<Standard> {
...
@@ -16,4 +16,7 @@ public interface StandardMapper extends BaseMapper<Standard> {
// 根据id查询
// 根据id查询
Standard
findListById
(
@Param
(
"id"
)
Long
Id
);
Standard
findListById
(
@Param
(
"id"
)
Long
Id
);
//查询全部
List
<
Standard
>
selectListAll
();
}
}
quality-review/src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
View file @
bb202591
package
com
.
ruoyi
.
mapper
;
package
com
.
ruoyi
.
mapper
;
import
com.ruoyi.domain.vo.ConfidentialityLevelProportionVO
;
import
com.ruoyi.domain.vo.InspectionItemPassedNumVO
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -14,4 +16,10 @@ public interface StatisticsHomeMapper {
...
@@ -14,4 +16,10 @@ public interface StatisticsHomeMapper {
// 标准类别统计
// 标准类别统计
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
// 任务保密等级统计
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
// 体系审查任务通过数量
public
InspectionItemPassedNumVO
selectInspectionItemPassedNum
();
}
}
quality-review/src/main/java/com/ruoyi/service/StatisticsHomeService.java
View file @
bb202591
package
com
.
ruoyi
.
service
;
package
com
.
ruoyi
.
service
;
import
com.ruoyi.domain.vo.AverageInspectionRateVO
;
import
com.ruoyi.domain.vo.ConfidentialityLevelProportionVO
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
...
@@ -11,4 +13,10 @@ public interface StatisticsHomeService {
...
@@ -11,4 +13,10 @@ public interface StatisticsHomeService {
// 标准类别统计
// 标准类别统计
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
// 任务保密等级统计
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
//平均检验通过率
public
List
<
AverageInspectionRateVO
>
selectAverageInspectionRate
();
}
}
quality-review/src/main/java/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
View file @
bb202591
package
com
.
ruoyi
.
service
.
impl
;
package
com
.
ruoyi
.
service
.
impl
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.mapper.StandardMapper
;
import
com.ruoyi.mapper.StatisticsHomeMapper
;
import
com.ruoyi.mapper.StatisticsHomeMapper
;
import
com.ruoyi.service.StatisticsHomeService
;
import
com.ruoyi.service.StatisticsHomeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
...
@@ -16,6 +18,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
...
@@ -16,6 +18,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
@Autowired
@Autowired
private
StatisticsHomeMapper
statisticsHomeMapper
;
private
StatisticsHomeMapper
statisticsHomeMapper
;
@Autowired
private
StandardMapper
standardMapper
;
@Override
@Override
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
){
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
){
...
@@ -30,7 +35,39 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
...
@@ -30,7 +35,39 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
return
statisticsHomeMapper
.
selectStandardCategoryStatistics
();
return
statisticsHomeMapper
.
selectStandardCategoryStatistics
();
}
}
// 计算百分比
@Override
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
(){
return
statisticsHomeMapper
.
selectConfidentialityLevelStatistics
();
}
@Override
public
List
<
AverageInspectionRateVO
>
selectAverageInspectionRate
(){
List
<
Standard
>
standards
=
standardMapper
.
selectListAll
();
String
standardNo
=
null
;
if
(!
standards
.
isEmpty
()){
standardNo
=
standards
.
get
(
0
).
getStandardNo
();
}
InspectionItemPassedNumVO
inspectionItemPassedNumVO
=
statisticsHomeMapper
.
selectInspectionItemPassedNum
();
List
<
AverageInspectionRateVO
>
list
=
new
ArrayList
<>();
AverageInspectionRateVO
averageInspectionRateOne
=
new
AverageInspectionRateVO
();
averageInspectionRateOne
.
setInspectionItems
(
"汽车信息安全管理体系要求"
);
averageInspectionRateOne
.
setPassingRate
(
proportionCalculation
(
inspectionItemPassedNumVO
.
getSysReviewPassedNum
(),
inspectionItemPassedNumVO
.
getSysReviewcompletedNum
()));
list
.
add
(
averageInspectionRateOne
);
AverageInspectionRateVO
averageInspectionRateTwo
=
new
AverageInspectionRateVO
();
averageInspectionRateTwo
.
setInspectionItems
(
"汽车信息安全一般要求"
);
averageInspectionRateTwo
.
setPassingRate
(
proportionCalculation
(
inspectionItemPassedNumVO
.
getCarReviewPassedNum
(),
inspectionItemPassedNumVO
.
getCarReviewcompletedNum
()));
list
.
add
(
averageInspectionRateTwo
);
AverageInspectionRateVO
averageInspectionRateThree
=
new
AverageInspectionRateVO
();
averageInspectionRateThree
.
setInspectionItems
(
"汽车信息安全技术要求"
);
averageInspectionRateThree
.
setPassingRate
(
proportionCalculation
(
inspectionItemPassedNumVO
.
getModelTestPassedNum
(),
inspectionItemPassedNumVO
.
getModelTestCompletedNum
()));
list
.
add
(
averageInspectionRateThree
);
for
(
AverageInspectionRateVO
averageInspectionRate:
list
){
averageInspectionRate
.
setStandardNumber
(
standardNo
);
}
return
list
;
}
// 计算两个数各占比
public
int
percentageCalculation
(
Integer
a
,
Integer
b
){
public
int
percentageCalculation
(
Integer
a
,
Integer
b
){
int
total
=
a
+
b
;
int
total
=
a
+
b
;
if
(
total
==
0
){
if
(
total
==
0
){
...
@@ -40,4 +77,14 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
...
@@ -40,4 +77,14 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
return
Math
.
round
(
c
*
100
);
return
Math
.
round
(
c
*
100
);
}
}
}
}
// 计算百分比
public
int
proportionCalculation
(
Integer
a
,
Integer
b
){
if
(
b
==
0
){
return
0
;
}
else
{
float
c
=
(
float
)
a
/
b
;
return
Math
.
round
(
c
*
100
);
}
}
}
}
quality-review/src/main/java/com/ruoyi/web/StatisticsHomeController.java
View file @
bb202591
package
com
.
ruoyi
.
web
;
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.domain.vo.AverageInspectionRateVO
;
import
com.ruoyi.domain.vo.ConfidentialityLevelProportionVO
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.service.StatisticsHomeService
;
import
com.ruoyi.service.StatisticsHomeService
;
...
@@ -32,4 +34,14 @@ public class StatisticsHomeController {
...
@@ -32,4 +34,14 @@ public class StatisticsHomeController {
public
R
<
List
<
StandardCategoryStatisticsVO
>>
selectStandardCategoryStatistics
(){
public
R
<
List
<
StandardCategoryStatisticsVO
>>
selectStandardCategoryStatistics
(){
return
R
.
ok
(
statisticsHomeService
.
selectStandardCategoryStatistics
());
return
R
.
ok
(
statisticsHomeService
.
selectStandardCategoryStatistics
());
}
}
@ApiOperation
(
"首页任务保密等级占比"
)
@PostMapping
(
"/confidentialityLevel"
)
public
R
<
List
<
ConfidentialityLevelProportionVO
>>
selectConfidentialityLevelStatistics
(){
return
R
.
ok
(
statisticsHomeService
.
selectConfidentialityLevelStatistics
());
}
@ApiOperation
(
"首页平均检验通过率"
)
@PostMapping
(
"/averageInspectionRate"
)
public
R
<
List
<
AverageInspectionRateVO
>>
selectAverageInspectionRate
(){
return
R
.
ok
(
statisticsHomeService
.
selectAverageInspectionRate
());
}
}
}
quality-review/src/main/resources/mapper/StandardMapper.xml
View file @
bb202591
...
@@ -30,4 +30,7 @@
...
@@ -30,4 +30,7 @@
FROM t_standard WHERE id = #{id}
FROM t_standard WHERE id = #{id}
</select>
</select>
<select
id=
"selectListAll"
resultMap=
"BaseResultMap"
>
SELECT id, name, standard_no, file,standard_type,standard_status,release_date,implementation_date FROM t_standard
</select>
</mapper>
</mapper>
quality-review/src/main/resources/mapper/StatisticsHomeMapper.xml
View file @
bb202591
...
@@ -38,4 +38,24 @@
...
@@ -38,4 +38,24 @@
GROUP BY
GROUP BY
standard_type
standard_type
</select>
</select>
<select
id=
"selectConfidentialityLevelStatistics"
resultType=
"com.ruoyi.domain.vo.ConfidentialityLevelProportionVO"
>
SELECT
count( id ) AS value,
confidentiality_level AS name
FROM
t_task
GROUP BY
confidentiality_level
</select>
<select
id=
"selectInspectionItemPassedNum"
resultType=
"com.ruoyi.domain.vo.InspectionItemPassedNumVO"
>
SELECT
( SELECT COUNT( id ) FROM t_system_review_task WHERE task_status = 'FINISH' ) AS sysReviewcompletedNum,
( SELECT COUNT( id ) FROM t_system_review_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS sysReviewPassedNum,
( SELECT COUNT( id ) FROM t_car_review_task WHERE task_status = 'FINISH' ) AS carReviewcompletedNum,
( SELECT COUNT( id ) FROM t_car_review_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS carReviewPassedNum,
( SELECT COUNT( id ) FROM t_model_test_task WHERE task_status = 'FINISH' ) AS modelTestCompletedNum,
( SELECT COUNT( id ) FROM t_model_test_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS modelTestPassedNum
</select>
</mapper>
</mapper>
\ No newline at end of file
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