💖💖作者:计算机毕业设计江挽 💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 深度学习实战项目
基于Python员工管理系统介绍
员工管理系统是一个基于SpringBoot+Vue+MySQL技术架构开发的企业人力资源管理平台,采用B/S结构设计,为企业提供完整的员工信息管理解决方案。系统后端采用SpringBoot框架整合Spring、SpringMVC、MyBatis技术栈,构建稳定的RESTful API服务,前端使用Vue.js框架结合ElementUI组件库实现用户界面,通过MySQL关系型数据库进行数据持久化存储。系统主要功能模块包括系统首页展示、个人中心管理、员工档案维护、部门组织管理、员工打卡记录、考勤统计分析、请假申请流程、薪资计算发放以及系统操作日志等核心业务功能。管理员可以通过系统完成员工基础信息录入、部门架构设置、考勤数据统计、薪资核算发放等日常管理工作,普通员工能够查看个人信息、进行打卡签到、提交请假申请、查询薪资详情等操作。系统界面设计简洁美观,操作流程符合用户习惯,数据库设计规范合理,能够有效提升企业人力资源管理效率,降低管理成本,为企业数字化管理提供可靠的技术支撑。
基于Python员工管理系统演示视频
基于Python员工管理系统演示图片
基于Python员工管理系统代码展示
SparkSession spark = SparkSession.builder().appName("EmployeeDataAnalysis").master("local").getOrCreate();
public Result addEmployee(Employee employee) {
if (employee.getName() == null || employee.getName().trim().isEmpty()) {
return Result.error("员工姓名不能为空");
}
if (employee.getPhone() == null || !employee.getPhone().matches("^1[3-9]\\d{9}__CODEBLOCK_0__quot;)) {
return Result.error("手机号格式不正确");
}
if (employee.getIdCard() == null || !employee.getIdCard().matches("^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]__CODEBLOCK_0__quot;)) {
return Result.error("身份证号格式不正确");
}
Employee existingEmployee = employeeMapper.selectByPhone(employee.getPhone());
if (existingEmployee != null) {
return Result.error("该手机号已存在");
}
existingEmployee = employeeMapper.selectByIdCard(employee.getIdCard());
if (existingEmployee != null) {
return Result.error("该身份证号已存在");
}
Department department = departmentMapper.selectById(employee.getDepartmentId());
if (department == null) {
return Result.error("所选部门不存在");
}
employee.setEmployeeNo(generateEmployeeNo());
employee.setCreateTime(new Date());
employee.setStatus(1);
employee.setPassword(MD5Utils.encrypt(employee.getIdCard().substring(employee.getIdCard().length() - 6)));
int result = employeeMapper.insert(employee);
if (result > 0) {
return Result.success("员工添加成功");
} else {
return Result.error("员工添加失败");
}
}
public Result clockIn(Long employeeId, String location, Double longitude, Double latitude) {
Employee employee = employeeMapper.selectById(employeeId);
if (employee == null) {
return Result.error("员工不存在");
}
if (employee.getStatus() != 1) {
return Result.error("员工状态异常,无法打卡");
}
Date now = new Date();
String today = DateUtils.format(now, "yyyy-MM-dd");
Attendance existingAttendance = attendanceMapper.selectByEmployeeIdAndDate(employeeId, today);
if (existingAttendance != null && existingAttendance.getClockInTime() != null) {
return Result.error("今日已打卡,请勿重复打卡");
}
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
int currentMinutes = hour * 60 + minute;
int workStartMinutes = 9 * 60;
boolean isLate = currentMinutes > workStartMinutes;
Attendance attendance = new Attendance();
attendance.setEmployeeId(employeeId);
attendance.setAttendanceDate(today);
attendance.setClockInTime(now);
attendance.setClockInLocation(location);
attendance.setLongitude(longitude);
attendance.setLatitude(latitude);
attendance.setIsLate(isLate ? 1 : 0);
attendance.setCreateTime(now);
int result = attendanceMapper.insert(attendance);
if (result > 0) {
return Result.success("打卡成功");
} else {
return Result.error("打卡失败");
}
}
public Result calculateSalary(Long employeeId, String month) {
Employee employee = employeeMapper.selectById(employeeId);
if (employee == null) {
return Result.error("员工不存在");
}
if (employee.getBaseSalary() == null || employee.getBaseSalary().compareTo(BigDecimal.ZERO) <= 0) {
return Result.error("员工基础工资未设置");
}
List<Attendance> attendanceList = attendanceMapper.selectByEmployeeIdAndMonth(employeeId, month);
int workDays = attendanceList.size();
int lateDays = (int) attendanceList.stream().filter(a -> a.getIsLate() == 1).count();
BigDecimal baseSalary = employee.getBaseSalary();
BigDecimal dailySalary = baseSalary.divide(new BigDecimal("22"), 2, RoundingMode.HALF_UP);
BigDecimal attendanceSalary = dailySalary.multiply(new BigDecimal(workDays));
BigDecimal lateDeduction = new BigDecimal(lateDays).multiply(new BigDecimal("50"));
BigDecimal totalSalary = attendanceSalary.subtract(lateDeduction);
if (totalSalary.compareTo(BigDecimal.ZERO) < 0) {
totalSalary = BigDecimal.ZERO;
}
Salary existingSalary = salaryMapper.selectByEmployeeIdAndMonth(employeeId, month);
if (existingSalary != null) {
existingSalary.setBaseSalary(baseSalary);
existingSalary.setAttendanceDays(workDays);
existingSalary.setLateDays(lateDays);
existingSalary.setDeductions(lateDeduction);
existingSalary.setTotalSalary(totalSalary);
existingSalary.setUpdateTime(new Date());
salaryMapper.updateById(existingSalary);
} else {
Salary salary = new Salary();
salary.setEmployeeId(employeeId);
salary.setSalaryMonth(month);
salary.setBaseSalary(baseSalary);
salary.setAttendanceDays(workDays);
salary.setLateDays(lateDays);
salary.setDeductions(lateDeduction);
salary.setTotalSalary(totalSalary);
salary.setCreateTime(new Date());
salaryMapper.insert(salary);
}
return Result.success("薪资计算完成");
}
基于Python员工管理系统文档展示
💖💖作者:计算机毕业设计江挽 💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 深度学习实战项目