123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef MINE_H
- #define MINE_H
- /**
- * @brief 矿井里相关的业务
- * @author 戴月腾
- * @date 2018-09-24
- */
- #include <unordered_map>
- #include <log.h>
- #include <chrono>
- #include "common.h"
- struct mine_tool
- {
- mine_tool():
- m_over_speed_count(0)
- ,m_normal_speed_count(0)
- ,m_status_call(0)
- ,m_stat_attendance(AS_INIT)
- ,m_attendance_start_time(std::chrono::seconds(0))
- {
- }
- int m_over_speed_count;
- int m_normal_speed_count;
- ///CALL_NONE(0):没有呼叫,CALL_ING(2):正在呼叫,CALL_SUCCESSED(1):呼叫成功
- int m_status_call;
- ///考勤状态 0初始状态 1 没在考勤 2 考勤;参看ATTENDANCE_STATUS
- int m_stat_attendance;
- ///考勤开始时间
- std::chrono::system_clock::time_point m_attendance_start_time;
- void on_point(uint32_t card_id, int32_t type, int vehicle_category_id);
- uint64_t get_down_time();
- uint64_t get_work_time();
- int32_t is_on_duty();
- bool is_attendance()
- {
- return AS_ATTENDANCE == m_stat_attendance;
- }
- };
- #endif // MINE_H
|