获取具备审核权限人员时支持过滤已加入审核组人员
This commit is contained in:
parent
d177a351ac
commit
f7e739ea7d
|
@ -195,7 +195,7 @@ public class ActTaskController {
|
|||
taskQuery.taskAssignee(SecurityUser.getUserId().toString());
|
||||
taskQuery.active();
|
||||
if (auditteam) { // 允许流程审核协作时
|
||||
List<SysAuditTeamDTO> sysAuditTeamDTOS = sysAuditTeamService.selectByMemberOne(userId);
|
||||
List<SysAuditTeamDTO> sysAuditTeamDTOS = sysAuditTeamService.selectByMemberOne(Long.parseLong(userId));
|
||||
List<String> groupUserId = sysAuditTeamDTOS
|
||||
.stream()
|
||||
.map(index_ -> index_.getMember())
|
||||
|
|
|
@ -146,7 +146,7 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
List<String> groupUserId = new ArrayList<>();
|
||||
List<SysAuditTeamDTO> sysAuditTeamDTOS = new ArrayList<>();
|
||||
if (auditteam) {
|
||||
sysAuditTeamDTOS = sysAuditTeamService.selectByMemberOne(userId);
|
||||
sysAuditTeamDTOS = sysAuditTeamService.selectByMemberOne(Long.parseLong(userId));
|
||||
groupUserId = sysAuditTeamDTOS
|
||||
.stream()
|
||||
.map(index -> index.getMember())
|
||||
|
|
|
@ -81,6 +81,7 @@ public class SysAuditTeamController {
|
|||
dto.setIndex(CommonUtils.getPinYinHeadChar(dto.getName())); // 索引设置为名称拼音
|
||||
dto.setMember(dto.getMember().stream().map(index -> {
|
||||
Optional<SysUserDTO> sysUserDTO = Optional.ofNullable(sysUserService.get(Long.parseLong((String) index.get("id"))));
|
||||
index.put("id", Long.parseLong((String) index.get("id")));
|
||||
if (sysUserDTO.isPresent()) {
|
||||
index.put("name", sysUserDTO.get().getRealName());
|
||||
index.put("dept_name", sysUserDTO.get().getDeptName());
|
||||
|
@ -100,7 +101,8 @@ public class SysAuditTeamController {
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
dto.setIndex(CommonUtils.getPinYinHeadChar(dto.getName())); // 索引设置为名称拼音
|
||||
dto.setMember(dto.getMember().stream().map(index -> {
|
||||
Optional<SysUserDTO> sysUserDTO = Optional.ofNullable(sysUserService.get(Long.parseLong(index.get("id").toString())));
|
||||
Optional<SysUserDTO> sysUserDTO = Optional.ofNullable(sysUserService.get(Long.parseLong((String) index.get("id"))));
|
||||
index.put("id", Long.parseLong((String) index.get("id")));
|
||||
if (sysUserDTO.isPresent()) {
|
||||
index.put("name", sysUserDTO.get().getRealName());
|
||||
index.put("dept_name", sysUserDTO.get().getDeptName());
|
||||
|
|
|
@ -23,5 +23,5 @@ public interface SysAuditTeamDao extends BaseDao<SysAuditTeamEntity> {
|
|||
* @param member
|
||||
* @return
|
||||
*/
|
||||
List<SysAuditTeamDTO> selectByMemberOne(@Param("member") String member);
|
||||
List<SysAuditTeamDTO> selectByMemberOne(@Param("member") Long member);
|
||||
}
|
|
@ -13,5 +13,5 @@ import java.util.List;
|
|||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
public interface SysAuditTeamService extends CrudService<SysAuditTeamEntity, SysAuditTeamDTO> {
|
||||
List<SysAuditTeamDTO> selectByMemberOne(String member);
|
||||
List<SysAuditTeamDTO> selectByMemberOne(Long member);
|
||||
}
|
|
@ -38,7 +38,7 @@ public class SysAuditTeamServiceImpl extends CrudServiceImpl<SysAuditTeamDao, Sy
|
|||
|
||||
|
||||
@Override
|
||||
public List<SysAuditTeamDTO> selectByMemberOne(String member) {
|
||||
public List<SysAuditTeamDTO> selectByMemberOne(Long member) {
|
||||
return baseDao.selectByMemberOne(member);
|
||||
}
|
||||
}
|
|
@ -255,6 +255,7 @@ public class SysUserController {
|
|||
//分页参数
|
||||
long curPage = 1;
|
||||
long limit = 10;
|
||||
boolean filterAuditTeam = Boolean.parseBoolean(params.getOrDefault("filter", "false").toString());
|
||||
|
||||
if (params.get(Constant.PAGE) != null) {
|
||||
curPage = Long.parseLong((String) params.get(Constant.PAGE));
|
||||
|
@ -277,9 +278,9 @@ public class SysUserController {
|
|||
}
|
||||
add(Long.parseLong(defaultAssigneeRoleId));
|
||||
}};
|
||||
List<Map> temp = sysUserService.getUserByRoleList(roleId, (int) curPage, (int) limit);
|
||||
List<Map> temp = sysUserService.getUserByRoleList(roleId, (int) curPage, (int) limit, filterAuditTeam);
|
||||
temp = temp.stream().map(index -> {
|
||||
List<SysAuditTeamDTO> sysAuditTeamDTOList = sysAuditTeamService.selectByMemberOne(index.get("id").toString());
|
||||
List<SysAuditTeamDTO> sysAuditTeamDTOList = sysAuditTeamService.selectByMemberOne(Long.parseLong(index.get("id").toString()));
|
||||
index.put("inAuditTeam", !sysAuditTeamDTOList.isEmpty());
|
||||
index.put("auditTeamName", sysAuditTeamDTOList.stream().findFirst().isPresent() ? sysAuditTeamDTOList.stream().findFirst().get().getName() : "");
|
||||
return index;
|
||||
|
|
|
@ -57,7 +57,7 @@ public interface SysUserDao extends BaseDao<SysUserEntity> {
|
|||
|
||||
Integer getApproverUnconfiguredRegionCount();
|
||||
|
||||
List<Map> getUserByRoleList(@Param("roleIds") List<Long> roleIds, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);
|
||||
List<Map> getUserByRoleList(@Param("roleIds") List<Long> roleIds, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param("filter") boolean filter);
|
||||
|
||||
Long getUserByRoleListCount(@Param("roleIds") List<Long> roleIds);
|
||||
}
|
|
@ -72,7 +72,7 @@ public interface SysUserService extends BaseService<SysUserEntity> {
|
|||
* @param roleIds
|
||||
* @return
|
||||
*/
|
||||
List<Map> getUserByRoleList(List<Long> roleIds, int pageNum, int pageSize);
|
||||
List<Map> getUserByRoleList(List<Long> roleIds, int pageNum, int pageSize, boolean filter);
|
||||
|
||||
Long getUserByRoleListCount(List<Long> roleIds);
|
||||
}
|
||||
|
|
|
@ -563,8 +563,8 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map> getUserByRoleList(List<Long> roleIds, int pageNum, int pageSize) {
|
||||
return baseDao.getUserByRoleList(roleIds, (pageNum - 1) * pageSize, pageSize);
|
||||
public List<Map> getUserByRoleList(List<Long> roleIds, int pageNum, int pageSize, boolean filter) {
|
||||
return baseDao.getUserByRoleList(roleIds, (pageNum - 1) * pageSize, pageSize, filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -199,8 +199,32 @@
|
|||
</select>
|
||||
|
||||
<select id="getUserByRoleList" resultType="java.util.Map">
|
||||
<!-- SELECT-->
|
||||
<!-- DISTINCT-->
|
||||
<!-- sys_user.id,-->
|
||||
<!-- sys_user.username,-->
|
||||
<!-- sys_user.real_name,-->
|
||||
<!-- sys_dept.`name`-->
|
||||
<!-- FROM-->
|
||||
<!-- sys_role_user-->
|
||||
<!-- LEFT JOIN sys_user ON sys_user.id = sys_role_user.user_id-->
|
||||
<!-- LEFT JOIN sys_dept ON sys_dept.id = sys_user.dept_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- 1 = 1-->
|
||||
<!-- AND sys_role_user.del_flag = 0-->
|
||||
<!-- AND sys_user.id IS NOT NULL-->
|
||||
<!-- <if test="null != roleIds">-->
|
||||
<!-- AND sys_role_user.role_id IN-->
|
||||
<!-- <foreach item="roleId" collection="roleIds" open="(" separator="," close=")">-->
|
||||
<!-- #{roleId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- LIMIT ${pageNum}, ${pageSize} -->
|
||||
SELECT
|
||||
DISTINCT
|
||||
temp.*
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT
|
||||
sys_user.id,
|
||||
sys_user.username,
|
||||
sys_user.real_name,
|
||||
|
@ -212,13 +236,28 @@
|
|||
WHERE
|
||||
1 = 1
|
||||
AND sys_role_user.del_flag = 0
|
||||
AND sys_user.id IS NOT NULL
|
||||
<if test="null != roleIds">
|
||||
AND sys_role_user.role_id IN
|
||||
<foreach item="roleId" collection="roleIds" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND sys_user.id IS NOT NULL
|
||||
) temp
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="filter">
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
sys_audit_team
|
||||
WHERE
|
||||
JSON_CONTAINS(
|
||||
sys_audit_team.member,
|
||||
JSON_OBJECT( "id", temp.id ))
|
||||
)
|
||||
</if>
|
||||
LIMIT ${pageNum}, ${pageSize}
|
||||
</select>
|
||||
<select id="getUserByRoleListCount" resultType="java.lang.Long">
|
||||
|
|
Loading…
Reference in New Issue