Browse Source

去掉保存井上分站第一次接收数据的时间

chensongchao 5 years ago
parent
commit
b3ecf48a94
2 changed files with 4 additions and 38 deletions
  1. 3 29
      card_person.cpp
  2. 1 9
      card_person.h

+ 3 - 29
card_person.cpp

@@ -94,23 +94,13 @@ void person::IKSDK_DB(int sid)
 		}
 		std::string card_id = tool_other::type_id_to_str(m_type,m_id);
 		std::string st	    = tool_time::to_str(now);
-		if (m_frist_iris_recognition_timeval == "")
-		{
-			m_frist_iris_recognition_timeval = st;
-		}
 
 		char nsql[256]={0};
-		const char*sql="REPLACE INTO his_att_interface (staff_id,card_id,reader_id,staff_name,dept_id,dept_name,upt_time,low_power_warn,frist_write_time)"
-				 " VALUES (%d,%s,%d,'%s',%d,'%s','%s',%d,'%s');";
-		snprintf(nsql,256,sql,m_cid,card_id.c_str(),sid,m_stafferName.c_str(),m_deptid,m_deptName.c_str(),st.c_str(),f,m_frist_iris_recognition_timeval.c_str());
+		const char*sql="REPLACE INTO his_att_interface (staff_id,card_id,reader_id,staff_name,dept_id,dept_name,upt_time,low_power_warn)"
+				 " VALUES (%d,%s,%d,'%s',%d,'%s','%s',%d);";
+		snprintf(nsql,256,sql,m_cid,card_id.c_str(),sid,m_stafferName.c_str(),m_deptid,m_deptName.c_str(),st.c_str(),f);
 
 		db_tool::PushAsync(nsql);
-
-		m_old_iris_recognition_timeval = m_iris_recognition_timeval;
-		if(m_old_iris_recognition_timeval == 0)
-		{
-			m_old_iris_recognition_timeval = now;
-		}
 		m_iris_recognition_timeval = now;
 	}
 }
@@ -158,9 +148,6 @@ void person::on_timer()
         return ;
     }
     m_1sto2s=false;
-
-    check_frist_iris_recognition_time();
-
     if(!m_mine_tool->m_is_attendance)
 	{
 		if(m_upmine_flag.load())
@@ -171,7 +158,6 @@ void person::on_timer()
 
 		return;
 	}
-    m_frist_iris_recognition_timeval = "";
 
 	YA::_CARD_POS_ cp;
 	uint64_t _time=0;
@@ -261,15 +247,3 @@ void person::get_card(bool f)
 		return ;
 	mine_business::inst()->fetch_add(m_display);
 }
-
-void person::check_frist_iris_recognition_time()
-{
-	if (m_frist_iris_recognition_timeval.length() < 4)
-	{
-		return ;
-	}
-	if (time(nullptr) - m_iris_recognition_timeval > 10)
-    {
-		m_frist_iris_recognition_timeval = "";
-    }
-}

+ 1 - 9
card_person.h

@@ -9,7 +9,7 @@ struct person:card_location_base, card_area
     int m_workLine=0;	
 	int m_worktype_id=0;
     int m_thour{-1};
-
+    time_t m_iris_recognition_timeval = 0;
     static int m_limit_detained_time;
     static int m_auto_up_mine_time;
     static int m_person_cards_flag;
@@ -41,14 +41,6 @@ struct person:card_location_base, card_area
     {
         return m_workLine;
     }
-
-public:
-    //虹膜考勤相关
-    //记录最早井上分站接收的状态
-    time_t m_iris_recognition_timeval = 0;
-    time_t m_old_iris_recognition_timeval = 0;
-    std::string m_frist_iris_recognition_timeval = "";
-    void check_frist_iris_recognition_time();
 };
 #endif