|
@@ -34,7 +34,18 @@ void area_business_car_attendance::on_enter(const std::shared_ptr<area_hover>&ar
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- save_attendance(card_ptr, area_hover_ptr);
|
|
|
+ auto mine_tool_ptr = card_ptr->get_mine_tool();
|
|
|
+ if(!mine_tool_ptr->m_is_attendance)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //考勤结束
|
|
|
+ mine_tool_ptr->m_is_attendance=false;
|
|
|
+ //作为一条结束考勤记录保存到数据库
|
|
|
+ db_tool::save_attendance(card_ptr);
|
|
|
+
|
|
|
+ //save_attendance(card_ptr, area_hover_ptr);
|
|
|
|
|
|
// auto ptr_temp = std::make_shared<car_attendance_data>();
|
|
|
// ptr = ptr_temp;
|
|
@@ -91,6 +102,35 @@ void area_business_car_attendance::on_leave(const std::shared_ptr<area_hover>&a,
|
|
|
// db_tool::save_attendance(card_ptr, ptr_temp->m_is_attendance, ptr_temp->m_attendance_start_time);
|
|
|
// }
|
|
|
}
|
|
|
+
|
|
|
+/////area_hover_ptr==nullptr 表示接收到 web的删除卡命令
|
|
|
+//void area_business_car_attendance::save_attendance(const std::shared_ptr<card_location_base>& card_ptr,
|
|
|
+// const std::shared_ptr<area_hover> area_hover_ptr)
|
|
|
+//{
|
|
|
+// auto mine_tool_ptr = card_ptr->get_mine_tool();
|
|
|
+// if(!mine_tool_ptr->m_is_attendance)
|
|
|
+// {
|
|
|
+// return;
|
|
|
+// }
|
|
|
+
|
|
|
+// //考勤结束
|
|
|
+// mine_tool_ptr->m_is_attendance=false;
|
|
|
+// //作为一条结束考勤记录保存到数据库
|
|
|
+// db_tool::save_attendance(card_ptr);
|
|
|
+
|
|
|
+//// if(area_hover_ptr)
|
|
|
+//// {
|
|
|
+//// log_info("车卡考勤结束:卡id=%d,卡type=%d,区域id=%d, stat_attendance=%d",
|
|
|
+//// card_ptr->m_id, card_ptr->m_type,
|
|
|
+//// area_ptr->m_id,mine_tool_ptr->m_stat_attendance);
|
|
|
+//// }
|
|
|
+//// else
|
|
|
+//// {
|
|
|
+//// log_info("收到web的删除卡命令,车卡考勤结束:卡id=%d,卡type=%d,stat_attendance=%d",
|
|
|
+//// card_ptr->m_id, card_ptr->m_type,mine_tool_ptr->m_stat_attendance);
|
|
|
+//// }
|
|
|
+//}
|
|
|
+
|
|
|
#if 0
|
|
|
|
|
|
//void area_business_car_attendance::init_attendance_area_from_db()
|
|
@@ -127,31 +167,5 @@ void area_business_car_attendance::on_leave(const std::shared_ptr<area_hover>&a,
|
|
|
|
|
|
#endif
|
|
|
|
|
|
-///area_hover_ptr==nullptr 表示接收到 web的删除卡命令
|
|
|
-void area_business_car_attendance::save_attendance(const std::shared_ptr<card_location_base>& card_ptr,
|
|
|
- const std::shared_ptr<area_hover> area_hover_ptr)
|
|
|
-{
|
|
|
- auto mine_tool_ptr = card_ptr->get_mine_tool();
|
|
|
- if(!mine_tool_ptr->m_is_attendance)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
- //考勤结束
|
|
|
- mine_tool_ptr->m_is_attendance=false;
|
|
|
- //作为一条结束考勤记录保存到数据库
|
|
|
- db_tool::save_attendance(card_ptr);
|
|
|
-
|
|
|
-// if(area_hover_ptr)
|
|
|
-// {
|
|
|
-// log_info("车卡考勤结束:卡id=%d,卡type=%d,区域id=%d, stat_attendance=%d",
|
|
|
-// card_ptr->m_id, card_ptr->m_type,
|
|
|
-// area_ptr->m_id,mine_tool_ptr->m_stat_attendance);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// log_info("收到web的删除卡命令,车卡考勤结束:卡id=%d,卡type=%d,stat_attendance=%d",
|
|
|
-// card_ptr->m_id, card_ptr->m_type,mine_tool_ptr->m_stat_attendance);
|
|
|
-// }
|
|
|
-}
|
|
|
|