增加状态更新
parent
d16f28c699
commit
590882e763
|
@ -509,3 +509,7 @@ compile_commands.json
|
|||
|
||||
*_qmlcache.qrc
|
||||
|
||||
testdata/
|
||||
/testdata
|
||||
|
||||
|
||||
|
|
|
@ -4,14 +4,31 @@
|
|||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QFormLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QHttpMultiPart>
|
||||
#include <QUrlQuery>
|
||||
#include <QLineEdit>
|
||||
#include <QDateTimeEdit>
|
||||
#include <QPushButton>
|
||||
#include <QNetworkReply>
|
||||
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDialog>
|
||||
#include "TaskOrder.h"
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
|
@ -24,27 +24,11 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>576</width>
|
||||
<height>292</height>
|
||||
<width>580</width>
|
||||
<height>597</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordercode">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OWLS_PC_DF_20240802150813_4570</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_applicant">
|
||||
<property name="minimumSize">
|
||||
|
@ -58,7 +42,54 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_createtime">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2024-08-02 15:08:13</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_applicant">
|
||||
<property name="text">
|
||||
<string>申请人:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QDateTimeEdit" name="dateTimeEditDateTIme">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="date">
|
||||
<date>
|
||||
<year>2001</year>
|
||||
<month>11</month>
|
||||
<day>11</day>
|
||||
</date>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>订单完成时间</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ResultFilePath">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
@ -68,10 +99,17 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_orderid">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_contactinfo">
|
||||
<property name="text">
|
||||
<string>订单id:</string>
|
||||
<string>联系方式:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>仿真项目名称:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -88,10 +126,40 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>成果文件:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_ordercode">
|
||||
<property name="text">
|
||||
<string>订单编号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordercode">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OWLS_PC_DF_20240802150813_4570</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_orderid">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
@ -104,36 +172,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_applicant">
|
||||
<property name="text">
|
||||
<string>申请人:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_createtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2024-08-02 15:08:13</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_ordercode">
|
||||
<property name="text">
|
||||
<string>订单编号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_createtime">
|
||||
<property name="text">
|
||||
|
@ -141,21 +179,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_orderid">
|
||||
<property name="text">
|
||||
<string>成果文件:</string>
|
||||
<string>订单id:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_contactinfo">
|
||||
<property name="text">
|
||||
<string>联系方式:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<item row="7" column="2">
|
||||
<widget class="QPushButton" name="pushButton_Select">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
@ -168,23 +199,20 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_simulationProduct">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "DialogTaskOrder.h"
|
||||
#include "ui_DialogTaskOrder.h"
|
||||
#include <QMessageBox>
|
||||
#include <QJsonDocument>
|
||||
#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()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>893</width>
|
||||
<width>1087</width>
|
||||
<height>740</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -24,54 +24,50 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>852</width>
|
||||
<height>1007</height>
|
||||
<width>1050</width>
|
||||
<height>791</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_orderid">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_ordersource">
|
||||
<property name="text">
|
||||
<string>订单id:</string>
|
||||
<string>订单来源:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_orderid">
|
||||
<item row="10" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_intention">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>348</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_ordercode">
|
||||
<property name="text">
|
||||
<string>订单编号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordercode">
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_orderstoreprocess">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OWLS_PC_DF_20240802150813_4570</string>
|
||||
<string>订单处理进度:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -82,19 +78,34 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_createtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item row="11" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_demand">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_applicant">
|
||||
<property name="text">
|
||||
<string>2024-08-02 15:08:13</string>
|
||||
<string>申请人:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_orderid">
|
||||
<property name="text">
|
||||
<string>订单id:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_demand">
|
||||
<property name="text">
|
||||
<string>仿真需求:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -105,40 +116,51 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordermode">
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_company">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>苏研院</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_orderdetails">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_orderstatus">
|
||||
<property name="text">
|
||||
<string>订单状态:</string>
|
||||
<string>订单详情:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="comboBox_orderstatus">
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_contactinfo">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_userid">
|
||||
<property name="text">
|
||||
<string>需求用户ID:</string>
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -158,43 +180,20 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_ordersource">
|
||||
<property name="text">
|
||||
<string>订单来源:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordersource">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_Orderstatus">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>应用技术集成与共享服务分系统</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_applicant">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_ordercode">
|
||||
<property name="text">
|
||||
<string>申请人:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_applicant">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>zyg990305zyg@163.com</string>
|
||||
<string>订单编号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -205,19 +204,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_contactinfo">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_company">
|
||||
<property name="text">
|
||||
|
@ -225,90 +211,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_company">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>苏研院</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_intention">
|
||||
<property name="text">
|
||||
<string>仿真目的:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_intention">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_demand">
|
||||
<property name="text">
|
||||
<string>仿真需求:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_demand">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_orderdetails">
|
||||
<property name="text">
|
||||
<string>订单详情:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_orderdetails"/>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_orderstoreprocess">
|
||||
<property name="text">
|
||||
<string>订单处理进度:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_orderstoreprocess"/>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_updatetime">
|
||||
<property name="text">
|
||||
<string>订单更新时间:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_ordertype">
|
||||
<property name="text">
|
||||
<string>订单类型:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordertype">
|
||||
<property name="enabled">
|
||||
|
@ -325,8 +227,27 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_updatetime">
|
||||
<item row="12" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_orderdetails">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordermode">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
|
@ -338,6 +259,175 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_createtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2024-08-02 15:08:13</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_userid">
|
||||
<property name="text">
|
||||
<string>需求用户ID:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordercode">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OWLS_PC_DF_20240802150813_4570</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_ordersource">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>应用技术集成与共享服务分系统</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_ordertype">
|
||||
<property name="text">
|
||||
<string>订单类型:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_updatetime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>订单更新时间:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_orderid">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>348</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_orderstatus">
|
||||
<property name="text">
|
||||
<string>订单状态:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_applicant">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>zyg990305zyg@163.com</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_intention">
|
||||
<property name="text">
|
||||
<string>仿真目的:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_updatetime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_orderstoreprocess">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="pushButtonUpdateOrderState">
|
||||
<property name="text">
|
||||
<string>更新状态</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -379,6 +469,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="submitBtn">
|
||||
<property name="text">
|
||||
<string>提交成果</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
|
|
|
@ -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++) {
|
||||
// °´ÕÕÁÐÌí¼Ó
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>qt5_applications_Qt</QtInstall>
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;opengl;network;gui;help;widgets;location;webchannel;websockets;webengine;datavisualization;networkauth;remoteobjects</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
|
@ -93,7 +93,7 @@
|
|||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
|
@ -104,9 +104,11 @@
|
|||
<ClCompile Include="LAMPTaskManagerMainWindows.cpp" />
|
||||
<ClCompile Include="LAMPWBDDManager.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="SarUploadDialog.cpp" />
|
||||
<ClCompile Include="TaskOrder.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="SarUploadDialog.h" />
|
||||
<QtMoc Include="DialogTaskOrder.h" />
|
||||
<QtMoc Include="LAMPTaskManagerMainWindows.h" />
|
||||
<QtMoc Include="DialogSubmitTaskResult.h" />
|
||||
|
@ -117,6 +119,7 @@
|
|||
<QtUic Include="DialogSubmitTaskResult.ui" />
|
||||
<QtUic Include="DialogTaskOrder.ui" />
|
||||
<QtUic Include="LAMPTaskManagerMainWindows.ui" />
|
||||
<QtUic Include="SarUploadDialog.ui" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
<ClCompile Include="DialogSubmitTaskResult.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SarUploadDialog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="LAMPWBDDManager.h">
|
||||
|
@ -60,6 +63,9 @@
|
|||
<QtMoc Include="DialogSubmitTaskResult.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="SarUploadDialog.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="DialogTaskOrder.ui">
|
||||
|
@ -71,5 +77,8 @@
|
|||
<QtUic Include="DialogSubmitTaskResult.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="SarUploadDialog.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace LAMPWBCONNECT {
|
|||
public:
|
||||
void loginIn();
|
||||
void getTaskList(int count, int pagenum);
|
||||
|
||||
static void updateTaskoderStatus(QString taskid, QString taskstatus);
|
||||
|
||||
public :
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SarUploadDialog</class>
|
||||
<widget class="QDialog" name="SarUploadDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>510</width>
|
||||
<height>236</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>SAR Data Upload Controller</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Upload Parameters ( * required)</string>
|
||||
</property>
|
||||
<layout class="QFormLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_dataSource">
|
||||
<property name="text">
|
||||
<string>dataSource*:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leFilePath"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnBrowse">
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnExecute">
|
||||
<property name="text">
|
||||
<string>Execute</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClear">
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCancel">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,139 @@
|
|||
#include "SarUploadDialog.h"
|
||||
|
||||
#include "saruploaddialog.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QFormLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QHttpMultiPart>
|
||||
#include <QUrlQuery>
|
||||
#include <QLineEdit>
|
||||
#include <QDateTimeEdit>
|
||||
#include <QPushButton>
|
||||
#include <QNetworkReply>
|
||||
|
||||
|
||||
|
||||
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;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef SARUPLOADDIALOG_H
|
||||
#define SARUPLOADDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
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
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SarUploadDialog</class>
|
||||
<widget class="QDialog" name="SarUploadDialog">
|
||||
<property name="windowTitle">
|
||||
<string>SAR Data Upload Controller</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Upload Parameters ( * required)</string>
|
||||
</property>
|
||||
<layout class="QFormLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_dataSource">
|
||||
<property name="text">
|
||||
<string>dataSource*:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leFilePath"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnBrowse">
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<!-- 其他参数项类似,此处省略完整XML -->
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnExecute">
|
||||
<property name="text">
|
||||
<string>Execute</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClear">
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCancel">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -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; }
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue