Prechádzať zdrojové kódy

Merge branch 'master' of http://local.beijingyongan.com:3000/linux-dev/ya-serv

liulei 5 rokov pred
rodič
commit
83a431ae09

+ 1 - 0
bindmorecard.h

@@ -369,6 +369,7 @@ struct CloserCardFactory : CardFactory
 						if(cardid == cid)
 						return true;
 						auto npcard = card_list::instance()->get(cardid);
+                        if(!npcard) return true;
 						if(npcard->type_()!=opcard->type_())
 						return true;
 						uint64_t ct1 = npcard->time_();

+ 2 - 2
cardMgr.cpp

@@ -49,8 +49,8 @@ void cardMgr::handleMessage(const Msg &m)
 {
     //更新卡位置信息
 	m_glist.update(m.x,m.y,m.cardid);
-    //排除车卡
-    if(tool_other::is_vehicle( m.type) ) return;
+    //排除车卡 目前车卡不会进来
+    //if(tool_other::is_vehicle( m.type) ) return;
     //查找该卡1个像素点内得卡号信息(有车卡)
 	std::vector<uint64_t> rc=m_glist.find_near(m.cardid,1);
     //打印找到得卡数据信息	

+ 1 - 4
card_base.cpp

@@ -18,7 +18,7 @@
 #include "common_tool.h"
 #include "ant.h"
 #include "area.h"
-#include "cardMgr.h"
+
 extern config_file config;
 card_location_base::card_location_base(const std::string&type,uint32_t id,uint16_t dis,int16_t t,int32_t deptid,int32_t level_id,uint32_t cid)
 	:card(id,dis,t,deptid,level_id,cid)
@@ -96,9 +96,6 @@ void card_location_base::on_location(const std::vector<point>&vp,const std::vect
 		x = tool_other::round(pt.x,3);
 		y = tool_other::round(pt.y,3);
 
-		Msg m;
-		m.type=m_type;m.x=(int)x;m.y=(int)y;m.cmd=CMD_HANDLE;m.cardid=m_type<<32|m_id;
-		cardMgr::instance()->tryPut(m);
 
 		double acc = lm[0].m_acc;
         m_acc = lm[0].m_acc;

+ 14 - 3
card_person.cpp

@@ -21,6 +21,7 @@
 extern config_file config;
 int person::m_limit_detained_time=-1;
 int person::m_auto_up_mine_time=-1;
+int person::m_person_cards_flag=-1;
 person::person(const std::string &type,uint32_t cardid,uint16_t needdisplay,int16_t t,int32_t deptid,int32_t level_id,uint32_t cid,int wl,const std::string &sname,const std::string &dname,int worketype_id)
 	:card_location_base(type,cardid,needdisplay,t,deptid,level_id,cid)
 	,m_workLine(wl)
@@ -31,6 +32,7 @@ person::person(const std::string &type,uint32_t cardid,uint16_t needdisplay,int1
     if(person::m_auto_up_mine_time==-1){
         person::m_limit_detained_time=config.get("service.detained_time",10);
         person::m_auto_up_mine_time=config.get("service.auto_up_mine_time",20);
+        person::m_person_cards_flag=config.get("service.person_cards_flag",0);
     }
 	m_message_handle.reset(new card_message_handle(this));
 	//m_his_location_card.reset(new location_staff(m_id,m_type,cid));
@@ -59,9 +61,11 @@ void person::clear()
         }
     }
     //清除一人多卡功能内存中的人卡相关数据,
-	Msg m;
-	m.cmd=CMD_CLEAR;m.cardid=m_type<<32|m_id;
-	cardMgr::instance()->tryPut(m);
+    if(m_person_cards_flag){
+    	Msg m;
+    	m.cmd=CMD_CLEAR;m.cardid=m_type<<32|m_id;
+    	cardMgr::instance()->tryPut(m);
+    }
 }
 
 void person::set_area_info(int mapid,double scale,int areaid,uint64_t t,int type)
@@ -107,6 +111,13 @@ void person::do_business(const std::shared_ptr<site>&site,const point &pt,double
     make_his_location(m_time,pt);
 	m_timeval=m_time;
 	handle_three_rates(pt);
+    //一人多卡数据输入
+
+    if(m_person_cards_flag){
+	    Msg m;
+	    m.type=m_type;m.x=(int)x;m.y=(int)y;m.cmd=CMD_HANDLE;m.cardid=m_type<<32|m_id;
+	    cardMgr::instance()->tryPut(m);
+    }
 }
 
 void person::reset(std::shared_ptr<monkey_person> mp)

+ 1 - 0
card_person.h

@@ -12,6 +12,7 @@ struct person:card_location_base, card_area
     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;
     std::weak_ptr<monkey_person> m_monkeyPerson;
     std::string m_stafferName,m_deptName;
     person(const std::string &type,uint32_t cardid,uint16_t needdisplay,int16_t t,int32_t deptid,int32_t level_id,uint32_t cid,int wl,const std::string &sname,const std::string &dname,int workrype_id);

+ 0 - 1
line.h

@@ -140,7 +140,6 @@ struct line_v:line//线段
 
 	line_v widen(double length) const
 	{
-		
 		point pt1(v[0].x-length*cos(),v[0].y-length*sin());
 		point pt2(v[1].x+length*cos(),v[1].y+length*sin());
 

+ 1 - 1
module_service/area_business_person_dwell_checker.cpp

@@ -44,7 +44,7 @@ void area_business_person_dwell_checker::on_hover(const std::shared_ptr<area_hov
     {
         c->set_event_flag(evType);
         uint64_t id = tool_other::type_id_to_u64(c->m_type, c->m_id);
-        event_tool::instance()->handle_event(OT_CARD,evType,id,limit_val,cur_val,true);
+        event_tool::instance()->handle_event(OT_CARD,evType,id, a->m_area->m_limit_person_min,cur_val/60,true);
     }
 
 }

+ 2 - 1
net-service.cpp

@@ -68,9 +68,10 @@ void net_service::on_message(const std::shared_ptr<client> &clt,const char*data,
 					auto site_ptr = sit_list::instance()->get(static_cast<int32_t>(site_id));
 					if(!site_ptr)
 					{
-						logn_error(1,"在全局分站列表中找不到分站:%s,%d", site_id);
+						logn_error(1,"在全局分站列表中找不到分站:%s,%d", clt->name().c_str(), site_id);
 						break;
 					}
+
                     if(site_ptr->is_abnormal_site())
                     {
 						logn_error(1,"分站[%d]天线异常", site_id);