From 5f209bc8ed68bbdb6b7180aaa5bc37acc8545e35 Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期五, 08 九月 2023 23:25:29 +0800 Subject: [PATCH] 0908 --- internal_system_v1/searchinfo.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/internal_system_v1/searchinfo.cpp b/internal_system_v1/searchinfo.cpp index b1036aa..83cc3fe 100644 --- a/internal_system_v1/searchinfo.cpp +++ b/internal_system_v1/searchinfo.cpp @@ -199,6 +199,23 @@ } } +QVector<QVector<QString>> SearchInfo::getResult(QString &sql,int colCnt) +{ + QVector<QVector<QString>> resultSet; + QSqlQuery query; + qDebug()<<sql; + if(query.exec(sql)){ + while (query.next()) { + QVector<QString> tmp; + for(int i=0;i<colCnt;++i){ + tmp.push_back(query.value(i).toString()); + } + resultSet.append(tmp); + } + } + return resultSet; +} + void SearchInfo::on_pushButton_search_clicked() { // 鑾峰彇淇℃伅锛岀劧鍚庢煡璇� @@ -224,3 +241,28 @@ } } + +void SearchInfo::on_pushButton_export_clicked() +{ + // 姣忎竴寮犺〃鎷挎渶鏂扮殑閭d竴鎵规暟鎹嵆鍙紝鐒跺悗淇濆瓨鍒扮數瀛愯〃鏍间腑 + int comId = m_comInfo[ui->comboBox_company->currentText()]; + QString audit_project = QString("select kpi_name,code,num from %2 where com_id=%1 limit 10").arg(comId).arg("audit_project"); + QString audit_workload = QString("select kpi_name,code,num from %2 where com_id=%1 limit 1").arg(comId).arg("audit_workload"); + QString case_clue = QString("select kpi_name,code,unit,num from %2 where com_id=%1 limit 2").arg(comId).arg("case_clue"); + QString problem_count = QString("select kpi_name,code,num,evidences from %2 where com_id=%1 limit 7").arg(comId).arg("problem_count"); + QString problem_money = QString("select kpi_name,code,num,evidences from %2 where com_id=%1 limit 11").arg(comId).arg("problem_money"); + QString problem_no_money = QString("select kpi_name,code,num,evidences from %2 where com_id=%1 limit 5").arg(comId).arg("problem_no_money"); + QString problem_rectification = QString("select kpi_name,code,num,evidences from %2 where com_id=%1 limit 7").arg(comId).arg("problem_rectification"); + QString punish = QString("select kpi_name,code,num from %2 where com_id=%1 limit 4").arg(comId).arg("punish"); + + QVector<QVector<QString>> audit_project_res = getResult(audit_project,3); + QVector<QVector<QString>> audit_workload_res = getResult(audit_workload,3); + QVector<QVector<QString>> case_clue_res = getResult(case_clue,4); + QVector<QVector<QString>> problem_count_res = getResult(problem_count,4); + QVector<QVector<QString>> problem_money_res = getResult(problem_money,4); + QVector<QVector<QString>> problem_no_money_res = getResult(problem_no_money,4); + QVector<QVector<QString>> problem_rectification_res = getResult(problem_rectification,4); + QVector<QVector<QString>> punish_res = getResult(punish,3); + qDebug()<<audit_project_res.size()<<punish_res.size(); + +} -- Gitblit v1.8.0