|
@@ -26,7 +26,8 @@ namespace db_tool
|
|
|
return std::string(sql);
|
|
|
}
|
|
|
|
|
|
- void save_attendance(const std::shared_ptr<card_location_base>& card_ptr)
|
|
|
+ void save_attendance(const std::shared_ptr<card_location_base>& card_ptr,
|
|
|
+ const std::shared_ptr<area_hover>& area_hover_ptr)
|
|
|
{
|
|
|
char sql[LENGTH_SQL] = {0};
|
|
|
|
|
@@ -48,56 +49,9 @@ namespace db_tool
|
|
|
std::string start_str = tool_time::to_str(start);
|
|
|
std::string end_str = tool_time::to_str(end);
|
|
|
|
|
|
- int landmarkid = 0;
|
|
|
- int landmarkdirect=0;
|
|
|
- double landmarkdist=0;
|
|
|
- auto area_hover_ptr = card_ptr->get_area_hover();
|
|
|
- if(area_hover_ptr)
|
|
|
- {
|
|
|
- landmarkid = area_hover_ptr->landmark_id;
|
|
|
- landmarkdirect = area_hover_ptr->landmark_dir;
|
|
|
- landmarkdist = area_hover_ptr->landmark_dis;
|
|
|
- }
|
|
|
-
|
|
|
- sprintf(sql, "CALL %s(%s, %d, '%s', '%s', %d, %d, %.3f);", call.c_str(),
|
|
|
- type_id_to_str(card_ptr->m_type,card_ptr->m_id).c_str(),
|
|
|
- card_ptr->m_id, start_str.c_str(), end_str.c_str(),
|
|
|
- landmarkid, landmarkdirect, landmarkdist);
|
|
|
-
|
|
|
- PushAsync(sql);
|
|
|
- }
|
|
|
-
|
|
|
- void save_attendance(const std::shared_ptr<card_location_base>& card_ptr,
|
|
|
- bool is_attendance, std::chrono::system_clock::time_point& attendance_start_time)
|
|
|
- {
|
|
|
- char sql[LENGTH_SQL] = {0};
|
|
|
-
|
|
|
- std::string call("add_att_staff");
|
|
|
- if(card_ptr->is_vehicle())//车卡
|
|
|
- {
|
|
|
- call="add_att_vehicle";
|
|
|
- }
|
|
|
-
|
|
|
- auto start = attendance_start_time;
|
|
|
- auto end = attendance_start_time;
|
|
|
- if(!is_attendance)//考勤结束时间
|
|
|
- {
|
|
|
- end = std::chrono::system_clock::now();
|
|
|
- }
|
|
|
-
|
|
|
- std::string start_str = tool_time::to_str(start);
|
|
|
- std::string end_str = tool_time::to_str(end);
|
|
|
-
|
|
|
- int landmarkid = 0;
|
|
|
- int landmarkdirect=0;
|
|
|
- double landmarkdist=0;
|
|
|
- auto area_hover_ptr = card_ptr->get_area_hover();
|
|
|
- if(area_hover_ptr)
|
|
|
- {
|
|
|
- landmarkid = area_hover_ptr->landmark_id;
|
|
|
- landmarkdirect = area_hover_ptr->landmark_dir;
|
|
|
- landmarkdist = area_hover_ptr->landmark_dis;
|
|
|
- }
|
|
|
+ int landmarkid = area_hover_ptr->landmark_id;
|
|
|
+ int landmarkdirect=area_hover_ptr->landmark_dir;
|
|
|
+ double landmarkdist=area_hover_ptr->landmark_dis;
|
|
|
|
|
|
sprintf(sql, "CALL %s(%s, %d, '%s', '%s', %d, %d, %.3f);", call.c_str(),
|
|
|
type_id_to_str(card_ptr->m_type,card_ptr->m_id).c_str(),
|