modify ledger
This commit is contained in:
@@ -133,7 +133,6 @@ void SendJsonAPI_web(const std::string& strUrl, //接口路径
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////上传文件接口
|
||||
|
||||
//处理文件上传响应
|
||||
@@ -609,7 +608,7 @@ int terminal_ledger_web(std::map<std::string, terminal_dev>& terminal_dev_map,
|
||||
};
|
||||
dev.terminal_id = safe_str(item, "id");
|
||||
dev.addr_str = safe_str(item, "ip");
|
||||
dev.terminal_code = safe_str(item, "name");
|
||||
dev.terminal_name = safe_str(item, "name");
|
||||
dev.org_name = safe_str(item, "org_name");
|
||||
dev.maint_name = safe_str(item, "maint_name");
|
||||
dev.station_name = safe_str(item, "stationName");
|
||||
@@ -623,18 +622,26 @@ int terminal_ledger_web(std::map<std::string, terminal_dev>& terminal_dev_map,
|
||||
dev.processNo = safe_str(item, "processNo");
|
||||
dev.maxProcessNum = safe_str(item, "maxProcessNum");
|
||||
|
||||
dev.mac = safe_str(item, "mac");//添加mac
|
||||
|
||||
if (item.contains("monitorData") && item["monitorData"].is_array()) {
|
||||
for (auto& mon : item["monitorData"]) {
|
||||
if (dev.line.size() >= 10) break;
|
||||
ledger_monitor m;
|
||||
m.monitor_id = safe_str(mon, "id");
|
||||
m.terminal_code = safe_str(mon, "terminal_code");
|
||||
m.terminal_id = safe_str(mon, "terminal_id");
|
||||
m.monitor_name = safe_str(mon, "name");
|
||||
m.logical_device_seq = safe_str(mon, "lineNo");
|
||||
m.voltage_level = safe_str(mon, "voltageLevel");
|
||||
m.terminal_connect = safe_str(mon, "ptType");
|
||||
m.timestamp = safe_str(mon, "updateTime");
|
||||
m.status = safe_str(mon, "status");
|
||||
|
||||
m.CT1 = mon.value("CT1", 0.0);
|
||||
m.CT2 = mon.value("CT2", 0.0);
|
||||
m.PT1 = mon.value("PT1", 0.0);
|
||||
m.PT2 = mon.value("PT2", 0.0);
|
||||
|
||||
dev.line.push_back(m);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user