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
dc69b020
Commit
dc69b020
authored
Jan 08, 2024
by
W_Y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交体系审查任务
parent
8e7a14ce
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
10 deletions
+63
-10
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
-2
ReviewDetailsMapper.xml
...-review/src/main/resources/mapper/ReviewDetailsMapper.xml
+4
-0
ReviewDetailsResultMapper.xml
...w/src/main/resources/mapper/ReviewDetailsResultMapper.xml
+0
-4
No files found.
quality-review/src/main/java/com/ruoyi/mapper/ReviewDetailsMapper.java
View file @
dc69b020
...
...
@@ -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 @
dc69b020
...
...
@@ -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 @
dc69b020
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 @
dc69b020
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,8 +121,13 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
@Override
public
void
submit
(
SystemReviewTaskSubmitRequest
request
)
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
request
.
getTaskId
());
strategySystemReviewTaskContext
.
getResource
(
systemReviewTask
.
getTaskStatus
()).
doSubmit
(
systemReviewTask
);
List
<
ReviewDetails
>
detailsList
=
reviewDetailsMapper
.
findNoResult
(
request
.
getTaskId
());
if
(
detailsList
!=
null
)
{
throw
new
ServiceException
(
"存在未填写的问卷,请填写完整"
,
HttpStatus
.
ERROR
);
}
else
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
request
.
getTaskId
());
strategySystemReviewTaskContext
.
getResource
(
systemReviewTask
.
getTaskStatus
()).
doSubmit
(
systemReviewTask
);
}
}
}
...
...
quality-review/src/main/resources/mapper/ReviewDetailsMapper.xml
View file @
dc69b020
...
...
@@ -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 @
dc69b020
...
...
@@ -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>
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