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
3ec6dbd2
Commit
3ec6dbd2
authored
Mar 14, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取任务与样品关系
parent
0407d327
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
179 additions
and
175 deletions
+179
-175
StrategyCarReviewTaskPending.java
.../com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
+8
-5
StrategySystemReviewTaskPending.java
...m/ruoyi/service/impl/StrategySystemReviewTaskPending.java
+8
-5
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+159
-163
SampleManagementMapper.xml
...view/src/main/resources/mapper/SampleManagementMapper.xml
+2
-1
TaskSampleRelationMapper.xml
...ew/src/main/resources/mapper/TaskSampleRelationMapper.xml
+2
-1
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
View file @
3ec6dbd2
...
...
@@ -74,6 +74,9 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired
private
TaskUserRelationMapper
taskUserRelationMapper
;
@Autowired
private
AutomobileEnterpriseMapper
automobileEnterpriseMapper
;
// PENDING状态下
// 1.standard字段查询当前最新问卷
// 2.查询场景变更任务
...
...
@@ -86,9 +89,6 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
// 获取当前问卷答案
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
// 任务样品关系
List
<
TaskSampleRelation
>
relations
=
taskSampleRelationMapper
.
selectByTaskId
(
taskMapper
.
findByCarReviewTaskId
(
carReviewTask
.
getId
()),
TaskSampleRelation
.
COMPLETE_VEHICLE_SAMPLE
);
// 绑定问卷与答案
setDetailsResult
(
standardTree
,
results
,
carReviewTask
);
...
...
@@ -98,14 +98,17 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
// 查询场景变更任务便于提醒用户场景变动
List
<
ReviewSceneChangeTask
>
lastChanges
=
reviewSceneChangeTaskService
.
findLastChangeByTaskId
(
carReviewTask
.
getId
());
// 任务样品关系
List
<
TaskSampleRelation
>
sampleRelations
=
taskSampleRelationMapper
.
selectByTaskId
(
taskMapper
.
findByCarReviewTaskId
(
carReviewTask
.
getId
()),
TaskSampleRelation
.
COMPLETE_VEHICLE_SAMPLE
);
// 获取第一个整车样品对应的生产企业
TaskSampleRelation
taskSampleRelation
=
sampleRelations
.
get
(
0
);
Sample
sample
=
sampleManagementMapper
.
selectSampleManagementById
(
taskSampleRelation
.
getSampleId
());
AutomobileEnterprise
automobileEnterprise
=
automobileEnterpriseMapper
.
selectAutomobileEnterpriseById
(
sample
.
getManufacturingEnterpriseId
());
carReviewTask
.
setEnterpriseName
(
sample
.
getManufacturingEnterpris
e
());
carReviewTask
.
setEnterpriseName
(
automobileEnterprise
.
getEnterpriseNam
e
());
// 构建返回结果
CarReviewTaskViewResponse
response
=
new
CarReviewTaskViewResponse
();
carReviewTask
.
setImagesUrl
(
"/vehicle-quality-review-oss/2024/03/04/qianzi1_20240304104011A001.jpg,/vehicle-quality-review-oss/2024/03/04/qianzi2_20240304104121A002.jpg"
);
response
.
setCarReviewTask
(
carReviewTask
);
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskPending.java
View file @
3ec6dbd2
...
...
@@ -66,6 +66,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired
private
TaskUserRelationMapper
taskUserRelationMapper
;
@Autowired
private
AutomobileEnterpriseMapper
automobileEnterpriseMapper
;
@Override
public
void
doStart
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能开始一个已经开始的任务"
,
HttpStatus
.
ERROR
);
...
...
@@ -129,9 +132,6 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
// 获取当前问卷答案
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
systemReviewTask
.
getId
());
// 任务样品关系
List
<
TaskSampleRelation
>
relations
=
taskSampleRelationMapper
.
selectByTaskId
(
taskMapper
.
findBySystemReviewTaskId
(
systemReviewTask
.
getId
()),
TaskSampleRelation
.
COMPLETE_VEHICLE_SAMPLE
);
// 绑定问卷与答案
setDetailsResult
(
standardTree
,
results
,
systemReviewTask
);
...
...
@@ -141,12 +141,15 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
// 查询场景变更任务便于提醒用户场景变动
List
<
ReviewSceneChangeTask
>
lastChanges
=
reviewSceneChangeTaskService
.
findLastChangeByTaskId
(
systemReviewTask
.
getId
());
// 任务样品关系
List
<
TaskSampleRelation
>
sampleRelations
=
taskSampleRelationMapper
.
selectByTaskId
(
taskMapper
.
findBySystemReviewTaskId
(
systemReviewTask
.
getId
()),
TaskSampleRelation
.
COMPLETE_VEHICLE_SAMPLE
);
// 获取第一个整车样品对应的生产企业
TaskSampleRelation
taskSampleRelation
=
sampleRelations
.
get
(
0
);
Sample
sample
=
sampleManagementMapper
.
selectSampleManagementById
(
taskSampleRelation
.
getSampleId
());
AutomobileEnterprise
automobileEnterprise
=
automobileEnterpriseMapper
.
selectAutomobileEnterpriseById
(
sample
.
getManufacturingEnterpriseId
());
systemReviewTask
.
setEnterpriseName
(
sample
.
getManufacturingEnterpris
e
());
systemReviewTask
.
setEnterpriseName
(
automobileEnterprise
.
getEnterpriseNam
e
());
// 构建返回结果
SystemReviewTaskViewResponse
response
=
new
SystemReviewTaskViewResponse
();
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
3ec6dbd2
This diff is collapsed.
Click to expand it.
quality-review/src/main/resources/mapper/SampleManagementMapper.xml
View file @
3ec6dbd2
...
...
@@ -176,7 +176,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select t.id,t.identification_code,t.sample_number,t.sample_name,t.manufacturing_enterprise_id,t.trademark,t.sample_photos,t.number_of_samples,t.delivery_date,t.sample_sender,t.manufacturing_enterprise,t.manufacture_date
from t_sample t
left join t_task_sample_relation ts on ts.sample_id = t.id and ts.task_id = #{id}
WHERE t.id IN
WHERE t.deleted = 0
AND t.id IN
<foreach
collection=
"relationList"
item=
"relation"
open=
"("
separator=
","
close=
")"
>
#{relation.sampleId}
</foreach>
...
...
quality-review/src/main/resources/mapper/TaskSampleRelationMapper.xml
View file @
3ec6dbd2
...
...
@@ -15,7 +15,8 @@
select id,task_id,sample_id,flag from t_task_sample_relation
</sql>
<select
id=
"selectByTaskId"
resultType=
"com.ruoyi.domain.TaskSampleRelation"
>
<include
refid=
"Base_Column_List"
/>
select ts.id,ts.task_id,ts.sample_id,ts.flag from t_task_sample_relation ts
left join t_sample t on t.id = ts.sample_id and t.deleted = 0
where
<if
test=
"taskId != null and taskId != ''"
>
task_id = #{taskId}
...
...
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