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
524adab0
Commit
524adab0
authored
Mar 12, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
总任务数据统计修改
parent
d55b12e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+23
-8
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
524adab0
...
...
@@ -592,6 +592,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
if
(
task
.
getSystemReviewTaskId
()
!=
null
)
{
systemReviewTaskService
.
view
(
task
.
getSystemReviewTaskId
());
SystemReviewTask
systemReviewTask
=
systemReviewTaskMapper
.
selectById
(
task
.
getSystemReviewTaskId
());
// 获取最新问卷
List
<
ReviewStandard
>
standardTree
=
reviewStandardService
.
findTree
(
systemReviewTask
.
getStandardId
(),
ReviewStandard
.
TYPE_SYSTEM
);
...
...
@@ -600,13 +602,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
systemReviewTask
.
getId
());
// 体系审查
setSystemDataStatistics
(
standardTree
,
results
,
response
);
setSystemDataStatistics
(
standardTree
,
results
,
response
,
systemReviewTask
);
return
response
;
}
if
(
task
.
getCarReviewTaskId
()
!=
null
)
{
carReviewTaskService
.
viewReviewTask
(
task
.
getCarReviewTaskId
());
CarReviewTask
carReviewTask
=
carReviewTaskMapper
.
selectById
(
task
.
getCarReviewTaskId
());
// 获取最新问卷
...
...
@@ -616,7 +620,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List
<
ReviewDetailsResult
>
carResults
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
// 车型审查
setCarDataStatistics
(
carStandardTree
,
carResults
,
response
);
setCarDataStatistics
(
carStandardTree
,
carResults
,
response
,
carReviewTask
);
return
response
;
...
...
@@ -627,16 +631,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
private
void
setSystemDataStatistics
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
,
DataStatisticsResponse
response
)
{
private
void
setSystemDataStatistics
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
,
DataStatisticsResponse
response
,
SystemReviewTask
systemReviewTask
)
{
Map
<
Long
,
ReviewDetailsResult
>
resultMap
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
ReviewDetailsResult:
:
getReviewDetailsId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
response
.
setSystemStandards
(
DataStatisticsUtils
.
calculateStandards
(
standards
));
if
(
Objects
.
equals
(
systemReviewTask
.
getTaskStatus
(),
SystemReviewTask
.
STATUS_NEW
))
{
response
.
setSystemStandards
(
DataStatisticsUtils
.
calculateStandards
(
standards
));
response
.
setSystemDetails
(
DataStatisticsUtils
.
calculateDetails
(
standards
));
}
else
{
response
.
setSystemStandards
(
systemReviewTask
.
getStandards
());
response
.
setSystemDetails
(
systemReviewTask
.
getDetails
());
}
response
.
setSystemStandardsPassNum
(
DataStatisticsUtils
.
calculateStandardsPass
(
standards
,
resultMap
));
response
.
setSystemStandardsNoPassNum
(
DataStatisticsUtils
.
calculateStandardsNoPass
(
standards
,
resultMap
));
response
.
setSystemStandardsUnderNum
(
response
.
getSystemStandards
()
-
response
.
getSystemStandardsPassNum
()
-
response
.
getSystemStandardsNoPassNum
());
BigDecimal
standardPass
=
new
BigDecimal
((
response
.
getSystemStandardsPassNum
()
/
(
double
)
response
.
getSystemStandards
())*
100
);
response
.
setSystemStandardsPass
(
standardPass
.
setScale
(
1
,
BigDecimal
.
ROUND_UP
).
doubleValue
());
response
.
setSystemDetails
(
DataStatisticsUtils
.
calculateDetails
(
standards
));
response
.
setSystemDetailsPassNum
(
DataStatisticsUtils
.
calculateDetailsPass
(
standards
,
resultMap
));
response
.
setSystemDetailsNoPassNum
(
DataStatisticsUtils
.
calculateDetailsNoPass
(
standards
,
resultMap
));
response
.
setSystemDetailsUnderNum
(
response
.
getSystemDetails
()
-
response
.
getSystemDetailsPassNum
()
-
response
.
getSystemDetailsNoPassNum
());
...
...
@@ -645,16 +655,21 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
private
void
setCarDataStatistics
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
,
DataStatisticsResponse
response
)
{
private
void
setCarDataStatistics
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
,
DataStatisticsResponse
response
,
CarReviewTask
carReviewTask
)
{
Map
<
Long
,
ReviewDetailsResult
>
resultMap
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
ReviewDetailsResult:
:
getReviewDetailsId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
response
.
setCarStandards
(
DataStatisticsUtils
.
calculateStandards
(
standards
));
if
(
Objects
.
equals
(
carReviewTask
.
getTaskStatus
(),
CarReviewTask
.
TASK_STATUS_NEW
))
{
response
.
setCarStandards
(
DataStatisticsUtils
.
calculateStandards
(
standards
));
response
.
setCarDetails
(
DataStatisticsUtils
.
calculateDetails
(
standards
));
}
else
{
response
.
setCarStandards
(
carReviewTask
.
getStandards
());
response
.
setCarDetails
(
carReviewTask
.
getDetails
());
}
response
.
setCarStandardsPassNum
(
DataStatisticsUtils
.
calculateStandardsPass
(
standards
,
resultMap
));
response
.
setCarStandardsNoPassNum
(
DataStatisticsUtils
.
calculateStandardsNoPass
(
standards
,
resultMap
));
response
.
setCarStandardsUnderNum
(
response
.
getCarStandards
()
-
response
.
getCarStandardsPassNum
()
-
response
.
getCarStandardsNoPassNum
());
BigDecimal
standardPass
=
new
BigDecimal
((
response
.
getCarStandardsPassNum
()
/
(
double
)
response
.
getCarStandards
())*
100
);
response
.
setCarStandardsPass
(
standardPass
.
setScale
(
1
,
BigDecimal
.
ROUND_UP
).
doubleValue
());
response
.
setCarDetails
(
DataStatisticsUtils
.
calculateDetails
(
standards
));
response
.
setCarDetailsPassNum
(
DataStatisticsUtils
.
calculateDetailsPass
(
standards
,
resultMap
));
response
.
setCarDetailsNoPassNum
(
DataStatisticsUtils
.
calculateDetailsNoPass
(
standards
,
resultMap
));
response
.
setCarDetailsUnderNum
(
response
.
getCarDetails
()
-
response
.
getCarDetailsPassNum
()
-
response
.
getCarDetailsNoPassNum
());
...
...
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