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
aa73859d
Commit
aa73859d
authored
Feb 05, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建任务&查询发布的任务&查询待办任务&查询已办任务
parent
2da01ad0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
38 deletions
+93
-38
Task.java
quality-review/src/main/java/com/ruoyi/domain/Task.java
+2
-2
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+21
-2
TaskStateNew.java
...ew/src/main/java/com/ruoyi/service/impl/TaskStateNew.java
+2
-0
TaskCreateRequest.java
...rc/main/java/com/ruoyi/web/request/TaskCreateRequest.java
+3
-5
TaskFindFinishRequest.java
...ain/java/com/ruoyi/web/request/TaskFindFinishRequest.java
+12
-6
TaskFindPendingRequest.java
...in/java/com/ruoyi/web/request/TaskFindPendingRequest.java
+12
-6
TaskMapper.xml
quality-review/src/main/resources/mapper/TaskMapper.xml
+41
-17
No files found.
quality-review/src/main/java/com/ruoyi/domain/Task.java
View file @
aa73859d
...
...
@@ -102,10 +102,10 @@ public class Task {
@ApiModelProperty
(
"委托单位邮政编码"
)
private
String
entrustedUnitCode
;
@ApiModelProperty
(
"整车样品信息
id
"
)
@ApiModelProperty
(
"整车样品信息"
)
private
String
vehicleSampleInformation
;
@ApiModelProperty
(
"零件样品信息
id
"
)
@ApiModelProperty
(
"零件样品信息"
)
private
String
partSampleInformation
;
@ApiModelProperty
(
"任务发起人id"
)
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
aa73859d
...
...
@@ -59,6 +59,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Autowired
private
TaskStateFacade
taskStateFacade
;
@Autowired
private
TaskSampleRelationService
taskSampleRelationService
;
@Override
public
List
<
Task
>
findList
(
TaskListRequest
request
)
{
...
...
@@ -86,8 +89,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
// 构建并保存任务信息
// 总任务
Task
task
=
new
Task
();
task
.
setVehicleSampleInformation
(
String
.
join
(
","
,
request
.
getVehicleSampleInformation
()));
task
.
setPartSampleInformation
(
String
.
join
(
","
,
request
.
getPartSampleInformation
()));
task
.
setTaskInitiatorId
(
loginUser
.
getUserId
());
task
.
setTaskInitiator
(
initiator
.
getNickName
());
task
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
...
...
@@ -118,6 +119,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
taskUserRelationService
.
saveBatch
(
auditors
);
// 保存关联的样品信息
List
<
TaskSampleRelation
>
relations
=
request
.
getSample
();
if
(
relations
.
size
()
!=
0
&&
relations
!=
null
)
{
for
(
TaskSampleRelation
sampleRelation
:
relations
)
{
sampleRelation
.
setTaskId
(
task
.
getId
());
}
taskSampleRelationService
.
saveBatch
(
relations
);
}
taskStateFacade
.
doCreate
(
task
,
request
.
getTaskList
());
}
...
...
@@ -188,6 +199,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Override
public
List
<
TaskFindResponse
>
findCreate
(
TaskFindRequest
request
,
Long
userId
)
{
List
<
TaskFindResponse
>
responses
=
taskMapper
.
findByUserId
(
request
,
userId
);
for
(
TaskFindResponse
response
:
responses
)
{
if
(
response
.
getSystemReviewTaskId
()
!=
null
)
{
response
.
setSystemReview
(
reviewDetailsMapper
.
count
(
response
.
getSystemReviewTaskId
(),
SystemReviewTask
.
TYPE
));
}
if
(
response
.
getCarReviewTaskId
()
!=
null
)
{
response
.
setCarReview
(
reviewDetailsMapper
.
count
(
response
.
getCarReviewTaskId
(),
CarReviewTask
.
TYPE
));
}
}
return
responses
;
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskStateNew.java
View file @
aa73859d
...
...
@@ -53,6 +53,8 @@ public class TaskStateNew implements TaskState, InitializingBean {
}
task
.
setNextNode
(
nextNode
);
taskService
.
updateById
(
task
);
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/web/request/TaskCreateRequest.java
View file @
aa73859d
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.web.request;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.common.core.domain.entity.SysDictData
;
import
com.ruoyi.domain.TaskSampleRelation
;
import
com.ruoyi.domain.TaskUserRelation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -52,11 +53,8 @@ public class TaskCreateRequest {
@ApiModelProperty
(
"委托单位邮政编码"
)
private
String
entrustedUnitCode
;
@ApiModelProperty
(
"整车样品信息id"
)
private
List
<
String
>
vehicleSampleInformation
;
@ApiModelProperty
(
"零件样品信息id"
)
private
List
<
String
>
partSampleInformation
;
@ApiModelProperty
(
"样品信息"
)
private
List
<
TaskSampleRelation
>
sample
;
@ApiModelProperty
(
"选择的任务"
)
List
<
String
>
taskList
;
...
...
quality-review/src/main/java/com/ruoyi/web/request/TaskFindFinishRequest.java
View file @
aa73859d
...
...
@@ -11,12 +11,18 @@ import java.util.Date;
@Data
public
class
TaskFindFinishRequest
extends
PageDomain
{
@ApiModelProperty
(
"
任务编号或名称关键词
"
)
private
String
taskNoOrName
;
@ApiModelProperty
(
"
检验依据
"
)
private
Long
standardId
;
@ApiModelProperty
(
"任务
开始时间
"
)
private
Date
taskBeginTime
;
@ApiModelProperty
(
"任务
编号
"
)
private
String
taskNo
;
@ApiModelProperty
(
"任务结束时间"
)
private
Date
taskEndTime
;
@ApiModelProperty
(
"任务名称"
)
private
String
taskName
;
@ApiModelProperty
(
"车辆型号"
)
private
String
productModel
;
@ApiModelProperty
(
"检验项目"
)
private
String
inspectionItem
;
}
quality-review/src/main/java/com/ruoyi/web/request/TaskFindPendingRequest.java
View file @
aa73859d
...
...
@@ -11,12 +11,18 @@ import java.util.Date;
@Data
public
class
TaskFindPendingRequest
extends
PageDomain
{
@ApiModelProperty
(
"
任务编号或名称关键词
"
)
private
String
taskNoOrName
;
@ApiModelProperty
(
"
检验依据
"
)
private
Long
standardId
;
@ApiModelProperty
(
"任务
开始时间
"
)
private
Date
taskBeginTime
;
@ApiModelProperty
(
"任务
编号
"
)
private
String
taskNo
;
@ApiModelProperty
(
"子任务状态"
)
private
String
subStatus
;
@ApiModelProperty
(
"任务名称"
)
private
String
taskName
;
@ApiModelProperty
(
"车辆型号"
)
private
String
productModel
;
@ApiModelProperty
(
"检验项目"
)
private
String
inspectionItem
;
}
quality-review/src/main/resources/mapper/TaskMapper.xml
View file @
aa73859d
...
...
@@ -6,8 +6,8 @@
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.domain.Task"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<
id
property=
"systemReviewTaskId"
column=
"system_review_task_id"
jdbcType=
"BIGINT"
/>
<
id
property=
"carReviewTaskId"
column=
"car_review_task_id"
jdbcType=
"BIGINT"
/>
<
result
property=
"systemReviewTaskId"
column=
"system_review_task_id"
jdbcType=
"BIGINT"
/>
<
result
property=
"carReviewTaskId"
column=
"car_review_task_id"
jdbcType=
"BIGINT"
/>
<result
property=
"taskStatus"
column=
"task_status"
jdbcType=
"VARCHAR"
/>
<result
property=
"runStatus"
column=
"run_status"
jdbcType=
"VARCHAR"
/>
<result
property=
"nextNode"
column=
"next_node"
jdbcType=
"VARCHAR"
/>
...
...
@@ -38,8 +38,8 @@
<resultMap
id=
"ResponseMap"
type=
"com.ruoyi.web.response.TaskFindResponse"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<
id
property=
"systemReviewTaskId"
column=
"system_review_task_id"
jdbcType=
"BIGINT"
/>
<
id
property=
"carReviewTaskId"
column=
"car_review_task_id"
jdbcType=
"BIGINT"
/>
<
result
property=
"systemReviewTaskId"
column=
"system_review_task_id"
jdbcType=
"BIGINT"
/>
<
result
property=
"carReviewTaskId"
column=
"car_review_task_id"
jdbcType=
"BIGINT"
/>
<result
property=
"taskNo"
column=
"task_no"
jdbcType=
"VARCHAR"
/>
<result
property=
"taskName"
column=
"task_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"productModel"
column=
"product_model"
jdbcType=
"VARCHAR"
/>
...
...
@@ -83,6 +83,7 @@
t.task_no,t.task_name,t.task_status,
t.leader_id,t.leader,
t.task_begin_time,
t.product_model,
t.next_node,
srt.task_begin_time system_task_begin_time,
srt.task_end_time system_task_end_time,
...
...
@@ -94,34 +95,56 @@
left join t_system_review_task srt on t.system_review_task_id = srt.id
left join t_car_review_task crt on t.car_review_task_id = crt.id
<where>
t.task_status IN ("
RUNNING","RUNNABLE
")
<if
test=
"
taskNoOrName != null and taskNoOrName
!= ''"
>
and
(t.task_no = #{taskNoOrName} || t.task_name like concat('%',#{taskNoOrName},'%'))
t.task_status IN ("
NEW","PENDING
")
<if
test=
"
standardId != null and standardId
!= ''"
>
and
t.standard_id = #{standardId}
</if>
<if
test=
"taskBeginTime != null and taskBeginTime != ''"
>
and t.task_begin_time = #{taskBeginTime}
<if
test=
"taskNo != null and taskNo != ''"
>
and t.task_no = #{taskNo}
</if>
<if
test=
"taskName != null and taskName != ''"
>
and t.task_name like concat('%',#{taskName},'%')
</if>
<if
test=
"productModel != null and productModel != ''"
>
and t.product_model = #{productModel}
</if>
<if
test=
"subStatus != null and subStatus != ''"
>
and (srt.task_status = #{subStatus} OR crt.task_status = #{subStatus})
<if
test=
"inspectionItem != null and inspectionItem != ''"
>
AND (
(inspectionItem = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR
(inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL)
)
</if>
</where>
order by t.create_time desc
</select>
<select
id=
"findFinish"
parameterType=
"com.ruoyi.web.request.TaskFindFinishRequest"
resultType=
"com.ruoyi.domain.Task"
>
SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status,
t.product_model,
t.leader_id,t.leader,
t.task_begin_time,t.task_end_time
FROM t_task t
<where>
t.task_status IN ("FINISH")
<if
test=
"
taskNoOrName != null and taskNoOrName
!= ''"
>
and
(t.task_no = #{taskNoOrName} || t.task_name like concat('%',#{taskNoOrName},'%'))
<if
test=
"
standardId != null and standardId
!= ''"
>
and
t.standard_id = #{standardId}
</if>
<if
test=
"taskBeginTime != null and taskBeginTime != ''"
>
and t.task_begin_time >= #{taskBeginTime}
<if
test=
"taskNo != null and taskNo != ''"
>
and t.task_no = #{taskNo}
</if>
<if
test=
"taskName != null and taskName != ''"
>
and t.task_name like concat('%',#{taskName},'%')
</if>
<if
test=
"productModel != null and productModel != ''"
>
and t.product_model = #{productModel}
</if>
<if
test=
"taskEndTime != null and taskEndTime != ''"
>
and t.task_end_time
<
= #{taskEndTime}
<if
test=
"inspectionItem != null and inspectionItem != ''"
>
AND (
(inspectionItem = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR
(inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL)
)
</if>
</where>
</select>
...
...
@@ -176,6 +199,7 @@
and t.task_status = #{request.taskStatus}
</if>
</where>
order by t.create_time desc
</select>
...
...
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