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
a602cf86
Commit
a602cf86
authored
Jan 08, 2024
by
王飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangdingyi' into 'dev'
提交审查问卷 See merge request
!26
parents
bd985bb0
9de8c6f9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
93 additions
and
13 deletions
+93
-13
SystemReviewTask.java
...view/src/main/java/com/ruoyi/domain/SystemReviewTask.java
+10
-0
ReviewDetailsMapper.java
...w/src/main/java/com/ruoyi/mapper/ReviewDetailsMapper.java
+7
-0
ReviewDetailsResultMapper.java
...main/java/com/ruoyi/mapper/ReviewDetailsResultMapper.java
+5
-0
StrategySystemReviewTaskPending.java
...m/ruoyi/service/impl/StrategySystemReviewTaskPending.java
+33
-4
SystemReviewTaskServiceImpl.java
...a/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
+14
-1
SystemReviewTaskController.java
...c/main/java/com/ruoyi/web/SystemReviewTaskController.java
+9
-0
ReviewDetailsMapper.xml
...-review/src/main/resources/mapper/ReviewDetailsMapper.xml
+4
-0
ReviewDetailsResultMapper.xml
...w/src/main/resources/mapper/ReviewDetailsResultMapper.xml
+0
-4
SystemReviewTaskMapper.xml
...view/src/main/resources/mapper/SystemReviewTaskMapper.xml
+4
-2
AjaxResult.java
...rc/main/java/com/ruoyi/common/core/domain/AjaxResult.java
+5
-0
GlobalExceptionHandler.java
...ruoyi/framework/web/exception/GlobalExceptionHandler.java
+2
-2
No files found.
quality-review/src/main/java/com/ruoyi/domain/SystemReviewTask.java
View file @
a602cf86
...
...
@@ -133,4 +133,14 @@ public class SystemReviewTask {
*/
private
String
file
;
/**
* 提交人id
*/
private
Long
submitById
;
/**
* 提交人姓名
*/
private
String
submitByName
;
}
quality-review/src/main/java/com/ruoyi/mapper/ReviewDetailsMapper.java
View file @
a602cf86
...
...
@@ -11,4 +11,11 @@ import java.util.List;
@Repository
public
interface
ReviewDetailsMapper
extends
BaseMapper
<
ReviewDetails
>
{
List
<
ReviewDetails
>
findByKeyPointList
(
@Param
(
"reviewKeyPointList"
)
List
<
ReviewKeyPoint
>
reviewKeyPointList
);
/**
* 根据任务id查询没有回答细则的数量
* @param taskId
* @return
*/
List
<
ReviewDetails
>
findNoResult
(
@Param
(
"taskId"
)
Long
taskId
);
}
quality-review/src/main/java/com/ruoyi/mapper/ReviewDetailsResultMapper.java
View file @
a602cf86
...
...
@@ -20,6 +20,11 @@ public interface ReviewDetailsResultMapper extends BaseMapper<ReviewDetailsResul
ReviewDetailsResult
findByTaskIdAndDetailsId
(
@Param
(
"taskId"
)
Long
taskId
,
@Param
(
"reviewDetailsId"
)
Long
reviewDetailsId
);
/**
* 根据任务id查询不通过的数量
* @param taskId
* @return
*/
Long
findNotPass
(
@Param
(
"taskId"
)
Long
taskId
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategySystemReviewTaskPending.java
View file @
a602cf86
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.ReviewDetailsResultMapper
;
import
com.ruoyi.mapper.SystemReviewTaskMapper
;
import
com.ruoyi.service.*
;
import
com.ruoyi.web.response.SystemReviewTaskViewResponse
;
...
...
@@ -32,6 +35,10 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired
private
SystemReviewTaskMapper
systemReviewTaskMapper
;
@Autowired
private
ReviewDetailsResultMapper
reviewDetailsResultMapper
;
@Override
public
void
doStart
(
SystemReviewTask
systemReviewTask
)
{
throw
new
ServiceException
(
"不能开始一个已经开始的任务"
,
HttpStatus
.
ERROR
);
...
...
@@ -41,11 +48,33 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
public
void
doSubmit
(
SystemReviewTask
systemReviewTask
)
{
// TODO
// 1. 获取最新问卷
List
<
ReviewStandard
>
standardTree
=
reviewStandardService
.
findTree
(
systemReviewTask
.
getStandardId
(),
ReviewStandard
.
TYPE_SYSTEM
);
// 2. 所有细则必须有对应答案
// 3. 答案的 id + text 必须与细则对应的答案一致
// 4. 将最终问卷归档到 standard 字段
// 5. 填充task_end_time
// 6. 修改任务状态为 FINISH
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
systemReviewTask
.
getId
());
// 3. 将最终问卷归档到 standard 字段
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. 设置问卷结果
if
(
reviewDetailsResultMapper
.
findNotPass
(
systemReviewTask
.
getId
())
>
0
)
{
systemReviewTask
.
setTaskResult
(
"REJECT"
);
}
else
{
systemReviewTask
.
setTaskResult
(
"PASS"
);
}
systemReviewTaskMapper
.
updateById
(
systemReviewTask
);
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
View file @
a602cf86
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SnowflakeUtil
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.mapper.ReviewDetailsMapper
;
import
com.ruoyi.mapper.ReviewDetailsResultMapper
;
import
com.ruoyi.mapper.SystemReviewTaskMapper
;
import
com.ruoyi.service.*
;
import
com.ruoyi.system.service.ISysUserService
;
...
...
@@ -46,6 +50,9 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
@Autowired
private
StandardService
standardService
;
@Autowired
private
ReviewDetailsMapper
reviewDetailsMapper
;
@Override
public
void
createTaskTest
(
SystemReviewTaskCreateRequest
request
)
{
...
...
@@ -114,7 +121,13 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
@Override
public
void
submit
(
SystemReviewTaskSubmitRequest
request
)
{
List
<
ReviewDetails
>
detailsList
=
reviewDetailsMapper
.
findNoResult
(
request
.
getTaskId
());
if
(
detailsList
!=
null
)
{
throw
new
ServiceException
(
"存在未填写的问卷,请填写完整"
,
HttpStatus
.
ERROR
,
detailsList
);
}
else
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
request
.
getTaskId
());
strategySystemReviewTaskContext
.
getResource
(
systemReviewTask
.
getTaskStatus
()).
doSubmit
(
systemReviewTask
);
}
}
}
...
...
quality-review/src/main/java/com/ruoyi/web/SystemReviewTaskController.java
View file @
a602cf86
...
...
@@ -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
=
"/submit"
)
public
R
<
String
>
submit
(
@Validated
@RequestBody
SystemReviewTaskSubmitRequest
request
)
{
systemReviewTaskService
.
submit
(
request
);
return
R
.
ok
();
}
@ApiOperation
(
"查询处理中的任务"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
...
...
quality-review/src/main/resources/mapper/ReviewDetailsMapper.xml
View file @
a602cf86
...
...
@@ -13,4 +13,8 @@
</foreach>
</select>
<select
id=
"findNoResult"
resultType=
"com.ruoyi.domain.ReviewDetails"
>
SELECT * FROM t_review_details WHERE id NOT IN (SELECT review_details_id FROM t_review_details_result WHERE task_id = #{taskId})
</select>
</mapper>
quality-review/src/main/resources/mapper/ReviewDetailsResultMapper.xml
View file @
a602cf86
...
...
@@ -33,8 +33,4 @@
WHERE passed = 0 AND task_id = #{taskId}
</select>
<select
id=
"findNoResult"
resultType=
"long"
>
SELECT COUNT(*) sum FROM t_review_details_result
WHERE passed is null AND task_id = #{taskId}
</select>
</mapper>
quality-review/src/main/resources/mapper/SystemReviewTaskMapper.xml
View file @
a602cf86
...
...
@@ -20,16 +20,18 @@
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
<result
property=
"standardNo"
column=
"standard_no"
jdbcType=
"VARCHAR"
/>
<result
property=
"file"
column=
"file"
jdbcType=
"VARCHAR"
/>
<result
property=
"submitById"
column=
"submit_by_id"
jdbcType=
"BIGINT"
/>
<result
property=
"submitByName"
column=
"submit_by_name"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"findListByStatus"
resultMap=
"BaseResultMap"
>
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file
, submit_by_id, submit_by_name
FROM t_system_review_task WHERE task_status = #{status}
ORDER BY create_time DESC
</select>
<select
id=
"findListInProcess"
resultMap=
"BaseResultMap"
>
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file
, submit_by_id, submit_by_name
FROM t_system_review_task WHERE task_status IN ('NEW','PENDING')
ORDER BY create_time DESC
</select>
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
View file @
a602cf86
...
...
@@ -170,6 +170,11 @@ public class AjaxResult extends HashMap<String, Object>
return
new
AjaxResult
(
code
,
msg
,
null
);
}
public
static
AjaxResult
error
(
int
code
,
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
code
,
msg
,
data
);
}
/**
* 是否为成功消息
*
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java
View file @
a602cf86
...
...
@@ -19,7 +19,7 @@ import com.ruoyi.common.utils.StringUtils;
/**
* 全局异常处理器
*
*
* @author ruoyi
*/
@RestControllerAdvice
...
...
@@ -60,7 +60,7 @@ public class GlobalExceptionHandler
Integer
code
=
e
.
getCode
();
Object
data
=
e
.
getData
();
return
StringUtils
.
isNotNull
(
code
)
?
AjaxResult
.
error
(
code
,
e
.
getMessage
())
:
AjaxResult
.
error
(
e
.
getMessage
(),
data
==
null
?
null
:
data
);
return
StringUtils
.
isNotNull
(
code
)
?
AjaxResult
.
error
(
code
,
e
.
getMessage
()
,
data
==
null
?
null
:
data
)
:
AjaxResult
.
error
(
e
.
getMessage
(),
data
==
null
?
null
:
data
);
}
/**
...
...
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