diff --git a/ServerLMS/Systems/Parsers/processparser.cpp b/ServerLMS/Systems/Parsers/processparser.cpp index fd76e0d..7b46ac3 100644 --- a/ServerLMS/Systems/Parsers/processparser.cpp +++ b/ServerLMS/Systems/Parsers/processparser.cpp @@ -162,19 +162,53 @@ void ProcessParser::clientUnityTaskFIMreport(QXmlStreamReader &xmlReader, Client task.title = taskNode.toElement().attribute("title"); 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"); task.malfunctionList.append(malfunction); + */ } + else + if(malfOrReportNode.nodeName() == "report") + {//Отчет + FIMReport report; + report.id = 0; //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 = 0; //reportItemNode.toElement().attribute("item_id").toInt(); + reportItem.text = reportItemNode.toElement().attribute("text"); + + if(reportItemNode.childNodes().count()) + { + QDomNode procedureIDNode = reportItemNode.childNodes().at(0); + reportItem.procedure.doc = procedureIDNode.toElement().attribute("doc"); + reportItem.procedure.title = procedureIDNode.toElement().attribute("title"); + reportItem.procedure.dmCode = procedureIDNode.toElement().attribute("dmCode"); + reportItem.procedure.result = procedureIDNode.toElement().attribute("result"); + } + + report.itemList.append(reportItem); + } + } + + task.report = report; + } } + /* //TODO -------------- (!Заглушка!) Отчет о выполнении FIMReport report; @@ -202,6 +236,7 @@ void ProcessParser::clientUnityTaskFIMreport(QXmlStreamReader &xmlReader, Client task.report = report; //----------------- + */ listTasks.append(task);