mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Установка статуса для AMM
This commit is contained in:
@@ -545,13 +545,49 @@ int DataBaseLMS::updateTaskAMM(TaskAmmFim task)
|
||||
|
||||
int DataBaseLMS::updateStatusTaskAMM(int task_id, QString status)
|
||||
{
|
||||
QString queryStr = QString("UPDATE public.tasks_amm SET status = '%1' "
|
||||
QString queryStr;
|
||||
bool resBool = false;
|
||||
int id_trainee = 0;
|
||||
|
||||
resBool = db->transaction();
|
||||
|
||||
queryStr = QString("SELECT trainees.trainee_id "
|
||||
"FROM public.trainees JOIN public.tasks_amm ON trainees.trainee_id = tasks_amm.trainee_task "
|
||||
"WHERE tasks_amm.task_id = %1 "
|
||||
"ORDER BY trainees.trainee_id ASC").arg(
|
||||
QString::number(task_id));
|
||||
|
||||
QSqlQuery query = QSqlQuery(*db);
|
||||
|
||||
if(queryExec(queryStr, &query))
|
||||
{
|
||||
if (query.first())
|
||||
{//Обучаемый
|
||||
id_trainee = query.value(0).toInt();
|
||||
}
|
||||
}
|
||||
if(!id_trainee)
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
queryStr = QString("UPDATE public.tasks_amm SET status = '%1' "
|
||||
"WHERE task_id = %2 "
|
||||
"RETURNING tasks_amm.task_id").arg(
|
||||
status,
|
||||
QString::number(task_id) );
|
||||
|
||||
return queryExecInt(queryStr);
|
||||
|
||||
if(!queryExecInt(queryStr))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
resBool = db->commit();
|
||||
return id_trainee;
|
||||
}
|
||||
|
||||
int DataBaseLMS::deleteTaskAMM(int id_task)
|
||||
|
||||
@@ -307,11 +307,6 @@ int InterfaceDataBaseLMS::editTaskAMM(TaskAmmFim task)
|
||||
return updateTaskAMM(task);
|
||||
}
|
||||
|
||||
int InterfaceDataBaseLMS::editStatusTaskAMM(int task_id, QString status)
|
||||
{
|
||||
return updateStatusTaskAMM(task_id, status);
|
||||
}
|
||||
|
||||
QList<TaskAmmFim> InterfaceDataBaseLMS::getListTasksAMMofTrainee(int id_trainee)
|
||||
{
|
||||
return selectTasksAMMofTrainee(id_trainee);
|
||||
@@ -356,6 +351,11 @@ int InterfaceDataBaseLMS::changeStatusTaskFIM(int id_task, QString status)
|
||||
return updateStatusTaskFIM(id_task, status);
|
||||
}
|
||||
|
||||
int InterfaceDataBaseLMS::changeStatusTaskAMM(int id_task, QString status)
|
||||
{
|
||||
return updateStatusTaskAMM(id_task, status);
|
||||
}
|
||||
|
||||
int InterfaceDataBaseLMS::newTrainee(int id_group)
|
||||
{
|
||||
return insertTrainee(id_group);
|
||||
|
||||
@@ -72,7 +72,6 @@ public:
|
||||
int newTaskAMM(TaskAmmFim task, int id_trainee);
|
||||
int delTaskAMM(int id);
|
||||
int editTaskAMM(TaskAmmFim task);
|
||||
int editStatusTaskAMM(int task_id, QString status);
|
||||
|
||||
QList<TaskAmmFim> getListTasksAMMofTrainee(int id_trainee);
|
||||
QList<TaskAmmFim> getListTasksFIMofTrainee(int id_trainee);
|
||||
@@ -82,6 +81,7 @@ public:
|
||||
int editTaskFIM(TaskAmmFim task);
|
||||
int replaceReportFIM(TaskAmmFim task);
|
||||
int changeStatusTaskFIM(int id_task, QString status);
|
||||
int changeStatusTaskAMM(int id_task, QString status);
|
||||
|
||||
int newTrainee(int id_group);
|
||||
int delTrainee(int id);
|
||||
|
||||
@@ -25,6 +25,7 @@ enum TypeQueryToDB{
|
||||
TYPE_QUERY_SET_REPORT_TASK_AMM_TO_TRAINEE,
|
||||
TYPE_QUERY_SET_REPORT_TASK_FIM_TO_TRAINEE,
|
||||
|
||||
TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE,
|
||||
TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE
|
||||
};
|
||||
|
||||
|
||||
@@ -204,7 +204,8 @@ QByteArray DataParser::createQueryToDBMessage(ClientQueryToDB *queryToDB, int id
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE)
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE ||
|
||||
queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE)
|
||||
{
|
||||
QString* status = (QString*)data;
|
||||
if(status)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <QResizeEvent>
|
||||
#include "ammtaskswidget.h"
|
||||
#include "ui_ammtaskswidget.h"
|
||||
#include "dialogchecktask.h"
|
||||
|
||||
AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, TypeListTreeAMMFIM type, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
@@ -72,7 +73,7 @@ AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, TypeListTre
|
||||
ui->verticalLayout->setAlignment(Qt::AlignmentFlag::AlignBottom);
|
||||
}
|
||||
|
||||
ui->btnCheck->setVisible(false);
|
||||
//ui->btnCheck->setVisible(false);
|
||||
}
|
||||
|
||||
AMMtasksWidget::~AMMtasksWidget()
|
||||
@@ -150,10 +151,12 @@ void AMMtasksWidget::on_treeWidget_currentItemChanged(QTreeWidgetItem *current,
|
||||
if(current == nullptr)
|
||||
{
|
||||
ui->btnDelete->setEnabled(false);
|
||||
ui->btnCheck->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnCheck->setEnabled(true);
|
||||
ui->btnDelete->setEnabled(true);
|
||||
}
|
||||
|
||||
@@ -335,7 +338,29 @@ void AMMtasksWidget::on_btnDelete_clicked()
|
||||
|
||||
void AMMtasksWidget::on_btnCheck_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{//Выбрана задача
|
||||
|
||||
int id = treeItemCurrent->text(ColumnsTreeAMM::clmnAMM_ID).toInt();
|
||||
|
||||
DialogCheckTask dlg(connectorToServer, "amm", this);
|
||||
|
||||
//dlg.setTask(task);
|
||||
dlg.setIDTask(id);
|
||||
|
||||
QDialog* dialog = new QDialog(this);
|
||||
QHBoxLayout *layout = new QHBoxLayout(dialog);
|
||||
layout->addWidget(&dlg);
|
||||
dialog->setWindowTitle(tr("Status Task"));
|
||||
dialog->setMinimumSize(200, 100);
|
||||
dialog->setStyleSheet(this->styleSheet());
|
||||
dialog->exec();
|
||||
|
||||
if(dlg.getFlChanged())
|
||||
waitAnimationWidget->showWithPlay();
|
||||
}
|
||||
}
|
||||
|
||||
void AMMtasksWidget::on_btnAssignTask_clicked()
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check</string>
|
||||
<string>Status</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
|
||||
@@ -1,21 +1,37 @@
|
||||
#include "dialogchecktask.h"
|
||||
#include "ui_dialogchecktask.h"
|
||||
|
||||
DialogCheckTask::DialogCheckTask(ConnectorToServer* connectorToServer, QWidget *parent) :
|
||||
DialogCheckTask::DialogCheckTask(ConnectorToServer* connectorToServer, QString type, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::DialogCheckTask),
|
||||
connectorToServer(connectorToServer),
|
||||
fimTasksWidget(nullptr),
|
||||
flChanged(false)
|
||||
flChanged(false),
|
||||
id_task(0),
|
||||
type("fim")
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
this->type = type;
|
||||
|
||||
if(type == "fim")
|
||||
{
|
||||
fimTasksWidget = new FIMtasksWidget(nullptr, TypeListTreeAMMFIM::listOneTask, this);
|
||||
|
||||
ui->verticalLayout_3->addWidget(fimTasksWidget);
|
||||
|
||||
ui->plainText->setReadOnly(true);
|
||||
ui->plainText->setObjectName("plainText");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->plainText->setVisible(false);
|
||||
ui->label->setVisible(false);
|
||||
ui->label_2->setVisible(false);
|
||||
ui->btnRight->setText(tr("Completed"));
|
||||
ui->btnWrong->setText(tr("New"));
|
||||
ui->btnWrong->setIcon(QIcon(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
}
|
||||
}
|
||||
|
||||
DialogCheckTask::~DialogCheckTask()
|
||||
@@ -27,6 +43,7 @@ DialogCheckTask::~DialogCheckTask()
|
||||
void DialogCheckTask::setTask(TaskAmmFim* task)
|
||||
{
|
||||
this->task = *task;
|
||||
id_task = task->getID();
|
||||
|
||||
//Задача
|
||||
fimTasksWidget->setOneTaskFim(&this->task);
|
||||
@@ -84,13 +101,26 @@ void DialogCheckTask::outReport(FIMReport report)
|
||||
|
||||
void DialogCheckTask::on_btnWrong_clicked()
|
||||
{
|
||||
int id = task.getID();
|
||||
QString status = "failed";
|
||||
TypeQueryToDB typeQuery;
|
||||
QString status;
|
||||
QString msgString;
|
||||
|
||||
if(QMessageBox::warning(this, tr("Attention!"), tr("Change task status?\nThe status will be set: 'failed'"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
if(type == "fim")
|
||||
{
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE, id, (void*)&status);
|
||||
//this->close();
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE;
|
||||
status = "failed";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'failed'");
|
||||
}
|
||||
else
|
||||
{
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
|
||||
status = "new";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'new'");
|
||||
}
|
||||
|
||||
if(QMessageBox::warning(this, tr("Attention!"), msgString, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
{
|
||||
connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status);
|
||||
this->parentWidget()->close();
|
||||
flChanged = true;
|
||||
}
|
||||
@@ -98,13 +128,26 @@ void DialogCheckTask::on_btnWrong_clicked()
|
||||
|
||||
void DialogCheckTask::on_btnRight_clicked()
|
||||
{
|
||||
int id = task.getID();
|
||||
QString status = "completed";
|
||||
TypeQueryToDB typeQuery;
|
||||
QString status;
|
||||
QString msgString;
|
||||
|
||||
if(QMessageBox::warning(this, tr("Attention!"), tr("Change task status?\nThe status will be set: 'completed'"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
if(type == "fim")
|
||||
{
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE, id, (void*)&status);
|
||||
//this->close();
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE;
|
||||
status = "completed";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'completed'");
|
||||
}
|
||||
else
|
||||
{
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
|
||||
status = "completed";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'completed'");
|
||||
}
|
||||
|
||||
if(QMessageBox::warning(this, tr("Attention!"), msgString, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
{
|
||||
connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status);
|
||||
this->parentWidget()->close();
|
||||
flChanged = true;
|
||||
}
|
||||
|
||||
@@ -14,13 +14,14 @@ class DialogCheckTask : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogCheckTask(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
||||
explicit DialogCheckTask(ConnectorToServer* connectorToServer, QString type, QWidget *parent = nullptr);
|
||||
~DialogCheckTask();
|
||||
|
||||
public:
|
||||
void setTask(TaskAmmFim* task);
|
||||
TaskAmmFim getTask();
|
||||
bool getFlChanged(){return flChanged;}
|
||||
void setIDTask(int id){id_task = id;}
|
||||
|
||||
private slots:
|
||||
void on_btnWrong_clicked();
|
||||
@@ -39,6 +40,8 @@ private:
|
||||
FIMtasksWidget* fimTasksWidget;
|
||||
|
||||
bool flChanged;
|
||||
int id_task;
|
||||
QString type;
|
||||
};
|
||||
|
||||
#endif // DIALOGCHECKTASK_H
|
||||
|
||||
@@ -361,7 +361,7 @@ void FIMtasksWidget::on_btnCheck_clicked()
|
||||
|
||||
TaskAmmFim* task = taskTreePreparation->getTaskFIMbyID(id);
|
||||
|
||||
DialogCheckTask dlg(connectorToServer, this);
|
||||
DialogCheckTask dlg(connectorToServer, "fim", this);
|
||||
|
||||
dlg.setTask(task);
|
||||
|
||||
|
||||
Binary file not shown.
@@ -18,67 +18,68 @@
|
||||
<source>Аvailable</source>
|
||||
<translation>Доступные</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.ui" line="102"/>
|
||||
<source>Check</source>
|
||||
<translation>Проверить</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.ui" line="128"/>
|
||||
<source>Delete</source>
|
||||
<translation>Удалить</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="274"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="277"/>
|
||||
<source>Task AMM</source>
|
||||
<translation>Задача AMM</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="274"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="277"/>
|
||||
<source>DM code</source>
|
||||
<translation>DM код</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="274"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="276"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="277"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="279"/>
|
||||
<source>ID</source>
|
||||
<translation>ID</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="274"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="276"/>
|
||||
<location filename="../tasks/ammtaskswidget.ui" line="102"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="277"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="279"/>
|
||||
<source>Status</source>
|
||||
<translation>Статус</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="276"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="279"/>
|
||||
<source>PM/DM</source>
|
||||
<translation>PM/DM</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="276"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="279"/>
|
||||
<source>Code</source>
|
||||
<translation>Код</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="327"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="330"/>
|
||||
<source>Attention!</source>
|
||||
<translation>Внимание!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="327"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="330"/>
|
||||
<source>The deletion will be irrevocable.
|
||||
Delete it anyway?</source>
|
||||
<translation>Удаление будет безвозвратным.
|
||||
Всё равно удалить?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="343"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="356"/>
|
||||
<source>Status Task</source>
|
||||
<translation>Статус задачи</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="368"/>
|
||||
<source>New task</source>
|
||||
<translation>Новая задача</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="343"/>
|
||||
<location filename="../tasks/ammtaskswidget.cpp" line="368"/>
|
||||
<source>Assign this task?</source>
|
||||
<translation>Назначить эту задачу?</translation>
|
||||
</message>
|
||||
@@ -135,32 +136,58 @@ Delete it anyway?</source>
|
||||
<translation>Верно</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="71"/>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="31"/>
|
||||
<source>Completed</source>
|
||||
<translation>Выполнена</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="32"/>
|
||||
<source>New</source>
|
||||
<translation>Новая</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="88"/>
|
||||
<source>viewed</source>
|
||||
<translation>Просмотрено</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="73"/>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="90"/>
|
||||
<source>completed</source>
|
||||
<translation>Выполнена</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="90"/>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="104"/>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="112"/>
|
||||
<source>Change task status?
|
||||
The status will be set:
|
||||
'failed'</source>
|
||||
<translation>Изменить статус задачи?
|
||||
Будет установлен статус:
|
||||
'неверно'</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="118"/>
|
||||
<source>Change task status?
|
||||
The status will be set:
|
||||
'new'</source>
|
||||
<translation>Изменить статус задачи?
|
||||
Будет установлен статус:
|
||||
'новая'</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="121"/>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="148"/>
|
||||
<source>Attention!</source>
|
||||
<translation>Внимание!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="90"/>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="139"/>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="145"/>
|
||||
<source>Change task status?
|
||||
The status will be set: 'failed'</source>
|
||||
<translation>Изменить статус задачи? Будет установлен статус 'неверно'</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/dialogchecktask.cpp" line="104"/>
|
||||
<source>Change task status?
|
||||
The status will be set: 'completed'</source>
|
||||
<translation>Изменить статус задачи? Будет установлен статус 'выполнена'</translation>
|
||||
The status will be set:
|
||||
'completed'</source>
|
||||
<translation>Изменить статус задачи?
|
||||
Будет установлен статус:
|
||||
'выполнена'</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -950,7 +977,7 @@ Delete it anyway?</source>
|
||||
<location filename="../tasks/tasktreepreparation.cpp" line="414"/>
|
||||
<location filename="../tasks/tasktreepreparation.cpp" line="500"/>
|
||||
<source>completed</source>
|
||||
<translation>выполнено</translation>
|
||||
<translation>выполнена</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../tasks/tasktreepreparation.cpp" line="371"/>
|
||||
|
||||
@@ -454,6 +454,7 @@ void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client,
|
||||
//task.title = value;
|
||||
break;
|
||||
|
||||
case TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE:
|
||||
case TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE:
|
||||
if(name == "status")
|
||||
status = value;
|
||||
@@ -480,6 +481,7 @@ void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client,
|
||||
case TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE:
|
||||
data = &task;
|
||||
break;
|
||||
case TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE:
|
||||
case TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE:
|
||||
data = &status;
|
||||
break;
|
||||
|
||||
@@ -327,7 +327,7 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
|
||||
{
|
||||
TaskAmmFim* task = (TaskAmmFim*)data;
|
||||
if(task->status == "completed")
|
||||
if( int id_task = providerDBLMS->editStatusTaskAMM(task->getID(), "completed") )
|
||||
if( int id_trainee = providerDBLMS->changeStatusTaskAMM(task->getID(), "completed") )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -344,6 +344,24 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
|
||||
break;
|
||||
}
|
||||
|
||||
case TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE:
|
||||
{
|
||||
QString* status = (QString*)data;
|
||||
if(int id_trainee = providerDBLMS->changeStatusTaskAMM(id, *status))
|
||||
{
|
||||
//Отправка списка задач AMM всем клиентам GUI
|
||||
//sendListTasksAMMofTraineetoClient(client, id_trainee);
|
||||
emit sigStatusTasksAMMofTraineeChanged(id_trainee);
|
||||
|
||||
//Отправка списка задач AMM клиенту Юнити
|
||||
if(ClientHandler* clientUnity = getUnityClientById(id_trainee))
|
||||
{//Есть такой
|
||||
sendListTasksAMMofTraineetoClient(clientUnity, id_trainee);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE:
|
||||
{
|
||||
QString* status = (QString*)data;
|
||||
|
||||
@@ -372,11 +372,6 @@ int ProviderDBLMS::editTaskAMM(TaskAmmFim task)
|
||||
return dbLMS->editTaskAMM(task);
|
||||
}
|
||||
|
||||
int ProviderDBLMS::editStatusTaskAMM(int task_id, QString status)
|
||||
{
|
||||
return dbLMS->editStatusTaskAMM(task_id, status);
|
||||
}
|
||||
|
||||
int ProviderDBLMS::newTaskFIM(TaskAmmFim task, int id_trainee)
|
||||
{
|
||||
return dbLMS->newTaskFIM(task, id_trainee);
|
||||
@@ -402,6 +397,11 @@ int ProviderDBLMS::changeStatusTaskFIM(int id_task, QString status)
|
||||
return dbLMS->changeStatusTaskFIM(id_task, status);
|
||||
}
|
||||
|
||||
int ProviderDBLMS::changeStatusTaskAMM(int id_task, QString status)
|
||||
{
|
||||
return dbLMS->changeStatusTaskAMM(id_task, status);
|
||||
}
|
||||
|
||||
QList<TaskAmmFim> ProviderDBLMS::GetListTasksAMMofTrainee(int id_trainee)
|
||||
{
|
||||
QList<TaskAmmFim> listTasks;
|
||||
|
||||
@@ -51,13 +51,13 @@ public:
|
||||
int newTaskAMM(TaskAmmFim task, int id_trainee);
|
||||
int delTaskAMM(int id);
|
||||
int editTaskAMM(TaskAmmFim task);
|
||||
int editStatusTaskAMM(int task_id, QString status);
|
||||
|
||||
int newTaskFIM(TaskAmmFim task, int id_trainee);
|
||||
int delTaskFIM(int id);
|
||||
int editTaskFIM(TaskAmmFim task);
|
||||
int replaceReportFIM(TaskAmmFim task);
|
||||
int changeStatusTaskFIM(int id_task, QString status);
|
||||
int changeStatusTaskAMM(int id_task, QString status);
|
||||
|
||||
QList<TaskAmmFim> GetListTasksAMMofTrainee(int id_trainee);
|
||||
QList<TaskAmmFim> GetListTasksFIMofTrainee(int id_trainee);
|
||||
|
||||
Reference in New Issue
Block a user