Browse Source

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

zzj 5 years ago
parent
commit
455d216d6c
6 changed files with 23 additions and 16 deletions
  1. 2 0
      card_base.cpp
  2. 1 0
      db/db_tool.cpp
  3. 1 0
      his_location.cpp
  4. 2 0
      module_service/module_web.cpp
  5. 1 0
      module_service/module_web.h
  6. 16 16
      websocket/ws_common.h

+ 2 - 0
card_base.cpp

@@ -99,6 +99,7 @@ void card_location_base::make_his_location(uint64_t t,const point & pt,bool bclo
 		site_id=site_ptr->m_id;
 	}
 
+    log_info("make_his_location: card_id: %d,map_id: %d,area_id: %d,site_id: %d",m_id,map_id,area_id,site_id);
 	m_his_location_card->push(t,pt,area_id,map_id,site_id,bclose);
 }
 
@@ -235,6 +236,7 @@ int  card_location_base::get_stat()
     log_info("card_lost:%03d%010d,[%lu-%lu]tlost:%lu---%s",m_type,m_id,now,m_time,tlost,tlost>CARD_LOST_TIME_OUT?"True":"False");
     if(tlost>CARD_LOST_TIME_OUT)
     {
+        // 人卡盲区: 当人卡丢失信号大于60s,判定人卡进入盲区
         return STATUS_LOST;
     }
     else if(auto ev_ptr = event_list::instance()->get_event_card(m_id, m_type, ET_CARD_HELP))

+ 1 - 0
db/db_tool.cpp

@@ -27,6 +27,7 @@ namespace db_tool
 		return std::string(sql);
 	}
 
+    // 保存考勤开始或结束数据到数据库
     void save_attendance(const std::shared_ptr<card_location_base>& card_ptr,
                          const std::shared_ptr<area_hover>& area_hover_ptr)
     {

+ 1 - 0
his_location.cpp

@@ -212,6 +212,7 @@ void location_card::push(uint64_t timestamp,const point & p,int32_t areaid,int32
         update(p,timestamp,iflag);
         //set_invalid();
         if(iflag>1){
+            m_siteid = siteid;
             set(p,timestamp);
             insert();
         }

+ 2 - 0
module_service/module_web.cpp

@@ -59,6 +59,8 @@ void module_web::accept( int ID, std::string const& name,
         else if(JSON_CMD_VALUE_CALL_CARD_CANCEL_REQUEST == cmd)//取消呼叫
         {
             module_call::instance()->accept_cancel(data_value);
+        }else if(JSON_CMD_REQ_ALL_PERSON_ON_CAR == cmd) // 所有在车上的人卡信息
+        {
         }
     }
 }

+ 1 - 0
module_service/module_web.h

@@ -50,6 +50,7 @@ public:
         MsgFuncList.insert( std::make_pair( JSON_CMD_VALUE_CALL_CARD_CANCEL_REQUEST, &module_web::accept ) );
 
         MsgFuncList.insert( std::make_pair( JSON_CMD_VALUE_CLEAR_CARD, &module_web::accept ) );//手动升井
+        MsgFuncList.insert( std::make_pair( JSON_CMD_REQ_ALL_PERSON_ON_CAR,&module_web::accept)); // 接收web端请求的在车上的人卡信息
     }
 
     /// web前端有用户登录时,反馈给web所有信息

+ 16 - 16
websocket/ws_common.h

@@ -50,22 +50,22 @@ namespace YA
 	*/
 	struct _BASE_CARD_
 	{
-		int Type;//卡类型
-		int ID;//卡ID
-		double x;//x坐标
-		double y;//y坐标
-		double z;//z坐标
-		double down_time;//入井时间戳
-		double enter_area_time;//进入区域时间戳
-		double rec_time;//最后接收时间戳
-		double work_time;//工作时长
-		int map_id;//地图编号
-		int area_id;//区域ID
-		int dept_id;//部门编号
-		int stat;//状态
-		int running_stat;//运行状态
-		int biz_stat;//业务状态
-		double speed;//速度
+		int Type;               //卡类型
+		int ID;                 //卡ID
+		double x;               //x坐标
+		double y;               //y坐标
+		double z;               //z坐标
+		double down_time;       //入井时间戳
+		double enter_area_time; //进入区域时间戳
+		double rec_time;        //最后接收时间戳
+		double work_time;       //工作时长
+		int map_id;             //地图编号
+		int area_id;            //区域ID
+		int dept_id;            //部门编号
+		int stat;               //状态
+		int running_stat;       //运行状态: 包括上猴车状态
+		int biz_stat;           //业务状态
+		double speed;           //速度
 		_BASE_CARD_()
 		{
 			Type            = 0;