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
bdb1e0cc
Commit
bdb1e0cc
authored
Mar 22, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
车型试验 - 状态(PENDING、SIGNED、FINISH) - 除了查看都完成
parent
20559352
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
165 additions
and
13 deletions
+165
-13
ModelTestTaskService.java
...src/main/java/com/ruoyi/service/ModelTestTaskService.java
+14
-0
StrategyModelTestTask.java
...rc/main/java/com/ruoyi/service/StrategyModelTestTask.java
+1
-2
ModelTestTaskServiceImpl.java
...java/com/ruoyi/service/impl/ModelTestTaskServiceImpl.java
+17
-0
StrategyModelTestTaskFinish.java
...a/com/ruoyi/service/impl/StrategyModelTestTaskFinish.java
+1
-1
StrategyModelTestTaskNew.java
...java/com/ruoyi/service/impl/StrategyModelTestTaskNew.java
+1
-2
StrategyModelTestTaskPending.java
.../com/ruoyi/service/impl/StrategyModelTestTaskPending.java
+11
-2
StrategyModelTestTaskSigned.java
...a/com/ruoyi/service/impl/StrategyModelTestTaskSigned.java
+36
-2
ModelTestTaskController.java
.../src/main/java/com/ruoyi/web/ModelTestTaskController.java
+31
-4
ModelTestTaskConfirmRequest.java
...va/com/ruoyi/web/request/ModelTestTaskConfirmRequest.java
+24
-0
ModelTestTaskSubmitRequest.java
...ava/com/ruoyi/web/request/ModelTestTaskSubmitRequest.java
+29
-0
No files found.
quality-review/src/main/java/com/ruoyi/service/ModelTestTaskService.java
View file @
bdb1e0cc
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.response.ModelTestTaskViewResponse
;
import
java.util.List
;
...
...
@@ -25,4 +26,17 @@ public interface ModelTestTaskService extends IService<ModelTestTask> {
* @param taskId
*/
void
startModelTestTask
(
Long
taskId
);
/**
* 确认车型试验任务
* @param taskId
*/
void
confirmModelTestTask
(
Long
taskId
);
/**
* 车型试验任务
* @param request
*/
void
submitModelTestTask
(
ModelTestTaskSubmitRequest
request
);
}
quality-review/src/main/java/com/ruoyi/service/StrategyModelTestTask.java
View file @
bdb1e0cc
...
...
@@ -33,8 +33,7 @@ public interface StrategyModelTestTask {
* 提交测试
* @param modelTestTask
* @param imagesUrl
* @param testScenarioList
*/
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
,
List
<
Long
>
testScenarioList
);
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
);
}
quality-review/src/main/java/com/ruoyi/service/impl/ModelTestTaskServiceImpl.java
View file @
bdb1e0cc
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.mapper.ModelTestTaskMapper
;
import
com.ruoyi.service.ModelTestTaskService
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.response.ModelTestTaskViewResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -46,4 +47,20 @@ public class ModelTestTaskServiceImpl extends ServiceImpl<ModelTestTaskMapper, M
ModelTestTask
modelTestTask
=
modelTestTaskMapper
.
selectById
(
taskId
);
strategyModelTestTaskContext
.
getResource
(
modelTestTask
.
getTaskStatus
()).
doStartTest
(
modelTestTask
);
}
/**
* 确认车型试验任务
* @param taskId
*/
@Override
public
void
confirmModelTestTask
(
Long
taskId
)
{
ModelTestTask
modelTestTask
=
modelTestTaskMapper
.
selectById
(
taskId
);
strategyModelTestTaskContext
.
getResource
(
modelTestTask
.
getTaskStatus
()).
doConfirmTest
(
modelTestTask
);
}
@Override
public
void
submitModelTestTask
(
ModelTestTaskSubmitRequest
request
)
{
ModelTestTask
modelTestTask
=
modelTestTaskMapper
.
selectById
(
request
.
getTaskId
());
strategyModelTestTaskContext
.
getResource
(
modelTestTask
.
getTaskStatus
()).
doSubmitTest
(
modelTestTask
,
request
.
getImagesUrl
());
}
}
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskFinish.java
View file @
bdb1e0cc
...
...
@@ -39,7 +39,7 @@ public class StrategyModelTestTaskFinish implements StrategyModelTestTask, Initi
}
@Override
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
,
List
<
Long
>
testScenarioList
)
{
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
)
{
throw
new
ServiceException
(
"不能提交一个结束的任务"
,
HttpStatus
.
ERROR
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskNew.java
View file @
bdb1e0cc
...
...
@@ -111,10 +111,9 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
* 状态为NEW时的提交车型试验任务
* @param modelTestTask
* @param imagesUrl
* @param testScenarioList
*/
@Override
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
,
List
<
Long
>
testScenarioList
)
{
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
)
{
throw
new
ServiceException
(
"不能提交一个尚未开始的任务"
,
HttpStatus
.
ERROR
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskPending.java
View file @
bdb1e0cc
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.mapper.ModelTestTaskMapper
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.web.response.ModelTestTaskViewResponse
;
import
org.springframework.beans.factory.InitializingBean
;
...
...
@@ -23,6 +25,9 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
@Autowired
private
StrategyModelTestTaskContext
strategyModelTestTaskContext
;
@Autowired
private
ModelTestTaskMapper
modelTestTaskMapper
;
@Override
public
List
<
ModelTestTaskViewResponse
>
doView
(
ModelTestTask
modelTestTask
)
{
throw
new
ServiceException
(
"能查看一个进行中的任务"
,
HttpStatus
.
ERROR
);
...
...
@@ -35,11 +40,15 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
@Override
public
void
doConfirmTest
(
ModelTestTask
modelTestTask
)
{
throw
new
ServiceException
(
"能确认一个进行中的任务"
,
HttpStatus
.
ERROR
);
// 进行中的任务, 点击确认后, 状态改为待签字
modelTestTaskMapper
.
update
(
new
ModelTestTask
(),
new
LambdaUpdateWrapper
<
ModelTestTask
>()
.
set
(
ModelTestTask:
:
getTaskStatus
,
ModelTestTask
.
TASK_STATUS_SIGNED
)
.
eq
(
ModelTestTask:
:
getId
,
modelTestTask
.
getId
()));
}
@Override
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
,
List
<
Long
>
testScenarioList
)
{
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
)
{
throw
new
ServiceException
(
"不能提交一个进行中的任务"
,
HttpStatus
.
ERROR
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskSigned.java
View file @
bdb1e0cc
package
com
.
ruoyi
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.domain.ModelTestTask
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.mapper.ModelTestTaskMapper
;
import
com.ruoyi.mapper.TaskMapper
;
import
com.ruoyi.service.StrategyModelTestTask
;
import
com.ruoyi.web.response.ModelTestTaskViewResponse
;
import
org.springframework.beans.factory.InitializingBean
;
...
...
@@ -11,6 +20,7 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
@Service
...
...
@@ -23,6 +33,15 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi
@Autowired
private
StrategyModelTestTaskContext
strategyModelTestTaskContext
;
@Autowired
private
ModelTestTaskMapper
modelTestTaskMapper
;
@Autowired
private
TaskMapper
taskMapper
;
@Autowired
private
TaskStateFacade
taskStateFacade
;
@Override
public
List
<
ModelTestTaskViewResponse
>
doView
(
ModelTestTask
modelTestTask
)
{
throw
new
ServiceException
(
"能查看一个已确认的任务"
,
HttpStatus
.
ERROR
);
...
...
@@ -39,8 +58,23 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi
}
@Override
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
,
List
<
Long
>
testScenarioList
)
{
throw
new
ServiceException
(
"能提交一个已确认的任务"
,
HttpStatus
.
ERROR
);
public
void
doSubmitTest
(
ModelTestTask
modelTestTask
,
List
<
String
>
imagesUrl
)
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
modelTestTaskMapper
.
update
(
new
ModelTestTask
(),
new
LambdaUpdateWrapper
<
ModelTestTask
>()
.
set
(
ModelTestTask:
:
getTaskStatus
,
ModelTestTask
.
TASK_STATUS_FINISH
)
.
set
(
ModelTestTask:
:
getTaskEndTime
,
new
Date
())
.
set
(
ModelTestTask:
:
getSubmitId
,
user
.
getUserId
())
.
set
(
ModelTestTask:
:
getSubmitName
,
user
.
getNickName
())
.
set
(
ModelTestTask:
:
getImagesUrl
,
StringUtils
.
join
(
imagesUrl
,
","
))
.
eq
(
ModelTestTask:
:
getId
,
modelTestTask
.
getId
()));
// 改总任务状态
// 通过modelId查询总任务ID
List
<
Task
>
taskList
=
taskMapper
.
selectList
(
new
QueryWrapper
<
Task
>().
eq
(
"model_test_task_id"
,
modelTestTask
.
getId
()));
if
(
CollUtil
.
isNotEmpty
(
taskList
))
{
Task
task
=
taskList
.
get
(
0
);
taskStateFacade
.
doSubmit
(
task
);
}
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/web/ModelTestTaskController.java
View file @
bdb1e0cc
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.annotation.Anonymous
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.service.ModelTestTaskService
;
import
com.ruoyi.web.request.CarReviewTaskViewRequest
;
import
com.ruoyi.web.request.ModelTestTaskConfirmRequest
;
import
com.ruoyi.web.request.ModelTestTaskSubmitRequest
;
import
com.ruoyi.web.response.ModelTestTaskViewResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -16,6 +17,10 @@ import java.util.List;
/**
* 车型试验任务Controller
* 总任务包含 (后)-> NEW (可以)-> 查看、开始
* 开始任务 -> PENDING -> 确认
* 确认任务 -> SIGNED -> 查看、提交
* 提交任务 -> FINISH -> 查看
* @author gxk
*/
@Api
(
tags
=
"车型试验子任务"
)
...
...
@@ -31,7 +36,6 @@ public class ModelTestTaskController extends BaseController {
* @param request
* @return
*/
@Anonymous
@ApiOperation
(
"查看车型试验任务详情"
)
@PostMapping
(
"/getById"
)
public
R
<
List
<
ModelTestTaskViewResponse
>>
view
(
@Validated
@RequestBody
CarReviewTaskViewRequest
request
)
{
...
...
@@ -44,12 +48,35 @@ public class ModelTestTaskController extends BaseController {
* @param request
* @return
*/
@Anonymous
@ApiOperation
(
"开始车型试验任务"
)
@PostMapping
(
"/start"
)
public
R
<
String
>
start
Review
(
@Validated
@RequestBody
CarReviewTaskViewRequest
request
)
{
public
R
<
String
>
start
Model
(
@Validated
@RequestBody
CarReviewTaskViewRequest
request
)
{
modelTestTaskService
.
startModelTestTask
(
request
.
getTaskId
());
return
R
.
ok
();
}
/**
* 确认车型试验任务
* @param request
* @return
*/
@ApiOperation
(
"确认车型试验任务"
)
@PostMapping
(
"/confirm"
)
public
R
<
String
>
confirmModel
(
@Validated
@RequestBody
ModelTestTaskConfirmRequest
request
)
{
modelTestTaskService
.
confirmModelTestTask
(
request
.
getTaskId
());
return
R
.
ok
();
}
/**
* 提交车型试验任务 - 在待签字页面进行
* @param request
* @return
*/
@ApiOperation
(
"提交车型试验任务"
)
@PostMapping
(
"/submit"
)
public
R
<
String
>
submitModel
(
@Validated
@RequestBody
ModelTestTaskSubmitRequest
request
)
{
modelTestTaskService
.
submitModelTestTask
(
request
);
return
R
.
ok
();
}
}
quality-review/src/main/java/com/ruoyi/web/request/ModelTestTaskConfirmRequest.java
0 → 100644
View file @
bdb1e0cc
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 车型试验确认请求DTO
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"车型试验确认请求DTO"
)
public
class
ModelTestTaskConfirmRequest
{
@ApiModelProperty
(
"任务id"
)
private
Long
taskId
;
}
quality-review/src/main/java/com/ruoyi/web/request/ModelTestTaskSubmitRequest.java
0 → 100644
View file @
bdb1e0cc
package
com
.
ruoyi
.
web
.
request
;
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.List
;
/**
* 车型试验提交DTO
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"车型试验提交DTO"
)
public
class
ModelTestTaskSubmitRequest
{
@ApiModelProperty
(
"任务id"
)
private
Long
taskId
;
@ApiModelProperty
(
"图片地址"
)
private
List
<
String
>
imagesUrl
;
}
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