|
@@ -11,7 +11,7 @@
|
|
|
#include"tool_time.h"
|
|
|
#include"ant.h"
|
|
|
#include"db/db_tool.h"
|
|
|
-
|
|
|
+#include "mine.h"
|
|
|
|
|
|
uint64_t ya_event::get_list_id()
|
|
|
{
|
|
@@ -235,7 +235,7 @@ std::shared_ptr<ya_event> event_list::get_event_card(uint32_t card_id, int card_
|
|
|
return base::get(to_list_id(ev_type, OT_CARD, id64,edt));
|
|
|
}
|
|
|
|
|
|
-void event_list::save_event(std::shared_ptr<ya_event> ev_ptr)
|
|
|
+void event_list::save_event(const std::shared_ptr<ya_event> &ev_ptr)
|
|
|
{
|
|
|
char sql[LENGTH_SQL] = {0};
|
|
|
std::string _time = tool_time::to_str_ex(ev_ptr->m_cur_time);
|
|
@@ -342,12 +342,18 @@ void event_list::load_his_data_from_db()
|
|
|
//这里当是卡告警的时候,对m_event数据进行赋值
|
|
|
//方便清理
|
|
|
//备注防追尾告警和一人多卡告警可能不适用,后续整理
|
|
|
- if(ev->m_obj_type==OT_CARD)
|
|
|
- {
|
|
|
+ if(ev->m_obj_type==OT_CARD){
|
|
|
uint64_t c_id= tool_other::card_id_to_u64(ev->m_obj_id);
|
|
|
- if(auto c=card_list::instance()->get(c_id))
|
|
|
- c->set_event_flag(ev->m_ev_type);
|
|
|
- }
|
|
|
+ if(auto c=card_list::instance()->get(c_id)){
|
|
|
+ do{
|
|
|
+ if(c->m_type==CT_PERSON){
|
|
|
+ auto mine_tool_ptr = c->get_mine_tool();
|
|
|
+ if(!mine_tool_ptr->m_is_attendance) break;
|
|
|
+ }
|
|
|
+ c->set_event_flag(ev->m_ev_type);
|
|
|
+ }while(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
if(ev->m_ev_type==ET_READER_POWER_BY_BATTERY)
|
|
|
if(auto r=sit_list::instance()->get(std::stoi(obj_id)))
|
|
|
r->m_power_ac_down=true;
|