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
629cdb79
Commit
629cdb79
authored
Jul 03, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
dev - master 37 See merge request
!398
parents
8c4389af
2e064def
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
1 deletion
+148
-1
SysUserController.java
...va/com/ruoyi/web/controller/system/SysUserController.java
+22
-0
SysUserVO.java
...m/src/main/java/com/ruoyi/system/domain/vo/SysUserVO.java
+31
-0
SysUserMapper.java
.../src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
+15
-0
InspectionRequest.java
...main/java/com/ruoyi/system/request/InspectionRequest.java
+13
-0
ISysUserService.java
...c/main/java/com/ruoyi/system/service/ISysUserService.java
+14
-0
SysUserServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+36
-0
SysUserMapper.xml
...system/src/main/resources/mapper/system/SysUserMapper.xml
+17
-1
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
View file @
629cdb79
...
@@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletResponse;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.system.domain.vo.SysUserVO
;
import
com.ruoyi.system.request.InspectionRequest
;
import
com.ruoyi.system.service.*
;
import
com.ruoyi.system.service.*
;
import
com.ruoyi.web.request.UserByRoleRequest
;
import
com.ruoyi.web.request.UserByRoleRequest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -94,6 +96,26 @@ public class SysUserController extends BaseController
...
@@ -94,6 +96,26 @@ public class SysUserController extends BaseController
}
}
}
}
/**
* 获取主检验人员列表
* @return
*/
@ApiOperation
(
"获取主检验人员列表"
)
@PostMapping
(
"/getPrimaryInspection"
)
public
R
<
List
<
SysUserVO
>>
getPrimaryInspection
()
{
return
R
.
ok
(
userService
.
getPrimaryInspection
());
}
/**
* 获取检验人员列表
* @return
*/
@ApiOperation
(
"获取检验人员列表"
)
@PostMapping
(
"/getInspection"
)
public
R
<
List
<
SysUserVO
>>
getInspection
()
{
return
R
.
ok
(
userService
.
getInspection
());
}
@Trace
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"param1"
,
value
=
"arg[1]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"param1"
,
value
=
"arg[1]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"用户管理"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"用户管理"
,
businessType
=
BusinessType
.
EXPORT
)
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysUserVO.java
0 → 100644
View file @
629cdb79
package
com
.
ruoyi
.
system
.
domain
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
@Data
@Accessors
(
chain
=
true
)
public
class
SysUserVO
{
@ApiModelProperty
(
"用户id"
)
private
Long
userId
;
@ApiModelProperty
(
"用户账号"
)
private
String
userName
;
@ApiModelProperty
(
"用户昵称"
)
private
String
nickname
;
@ApiModelProperty
(
"部门名称"
)
private
String
deptName
;
@ApiModelProperty
(
"角色id"
)
private
Long
roleId
;
@ApiModelProperty
(
"帐号状态(0正常 1停用)"
)
private
String
status
;
@ApiModelProperty
(
"删除标志(0代表存在 2代表删除)"
)
private
String
delFlag
;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
View file @
629cdb79
package
com
.
ruoyi
.
system
.
mapper
;
package
com
.
ruoyi
.
system
.
mapper
;
import
java.util.List
;
import
java.util.List
;
import
com.ruoyi.system.domain.vo.SysUserVO
;
import
com.ruoyi.system.domain.vo.UserCountVo
;
import
com.ruoyi.system.domain.vo.UserCountVo
;
import
com.ruoyi.system.request.InspectionRequest
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
...
@@ -146,4 +149,16 @@ public interface SysUserMapper
...
@@ -146,4 +149,16 @@ public interface SysUserMapper
* @return
* @return
*/
*/
List
<
UserCountVo
>
countTaskByUserId
(
@Param
(
"userIds"
)
Long
[]
userIds
);
List
<
UserCountVo
>
countTaskByUserId
(
@Param
(
"userIds"
)
Long
[]
userIds
);
/**
* 获取主检验人员列表
* @return
*/
List
<
SysUserVO
>
getPrimaryInspection
();
/**
* 获取检验人员列表
* @return
*/
List
<
SysUserVO
>
getInspection
();
}
}
ruoyi-system/src/main/java/com/ruoyi/system/request/InspectionRequest.java
0 → 100644
View file @
629cdb79
package
com
.
ruoyi
.
system
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
public
class
InspectionRequest
{
@ApiModelProperty
(
"类型"
)
private
String
flag
;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
View file @
629cdb79
...
@@ -2,6 +2,8 @@ package com.ruoyi.system.service;
...
@@ -2,6 +2,8 @@ package com.ruoyi.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.system.domain.vo.SysUserVO
;
import
com.ruoyi.system.request.InspectionRequest
;
/**
/**
* 用户 业务层
* 用户 业务层
...
@@ -225,4 +227,16 @@ public interface ISysUserService
...
@@ -225,4 +227,16 @@ public interface ISysUserService
* @return
* @return
*/
*/
List
<
SysUser
>
selectUserByRoleInDept
(
Long
roleId
);
List
<
SysUser
>
selectUserByRoleInDept
(
Long
roleId
);
/**
* 获取主检验人员列表
* @return
*/
List
<
SysUserVO
>
getPrimaryInspection
();
/**
* 获取检验人员列表
* @return
*/
List
<
SysUserVO
>
getInspection
();
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
View file @
629cdb79
...
@@ -6,8 +6,10 @@ import java.util.stream.Collectors;
...
@@ -6,8 +6,10 @@ import java.util.stream.Collectors;
import
javax.validation.Validator
;
import
javax.validation.Validator
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.system.domain.vo.SysUserVO
;
import
com.ruoyi.system.domain.vo.UserCountVo
;
import
com.ruoyi.system.domain.vo.UserCountVo
;
import
com.ruoyi.system.mapper.*
;
import
com.ruoyi.system.mapper.*
;
import
com.ruoyi.system.request.InspectionRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -591,6 +593,40 @@ public class SysUserServiceImpl implements ISysUserService
...
@@ -591,6 +593,40 @@ public class SysUserServiceImpl implements ISysUserService
return
list
;
return
list
;
}
}
/**
* 获取主检验人员列表
* @return
*/
@Override
public
List
<
SysUserVO
>
getPrimaryInspection
()
{
List
<
SysUserVO
>
userList
=
userMapper
.
getPrimaryInspection
();
// 使用Stream API进行去重,基于userId字段
List
<
SysUserVO
>
deduplicatedList
=
userList
.
stream
()
.
filter
(
distinctByKey
(
user
->
user
.
getUserId
()))
.
collect
(
Collectors
.
toList
());
return
deduplicatedList
;
}
/**
* 获取检验人员列表
* @return
*/
@Override
public
List
<
SysUserVO
>
getInspection
()
{
List
<
SysUserVO
>
userList
=
userMapper
.
getInspection
();
// 使用Stream API进行去重,基于userId字段
List
<
SysUserVO
>
deduplicatedList
=
userList
.
stream
()
.
filter
(
distinctByKey
(
user
->
user
.
getUserId
()))
.
collect
(
Collectors
.
toList
());
return
deduplicatedList
;
}
// 辅助方法,用于去重
private
static
<
T
>
java
.
util
.
function
.
Predicate
<
T
>
distinctByKey
(
java
.
util
.
function
.
Function
<?
super
T
,
?>
keyExtractor
)
{
java
.
util
.
Map
<
Object
,
Boolean
>
seen
=
new
java
.
util
.
concurrent
.
ConcurrentHashMap
<>();
return
t
->
seen
.
putIfAbsent
(
keyExtractor
.
apply
(
t
),
Boolean
.
TRUE
)
==
null
;
}
/**
/**
* 递归
* 递归
* 查询出当前用户所在部门以及所有子部门
* 查询出当前用户所在部门以及所有子部门
...
...
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
629cdb79
...
@@ -244,5 +244,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -244,5 +244,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</foreach>
group by tr.user_id
group by tr.user_id
</select>
</select>
<select
id=
"getPrimaryInspection"
resultType=
"com.ruoyi.system.domain.vo.SysUserVO"
>
select u.user_id,sr.role_id,u.user_name,u.nick_name,u.status,u.del_flag, sd.dept_name
from sys_user u
left join sys_user_role sr on u.user_id = sr.user_id
left join sys_dept sd on sd.dept_id = u.dept_id
where sr.role_id = 112
and u.del_flag = '0'
</select>
<select
id=
"getInspection"
resultType=
"com.ruoyi.system.domain.vo.SysUserVO"
>
select u.user_id,sr.role_id,u.user_name,u.nick_name,u.status,u.del_flag, sd.dept_name
from sys_user u
left join sys_user_role sr on u.user_id = sr.user_id
left join sys_dept sd on sd.dept_id = u.dept_id
where sr.role_id IN (106, 112)
and u.del_flag = '0'
</select>
</mapper>
</mapper>
\ No newline at end of file
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