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
fd217a6c
Commit
fd217a6c
authored
Jan 08, 2024
by
W_Y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查看车辆审查任务
parent
57d07b73
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
155 additions
and
3 deletions
+155
-3
CarReviewTaskService.java
...src/main/java/com/ruoyi/service/CarReviewTaskService.java
+2
-1
StrategyCarReviewTask.java
...rc/main/java/com/ruoyi/service/StrategyCarReviewTask.java
+9
-0
CarReviewTaskServiceImpl.java
...java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
+7
-2
StrategyCarReviewTaskContext.java
.../com/ruoyi/service/impl/StrategyCarReviewTaskContext.java
+26
-0
StrategyCarReviewTaskPending.java
.../com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
+85
-0
CarReviewTaskViewResponse.java
...ava/com/ruoyi/web/response/CarReviewTaskViewResponse.java
+26
-0
No files found.
quality-review/src/main/java/com/ruoyi/service/CarReviewTaskService.java
View file @
fd217a6c
...
@@ -3,6 +3,7 @@ package com.ruoyi.service;
...
@@ -3,6 +3,7 @@ package com.ruoyi.service;
import
com.ruoyi.domain.CarReviewTask
;
import
com.ruoyi.domain.CarReviewTask
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.response.CarReviewTaskViewResponse
;
import
com.ruoyi.web.response.SystemReviewTaskViewResponse
;
import
com.ruoyi.web.response.SystemReviewTaskViewResponse
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,7 +33,7 @@ public interface CarReviewTaskService extends IService<CarReviewTask> {
...
@@ -32,7 +33,7 @@ public interface CarReviewTaskService extends IService<CarReviewTask> {
* @param taskId
* @param taskId
* @return
* @return
*/
*/
System
ReviewTaskViewResponse
viewReviewTask
(
Long
taskId
);
Car
ReviewTaskViewResponse
viewReviewTask
(
Long
taskId
);
/**
/**
...
...
quality-review/src/main/java/com/ruoyi/service/StrategyCarReviewTask.java
0 → 100644
View file @
fd217a6c
package
com
.
ruoyi
.
service
;
import
com.ruoyi.domain.CarReviewTask
;
import
com.ruoyi.web.response.CarReviewTaskViewResponse
;
public
interface
StrategyCarReviewTask
{
CarReviewTaskViewResponse
doView
(
CarReviewTask
carReviewTask
);
}
quality-review/src/main/java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
View file @
fd217a6c
...
@@ -17,6 +17,7 @@ import com.ruoyi.system.service.ISysUserService;
...
@@ -17,6 +17,7 @@ import com.ruoyi.system.service.ISysUserService;
import
com.ruoyi.web.request.CarReviewTaskCreateRequest
;
import
com.ruoyi.web.request.CarReviewTaskCreateRequest
;
import
com.ruoyi.web.request.CarReviewTaskStartRequest
;
import
com.ruoyi.web.request.CarReviewTaskStartRequest
;
import
com.ruoyi.web.request.CarReviewTaskSubmitRequest
;
import
com.ruoyi.web.request.CarReviewTaskSubmitRequest
;
import
com.ruoyi.web.response.CarReviewTaskViewResponse
;
import
com.ruoyi.web.response.SystemReviewTaskViewResponse
;
import
com.ruoyi.web.response.SystemReviewTaskViewResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -50,6 +51,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
...
@@ -50,6 +51,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Autowired
@Autowired
private
ReviewTaskUserRelationService
relationService
;
private
ReviewTaskUserRelationService
relationService
;
@Autowired
private
StrategyCarReviewTaskContext
strategyCarReviewTaskContext
;
@Override
@Override
public
List
<
CarReviewTask
>
findListByReviewStatus
(
String
reviewStatus
)
{
public
List
<
CarReviewTask
>
findListByReviewStatus
(
String
reviewStatus
)
{
return
carReviewTaskMapper
.
findListByReviewStatus
(
reviewStatus
);
return
carReviewTaskMapper
.
findListByReviewStatus
(
reviewStatus
);
...
@@ -111,8 +115,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
...
@@ -111,8 +115,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
}
}
@Override
@Override
public
SystemReviewTaskViewResponse
viewReviewTask
(
Long
taskId
)
{
public
CarReviewTaskViewResponse
viewReviewTask
(
Long
taskId
)
{
return
null
;
CarReviewTask
carReviewTask
=
carReviewTaskService
.
getById
(
taskId
);
return
strategyCarReviewTaskContext
.
getResource
(
carReviewTask
.
getTaskStatus
()).
doView
(
carReviewTask
);
}
}
@Override
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskContext.java
0 → 100644
View file @
fd217a6c
package
com
.
ruoyi
.
service
.
impl
;
import
com.ruoyi.service.StrategyCarReviewTask
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Transactional
@Service
public
class
StrategyCarReviewTaskContext
{
@Autowired
private
final
Map
<
String
,
StrategyCarReviewTask
>
resourceMap
=
new
ConcurrentHashMap
<>();
public
StrategyCarReviewTaskContext
(
Map
<
String
,
StrategyCarReviewTask
>
strategyMap
)
{
this
.
resourceMap
.
clear
();
strategyMap
.
forEach
(
resourceMap:
:
put
);
}
public
StrategyCarReviewTask
getResource
(
String
operation
){
return
resourceMap
.
get
(
operation
);
}
}
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
0 → 100644
View file @
fd217a6c
package
com
.
ruoyi
.
service
.
impl
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.mapper.ReviewDetailsResultMapper
;
import
com.ruoyi.mapper.SystemReviewTaskMapper
;
import
com.ruoyi.service.ReviewDetailsResultService
;
import
com.ruoyi.service.ReviewSceneChangeTaskService
;
import
com.ruoyi.service.ReviewStandardService
;
import
com.ruoyi.service.StrategyCarReviewTask
;
import
com.ruoyi.web.response.CarReviewTaskViewResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Transactional
@Service
(
CarReviewTask
.
TASK_STATUS_PENDING
)
public
class
StrategyCarReviewTaskPending
implements
StrategyCarReviewTask
{
@Autowired
private
ReviewStandardService
reviewStandardService
;
@Autowired
private
ReviewDetailsResultService
reviewDetailsResultService
;
@Autowired
private
ReviewSceneChangeTaskService
reviewSceneChangeTaskService
;
@Autowired
private
SystemReviewTaskMapper
systemReviewTaskMapper
;
@Autowired
private
ReviewDetailsResultMapper
reviewDetailsResultMapper
;
// PENDING状态下
// 1.standard字段查询当前最新问卷
// 2.查询场景变更任务
// 3.需要联查问卷答案
@Override
public
CarReviewTaskViewResponse
doView
(
CarReviewTask
carReviewTask
)
{
// 获取最新问卷
List
<
ReviewStandard
>
standardTree
=
reviewStandardService
.
findTree
(
carReviewTask
.
getStandardId
(),
ReviewStandard
.
TYPE_CAR
);
// 获取当前问卷答案
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
// 绑定问卷与答案
setDetailsResult
(
standardTree
,
results
);
// 赋值给任务
carReviewTask
.
setStandard
(
standardTree
);
// 查询场景变更任务便于提醒用户场景变动
List
<
ReviewSceneChangeTask
>
lastChanges
=
reviewSceneChangeTaskService
.
findLastChangeByTaskId
(
carReviewTask
.
getId
());
// 构建返回结果
CarReviewTaskViewResponse
response
=
new
CarReviewTaskViewResponse
();
response
.
setCarReviewTask
(
carReviewTask
);
response
.
setReviewSceneChangeTasks
(
lastChanges
);
return
response
;
}
private
void
setDetailsResult
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
)
{
Map
<
Long
,
ReviewDetailsResult
>
resultMap
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
ReviewDetailsResult:
:
getReviewDetailsId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
for
(
ReviewStandard
standard
:
standards
)
{
List
<
ReviewKeyPoint
>
keyPointList
=
standard
.
getKeyPointList
();
for
(
ReviewKeyPoint
keypoint
:
keyPointList
)
{
List
<
ReviewDetails
>
reviewDetailsList
=
keypoint
.
getReviewDetailsList
();
for
(
ReviewDetails
details
:
reviewDetailsList
)
{
details
.
setResult
(
resultMap
.
get
(
details
.
getId
()));
}
}
}
}
}
quality-review/src/main/java/com/ruoyi/web/response/CarReviewTaskViewResponse.java
0 → 100644
View file @
fd217a6c
package
com
.
ruoyi
.
web
.
response
;
import
com.ruoyi.domain.CarReviewTask
;
import
com.ruoyi.domain.ReviewSceneChangeTask
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"CarReviewTaskViewResponse"
,
description
=
"查询车辆审查任务详情响应体"
)
@Data
public
class
CarReviewTaskViewResponse
{
/**
* 任务信息
*/
@ApiModelProperty
(
"任务信息"
)
private
CarReviewTask
carReviewTask
;
/**
* 任务开始后的场景变更信息
*/
@ApiModelProperty
(
"任务开始后的场景变更信息"
)
private
List
<
ReviewSceneChangeTask
>
reviewSceneChangeTasks
;
}
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