Employee attendance system

Posted by phpology on Sat, 18 Dec 2021 17:59:48 +0100

Requirements:

1, User management
1. User list
List fields: name, login name, gender, mobile phone number, salary, position and role
List buttons: edit, enable, disable, reset password
Search criteria: user name, status (enabled or disabled)
Top button: Add User
Import, export
2, Attendance management
1. Clock in
Buttons: clock in at work (8:00-8:30), clock out after work (18:00-18:30)
Deduct 50 for being late, 100 for leaving early and 200 for absenteeism
2. Attendance list
List fields: name, clock in time, clock in status (normal, late, early leave)
Search criteria: name, punch in status
3: Process management
1. Process management
List fields: name, type, opinion, approval status
Button: View Details
2. New process
Fields: type (leave, resignation, reimbursement), start time (leave), end time (leave), reason, days (displayed during leave), amount (displayed during reimbursement)
3. Audit process
List fields: name, type, opinion, approval status
Button: approve (pass, comment)
4. My process
Same process list
4, Salary management
1. My salary
List fields: name, late fee deduction, absenteeism fee deduction, early leave fee deduction, bonus, basic salary and month
2. Salary details
Generate the salary of this month. The fields are the same as above. There is one more approval button, and you can enter bonus
3. Post salary
List fields: position and salary
Buttons: add, edit, delete
5, Personal information management
Name, address, telephone number and password can be modified

Permission related
2 roles, administrator and employee
Employee permission: attendance management - attendance punch and attendance list
Process management - my process, new process
Salary management - my salary
Personal information management

Partial logic and class presentation




Interface display




Code display

 public R findPageStaffByStatus(Integer status, Long current, Long size)
    {
        QueryWrapper<Staff> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", status);
        List<Staff> staff = staffMapper.selectList(queryWrapper);
        Long Assize = Math.min(staff.size(), size);
        if (current <= (staff.size() / size)+1)
        {
            currents = current;
        }
        Page<PageStaff> page = pageStaffMapper.selectPageAndSalaryByStatus(new Page<>(currents, Assize), status);
        if (size > staff.size())
        {
            return R.ok(page, "The size entered is too large to display all information");
        }
        if (current > (staff.size() / size)+1)
        {
            return R.failed("The page number you entered is too large. Please re-enter it");
        }
        return page.getTotal() == 0 ? R.failed("no message") : R.ok(page, "Return information");
    }
    
    @Override
    public R findPageStaffByName(String name, Long current, Long size)
    {
        QueryWrapper<Staff> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("name", name);
        List<Staff> staff = staffMapper.selectList(queryWrapper);
        Long Assize = Math.min(staff.size(), size);
        if (current <= (staff.size() / size)+1)
        {
            currents = current;
        }
        Page<PageStaff> page = pageStaffMapper.selectPageAndSalaryByName(new Page<>(currents, Assize),name);
        if (size > staff.size())
        {
            return R.ok(page, "The size entered is too large to display all information");
        }
        if (current > (staff.size() / size)+1)
        {
            return R.failed("The page number you entered is too large. Please re-enter it");
        }
        return page.getTotal() == 0 ? R.failed("no message") : R.ok(page, "Return information");
    }
    
    @Override
    public Integer updateStaffStatus(Staff staff)
    {
        return staffMapper.updateById(staff);
    }
    
    @Override
    public R editStaff(Staff staff1, Integer salary)
    {
        if (staff1.getJobId() == null)
        {
            return R.failed("Employee ID cannot be empty!");
        }
        // Modify salary
        QueryWrapper<Salary>queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("userid",staff1.getJobId());
        Salary salary1 = salaryMapper.selectOne(queryWrapper);
        if (salary1==null)
        {
            return R.failed("This employee does not exist");
        }
        salary1.setBascimoney(salary);
        salary1.setName(staff1.getName());
        salary1.setPost(staff1.getPost());
        salaryMapper.updateById(salary1);
        
        // Modify employee information
        if (staffMapper.selectById(staff1.getJobId()) == null)
        {
            return R.failed("The employee table does not exist for this employee");
        }
        staffMapper.updateById(staff1);
        
        return R.ok("Modified successfully");
    }

    @Override
    public Integer updateStaff2(Staff staff) {
        return  staffMapper.updateById(staff);
    }

Function display









If you need it, you can confide in me, or go to my github and pull yourself
https://github.com/zyy0822

Topics: Java Hibernate Mybatis Spring