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
d25ab3f7
Commit
d25ab3f7
authored
Mar 28, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.91isoft.com:90/wangfei/vehicle-quality-review
into wangdingyi
parents
29347ca5
d8368e2b
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
491 additions
and
62 deletions
+491
-62
TestUseCase.java
...ty-review/src/main/java/com/ruoyi/domain/TestUseCase.java
+9
-0
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
OptionalUseCasesVO.java
...src/main/java/com/ruoyi/domain/vo/OptionalUseCasesVO.java
+31
-0
TaskParticipationStatisticsVO.java
...va/com/ruoyi/domain/vo/TaskParticipationStatisticsVO.java
+14
-0
StandardMapper.java
...review/src/main/java/com/ruoyi/mapper/StandardMapper.java
+3
-0
StatisticsHomeMapper.java
.../src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
+10
-2
TestUseCaseMapper.java
...iew/src/main/java/com/ruoyi/mapper/TestUseCaseMapper.java
+8
-0
ReviewStandardService.java
...rc/main/java/com/ruoyi/service/ReviewStandardService.java
+15
-4
StatisticsHomeService.java
...rc/main/java/com/ruoyi/service/StatisticsHomeService.java
+10
-2
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+63
-38
ReviewStandardServiceImpl.java
...ava/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
+41
-7
StatisticsHomeServiceImpl.java
...ava/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
+55
-3
ReviewStandardController.java
...src/main/java/com/ruoyi/web/ReviewStandardController.java
+27
-4
StatisticsHomeController.java
...src/main/java/com/ruoyi/web/StatisticsHomeController.java
+16
-2
ReviewStandardSaveStandardUsecaseRequest.java
...web/request/ReviewStandardSaveStandardUsecaseRequest.java
+31
-0
ReviewStandardStandardUsecaseRequest.java
...oyi/web/request/ReviewStandardStandardUsecaseRequest.java
+24
-0
ReviewStandardStandardUsecaseResponse.java
...i/web/response/ReviewStandardStandardUsecaseResponse.java
+30
-0
StandardMapper.xml
quality-review/src/main/resources/mapper/StandardMapper.xml
+3
-0
StatisticsHomeMapper.xml
...review/src/main/resources/mapper/StatisticsHomeMapper.xml
+30
-0
TestUseCaseMapper.xml
...ty-review/src/main/resources/mapper/TestUseCaseMapper.xml
+9
-0
UserPhotoStorageMapper.xml
...view/src/main/resources/mapper/UserPhotoStorageMapper.xml
+1
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/TestUseCase.java
View file @
d25ab3f7
...
...
@@ -7,7 +7,10 @@ import java.util.Date;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 测试用例
...
...
@@ -15,6 +18,9 @@ import lombok.Data;
*/
@TableName
(
value
=
"t_test_usecase"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
TestUseCase
implements
Serializable
{
/**
* 主键
...
...
@@ -90,6 +96,9 @@ public class TestUseCase implements Serializable {
@ApiModelProperty
(
"用例ID"
)
private
String
caseId
;
@ApiModelProperty
(
"标准条款ID"
)
private
Long
reviewStandardId
;
/**
* 返回用例在矩阵中的坐标
* @return
...
...
quality-review/src/main/java/com/ruoyi/domain/vo/AverageInspectionRateVO.java
0 → 100644
View file @
d25ab3f7
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 @
d25ab3f7
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 @
d25ab3f7
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/domain/vo/OptionalUseCasesVO.java
0 → 100644
View file @
d25ab3f7
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 可显示用例
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
OptionalUseCasesVO
{
@ApiModelProperty
(
"禁用"
)
private
Boolean
disabled
;
@ApiModelProperty
(
"值"
)
private
Long
key
;
@ApiModelProperty
(
"键"
)
private
String
label
;
@ApiModelProperty
(
"标准ID"
)
private
Long
standardId
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/TaskParticipationStatisticsVO.java
0 → 100644
View file @
d25ab3f7
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"首页参与任务情况"
)
public
class
TaskParticipationStatisticsVO
{
@ApiModelProperty
(
"用户名称"
)
private
String
userName
;
@ApiModelProperty
(
"项目数量"
)
private
Integer
taskNum
;
}
quality-review/src/main/java/com/ruoyi/mapper/StandardMapper.java
View file @
d25ab3f7
...
...
@@ -16,4 +16,7 @@ public interface StandardMapper extends BaseMapper<Standard> {
// 根据id查询
Standard
findListById
(
@Param
(
"id"
)
Long
Id
);
//查询全部
List
<
Standard
>
selectListAll
();
}
quality-review/src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
View file @
d25ab3f7
package
com
.
ruoyi
.
mapper
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.vo.*
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
...
...
@@ -14,4 +13,13 @@ public interface StatisticsHomeMapper {
// 标准类别统计
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
// 任务保密等级统计
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
// 体系审查任务通过数量
public
InspectionItemPassedNumVO
selectInspectionItemPassedNum
();
// 参与任务情况统计
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
();
}
quality-review/src/main/java/com/ruoyi/mapper/TestUseCaseMapper.java
View file @
d25ab3f7
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.mapper;
import
com.ruoyi.domain.TestUseCase
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.domain.vo.OptionalUseCasesVO
;
import
com.ruoyi.domain.vo.TestUsecaseVO
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -31,6 +32,13 @@ public interface TestUseCaseMapper extends BaseMapper<TestUseCase> {
* @return
*/
List
<
TestUsecaseVO
>
selectListByTaskId
(
Long
id
);
/**
* 查询测试用例列表
* @return
*/
List
<
OptionalUseCasesVO
>
selectOptionalUsecase
();
}
...
...
quality-review/src/main/java/com/ruoyi/service/ReviewStandardService.java
View file @
d25ab3f7
...
...
@@ -5,10 +5,8 @@ import com.ruoyi.domain.ReviewStandard;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.response.ReviewStandardInspectionContentResponse
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.response.ReviewStandardResponse
;
import
com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse
;
import
com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest
;
import
com.ruoyi.web.response.*
;
import
java.util.List
;
...
...
@@ -59,4 +57,17 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
// 标准-要点-细则
List
<
ReviewStandard
>
findDetailsList
(
ReviewFindListRequest
request
);
/**
* 选择标准-测试用例
* @param standardId
* @return
*/
ReviewStandardStandardUsecaseResponse
selectStandardUsecase
(
Long
standardId
);
/**
* 保存 标准-检验内容-用例
* @param request
*/
void
saveStandardUsecase
(
ReviewStandardSaveStandardUsecaseRequest
request
);
}
quality-review/src/main/java/com/ruoyi/service/StatisticsHomeService.java
View file @
d25ab3f7
package
com
.
ruoyi
.
service
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.vo.*
;
import
java.util.List
;
...
...
@@ -11,4 +10,13 @@ public interface StatisticsHomeService {
// 标准类别统计
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
// 任务保密等级统计
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
//平均检验通过率
public
List
<
AverageInspectionRateVO
>
selectAverageInspectionRate
();
// 参与任务情况统计
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
();
}
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
View file @
d25ab3f7
...
...
@@ -17,6 +17,7 @@ import com.ruoyi.system.mapper.SysDictDataMapper;
import
io.minio.MinioClient
;
import
io.minio.ObjectWriteArgs
;
import
io.minio.PutObjectArgs
;
import
lombok.SneakyThrows
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -24,8 +25,11 @@ import org.springframework.transaction.annotation.Transactional;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.lang.reflect.Field
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.*
;
import
java.util.List
;
...
...
@@ -64,51 +68,72 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
* @param taskId
* @return
*/
@SneakyThrows
@Override
public
String
generateInspectionReport
(
Long
taskId
)
throws
Exception
{
public
String
generateInspectionReport
(
Long
taskId
)
{
PdfReader
reader
=
null
;
PdfStamper
ps
=
null
;
ByteArrayOutputStream
bos
=
null
;
try
{
// 模板绝对路径--服务器
String
fileName
=
"/template/receipt_template_03_27.pdf"
;
// 读取现有模板内容
reader
=
new
PdfReader
(
fileName
);
// 创建输出流
bos
=
new
ByteArrayOutputStream
();
// 实例化PdfStamper准备编辑pdf内容
ps
=
new
PdfStamper
(
reader
,
bos
);
// 获取表单所有元素
AcroFields
fields
=
ps
.
getAcroFields
();
// 设置具体字体格式的编码, 不设置的话中文可能不会显示
BaseFont
bf
=
BaseFont
.
createFont
(
"STSongStd-Light"
,
"UniGB-UCS2-H"
,
BaseFont
.
NOT_EMBEDDED
);
fields
.
addSubstitutionFont
(
bf
);
// 测试数据
InspectionReportPdfVO
inspectionReportPdfVO
=
requireData
(
taskId
);
// 渲染数据
renderData
(
fields
,
inspectionReportPdfVO
,
ps
);
//必须要调用这个,否则文档不会生成的
ps
.
setFormFlattening
(
true
);
ps
.
close
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
finally
{
if
(
bos
!=
null
){
bos
.
close
();
}
if
(
reader
!=
null
){
reader
.
close
();
}
}
assert
bos
!=
null
;
// 名字
// 模板绝对路径--服务器
String
fileName
=
"/template/receipt_template_03_27.pdf"
;
// 读取现有模板内容
reader
=
new
PdfReader
(
fileName
);
// 创建输出流
bos
=
new
ByteArrayOutputStream
();
// 实例化PdfStamper准备编辑pdf内容
ps
=
new
PdfStamper
(
reader
,
bos
);
// 获取表单所有元素
AcroFields
fields
=
ps
.
getAcroFields
();
// 设置具体字体格式的编码, 不设置的话中文可能不会显示
BaseFont
bf
=
BaseFont
.
createFont
(
"STSongStd-Light"
,
"UniGB-UCS2-H"
,
BaseFont
.
NOT_EMBEDDED
);
fields
.
addSubstitutionFont
(
bf
);
// 测试数据
InspectionReportPdfVO
inspectionReportPdfVO
=
requireData
(
taskId
);
// 渲染数据
renderData
(
fields
,
inspectionReportPdfVO
,
ps
);
// 必须要调用这个,否则文档不会生成的
ps
.
setFormFlattening
(
true
);
// 关闭
ps
.
close
();
bos
.
close
();
reader
.
close
();
// // 把第一个模板填入数据后生成一个oss
// String templateName = uploadMinio(bos, "整车信息安全检验临时模板");
// // 创建一个空PDF, 融合两个PDF
// Document document = new Document();
// ByteArrayOutputStream out = new ByteArrayOutputStream();
// PdfCopy copy = new PdfCopy(document, out);
// document.open();
// // 第一个PDF
// PdfReader readerFirst = new PdfReader(minioUrl() + templateName);
// int numberPage = readerFirst.getNumberOfPages();
// for (int i = 1;i < numberPage;i++) {
// PdfImportedPage importedPage = copy.getImportedPage(readerFirst, i);
// copy.addPage(importedPage);
// }
// // 第二个PDF
// ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
// PdfBaseWriter writer = new PdfBaseWriter(outputStream);
// writer.open();
// // 代码渲染
// writer.setParagraph("企业留档文件", 30f, Element.ALIGN_CENTER, 0,15f, 180f);
// writer.close();
// String codeName = uploadMinio(outputStream, "整车信息安全检验临时代码");
// PdfReader pr = new PdfReader(minioUrl() + codeName);
// copy.addPage(copy.getImportedPage(pr, 1));
// document.close();
return
uploadMinio
(
bos
,
"整车信息安全检验报告-"
+
getReportName
());
}
/**
* minio对象存储查看图片地址
* @return
*/
private
String
minioUrl
()
{
return
minioEndpoint
+
"/"
+
bucketName
+
"/"
;
}
private
String
getReportName
()
{
return
DateUtils
.
parseDateToStr
(
"yyyyMMddHHmm"
,
new
Date
());
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
View file @
d25ab3f7
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.utils.SnowflakeUtil
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.mapper.ReviewDetailsMapper
;
import
com.ruoyi.mapper.ReviewKeyPointMapper
;
import
com.ruoyi.mapper.ReviewStandardMapper
;
import
com.ruoyi.domain.vo.OptionalUseCasesVO
;
import
com.ruoyi.mapper.*
;
import
com.ruoyi.service.*
;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.response.ReviewStandardInspectionContentResponse
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.response.ReviewStandardResponse
;
import
com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse
;
import
com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest
;
import
com.ruoyi.web.response.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -21,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Transactional
@Service
...
...
@@ -44,6 +44,9 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
@Autowired
private
ReviewDetailsMapper
reviewDetailsMapper
;
@Autowired
private
TestUseCaseMapper
testUseCaseMapper
;
/**
* 查询所有审查 标准、要点、细则、场景 并组织成树状结构返回
* @param standardId 关联到标准库中的id
...
...
@@ -140,6 +143,37 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
return
buildStandard
(
standardList
,
keyPointListTree
);
}
/**
* 选择 标准-用例
* @param standardId
* @return
*/
@Override
public
ReviewStandardStandardUsecaseResponse
selectStandardUsecase
(
Long
standardId
)
{
ReviewStandardStandardUsecaseResponse
response
=
new
ReviewStandardStandardUsecaseResponse
();
// 查询当前所有的测试用例
List
<
OptionalUseCasesVO
>
testUseCases
=
testUseCaseMapper
.
selectOptionalUsecase
();
// 查看此标准下所有的测试用例
List
<
TestUseCase
>
usecaseRelationList
=
testUseCaseMapper
.
selectList
(
new
QueryWrapper
<
TestUseCase
>().
eq
(
"review_standard_id"
,
standardId
));
// 此标准还可以选择的用例
List
<
OptionalUseCasesVO
>
optionalUseCasesVOList
=
testUseCases
.
stream
().
filter
(
a
->
!
a
.
getStandardId
().
equals
(
standardId
)).
collect
(
Collectors
.
toList
());
optionalUseCasesVOList
.
stream
().
forEach
(
obj
->
obj
.
setDisabled
(
false
));
response
.
setOptionalUseCasesList
(
optionalUseCasesVOList
);
response
.
setSelectedUseCaseList
(
usecaseRelationList
.
stream
().
map
(
TestUseCase:
:
getId
).
collect
(
Collectors
.
toList
()));
return
response
;
}
/**
* 保存 标准-用例
* @param request
*/
@Override
public
void
saveStandardUsecase
(
ReviewStandardSaveStandardUsecaseRequest
request
)
{
testUseCaseMapper
.
update
(
TestUseCase
.
builder
().
reviewStandardId
(
request
.
getStandardId
()).
build
(),
new
UpdateWrapper
<
TestUseCase
>().
in
(
"id"
,
request
.
getUsecaseIdList
()));
}
/**
* 将审查 标准、要点、细则、场景 按照父子关系拆分写入到各自的表中
* @param reviewStandardList
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
View file @
d25ab3f7
package
com
.
ruoyi
.
service
.
impl
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.mapper.StandardMapper
;
import
com.ruoyi.mapper.StatisticsHomeMapper
;
import
com.ruoyi.service.StatisticsHomeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
...
...
@@ -16,6 +18,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
@Autowired
private
StatisticsHomeMapper
statisticsHomeMapper
;
@Autowired
private
StandardMapper
standardMapper
;
@Override
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
){
...
...
@@ -30,7 +35,44 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
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
;
}
@Override
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
(){
return
statisticsHomeMapper
.
selectTaskParticipationStatistics
();
}
// 计算两个数各占比
public
int
percentageCalculation
(
Integer
a
,
Integer
b
){
int
total
=
a
+
b
;
if
(
total
==
0
){
...
...
@@ -40,4 +82,14 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
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/ReviewStandardController.java
View file @
d25ab3f7
...
...
@@ -8,10 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
import
com.ruoyi.domain.ReviewStandard
;
import
com.ruoyi.service.ReviewStandardService
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.response.ReviewStandardInspectionContentResponse
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.response.ReviewStandardResponse
;
import
com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse
;
import
com.ruoyi.web.response.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
...
...
@@ -72,6 +69,32 @@ public class ReviewStandardController extends BaseController {
return
R
.
ok
(
response
);
}
/**
* 查询 标准-检验内容-用例
* @param request
* @return
*/
@Anonymous
@ApiOperation
(
"查询 标准-检验内容-用例"
)
@PostMapping
(
"/test/getStandardUsecase"
)
public
R
<
ReviewStandardStandardUsecaseResponse
>
getStandardUsecase
(
@Validated
@RequestBody
ReviewStandardStandardUsecaseRequest
request
)
{
ReviewStandardStandardUsecaseResponse
response
=
reviewStandardService
.
selectStandardUsecase
(
request
.
getStandardId
());
return
R
.
ok
(
response
);
}
/**
* 保存 标准-检验内容-用例
* @param request
* @return
*/
@Anonymous
@ApiOperation
(
"保存 标准-检验内容-用例"
)
@PostMapping
(
"/test/saveStandardUsecase"
)
public
R
<
Boolean
>
saveStandardUsecase
(
@Validated
@RequestBody
ReviewStandardSaveStandardUsecaseRequest
request
)
{
reviewStandardService
.
saveStandardUsecase
(
request
);
return
R
.
ok
(
true
);
}
@ApiOperation
(
"查询标注要求列表"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
...
...
quality-review/src/main/java/com/ruoyi/web/StatisticsHomeController.java
View file @
d25ab3f7
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.domain.vo.QuantityStatisticsVO
;
import
com.ruoyi.domain.vo.StandardCategoryStatisticsVO
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.service.StatisticsHomeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -32,4 +31,19 @@ public class StatisticsHomeController {
public
R
<
List
<
StandardCategoryStatisticsVO
>>
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
());
}
@ApiOperation
(
"首页任务情况安排"
)
@PostMapping
(
"/taskParticipation"
)
public
R
<
List
<
TaskParticipationStatisticsVO
>>
selectTaskParticipationStatistics
(){
return
R
.
ok
(
statisticsHomeService
.
selectTaskParticipationStatistics
());
}
}
quality-review/src/main/java/com/ruoyi/web/request/ReviewStandardSaveStandardUsecaseRequest.java
0 → 100644
View file @
d25ab3f7
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* 保存标准用例请求DTO
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"保存标准用例请求DTO"
)
public
class
ReviewStandardSaveStandardUsecaseRequest
{
@ApiModelProperty
(
"标准ID"
)
@NotNull
(
message
=
"标准ID不能为空"
)
private
Long
standardId
;
@ApiModelProperty
(
"用例ID集合"
)
private
List
<
Long
>
usecaseIdList
;
}
quality-review/src/main/java/com/ruoyi/web/request/ReviewStandardStandardUsecaseRequest.java
0 → 100644
View file @
d25ab3f7
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 标准-用例 请求
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"标准-用例 请求"
)
public
class
ReviewStandardStandardUsecaseRequest
{
@ApiModelProperty
(
"标准ID"
)
private
Long
standardId
;
}
quality-review/src/main/java/com/ruoyi/web/response/ReviewStandardStandardUsecaseResponse.java
0 → 100644
View file @
d25ab3f7
package
com
.
ruoyi
.
web
.
response
;
import
com.ruoyi.domain.vo.OptionalUseCasesVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* 标准-用例 返回 DTO
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"标准-用例 返回 DTO"
)
public
class
ReviewStandardStandardUsecaseResponse
{
@ApiModelProperty
(
"可选择用例"
)
private
List
<
OptionalUseCasesVO
>
optionalUseCasesList
;
@ApiModelProperty
(
"已选择用例"
)
private
List
<
Long
>
selectedUseCaseList
;
}
quality-review/src/main/resources/mapper/StandardMapper.xml
View file @
d25ab3f7
...
...
@@ -30,4 +30,7 @@
FROM t_standard WHERE id = #{id}
</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>
quality-review/src/main/resources/mapper/StatisticsHomeMapper.xml
View file @
d25ab3f7
...
...
@@ -38,4 +38,34 @@
GROUP BY
standard_type
</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>
<select
id=
"selectTaskParticipationStatistics"
resultType=
"com.ruoyi.domain.vo.TaskParticipationStatisticsVO"
>
SELECT
count( task_id ) AS taskNum,
NAME AS userName
FROM
t_task_user_relation
GROUP BY
user_id,NAME
</select>
</mapper>
\ No newline at end of file
quality-review/src/main/resources/mapper/TestUseCaseMapper.xml
View file @
d25ab3f7
...
...
@@ -76,4 +76,13 @@
where
mtt.id = #{id}
</select>
<select
id=
"selectOptionalUsecase"
resultType=
"com.ruoyi.domain.vo.OptionalUseCasesVO"
>
select
id AS `key`,
CONCAT('(', usecase_no, ')', name) AS label,
review_standard_id AS standardId
from
t_test_usecase
</select>
</mapper>
quality-review/src/main/resources/mapper/UserPhotoStorageMapper.xml
View file @
d25ab3f7
...
...
@@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectUserPhotoStorageList"
parameterType=
"com.ruoyi.domain.UserPhotoStorage"
resultMap=
"UserPhotoStorageResult"
>
<include
refid=
"selectUserPhotoStorageVo"
/>
<where>
deleted = 0
<if
test=
"userId != null "
>
and user_id = #{userId}
</if>
<if
test=
"username != null and username != ''"
>
and username like concat('%', #{username}, '%')
</if>
</where>
...
...
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