mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Статусы задач обновляются, но автоматически в ГУИ пока нет
This commit is contained in:
@@ -63,6 +63,22 @@ void ProcessParser::read(ClientHandler *client, QByteArray array)
|
||||
{
|
||||
clientDataInfo(xmlReader,client);
|
||||
}
|
||||
else if(xmlReader.name() == "ListTasksAMM")
|
||||
{
|
||||
//TODO
|
||||
if(client->getClient()->getIsUnity())
|
||||
{//Отчет по задаче АММ от Юнити-клиента
|
||||
clientUnityTaskAMMreport(xmlReader,client, array);
|
||||
}
|
||||
}
|
||||
else if(xmlReader.name() == "ListTasksFIM")
|
||||
{
|
||||
//TODO
|
||||
if(client->getClient()->getIsUnity())
|
||||
{//Отчет по задаче FIM от Юнити-клиента
|
||||
clientUnityTaskFIMreport(xmlReader,client, array);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
emit sigLogMessage("XmlParser: unrecognized tag");
|
||||
@@ -93,6 +109,85 @@ void ProcessParser::clientDataInfo(QXmlStreamReader &xmlReader,ClientHandler *cl
|
||||
|
||||
}
|
||||
|
||||
void ProcessParser::clientUnityTaskAMMreport(QXmlStreamReader &xmlReader, ClientHandler *client, QByteArray array)
|
||||
{
|
||||
QDomDocument commonDOM;
|
||||
commonDOM.setContent(array);
|
||||
|
||||
QList<TaskAmmFim> listTasks;
|
||||
int trainee_id = 0;
|
||||
QDomNode listNode = commonDOM.namedItem("ListTasksAMM");
|
||||
trainee_id = listNode.toElement().attribute("trainee_id").toInt();
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode taskNode = listNode.childNodes().at(i);
|
||||
if(taskNode.nodeName() == "taskAMM")
|
||||
{//Задача
|
||||
TaskAmmFim task;
|
||||
task.setID(taskNode.toElement().attribute("task_id").toInt());
|
||||
task.ammProcedure.title = taskNode.toElement().attribute("title");
|
||||
task.ammProcedure.dmCode = taskNode.toElement().attribute("dmCode");
|
||||
task.status = taskNode.toElement().attribute("status");
|
||||
|
||||
listTasks.append(task);
|
||||
|
||||
//Изменение задачи
|
||||
void* data = nullptr;
|
||||
data = &task;
|
||||
ClientQueryToDB queryToDB;
|
||||
queryToDB.typeQuery = TypeQueryToDB::TYPE_QUERY_EDIT_TASK_AMM_TO_TRAINEE;
|
||||
processingSystem->processingClientQueryToDB(client, queryToDB, trainee_id, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessParser::clientUnityTaskFIMreport(QXmlStreamReader &xmlReader, ClientHandler *client, QByteArray array)
|
||||
{
|
||||
QDomDocument commonDOM;
|
||||
commonDOM.setContent(array);
|
||||
|
||||
QList<TaskAmmFim> listTasks;
|
||||
int trainee_id = 0;
|
||||
QDomNode listNode = commonDOM.namedItem("ListTasksFIM");
|
||||
trainee_id = listNode.toElement().attribute("trainee_id").toInt();
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{//Задачи
|
||||
QDomNode taskNode = listNode.childNodes().at(i);
|
||||
if(taskNode.nodeName() == "taskFIM")
|
||||
{
|
||||
TaskAmmFim task;
|
||||
task.setID(taskNode.toElement().attribute("task_id").toInt());
|
||||
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")
|
||||
{
|
||||
Malfunction malfunction;
|
||||
malfunction.num = malfunctionNode.toElement().attribute("num");
|
||||
malfunction.dmCode = malfunctionNode.toElement().attribute("dmCode");
|
||||
malfunction.description = malfunctionNode.toElement().attribute("description");
|
||||
|
||||
task.malfunctionList.append(malfunction);
|
||||
}
|
||||
}
|
||||
|
||||
listTasks.append(task);
|
||||
|
||||
//Изменение задачи
|
||||
void* data = nullptr;
|
||||
data = &task;
|
||||
ClientQueryToDB queryToDB;
|
||||
queryToDB.typeQuery = TypeQueryToDB::TYPE_QUERY_EDIT_TASK_FIM_TO_TRAINEE;
|
||||
processingSystem->processingClientQueryToDB(client, queryToDB, trainee_id, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TaskAmmFim ProcessParser::xmlParserQueryToDB_ASSIGN_TASK_FIM_TO_TRAINEE(QByteArray array)
|
||||
{
|
||||
TaskAmmFim task;
|
||||
|
||||
Reference in New Issue
Block a user