001/include/app.hpp

79 lines
2.0 KiB
C++
Raw Normal View History

2026-04-15 08:34:21 +00:00
#ifndef ATTENDANCE_SYSTEM_APP_HPP
#define ATTENDANCE_SYSTEM_APP_HPP
#include <string>
#include <vector>
#include <memory>
#include "employee.hpp"
#include "schedule.hpp"
#include "checkin.hpp"
#include "attendance.hpp"
#include "alert.hpp"
namespace AttendanceSystem {
class Application {
public:
Application();
~Application() = default;
// 初始化应用程序
bool initialize();
// 运行主逻辑
void run();
// 添加员工
bool addEmployee(const std::string& name, const std::string& departmentId,
const std::string& position, const std::string& mobile,
const std::string& email);
// 添加排班规则
bool addScheduleRule(const std::string& shiftName, int startHour, int startMinute,
int endHour, int endMinute, int breakDuration, int overtimeThreshold);
// 员工打卡
bool employeeCheckIn(const std::string& employeeId, CheckInMethod method,
int hour, int minute, double latitude = 0.0, double longitude = 0.0);
// 计算考勤结果
void calculateAttendance();
// 检测异常事件
void detectAbnormalities();
// 生成统计信息
void generateStatistics();
// 获取员工列表
std::vector<Employee> getEmployees() const;
// 获取考勤记录列表
std::vector<CheckInRecord> getCheckInRecords() const;
// 获取考勤结果列表
std::vector<AttendanceResult> getAttendanceResults() const;
// 获取异常事件列表
std::vector<AlertEvent> getAlertEvents() const;
private:
std::vector<Employee> employees_;
std::vector<ScheduleRule> scheduleRules_;
std::vector<CheckInRecord> checkInRecords_;
std::vector<AttendanceResult> attendanceResults_;
std::vector<AlertEvent> alertEvents_;
// 生成模拟数据
void generateMockData();
// 显示菜单
void showMenu();
// 处理用户输入
void handleInput(int choice);
};
} // namespace AttendanceSystem
#endif // ATTENDANCE_SYSTEM_APP_HPP