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
6d6fabcc
Commit
6d6fabcc
authored
Mar 01, 2024
by
王飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangfei' into 'dev'
1、计算统计数据 See merge request
!114
parents
c7f55dfa
7c5131da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
33 deletions
+111
-33
StrategyCarReviewTaskPending.java
.../com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
+111
-33
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
View file @
6d6fabcc
...
...
@@ -16,6 +16,7 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -191,53 +192,130 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
Map
<
Long
,
ReviewDetailsResult
>
resultMap
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
ReviewDetailsResult:
:
getReviewDetailsId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
// //审查细则(条)
// int detailsNum = 0;
//
// //审查细则符合数
// int detailsPassNum = 0;
//
// //标准条款(条)
// int standardsNum = 0;
//
// //标准条款通过数
// int standardsPassNum = 0;
//
// for(ReviewStandard standard : standards) {
// standard.setPassed(1);
// standardsNum ++;
// List<ReviewKeyPoint> keyPointList = standard.getKeyPointList();
//
// for(ReviewKeyPoint keypoint : keyPointList) {
// List<ReviewDetails> reviewDetailsList = keypoint.getReviewDetailsList();
//
// for(ReviewDetails details : reviewDetailsList) {
// detailsNum ++;
// ReviewDetailsResult reviewDetailsResult = resultMap.get(details.getId());
// if(reviewDetailsResult == null || reviewDetailsResult.getPassed() == 0) {
// standard.setPassed(reviewDetailsResult.getPassed());
// detailsPassNum ++;
// standardsPassNum ++;
//
// }
// if(reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() != null) {
// ReviewEnterpriseArchive reviewEnterpriseArchive = reviewEnterpriseArchiveMapper.selectById(reviewDetailsResult.getReviewEnterpriseArchiveId());
// reviewDetailsResult.setEnterpriseName(reviewEnterpriseArchive.getEnterpriseName());
// }
// details.setResult(reviewDetailsResult);
// }
// }
// }
List
<
TaskUserRelation
>
relationList
=
taskUserRelationMapper
.
selectQTeamMembers
(
taskMapper
.
findByCarReviewTaskId
(
carReviewTask
.
getId
()));
// carReviewTask.setDetails(detailsNum);
// carReviewTask.setDetailsPass(((long)detailsPassNum/(long)detailsNum));
// carReviewTask.setStandards(standardsNum);
// carReviewTask.setStandardsPass(((long)standardsPassNum/(long)standardsNum));
carReviewTask
.
setStandards
(
calculateStandards
(
standards
));
carReviewTask
.
setStandardsPass
(
calculateStandardsPass
(
standards
,
resultMap
)
/
(
long
)
carReviewTask
.
getStandards
());
carReviewTask
.
setDetails
(
calculateDetails
(
standards
));
carReviewTask
.
setDetailsPass
((
calculateDetailsPass
(
standards
,
resultMap
)
/
(
long
)
carReviewTask
.
getDetails
()));
carReviewTask
.
setPerson
(
relationList
.
size
());
}
private
int
calculateStandards
(
List
<
ReviewStandard
>
standards
)
{
return
standards
.
size
();
}
private
long
calculateStandardsPass
(
List
<
ReviewStandard
>
standards
,
Map
<
Long
,
ReviewDetailsResult
>
resultMap
)
{
long
standardsPass
=
0
;
for
(
ReviewStandard
standard
:
standards
)
{
List
<
ReviewDetails
>
details
=
getDetailsByStandard
(
standard
);
for
(
ReviewDetails
reviewDetails
:
details
)
{
if
(
detailsIsPass
(
reviewDetails
,
resultMap
))
{
standardsPass
=
standardsPass
+
1
;
}
}
}
return
standardsPass
;
}
private
int
calculateDetails
(
List
<
ReviewStandard
>
standards
)
{
//审查细则(条)
int
detailsNum
=
0
;
//审查细则符合数
int
detailsPassNum
=
0
;
for
(
ReviewStandard
standard
:
standards
)
{
List
<
ReviewDetails
>
details
=
getDetailsByStandard
(
standard
);
detailsNum
=
detailsNum
+
details
.
size
();
}
//标准条款(条)
int
standardsNum
=
0
;
return
detailsNum
;
//标准条款通过数
int
standardsPassNum
=
0
;
}
private
long
calculateDetailsPass
(
List
<
ReviewStandard
>
standards
,
Map
<
Long
,
ReviewDetailsResult
>
resultMap
)
{
long
detailsPass
=
0L
;
for
(
ReviewStandard
standard
:
standards
)
{
standard
.
setPassed
(
1
);
standardsNum
++;
List
<
ReviewKeyPoint
>
keyPointList
=
standard
.
getKeyPointList
();
for
(
ReviewKeyPoint
keypoint
:
keyPointList
)
{
List
<
ReviewDetails
>
reviewDetailsList
=
keypoint
.
getReviewDetailsList
();
for
(
ReviewDetails
details
:
reviewDetailsList
)
{
detailsNum
++;
ReviewDetailsResult
reviewDetailsResult
=
resultMap
.
get
(
details
.
getId
());
if
(
reviewDetailsResult
==
null
||
reviewDetailsResult
.
getPassed
()
==
0
)
{
standard
.
setPassed
(
reviewDetailsResult
.
getPassed
());
detailsPassNum
++;
standardsPassNum
++;
}
if
(
reviewDetailsResult
!=
null
&&
reviewDetailsResult
.
getReviewEnterpriseArchiveId
()
!=
null
)
{
ReviewEnterpriseArchive
reviewEnterpriseArchive
=
reviewEnterpriseArchiveMapper
.
selectById
(
reviewDetailsResult
.
getReviewEnterpriseArchiveId
());
reviewDetailsResult
.
setEnterpriseName
(
reviewEnterpriseArchive
.
getEnterpriseName
());
}
details
.
setResult
(
reviewDetailsResult
);
List
<
ReviewDetails
>
details
=
getDetailsByStandard
(
standard
);
for
(
ReviewDetails
reviewDetails
:
details
)
{
if
(
detailsIsPass
(
reviewDetails
,
resultMap
))
{
detailsPass
=
detailsPass
+
1
;
}
}
}
List
<
TaskUserRelation
>
relationList
=
taskUserRelationMapper
.
selectQTeamMembers
(
taskMapper
.
findByCarReviewTaskId
(
carReviewTask
.
getId
()))
;
return
detailsPass
;
}
carReviewTask
.
setDetails
(
detailsNum
);
carReviewTask
.
setDetailsPass
(((
long
)
detailsPassNum
/(
long
)
detailsNum
));
carReviewTask
.
setStandards
(
standardsNum
);
carReviewTask
.
setStandardsPass
(((
long
)
standardsPassNum
/(
long
)
standardsNum
));
carReviewTask
.
setPerson
(
relationList
.
size
());
private
List
<
ReviewDetails
>
getDetailsByStandard
(
ReviewStandard
standard
)
{
List
<
ReviewDetails
>
details
=
new
ArrayList
();
List
<
ReviewKeyPoint
>
keyPointList
=
standard
.
getKeyPointList
();
for
(
ReviewKeyPoint
keyPoint
:
keyPointList
)
{
details
.
addAll
(
keyPoint
.
getReviewDetailsList
());
}
return
details
;
}
private
boolean
detailsIsPass
(
ReviewDetails
reviewDetails
,
Map
<
Long
,
ReviewDetailsResult
>
resultMap
)
{
ReviewDetailsResult
result
=
resultMap
.
get
(
reviewDetails
.
getId
());
return
result
.
getPassed
()
==
1
;
}
@Override
...
...
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