人员列表
This commit is contained in:
parent
2619fa3015
commit
9ba88d2b98
@ -10,7 +10,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@ -78,8 +77,8 @@ public class AttendanceController {
|
||||
|
||||
@GetMapping("/getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights")
|
||||
@Operation(summary = "获取当前登陆用户所在考勤组并且是否有管理员权限")
|
||||
public CommonResult<List<AttendanceGroupSystemVO>> getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights() {
|
||||
List<AttendanceGroupSystemVO> vo = attendanceService.getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights();
|
||||
public CommonResult<List<AttendanceGroupSystemVO>> getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights(@RequestParam(name = "allFlag", required = false, defaultValue = "false") Boolean allFlag) {
|
||||
List<AttendanceGroupSystemVO> vo = attendanceService.getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights(allFlag);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,18 @@ public class UserController {
|
||||
return success(UserConvert.INSTANCE.convertSimpleList(list, deptMap));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping({"/list-all"})
|
||||
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项,无数据权限")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<List<UserSimpleRespVO>> getAllUserListByGroupIds(@RequestBody List<Long> groupIds) {
|
||||
List<AdminUserDO> list = userService.getAllUserListByGroupIds(groupIds);
|
||||
// 拼接数据
|
||||
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
||||
convertList(list, AdminUserDO::getDeptId));
|
||||
return success(UserConvert.INSTANCE.convertSimpleList(list, deptMap));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
|
@ -92,4 +92,11 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
List<UserRespVO> selectByDeptIdsFilterGroupUser(@Param("deptIds") Collection<Long> deptIds, @Param("groupId") Long groupId);
|
||||
|
||||
List<Long> selectUserByBoss();
|
||||
|
||||
/**
|
||||
* 获取考勤组里所有的用户
|
||||
* @param groupIds
|
||||
* @return
|
||||
*/
|
||||
List<AdminUserDO> getAllUserListByGroupIds(@Param("groupIds") List<Long> groupIds);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public interface AttendanceService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<AttendanceGroupSystemVO> getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights();
|
||||
List<AttendanceGroupSystemVO> getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights(Boolean allFlag);
|
||||
|
||||
/**
|
||||
* 获取考勤规则
|
||||
|
@ -757,11 +757,11 @@ public class AttendanceServiceImpl implements AttendanceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttendanceGroupSystemVO> getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights() {
|
||||
public List<AttendanceGroupSystemVO> getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights(Boolean allFlag) {
|
||||
Long userId = getLoginUserId();
|
||||
List<AttendanceGroupSystemVO> attendanceGroupSystemVOS = new ArrayList<>();
|
||||
List<AttendanceGroupDO> attendanceGroupDOS = attendanceGroupMapper.selectList(new LambdaQueryWrapper<AttendanceGroupDO>()
|
||||
.eq(AttendanceGroupDO::getUserId, userId));
|
||||
.eq(!allFlag, AttendanceGroupDO::getUserId, userId));
|
||||
if (CollectionUtil.isEmpty(attendanceGroupDOS)) {
|
||||
return attendanceGroupSystemVOS;
|
||||
}
|
||||
|
@ -296,4 +296,12 @@ public interface AdminUserService {
|
||||
* @return
|
||||
*/
|
||||
List<AdminUserDO> getAllList(Integer status, Integer type, List<Long> userIds);
|
||||
|
||||
/**
|
||||
* 获取所有人员列表根据考勤组
|
||||
*
|
||||
* @param groupIds
|
||||
* @return
|
||||
*/
|
||||
List<AdminUserDO> getAllUserListByGroupIds(List<Long> groupIds);
|
||||
}
|
||||
|
@ -597,4 +597,9 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
.in(CollectionUtil.isNotEmpty(userIds), AdminUserDO::getId, userIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserDO> getAllUserListByGroupIds(List<Long> groupIds) {
|
||||
return userMapper.getAllUserListByGroupIds(groupIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,4 +54,19 @@
|
||||
</foreach>
|
||||
and not exists(select id from kq_attendance_group_user where user_id = a.id and attendance_group_id != #{groupId} and deleted = 0)
|
||||
</select>
|
||||
<select id="getAllUserListByGroupIds"
|
||||
resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
|
||||
select a.*
|
||||
from system_users as a
|
||||
left join kq_attendance_group_user b on a.id = b.user_id
|
||||
<where>
|
||||
a.deleted = 0 and b.deleted = 0
|
||||
<if test="groupIds != null and groupIds.size() > 0">
|
||||
and b.attendance_group_id in
|
||||
<foreach collection="groupIds" item="groupId" open="(" close=")" separator=",">
|
||||
#{groupId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user