From 590882e763ef666f5b8cbbf5d3ab80e3eded39ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A2=9E=E8=BE=89?= <3045316072@qq.com> Date: Tue, 15 Apr 2025 19:06:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8A=B6=E6=80=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 + DialogSubmitTaskResult.cpp | 77 +++++- DialogSubmitTaskResult.h | 7 +- DialogSubmitTaskResult.ui | 182 ++++++++------ DialogTaskOrder.cpp | 14 +- DialogTaskOrder.h | 2 +- DialogTaskOrder.ui | 441 ++++++++++++++++++++------------- LAMPTaskManagerMainWindows.cpp | 3 - LAMPWBDD.vcxproj | 7 +- LAMPWBDD.vcxproj.filters | 9 + LAMPWBDDManager.cpp | 43 +++- LAMPWBDDManager.h | 2 +- QTestUpLoadDialog.ui | 76 ++++++ SarUploadDialog.cpp | 139 +++++++++++ SarUploadDialog.h | 45 ++++ SarUploadDialog.ui | 69 ++++++ TaskOrder.cpp | 6 +- TaskOrder.h | 6 +- 18 files changed, 862 insertions(+), 270 deletions(-) create mode 100644 QTestUpLoadDialog.ui create mode 100644 SarUploadDialog.cpp create mode 100644 SarUploadDialog.h create mode 100644 SarUploadDialog.ui diff --git a/.gitignore b/.gitignore index 32c5fdf..eec4f3e 100644 --- a/.gitignore +++ b/.gitignore @@ -509,3 +509,7 @@ compile_commands.json *_qmlcache.qrc +testdata/ +/testdata + + diff --git a/DialogSubmitTaskResult.cpp b/DialogSubmitTaskResult.cpp index a99e016..8dbeb7e 100644 --- a/DialogSubmitTaskResult.cpp +++ b/DialogSubmitTaskResult.cpp @@ -4,14 +4,31 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + #include "TaskOrder.h" namespace WBFZTASK { DialogSubmitTaskResult::DialogSubmitTaskResult(QWidget* parent) : QDialog(parent) ,ui(new Ui::DialogSubmitTaskResultClass) + ,networkManager(new QNetworkAccessManager(this)) { ui->setupUi(this); QObject::connect(ui->pushButton_Select, SIGNAL(clicked()), this, SLOT(on_clicked_pushButton_Select())); + this->ui->dateTimeEditDateTIme->setDateTime(QDateTime::currentDateTime()); } DialogSubmitTaskResult::~DialogSubmitTaskResult() @@ -27,11 +44,57 @@ namespace WBFZTASK { this->ui->lineEdit_contactinfo->setText(task->getContactInfo()); this->ui->lineEdit_createtime->setText(task->getCreateTime()); this->ui->lineEdit_ordercode->setText(task->getOrderCode()); - this->ui->lineEdit_orderid->setText(QString::number(task->getOrderId())); + this->ui->lineEdit_orderid->setText(task->getOrderId()); } void DialogSubmitTaskResult::accept() { + // 获取参数 + QString dataSource = ui->lineEdit_ResultFilePath->text(); + QString dataType = this->task->getOrderType(); + QString dataname = QFileInfo(dataSource).fileName(); + QString DateTime = this->ui->dateTimeEditDateTIme->dateTime().toString("yyyy-MM-dd HH:mm:ss"); + QString orderid = this->task->getOrderId(); + QString ordersource = this->task->getOrderSource(); + QString orderType = this->task->getOrderType(); + QString simulationProduction = this->ui->lineEdit_simulationProduct->text();// this->ui.lineEdit_simulationProduct.text(); + + + + + QUrlQuery query; + query.addQueryItem("dataType", QString("'%1'").arg(dataType)); + query.addQueryItem("dataname", QString("'%1'").arg(dataname)); + query.addQueryItem("datatime", QString("'%1'").arg(DateTime)); + query.addQueryItem("orderid", QString("'%1'").arg(orderid)); + query.addQueryItem("ordersource", QString("'%1'").arg(ordersource)); + query.addQueryItem("ordertype", QString("'%1'").arg(orderType)); + query.addQueryItem("simulationProduction", QString("'%1'").arg(simulationProduction)); + + QHttpMultiPart* multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType); + + // 文件部分 + QHttpPart filePart; + filePart.setHeader(QNetworkRequest::ContentDispositionHeader, + QVariant("form-data; name=\"dataSource\"; filename=\"" + + QFileInfo(dataSource).fileName() + "\"")); + QFile* file = new QFile(dataSource); + file->open(QIODevice::ReadOnly); + filePart.setBodyDevice(file); + multiPart->append(filePart); + + QUrl url("https://caplos.aircas.ac.cn/gateway/api/interface/api/uploadOpticalSar"); + url.setQuery(query); + + QNetworkRequest request(url); + request.setRawHeader("Accept", "application/json"); + + QNetworkReply* reply = networkManager->put(request, multiPart); + connect(reply, &QNetworkReply::finished, [=]() { + handleResponse(reply); + multiPart->deleteLater(); + }); + QMessageBox::information(this, u8"信息", u8"成果文件提交成功"); } @@ -58,6 +121,18 @@ namespace WBFZTASK { qDebug() << "No file selected."; } } + // 响应处理 + void DialogSubmitTaskResult::handleResponse(QNetworkReply* reply) + { + if (reply->error() == QNetworkReply::NoError) { + QMessageBox::information(this, "Success", "Upload completed successfully"); + } + else { + QMessageBox::critical(this, "Error", + QString("Error %1: %2").arg(reply->error()).arg(reply->errorString())); + } + reply->deleteLater(); + } } diff --git a/DialogSubmitTaskResult.h b/DialogSubmitTaskResult.h index c22ec74..a775593 100644 --- a/DialogSubmitTaskResult.h +++ b/DialogSubmitTaskResult.h @@ -1,8 +1,8 @@ #pragma once - +#include #include #include "TaskOrder.h" - +#include namespace Ui { @@ -22,9 +22,10 @@ namespace WBFZTASK { public slots: void on_clicked_pushButton_Select(); void accept(); - + void handleResponse(QNetworkReply* reply); private: Ui::DialogSubmitTaskResultClass* ui; WBFZTASK::TaskOrder* task; + QNetworkAccessManager* networkManager; }; } \ No newline at end of file diff --git a/DialogSubmitTaskResult.ui b/DialogSubmitTaskResult.ui index 7eb2f68..25400d6 100644 --- a/DialogSubmitTaskResult.ui +++ b/DialogSubmitTaskResult.ui @@ -24,27 +24,11 @@ 0 0 - 576 - 292 + 580 + 597 - - - - false - - - - 0 - 30 - - - - OWLS_PC_DF_20240802150813_4570 - - - @@ -58,7 +42,54 @@ - + + + + true + + + + 0 + 30 + + + + 2024-08-02 15:08:13 + + + + + + + 鐢宠浜: + + + + + + + + 0 + 30 + + + + + 2001 + 11 + 11 + + + + + + + + 璁㈠崟瀹屾垚鏃堕棿 + + + + @@ -68,10 +99,17 @@ - - + + - 璁㈠崟id: + 鑱旂郴鏂瑰紡: + + + + + + + 浠跨湡椤圭洰鍚嶇О锛 @@ -88,10 +126,40 @@ + + + + 鎴愭灉鏂囦欢锛 + + + + + + + 璁㈠崟缂栧彿: + + + + + + + true + + + + 0 + 30 + + + + OWLS_PC_DF_20240802150813_4570 + + + - false + true @@ -104,36 +172,6 @@ - - - - 鐢宠浜: - - - - - - - false - - - - 0 - 30 - - - - 2024-08-02 15:08:13 - - - - - - - 璁㈠崟缂栧彿: - - - @@ -141,21 +179,14 @@ - - + + - 鎴愭灉鏂囦欢锛 + 璁㈠崟id: - - - - 鑱旂郴鏂瑰紡: - - - - + @@ -168,23 +199,20 @@ + + + + + 0 + 30 + + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - diff --git a/DialogTaskOrder.cpp b/DialogTaskOrder.cpp index 05aa7ff..02a2bab 100644 --- a/DialogTaskOrder.cpp +++ b/DialogTaskOrder.cpp @@ -1,6 +1,8 @@ #include "DialogTaskOrder.h" #include "ui_DialogTaskOrder.h" #include +#include +#include "LAMPWBDDManager.h" namespace WBFZTASK { DialogTaskOrder::DialogTaskOrder(QWidget* parent) @@ -8,6 +10,7 @@ namespace WBFZTASK { , ui(new Ui::DialogTaskOrder) { ui->setupUi(this); + QObject::connect(ui->pushButtonUpdateOrderState, SIGNAL(clicked()), this, SLOT(onpushButtonUpdateOrderState_clicked())); } DialogTaskOrder::~DialogTaskOrder() @@ -21,7 +24,7 @@ namespace WBFZTASK { this->ui->lineEdit_contactinfo->setText(task->getContactInfo()); this->ui->lineEdit_createtime->setText(task->getCreateTime()); this->ui->lineEdit_ordercode->setText(task->getOrderCode()); - this->ui->lineEdit_orderid->setText(QString::number(task->getOrderId())); + this->ui->lineEdit_orderid->setText(task->getOrderId()); this->ui->lineEdit_ordermode->setText(task->getOrderMode()); this->ui->lineEdit_ordersource->setText(task->getOrderSource()); this->ui->lineEdit_ordertype->setText(task->getOrderType()); @@ -31,6 +34,15 @@ namespace WBFZTASK { this->ui->plainTextEdit_intention->setPlainText(task->getIntention()); this->ui->plainTextEdit_orderdetails->setPlainText(task->getOrderDetails()); this->ui->plainTextEdit_orderstoreprocess->setPlainText(task->getOrderStoreProcess()); + this->ui->lineEdit_Orderstatus->setText(task->getOrderStatus()); + } + + void DialogTaskOrder::onpushButtonUpdateOrderState_clicked() + { + LAMPWBCONNECT::LAMPWBDDManager::updateTaskoderStatus(this->ui->lineEdit_orderid->text(), + this->ui->lineEdit_Orderstatus->text() + ); + } diff --git a/DialogTaskOrder.h b/DialogTaskOrder.h index ef2c1d1..b181aea 100644 --- a/DialogTaskOrder.h +++ b/DialogTaskOrder.h @@ -18,7 +18,7 @@ namespace WBFZTASK { void SetTaskOrder(WBFZTASK::TaskOrder* task); public slots: void accept(); - + void onpushButtonUpdateOrderState_clicked(); private: Ui::DialogTaskOrder* ui; WBFZTASK::TaskOrder* task; diff --git a/DialogTaskOrder.ui b/DialogTaskOrder.ui index 0fcdf90..149e8d4 100644 --- a/DialogTaskOrder.ui +++ b/DialogTaskOrder.ui @@ -6,7 +6,7 @@ 0 0 - 893 + 1087 740 @@ -24,54 +24,50 @@ 0 0 - 852 - 1007 + 1050 + 791 - - + + - 璁㈠崟id: + 璁㈠崟鏉ユ簮: - - + + false 0 - 30 + 50 - - 348 - - - - - 璁㈠崟缂栧彿: - - - - - + + false 0 - 30 + 1 + + + + + 16777215 + 1 - OWLS_PC_DF_20240802150813_4570 + 璁㈠崟澶勭悊杩涘害: @@ -82,19 +78,34 @@ - - - - false - + + 0 - 30 + 300 + + + + - 2024-08-02 15:08:13 + 鐢宠浜: + + + + + + + 璁㈠崟id: + + + + + + + 浠跨湡闇姹: @@ -105,40 +116,51 @@ - - + + + + + 0 + 30 + + + + 鑻忕爺闄 + + + + + false 0 - 30 + 1 + + + + + 16777215 + 1 - - - - - 璁㈠崟鐘舵: + 璁㈠崟璇︽儏: - - + + 0 30 - - - - - 闇姹傜敤鎴稩D: + @@ -158,43 +180,20 @@ - - - - 璁㈠崟鏉ユ簮: - - - - - + + 0 30 - - 搴旂敤鎶鏈泦鎴愪笌鍏变韩鏈嶅姟鍒嗙郴缁 - - - + + - 鐢宠浜: - - - - - - - - 0 - 30 - - - - zyg990305zyg@163.com + 璁㈠崟缂栧彿: @@ -205,19 +204,6 @@ - - - - - 0 - 30 - - - - - - - @@ -225,90 +211,6 @@ - - - - - 0 - 30 - - - - 鑻忕爺闄 - - - - - - - 浠跨湡鐩殑: - - - - - - - false - - - - 0 - 50 - - - - - - - - 浠跨湡闇姹: - - - - - - - - 0 - 300 - - - - - - - - 璁㈠崟璇︽儏: - - - - - - - - - - 璁㈠崟澶勭悊杩涘害: - - - - - - - - - - 璁㈠崟鏇存柊鏃堕棿: - - - - - - - 璁㈠崟绫诲瀷: - - - @@ -325,8 +227,27 @@ - - + + + + false + + + + 0 + 1 + + + + + 16777215 + 1 + + + + + + false @@ -338,6 +259,175 @@ + + + + false + + + + 0 + 30 + + + + 2024-08-02 15:08:13 + + + + + + + 闇姹傜敤鎴稩D: + + + + + + + false + + + + 0 + 30 + + + + OWLS_PC_DF_20240802150813_4570 + + + + + + + + 0 + 30 + + + + 搴旂敤鎶鏈泦鎴愪笌鍏变韩鏈嶅姟鍒嗙郴缁 + + + + + + + 璁㈠崟绫诲瀷: + + + + + + + false + + + + 0 + 1 + + + + + 16777215 + 1 + + + + 璁㈠崟鏇存柊鏃堕棿: + + + + + + + false + + + + 0 + 30 + + + + 348 + + + + + + + 璁㈠崟鐘舵: + + + + + + + + 0 + 30 + + + + zyg990305zyg@163.com + + + + + + + 浠跨湡鐩殑: + + + + + + + false + + + + 0 + 1 + + + + + 16777215 + 1 + + + + + + + + false + + + + 0 + 1 + + + + + 16777215 + 1 + + + + + + + + 鏇存柊鐘舵 + + + @@ -379,6 +469,13 @@ + + + + 鎻愪氦鎴愭灉 + + + diff --git a/LAMPTaskManagerMainWindows.cpp b/LAMPTaskManagerMainWindows.cpp index 43a3060..f545777 100644 --- a/LAMPTaskManagerMainWindows.cpp +++ b/LAMPTaskManagerMainWindows.cpp @@ -51,11 +51,8 @@ namespace WBFZTASK { ui->tableWidget->setRowCount(taskcollect->getPagecount()); qDebug() << "page Count : " << taskcollect->getPagecount(); - QString colname = ""; - - for (int rowidx = 0; rowidx < taskcollect->getPagecount();rowidx++) { // 按照列添加 diff --git a/LAMPWBDD.vcxproj b/LAMPWBDD.vcxproj index fd5c543..b24c463 100644 --- a/LAMPWBDD.vcxproj +++ b/LAMPWBDD.vcxproj @@ -41,7 +41,7 @@ debug - qt5_applications_Qt + tools_qt5 core;opengl;network;gui;help;widgets;location;webchannel;websockets;webengine;datavisualization;networkauth;remoteobjects release @@ -93,7 +93,7 @@ Console - false + DebugFull true true @@ -104,9 +104,11 @@ + + @@ -117,6 +119,7 @@ + diff --git a/LAMPWBDD.vcxproj.filters b/LAMPWBDD.vcxproj.filters index be4643b..b3302d5 100644 --- a/LAMPWBDD.vcxproj.filters +++ b/LAMPWBDD.vcxproj.filters @@ -41,6 +41,9 @@ Source Files + + Source Files + @@ -60,6 +63,9 @@ Header Files + + Header Files + @@ -71,5 +77,8 @@ Form Files + + Form Files + \ No newline at end of file diff --git a/LAMPWBDDManager.cpp b/LAMPWBDDManager.cpp index e3cd8c4..03621d0 100644 --- a/LAMPWBDDManager.cpp +++ b/LAMPWBDDManager.cpp @@ -24,8 +24,6 @@ namespace LAMPWBCONNECT { } void LAMPWBDDManager::getTaskList(int count, int pagenum) { - - QNetworkAccessManager* manager = new QNetworkAccessManager(); QUrl url = QUrl(QString( "https://124.16.188.131:9699/gateway/api/interface/ddtc/dealManage/wbfzddSearch?")); qDebug() << QString("count : %1 , pagenum: %2 , orderType: %3").arg(count).arg(pagenum).arg(QString(u8"微波仿真订单")); @@ -44,7 +42,6 @@ namespace LAMPWBCONNECT { config.setPeerVerifyMode(QSslSocket::VerifyNone); request.setSslConfiguration(config); - QByteArray postData;// = query.toString().toUtf8(); QNetworkReply* reply = manager->post(request, postData); @@ -66,5 +63,45 @@ namespace LAMPWBCONNECT { reply->deleteLater(); }); } + void LAMPWBDDManager::updateTaskoderStatus(QString taskid, QString taskstatus) + { + QNetworkAccessManager* manager = new QNetworkAccessManager(); + QUrl url = QUrl(QString("https://caplos.aircas.ac.cn/gateway/api/interface/ddtc/managedeal/wbfzdd/statusupdate")); + QJsonObject jsonObj; + jsonObj["orderid"] = taskid; + jsonObj["orderstatus"] = taskstatus; + QJsonDocument jsonDoc(jsonObj); + QByteArray postData = jsonDoc.toJson(); // 转换为JSON字节数组 + + QNetworkRequest request; + request.setUrl(url); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + //request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + QSslConfiguration config = QSslConfiguration::defaultConfiguration(); + config.setProtocol(QSsl::AnyProtocol);; + config.setPeerVerifyMode(QSslSocket::VerifyNone); + request.setSslConfiguration(config); + + + QNetworkReply* reply = manager->post(request, postData); + + QObject::connect(reply, &QNetworkReply::finished, [reply, manager]() { + if (reply->error() == QNetworkReply::NoError) { + QByteArray response_data = reply->readAll(); + QJsonDocument doc = QJsonDocument::fromJson(response_data); + //qDebug() << response_data; + qDebug() << doc["msg"]; + qDebug() << doc["code"]; + + //WBFZTASK::TaskCollect::getInstance()->LoadTaskCollect(doc, reply->errorString()); + qDebug() << "request success " << reply->url(); + } + else { + //WBFZTASK::TaskCollect::getInstance()->LoadTaskCollectState(reply->errorString()); + qDebug() << "request failed:" << reply->errorString(); + } + reply->deleteLater(); + }); + } } diff --git a/LAMPWBDDManager.h b/LAMPWBDDManager.h index 5d73c9d..33c9ca5 100644 --- a/LAMPWBDDManager.h +++ b/LAMPWBDDManager.h @@ -14,7 +14,7 @@ namespace LAMPWBCONNECT { public: void loginIn(); void getTaskList(int count, int pagenum); - + static void updateTaskoderStatus(QString taskid, QString taskstatus); public : diff --git a/QTestUpLoadDialog.ui b/QTestUpLoadDialog.ui new file mode 100644 index 0000000..2771779 --- /dev/null +++ b/QTestUpLoadDialog.ui @@ -0,0 +1,76 @@ + + + SarUploadDialog + + + + 0 + 0 + 510 + 236 + + + + SAR Data Upload Controller + + + + + + Upload Parameters ( * required) + + + + + + dataSource*: + + + + + + + + + + + + Browse... + + + + + + + + + + + + + + Execute + + + + + + + Clear + + + + + + + Cancel + + + + + + + + + + diff --git a/SarUploadDialog.cpp b/SarUploadDialog.cpp new file mode 100644 index 0000000..fc6fba1 --- /dev/null +++ b/SarUploadDialog.cpp @@ -0,0 +1,139 @@ +#include "SarUploadDialog.h" + +#include "saruploaddialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +SarUploadDialog::SarUploadDialog(QWidget* parent) + : QDialog(parent), + networkManager(new QNetworkAccessManager(this)) +{ + setupUi(); + initConnections(); +} + +SarUploadDialog::~SarUploadDialog() +{ + // 自动释放Qt对象 +} + +void SarUploadDialog::setupUi() +{ + QVBoxLayout* mainLayout = new QVBoxLayout(this); + + // 参数组 + QGroupBox* groupBox = new QGroupBox("Upload Parameters ( * required)"); + QFormLayout* formLayout = new QFormLayout; + + // dataSource字段 + leFilePath = new QLineEdit; + btnBrowse = new QPushButton("Browse..."); + QHBoxLayout* fileLayout = new QHBoxLayout; + fileLayout->addWidget(leFilePath); + fileLayout->addWidget(btnBrowse); + formLayout->addRow("dataSource*:", fileLayout); + + // 其他字段初始化... + + groupBox->setLayout(formLayout); + mainLayout->addWidget(groupBox); + + // 按钮组 + QHBoxLayout* buttonLayout = new QHBoxLayout; + btnExecute = new QPushButton("Execute"); + btnClear = new QPushButton("Clear"); + btnCancel = new QPushButton("Cancel"); + buttonLayout->addWidget(btnExecute); + buttonLayout->addWidget(btnClear); + buttonLayout->addWidget(btnCancel); + mainLayout->addLayout(buttonLayout); +} + +void SarUploadDialog::initConnections() +{ + connect(btnBrowse, &QPushButton::clicked, this, &SarUploadDialog::onBrowseClicked); + connect(btnExecute, &QPushButton::clicked, this, &SarUploadDialog::onExecuteClicked); + connect(btnClear, &QPushButton::clicked, [this]() { + leFilePath->clear(); + // 清空其他字段... + }); + connect(btnCancel, &QPushButton::clicked, this, &QDialog::reject); +} + +// 文件浏览槽函数 +void SarUploadDialog::onBrowseClicked() +{ + QString file = QFileDialog::getOpenFileName(this, "Select SAR File"); + if (!file.isEmpty()) leFilePath->setText(file); +} + +// 执行上传 +void SarUploadDialog::onExecuteClicked() +{ + if (!validateInputs()) return; + + QUrlQuery query; + query.addQueryItem("dataType", leDataType->text()); + query.addQueryItem("dataname", leDataname->text()); + + QHttpMultiPart* multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType); + + // 文件部分 + QHttpPart filePart; + filePart.setHeader(QNetworkRequest::ContentDispositionHeader, + QVariant("form-data; name=\"dataSource\"; filename=\"" + + QFileInfo(leFilePath->text()).fileName() + "\"")); + QFile* file = new QFile(leFilePath->text()); + file->open(QIODevice::ReadOnly); + filePart.setBodyDevice(file); + multiPart->append(filePart); + + QUrl url("http://your-api-domain/api/uploadOpticalSar"); + url.setQuery(query); + + QNetworkRequest request(url); + request.setRawHeader("Accept", "application/json"); + + QNetworkReply* reply = networkManager->put(request, multiPart); + connect(reply, &QNetworkReply::finished, [=]() { + handleResponse(reply); + multiPart->deleteLater(); + }); +} + +// 响应处理 +void SarUploadDialog::handleResponse(QNetworkReply* reply) +{ + if (reply->error() == QNetworkReply::NoError) { + QMessageBox::information(this, "Success", "Upload completed successfully"); + } + else { + QMessageBox::critical(this, "Error", + QString("Error %1: %2").arg(reply->error()).arg(reply->errorString())); + } + reply->deleteLater(); +} + +// 输入验证 +bool SarUploadDialog::validateInputs() +{ + if (leFilePath->text().isEmpty()) { + QMessageBox::warning(this, "Warning", "dataSource is required!"); + return false; + } + // 其他验证逻辑... + return true; +} diff --git a/SarUploadDialog.h b/SarUploadDialog.h new file mode 100644 index 0000000..94fe3ff --- /dev/null +++ b/SarUploadDialog.h @@ -0,0 +1,45 @@ +#pragma once + +#ifndef SARUPLOADDIALOG_H +#define SARUPLOADDIALOG_H + +#include +#include + +class QLineEdit; +class QDateTimeEdit; +class QPushButton; +class QNetworkReply; + +class SarUploadDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SarUploadDialog(QWidget* parent = nullptr); + ~SarUploadDialog(); + +private slots: + void onBrowseClicked(); + void onExecuteClicked(); + void handleResponse(QNetworkReply* reply); + +private: + void setupUi(); + void initConnections(); + bool validateInputs(); + + // UI Components + QLineEdit* leFilePath; + QLineEdit* leDataType; + QLineEdit* leDataname; + QDateTimeEdit* dtDatatime; + QPushButton* btnBrowse; + QPushButton* btnExecute; + QPushButton* btnClear; + QPushButton* btnCancel; + + QNetworkAccessManager* networkManager; +}; + +#endif // SARUPLOADDIALOG_H diff --git a/SarUploadDialog.ui b/SarUploadDialog.ui new file mode 100644 index 0000000..2fca019 --- /dev/null +++ b/SarUploadDialog.ui @@ -0,0 +1,69 @@ + + + SarUploadDialog + + + SAR Data Upload Controller + + + + + + Upload Parameters ( * required) + + + + + + dataSource*: + + + + + + + + + + + + Browse... + + + + + + + + + + + + + + + Execute + + + + + + + Clear + + + + + + + Cancel + + + + + + + + + + diff --git a/TaskOrder.cpp b/TaskOrder.cpp index 4e4955c..8955b3e 100644 --- a/TaskOrder.cpp +++ b/TaskOrder.cpp @@ -15,7 +15,7 @@ namespace WBFZTASK { // 使用QJsonObject初始化所有成员变量 createTime = jsonObj["createtime"].toString(); orderStatus = jsonObj["orderstatus"].toString(); - orderId = jsonObj["orderid"].toInt(); + orderId = jsonObj["orderid"].toString(); orderMode = jsonObj["ordermode"].toString(); ip = jsonObj["ip"].toString(); orderDownloadAddr = jsonObj["orderdownloadaddr"].toString(); @@ -79,8 +79,8 @@ namespace WBFZTASK { void TaskOrder::setOrderStatus(const QString& value) { orderStatus = value; } QString TaskOrder::getOrderStatus() const { return orderStatus; } - void TaskOrder::setOrderId(int value) { orderId = value; } - int TaskOrder::getOrderId() const { return orderId; } + void TaskOrder::setOrderId(QString value) { orderId = value; } + QString TaskOrder::getOrderId() const { return orderId; } void TaskOrder::setOrderMode(const QString& value) { orderMode = value; } QString TaskOrder::getOrderMode() const { return orderMode; } diff --git a/TaskOrder.h b/TaskOrder.h index 093daf6..3006dac 100644 --- a/TaskOrder.h +++ b/TaskOrder.h @@ -19,7 +19,7 @@ namespace WBFZTASK { private: QString createTime; QString orderStatus; - int orderId; + QString orderId; QString orderMode; QString ip; QString orderDownloadAddr; @@ -50,8 +50,8 @@ namespace WBFZTASK { void setOrderStatus(const QString& value); QString getOrderStatus() const; - void setOrderId(int value); - int getOrderId() const; + void setOrderId(QString value); + QString getOrderId() const; void setOrderMode(const QString& value); QString getOrderMode() const;