fix devname bug

This commit is contained in:
lnk
2026-01-08 16:51:08 +08:00
parent d18eb0d157
commit c538161074
2 changed files with 5 additions and 4 deletions

View File

@@ -5813,8 +5813,7 @@ void on_device_response_minimal(int response_code,
<< " " << front.StartTime << "~" << front.EndTime
<< " rc=" << response_code << " recall_status=" << front.recall_status << std::endl; //错误响应码
//记录日志
DIY_ERRORLOG_CODE(matched_monitor->monitor_id.c_str(),2,static_cast<int>(LogCode::LOG_CODE_RECALL),"监测点:%s 补招数据失败 - 失败时间点:%s 至 %s",matched_monitor->monitor_id.c_str(),front.StartTime.c_str(),front.EndTime.c_str());
}
else { //补招失败
front.recall_status = static_cast<int>(RecallStatus::FAILED);
@@ -5824,7 +5823,7 @@ void on_device_response_minimal(int response_code,
<< " rc=" << response_code << " recall_status=" << front.recall_status<< std::endl; //错误响应码
//记录日志
DIY_ERRORLOG_CODE(matched_monitor->monitor_id.c_str(),2,static_cast<int>(LogCode::LOG_CODE_RECALL),"监测点:%s 补招数据失败 - 失败时间点:%s 至 %s",matched_monitor->monitor_id.c_str(),front.StartTime.c_str(),front.EndTime.c_str());
DIY_ERRORLOG_CODE(matched_monitor->monitor_id.c_str(),2,static_cast<int>(LogCode::LOG_CODE_RECALL),"监测点:%s 补招数据失败 - 失败时间点:%s 至 %s",matched_monitor->monitor_name.c_str(),front.StartTime.c_str(),front.EndTime.c_str());
}
updated = true;
} else { //首条不是 RUNNING 状态,不应该收到这条响应

View File

@@ -1043,7 +1043,7 @@ rocketmq::ConsumeStatus myMessageCallbackrtdata(const rocketmq::MQMessageExt& ms
int limit = 0;
int idx = 0;
get_terminal_name_by_terminal_id(devid, devname);
if (!parseJsonMessageRT(body, devid, line, realData, soeData, limit,idx)) {
std::cerr << "Failed to parse the JSON message." << std::endl;
@@ -1051,6 +1051,8 @@ rocketmq::ConsumeStatus myMessageCallbackrtdata(const rocketmq::MQMessageExt& ms
return rocketmq::RECONSUME_LATER;
}
get_terminal_name_by_terminal_id(devid, devname);
// 加锁访问台账
if( !devid.empty() && line > 0){
//不再使用文件触发方式,直接调用接口向终端发起请求