123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- #ifndef MODULE_ATTENDANCE_PERSON_H
- #define MODULE_ATTENDANCE_PERSON_H
- #include <memory>
- #include <mutex>
- #include <map>
- #include <string>
- #include <chrono>
- #include <vector>
- #include<card.h>
- #include"ant.h"
- #include"area.h"
- #include"site_area.h"
- #include"module_const.h"
- class module_attendance_person:public singleton_base<module_attendance_person>
- {
- private:
- friend class singleton_base<module_attendance_person>;
- module_attendance_person()
- {
- }
- public:
-
- void enter_site(uint64_t card_id,int enter_site)
- {
- auto card_ptr=card_list::instance()->get(card_id);
- if(!card_ptr)
- {
- log_error("卡不存在card_id=%d", card_id);
- return;
- }
- auto site_ptr=sit_list::instance()->get(enter_site);
- if(!site_ptr)
- {
- log_error("在分站列表中找不到分站,分站id=%d", enter_site);
- return;
- }
- card_ptr->m_site_id = enter_site;
-
- if(UP_SITE==site_ptr->m_up_down)
- {
- if(AS_ATTENDANCE == card_ptr->m_stat_attendance)
- {
-
- card_ptr->m_stat_attendance=AS_NOT_ATTENDANCE;
-
- tool_db::save_attendance(card_ptr);
- }
- }
-
- if(DOWN_SITE==site_ptr->m_up_down)
- {
- if(AS_ATTENDANCE != card_ptr->m_stat_attendance)
- {
-
- card_ptr->m_stat_attendance=AS_ATTENDANCE;
- card_ptr->m_attendance_start_time=std::chrono::system_clock::now();
-
- tool_db::save_attendance(card_ptr);
- }
- }
- }
-
- void leave_site(uint64_t card_id,int enter_site)
- {
- }
-
- void up_well(std::vector<std::string>& card_ids)
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- };
- #endif
|