BAOLH
2026-09-17 59c2e48f4c40e7dbc81149c9a859a54d8780ddf3
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/NewAttendanceServiceImpl.java
@@ -128,8 +128,8 @@
        //获取当前登入人信息
        User user = userRepository.getOne(SecurityUtils.getCurrentUserId());
        Role role = user.getRoles().iterator().next();
        //除超管、总经理只能修改自己信息
        if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) {
        // 除超管、总经理只能修改自己信息
        if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) {
            if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())) {
                throw new BadRequestException("只能修改自己的记录");
            }
@@ -238,8 +238,8 @@
            Role role = user.getRoles().iterator().next();
            //根据id查询记录
            Optional<NewAttendance> attendance = newAttendanceRepository.findById(id);
            //除超管、总经理只能删除自己信息
            if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) {
            // 除超管、总经理只能删除自己信息
            if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) {
                if (!Long.valueOf(attendance.get().getUserId()).equals(SecurityUtils.getCurrentUserId())) {
                    throw new BadRequestException("只能删除自己的记录");
                }
@@ -257,8 +257,8 @@
        //获取当前登入人信息
        User user = userRepository.getOne(SecurityUtils.getCurrentUserId());
        Role role = user.getRoles().iterator().next();
        //除超管、总经理只能补自己的卡
        if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) {
        // 除超管、总经理只能补自己的卡
        if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) {
            if (!Long.valueOf(userId).equals(SecurityUtils.getCurrentUserId())) {
                throw new BadRequestException("只能补自己的卡");
            }