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
155e2314
Commit
155e2314
authored
Mar 04, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查看问卷统计数据&编辑任务修改
parent
258fe201
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
22 deletions
+35
-22
StrategyCarReviewTaskPending.java
.../com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
+5
-2
StrategySystemReviewTaskPending.java
...m/ruoyi/service/impl/StrategySystemReviewTaskPending.java
+7
-3
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+23
-17
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
View file @
155e2314
...
@@ -16,6 +16,7 @@ import org.springframework.context.ApplicationContext;
...
@@ -16,6 +16,7 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -168,9 +169,11 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
...
@@ -168,9 +169,11 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
List
<
TaskUserRelation
>
relationList
=
taskUserRelationMapper
.
selectQTeamMembers
(
taskMapper
.
findByCarReviewTaskId
(
carReviewTask
.
getId
()));
List
<
TaskUserRelation
>
relationList
=
taskUserRelationMapper
.
selectQTeamMembers
(
taskMapper
.
findByCarReviewTaskId
(
carReviewTask
.
getId
()));
carReviewTask
.
setStandards
(
calculateStandards
(
standards
));
carReviewTask
.
setStandards
(
calculateStandards
(
standards
));
carReviewTask
.
setStandardsPass
(
calculateStandardsPass
(
standards
,
resultMap
)
/
(
double
)
carReviewTask
.
getStandards
());
BigDecimal
standardPass
=
new
BigDecimal
(
calculateStandardsPass
(
standards
,
resultMap
)
/
(
double
)
carReviewTask
.
getStandards
());
carReviewTask
.
setStandardsPass
(
standardPass
.
setScale
(
3
,
BigDecimal
.
ROUND_UP
).
doubleValue
()
*
100
);
carReviewTask
.
setDetails
(
calculateDetails
(
standards
));
carReviewTask
.
setDetails
(
calculateDetails
(
standards
));
carReviewTask
.
setDetailsPass
((
calculateDetailsPass
(
standards
,
resultMap
)
/
(
double
)
carReviewTask
.
getDetails
()));
BigDecimal
detailsPass
=
new
BigDecimal
(
calculateDetailsPass
(
standards
,
resultMap
)
/
(
double
)
carReviewTask
.
getDetails
());
carReviewTask
.
setDetailsPass
(
detailsPass
.
setScale
(
3
,
BigDecimal
.
ROUND_UP
).
doubleValue
()
*
100
);
carReviewTask
.
setPerson
(
relationList
.
size
());
carReviewTask
.
setPerson
(
relationList
.
size
());
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskPending.java
View file @
155e2314
...
@@ -14,6 +14,8 @@ import org.springframework.context.ApplicationContext;
...
@@ -14,6 +14,8 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -160,12 +162,14 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
...
@@ -160,12 +162,14 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
Map
<
Long
,
ReviewDetailsResult
>
resultMap
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
ReviewDetailsResult:
:
getReviewDetailsId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
Map
<
Long
,
ReviewDetailsResult
>
resultMap
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
ReviewDetailsResult:
:
getReviewDetailsId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
List
<
TaskUserRelation
>
relationList
=
taskUserRelationMapper
.
selectQTeamMembers
(
taskMapper
.
findBy
Car
ReviewTaskId
(
systemReviewTask
.
getId
()));
List
<
TaskUserRelation
>
relationList
=
taskUserRelationMapper
.
selectQTeamMembers
(
taskMapper
.
findBy
System
ReviewTaskId
(
systemReviewTask
.
getId
()));
systemReviewTask
.
setStandards
(
calculateStandards
(
standards
));
systemReviewTask
.
setStandards
(
calculateStandards
(
standards
));
systemReviewTask
.
setStandardsPass
(
calculateStandardsPass
(
standards
,
resultMap
)
/
(
double
)
systemReviewTask
.
getStandards
());
BigDecimal
standardPass
=
new
BigDecimal
(
calculateStandardsPass
(
standards
,
resultMap
)
/
(
double
)
systemReviewTask
.
getStandards
());
systemReviewTask
.
setStandardsPass
(
standardPass
.
setScale
(
3
,
BigDecimal
.
ROUND_UP
).
doubleValue
()
*
100
);
systemReviewTask
.
setDetails
(
calculateDetails
(
standards
));
systemReviewTask
.
setDetails
(
calculateDetails
(
standards
));
systemReviewTask
.
setDetailsPass
((
calculateDetailsPass
(
standards
,
resultMap
)
/
(
double
)
systemReviewTask
.
getDetails
()));
BigDecimal
detailsPass
=
new
BigDecimal
(
calculateDetailsPass
(
standards
,
resultMap
)
/
(
double
)
systemReviewTask
.
getDetails
());
systemReviewTask
.
setDetailsPass
(
detailsPass
.
setScale
(
3
,
BigDecimal
.
ROUND_UP
).
doubleValue
()
*
100
);
systemReviewTask
.
setPerson
(
relationList
.
size
());
systemReviewTask
.
setPerson
(
relationList
.
size
());
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
155e2314
...
@@ -337,16 +337,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
...
@@ -337,16 +337,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
SysUser
initiator
=
sysUserService
.
selectUserById
(
loginUser
.
getUserId
());
SysUser
initiator
=
sysUserService
.
selectUserById
(
loginUser
.
getUserId
());
Standard
standard
=
standardService
.
findListById
(
request
.
getStandardId
());
Standard
standard
=
standardService
.
findListById
(
request
.
getStandardId
());
// 找到审查组长
TaskUserRelation
leader
=
null
;
List
<
TaskUserRelation
>
auditors
=
request
.
getAuditors
();
for
(
TaskUserRelation
auditor
:
auditors
)
{
if
(
auditor
.
getIsLeader
()
==
1
)
{
leader
=
auditor
;
break
;
}
}
// 构建并保存任务信息
// 构建并保存任务信息
// 总任务
// 总任务
Task
task
=
new
Task
();
Task
task
=
new
Task
();
...
@@ -354,8 +344,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
...
@@ -354,8 +344,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
task
.
setTaskInitiator
(
initiator
.
getNickName
());
task
.
setTaskInitiator
(
initiator
.
getNickName
());
task
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
task
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
task
.
setTaskStatus
(
Task
.
TASK_STATUS_TEMPORARILY
);
task
.
setTaskStatus
(
Task
.
TASK_STATUS_TEMPORARILY
);
task
.
setLeaderId
(
leader
.
getUserId
());
task
.
setLeader
(
leader
.
getName
());
task
.
setName
(
standard
.
getName
());
task
.
setName
(
standard
.
getName
());
task
.
setStandardNo
(
standard
.
getStandardNo
());
task
.
setStandardNo
(
standard
.
getStandardNo
());
task
.
setFile
(
standard
.
getFile
());
task
.
setFile
(
standard
.
getFile
());
...
@@ -363,14 +351,32 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
...
@@ -363,14 +351,32 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
task
.
setTaskList
(
joinTaskList
);
task
.
setTaskList
(
joinTaskList
);
BeanUtils
.
copyBeanProp
(
task
,
request
);
BeanUtils
.
copyBeanProp
(
task
,
request
);
taskService
.
save
(
task
);
// 找到审查组长
TaskUserRelation
leader
=
null
;
List
<
TaskUserRelation
>
auditors
=
request
.
getAuditors
();
if
(
auditors
.
size
()
!=
0
&&
auditors
!=
null
)
{
for
(
TaskUserRelation
auditor
:
auditors
)
{
if
(
auditor
.
getIsLeader
()
==
1
)
{
leader
=
auditor
;
break
;
}
}
// 构建并保存该任务所关联的审核组信息
// 构建并保存该任务所关联的审核组信息
for
(
TaskUserRelation
auditor
:
auditors
)
{
for
(
TaskUserRelation
auditor
:
auditors
)
{
auditor
.
setTaskId
(
task
.
getId
());
auditor
.
setTaskId
(
task
.
getId
());
}
taskUserRelationService
.
saveBatch
(
auditors
);
// 任务组长
task
.
setLeaderId
(
leader
.
getUserId
());
task
.
setLeader
(
leader
.
getName
());
}
}
taskUserRelationService
.
saveBatch
(
auditors
);
// 暂存
taskService
.
save
(
task
);
// 保存关联的整车样品信息
// 保存关联的整车样品信息
List
<
TaskSampleRelation
>
relations
=
request
.
getSample
();
List
<
TaskSampleRelation
>
relations
=
request
.
getSample
();
...
...
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