|
@@ -193,7 +193,7 @@ void area::on_load_his(const std::shared_ptr<area_hover>&a,const std::shared_ptr
|
|
|
|
|
|
void area::on_leave(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c)
|
|
|
{
|
|
|
- log_info("on_leave..%d areaId:%d",c->m_id,m_id);
|
|
|
+ log_info("on_leave..card=%d areaId=%d",c->m_id,m_id);
|
|
|
a->m_last_time=tool_time::now_to_ms();
|
|
|
a->m_last_point=*c;
|
|
|
for(const auto &i:m_area_business_list)
|
|
@@ -724,6 +724,7 @@ void area_tool::on_point(const std::shared_ptr<card_location_base>& c,const poin
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
while(c1!=ce)
|
|
|
{
|
|
|
if((*c1)->m_area->get_frozen_count()==0)
|
|
@@ -767,13 +768,16 @@ void area_tool::on_point(const std::shared_ptr<card_location_base>& c,const poin
|
|
|
strAreaInfo += tmpArea;
|
|
|
}
|
|
|
}
|
|
|
- char sql[1024] = {0};
|
|
|
- std::string _time=tool_time::to_str_ex(c->time_());
|
|
|
- snprintf(sql, 1024, "REPLACE INTO rt_location (card_id, site_id,cur_time, x, y, z, state, area_info) VALUES (%s, %d,'%s',%lf, %lf, %lf, 0, '%s');",
|
|
|
- tool_other::type_id_to_str(c->m_type, c->m_id).c_str(), m_site->id(),_time.c_str(), pt.x, pt.y, pt.z, strAreaInfo.c_str());
|
|
|
- db_tool::PushAsync(sql);
|
|
|
- log_info("insert rt_location: card=%d site_id=%d,point=%.2f-%.2f,area_info=%s"
|
|
|
- ,c->m_id,m_site->id(),pt.x,pt.y,strAreaInfo.c_str());
|
|
|
+ if(!strAreaInfo.empty())
|
|
|
+ {
|
|
|
+ char sql[1024] = {0};
|
|
|
+ std::string _time=tool_time::to_str_ex(c->time_());
|
|
|
+ snprintf(sql, 1024, "REPLACE INTO rt_location (card_id, site_id,cur_time, x, y, z, state, area_info) VALUES (%s, %d,'%s',%lf, %lf, %lf, 0, '%s');",
|
|
|
+ tool_other::type_id_to_str(c->m_type, c->m_id).c_str(), m_site->id(),_time.c_str(), pt.x, pt.y, pt.z, strAreaInfo.c_str());
|
|
|
+ db_tool::PushAsync(sql);
|
|
|
+ log_info("insert rt_location: card=%d site_id=%d,point=%.2f-%.2f,area_info=%s"
|
|
|
+ ,c->m_id,m_site->id(),pt.x,pt.y,strAreaInfo.c_str());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -781,8 +785,10 @@ void area_tool::on_leave(const std::shared_ptr<card_location_base>& c)
|
|
|
{
|
|
|
for(const auto& t:m_hover_list)
|
|
|
{
|
|
|
- t->m_area->on_leave(t, c);
|
|
|
+ t->m_area->on_leave(t, c);
|
|
|
}
|
|
|
+
|
|
|
+ m_hover_list.clear(); //手动升井、自动升井清除该卡区域列表
|
|
|
}
|
|
|
|
|
|
void area_tool::set_area_info(int mapid,double scale,int areaid,const point &pt,uint64_t t,int type)
|