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
b5d9a98d
Commit
b5d9a98d
authored
Jan 08, 2024
by
W_Y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建车辆审查任务
parent
e4224c73
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
144 additions
and
23 deletions
+144
-23
CarReviewTask.java
...-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
+3
-1
ReviewTaskUserRelation.java
...rc/main/java/com/ruoyi/domain/ReviewTaskUserRelation.java
+4
-5
ReviewTaskUserRelationMapper.java
...n/java/com/ruoyi/mapper/ReviewTaskUserRelationMapper.java
+2
-2
CarReviewTaskService.java
...src/main/java/com/ruoyi/service/CarReviewTaskService.java
+1
-1
ReviewTaskUserRelationService.java
...java/com/ruoyi/service/ReviewTaskUserRelationService.java
+2
-2
CarReviewTaskServiceImpl.java
...java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
+73
-1
ReviewTaskUserRelationServiceImpl.java
...ruoyi/service/impl/ReviewTaskUserRelationServiceImpl.java
+22
-0
SystemReviewTaskServiceImpl.java
...a/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
+5
-6
CarReviewTaskCreateRequest.java
...ava/com/ruoyi/web/request/CarReviewTaskCreateRequest.java
+26
-0
SystemReviewTaskCreateRequest.java
.../com/ruoyi/web/request/SystemReviewTaskCreateRequest.java
+2
-2
ReviewTaskUserRelationMapper.xml
...rc/main/resources/mapper/ReviewTaskUserRelationMapper.xml
+4
-3
No files found.
quality-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
View file @
b5d9a98d
...
...
@@ -9,12 +9,14 @@ import java.util.Date;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 车型审查任务
* @TableName t_car_review_task
*/
@TableName
(
value
=
"t_car_review_task"
)
@Accessors
(
chain
=
true
)
@Data
public
class
CarReviewTask
implements
Serializable
{
...
...
@@ -157,4 +159,4 @@ public class CarReviewTask implements Serializable {
@ApiModelProperty
(
"车型测试任务状态[NONE、NEW、PENDING、FINISH]"
)
private
String
testStatus
;
}
\ No newline at end of file
}
quality-review/src/main/java/com/ruoyi/domain/
System
ReviewTaskUserRelation.java
→
quality-review/src/main/java/com/ruoyi/domain/ReviewTaskUserRelation.java
View file @
b5d9a98d
package
com
.
ruoyi
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -11,13 +10,13 @@ import lombok.experimental.Accessors;
/**
* 体系审查任务&用户映射关系
* @TableName t_
system_
review_task_user_relation
* @TableName t_review_task_user_relation
*/
@ApiModel
@TableName
(
value
=
"t_
system_
review_task_user_relation"
)
@TableName
(
value
=
"t_review_task_user_relation"
)
@Accessors
(
chain
=
true
)
@Data
public
class
System
ReviewTaskUserRelation
{
public
class
ReviewTaskUserRelation
{
/**
* 任务id
...
...
@@ -44,4 +43,4 @@ public class SystemReviewTaskUserRelation {
@ApiModelProperty
(
"用户姓名"
)
private
String
name
;
}
\ No newline at end of file
}
quality-review/src/main/java/com/ruoyi/mapper/
System
ReviewTaskUserRelationMapper.java
→
quality-review/src/main/java/com/ruoyi/mapper/ReviewTaskUserRelationMapper.java
View file @
b5d9a98d
package
com
.
ruoyi
.
mapper
;
import
com.ruoyi.domain.
System
ReviewTaskUserRelation
;
import
com.ruoyi.domain.ReviewTaskUserRelation
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository;
* @Entity com.ruoyi.domain.SystemReviewTaskUserRelation
*/
@Repository
public
interface
SystemReviewTaskUserRelationMapper
extends
BaseMapper
<
System
ReviewTaskUserRelation
>
{
public
interface
ReviewTaskUserRelationMapper
extends
BaseMapper
<
ReviewTaskUserRelation
>
{
}
...
...
quality-review/src/main/java/com/ruoyi/service/CarReviewTaskService.java
View file @
b5d9a98d
...
...
@@ -32,7 +32,7 @@ public interface CarReviewTaskService extends IService<CarReviewTask> {
* @param taskId
* @return
*/
SystemReviewTaskViewResponse
view
(
Long
taskId
);
SystemReviewTaskViewResponse
view
ReviewTask
(
Long
taskId
);
/**
...
...
quality-review/src/main/java/com/ruoyi/service/
System
ReviewTaskUserRelationService.java
→
quality-review/src/main/java/com/ruoyi/service/ReviewTaskUserRelationService.java
View file @
b5d9a98d
package
com
.
ruoyi
.
service
;
import
com.ruoyi.domain.
System
ReviewTaskUserRelation
;
import
com.ruoyi.domain.ReviewTaskUserRelation
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
...
...
@@ -8,6 +8,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @description 针对表【t_system_review_task_user_relation(体系审查任务&用户映射关系)】的数据库操作Service
* @createDate 2023-12-15 10:41:16
*/
public
interface
SystemReviewTaskUserRelationService
extends
IService
<
System
ReviewTaskUserRelation
>
{
public
interface
ReviewTaskUserRelationService
extends
IService
<
ReviewTaskUserRelation
>
{
}
quality-review/src/main/java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
View file @
b5d9a98d
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
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.service.CarReviewTaskService
;
import
com.ruoyi.mapper.CarReviewTaskMapper
;
import
com.ruoyi.service.ReviewTaskUserRelationService
;
import
com.ruoyi.service.StandardService
;
import
com.ruoyi.system.service.ISysUserService
;
import
com.ruoyi.web.request.CarReviewTaskCreateRequest
;
import
com.ruoyi.web.request.CarReviewTaskStartRequest
;
import
com.ruoyi.web.request.CarReviewTaskSubmitRequest
;
...
...
@@ -12,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -27,6 +38,18 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Autowired
private
CarReviewTaskMapper
carReviewTaskMapper
;
@Autowired
private
ISysUserService
sysUserService
;
@Autowired
private
StandardService
standardService
;
@Autowired
private
CarReviewTaskService
carReviewTaskService
;
@Autowired
private
ReviewTaskUserRelationService
relationService
;
@Override
public
List
<
CarReviewTask
>
findListByReviewStatus
(
String
reviewStatus
)
{
return
carReviewTaskMapper
.
findListByReviewStatus
(
reviewStatus
);
...
...
@@ -35,10 +58,59 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override
public
void
createTask
(
CarReviewTaskCreateRequest
request
)
{
// 构建任务创建者
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
SysUser
initiator
=
sysUserService
.
selectUserById
(
loginUser
.
getUserId
());
Standard
standard
=
standardService
.
findListById
(
request
.
getStandardId
());
// 找到审查组长
ReviewTaskUserRelation
leader
=
null
;
List
<
ReviewTaskUserRelation
>
auditors
=
request
.
getAuditors
();
for
(
ReviewTaskUserRelation
auditor
:
auditors
)
{
if
(
auditor
.
getIsLeader
()
==
1
)
{
leader
=
auditor
;
break
;
}
}
// 构建并保存任务信息
CarReviewTask
task
=
new
CarReviewTask
()
.
setTaskNo
(
SnowflakeUtil
.
generate
().
toString
())
.
setTaskInitiator
(
initiator
.
getNickName
())
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
())
.
setTaskStatus
(
CarReviewTask
.
TASK_STATUS_PENDING
)
.
setBizInfo
(
request
.
getBizInfo
())
.
setLeaderId
(
leader
.
getUserId
())
.
setLeader
(
leader
.
getName
())
.
setCreateTime
(
new
Date
())
.
setStandardId
(
standard
.
getId
())
.
setName
(
standard
.
getName
())
.
setStandardNo
(
standard
.
getStandardNo
())
.
setFile
(
standard
.
getFile
());
if
(
request
.
getReview
())
{
task
.
setReviewStatus
(
CarReviewTask
.
REVIEW_STATUS_NEW
);
}
else
{
task
.
setReviewStatus
(
CarReviewTask
.
REVIEW_STATUS_NONE
);
}
if
(
request
.
getTest
())
{
task
.
setTestStatus
(
CarReviewTask
.
TEST_STATUS_NEW
);
}
else
{
task
.
setTestStatus
(
CarReviewTask
.
TEST_STATUS_NONE
);
}
carReviewTaskService
.
save
(
task
);
// 构建并保存该任务所关联的审核组信息
for
(
ReviewTaskUserRelation
auditor
:
auditors
)
{
auditor
.
setTaskId
(
task
.
getId
());
}
relationService
.
saveBatch
(
auditors
);
}
@Override
public
SystemReviewTaskViewResponse
view
(
Long
taskId
)
{
public
SystemReviewTaskViewResponse
view
ReviewTask
(
Long
taskId
)
{
return
null
;
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/
System
ReviewTaskUserRelationServiceImpl.java
→
quality-review/src/main/java/com/ruoyi/service/impl/ReviewTaskUserRelationServiceImpl.java
View file @
b5d9a98d
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.domain.
System
ReviewTaskUserRelation
;
import
com.ruoyi.service.
System
ReviewTaskUserRelationService
;
import
com.ruoyi.mapper.
System
ReviewTaskUserRelationMapper
;
import
com.ruoyi.domain.ReviewTaskUserRelation
;
import
com.ruoyi.service.ReviewTaskUserRelationService
;
import
com.ruoyi.mapper.ReviewTaskUserRelationMapper
;
import
org.springframework.stereotype.Service
;
/**
* @author wangfei
* @description 针对表【t_
system_
review_task_user_relation(体系审查任务&用户映射关系)】的数据库操作Service实现
* @description 针对表【t_review_task_user_relation(体系审查任务&用户映射关系)】的数据库操作Service实现
* @createDate 2023-12-15 10:41:16
*/
@Service
public
class
SystemReviewTaskUserRelationServiceImpl
extends
ServiceImpl
<
SystemReviewTaskUserRelationMapper
,
System
ReviewTaskUserRelation
>
implements
SystemReviewTaskUserRelationService
{
public
class
ReviewTaskUserRelationServiceImpl
extends
ServiceImpl
<
ReviewTaskUserRelationMapper
,
ReviewTaskUserRelation
>
implements
ReviewTaskUserRelationService
{
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
View file @
b5d9a98d
...
...
@@ -9,7 +9,6 @@ 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
;
...
...
@@ -33,7 +32,7 @@ import java.util.*;
public
class
SystemReviewTaskServiceImpl
extends
ServiceImpl
<
SystemReviewTaskMapper
,
SystemReviewTask
>
implements
SystemReviewTaskService
{
@Autowired
private
System
ReviewTaskUserRelationService
systemReviewTaskUserRelationService
;
private
ReviewTaskUserRelationService
systemReviewTaskUserRelationService
;
@Autowired
private
SystemReviewTaskService
systemReviewTaskService
;
...
...
@@ -63,9 +62,9 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
Standard
standard
=
standardService
.
findListById
(
request
.
getStandardId
());
// 找到审查组长
System
ReviewTaskUserRelation
leader
=
null
;
List
<
System
ReviewTaskUserRelation
>
auditors
=
request
.
getAuditors
();
for
(
System
ReviewTaskUserRelation
auditor
:
auditors
)
{
ReviewTaskUserRelation
leader
=
null
;
List
<
ReviewTaskUserRelation
>
auditors
=
request
.
getAuditors
();
for
(
ReviewTaskUserRelation
auditor
:
auditors
)
{
if
(
auditor
.
getIsLeader
()
==
1
)
{
leader
=
auditor
;
break
;
...
...
@@ -91,7 +90,7 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
// 构建并保存该任务所关联的审核组信息
for
(
System
ReviewTaskUserRelation
auditor
:
auditors
)
{
for
(
ReviewTaskUserRelation
auditor
:
auditors
)
{
auditor
.
setTaskId
(
task
.
getId
());
}
systemReviewTaskUserRelationService
.
saveBatch
(
auditors
);
...
...
quality-review/src/main/java/com/ruoyi/web/request/CarReviewTaskCreateRequest.java
View file @
b5d9a98d
package
com
.
ruoyi
.
web
.
request
;
import
com.ruoyi.domain.ReviewTaskUserRelation
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
CarReviewTaskCreateRequest
{
private
String
bizInfo
;
private
List
<
ReviewTaskUserRelation
>
auditors
;
/**
* 是否创建车型问卷审查任务
*/
private
Boolean
review
;
/**
* 是否创建车型测试任务
*/
private
Boolean
test
;
/**
* 标准id
* 根据哪个标准新建的审查任务
*/
private
Long
standardId
;
}
quality-review/src/main/java/com/ruoyi/web/request/SystemReviewTaskCreateRequest.java
View file @
b5d9a98d
package
com
.
ruoyi
.
web
.
request
;
import
com.ruoyi.domain.
System
ReviewTaskUserRelation
;
import
com.ruoyi.domain.ReviewTaskUserRelation
;
import
lombok.Data
;
import
java.util.List
;
...
...
@@ -10,7 +10,7 @@ public class SystemReviewTaskCreateRequest {
private
String
bizInfo
;
private
List
<
System
ReviewTaskUserRelation
>
auditors
;
private
List
<
ReviewTaskUserRelation
>
auditors
;
/**
* 标准id
...
...
quality-review/src/main/resources/mapper/
System
ReviewTaskUserRelationMapper.xml
→
quality-review/src/main/resources/mapper/ReviewTaskUserRelationMapper.xml
View file @
b5d9a98d
...
...
@@ -2,15 +2,16 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.mapper.
System
ReviewTaskUserRelationMapper"
>
<mapper
namespace=
"com.ruoyi.mapper.ReviewTaskUserRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.domain.
System
ReviewTaskUserRelation"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.domain.ReviewTaskUserRelation"
>
<result
property=
"taskId"
column=
"task_id"
jdbcType=
"BIGINT"
/>
<result
property=
"userId"
column=
"user_id"
jdbcType=
"BIGINT"
/>
<result
property=
"isLeader"
column=
"is_leader"
jdbcType=
"TINYINT"
/>
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
task_id,user_id,is_leader
task_id,user_id,is_leader
,name
</sql>
</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