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
2e13c43f
Commit
2e13c43f
authored
Aug 13, 2024
by
宋源硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'songyuanshuo' into 'dev'
评审人员字段增加 See merge request
!419
parents
a40f69eb
a8900a3c
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
130 additions
and
44 deletions
+130
-44
ReviewSceneChangeTask.java
...src/main/java/com/ruoyi/domain/ReviewSceneChangeTask.java
+4
-0
ReviewSceneChangeTaskMapper.java
...in/java/com/ruoyi/mapper/ReviewSceneChangeTaskMapper.java
+4
-0
ReviewSceneChangeTaskService.java
.../java/com/ruoyi/service/ReviewSceneChangeTaskService.java
+1
-0
CarReviewTaskServiceImpl.java
...java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
+0
-4
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+0
-1
ReviewSceneChangeTaskServiceImpl.java
.../ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
+70
-5
SystemReviewTaskServiceImpl.java
...a/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
+1
-1
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+1
-2
ReviewSceneChangeTaskController.java
...n/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
+4
-5
SystemReviewTaskController.java
...c/main/java/com/ruoyi/web/SystemReviewTaskController.java
+0
-1
TaskController.java
...ty-review/src/main/java/com/ruoyi/web/TaskController.java
+0
-3
ReviewSceneChangeTaskCreateRequest.java
...ruoyi/web/request/ReviewSceneChangeTaskCreateRequest.java
+11
-5
ReviewSceneChangeTaskResponse.java
...com/ruoyi/web/response/ReviewSceneChangeTaskResponse.java
+5
-0
ReviewSceneChangeTaskMapper.xml
...src/main/resources/mapper/ReviewSceneChangeTaskMapper.xml
+3
-0
SysUserRoleMapper.java
.../main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
+12
-7
SysUserRoleMapper.xml
...em/src/main/resources/mapper/system/SysUserRoleMapper.xml
+14
-10
No files found.
quality-review/src/main/java/com/ruoyi/domain/ReviewSceneChangeTask.java
View file @
2e13c43f
...
...
@@ -215,4 +215,8 @@ public class ReviewSceneChangeTask {
@ApiModelProperty
(
value
=
"审查场景id"
,
notes
=
"1.若为修改、删除任务时,此id在创建任务时赋值; 2.若为新增任务时,此id在审批通过并保存新场景后赋值 "
)
private
Long
reviewSceneId
;
@ApiModelProperty
(
"评审人员"
)
@TableField
(
exist
=
false
)
private
String
reviewer
;
}
quality-review/src/main/java/com/ruoyi/mapper/ReviewSceneChangeTaskMapper.java
View file @
2e13c43f
...
...
@@ -44,6 +44,10 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang
*/
List
<
ReviewSceneChangeTask
>
findCreateListByUserId
(
@Param
(
"userId"
)
Long
userId
,
@Param
(
"request"
)
ReviewSceneChangeTaskFindCreateRequest
request
);
/*
* 根据id查询任务详细信息
* */
ReviewSceneChangeTask
findSceneChangeTaskById
(
@Param
(
"id"
)
Long
id
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/ReviewSceneChangeTaskService.java
View file @
2e13c43f
...
...
@@ -77,4 +77,5 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
*/
List
<
ReviewSceneChangeTask
>
findCreateListByUserId
(
Long
userId
,
ReviewSceneChangeTaskFindCreateRequest
request
);
ReviewSceneChangeTask
getBySceneChangeTaskId
(
Long
id
);
}
quality-review/src/main/java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
View file @
2e13c43f
...
...
@@ -97,7 +97,6 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
carReviewTaskService
.
save
(
task
);
// 构建并保存该任务所关联的审核组信息
for
(
TaskUserRelation
auditor
:
auditors
)
{
auditor
.
setTaskId
(
task
.
getId
());
...
...
@@ -124,14 +123,12 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override
public
void
confirmReviewTask
(
CarReviewTaskConfirmRequest
request
)
{
CarReviewTask
carReviewTask
=
carReviewTaskService
.
getById
(
request
.
getTaskId
());
strategyCarReviewTaskContext
.
getResource
(
carReviewTask
.
getTaskStatus
()).
doConfirmReview
(
carReviewTask
);
}
@Override
public
void
submitReviewTask
(
CarReviewTaskSubmitRequest
request
)
{
CarReviewTask
carReviewTask
=
carReviewTaskService
.
getById
(
request
.
getTaskId
());
strategyCarReviewTaskContext
.
getResource
(
carReviewTask
.
getTaskStatus
()).
doSubmitReview
(
carReviewTask
,
request
.
getImagesUrl
(),
request
.
getTestScenarioList
());
}
...
...
@@ -140,7 +137,6 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
public
List
<
CarReviewTask
>
findListByStatus
(
String
status
)
{
return
carReviewTaskMapper
.
findListByTaskStatus
(
status
);
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
View file @
2e13c43f
...
...
@@ -135,7 +135,6 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
ps
.
close
();
bos
.
close
();
reader
.
close
();
// 把第一个模板填入数据后生成一个oss
String
templateName
=
uploadMinio
(
bos
,
"整车信息安全检验临时模板"
);
// 创建一个空PDF, 融合两个PDF
...
...
quality-review/src/main/java/com/ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
View file @
2e13c43f
...
...
@@ -7,11 +7,13 @@ import com.ruoyi.common.exception.ServiceException;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.domain.ReviewSceneChangeTask
;
import
com.ruoyi.domain.ReviewSceneChangeTaskUserRelation
;
import
com.ruoyi.framework.web.domain.server.Sys
;
import
com.ruoyi.service.ReviewSceneChangeTaskService
;
import
com.ruoyi.mapper.ReviewSceneChangeTaskMapper
;
import
com.ruoyi.service.ReviewSceneChangeTaskUserRelationService
;
import
com.ruoyi.service.ReviewSceneService
;
import
com.ruoyi.service.ReviewTaskInboxService
;
import
com.ruoyi.system.mapper.SysUserRoleMapper
;
import
com.ruoyi.system.service.ISysUserService
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest
;
...
...
@@ -22,10 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.*
;
/**
* @author wangfei
...
...
@@ -54,6 +53,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired
private
ReviewSceneChangeTaskMapper
reviewSceneChangeTaskMapper
;
@Autowired
private
SysUserRoleMapper
sysUserRoleMapper
;
@Override
public
void
create
(
ReviewSceneChangeTask
reviewSceneChangeTask
)
{
...
...
@@ -68,6 +70,10 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
.
setTaskStatus
(
ReviewSceneChangeTask
.
STATUS_PENDING
)
.
setTaskBeginTime
(
new
Date
());
//获取operationSort设置operation
String
[]
operationSortPart
=
reviewSceneChangeTask
.
getOperationSort
().
split
(
"_"
);
reviewSceneChangeTask
.
setOperation
(
operationSortPart
[
0
]);
// 保存任务
save
(
reviewSceneChangeTask
);
...
...
@@ -80,7 +86,6 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
.
setUserId
(
sysUser
.
getUserId
())
.
setName
(
sysUser
.
getNickName
())
.
setDept
(
sysUser
.
getDept
().
getDeptName
());
relations
.
add
(
relation
);
}
...
...
@@ -216,6 +221,20 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Override
public
List
<
ReviewSceneChangeTaskResponse
>
findPendingListByUserId
(
Long
userId
,
ReviewSceneChangeTaskFindPendingRequest
request
)
{
List
<
ReviewSceneChangeTaskResponse
>
reviewSceneChangeTask
=
reviewSceneChangeTaskMapper
.
findPendingListByUserId
(
userId
,
request
);
//查询审核人员
List
<
Long
>
reviewerIdList
=
sysUserRoleMapper
.
selectReviewerIdByRoleId
(
103L
);
List
<
SysUser
>
reviewerList
=
sysUserService
.
selectUserListByIds
(
reviewerIdList
);
Set
<
String
>
reviewerNameSet
=
new
HashSet
<>();
for
(
SysUser
reviewer
:
reviewerList
){
reviewerNameSet
.
add
(
reviewer
.
getNickName
());
}
//生成审核人员名字字符串
String
reviewerNames
=
String
.
join
(
"、"
,
reviewerNameSet
);
for
(
ReviewSceneChangeTaskResponse
taskResponse
:
reviewSceneChangeTask
){
taskResponse
.
setReviewer
(
reviewerNames
);
}
return
reviewSceneChangeTask
;
}
...
...
@@ -227,6 +246,19 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Override
public
List
<
ReviewSceneChangeTaskResponse
>
findFinishListByUserId
(
Long
userId
,
ReviewSceneChangeTaskFindFinishRequest
request
)
{
List
<
ReviewSceneChangeTaskResponse
>
reviewSceneChangeTask
=
reviewSceneChangeTaskMapper
.
findFinishListByUserId
(
userId
,
request
);
//查询审核人员
List
<
Long
>
reviewerIdList
=
sysUserRoleMapper
.
selectReviewerIdByRoleId
(
103L
);
List
<
SysUser
>
reviewerList
=
sysUserService
.
selectUserListByIds
(
reviewerIdList
);
Set
<
String
>
reviewerNameSet
=
new
HashSet
<>();
for
(
SysUser
reviewer
:
reviewerList
){
reviewerNameSet
.
add
(
reviewer
.
getNickName
());
}
//生成审核人员名字字符串
String
reviewerNames
=
String
.
join
(
"、"
,
reviewerNameSet
);
for
(
ReviewSceneChangeTaskResponse
taskResponse:
reviewSceneChangeTask
){
taskResponse
.
setReviewer
(
reviewerNames
);
}
return
reviewSceneChangeTask
;
}
...
...
@@ -238,6 +270,39 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Override
public
List
<
ReviewSceneChangeTask
>
findCreateListByUserId
(
Long
userId
,
ReviewSceneChangeTaskFindCreateRequest
request
)
{
List
<
ReviewSceneChangeTask
>
reviewSceneChangeTask
=
reviewSceneChangeTaskMapper
.
findCreateListByUserId
(
userId
,
request
);
//查询审核人员
List
<
Long
>
reviewerIdList
=
sysUserRoleMapper
.
selectReviewerIdByRoleId
(
103L
);
List
<
SysUser
>
reviewerList
=
sysUserService
.
selectUserListByIds
(
reviewerIdList
);
Set
<
String
>
reviewerNameSet
=
new
HashSet
<>();
for
(
SysUser
reviewer
:
reviewerList
)
{
reviewerNameSet
.
add
(
reviewer
.
getNickName
());
}
// 生成审核人员名字字符串
String
reviewerNames
=
String
.
join
(
"、"
,
reviewerNameSet
);
for
(
ReviewSceneChangeTask
task
:
reviewSceneChangeTask
){
task
.
setReviewer
(
reviewerNames
);
}
return
reviewSceneChangeTask
;
}
@Override
public
ReviewSceneChangeTask
getBySceneChangeTaskId
(
Long
id
)
{
ReviewSceneChangeTask
reviewSceneChangeTask
=
reviewSceneChangeTaskMapper
.
findSceneChangeTaskById
(
id
);
//查询审核人员
List
<
Long
>
reviewerIdList
=
sysUserRoleMapper
.
selectReviewerIdByRoleId
(
103L
);
List
<
SysUser
>
reviewerList
=
sysUserService
.
selectUserListByIds
(
reviewerIdList
);
Set
<
String
>
reviewerNameSet
=
new
HashSet
<>();
for
(
SysUser
reviewer
:
reviewerList
)
{
reviewerNameSet
.
add
(
reviewer
.
getNickName
());
}
// 生成审核人员名字字符串
String
reviewerNames
=
String
.
join
(
"、"
,
reviewerNameSet
);
reviewSceneChangeTask
.
setReviewer
(
reviewerNames
);
return
reviewSceneChangeTask
;
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
View file @
2e13c43f
...
...
@@ -108,7 +108,7 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
@Override
public
void
start
(
Long
id
)
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
id
);
strategySystemReviewTaskContext
.
getResource
(
systemReviewTask
.
getTaskStatus
()).
doStart
(
systemReviewTask
);
strategySystemReviewTaskContext
.
getResource
(
systemReviewTask
.
getTaskStatus
()).
doStart
(
systemReviewTask
);
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
2e13c43f
...
...
@@ -153,6 +153,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 构建任务创建者
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
//根据Id查询当前用户是否拥有暂存任务
TaskGetInfoResponse
temporaryStorageTask
=
taskService
.
getByUserId
(
loginUser
.
getUserId
());
if
(
temporaryStorageTask
!=
null
)
{
taskMapper
.
deleteById
(
temporaryStorageTask
.
getId
());
...
...
@@ -408,7 +409,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
if
(
fileList
!=
null
&&
fileList
.
size
()
!=
0
)
{
taskFileRelationService
.
removeBatchByIds
(
fileList
);
}
taskMapper
.
deleteById
(
request
.
getId
());
}
...
...
@@ -458,7 +458,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
}
}
return
responses
;
}
...
...
quality-review/src/main/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
View file @
2e13c43f
...
...
@@ -39,8 +39,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
ReviewSceneChangeTask
reviewSceneChangeTask
=
new
ReviewSceneChangeTask
();
BeanUtils
.
copyBeanProp
(
reviewSceneChangeTask
,
request
);
reviewSceneChangeTask
.
setOperationSort
(
request
.
getOperation
()+
"_"
+
request
.
getSort
());
/*reviewSceneChangeTask.setOperationSort(request.getOperation()+"_"+request.getSort());*/
reviewSceneChangeTaskService
.
create
(
reviewSceneChangeTask
);
return
R
.
ok
();
...
...
@@ -52,7 +51,6 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Log
(
title
=
"审核任务"
,
businessType
=
BusinessType
.
UPDATE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/audit"
)
public
R
<
String
>
audit
(
@Validated
@RequestBody
ReviewSceneChangeTaskPassRequest
request
)
{
reviewSceneChangeTaskService
.
audit
(
request
);
return
R
.
ok
();
}
...
...
@@ -87,7 +85,8 @@ public class ReviewSceneChangeTaskController extends BaseController {
* 查询当前用户发布的任务
* @return
*/
@ApiOperation
(
"查询当前用户发布的任务"
)
/*@ApiOperation("查询当前用户发布的任务")*/
@ApiOperation
(
"用户-评审管理-我发起的评审"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findCreate"
)
...
...
@@ -101,7 +100,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getById"
)
public
R
<
ReviewSceneChangeTask
>
getInfo
(
@Validated
@RequestBody
ReviewSceneChangeTaskGetInfoRequest
request
)
{
return
R
.
ok
(
reviewSceneChangeTaskService
.
getById
(
request
.
getId
()));
return
R
.
ok
(
reviewSceneChangeTaskService
.
getBy
SceneChangeTask
Id
(
request
.
getId
()));
}
}
quality-review/src/main/java/com/ruoyi/web/SystemReviewTaskController.java
View file @
2e13c43f
...
...
@@ -102,7 +102,6 @@ public class SystemReviewTaskController extends BaseController {
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/exportPDF"
)
public
R
<
SystemReviewTaskExportPDFResponse
>
exportPDF
()
{
return
null
;
}
}
quality-review/src/main/java/com/ruoyi/web/TaskController.java
View file @
2e13c43f
...
...
@@ -78,7 +78,6 @@ public class TaskController extends BaseController {
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getTemporaryStorage"
)
public
R
<
TaskGetInfoResponse
>
getTemporaryStorage
()
{
TaskGetInfoResponse
response
=
taskService
.
getByUserId
(
getUserId
());
return
R
.
ok
(
response
);
}
...
...
@@ -108,7 +107,6 @@ public class TaskController extends BaseController {
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findCreate"
)
public
TableDataInfo
<
TaskFindResponse
>
findCreate
(
@Validated
@RequestBody
TaskFindRequest
request
)
{
startPage
(
request
);
return
getDataTable
(
taskService
.
findCreate
(
request
,
getUserId
()));
}
...
...
@@ -186,7 +184,6 @@ public class TaskController extends BaseController {
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dataStatistics"
)
public
R
<
DataStatisticsResponse
>
dataStatistics
(
@Validated
@RequestBody
TaskGetInfoRequest
request
)
{
DataStatisticsResponse
response
=
taskService
.
dataStatistics
(
request
);
return
R
.
ok
(
response
);
}
...
...
quality-review/src/main/java/com/ruoyi/web/request/ReviewSceneChangeTaskCreateRequest.java
View file @
2e13c43f
...
...
@@ -65,11 +65,17 @@ public class ReviewSceneChangeTaskCreateRequest {
/**
* 操作(ADD DELETE UPDATE)
*/
@ApiModelProperty
(
value
=
"操作"
,
notes
=
"[ADD DELETE UPDATE]"
)
private
String
operation
;
@ApiModelProperty
(
value
=
"分类"
,
notes
=
"[KEYPOINT DETAILS SCENE]"
)
private
String
sort
;
// @ApiModelProperty(value = "操作" , notes = "[ADD DELETE UPDATE]")
// private String operation;
//
// @ApiModelProperty(value = "分类" , notes = "[KEYPOINT DETAILS SCENE]")
// private String sort;
/*
* 评审类型
* */
@ApiModelProperty
(
"评审类型"
)
private
String
operationSort
;
/**
* 当 operation 为 ADD 时该字段为空
...
...
quality-review/src/main/java/com/ruoyi/web/response/ReviewSceneChangeTaskResponse.java
View file @
2e13c43f
package
com
.
ruoyi
.
web
.
response
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -161,4 +162,8 @@ public class ReviewSceneChangeTaskResponse {
*/
@ApiModelProperty
(
"本人审核意见(PASS、REJECT)"
)
private
String
decision
;
@ApiModelProperty
(
"评审人员"
)
@TableField
(
exist
=
false
)
private
String
reviewer
;
}
quality-review/src/main/resources/mapper/ReviewSceneChangeTaskMapper.xml
View file @
2e13c43f
...
...
@@ -111,5 +111,8 @@
and inspect_standard_id = #{request.inspectStandardId}
</if>
</select>
<select
id=
"findSceneChangeTaskById"
resultType=
"com.ruoyi.domain.ReviewSceneChangeTask"
>
select * from t_review_scene_change_task where id = #{id}
</select>
</mapper>
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
View file @
2e13c43f
...
...
@@ -6,14 +6,14 @@ import com.ruoyi.system.domain.SysUserRole;
/**
* 用户与角色关联表 数据层
*
*
* @author ruoyi
*/
public
interface
SysUserRoleMapper
{
/**
* 通过用户ID删除用户和角色关联
*
*
* @param userId 用户ID
* @return 结果
*/
...
...
@@ -21,7 +21,7 @@ public interface SysUserRoleMapper
/**
* 批量删除用户和角色关联
*
*
* @param ids 需要删除的数据ID
* @return 结果
*/
...
...
@@ -29,7 +29,7 @@ public interface SysUserRoleMapper
/**
* 通过角色ID查询角色使用数量
*
*
* @param roleId 角色ID
* @return 结果
*/
...
...
@@ -37,7 +37,7 @@ public interface SysUserRoleMapper
/**
* 批量新增用户角色信息
*
*
* @param userRoleList 用户角色列表
* @return 结果
*/
...
...
@@ -45,7 +45,7 @@ public interface SysUserRoleMapper
/**
* 删除用户和角色关联信息
*
*
* @param userRole 用户和角色关联信息
* @return 结果
*/
...
...
@@ -53,10 +53,15 @@ public interface SysUserRoleMapper
/**
* 批量取消授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要删除的用户数据ID
* @return 结果
*/
public
int
deleteUserRoleInfos
(
@Param
(
"roleId"
)
Long
roleId
,
@Param
(
"userIds"
)
Long
[]
userIds
);
/*
*根据roleId查询审核员Id
* */
List
<
Long
>
selectReviewerIdByRoleId
(
Long
roleId
);
}
ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
View file @
2e13c43f
...
...
@@ -12,33 +12,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete
id=
"deleteUserRoleByUserId"
parameterType=
"Long"
>
delete from sys_user_role where user_id=#{userId}
</delete>
<select
id=
"countUserRoleByRoleId"
resultType=
"Integer"
>
select count(1) from sys_user_role where role_id=#{roleId}
select count(1) from sys_user_role where role_id=#{roleId}
</select>
<select
id=
"selectReviewerIdByRoleId"
resultType=
"java.lang.Long"
>
select user_id from sys_user_role where role_id = #{roleId}
</select>
<delete
id=
"deleteUserRole"
parameterType=
"Long"
>
<delete
id=
"deleteUserRole"
parameterType=
"Long"
>
delete from sys_user_role where user_id in
<foreach
collection=
"array"
item=
"userId"
open=
"("
separator=
","
close=
")"
>
#{userId}
</foreach>
</foreach>
</delete>
<insert
id=
"batchUserRole"
>
insert into sys_user_role(user_id, role_id) values
<foreach
item=
"item"
index=
"index"
collection=
"list"
separator=
","
>
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<delete
id=
"deleteUserRoleInfo"
parameterType=
"SysUserRole"
>
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
</delete>
<delete
id=
"deleteUserRoleInfos"
>
delete from sys_user_role where role_id=#{roleId} and user_id in
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
separator=
","
close=
")"
>
#{userId}
</foreach>
</foreach>
</delete>
</mapper>
\ No newline at end of file
</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