Procházet zdrojové kódy

Merge branch 'master' of liulei/ya-serv into master

liheting před 6 roky
rodič
revize
d71b2587a4
5 změnil soubory, kde provedl 15 přidání a 7 odebrání
  1. 3 2
      card_base.cpp
  2. 1 1
      card_base.h
  3. 4 1
      card_person.cpp
  4. 3 2
      card_person.h
  5. 4 1
      db/db_card.cpp

+ 3 - 2
card_base.cpp

@@ -124,6 +124,7 @@ void card_location_base::put_three_rates(card_pos & cp)
 {
 	cp.rec_time=m_time;cp.type=m_type;cp.id=m_id;
 	cp.identifier_id=m_cid;cp.running_stat=m_stat;cp.final_v=m_speed;
+	cp.dpt_id = m_deptid;
 	log_info("three_rates:type:%d,id:%d,cid:%d",cp.type,cp.id,cp.identifier_id);
 	three_rates::get_instance()->put(cp);
 }
@@ -143,9 +144,9 @@ card_location_base::~card_location_base()
 }
 
 std::shared_ptr<card_location_base> card_location_base::make_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)
+		int32_t deptid,int32_t level_id,uint32_t cid,int wl,const std::string &sname,const std::string & dname,int worktype_id)
 {
-	return std::make_shared<person>(type,cardid,needdisplay,t, deptid,level_id,cid,wl,sname,dname);
+	return std::make_shared<person>(type,cardid,needdisplay,t, deptid,level_id,cid,wl,sname,dname,worktype_id);
 }
 
 std::shared_ptr<card_location_base> card_location_base::make_car(const std::string&type,uint32_t cardid,uint16_t needdisplay,int16_t t,

+ 1 - 1
card_base.h

@@ -114,7 +114,7 @@ struct card_location_base:card,std::enable_shared_from_this<card_location_base>
 	virtual ~card_location_base();
 
     static std::shared_ptr<card_location_base> make_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);
+			int32_t deptid,int32_t level_id,uint32_t cid,int wl,const std::string & sname,const std::string & dname,int worktype_id);
 
     static std::shared_ptr<card_location_base> make_car(const std::string&type,uint32_t cardid,uint16_t needdisplay,int16_t t,
 			int32_t deptid, int32_t categoryid, int type_id,int32_t level_id,uint32_t cid);

+ 4 - 1
card_person.cpp

@@ -17,11 +17,12 @@
 #include"common_tool.h"
 #include"db/db_tool.h"
 
-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)
+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)
 	,m_stafferName(sname)
 	,m_deptName(dname)
+	,m_worktype_id(worketype_id)
 {
 	m_message_handle.reset(new card_message_handle(this));
 	m_his_location_card.reset(new location_staff(m_id,m_type));
@@ -111,9 +112,11 @@ void person::handle_three_rates(const point & pt)
 {
 	card_pos cp;
 	cp.work_line=m_workLine;
+	cp.work_type_id = m_worktype_id;
 	m_biz_stat=get_stat();
 	cp.biz_stat = m_biz_stat;
 	cp.x=pt.x;cp.y=pt.y;cp.z=pt.z;
+	cp.work_type_id=m_worktype_id;
 	const auto lm = m_area_tool->getLandmark();
 //	cp.enter_time = std::get<0>(lm)*1000;
 //	cp.area_id = std::get<3>(lm);

+ 3 - 2
card_person.h

@@ -7,10 +7,11 @@
 struct person:card_location_base, card_area
 {
     std::weak_ptr<monkey_person> m_monkeyPerson;
-    int m_workLine=0;
+    int m_workLine=0;	
     time_t m_iris_recognition_timeval = 0;
     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 m_worktype_id=0;
+    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);
     ~person();
 
 

+ 4 - 1
db/db_card.cpp

@@ -183,8 +183,11 @@ namespace db_card
 			std::string dept_name;
 			DBRes.GetField( "dept_name",dept_name, Error );
 
+			int worktype_id;
+			DBRes.GetField( "worktype_id",worktype_id, Error );
+
             std::shared_ptr<card_location_base> clb =
-                    std::make_shared<person>(strategy,vsid,need_display,card_type_id,dept_id,occupation_level_id,staff_id,work_line,staffer_name,dept_name);
+                    std::make_shared<person>(strategy,vsid,need_display,card_type_id,dept_id,occupation_level_id,staff_id,work_line,staffer_name,dept_name,worktype_id);
             uint64_t cardid = tool_other::type_id_to_u64(card_type_id,vsid);
             log_info("cardId:%llu,id:%d dept_id:%d,need_display:%d,card:%s:work_line:%d,staff_id:%d,type:%d,staffer_name:%s,dept_name:%s",
                      cardid,vsid,dept_id,need_display,card_id.c_str(),work_line,staff_id,card_type_id,staffer_name.c_str(),dept_name.c_str());