mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
taskFIM записывается в базу с Malfunction
This commit is contained in:
@@ -42,7 +42,7 @@ void ProcessParser::read(ClientHandler *client, QByteArray array)
|
||||
else if(xmlReader.name() == "QueryToDB")
|
||||
{//Запрос к базе данных от клиента
|
||||
|
||||
queryToDb(xmlReader,client);
|
||||
queryToDb(xmlReader,client, array);
|
||||
}
|
||||
else if(xmlReader.name() == "QueryTasksXML")
|
||||
{//Запрос файла XML с задачами
|
||||
@@ -92,6 +92,36 @@ void ProcessParser::clientDataInfo(QXmlStreamReader &xmlReader,ClientHandler *cl
|
||||
processingSystem->setCurrentDataInfo(dataInfo);
|
||||
|
||||
}
|
||||
|
||||
TaskAmmFim ProcessParser::xmlParserQueryToDB_ASSIGN_TASK_FIM_TO_TRAINEE(QByteArray array)
|
||||
{
|
||||
TaskAmmFim task;
|
||||
|
||||
QDomDocument commonDOM;
|
||||
commonDOM.setContent(array);
|
||||
|
||||
QDomNode mainNode = commonDOM.namedItem("QueryToDB");
|
||||
|
||||
task.title = mainNode.toElement().attribute("title");
|
||||
|
||||
for(int i = 0; i < mainNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode malfunctionNode = mainNode.childNodes().at(i);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
void ProcessParser::clientAuth(QXmlStreamReader &xmlReader,ClientHandler *client)
|
||||
{
|
||||
ClientAutorization clientAutorization;
|
||||
@@ -156,7 +186,7 @@ void ProcessParser::toClientMessage(QXmlStreamReader &xmlReader,ClientHandler *c
|
||||
processingSystem->processingToClientMessage(client, toClientMessage);
|
||||
}
|
||||
|
||||
void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client)
|
||||
void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client, QByteArray array)
|
||||
{
|
||||
ClientQueryToDB queryToDB;
|
||||
int id = 0;
|
||||
@@ -174,7 +204,13 @@ void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client)
|
||||
//addTextToLogger(name + ": " + value);
|
||||
|
||||
if(name == "TypeQuery")
|
||||
{
|
||||
queryToDB.typeQuery = (TypeQueryToDB)value.toInt();
|
||||
if(queryToDB.typeQuery == TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE)
|
||||
{
|
||||
task = xmlParserQueryToDB_ASSIGN_TASK_FIM_TO_TRAINEE(array);
|
||||
}
|
||||
}
|
||||
else if(name == "id")
|
||||
id = value.toInt();
|
||||
else
|
||||
@@ -238,8 +274,8 @@ void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client)
|
||||
task.ammProcedure.dmCode = value;
|
||||
break;
|
||||
case TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE:
|
||||
if(name == "title")
|
||||
task.title = value;
|
||||
//if(name == "title")
|
||||
//task.title = value;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user