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
ec1cdab3
Commit
ec1cdab3
authored
Jan 15, 2024
by
W_Y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加待签字状态&确认体系审查问卷接口
parent
fc0b7078
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
168 additions
and
19 deletions
+168
-19
CarReviewTask.java
...-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
+2
-0
SystemReviewTask.java
...view/src/main/java/com/ruoyi/domain/SystemReviewTask.java
+2
-0
StrategySystemReviewTask.java
...main/java/com/ruoyi/service/StrategySystemReviewTask.java
+4
-0
SystemReviewTaskService.java
.../main/java/com/ruoyi/service/SystemReviewTaskService.java
+7
-0
StrategySystemReviewTaskClose.java
...com/ruoyi/service/impl/StrategySystemReviewTaskClose.java
+5
-0
StrategySystemReviewTaskFinish.java
...om/ruoyi/service/impl/StrategySystemReviewTaskFinish.java
+5
-0
StrategySystemReviewTaskNew.java
...a/com/ruoyi/service/impl/StrategySystemReviewTaskNew.java
+5
-0
StrategySystemReviewTaskPending.java
...m/ruoyi/service/impl/StrategySystemReviewTaskPending.java
+16
-19
StrategySystemReviewTaskSigned.java
...om/ruoyi/service/impl/StrategySystemReviewTaskSigned.java
+92
-0
SystemReviewTaskServiceImpl.java
...a/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
+7
-0
SystemReviewTaskController.java
...c/main/java/com/ruoyi/web/SystemReviewTaskController.java
+9
-0
SystemReviewTaskConfirmRequest.java
...com/ruoyi/web/request/SystemReviewTaskConfirmRequest.java
+14
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
View file @
ec1cdab3
...
...
@@ -39,6 +39,8 @@ public class CarReviewTask implements Serializable {
@TableField
(
exist
=
false
)
public
static
final
String
REVIEW_STATUS_PENDING
=
"PENDING"
;
@TableField
(
exist
=
false
)
public
static
final
String
REVIEW_STATUS_SIGNED
=
"SIGNED"
;
@TableField
(
exist
=
false
)
public
static
final
String
REVIEW_STATUS_FINISH
=
"FINISH"
;
...
...
quality-review/src/main/java/com/ruoyi/domain/SystemReviewTask.java
View file @
ec1cdab3
...
...
@@ -29,6 +29,8 @@ public class SystemReviewTask {
@TableField
(
exist
=
false
)
public
static
final
String
STATUS_PENDING
=
"PENDING"
;
@TableField
(
exist
=
false
)
public
static
final
String
STATUS_SIGNED
=
"SIGNED"
;
@TableField
(
exist
=
false
)
public
static
final
String
STATUS_FINISH
=
"FINISH"
;
@TableField
(
exist
=
false
)
public
static
final
String
STATUS_CLOSE
=
"CLOSE"
;
...
...
quality-review/src/main/java/com/ruoyi/service/StrategySystemReviewTask.java
View file @
ec1cdab3
...
...
@@ -7,10 +7,14 @@ public interface StrategySystemReviewTask {
void
doStart
(
SystemReviewTask
systemReviewTask
);
void
doConfirm
(
SystemReviewTask
systemReviewTask
);
void
doSubmit
(
SystemReviewTask
systemReviewTask
);
void
doClose
(
SystemReviewTask
systemReviewTask
);
SystemReviewTaskViewResponse
doView
(
SystemReviewTask
systemReviewTask
);
}
quality-review/src/main/java/com/ruoyi/service/SystemReviewTaskService.java
View file @
ec1cdab3
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.service;
import
com.ruoyi.domain.SystemReviewTask
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.web.request.SystemReviewTaskConfirmRequest
;
import
com.ruoyi.web.request.SystemReviewTaskCreateRequest
;
import
com.ruoyi.web.request.SystemReviewTaskStartRequest
;
import
com.ruoyi.web.request.SystemReviewTaskSubmitRequest
;
...
...
@@ -47,6 +48,12 @@ public interface SystemReviewTaskService extends IService<SystemReviewTask> {
*/
List
<
SystemReviewTask
>
findListInProcess
();
/**
* 确认审查问卷
* @param request
*/
void
confirm
(
SystemReviewTaskConfirmRequest
request
);
/**
* 提交审查问卷
* @param request
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskClose.java
View file @
ec1cdab3
...
...
@@ -35,6 +35,11 @@ public class StrategySystemReviewTaskClose implements StrategySystemReviewTask,
throw
new
ServiceException
(
"不能关闭一个已关闭的任务"
,
HttpStatus
.
ERROR
);
}
@Override
public
void
doConfirm
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能确认一个已关闭的任务"
,
HttpStatus
.
ERROR
);
}
// CLOSE状态下
// 1.standard字段使用task中归档的问卷
// 2.不查询场景变更任务
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskFinish.java
View file @
ec1cdab3
...
...
@@ -35,6 +35,11 @@ public class StrategySystemReviewTaskFinish implements StrategySystemReviewTask,
throw
new
ServiceException
(
"不能关闭一个已完成的任务"
,
HttpStatus
.
ERROR
);
}
@Override
public
void
doConfirm
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能确认一个已完成的任务"
,
HttpStatus
.
ERROR
);
}
// FINISH状态下
// 1.standard字段使用task中归档的问卷
// 2.不查询场景变更任务
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskNew.java
View file @
ec1cdab3
...
...
@@ -51,6 +51,11 @@ public class StrategySystemReviewTaskNew implements StrategySystemReviewTask, In
systemReviewTaskMapper
.
updateById
(
systemReviewTask
);
}
@Override
public
void
doConfirm
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能确认一个尚未开始的任务"
,
HttpStatus
.
ERROR
);
}
// NEW状态下
// 1.standard字段查询当前最新问卷
// 2.不查询场景变更任务
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskPending.java
View file @
ec1cdab3
...
...
@@ -56,6 +56,18 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Override
public
void
doSubmit
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能提交一个未确认的任务"
,
HttpStatus
.
ERROR
);
}
@Override
public
void
doClose
(
SystemReviewTask
systemReviewTask
)
{
systemReviewTask
.
setTaskEndTime
(
new
Date
());
systemReviewTask
.
setTaskStatus
(
SystemReviewTask
.
STATUS_CLOSE
);
systemReviewTaskMapper
.
updateById
(
systemReviewTask
);
}
@Override
public
void
doConfirm
(
SystemReviewTask
systemReviewTask
)
{
// TODO
List
<
ReviewDetails
>
detailsList
=
reviewDetailsMapper
.
findNoResult
(
systemReviewTask
.
getId
());
if
(
detailsList
!=
null
)
{
...
...
@@ -71,17 +83,10 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
setDetailsResult
(
standardTree
,
results
);
systemReviewTask
.
setStandard
(
standardTree
);
// 4. 填充task_end_time
systemReviewTask
.
setTaskEndTime
(
new
Date
());
// 5. 修改任务状态为 FINISH
systemReviewTask
.
setTaskStatus
(
SystemReviewTask
.
STATUS_FINISH
);
// 6. 填写当前用户id
// 获取当前登陆人
SysUser
loginUser
=
SecurityUtils
.
getLoginUser
().
getUser
();
systemReviewTask
.
setSubmitById
(
loginUser
.
getUserId
());
systemReviewTask
.
setSubmitByName
(
loginUser
.
getNickName
());
// 7. 设置问卷结果
// 4. 修改任务状态为 SIGNED 待签字
systemReviewTask
.
setTaskStatus
(
SystemReviewTask
.
STATUS_SIGNED
);
// 5. 设置问卷结果
if
(
reviewDetailsResultMapper
.
findNotPass
(
systemReviewTask
.
getId
())
>
0
)
{
systemReviewTask
.
setTaskResult
(
"REJECT"
);
}
else
{
...
...
@@ -89,14 +94,6 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
}
systemReviewTaskMapper
.
updateById
(
systemReviewTask
);
}
}
@Override
public
void
doClose
(
SystemReviewTask
systemReviewTask
)
{
systemReviewTask
.
setTaskEndTime
(
new
Date
());
systemReviewTask
.
setTaskStatus
(
SystemReviewTask
.
STATUS_CLOSE
);
systemReviewTaskMapper
.
updateById
(
systemReviewTask
);
}
// PENDING状态下
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskSigned.java
0 → 100644
View file @
ec1cdab3
package
com
.
ruoyi
.
service
.
impl
;
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.domain.*
;
import
com.ruoyi.mapper.ReviewDetailsMapper
;
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.StrategySystemReviewTask
;
import
com.ruoyi.web.response.SystemReviewTaskViewResponse
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Transactional
@Service
public
class
StrategySystemReviewTaskSigned
implements
StrategySystemReviewTask
,
InitializingBean
{
@Autowired
private
StrategySystemReviewTaskContext
strategySystemReviewTaskContext
;
@Autowired
private
ApplicationContext
applicationContext
;
@Autowired
private
SystemReviewTaskMapper
systemReviewTaskMapper
;
@Override
public
void
doStart
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能开始一个已确认的任务"
,
HttpStatus
.
ERROR
);
}
@Override
public
void
doConfirm
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能确认一个已确认的任务"
,
HttpStatus
.
ERROR
);
}
@Override
public
void
doSubmit
(
SystemReviewTask
systemReviewTask
)
{
// 1. 填充task_end_time
systemReviewTask
.
setTaskEndTime
(
new
Date
());
// 2. 修改任务状态为 FINISH
systemReviewTask
.
setTaskStatus
(
SystemReviewTask
.
STATUS_FINISH
);
// 3. 填写当前用户id
// 获取当前登陆人
SysUser
loginUser
=
SecurityUtils
.
getLoginUser
().
getUser
();
systemReviewTask
.
setSubmitById
(
loginUser
.
getUserId
());
systemReviewTask
.
setSubmitByName
(
loginUser
.
getNickName
());
systemReviewTaskMapper
.
updateById
(
systemReviewTask
);
}
@Override
public
void
doClose
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能关闭一个已确认的任务"
,
HttpStatus
.
ERROR
);
}
// SIGNED状态下
// 1.standard字段使用task中归档的问卷
// 2.不查询场景变更任务
// 3.无需联查问卷答案
@Override
public
SystemReviewTaskViewResponse
doView
(
SystemReviewTask
systemReviewTask
)
{
SystemReviewTaskViewResponse
response
=
new
SystemReviewTaskViewResponse
();
response
.
setSystemReviewTask
(
systemReviewTask
);
return
response
;
}
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
strategySystemReviewTaskContext
.
putResource
(
SystemReviewTask
.
STATUS_SIGNED
,
applicationContext
.
getBean
(
this
.
getClass
()));
}
}
quality-review/src/main/java/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
View file @
ec1cdab3
...
...
@@ -10,6 +10,7 @@ import com.ruoyi.mapper.ReviewDetailsMapper;
import
com.ruoyi.mapper.SystemReviewTaskMapper
;
import
com.ruoyi.service.*
;
import
com.ruoyi.system.service.ISysUserService
;
import
com.ruoyi.web.request.SystemReviewTaskConfirmRequest
;
import
com.ruoyi.web.request.SystemReviewTaskCreateRequest
;
import
com.ruoyi.web.request.SystemReviewTaskStartRequest
;
import
com.ruoyi.web.request.SystemReviewTaskSubmitRequest
;
...
...
@@ -115,6 +116,12 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
return
systemReviewTaskMapper
.
findListInProcess
();
}
@Override
public
void
confirm
(
SystemReviewTaskConfirmRequest
request
)
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
request
.
getTaskId
());
strategySystemReviewTaskContext
.
getResource
(
systemReviewTask
.
getTaskStatus
()).
doConfirm
(
systemReviewTask
);
}
@Override
public
void
submit
(
SystemReviewTaskSubmitRequest
request
)
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
request
.
getTaskId
());
...
...
quality-review/src/main/java/com/ruoyi/web/SystemReviewTaskController.java
View file @
ec1cdab3
...
...
@@ -61,6 +61,15 @@ public class SystemReviewTaskController extends BaseController {
return
R
.
ok
();
}
@ApiOperation
(
"确认体系审查问卷"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/confirm"
)
public
R
<
String
>
confirm
(
@Validated
@RequestBody
SystemReviewTaskConfirmRequest
request
)
{
systemReviewTaskService
.
confirm
(
request
);
return
R
.
ok
();
}
@ApiOperation
(
"提交体系审查任务"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
...
...
quality-review/src/main/java/com/ruoyi/web/request/SystemReviewTaskConfirmRequest.java
0 → 100644
View file @
ec1cdab3
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"SystemReviewTaskConfirmRequest"
,
description
=
"确认体系审查问卷"
)
@Data
public
class
SystemReviewTaskConfirmRequest
{
@ApiModelProperty
(
"任务id"
)
private
Long
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