|
@@ -32,7 +32,7 @@ area_business_person_attendance::area_business_person_attendance()
|
|
|
|
|
|
|
|
|
void area_business_person_attendance::on_enter(const std::shared_ptr<area_hover>&a,
|
|
|
- const std::shared_ptr<card_location_base>&card_ptr,std::shared_ptr<business_data>&ptr)
|
|
|
+ const std::shared_ptr<card_location_base>&card_ptr,std::shared_ptr<business_data>&ptr)
|
|
|
{
|
|
|
if(!card_ptr->is_person())
|
|
|
{
|
|
@@ -49,19 +49,19 @@ void area_business_person_attendance::on_enter(const std::shared_ptr<area_hover>
|
|
|
|
|
|
db_tool::save_attendance(card_ptr);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void area_business_person_attendance::on_hover(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
@@ -70,36 +70,13 @@ void area_business_person_attendance::on_hover(const std::shared_ptr<area_hover>
|
|
|
}
|
|
|
|
|
|
void area_business_person_attendance::on_leave(const std::shared_ptr<area_hover>&a,
|
|
|
- const std::shared_ptr<card_location_base>&card_ptr,std::shared_ptr<business_data> ptr)
|
|
|
+ const std::shared_ptr<card_location_base>&card_ptr,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
if(!card_ptr->is_person())
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- up_mine(card_ptr, false);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-void area_business_person_attendance::up_mine(std::shared_ptr<card_location_base> card_ptr, bool is_web_delete)
|
|
|
-{
|
|
|
auto mine_tool_ptr = card_ptr->get_mine_tool();
|
|
|
if(!mine_tool_ptr->m_is_attendance)
|
|
|
{
|
|
@@ -119,9 +96,9 @@ void area_business_person_attendance::up_mine(std::shared_ptr<card_location_base
|
|
|
_to_json_card_up_one(card_ptr, datas, allocator);
|
|
|
|
|
|
|
|
|
- auto rea_tool = card_ptr->get_area_tool();
|
|
|
- rea_tool->on_leave(card_ptr);
|
|
|
- card_ptr->clear();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
if(datas.Size() > 0)
|
|
@@ -133,17 +110,23 @@ void area_business_person_attendance::up_mine(std::shared_ptr<card_location_base
|
|
|
swsClientMgr.send(JSON_CMD_VALUE_PUSH, tool_json::doc_to_json(doc));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -158,9 +141,9 @@ void area_business_person_attendance::handle_up_mine(sio::message::ptr const& da
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- rapidjson::Document doc(rapidjson::kObjectType);
|
|
|
- rapidjson::Value datas(rapidjson::kArrayType);
|
|
|
- rapidjson::Document::AllocatorType& allocator=doc.GetAllocator();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
std::vector<sio::message::ptr>::const_iterator it_card = card_vec.begin();
|
|
|
int type = 0;
|
|
@@ -168,7 +151,7 @@ void area_business_person_attendance::handle_up_mine(sio::message::ptr const& da
|
|
|
for(; it_card != card_vec.end(); ++it_card)
|
|
|
{
|
|
|
if(!tool_map::try_get_value(s_card_id, JSON_KEY_CALL_CARD_CARD_ID, (*it_card))
|
|
|
- ||!tool_map::try_get_value(type, JSON_KEY_CALL_CARD_CARD_TYPE_ID, (*it_card)))
|
|
|
+ ||!tool_map::try_get_value(type, JSON_KEY_CALL_CARD_CARD_TYPE_ID, (*it_card)))
|
|
|
{
|
|
|
log_error("手工升井,web发来的数据 card_id 或 card_type格式不对");
|
|
|
continue;
|
|
@@ -181,22 +164,26 @@ void area_business_person_attendance::handle_up_mine(sio::message::ptr const& da
|
|
|
std_debug("手工升井,处理,卡id=%d,卡type=%d", id, type);
|
|
|
log_info("手工升井,处理,卡id=%d,卡type=%d", id, type);
|
|
|
|
|
|
- auto mine_tool_ptr = card_ptr->get_mine_tool();
|
|
|
- if(mine_tool_ptr->m_is_attendance)
|
|
|
- {
|
|
|
-
|
|
|
- mine_tool_ptr->m_is_attendance=false;
|
|
|
+ auto rea_tool = card_ptr->get_area_tool();
|
|
|
+ rea_tool->on_leave(card_ptr);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- db_tool::save_attendance(card_ptr);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- auto rea_tool = card_ptr->get_area_tool();
|
|
|
- rea_tool->on_leave(card_ptr);
|
|
|
- card_ptr->clear();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -204,20 +191,20 @@ void area_business_person_attendance::handle_up_mine(sio::message::ptr const& da
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if(datas.Size() > 0)
|
|
|
- {
|
|
|
- doc.AddMember(JSON_ROOT_KEY_CMD,JSON_CMD_VALUE_UP_MINE, allocator);
|
|
|
-
|
|
|
- doc.AddMember(JSON_ROOT_KEY_DATA, datas, allocator);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- swsClientMgr.send(JSON_CMD_VALUE_PUSH, tool_json::doc_to_json(doc));
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
void area_business_person_attendance::_to_json_card_up_one(std::shared_ptr<card_location_base> card_ptr,
|
|
|
- rapidjson::Value& out_datas, rapidjson::Document::AllocatorType& allocator)
|
|
|
+ rapidjson::Value& out_datas, rapidjson::Document::AllocatorType& allocator)
|
|
|
{
|
|
|
if(!card_ptr->m_display)
|
|
|
{
|
|
@@ -268,3 +255,54 @@ void area_business_person_attendance::_to_json_card_up_one(std::shared_ptr<card_
|
|
|
out_datas.PushBack(data, allocator);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|