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
81c4a376
Commit
81c4a376
authored
Jan 09, 2024
by
W_Y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开始一个车辆审查任务中的问卷任务&提交问卷任务
parent
05780c18
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
9 deletions
+57
-9
CarReviewTask.java
...-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
+6
-0
CarReviewTaskServiceImpl.java
...java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
+7
-5
StrategyCarReviewTaskNew.java
...java/com/ruoyi/service/impl/StrategyCarReviewTaskNew.java
+8
-1
StrategyCarReviewTaskPending.java
.../com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
+32
-1
CarReviewTaskMapper.xml
...-review/src/main/resources/mapper/CarReviewTaskMapper.xml
+4
-2
No files found.
quality-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
View file @
81c4a376
...
...
@@ -185,4 +185,10 @@ public class CarReviewTask implements Serializable {
@ApiModelProperty
(
"车型问卷提交人姓名"
)
private
String
reviewSubmitName
;
/**
* 车型问卷审查结果
*/
@ApiModelProperty
(
"车型问卷审查结果"
)
private
String
reviewResult
;
}
quality-review/src/main/java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
View file @
81c4a376
...
...
@@ -5,10 +5,8 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SnowflakeUtil
;
import
com.ruoyi.domain.CarReviewTask
;
import
com.ruoyi.domain.ReviewTaskUserRelation
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.domain.SystemReviewTask
;
import
com.ruoyi.domain.*
;
import
com.ruoyi.mapper.ReviewDetailsMapper
;
import
com.ruoyi.service.CarReviewTaskService
;
import
com.ruoyi.mapper.CarReviewTaskMapper
;
import
com.ruoyi.service.ReviewTaskUserRelationService
;
...
...
@@ -54,6 +52,9 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Autowired
private
StrategyCarReviewTaskContext
strategyCarReviewTaskContext
;
@Autowired
private
ReviewDetailsMapper
reviewDetailsMapper
;
@Override
public
List
<
CarReviewTask
>
findListByReviewStatus
(
String
reviewStatus
)
{
return
carReviewTaskMapper
.
findListByReviewStatus
(
reviewStatus
);
...
...
@@ -123,11 +124,12 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override
public
void
startReviewTask
(
CarReviewTaskStartRequest
request
)
{
CarReviewTask
carReviewTask
=
carReviewTaskService
.
getById
(
request
.
getTaskId
());
strategyCarReviewTaskContext
.
getResource
(
carReviewTask
.
getReviewStatus
()).
doStartReview
(
carReviewTask
);
}
@Override
public
void
submitReviewTask
(
CarReviewTaskSubmitRequest
request
)
{
List
<
ReviewDetails
>
detailsList
=
reviewDetailsMapper
.
findNoResult
(
request
.
getTaskId
());
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskNew.java
View file @
81c4a376
...
...
@@ -4,6 +4,7 @@ import com.ruoyi.common.constant.HttpStatus;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.CarReviewTask
;
import
com.ruoyi.domain.ReviewStandard
;
import
com.ruoyi.mapper.CarReviewTaskMapper
;
import
com.ruoyi.service.ReviewStandardService
;
import
com.ruoyi.service.StrategyCarReviewTask
;
import
com.ruoyi.web.response.CarReviewTaskViewResponse
;
...
...
@@ -12,6 +13,7 @@ import org.springframework.beans.factory.InitializingBean;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
java.util.Date
;
import
java.util.List
;
public
class
StrategyCarReviewTaskNew
implements
StrategyCarReviewTask
,
InitializingBean
{
...
...
@@ -25,6 +27,9 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
@Autowired
private
ReviewStandardService
reviewStandardService
;
@Autowired
private
CarReviewTaskMapper
carReviewTaskMapper
;
// NEW状态下
// 1.standard字段查询当前最新问卷
...
...
@@ -47,7 +52,9 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
@Override
public
void
doStartReview
(
CarReviewTask
carReviewTask
)
{
carReviewTask
.
setReviewStartTime
(
new
Date
());
carReviewTask
.
setReviewStatus
(
CarReviewTask
.
REVIEW_STATUS_PENDING
);
carReviewTaskMapper
.
updateById
(
carReviewTask
);
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StrategyCarReviewTaskPending.java
View file @
81c4a376
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.CarReviewTaskMapper
;
import
com.ruoyi.mapper.ReviewDetailsResultMapper
;
import
com.ruoyi.mapper.SystemReviewTaskMapper
;
import
com.ruoyi.service.ReviewDetailsResultService
;
...
...
@@ -16,6 +19,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
;
import
java.util.Map
;
import
java.util.function.Function
;
...
...
@@ -40,7 +44,7 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
private
ReviewSceneChangeTaskService
reviewSceneChangeTaskService
;
@Autowired
private
SystemReviewTaskMapper
system
ReviewTaskMapper
;
private
CarReviewTaskMapper
car
ReviewTaskMapper
;
@Autowired
private
ReviewDetailsResultMapper
reviewDetailsResultMapper
;
...
...
@@ -83,6 +87,33 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Override
public
void
doSubmitReview
(
CarReviewTask
carReviewTask
)
{
// 1. 获取最新问卷
List
<
ReviewStandard
>
standardTree
=
reviewStandardService
.
findTree
(
carReviewTask
.
getStandardId
(),
ReviewStandard
.
TYPE_CAR
);
// 2. 所有细则必须有对应答案
List
<
ReviewDetailsResult
>
results
=
reviewDetailsResultService
.
findByTaskId
(
carReviewTask
.
getId
());
// 3. 将最终问卷归档到 standard 字段
setDetailsResult
(
standardTree
,
results
);
carReviewTask
.
setStandard
(
standardTree
);
// 4. 填充review_submit_time
carReviewTask
.
setReviewSubmitTime
(
new
Date
());
// 5. 修改任务状态为 FINISH
carReviewTask
.
setReviewStatus
(
CarReviewTask
.
REVIEW_STATUS_FINISH
);
// 6. 填写当前用户id
// 获取当前登陆人
SysUser
loginUser
=
SecurityUtils
.
getLoginUser
().
getUser
();
carReviewTask
.
setReviewSubmitId
(
loginUser
.
getUserId
());
carReviewTask
.
setReviewSubmitName
(
loginUser
.
getNickName
());
// 7. 设置问卷结果
if
(
reviewDetailsResultMapper
.
findNotPass
(
carReviewTask
.
getId
())
>
0
)
{
carReviewTask
.
setReviewResult
(
"REJECT"
);
}
else
{
carReviewTask
.
setReviewResult
(
"PASS"
);
}
carReviewTaskMapper
.
updateById
(
carReviewTask
);
}
private
void
setDetailsResult
(
List
<
ReviewStandard
>
standards
,
List
<
ReviewDetailsResult
>
results
)
{
...
...
quality-review/src/main/resources/mapper/CarReviewTaskMapper.xml
View file @
81c4a376
...
...
@@ -28,6 +28,7 @@
<result
property=
"reviewSubmitTime"
column=
"review_submit_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"reviewSubmitId"
column=
"review_submit_id"
jdbcType=
"BIGINT"
/>
<result
property=
"reviewSubmitName"
column=
"review_submit_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"reviewResult"
column=
"review_result"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -40,10 +41,11 @@
test_status,review_start_time,
review_submit_time,
review_submit_id,
review_submit_name
review_submit_name,
review_result
</sql>
<select
id=
"findListByReviewStatus"
resultType=
"com.ruoyi.domain.CarReviewTask"
>
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,biz_info,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,biz_info,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name
,review_result
FROM t_system_review_task WHERE review_status = #{reviewStatus} AND task_status = 'PENDING'
</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