派生自 development/c++

miyanhui
2019-02-13 e4c9b5bfb1d9000c08d84f2f044cd0c3605a2945
QiaoJiaSystem/StructureApp/PerimeterElement.cpp
@@ -54,6 +54,7 @@
        return;
    int num = 0;
    std::string picDate;
    std::string imgKey;
    bool state = false;
    m_recVec.clear();
@@ -70,6 +71,10 @@
            picDate = obj.properties["time"];
            // DBG("picDate="<<picDate);
        }
        if(imgKey.empty())
        {
            imgKey =obj.properties["imgKey"];
        }
        if (m_sdkRule.nSdkType == PerimeterSdk)
        {
@@ -185,7 +190,7 @@
//                return;
//            }
            std::string imgUrl = uploadImgToFdfs(image);
            saveInfoToEs(imgUrl, picDate);
            saveInfoToEs(imgUrl, picDate,imgKey);
        }
        DBG("num=" << num << " lastnum=" << mRealNum);
        mRealNum = num;
@@ -325,7 +330,7 @@
    return strImgUrl;
}
bool PerimeterElement::saveInfoToEs(const std::string &imgUrl, const std::string &time) {
bool PerimeterElement::saveInfoToEs(const std::string &imgUrl, const std::string &time,const std::string& imgKey) {
    string str_uuid;
    uuid_t t_uuid;
@@ -375,7 +380,8 @@
    t_json["videoIp"] = m_sdkRule.strAddr.toStdString();  // 设备ip
    t_json["ack_alarm"] = m_triggerElement.getTriggerState() ? "0" : "";  //  que ren shi fou bao jing
    t_json["cluster_id"] = appPref.getStringData("clusterID");; // ji qun id
    t_json["imgKey"] = imgKey;
    INFO("SaveImgKeyToES: "<<imgKey);
    bool retface = false;
    if (pManagerEsDB)
        retface = pManagerEsDB->insertData("personaction", "perVideoAction", t_json.toStyledString(), str_uuid);