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
b1a7c4d7
Commit
b1a7c4d7
authored
Mar 15, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
总任务 - 车型试验
parent
6a3f09fd
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
300 additions
and
6 deletions
+300
-6
ModelTestTask.java
...-review/src/main/java/com/ruoyi/domain/ModelTestTask.java
+118
-0
Task.java
quality-review/src/main/java/com/ruoyi/domain/Task.java
+5
-0
TaskScenarioRelation.java
.../src/main/java/com/ruoyi/domain/TaskScenarioRelation.java
+37
-0
ModelTestTaskMapper.java
...w/src/main/java/com/ruoyi/mapper/ModelTestTaskMapper.java
+13
-0
TaskScenarioRelationMapper.java
...ain/java/com/ruoyi/mapper/TaskScenarioRelationMapper.java
+13
-0
ModelTestTaskService.java
...src/main/java/com/ruoyi/service/ModelTestTaskService.java
+12
-0
ModelTestTaskServiceImpl.java
...java/com/ruoyi/service/impl/ModelTestTaskServiceImpl.java
+17
-0
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+64
-6
ModelTestTaskController.java
.../src/main/java/com/ruoyi/web/ModelTestTaskController.java
+16
-0
TaskCreateRequest.java
...rc/main/java/com/ruoyi/web/request/TaskCreateRequest.java
+2
-0
TaskGetInfoResponse.java
...main/java/com/ruoyi/web/response/TaskGetInfoResponse.java
+3
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/ModelTestTask.java
0 → 100644
View file @
b1a7c4d7
package
com
.
ruoyi
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.common.StandardJsonTypeHandler
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
import
java.util.List
;
/**
* 车型试验任务
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"车型试验任务"
)
@TableName
(
value
=
"t_model_test_task"
)
public
class
ModelTestTask
{
/**
* 任务类型
*/
@TableField
(
exist
=
false
)
public
static
final
String
TYPE
=
"car"
;
/**
* 任务状态
*/
@TableField
(
exist
=
false
)
public
static
final
String
TASK_STATUS_NEW
=
"NEW"
;
@TableField
(
exist
=
false
)
public
static
final
String
TASK_STATUS_PENDING
=
"PENDING"
;
@TableField
(
exist
=
false
)
public
static
final
String
TASK_STATUS_SIGNED
=
"SIGNED"
;
@TableField
(
exist
=
false
)
public
static
final
String
TASK_STATUS_FINISH
=
"FINISH"
;
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
id
;
@ApiModelProperty
(
"任务编号"
)
private
String
taskNo
;
@ApiModelProperty
(
"任务状态[NEW、PENDING、SIGNED、FINISH]"
)
private
String
taskStatus
;
@ApiModelProperty
(
"任务发起人姓名"
)
private
String
taskInitiator
;
@ApiModelProperty
(
"任务发起人部门"
)
private
String
taskInitiatorDept
;
@ApiModelProperty
(
"任务结果(PASS、REJECT)"
)
private
String
taskResult
;
@ApiModelProperty
(
"任务开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
private
Date
taskBeginTime
;
@ApiModelProperty
(
"任务结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
private
Date
taskEndTime
;
@ApiModelProperty
(
"测试用例"
)
@TableField
(
value
=
"testCase"
,
typeHandler
=
StandardJsonTypeHandler
.
class
)
private
List
<
ReviewStandard
>
testCase
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
private
Date
createTime
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
@ApiModelProperty
(
"审查组长id"
)
private
Long
leaderId
;
@ApiModelProperty
(
"审查组长姓名"
)
private
String
leader
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
@ApiModelProperty
(
"关联标准表id"
)
private
Long
standardId
;
@ApiModelProperty
(
"标准名称"
)
private
String
name
;
@ApiModelProperty
(
"标准号"
)
private
String
standardNo
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
@ApiModelProperty
(
"提交人id"
)
private
Long
submitId
;
@ApiModelProperty
(
"提交人姓名"
)
private
String
submitName
;
@ApiModelProperty
(
"签名图片地址"
)
private
String
imagesUrl
;
@ApiModelProperty
(
"车型试验测试用例数"
)
private
Integer
details
;
@ApiModelProperty
(
"车型试验标准条款数"
)
private
Integer
standards
;
}
quality-review/src/main/java/com/ruoyi/domain/Task.java
View file @
b1a7c4d7
...
...
@@ -68,6 +68,11 @@ public class Task {
@TableField
(
insertStrategy
=
FieldStrategy
.
IGNORED
,
updateStrategy
=
FieldStrategy
.
IGNORED
,
whereStrategy
=
FieldStrategy
.
IGNORED
)
private
Long
carReviewTaskId
;
@ApiModelProperty
(
"车型检验任务id"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
@TableField
(
insertStrategy
=
FieldStrategy
.
IGNORED
,
updateStrategy
=
FieldStrategy
.
IGNORED
,
whereStrategy
=
FieldStrategy
.
IGNORED
)
private
Long
modelTestTaskId
;
@ApiModelProperty
(
"任务状态NEW(新建的)、PENDING(运行中的)、FINISH(已结束的)、TEMPORARILY(暂存)"
)
private
String
taskStatus
;
...
...
quality-review/src/main/java/com/ruoyi/domain/TaskScenarioRelation.java
0 → 100644
View file @
b1a7c4d7
package
com
.
ruoyi
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 任务场景关系实体类
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"任务场景关系实体类"
)
@TableName
(
value
=
"t_task_scenario_relation"
)
public
class
TaskScenarioRelation
{
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
id
;
@ApiModelProperty
(
"任务ID"
)
private
Long
taskId
;
@ApiModelProperty
(
"测试场景ID"
)
private
Long
testScenarioId
;
}
quality-review/src/main/java/com/ruoyi/mapper/ModelTestTaskMapper.java
0 → 100644
View file @
b1a7c4d7
package
com
.
ruoyi
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.domain.ModelTestTask
;
import
org.springframework.stereotype.Repository
;
/**
* 车型试验Mapper层
* @author gxk
*/
@Repository
public
interface
ModelTestTaskMapper
extends
BaseMapper
<
ModelTestTask
>
{
}
quality-review/src/main/java/com/ruoyi/mapper/TaskScenarioRelationMapper.java
0 → 100644
View file @
b1a7c4d7
package
com
.
ruoyi
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.domain.TaskScenarioRelation
;
import
org.springframework.stereotype.Repository
;
/**
* 任务与场景关系Mapper接口
* @author gxk
*/
@Repository
public
interface
TaskScenarioRelationMapper
extends
BaseMapper
<
TaskScenarioRelation
>
{
}
quality-review/src/main/java/com/ruoyi/service/ModelTestTaskService.java
0 → 100644
View file @
b1a7c4d7
package
com
.
ruoyi
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.domain.ModelTestTask
;
import
org.springframework.stereotype.Service
;
/**
* 车型试验任务Service接口
* @author gxk
*/
public
interface
ModelTestTaskService
extends
IService
<
ModelTestTask
>
{
}
quality-review/src/main/java/com/ruoyi/service/impl/ModelTestTaskServiceImpl.java
0 → 100644
View file @
b1a7c4d7
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.mapper.ModelTestTaskMapper
;
import
com.ruoyi.service.ModelTestTaskService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 车型试验Service业务层处理
* @author gxk
*/
@Service
@Transactional
public
class
ModelTestTaskServiceImpl
extends
ServiceImpl
<
ModelTestTaskMapper
,
ModelTestTask
>
implements
ModelTestTaskService
{
}
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
b1a7c4d7
package
com
.
ruoyi
.
service
.
impl
;
import
c
om.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.
toolkit.Wrappers
;
import
c
n.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.
conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.DataStatisticsUtils
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.bean.BeanUtils
;
...
...
@@ -22,10 +23,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -87,6 +85,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
@Autowired
private
ReviewDetailsResultService
reviewDetailsResultService
;
@Autowired
private
ModelTestTaskService
modelTestTaskService
;
@Autowired
private
TaskScenarioRelationMapper
taskScenarioRelationMapper
;
@Override
public
List
<
Task
>
findList
(
TaskListRequest
request
)
{
...
...
@@ -139,9 +142,23 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 保存体系审查任务
task
.
setSystemReviewTaskId
(
saveSystemReview
(
request
,
initiator
,
standard
,
leader
));
}
if
(
request
.
getTaskList
().
contains
(
Task
.
SUB_TASK_TRFIS
))
{
task
.
setModelTestTaskId
(
saveModelTest
(
request
,
initiator
,
standard
,
leader
));
}
taskService
.
save
(
task
);
// 总任务包含车型试验,添加任务-场景关联信息
if
(
CollUtil
.
isNotEmpty
(
request
.
getTestScenarioList
()))
{
for
(
Long
sceneId
:
request
.
getTestScenarioList
())
{
TaskScenarioRelation
taskScenario
=
TaskScenarioRelation
.
builder
()
.
taskId
(
task
.
getId
())
.
testScenarioId
(
sceneId
)
.
build
();
taskScenarioRelationMapper
.
insert
(
taskScenario
);
}
}
// 构建并保存该任务所关联的审核组信息
for
(
TaskUserRelation
auditor
:
auditors
)
{
auditor
.
setTaskId
(
task
.
getId
());
...
...
@@ -360,6 +377,17 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
if
(
task
!=
null
)
{
BeanUtils
.
copyBeanProp
(
response
,
task
);
// 测试场景
List
<
String
>
taskList
=
Arrays
.
asList
(
task
.
getTaskList
().
split
(
","
));
if
(
taskList
.
contains
(
Task
.
SUB_TASK_TRFIS
)
&&
taskList
.
size
()
==
1
)
{
List
<
Long
>
testkScenarioList
=
taskScenarioRelationMapper
.
selectList
(
new
QueryWrapper
<
TaskScenarioRelation
>().
eq
(
"task_id"
,
request
.
getId
()))
.
stream
()
.
map
(
TaskScenarioRelation:
:
getTestScenarioId
)
.
collect
(
Collectors
.
toList
());
response
.
setTestScenarioList
(
testkScenarioList
);
}
// 小组成员
response
.
setAuditors
(
setAuditors
(
request
.
getId
()));
...
...
@@ -746,5 +774,35 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return
task
.
getId
();
}
/**
* 保存车型试验任务
* @param request
* @param initiator
* @param standard
* @param leader
* @return
*/
public
Long
saveModelTest
(
TaskCreateRequest
request
,
SysUser
initiator
,
Standard
standard
,
TaskUserRelation
leader
)
{
// 构建并保存任务信息
ModelTestTask
modelTestTask
=
ModelTestTask
.
builder
()
.
taskNo
(
request
.
getTaskNo
())
.
taskInitiator
(
initiator
.
getNickName
())
.
taskStatus
(
ModelTestTask
.
TASK_STATUS_NEW
)
.
leaderId
(
leader
.
getUserId
())
.
leader
(
leader
.
getName
())
.
createTime
(
DateUtils
.
getNowDate
())
.
standardId
(
standard
.
getId
())
.
name
(
standard
.
getName
())
.
standardNo
(
standard
.
getStandardNo
())
.
build
();
if
(
initiator
.
getDept
()
!=
null
)
{
modelTestTask
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
}
modelTestTaskService
.
save
(
modelTestTask
);
return
modelTestTask
.
getId
();
}
}
quality-review/src/main/java/com/ruoyi/web/ModelTestTaskController.java
0 → 100644
View file @
b1a7c4d7
package
com
.
ruoyi
.
web
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 车型测试任务Controller
* @author gxk
*/
@RestController
@RequestMapping
(
"/car/test/task"
)
public
class
ModelTestTaskController
{
}
quality-review/src/main/java/com/ruoyi/web/request/TaskCreateRequest.java
View file @
b1a7c4d7
...
...
@@ -62,5 +62,7 @@ public class TaskCreateRequest {
@ApiModelProperty
(
"选择的任务"
)
List
<
String
>
taskList
;
@ApiModelProperty
(
"选择的测试场景"
)
private
List
<
Long
>
testScenarioList
;
}
quality-review/src/main/java/com/ruoyi/web/response/TaskGetInfoResponse.java
View file @
b1a7c4d7
...
...
@@ -127,4 +127,7 @@ public class TaskGetInfoResponse {
@ApiModelProperty
(
"零件样品信息"
)
private
List
<
Sample
>
partVehicleSample
;
@ApiModelProperty
(
"测试场景"
)
private
List
<
Long
>
testScenarioList
;
}
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