|
@@ -43,7 +43,7 @@ bool FromWebAPI::initWebApi(const QString& url,const QString& serID, const QStri
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- m_httpApi->DBInit(url.toStdString().c_str());
|
|
|
+ m_httpApi->DBInit(url.toStdString().c_str(), true);
|
|
|
// if(ret != 0)
|
|
|
// {
|
|
|
// SPDLOG_LOGGER_ERROR(m_logger,"Init WebApi failed:{}, error Info:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -52,7 +52,7 @@ bool FromWebAPI::initWebApi(const QString& url,const QString& serID, const QStri
|
|
|
// SPDLOG_LOGGER_TRACE(m_logger,"初始化WebApi成功!");
|
|
|
/* 获取服务器列表 */
|
|
|
char serverList[8192];
|
|
|
- ret = m_httpApi->DBGetServerList(serverList, 8192);
|
|
|
+ ret = m_httpApi->DBGetServerList(serverList, 8192, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"Get server list failed:{}, error info:{}",ret, m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -61,7 +61,7 @@ bool FromWebAPI::initWebApi(const QString& url,const QString& serID, const QStri
|
|
|
// SPDLOG_LOGGER_TRACE(m_logger,"Server list:{}", serverList);
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"WebAPI Load Sucess!");
|
|
|
/* 登录,第二个参数是限制的服务 */
|
|
|
- ret = m_httpApi->DBLogin(serverIP, serID, appType, m_userToken);
|
|
|
+ ret = m_httpApi->DBLogin(serverIP, serID, appType, m_userToken, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"Login failed:{}, error info:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -123,7 +123,7 @@ bool FromWebAPI::writeAlgorithmInfo(std::vector<AlgorithmInfo>& vecInfo)
|
|
|
}
|
|
|
QString retStr;
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
- int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, retStr);
|
|
|
+ int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, retStr, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"写入tAction失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -172,7 +172,7 @@ bool FromWebAPI::deleteAlgorithmInfo(std::vector<AlgorithmInfo>& vecDeleteInfo)
|
|
|
}
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"删除tAction失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -211,7 +211,7 @@ bool FromWebAPI::getAlgorithmInfo(std::vector<AlgorithmInfo>& vecInfo)
|
|
|
json0["opName"] = "SPSS_SelectFromAction";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取tAction失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -295,7 +295,7 @@ bool FromWebAPI::insertDeviceInfo(std::vector<DeviceInfo>& vecInfo)
|
|
|
}
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"插入设备信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -323,7 +323,7 @@ bool FromWebAPI::insertDeviceInfo(std::vector<DeviceInfo>& vecInfo)
|
|
|
// strRet.clear();
|
|
|
// ret = 0;
|
|
|
// strCmd = QString::fromStdString(json0.dump());
|
|
|
- // ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Insert, strCmd, strRet);
|
|
|
+ // ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Insert, strCmd, strRet, true);
|
|
|
// if(ret != 0)
|
|
|
// {
|
|
|
// SPDLOG_LOGGER_DEBUG(m_logger,"插入设备信息到tActionCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -388,7 +388,7 @@ bool FromWebAPI::updateDeviceInfo(std::vector<DeviceInfo>& vecUpdateInfo)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"更新设备信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -445,7 +445,7 @@ bool FromWebAPI::deleteDeviceInfo(std::vector<DeviceInfo>& vecDeleteInfo)
|
|
|
}
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"删除tCamerinfo设备信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -483,7 +483,7 @@ bool FromWebAPI::getDeviceInfo(std::vector<DeviceInfo>& vecInfo)
|
|
|
json0["opName"] = "SPSS_SelectFromCamerInfo";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取CamerInfo失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -551,7 +551,7 @@ bool FromWebAPI::getChannelInfo(std::map<int, std::string>& mapChannelName)
|
|
|
json0["opName"] = "SPSS_SelectChannelInfo";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取通道信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -606,7 +606,7 @@ std::string FromWebAPI::getChannelInfo(int chnID)
|
|
|
json0["opName"] = "SPSS_SelectChannelInfo";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取通道信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -665,7 +665,7 @@ bool FromWebAPI::getCameraInfo(std::map<int, std::string>& mapCameraName)
|
|
|
json0["opName"] = "SPSS_SelectCameraInfo";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取通道信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -738,7 +738,7 @@ bool FromWebAPI::insertDeviceAlgorithmInfo(std::vector<DeviceInfo>& vecInfo)
|
|
|
}
|
|
|
QString strRet;
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
- int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"插入设备信息到tActionCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -797,7 +797,7 @@ bool FromWebAPI::updateDeviceAlgorithmInfo(std::vector<DeviceInfo>& vecInfo)
|
|
|
}
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"插入设备信息到tActionCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -850,7 +850,7 @@ bool FromWebAPI::deleteDeviceAlgorithmInfo(std::vector<DeviceInfo>& vecInfo)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"删除设备信息到tActionCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -904,7 +904,7 @@ bool FromWebAPI::deleteDeviceAlgorithmInfo(std::list<int>& vecID)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_ERROR(m_logger,"删除设备信息到tActionCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -949,7 +949,7 @@ bool FromWebAPI::getDeviceAlgorithmInfo(std::vector<DeviceInfo>& vecInfo, std::l
|
|
|
json0["opName"] = "SPSS_SelectFromActionCamer";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取ActionCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1047,7 +1047,7 @@ bool FromWebAPI::getActionInfo(ListActionInfo& listInfo)
|
|
|
json0["opName"] = "SPSS_SelectFromActionInfo";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取ActionCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1113,7 +1113,7 @@ bool FromWebAPI::getRoomCameraInfo(std::list<RoomCameraInfo>& vecInfo)
|
|
|
json0["opName"] = "SPSS_SelectRoomCamer";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取RoomCamer失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1200,7 +1200,7 @@ bool FromWebAPI::getFuncDetectTime(int ChannelID, AppFunction app, DetectPeriodI
|
|
|
json0["paramList"] = json1;
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger,"获取Period信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1276,7 +1276,7 @@ bool FromWebAPI::insertAlarmInfo(const AlarmInfo& alarmInfo, int& PKID)
|
|
|
return false;
|
|
|
}
|
|
|
/* 判断是否有图片,没有图片就取消报警 */
|
|
|
- if(alarmInfo.PicUrl.empty())
|
|
|
+ if(alarmInfo.ImageInfo.empty())
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger, "× 取消新增报警信息,因为没有图片,频道[{}],房间[{}],摄像头[{}],{},{},有{}个区域,有{}个人脸",
|
|
|
alarmInfo.ChannelID, alarmInfo.RoomID, alarmInfo.DeviceID, alarmInfo.ActionDes, alarmInfo.ImageInfo, alarmInfo.listBbox.size(), alarmInfo.listPersonInfo.size());
|
|
@@ -1299,11 +1299,17 @@ bool FromWebAPI::insertAlarmInfo(const AlarmInfo& alarmInfo, int& PKID)
|
|
|
json0["opName"] = "SPSS_InsertToAlarm";
|
|
|
nJson json1;
|
|
|
json1["alarmID"] = alarmInfo.AlarmID;
|
|
|
- json1["startTime"] = alarmInfo.StartTime.empty() ? "" : alarmInfo.StartTime;
|
|
|
- json1["createTime"] = alarmInfo.EventTime.empty() ? "" : alarmInfo.EventTime;
|
|
|
- json1["endTime"] = alarmInfo.EndTime;
|
|
|
+ json1["startTime"] = alarmInfo.StartTime.toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString();
|
|
|
+ json1["createTime"] = alarmInfo.EventTime.toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString();
|
|
|
+ std::string strEndTime = "";
|
|
|
+ /* 这里判断一下结束时间是否需要设置,如果不需要,则设置成小于2020年即可,写入数据库就是空 */
|
|
|
+ if(alarmInfo.EndTime > QDateTime::fromString("2020-01-01 00:00:00", "yyyy-MM-dd hh:mm:ss"))
|
|
|
+ {
|
|
|
+ strEndTime = alarmInfo.EndTime.toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString();
|
|
|
+ }
|
|
|
+ json1["endTime"] = strEndTime;
|
|
|
json1["bbox"] = strBbox;
|
|
|
- json1["picUrl"] = alarmInfo.PicUrl;
|
|
|
+ json1["picUrl"] = alarmInfo.ImageInfo;
|
|
|
json1["appID"] = getAppFunctionID(alarmInfo.appFunction);
|
|
|
json1["actionID"] = alarmInfo.ActionID;
|
|
|
json1["actionDes"] = alarmInfo.ActionDes;
|
|
@@ -1319,7 +1325,7 @@ bool FromWebAPI::insertAlarmInfo(const AlarmInfo& alarmInfo, int& PKID)
|
|
|
// SPDLOG_LOGGER_DEBUG(m_logger, "写入报警信息的字符串:{}\n", json0.dump(4));
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Insert, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Insert, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger,"插入报警信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1370,11 +1376,11 @@ void FromWebAPI::printAlarmInfo(const AlarmInfo& alarmInfo, std::string strBBox)
|
|
|
std::string strLog;
|
|
|
strLog += "写入报警信息:\n";
|
|
|
strLog += fmt::format("alarmID: {}\n", alarmInfo.AlarmID);
|
|
|
- strLog += fmt::format("startTime: {}\n", alarmInfo.StartTime);
|
|
|
- strLog += fmt::format("createTime: {}\n", alarmInfo.EventTime);
|
|
|
- strLog += fmt::format("endTime: {}\n", alarmInfo.EndTime);
|
|
|
+ strLog += fmt::format("startTime: {}\n", alarmInfo.StartTime.toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString());
|
|
|
+ strLog += fmt::format("createTime: {}\n", alarmInfo.EventTime.toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString());
|
|
|
+ strLog += fmt::format("endTime: {}\n", alarmInfo.EndTime.toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString());
|
|
|
strLog += fmt::format("bbox: {}\n", strBBox);
|
|
|
- strLog += fmt::format("picUrl: {}\n", alarmInfo.PicUrl);
|
|
|
+ strLog += fmt::format("picUrl: {}\n", alarmInfo.ImageInfo);
|
|
|
strLog += fmt::format("appID: {}\n", getAppFunctionID(alarmInfo.appFunction));
|
|
|
strLog += fmt::format("actionID: {}\n", alarmInfo.ActionID);
|
|
|
strLog += fmt::format("actionDes: {}\n", alarmInfo.ActionDes);
|
|
@@ -1401,7 +1407,7 @@ bool FromWebAPI::updateAlarmEndTime(const AlarmInfo& alarmInfo)
|
|
|
nJson json0;
|
|
|
json0["opName"] = "SPSS_UpdateAlarmEndTime";
|
|
|
nJson json1;
|
|
|
- json1["EndTime"] = alarmInfo.EndTime;
|
|
|
+ json1["EndTime"] = alarmInfo.EndTime.toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString();
|
|
|
json1["ChannelID"] = alarmInfo.ChannelID;
|
|
|
json1["RoomID"] = alarmInfo.RoomID;
|
|
|
json1["CamerID"] = alarmInfo.DeviceID;
|
|
@@ -1410,7 +1416,7 @@ bool FromWebAPI::updateAlarmEndTime(const AlarmInfo& alarmInfo)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet);
|
|
|
+ int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger,"更新报警结束时间失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1458,7 +1464,7 @@ bool FromWebAPI::endAlarmInfoByPKID(const int PKID, const QDateTime dateTime)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet);
|
|
|
+ int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger,"更新报警结束时间失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1505,7 +1511,7 @@ bool FromWebAPI::updatePersonInfo(RoomOnWorkInfo& roomInfo)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet);
|
|
|
+ int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger,"更新报警结束时间失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1548,7 +1554,7 @@ bool FromWebAPI::getMaxAlarmPKID(const int ChannelID, const AppFunction AppID, i
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取Alarma max PKID失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1609,7 +1615,7 @@ bool FromWebAPI::clearOnWorkAlarmInfo(const int PKID, const bool onWork, const s
|
|
|
json0["paramList"] = json1;
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"清空在岗离岗报警的在岗人员信息失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1634,7 +1640,7 @@ bool FromWebAPI::getPersonCountRuleInfo(std::list<PersonCountRuleInfo>& list)
|
|
|
json0["opName"] = "SPSS_GetPersonCountRule";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取AlarmRule失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1696,13 +1702,13 @@ bool FromWebAPI::getPersonCountRuleInfo(std::list<PersonCountRuleInfo>& list)
|
|
|
}
|
|
|
|
|
|
/* 获取报警时段,也同时获取报警的应用信息,tPeriod表 */
|
|
|
-bool FromWebAPI::getAlarmAppInfo(std::list<AppAndTimeInfo>& listInfo)
|
|
|
+bool FromWebAPI::getAlarmAppInfo(std::list<ChannelAppInfo>& listInfo)
|
|
|
{
|
|
|
nJson json0;
|
|
|
- json0["opName"] = "SPSS_SelectPeriod";
|
|
|
+ json0["opName"] = "SPSS_SelectChannelApp";
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_DEBUG(m_logger,"获取AlarmApp失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1725,13 +1731,11 @@ bool FromWebAPI::getAlarmAppInfo(std::list<AppAndTimeInfo>& listInfo)
|
|
|
listInfo.clear();
|
|
|
for(const auto& it : result)
|
|
|
{
|
|
|
- AppAndTimeInfo info;
|
|
|
+ ChannelAppInfo info;
|
|
|
info.ChannelID = it["chnId"].get<int>();
|
|
|
info.AppType = it["appType"].get<int>();
|
|
|
- QString strStart = QString::fromStdString(it["startTime"].get<std::string>());
|
|
|
- QString strEnd = QString::fromStdString(it["endTime"].get<std::string>());
|
|
|
- info.StartTime = QDateTime::fromString(strStart, "yyyy-MM-ss hh:mm:ss");
|
|
|
- info.EndTime = QDateTime::fromString(strEnd, "yyyy-MM-ss hh:mm:ss");
|
|
|
+ info.strChannelName = it["chnName"].is_null() ? "" : it["chnName"].get<std::string>();
|
|
|
+ info.strAppName = it["appName"].is_null() ? "" : it["appName"].get<std::string>();
|
|
|
|
|
|
listInfo.push_back(info);
|
|
|
}
|
|
@@ -1774,7 +1778,7 @@ bool FromWebAPI::endPersonCountAlarm(int chnID, AppFunction appID)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet);
|
|
|
+ int ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Update, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger,"结束人员计数报警失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|
|
@@ -1840,7 +1844,7 @@ bool FromWebAPI::insertOnWorkInfo(const RoomFaceInfo& onWorkInfo)
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Insert, strCmd, strRet);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Insert, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
SPDLOG_LOGGER_WARN(m_logger,"插入 tWorkOnInfo 失败:{}, 错误信息:{}",ret,m_httpApi->DoGetLastError(&ret).toStdString());
|