Реализована передача репортов вместе с задачами

This commit is contained in:
2025-05-22 12:30:29 +03:00
parent 2b0e7c67d7
commit ab05d1fa61
4 changed files with 113 additions and 7 deletions

View File

@@ -693,17 +693,41 @@ void RecognizeSystem::xmlParserQueryToDB(PacketType packetType, QByteArray array
task.status = taskNode.toElement().attribute("status");
for(int j = 0; j < taskNode.childNodes().count(); j++)
{//Неисправности
QDomNode malfunctionNode = taskNode.childNodes().at(j);
if(malfunctionNode.nodeName() == "malfunction")
{
{
QDomNode malfOrReportNode = taskNode.childNodes().at(j);
if(malfOrReportNode.nodeName() == "malfunction")
{//Неисправность
Malfunction malfunction;
malfunction.num = malfunctionNode.toElement().attribute("num");
malfunction.dmCode = malfunctionNode.toElement().attribute("dmCode");
malfunction.description = malfunctionNode.toElement().attribute("description");
malfunction.num = malfOrReportNode.toElement().attribute("num");
malfunction.dmCode = malfOrReportNode.toElement().attribute("dmCode");
malfunction.description = malfOrReportNode.toElement().attribute("description");
task.malfunctionList.append(malfunction);
}
else
if(malfOrReportNode.nodeName() == "report")
{//Отчет
FIMReport report;
report.id = malfOrReportNode.toElement().attribute("report_id").toInt();
for(int k = 0; k < malfOrReportNode.childNodes().count(); k++)
{
QDomNode reportItemNode = malfOrReportNode.childNodes().at(k);
if(reportItemNode.nodeName() == "reportItem")
{
FIMReportItem reportItem;
reportItem.id = reportItemNode.toElement().attribute("item_id").toInt();
reportItem.text = reportItemNode.toElement().attribute("text");
reportItem.procedure.title = reportItemNode.toElement().attribute("title");
reportItem.procedure.dmCode = reportItemNode.toElement().attribute("dmCode");
reportItem.procedure.result = reportItemNode.toElement().attribute("result");
report.itemList.append(reportItem);
}
}
task.report = report;
}
}
listTasks.append(task);