|
|
@@ -2532,10 +2532,10 @@ void CResistAlarmMng::ThreadProcDevice(DWORD_PTR param)
|
|
|
{
|
|
|
//恢复报警
|
|
|
//更新数据库
|
|
|
- string recovery_time = ctAlarmTime.Format("%Y-%m-%d %H:%M:%S");
|
|
|
- CString sql;
|
|
|
- sql.Format("UPDATE [rm_alarm] SET [recovery_time]='%s' WHERE ID = %d;", recovery_time.c_str(), pAlarmInfo->id);
|
|
|
- CDBConnectPool::Instance()->DBExecuteSQL(sql);
|
|
|
+ //string recovery_time = ctAlarmTime.Format("%Y-%m-%d %H:%M:%S");
|
|
|
+ //CString sql;
|
|
|
+ //sql.Format("UPDATE [rm_alarm] SET [recovery_time]='%s' WHERE ID = %d;", recovery_time.c_str(), pAlarmInfo->id);
|
|
|
+ //CDBConnectPool::Instance()->DBExecuteSQL(sql);
|
|
|
//315上送
|
|
|
g_p315ClientManager->GetTcpClient()->SendAlarmData(pInfo->zzjno, 2, CTime(pAlarm->time).GetTime(), ctAlarmTime.GetTime(), pAlarm->type,
|
|
|
eDaoChaPosi::DCP_UNKNOWN, pAlarm->level, eLowHigh::LH_UNKNOWN, TIEDA_ACQ_VALUE(INT_MIN), TIEDA_ACQ_VALUE(INT_MIN), 0);
|
|
|
@@ -2575,41 +2575,41 @@ void CResistAlarmMng::ThreadProcDevice(DWORD_PTR param)
|
|
|
pAlarmInfo->desc = szInfo;
|
|
|
pAlarmInfo->sunroof = CSkylightMng::GetInstance()->IsSkylight(&pAlarmInfo->time);
|
|
|
lock_guard<mutex> lock(pService->m_mtxAlarm);
|
|
|
- pService->m_lstUnConfirmAlarm.push_back(pAlarmInfo);
|
|
|
+ //pService->m_lstUnConfirmAlarm.push_back(pAlarmInfo);
|
|
|
}
|
|
|
|
|
|
//send
|
|
|
- if (bNew) //不再推送
|
|
|
- {
|
|
|
- rapidjson::StringBuffer buffer;
|
|
|
- auto ret = AlarmInfo2Pack(pAlarmInfo, buffer);
|
|
|
- const char* output = buffer.GetString();
|
|
|
- //CAppService::Instance()->GetLwsServer()->SendPackToALLClient_with_noEncode((uint8_t*)output, buffer.GetLength());
|
|
|
- CAppService::Instance()->GetMgServer()->SendToAllClient(output, buffer.GetLength());
|
|
|
- }
|
|
|
+ //if (bNew) //不再推送
|
|
|
+ //{
|
|
|
+ // rapidjson::StringBuffer buffer;
|
|
|
+ // auto ret = AlarmInfo2Pack(pAlarmInfo, buffer);
|
|
|
+ // const char* output = buffer.GetString();
|
|
|
+ // //CAppService::Instance()->GetLwsServer()->SendPackToALLClient_with_noEncode((uint8_t*)output, buffer.GetLength());
|
|
|
+ // CAppService::Instance()->GetMgServer()->SendToAllClient(output, buffer.GetLength());
|
|
|
+ //}
|
|
|
|
|
|
//save
|
|
|
if (bNew)
|
|
|
{
|
|
|
- CString sql;
|
|
|
- sql.Format("INSERT INTO [rm_alarm]([ID],[mo],[mp],[no],[type],[occur_time],[level],[desc],[suggest],[val],[event_id],[rel_id],posi,loworhigh,referval,[sunroof]) "\
|
|
|
- "VALUES(%d, '%s', '%s', %d, %d, '%s', %d, '%s', '%s', %d, '%s', '%s',%d,%d,%d,%d);",
|
|
|
- pAlarmInfo->id, pAlarmInfo->mo.c_str(), pAlarmInfo->mp.c_str(), pAlarmInfo->no, pAlarmInfo->type,
|
|
|
- (LPCSTR)(ctAlarmTime.Format("%Y-%m-%d %H:%M:%S")), pAlarmInfo->level, pAlarmInfo->desc.c_str(), pAlarmInfo->suggest.c_str(), pAlarmInfo->val,
|
|
|
- pAlarmInfo->event_id.c_str(), pAlarmInfo->rel_id.c_str(), uint8_t(pAlarmInfo->posi), uint8_t(pAlarmInfo->loworhigh), pAlarmInfo->refer_val, pAlarmInfo->sunroof);
|
|
|
-
|
|
|
- if (false == CDBConnectPool::Instance()->DBExecuteSQL(sql))
|
|
|
- CSimpleLog::Error("执行语句失败" + sql);
|
|
|
- else
|
|
|
- {
|
|
|
+ //CString sql;
|
|
|
+ //sql.Format("INSERT INTO [rm_alarm]([ID],[mo],[mp],[no],[type],[occur_time],[level],[desc],[suggest],[val],[event_id],[rel_id],posi,loworhigh,referval,[sunroof]) "\
|
|
|
+ // "VALUES(%d, '%s', '%s', %d, %d, '%s', %d, '%s', '%s', %d, '%s', '%s',%d,%d,%d,%d);",
|
|
|
+ // pAlarmInfo->id, pAlarmInfo->mo.c_str(), pAlarmInfo->mp.c_str(), pAlarmInfo->no, pAlarmInfo->type,
|
|
|
+ // (LPCSTR)(ctAlarmTime.Format("%Y-%m-%d %H:%M:%S")), pAlarmInfo->level, pAlarmInfo->desc.c_str(), pAlarmInfo->suggest.c_str(), pAlarmInfo->val,
|
|
|
+ // pAlarmInfo->event_id.c_str(), pAlarmInfo->rel_id.c_str(), uint8_t(pAlarmInfo->posi), uint8_t(pAlarmInfo->loworhigh), pAlarmInfo->refer_val, pAlarmInfo->sunroof);
|
|
|
+ //
|
|
|
+ //if (false == CDBConnectPool::Instance()->DBExecuteSQL(sql))
|
|
|
+ // CSimpleLog::Error("执行语句失败" + sql);
|
|
|
+ //else
|
|
|
+ //{
|
|
|
uint8_t* pack = nullptr; int len = 0;
|
|
|
- auto packno = CResistAlarmMng::GeneralNewAlarmData(pAlarmInfo, &pack, &len);
|
|
|
- if (packno) CSuperManager::Instance()->SendPack(pack, len, packno, E_ZL_PROTOCAL::ZL_ALARM_DATA, true);
|
|
|
+ //auto packno = CResistAlarmMng::GeneralNewAlarmData(pAlarmInfo, &pack, &len);
|
|
|
+ //if (packno) CSuperManager::Instance()->SendPack(pack, len, packno, E_ZL_PROTOCAL::ZL_ALARM_DATA, true);
|
|
|
g_p315ClientManager->GetTcpClient()->SendAlarmData(pAlarmInfo->zzjno, 1, ctAlarmTime.GetTime(), 0xFFFFFFFF, pAlarmInfo->type, eDaoChaPosi::DCP_UNKNOWN, 1, eLowHigh::LH_UNKNOWN,
|
|
|
TIEDA_ACQ_VALUE(INT_MIN), TIEDA_ACQ_VALUE(INT_MIN), 0);
|
|
|
delete[] pack;
|
|
|
pack = nullptr;
|
|
|
- }
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
}
|