From 139dff28a5fe110d848b77fbbfe041ed9af42aa4 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期二, 16 四月 2019 21:53:54 +0800
Subject: [PATCH] 修改查找视频

---
 QiaoJiaSystem/DataManagerServer/http_configserver.cpp |   28 +++++++++++--
 QiaoJiaSystem/DataManagerServer/http_configserver.h   |   78 ++++++++++++++++++++++++++++++++++++++-
 QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.h    |    8 ++++
 3 files changed, 107 insertions(+), 7 deletions(-)

diff --git a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
index 85d8485..691641e 100644
--- a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
+++ b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
@@ -1763,6 +1763,13 @@
     return out;
 }
 
+//{
+//	"cookie": "abc",                        //闆嗙兢cookie
+//	"fatherNodeName": "main@192.168.1.186", //寮曞鑺傜偣鍚嶇О,娣诲姞寮曞鑺傜偣鏃惰鍊间负" "(鍐呬负绌烘牸)
+//	"culID" : "uuid",                       //闆嗙兢id
+//	"culName" : "name",                     //闆嗙兢鍚嶇О
+//	"devID" : "uuid"                        //璁惧id
+//}
 std::string devHttpServer_c::addNode(std::string ip, unsigned int port, std::string content, PResponse &response) {
     DBG("ip:" << ip << "; port:" << port);
     DBG("content: " << content);
@@ -2030,9 +2037,7 @@
         fieldValues.insert(std::make_pair("bwType", BwType));
         fieldValues.insert(std::make_pair("startTime", StartTime));
         fieldValues.insert(std::make_pair("endTime", EndTime));
-//        #todo
         fieldValues.insert(std::make_pair("create_by", createBy));
-
         fieldValues.insert(std::make_pair("uploadFlag", UploadFlag));
         fieldValues.insert(std::make_pair("cmpThreshold", CmpThreshold));
         fieldValues.insert(std::make_pair("enabled", Enabled));
@@ -2056,7 +2061,6 @@
             response->write(SimpleWeb::StatusCode::server_error_not_implemented, "{\"error\":\"绫诲瀷閿欒锛屾湭璇嗗埆锛� \"}");
             return "";
         }
-
 
 ////            #todo 涓婁紶銆備粎榛戝悕鍗曘��
 ////            #TODO 鏍规嵁createBy鍒ゆ柇鏄惁闇�瑕佷笂浼�
@@ -2138,9 +2142,12 @@
 //        auto resType = erlangDbTool->findAllTypeInfo();
         string json = "[";
         for (auto &item : resDB) {
+            //-------------------maybe delete ?------------------------
             if (item.second.tableName.find("lt_") == 0) {
                 continue;
             }
+            //-------------------maybe delete end----------------------
+
             string subJson = "{ ";
             subJson.append("\"uuid\":\"" + item.second.uuid + "\",");
             subJson.append("\"tableName\":\"" + item.second.tableName + "\",");
@@ -3025,8 +3032,19 @@
         }
     }
 
-    if (videoStVec.size() >= 1) {
-        std::string strVideoName = strPath + videoStVec[0].ToVideoName();
+    std::vector<VideoName_s_t> videoStVec_;
+    auto imgTm_ = AppUtil::ParseFromHypenTimeStr(imgSt.m_timeStamp);
+    for (auto &item : videoStVec) {
+        auto resTime_ = AppUtil::ParseFromHypenTimeStr(item.m_timeStamp);
+        auto timeRes = difftime(mktime(&resTime_), mktime(&imgTm_));
+        if ((timeRes < 0 && difftime(mktime(&imgTm_), mktime(&resTime_)) >= 30) || (timeRes / 60 >= 3)) {
+            continue;
+        }
+        videoStVec_.emplace_back(item);
+    }
+
+    if (videoStVec_.size() >= 1) {
+        std::string strVideoName = strPath + videoStVec_[0].ToVideoName();
         INFO("ImageName: " << imgKey << "  SingleMatchVideo: " << strVideoName);
         return strVideoName;
     } else {
diff --git a/QiaoJiaSystem/DataManagerServer/http_configserver.h b/QiaoJiaSystem/DataManagerServer/http_configserver.h
index 00fff1c..98399e4 100644
--- a/QiaoJiaSystem/DataManagerServer/http_configserver.h
+++ b/QiaoJiaSystem/DataManagerServer/http_configserver.h
@@ -121,7 +121,7 @@
     std::string createDatabase(std::string ip, unsigned int port, std::string content, PResponse &response);
 
     /**
-     *
+     * 鍒犻櫎鏁版嵁 搴曞簱
      * @param ip
      * @param port
      * @param content
@@ -130,23 +130,97 @@
      */
     std::string deleteDatabase(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    /***
+     * 鏇存柊鏁版嵁 搴曞簱
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string updateDatabase(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    /**
+     * 鏌ヨ鎵�鏈夊悓姝ュ簱
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string findAllDatabase(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    /**
+     * 鏌ヨ鎵�鏈夋湰鍦板簱
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string findLocalDatabase(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    /***
+     * 涓婁紶浜哄憳
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string addPerson(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    //#todo 鎵归噺娣诲姞浜哄憳鍊熷彛
+
+    /***
+     * 鍚戝悓姝ュ簱鎵归噺娣诲姞浜哄憳鍙婃洿鏂颁汉鍛�
+     * feature_addPersonTracking 鍒嗘敮涓洿鏂板姛鑳藉垎绂讳负鏂板�熷彛
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string addPersons(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    /***
+     * 鍒ゆ柇鍚屾搴撲腑浜哄憳鏄惁瀛樺湪
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string personIsExists(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    /**
+     * 鏇存柊鍚屾搴撲腑鐨勪汉鍛�
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string updatePersonByOldId(std::string ip, unsigned int port, std::string content, PResponse &response);
 
-
+    /**
+     * 鍒犻櫎浜哄憳
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string delPerson(std::string ip, unsigned int port, std::string content, PResponse &response);
 
+    /**
+     * 鍔犺浇鐗瑰緛
+     * @param ip
+     * @param port
+     * @param content
+     * @param response
+     * @return
+     */
     std::string loadFaceFeaData(std::string ip, unsigned int port, std::string content, PResponse &response);
 
 
diff --git a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.h b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.h
index 09dfe1a..fed2cdb 100644
--- a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.h
+++ b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.h
@@ -10,6 +10,10 @@
     ~FaceDetectServerI();
     // FaceDetectServer interface
 public:
+    /**
+     * 浜鸿劯妫�娴�
+     * @return
+     */
     virtual FaceDetect::Faces faceDetect(Ice::Int, Ice::Int, const std::string &, const Ice::Current &) override;
 
 private:
@@ -19,6 +23,10 @@
 
     // FaceDetectServer interface
 public:
+    /**
+     * 浜鸿劯浜屾灞炴�ф彁鍙�
+     * @return
+     */
     virtual FaceDetect::ThftResult faceProperty(Ice::Int, Ice::Int, const FaceDetect::FacePos &, const std::string &, const Ice::Current &) override;
 
 private:

--
Gitblit v1.8.0