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
0d930ed5
Commit
0d930ed5
authored
Mar 01, 2024
by
王飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangdingyi' into 'dev'
任务数据统计 See merge request
!113
parents
070f8e7d
da15b7f2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
12 deletions
+94
-12
CarReviewTask.java
...-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
+20
-0
StrategyCarReviewTaskPending.java
.../com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
+71
-9
StrategySystemReviewTaskPending.java
...m/ruoyi/service/impl/StrategySystemReviewTaskPending.java
+3
-3
No files found.
quality-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
View file @
0d930ed5
...
...
@@ -153,4 +153,24 @@ public class CarReviewTask implements Serializable {
@ApiModelProperty
(
"问卷签名图片地址"
)
private
String
imagesUrl
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"审查细则(条)"
)
private
Integer
details
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"审查细则符合率"
)
private
Long
detailsPass
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"标准条款(条)"
)
private
Integer
standards
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"标准条款通过率"
)
private
Long
standardsPass
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"参与审查人数(人)"
)
private
Integer
person
;
}
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
View file @
0d930ed5
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.mapper.*
;
import
com.ruoyi.service.ReviewDetailsResultService
;
import
com.ruoyi.service.ReviewSceneChangeTaskService
;
import
com.ruoyi.service.ReviewStandardService
;
import
com.ruoyi.service.StrategyCarReviewTask
;
import
com.ruoyi.service.*
;
import
com.ruoyi.web.response.CarReviewTaskViewResponse
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
...
...
@@ -65,6 +64,18 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired
private
ReviewEnterpriseArchiveMapper
reviewEnterpriseArchiveMapper
;
@Autowired
private
ReviewKeyPointService
reviewKeyPointService
;
@Autowired
private
ReviewDetailsService
reviewDetailsService
;
@Autowired
private
ReviewStandardMapper
reviewStandardMapper
;
@Autowired
private
TaskUserRelationMapper
taskUserRelationMapper
;
// PENDING状态下
// 1.standard字段查询当前最新问卷
// 2.查询场景变更任务
...
...
@@ -74,6 +85,30 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
// 获取最新问卷
List
<
ReviewStandard
>
standardTree
=
reviewStandardService
.
findTree
(
carReviewTask
.
getStandardId
(),
ReviewStandard
.
TYPE_CAR
);
List
<
ReviewStandard
>
reviewStandardList
=
reviewStandardMapper
.
findListByStandardIdAndType
(
carReviewTask
.
getStandardId
(),
ReviewStandard
.
TYPE_CAR
);
// 查询审查标准
List
<
ReviewKeyPoint
>
reviewKeyPointList
=
reviewKeyPointService
.
findByStandardList
(
reviewStandardList
);
// 查询审查要点
List
<
ReviewDetails
>
reivewDetailsList
=
reviewDetailsService
.
findByKeyPointsList
(
reviewKeyPointList
);
// 查询审查细则
// for(ReviewStandard standard : standardTree) {
// standard.setPassed(0);
// 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());
// standardsPassNum ++;
// detailsPassNum ++;
// }
// }
// }
// }
// 获取当前问卷答案
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
...
...
@@ -91,7 +126,7 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
}
// 绑定问卷与答案
setDetailsResult
(
standardTree
,
results
);
setDetailsResult
(
standardTree
,
results
,
carReviewTask
);
// 赋值给任务
carReviewTask
.
setStandard
(
standardTree
);
...
...
@@ -129,7 +164,7 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
// 3. 将最终问卷归档到 standard 字段
setDetailsResult
(
standardTree
,
results
);
setDetailsResult
(
standardTree
,
results
,
carReviewTask
);
carReviewTask
.
setStandard
(
standardTree
);
// 4. 修改任务状态为 SIGNED 待签字
...
...
@@ -152,21 +187,38 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
}
private
void
setDetailsResult
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
)
{
private
void
setDetailsResult
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
,
CarReviewTask
carReviewTask
)
{
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
(
0
);
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
)
{
if
(
reviewDetailsResult
==
null
||
reviewDetailsResult
.
getPassed
()
=
=
0
)
{
standard
.
setPassed
(
reviewDetailsResult
.
getPassed
());
detailsPassNum
++;
standardsPassNum
++;
}
if
(
reviewDetailsResult
!=
null
&&
reviewDetailsResult
.
getReviewEnterpriseArchiveId
()
!=
null
)
{
ReviewEnterpriseArchive
reviewEnterpriseArchive
=
reviewEnterpriseArchiveMapper
.
selectById
(
reviewDetailsResult
.
getReviewEnterpriseArchiveId
());
...
...
@@ -176,6 +228,16 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
}
}
}
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
.
setPerson
(
relationList
.
size
());
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskPending.java
View file @
0d930ed5
...
...
@@ -160,7 +160,7 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
Map
<
Long
,
ReviewDetailsResult
>
resultMap
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
ReviewDetailsResult:
:
getReviewDetailsId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
for
(
ReviewStandard
standard
:
standards
)
{
standard
.
setPassed
(
0
);
standard
.
setPassed
(
1
);
List
<
ReviewKeyPoint
>
keyPointList
=
standard
.
getKeyPointList
();
for
(
ReviewKeyPoint
keypoint
:
keyPointList
)
{
...
...
@@ -168,8 +168,8 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
for
(
ReviewDetails
details
:
reviewDetailsList
)
{
ReviewDetailsResult
reviewDetailsResult
=
resultMap
.
get
(
details
.
getId
());
if
(
reviewDetailsResult
!=
null
&&
reviewDetailsResult
.
getPassed
()
!
=
0
)
{
standard
.
setPassed
(
reviewDetailsResult
.
getPassed
()
);
if
(
reviewDetailsResult
==
null
||
reviewDetailsResult
.
getPassed
()
=
=
0
)
{
standard
.
setPassed
(
0
);
}
if
(
reviewDetailsResult
!=
null
&&
reviewDetailsResult
.
getReviewEnterpriseArchiveId
()
!=
null
)
{
ReviewEnterpriseArchive
reviewEnterpriseArchive
=
reviewEnterpriseArchiveMapper
.
selectById
(
reviewDetailsResult
.
getReviewEnterpriseArchiveId
());
...
...
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