From 118d5304c8744a3cb533164af6fbdc91229d6f3d Mon Sep 17 00:00:00 2001 From: xuxiuxi <554325746@qq.com> Date: 星期五, 08 三月 2019 16:25:06 +0800 Subject: [PATCH] cam_dev add type code --- QiaoJiaSystem/VideoServer/QiaoJia/DB/DBStruct.h | 2 ++ QiaoJiaSystem/DataManagerServer/http_configserver.cpp | 2 +- QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp | 2 +- QiaoJiaSystem/DataManagerServer/vss/controller/CamDevController.h | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp index f93e4e0..35bb566 100644 --- a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp +++ b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp @@ -1052,7 +1052,7 @@ if ((!ret) || (serialnumber[0] == 0)) { return "{\"ret_status\": \"鍐呭鏈夎锛岃妫�鏌ワ紒\"}"; } - + rec.type = 0; rec.str_cam_dev_id = QString::fromLatin1((const char *) serialnumber);//鎽勫儚鏈篿d cam_mac rec.str_name = QString::fromStdString(value["str_name"].asString()); rec.str_addr = QString::fromStdString(value["str_addr"].asString()); diff --git a/QiaoJiaSystem/DataManagerServer/vss/controller/CamDevController.h b/QiaoJiaSystem/DataManagerServer/vss/controller/CamDevController.h index a8675c4..8923fdb 100755 --- a/QiaoJiaSystem/DataManagerServer/vss/controller/CamDevController.h +++ b/QiaoJiaSystem/DataManagerServer/vss/controller/CamDevController.h @@ -128,6 +128,8 @@ Json::Value typeJsonValue = requestJsonValue[CamDev_type]; if (typeJsonValue.type() != Json::ValueType::nullValue) { camDevBuilder.addtype((typeJsonValue.asString())); + } else { + camDevBuilder.addtype("1"); } auto keyValuesToAdd = camDevBuilder.buildCamDevMap(); if (keyValuesToAdd.size() > 0) { @@ -309,6 +311,8 @@ Json::Value typeJsonValue = requestJsonValue[CamDev_type]; if (typeJsonValue.type() != Json::ValueType::nullValue) { camDevBuilder.addtype((typeJsonValue.asString())); + } else { + camDevBuilder.addtype("1"); } responseJsonValue["message"] = "鏌ヨ鎴愬姛锛�"; responseJsonValue["success"] = "true"; @@ -390,6 +394,8 @@ Json::Value typeJsonValue = requestJsonValue[CamDev_type]; if (typeJsonValue.type() != Json::ValueType::nullValue) { camDevBuilder.addtype((typeJsonValue.asString())); + } else { + camDevBuilder.addtype("1"); } responseJsonValue["message"] = "鏌ヨ鎴愬姛锛�"; responseJsonValue["success"] = "true"; diff --git a/QiaoJiaSystem/VideoServer/QiaoJia/DB/DBStruct.h b/QiaoJiaSystem/VideoServer/QiaoJia/DB/DBStruct.h index 0ae7935..44e7822 100644 --- a/QiaoJiaSystem/VideoServer/QiaoJia/DB/DBStruct.h +++ b/QiaoJiaSystem/VideoServer/QiaoJia/DB/DBStruct.h @@ -61,6 +61,7 @@ str_brand = ""; str_reserved = ""; n_type = -1; + type = -1; } int n_id;//鑷id @@ -76,6 +77,7 @@ QString str_brand;//鎽勫儚鏈哄搧鐗� QString str_reserved;//棰勭暀 int n_type;//棰勭暀 + int type;// 0 rtsp, 1 gb28181 }; struct Record_Cam_Chn { diff --git a/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp b/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp index 8070b13..031e039 100644 --- a/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp +++ b/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp @@ -500,7 +500,7 @@ std::list<Record_Cam_Dev> lst; QSqlTableModel pModel(NULL, m_db); pModel.setTable("cam_dev"); - pModel.setFilter(QObject::tr("cam_dev_id != '' and cam_dev_id is not null")); + pModel.setFilter(QObject::tr("cam_dev_id != '' and cam_dev_id is not null and type='0'")); pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange pModel.select(); -- Gitblit v1.8.0