From d16f28c699fcd1869a3d1ab3056edddc4a595e51 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, 18 Mar 2025 23:16:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DialogSubmitTaskResult.cpp | 70 ++++++ DialogSubmitTaskResult.h | 30 +++ DialogSubmitTaskResult.ui | 272 +++++++++++++++++++++ DialogTaskOrder.cpp | 40 +++ DialogTaskOrder.h | 26 ++ DialogTaskOrder.ui | 428 +++++++++++++++++++++++++++++++++ LAMPTaskManagerMainWindows.cpp | 183 ++++++++++++++ LAMPTaskManagerMainWindows.h | 42 ++++ LAMPTaskManagerMainWindows.ui | 171 +++++++++++++ LAMPWBDD.sln | 25 ++ LAMPWBDD.vcxproj | 127 ++++++++++ LAMPWBDD.vcxproj.filters | 75 ++++++ LAMPWBDDManager.cpp | 70 ++++++ LAMPWBDDManager.h | 24 ++ TaskOrder.cpp | 238 ++++++++++++++++++ TaskOrder.h | 143 +++++++++++ main.cpp | 17 ++ 17 files changed, 1981 insertions(+) create mode 100644 DialogSubmitTaskResult.cpp create mode 100644 DialogSubmitTaskResult.h create mode 100644 DialogSubmitTaskResult.ui create mode 100644 DialogTaskOrder.cpp create mode 100644 DialogTaskOrder.h create mode 100644 DialogTaskOrder.ui create mode 100644 LAMPTaskManagerMainWindows.cpp create mode 100644 LAMPTaskManagerMainWindows.h create mode 100644 LAMPTaskManagerMainWindows.ui create mode 100644 LAMPWBDD.sln create mode 100644 LAMPWBDD.vcxproj create mode 100644 LAMPWBDD.vcxproj.filters create mode 100644 LAMPWBDDManager.cpp create mode 100644 LAMPWBDDManager.h create mode 100644 TaskOrder.cpp create mode 100644 TaskOrder.h create mode 100644 main.cpp diff --git a/DialogSubmitTaskResult.cpp b/DialogSubmitTaskResult.cpp new file mode 100644 index 0000000..a99e016 --- /dev/null +++ b/DialogSubmitTaskResult.cpp @@ -0,0 +1,70 @@ +#include "DialogSubmitTaskResult.h" +#include "ui_DialogSubmitTaskResult.h" +#include +#include +#include +#include +#include "TaskOrder.h" +namespace WBFZTASK { + DialogSubmitTaskResult::DialogSubmitTaskResult(QWidget* parent) + : QDialog(parent) + ,ui(new Ui::DialogSubmitTaskResultClass) + { + ui->setupUi(this); + QObject::connect(ui->pushButton_Select, SIGNAL(clicked()), this, SLOT(on_clicked_pushButton_Select())); + } + + DialogSubmitTaskResult::~DialogSubmitTaskResult() + { + + + } + void DialogSubmitTaskResult::SetTaskOrder(WBFZTASK::TaskOrder* task) + { + this->task = task; + this->ui->lineEdit_applicant->setText(task->getApplicant()); + + 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())); + + } + void DialogSubmitTaskResult::accept() + { + QMessageBox::information(this, u8"信息", u8"成果文件提交成功"); + } + + + void DialogSubmitTaskResult::on_clicked_pushButton_Select() { + // 创建文件对话框 + QFileDialog fileDialog; + fileDialog.setFileMode(QFileDialog::ExistingFiles); + fileDialog.setNameFilter(tr("ZIP files (*.zip)")); + fileDialog.setViewMode(QFileDialog::List); + + // 显示文件对话框并获取选中的文件路径 + QString fileNames=fileDialog.getOpenFileName(); + + // 处理选择的文件 + if (!fileNames.isEmpty()) + { + QString fileName = fileNames; // 这里假设用户选择了一个文件 + ui->lineEdit_ResultFilePath->setText(fileName); + // 这里可以进一步处理选中的 ZIP 文件,例如读取或解压 + } + else + { + qDebug() << "No file selected."; + } + } + +} + + +/* + QPushButton *pushButton_Select; + QPushButton *okButton; + QPushButton *cancelButton; + +*/ \ No newline at end of file diff --git a/DialogSubmitTaskResult.h b/DialogSubmitTaskResult.h new file mode 100644 index 0000000..c22ec74 --- /dev/null +++ b/DialogSubmitTaskResult.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include "TaskOrder.h" + + + +namespace Ui { + class DialogSubmitTaskResultClass; +} + + +namespace WBFZTASK { + class DialogSubmitTaskResult : public QDialog + { + Q_OBJECT + + public: + DialogSubmitTaskResult(QWidget* parent = nullptr); + ~DialogSubmitTaskResult(); + void SetTaskOrder(WBFZTASK::TaskOrder* task); + public slots: + void on_clicked_pushButton_Select(); + void accept(); + + private: + Ui::DialogSubmitTaskResultClass* ui; + WBFZTASK::TaskOrder* task; + }; +} \ No newline at end of file diff --git a/DialogSubmitTaskResult.ui b/DialogSubmitTaskResult.ui new file mode 100644 index 0000000..7eb2f68 --- /dev/null +++ b/DialogSubmitTaskResult.ui @@ -0,0 +1,272 @@ + + + DialogSubmitTaskResultClass + + + + 0 + 0 + 600 + 656 + + + + 鎴愭灉鎻愪氦椤甸潰 + + + + + + true + + + + + 0 + 0 + 576 + 292 + + + + + + + false + + + + 0 + 30 + + + + OWLS_PC_DF_20240802150813_4570 + + + + + + + + 0 + 30 + + + + zyg990305zyg@163.com + + + + + + + + 0 + 30 + + + + + + + + 璁㈠崟id: + + + + + + + + 0 + 30 + + + + + + + + + + + false + + + + 0 + 30 + + + + 348 + + + + + + + 鐢宠浜: + + + + + + + false + + + + 0 + 30 + + + + 2024-08-02 15:08:13 + + + + + + + 璁㈠崟缂栧彿: + + + + + + + 璁㈠崟鍒涘缓鏃堕棿: + + + + + + + 鎴愭灉鏂囦欢锛 + + + + + + + 鑱旂郴鏂瑰紡: + + + + + + + + 0 + 30 + + + + 閫夋嫨 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + + + okButton + clicked() + DialogSubmitTaskResultClass + accept() + + + 461 + 627 + + + 299 + 327 + + + + + cancelButton + clicked() + DialogSubmitTaskResultClass + reject() + + + 547 + 627 + + + 299 + 327 + + + + + diff --git a/DialogTaskOrder.cpp b/DialogTaskOrder.cpp new file mode 100644 index 0000000..05aa7ff --- /dev/null +++ b/DialogTaskOrder.cpp @@ -0,0 +1,40 @@ +#include "DialogTaskOrder.h" +#include "ui_DialogTaskOrder.h" +#include + +namespace WBFZTASK { + DialogTaskOrder::DialogTaskOrder(QWidget* parent) + : QDialog(parent) + , ui(new Ui::DialogTaskOrder) + { + ui->setupUi(this); + } + + DialogTaskOrder::~DialogTaskOrder() + {} + + void DialogTaskOrder::SetTaskOrder(WBFZTASK::TaskOrder* task) + { + this->task = task; + this->ui->lineEdit_applicant->setText(task->getApplicant()); + this->ui->lineEdit_company->setText(task->getCompany()); + 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_ordermode->setText(task->getOrderMode()); + this->ui->lineEdit_ordersource->setText(task->getOrderSource()); + this->ui->lineEdit_ordertype->setText(task->getOrderType()); + this->ui->lineEdit_updatetime->setText(task->getUpdateTime()); + this->ui->lineEdit_userid->setText(task->getUserId()); + this->ui->plainTextEdit_demand->setPlainText(task->getDemand()); + this->ui->plainTextEdit_intention->setPlainText(task->getIntention()); + this->ui->plainTextEdit_orderdetails->setPlainText(task->getOrderDetails()); + this->ui->plainTextEdit_orderstoreprocess->setPlainText(task->getOrderStoreProcess()); + } + + + void DialogTaskOrder::accept() { + QMessageBox::information(this, u8"信息", u8"信息更新成功"); + } +} \ No newline at end of file diff --git a/DialogTaskOrder.h b/DialogTaskOrder.h new file mode 100644 index 0000000..ef2c1d1 --- /dev/null +++ b/DialogTaskOrder.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "TaskOrder.h" + +namespace Ui { + class DialogTaskOrder; +} + +namespace WBFZTASK { + class DialogTaskOrder : public QDialog + { + Q_OBJECT + + public: + DialogTaskOrder(QWidget* parent = nullptr); + ~DialogTaskOrder(); + void SetTaskOrder(WBFZTASK::TaskOrder* task); + public slots: + void accept(); + + private: + Ui::DialogTaskOrder* ui; + WBFZTASK::TaskOrder* task; + }; +} \ No newline at end of file diff --git a/DialogTaskOrder.ui b/DialogTaskOrder.ui new file mode 100644 index 0000000..0fcdf90 --- /dev/null +++ b/DialogTaskOrder.ui @@ -0,0 +1,428 @@ + + + DialogTaskOrder + + + + 0 + 0 + 893 + 740 + + + + 浠诲姟璇︾粏鐣岄潰 + + + + + + true + + + + + 0 + 0 + 852 + 1007 + + + + + + + 璁㈠崟id: + + + + + + + false + + + + 0 + 30 + + + + 348 + + + + + + + 璁㈠崟缂栧彿: + + + + + + + false + + + + 0 + 30 + + + + OWLS_PC_DF_20240802150813_4570 + + + + + + + 璁㈠崟鍒涘缓鏃堕棿: + + + + + + + false + + + + 0 + 30 + + + + 2024-08-02 15:08:13 + + + + + + + 璁㈠崟妯″紡: + + + + + + + false + + + + 0 + 30 + + + + + + + + 璁㈠崟鐘舵: + + + + + + + + 0 + 30 + + + + + + + + 闇姹傜敤鎴稩D: + + + + + + + false + + + + 0 + 30 + + + + ZZX-gxfw001030 + + + + + + + 璁㈠崟鏉ユ簮: + + + + + + + + 0 + 30 + + + + 搴旂敤鎶鏈泦鎴愪笌鍏变韩鏈嶅姟鍒嗙郴缁 + + + + + + + 鐢宠浜: + + + + + + + + 0 + 30 + + + + zyg990305zyg@163.com + + + + + + + 鑱旂郴鏂瑰紡: + + + + + + + + 0 + 30 + + + + + + + + + + + 闇姹傚崟浣: + + + + + + + + 0 + 30 + + + + 鑻忕爺闄 + + + + + + + 浠跨湡鐩殑: + + + + + + + false + + + + 0 + 50 + + + + + + + + 浠跨湡闇姹: + + + + + + + + 0 + 300 + + + + + + + + 璁㈠崟璇︽儏: + + + + + + + + + + 璁㈠崟澶勭悊杩涘害: + + + + + + + + + + 璁㈠崟鏇存柊鏃堕棿: + + + + + + + 璁㈠崟绫诲瀷: + + + + + + + false + + + + 0 + 30 + + + + 寰尝浠跨湡璁㈠崟 + + + + + + + false + + + + 0 + 30 + + + + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + + okButton + clicked() + DialogTaskOrder + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + DialogTaskOrder + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/LAMPTaskManagerMainWindows.cpp b/LAMPTaskManagerMainWindows.cpp new file mode 100644 index 0000000..43a3060 --- /dev/null +++ b/LAMPTaskManagerMainWindows.cpp @@ -0,0 +1,183 @@ +#include "LAMPTaskManagerMainWindows.h" +#include "LAMPWBDDManager.h" +#include "ui_LAMPTaskManagerMainWindows.h" +#include "DialogTaskOrder.h" +#include "DialogSubmitTaskResult.h" +namespace WBFZTASK { + LAMPTaskManagerMainWindows::LAMPTaskManagerMainWindows(QWidget* parent) + : QMainWindow(parent) + , ui(new Ui::LAMPTaskManagerMainWindowsClass) + { + connectmanager = new LAMPWBCONNECT::LAMPWBDDManager; + + ui->setupUi(this); + QObject::connect(TaskCollect::getInstance(), SIGNAL(updateSIG(WBTASKSAPIREQURSTSTATE, QString)), this, SLOT(updateTaskListCollect(WBTASKSAPIREQURSTSTATE , QString ))); + QObject::connect(ui->pushButton_Search ,SIGNAL(clicked()),this,SLOT(on_clicked_pushButton_Search ())); + QObject::connect(ui->pushButton_ShowTask,SIGNAL(clicked()),this,SLOT(on_clicked_pushButton_ShowTask())); + QObject::connect(ui->pushButton_LastPage,SIGNAL(clicked()),this,SLOT(on_clicked_pushButton_LastPage())); + QObject::connect(ui->pushButton_NextPage,SIGNAL(clicked()),this,SLOT(on_clicked_pushButton_NextPage())); + QObject::connect(ui->pushButton_submitResult, SIGNAL(clicked()), this, SLOT(on_clicked_pushButton_submitResult())); + + + ui->spinBox_PageIdx->setMinimum(1); + ui->spinBox_PageIdx->setValue(1); + ui->spinBox_PageIdx->setMaximum(10000); + ui->pushButton_LastPage->setEnabled(false); + ui->pushButton_NextPage->setEnabled(false); + } + + LAMPTaskManagerMainWindows::~LAMPTaskManagerMainWindows() + {} + + void LAMPTaskManagerMainWindows::ClearTable() + { + // ui->table + ui->tableWidget->clear(); + + } + + void LAMPTaskManagerMainWindows::ShowTable() + { + + this->ClearTable(); + TaskCollect* taskcollect = TaskCollect::getInstance(); + + QStringList headers = { + u8"订单ID",u8"订单模式",u8"订单状态",u8"订单目的",u8"申请人",u8"创建时间" + }; + + ui->tableWidget->setColumnCount(headers.size()); + ui->tableWidget->setHorizontalHeaderLabels(headers); + ui->tableWidget->setRowCount(taskcollect->getPagecount()); + qDebug() << "page Count : " << taskcollect->getPagecount(); + + + QString colname = ""; + + + + for (int rowidx = 0; rowidx < taskcollect->getPagecount();rowidx++) { + // 按照列添加 + + for (int colidx = 0; colidx < headers.count(); colidx++) { + colname= ui->tableWidget->model()->headerData(colidx, Qt::Horizontal).toString(); + if(colname.contains(u8"订单ID")){ + ui->tableWidget->setItem(rowidx, colidx, new QTableWidgetItem(QString("%1").arg(taskcollect->getCurrentTaskAt(rowidx)->getOrderId()))); + } + else if(colname.contains(u8"订单模式")){ + ui->tableWidget->setItem(rowidx, colidx, new QTableWidgetItem(QString("%1").arg(taskcollect->getCurrentTaskAt(rowidx)->getOrderMode()))); + } + else if(colname.contains(u8"订单状态")){ + ui->tableWidget->setItem(rowidx, colidx, new QTableWidgetItem(QString("%1").arg(taskcollect->getCurrentTaskAt(rowidx)->getOrderStatus()))); + } + else if(colname.contains(u8"订单目的")){ + ui->tableWidget->setItem(rowidx, colidx, new QTableWidgetItem(QString("%1").arg(taskcollect->getCurrentTaskAt(rowidx)->getIntention()))); + } + else if(colname.contains(u8"申请人")){ + ui->tableWidget->setItem(rowidx, colidx, new QTableWidgetItem(QString("%1").arg(taskcollect->getCurrentTaskAt(rowidx)->getApplicant()))); + } + else if (colname.contains(u8"创建时间")) { + ui->tableWidget->setItem(rowidx, colidx, new QTableWidgetItem(QString("%1").arg(taskcollect->getCurrentTaskAt(rowidx)->getCreateTime()))); + } + else { + + } + } + } + + // 处理显示信息 + int alltaskcount = taskcollect->getTotal(); + int pageCount = taskcollect->getPagecount(); + int Pagetotal = alltaskcount / pageCount +( alltaskcount % pageCount == 0 ? 0 : 1); + ui->spinBox_PageIdx->setMaximum(Pagetotal); + ui->statusBar->showMessage(QString(u8"第 %1 页 / 共 %2 页").arg(taskcollect->getPagenum()).arg(Pagetotal)); + ui->spinBox_PageIdx->setValue(taskcollect->getPagenum()); + if (taskcollect->getPagenum() == 1) { + ui->pushButton_LastPage->setEnabled(false); + } + else { + ui->pushButton_LastPage->setEnabled(true); + } + + if (taskcollect->getPagenum() == Pagetotal) { + ui->pushButton_NextPage->setEnabled(false); + } + else { + ui->pushButton_NextPage->setEnabled(true); + } + } + + void LAMPTaskManagerMainWindows::on_clicked_pushButton_Search() + { + int searchPage = ui->spinBox_PageIdx->value(); + int searchPageNum = ui->spinBox_tasknum->value(); + ui->statusBar->showMessage(QString(u8"正在查询 第 %1 页 中, 每页任务数:%2 ....").arg(searchPage).arg(searchPageNum)); + connectmanager->getTaskList(searchPageNum, searchPage); + } + + void LAMPTaskManagerMainWindows::on_clicked_pushButton_ShowTask() + { + if (ui->tableWidget->selectedItems().isEmpty()) { + return; + } + int currentRow = ui->tableWidget->currentRow(); + + + WBFZTASK::DialogTaskOrder* dialogtaskshow = new WBFZTASK::DialogTaskOrder(this); + dialogtaskshow->SetTaskOrder(TaskCollect::getInstance()->getCurrentTaskAt(currentRow)); + dialogtaskshow->exec(); + } + + void LAMPTaskManagerMainWindows::on_clicked_pushButton_LastPage() + { + int searchPage = TaskCollect::getInstance()->getPagenum()-1; + int searchPageNum = ui->spinBox_tasknum->value(); + ui->statusBar->showMessage(QString(u8"正在查询 第 %1 页 中, 每页任务数:%2 ....").arg(searchPage).arg(searchPageNum)); + connectmanager->getTaskList(searchPageNum, searchPage); + } + + void LAMPTaskManagerMainWindows::on_clicked_pushButton_NextPage() + { + int searchPage = TaskCollect::getInstance()->getPagenum()+1; + int searchPageNum = ui->spinBox_tasknum->value(); + ui->statusBar->showMessage(QString(u8"正在查询 第 %1 页 中, 每页任务数:%2 ....").arg(searchPage).arg(searchPageNum)); + connectmanager->getTaskList(searchPageNum, searchPage); + } + + void LAMPTaskManagerMainWindows::on_clicked_pushButton_submitResult() + { + if (ui->tableWidget->selectedItems().isEmpty()) { + return; + } + int currentRow = ui->tableWidget->currentRow(); + + DialogSubmitTaskResult* dialog = new DialogSubmitTaskResult; + dialog->SetTaskOrder(TaskCollect::getInstance()->getCurrentTaskAt(currentRow)); + dialog->exec(); + } + + + void LAMPTaskManagerMainWindows::updateTaskListCollect(WBTASKSAPIREQURSTSTATE state, QString message) { + // 触发更新 + + switch (state) { + case WBTASKSAPIREQURSTSTATE::ERROR: { + ui->statusBar->showMessage(QString(u8"查询错误: ").arg(message)); + break; + } + case WBTASKSAPIREQURSTSTATE::FAIL: { + ui->statusBar->showMessage(QString(u8"查询失败: ").arg(message)); + break; + } + case WBTASKSAPIREQURSTSTATE::SUCCESS: { + + this->ShowTable(); + break; + } + default: + ui->statusBar->showMessage(QString(u8"请重试,信息:").arg(message)); + break; + } + } + +} \ No newline at end of file diff --git a/LAMPTaskManagerMainWindows.h b/LAMPTaskManagerMainWindows.h new file mode 100644 index 0000000..bb9fa87 --- /dev/null +++ b/LAMPTaskManagerMainWindows.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include "TaskOrder.h" +#include "LAMPWBDDManager.h" + + +namespace Ui { + class LAMPTaskManagerMainWindowsClass; +} + + +namespace WBFZTASK { + class LAMPTaskManagerMainWindows : public QMainWindow + { + Q_OBJECT + + public: + LAMPTaskManagerMainWindows(QWidget* parent = nullptr); + ~LAMPTaskManagerMainWindows(); + + public : + void ClearTable(); + void ShowTable(); + + + public slots: + void updateTaskListCollect(WBTASKSAPIREQURSTSTATE state, QString message); + void on_clicked_pushButton_Search(); + void on_clicked_pushButton_ShowTask(); + void on_clicked_pushButton_LastPage(); + void on_clicked_pushButton_NextPage(); + void on_clicked_pushButton_submitResult(); + + private: + QString LoginName; + LAMPWBCONNECT::LAMPWBDDManager* connectmanager; + + private: + Ui::LAMPTaskManagerMainWindowsClass* ui; + }; +} \ No newline at end of file diff --git a/LAMPTaskManagerMainWindows.ui b/LAMPTaskManagerMainWindows.ui new file mode 100644 index 0000000..f8bd436 --- /dev/null +++ b/LAMPTaskManagerMainWindows.ui @@ -0,0 +1,171 @@ + + + LAMPTaskManagerMainWindowsClass + + + + 0 + 0 + 1218 + 579 + + + + LAMPTaskManagerMainWindows + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 30 + + + + 鏌ヨ + + + + + + + + 0 + 30 + + + + 鏌ョ湅璁㈠崟 + + + + + + + + 0 + 30 + + + + 鎻愪氦璁㈠崟鎴愭灉 + + + + + + + + 0 + 30 + + + + 涓婁竴椤 + + + + + + + + 0 + 30 + + + + 涓嬩竴椤 + + + + + + + 姣忔鏌ヨ鏉℃暟 + + + + + + + false + + + 1 + + + 100 + + + 100 + + + + + + + 璺宠浆绗 + + + + + + + + 27 + 0 + + + + 1 + + + 1000 + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + diff --git a/LAMPWBDD.sln b/LAMPWBDD.sln new file mode 100644 index 0000000..ab2bcf4 --- /dev/null +++ b/LAMPWBDD.sln @@ -0,0 +1,25 @@ +锘 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34701.34 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LAMPWBDD", "LAMPWBDD.vcxproj", "{F8B4568B-E065-48AF-916E-0A59A05C86CC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F8B4568B-E065-48AF-916E-0A59A05C86CC}.Debug|x64.ActiveCfg = Debug|x64 + {F8B4568B-E065-48AF-916E-0A59A05C86CC}.Debug|x64.Build.0 = Debug|x64 + {F8B4568B-E065-48AF-916E-0A59A05C86CC}.Release|x64.ActiveCfg = Release|x64 + {F8B4568B-E065-48AF-916E-0A59A05C86CC}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EF8E3423-CCAE-4D6C-B527-D130079BD542} + EndGlobalSection +EndGlobal diff --git a/LAMPWBDD.vcxproj b/LAMPWBDD.vcxproj new file mode 100644 index 0000000..fd5c543 --- /dev/null +++ b/LAMPWBDD.vcxproj @@ -0,0 +1,127 @@ +锘 + + + + Debug + x64 + + + Release + x64 + + + + {F8B4568B-E065-48AF-916E-0A59A05C86CC} + QtVS_v304 + 10.0 + 10.0 + $(MSBuildProjectDirectory)\QtMsBuild + + + + Application + v143 + true + Unicode + + + Application + v143 + false + true + Unicode + + + + + + + qt5_applications_Qt + core;gui;widgets + debug + + + qt5_applications_Qt + core;opengl;network;gui;help;widgets;location;webchannel;websockets;webengine;datavisualization;networkauth;remoteobjects + release + + + + + + + + + + + + + + + + + + + + + + EditAndContinue + false + Disabled + + + + + true + Level3 + true + true + + + Console + true + + + + + true + Level3 + true + true + true + true + + + Console + false + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LAMPWBDD.vcxproj.filters b/LAMPWBDD.vcxproj.filters new file mode 100644 index 0000000..be4643b --- /dev/null +++ b/LAMPWBDD.vcxproj.filters @@ -0,0 +1,75 @@ +锘 + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} + ts + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Form Files + + + Form Files + + + Form Files + + + \ No newline at end of file diff --git a/LAMPWBDDManager.cpp b/LAMPWBDDManager.cpp new file mode 100644 index 0000000..e3cd8c4 --- /dev/null +++ b/LAMPWBDDManager.cpp @@ -0,0 +1,70 @@ +#include "LAMPWBDDManager.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "TaskOrder.h" + +namespace LAMPWBCONNECT { + LAMPWBDDManager::LAMPWBDDManager() + { + } + LAMPWBDDManager::~LAMPWBDDManager() + { + } + void LAMPWBDDManager::loginIn() + { + + + } + 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"微波仿真订单")); + QUrlQuery query; + query.addQueryItem("count", QString::number(count)); + query.addQueryItem("pagenum", QString::number(pagenum)); + query.addQueryItem("orderType", QString(u8"微波仿真订单")); + url.setQuery(query); + + 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); + + + QByteArray postData;// = query.toString().toUtf8(); + 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["total"] ; + qDebug() << doc["pagenum"] ; + + 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 new file mode 100644 index 0000000..5d73c9d --- /dev/null +++ b/LAMPWBDDManager.h @@ -0,0 +1,24 @@ +#pragma once +// 微波订单管理界面 +#include +#include +#include +#include + +namespace LAMPWBCONNECT { + class LAMPWBDDManager + { + public: + LAMPWBDDManager(); + ~LAMPWBDDManager(); + public: + void loginIn(); + void getTaskList(int count, int pagenum); + + + public : + + + }; +} + diff --git a/TaskOrder.cpp b/TaskOrder.cpp new file mode 100644 index 0000000..4e4955c --- /dev/null +++ b/TaskOrder.cpp @@ -0,0 +1,238 @@ +#include "TaskOrder.h" +#include +#include +#include +#include +#include +namespace WBFZTASK { + + TaskCollect* TaskCollect::instance = nullptr; + + + TaskOrder::TaskOrder(){} + + TaskOrder::TaskOrder(const QJsonObject& jsonObj) { + // 使用QJsonObject初始化所有成员变量 + createTime = jsonObj["createtime"].toString(); + orderStatus = jsonObj["orderstatus"].toString(); + orderId = jsonObj["orderid"].toInt(); + orderMode = jsonObj["ordermode"].toString(); + ip = jsonObj["ip"].toString(); + orderDownloadAddr = jsonObj["orderdownloadaddr"].toString(); + userId = jsonObj["userid"].toString(); + demand = jsonObj["demand"].toString(); + orderSource = jsonObj["ordersource"].toString(); + applicant = jsonObj["applicant"].toString(); + intention = jsonObj["intention"].toString(); + orderStoreProcess = jsonObj["orderstoreprocess"].toString(); + orderCode = jsonObj["ordercode"].toString(); + qrstCode = jsonObj["qrstcode"].toString(); + contactInfo = jsonObj["contactinfo"].toString(); + orderDetails = jsonObj["orderdetails"].toString(); + company = jsonObj["company"].toString(); + dataSize = jsonObj["datasize"].toString(); + updateTime = jsonObj["updatetime"].toString(); + orderType = jsonObj["ordertype"].toString(); + + //// 打印 + + //for (auto key : jsonObj.keys()) { + // QJsonValue value = jsonObj.value(key); + + // // 检查值是否为 null + // if (value.isNull()) { + // qDebug() << key << ": null"; + // } + // else { + // qDebug() << key << ":" << value.toVariant().toString(); + // } + //} + + + + //qDebug() << "createTime " << createTime; + //qDebug() << "orderStatus " << orderStatus; + //qDebug() << "orderId " << orderId; + //qDebug() << "orderMode " << orderMode; + //qDebug() << "ip " << ip; + //qDebug() << "orderDownloadAddr " << orderDownloadAddr; + //qDebug() << "userId " << userId; + //qDebug() << "demand " << demand; + //qDebug() << "orderSource " << orderSource; + //qDebug() << "applicant " << applicant; + //qDebug() << "intention " << intention; + //qDebug() << "orderStoreProcess " << orderStoreProcess; + //qDebug() << "orderCode " << orderCode; + //qDebug() << "qrstCode " << qrstCode; + //qDebug() << "contactInfo " << contactInfo; + //qDebug() << "orderDetails " << orderDetails; + //qDebug() << "company " << company; + //qDebug() << "dataSize " << dataSize; + //qDebug() << "updateTime " << updateTime; + //qDebug() << "orderType " << orderType; + + } + + void TaskOrder::setCreateTime(const QString& value) { createTime = value; } + QString TaskOrder::getCreateTime() const { return createTime; } + + 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::setOrderMode(const QString& value) { orderMode = value; } + QString TaskOrder::getOrderMode() const { return orderMode; } + + void TaskOrder::setIp(const QString& value) { ip = value; } + QString TaskOrder::getIp() const { return ip; } + + void TaskOrder::setOrderDownloadAddr(const QString& value) { orderDownloadAddr = value; } + QString TaskOrder::getOrderDownloadAddr() const { return orderDownloadAddr; } + + void TaskOrder::setUserId(const QString& value) { userId = value; } + QString TaskOrder::getUserId() const { return userId; } + + void TaskOrder::setDemand(const QString& value) { demand = value; } + QString TaskOrder::getDemand() const { return demand; } + + void TaskOrder::setOrderSource(const QString& value) { orderSource = value; } + QString TaskOrder::getOrderSource() const { return orderSource; } + + void TaskOrder::setApplicant(const QString& value) { applicant = value; } + QString TaskOrder::getApplicant() const { return applicant; } + + void TaskOrder::setIntention(const QString& value) { intention = value; } + QString TaskOrder::getIntention() const { return intention; } + + void TaskOrder::setOrderStoreProcess(const QString& value) { orderStoreProcess = value; } + QString TaskOrder::getOrderStoreProcess() const { return orderStoreProcess; } + + void TaskOrder::setOrderCode(const QString& value) { orderCode = value; } + QString TaskOrder::getOrderCode() const { return orderCode; } + + void TaskOrder::setQrstCode(const QString& value) { qrstCode = value; } + QString TaskOrder::getQrstCode() const { return qrstCode; } + + void TaskOrder::setContactInfo(const QString& value) { contactInfo = value; } + QString TaskOrder::getContactInfo() const { return contactInfo; } + + void TaskOrder::setOrderDetails(const QString& value) { orderDetails = value; } + QString TaskOrder::getOrderDetails() const { return orderDetails; } + + void TaskOrder::setCompany(const QString& value) { company = value; } + QString TaskOrder::getCompany() const { return company; } + + void TaskOrder::setDataSize(const QString& value) { dataSize = value; } + QString TaskOrder::getDataSize() const { return dataSize; } + + void TaskOrder::setUpdateTime(const QString& value) { updateTime = value; } + QString TaskOrder::getUpdateTime() const { return updateTime; } + + void TaskOrder::setOrderType(const QString& value) { orderType = value; } + QString TaskOrder::getOrderType() const { return orderType; } + + void TaskCollect::LoadTaskCollect(QJsonDocument& doc, QString message) + { + + this->Currnettasklist.clear(); + + if (doc["msg"].toString().contains("SUCCESS")) { + qDebug() << "state SUCCESS"; + this->state = WBTASKSAPIREQURSTSTATE::SUCCESS; + + this->total = doc["total"].toInt(); + this->pagenum = doc["pagenum"].toInt(); + + QJsonValue data = doc["data"]; + if (data.isArray()) { + + QJsonArray datalist = data.toArray(); + + for (size_t i = 0; i < datalist.count(); i++) { + QJsonObject jsonObj = datalist.at(i).toObject(); + + if (jsonObj.contains("ordertype") && !(jsonObj["ordertype"].isNull()) && (jsonObj["ordertype"].toString().contains(QString(u8"微波仿真订单")))) + { + TaskOrder neworder(jsonObj); + this->Currnettasklist.append(neworder); + } + else { + //qDebug() << jsonObj.contains("ordertype") <<" "<< !(jsonObj["ordertype"].isNull()) <<" "<<(jsonObj["ordertype"].toString().contains(QString(u8"微波仿真订单")))<<" "<< jsonObj["ordertype"].toString(); + //TaskOrder neworder(jsonObj); + //this->Currnettasklist.append(neworder); + } + } + this->pagecount = this->Currnettasklist.count(); + qDebug() << "load data array , count " << this->pagecount; + } + else { + this->pagecount = 0; + } + + } + else { + qDebug() << "state not SUCCESS"; + this->state = WBTASKSAPIREQURSTSTATE::FAIL; + this->total = 0; + this->pagenum = 0; + this->pagecount = 0; + } + this->pagecount = this->Currnettasklist.count(); + emit this->updateSIG(this->state,message); + } + + void TaskCollect::LoadTaskCollectState(QString message) + { + this->clear(); + this->state= WBTASKSAPIREQURSTSTATE::ERROR; + emit this->updateSIG(this->state, message); + } + + TaskCollect* TaskCollect::getInstance() + { + + if (nullptr == TaskCollect::instance) { + TaskCollect::instance = new TaskCollect; + } + else {} + return TaskCollect::instance; + } + + int TaskCollect::clear() + { + this->state = WBTASKSAPIREQURSTSTATE::FAIL; + this->total = 0; + this->pagenum = 0; + this->pagecount = 0; + return 0; + } + + int TaskCollect::getPagenum() + { + return this->pagenum; + } + + int TaskCollect::getTotal() + { + return this->total; + } + + int TaskCollect::getPagecount() + { + return this->pagecount; + } + + TaskOrder* TaskCollect::getCurrentTaskAt(int i) + { + return &this->Currnettasklist[i]; + } + + TaskCollect::TaskCollect() { + this->state = WBTASKSAPIREQURSTSTATE::FAIL; + this->total = 0; + this->pagenum = 0; + this->pagecount = 0; + } +} \ No newline at end of file diff --git a/TaskOrder.h b/TaskOrder.h new file mode 100644 index 0000000..093daf6 --- /dev/null +++ b/TaskOrder.h @@ -0,0 +1,143 @@ +#pragma once +#ifndef ORDER_H +#define ORDER_H + +#include +#include +#include + +namespace WBFZTASK { + + enum WBTASKSAPIREQURSTSTATE { + FAIL, + SUCCESS, + ERROR + }; + + + class TaskOrder { + private: + QString createTime; + QString orderStatus; + int orderId; + QString orderMode; + QString ip; + QString orderDownloadAddr; + QString userId; + QString demand; + QString orderSource; + QString applicant; + QString intention; + QString orderStoreProcess; + QString orderCode; + QString qrstCode; + QString contactInfo; + QString orderDetails; + QString company; + QString dataSize; + QString updateTime; + QString orderType; + + public: + // 构造函数 + TaskOrder(); + TaskOrder(const QJsonObject& jsonObj); + + // Getter 和 Setter 方法 + void setCreateTime(const QString& value); + QString getCreateTime() const; + + void setOrderStatus(const QString& value); + QString getOrderStatus() const; + + void setOrderId(int value); + int getOrderId() const; + + void setOrderMode(const QString& value); + QString getOrderMode() const; + + void setIp(const QString& value); + QString getIp() const; + + void setOrderDownloadAddr(const QString& value); + QString getOrderDownloadAddr() const; + + void setUserId(const QString& value); + QString getUserId() const; + + void setDemand(const QString& value); + QString getDemand() const; + + void setOrderSource(const QString& value); + QString getOrderSource() const; + + void setApplicant(const QString& value); + QString getApplicant() const; + + void setIntention(const QString& value); + QString getIntention() const; + + void setOrderStoreProcess(const QString& value); + QString getOrderStoreProcess() const; + + void setOrderCode(const QString& value); + QString getOrderCode() const; + + void setQrstCode(const QString& value); + QString getQrstCode() const; + + void setContactInfo(const QString& value); + QString getContactInfo() const; + + void setOrderDetails(const QString& value); + QString getOrderDetails() const; + + void setCompany(const QString& value); + QString getCompany() const; + + void setDataSize(const QString& value); + QString getDataSize() const; + + void setUpdateTime(const QString& value); + QString getUpdateTime() const; + + void setOrderType(const QString& value); + QString getOrderType() const; + }; + + + class TaskCollect:public QObject { + Q_OBJECT + private: + TaskCollect(); + public: + void LoadTaskCollect(QJsonDocument& d,QString message); + void LoadTaskCollectState(QString message); + static TaskCollect* getInstance(); + + int clear(); + + int getPagenum(); + int getTotal(); + int getPagecount(); + TaskOrder* getCurrentTaskAt(int i); + + signals: + void updateSIG(WBTASKSAPIREQURSTSTATE state,QString message); + + + private: + QList Currnettasklist; + int pagenum;// 当前page 的 枚举 + int total;// 总共订单总数 + int pagecount;// 每页订单数量 + WBTASKSAPIREQURSTSTATE state;// 状态 + static TaskCollect* instance; + }; + + +} + +#endif // ORDER_H + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..8428d9b --- /dev/null +++ b/main.cpp @@ -0,0 +1,17 @@ +#include +#include +#include "LAMPWBDDManager.h" +#include "LAMPTaskManagerMainWindows.h" + + + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + + WBFZTASK::LAMPTaskManagerMainWindows mainwindows ; + mainwindows.setWindowTitle(u8"微波仿真订单查询系统"); + mainwindows.show(); + + return a.exec(); +}