mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
bugFix Блочная передача больших данных
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "providerdblms.h"
|
||||
|
||||
#include <clienthandler.h>
|
||||
#include <QMap>
|
||||
|
||||
ProcessingSystem::ProcessingSystem(ProviderDBLMS* providerDBLMS, UpdateController* updateController, DocsUpdater* docsUpdater, CfiController* cfiController, QObject *parent):
|
||||
QObject(parent),
|
||||
@@ -322,14 +323,21 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
|
||||
//client->sendXmlAnswer(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES);
|
||||
client->sendFileBlockByteArray(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES);
|
||||
|
||||
/**/
|
||||
if(listTrainees.count())
|
||||
{
|
||||
//Отправка списка задач FIM всех обучаемых клиенту GUI
|
||||
sendListsTasksFIMofAllTraineestoClient(client, listTrainees);
|
||||
//Отправка списка задач AMM всех обучаемых клиенту GUI
|
||||
sendListsTasksAMMofAllTraineestoClient(client, listTrainees);
|
||||
}
|
||||
/*
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
//Отправка списка задач AMM этого обучаемого клиенту GUI
|
||||
sendListTasksAMMofTraineetoClient(client, trainee.getID());
|
||||
//Отправка списка задач FIM этого обучаемого клиенту GUI
|
||||
sendListTasksFIMofTraineetoClient(client, trainee.getID());
|
||||
}
|
||||
}*/
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -756,6 +764,36 @@ void ProcessingSystem::sendListTasksFIMofTraineetoClient(ClientHandler *client,
|
||||
client->sendFileBlockByteArray(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_TASKS_FIM_OF_TRAINEE);
|
||||
}
|
||||
|
||||
void ProcessingSystem::sendListsTasksAMMofAllTraineestoClient(ClientHandler *client, QList<Trainee> listTrainees)
|
||||
{
|
||||
QMap<int, QList<TaskAmmFim>> mapOfLists;
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
int id_trainee = trainee.getID();
|
||||
QList<TaskAmmFim> listTasksOneTrainee = providerDBLMS->GetListTasksAMMofTrainee(id_trainee);
|
||||
if(listTasksOneTrainee.count())
|
||||
mapOfLists.insert(id_trainee, listTasksOneTrainee);
|
||||
}
|
||||
|
||||
QByteArray arrayAnswer = dataParser->DbAnswer()->listsTasksAMMofAllTrainees(&mapOfLists);
|
||||
client->sendFileBlockByteArray(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_TASKS_AMM_OF_ALL_TRAINEES);
|
||||
}
|
||||
|
||||
void ProcessingSystem::sendListsTasksFIMofAllTraineestoClient(ClientHandler *client, QList<Trainee> listTrainees)
|
||||
{
|
||||
QMap<int, QList<TaskAmmFim>> mapOfLists;
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
int id_trainee = trainee.getID();
|
||||
QList<TaskAmmFim> listTasksOneTrainee = providerDBLMS->GetListTasksFIMofTrainee(id_trainee);
|
||||
if(listTasksOneTrainee.count())
|
||||
mapOfLists.insert(id_trainee, listTasksOneTrainee);
|
||||
}
|
||||
|
||||
QByteArray arrayAnswer = dataParser->DbAnswer()->listsTasksFIMofAllTrainees(&mapOfLists);
|
||||
client->sendFileBlockByteArray(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_TASKS_FIM_OF_ALL_TRAINEES);
|
||||
}
|
||||
|
||||
void ProcessingSystem::sendListTasksAMMofTraineeByIDtoClient(ClientHandler *client, int id_trainee, QList<int> listID)
|
||||
{
|
||||
QList<TaskAmmFim> listTasksNeed;
|
||||
|
||||
Reference in New Issue
Block a user