From 8d02dbd0ba6c82ed15f510651a8aa3f09c19721a Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期三, 30 八月 2023 23:18:33 +0800 Subject: [PATCH] 0830 --- internal_system_v1/searchinfo.cpp | 121 +++++++++ internal_system_v1/problemnotmoney.cpp | 41 +++ sqlData.sql | 16 + internal_system_v1/coverinfo.ui | 15 + internal_system_v1/punish.h | 3 internal_system_v1/auditproject.cpp | 32 ++ internal_system_v1/problemcount.h | 3 internal_system_v1/punish.cpp | 26 ++ internal_system_v1/problemrectification.cpp | 41 +++ internal_system_v1/auditproject.ui | 13 + internal_system_v1/problemmoney.h | 5 internal_system_v1/caseclue.ui | 13 + internal_system_v1/auditworkload.ui | 13 + internal_system_v1/auditworkload.h | 4 internal_system_v1/caseclue.cpp | 23 + internal_system_v1/problemnotmoney.ui | 43 +++ internal_system_v1/auditworkload.cpp | 22 + internal_system_v1/problemcount.ui | 53 ++++ internal_system_v1/caseclue.h | 4 internal_system_v1/searchinfo.h | 4 internal_system_v1/problemrectification.h | 3 internal_system_v1/problemcount.cpp | 40 +++ internal_system_v1/problemnotmoney.h | 3 internal_system_v1/problemmoney.cpp | 36 ++ internal_system_v1/problemmoney.ui | 87 ++++++ internal_system_v1/auditproject.h | 3 internal_system_v1/punish.ui | 13 + internal_system_v1/problemrectification.ui | 53 ++++ internal_system_v1/searchinfo.ui | 45 +++ 29 files changed, 770 insertions(+), 8 deletions(-) diff --git a/internal_system_v1/auditproject.cpp b/internal_system_v1/auditproject.cpp index 406ac45..9dbb73e 100644 --- a/internal_system_v1/auditproject.cpp +++ b/internal_system_v1/auditproject.cpp @@ -1,5 +1,7 @@ #include "auditproject.h" #include "ui_auditproject.h" +#include <QDebug> +#include <QSqlQuery> AuditProject::AuditProject(QWidget *parent) : QMainWindow(parent), @@ -14,6 +16,7 @@ } } ui->tableWidget->setColumnWidth(0,300); + m_comId = 1; // 鍗曚綅id } @@ -32,3 +35,32 @@ ui->tableWidget->setItem(0,2,new QTableWidgetItem(QString::number(sum))); } } + +void AuditProject::on_pushButton_clicked() +{ + + // 鍐嶆缁熻涓�鎶� + int sum = 0; + for(int i=1;i<9;++i){ + sum += ui->tableWidget->item(i,2)->text().toInt(); + } + ui->tableWidget->setItem(0,2,new QTableWidgetItem(QString::number(sum))); + + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2',%3,%4),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) + .arg(m_comId); + } + //qDebug()<<values; + values = values.left(values.length()-1); + //qDebug()<<values; + QString sql = QString("insert into audit_project (kpi_name,code,num,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/auditproject.h b/internal_system_v1/auditproject.h index 13244d4..9f0648e 100644 --- a/internal_system_v1/auditproject.h +++ b/internal_system_v1/auditproject.h @@ -18,8 +18,11 @@ private slots: void on_tableWidget_clicked(const QModelIndex &index); + void on_pushButton_clicked(); + private: Ui::AuditProject *ui; + int m_comId; }; #endif // AUDITPROJECT_H diff --git a/internal_system_v1/auditproject.ui b/internal_system_v1/auditproject.ui index f563d9a..4ef1a3d 100644 --- a/internal_system_v1/auditproject.ui +++ b/internal_system_v1/auditproject.ui @@ -250,6 +250,19 @@ </item> </widget> </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--瀹¤椤圭洰</string> + </property> + </widget> + </item> </layout> </widget> <widget class="QMenuBar" name="menubar"> diff --git a/internal_system_v1/auditworkload.cpp b/internal_system_v1/auditworkload.cpp index 0f6c640..c3b82e6 100644 --- a/internal_system_v1/auditworkload.cpp +++ b/internal_system_v1/auditworkload.cpp @@ -1,5 +1,7 @@ #include "auditworkload.h" #include "ui_auditworkload.h" +#include <QDebug> +#include <QSqlQuery> AuditWorkload::AuditWorkload(QWidget *parent) : QMainWindow(parent), @@ -7,9 +9,29 @@ { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,260); + m_comId = 1; } AuditWorkload::~AuditWorkload() { delete ui; } + +void AuditWorkload::on_pushButton_clicked() +{ + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2',%3,%4),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) + .arg(m_comId); + } + values = values.left(values.length()-1); + QString sql = QString("insert into audit_workload (kpi_name,code,num,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/auditworkload.h b/internal_system_v1/auditworkload.h index 89eb18c..b9c91d5 100644 --- a/internal_system_v1/auditworkload.h +++ b/internal_system_v1/auditworkload.h @@ -15,8 +15,12 @@ explicit AuditWorkload(QWidget *parent = 0); ~AuditWorkload(); +private slots: + void on_pushButton_clicked(); + private: Ui::AuditWorkload *ui; + int m_comId; }; #endif // AUDITWORKLOAD_H diff --git a/internal_system_v1/auditworkload.ui b/internal_system_v1/auditworkload.ui index ddcf886..7011e39 100644 --- a/internal_system_v1/auditworkload.ui +++ b/internal_system_v1/auditworkload.ui @@ -64,6 +64,19 @@ </item> </widget> </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--鍐呭宸ヤ綔閲�</string> + </property> + </widget> + </item> </layout> </widget> <widget class="QMenuBar" name="menubar"> diff --git a/internal_system_v1/caseclue.cpp b/internal_system_v1/caseclue.cpp index 5d5017a..120a3b4 100644 --- a/internal_system_v1/caseclue.cpp +++ b/internal_system_v1/caseclue.cpp @@ -1,5 +1,7 @@ #include "caseclue.h" #include "ui_caseclue.h" +#include <QDebug> +#include <QSqlQuery> CaseClue::CaseClue(QWidget *parent) : QMainWindow(parent), @@ -7,9 +9,30 @@ { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,300); + m_comId = 1; } CaseClue::~CaseClue() { delete ui; } + +void CaseClue::on_pushButton_clicked() +{ + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2','%3',%4,%5),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text()) + .arg(ui->tableWidget->item(i,3)->text().toInt()) + .arg(m_comId); + } + values = values.left(values.length()-1); + QString sql = QString("insert into case_clue (kpi_name,code,unit,num,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/caseclue.h b/internal_system_v1/caseclue.h index 9ad6bf9..200afdc 100644 --- a/internal_system_v1/caseclue.h +++ b/internal_system_v1/caseclue.h @@ -15,8 +15,12 @@ explicit CaseClue(QWidget *parent = 0); ~CaseClue(); +private slots: + void on_pushButton_clicked(); + private: Ui::CaseClue *ui; + int m_comId; }; #endif // CASECLUE_H diff --git a/internal_system_v1/caseclue.ui b/internal_system_v1/caseclue.ui index 150b86b..fcbdf5d 100644 --- a/internal_system_v1/caseclue.ui +++ b/internal_system_v1/caseclue.ui @@ -99,6 +99,19 @@ </item> </widget> </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--妗堜欢绾跨储</string> + </property> + </widget> + </item> </layout> </widget> <widget class="QMenuBar" name="menubar"> diff --git a/internal_system_v1/coverinfo.ui b/internal_system_v1/coverinfo.ui index 90ce635..0dd41ca 100644 --- a/internal_system_v1/coverinfo.ui +++ b/internal_system_v1/coverinfo.ui @@ -907,6 +907,21 @@ <set>Qt::AlignCenter</set> </property> </widget> + <widget class="QComboBox" name="comboBox"> + <property name="geometry"> + <rect> + <x>670</x> + <y>30</y> + <width>291</width> + <height>22</height> + </rect> + </property> + <item> + <property name="text"> + <string>鍏徃鍚嶇О</string> + </property> + </item> + </widget> </widget> <widget class="QMenuBar" name="menubar"> <property name="geometry"> diff --git a/internal_system_v1/problemcount.cpp b/internal_system_v1/problemcount.cpp index cc554c7..d2caeda 100644 --- a/internal_system_v1/problemcount.cpp +++ b/internal_system_v1/problemcount.cpp @@ -1,6 +1,9 @@ #include "problemcount.h" #include "ui_problemcount.h" #include <QDebug> +#include <QFileDialog> +#include <QPushButton> +#include <QSqlQuery> ProblemCount::ProblemCount(QWidget *parent) : QMainWindow(parent), @@ -8,6 +11,19 @@ { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,300); + m_comId = 1; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + QPushButton *btn = new QPushButton("涓婁紶",this); + ui->tableWidget->setCellWidget(i,3,btn); + connect(btn,&QPushButton::clicked,this,[=]{ + QStringList files = QFileDialog::getOpenFileNames(); + QString str; + for(auto f:files){ + str += f + " "; + } + ui->tableWidget->setItem(i,4,new QTableWidgetItem(str)); + }); + } } ProblemCount::~ProblemCount() @@ -43,3 +59,27 @@ ui->tableWidget->setItem(0,2,new QTableWidgetItem(QString::number(allCnt))); } + +void ProblemCount::on_pushButton_clicked() +{ + // 鍐嶇粺璁′竴鎶� + on_tableWidget_activated(QModelIndex()); + + + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2',%3,'%4',%5),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) + .arg(ui->tableWidget->item(i,4)->text()) + .arg(m_comId); + } + values = values.left(values.length()-1); + QString sql = QString("insert into problem_count (kpi_name,code,num,evidences,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/problemcount.h b/internal_system_v1/problemcount.h index 68d3ea3..2cf0cd0 100644 --- a/internal_system_v1/problemcount.h +++ b/internal_system_v1/problemcount.h @@ -20,8 +20,11 @@ void on_tableWidget_activated(const QModelIndex &index); + void on_pushButton_clicked(); + private: Ui::ProblemCount *ui; + int m_comId; }; #endif // PROBLEMCOUNT_H diff --git a/internal_system_v1/problemcount.ui b/internal_system_v1/problemcount.ui index 15d322e..0b71dbf 100644 --- a/internal_system_v1/problemcount.ui +++ b/internal_system_v1/problemcount.ui @@ -82,6 +82,11 @@ <string>涓婁紶浣愯瘉璧勬枡</string> </property> </column> + <column> + <property name="text"> + <string>浣愯瘉璧勬枡</string> + </property> + </column> <item row="0" column="0"> <property name="text"> <string>瀹¤鍙戠幇闂涓暟</string> @@ -95,6 +100,11 @@ <item row="0" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="0" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="1" column="0"> @@ -112,6 +122,11 @@ <string>0</string> </property> </item> + <item row="1" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="2" column="0"> <property name="text"> <string>闈為噾棰濈被闂涓暟</string> @@ -125,6 +140,11 @@ <item row="2" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="2" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="3" column="0"> @@ -142,6 +162,11 @@ <string>0</string> </property> </item> + <item row="3" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="4" column="0"> <property name="text"> <string>鍙戝睍瑙勫垝涓庢垬鐣ュ喅绛栨柟闈�</string> @@ -155,6 +180,11 @@ <item row="4" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="4" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="5" column="0"> @@ -172,6 +202,11 @@ <string>0</string> </property> </item> + <item row="5" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="6" column="0"> <property name="text"> <string>鍏朵粬</string> @@ -187,6 +222,24 @@ <string>0</string> </property> </item> + <item row="6" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> + </widget> + </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--闂涓暟</string> + </property> </widget> </item> </layout> diff --git a/internal_system_v1/problemmoney.cpp b/internal_system_v1/problemmoney.cpp index 06a7d6a..7f5fce5 100644 --- a/internal_system_v1/problemmoney.cpp +++ b/internal_system_v1/problemmoney.cpp @@ -1,5 +1,8 @@ #include "problemmoney.h" #include "ui_problemmoney.h" +#include <QPushButton> +#include <QDebug> +#include <QSqlQuery> ProblemMoney::ProblemMoney(QWidget *parent) : QMainWindow(parent), @@ -7,9 +10,42 @@ { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,300); + m_comId = 1; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + QPushButton *btn = new QPushButton("涓婁紶",this); + ui->tableWidget->setCellWidget(i,3,btn); + connect(btn,&QPushButton::clicked,this,[=]{ + QStringList files = QFileDialog::getOpenFileNames(); + QString str; + for(auto f:files){ + str += f + " "; + } + ui->tableWidget->setItem(i,4,new QTableWidgetItem(str)); + }); + } } ProblemMoney::~ProblemMoney() { delete ui; } + +void ProblemMoney::on_pushButton_clicked() +{ + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2',%3,'%4',%5),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) + .arg(ui->tableWidget->item(i,4)->text()) + .arg(m_comId); + } + values = values.left(values.length()-1); + QString sql = QString("insert into problem_money (kpi_name,code,num,evidences,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/problemmoney.h b/internal_system_v1/problemmoney.h index e7be187..8e8fece 100644 --- a/internal_system_v1/problemmoney.h +++ b/internal_system_v1/problemmoney.h @@ -2,6 +2,7 @@ #define PROBLEMMONEY_H #include <QMainWindow> +#include <QFileDialog> namespace Ui { class ProblemMoney; @@ -15,8 +16,12 @@ explicit ProblemMoney(QWidget *parent = 0); ~ProblemMoney(); +private slots: + void on_pushButton_clicked(); + private: Ui::ProblemMoney *ui; + int m_comId; }; #endif // PROBLEMMONEY_H diff --git a/internal_system_v1/problemmoney.ui b/internal_system_v1/problemmoney.ui index f1e8445..eb7d1f3 100644 --- a/internal_system_v1/problemmoney.ui +++ b/internal_system_v1/problemmoney.ui @@ -15,13 +15,6 @@ </property> <widget class="QWidget" name="centralwidget"> <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>闂閲戦</string> - </property> - </widget> - </item> <item row="1" column="0"> <widget class="QTableWidget" name="tableWidget"> <attribute name="verticalHeaderVisible"> @@ -102,6 +95,11 @@ <string>涓婁紶浣愯瘉璧勬枡</string> </property> </column> + <column> + <property name="text"> + <string>浣愯瘉璧勬枡</string> + </property> + </column> <item row="0" column="0"> <property name="text"> <string>瀹¤鍙戠幇闂閲戦</string> @@ -115,6 +113,11 @@ <item row="0" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="0" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="1" column="0"> @@ -132,6 +135,11 @@ <string>0</string> </property> </item> + <item row="1" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="2" column="0"> <property name="text"> <string>鍚堣鎬ч棶棰橀噾棰�</string> @@ -145,6 +153,11 @@ <item row="2" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="2" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="3" column="0"> @@ -162,6 +175,11 @@ <string>0</string> </property> </item> + <item row="3" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="4" column="0"> <property name="text"> <string>杩濊浣跨敤璧勯噾</string> @@ -175,6 +193,11 @@ <item row="4" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="4" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="5" column="0"> @@ -192,6 +215,11 @@ <string>0</string> </property> </item> + <item row="5" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="6" column="0"> <property name="text"> <string>鎹熷け娴垂</string> @@ -205,6 +233,11 @@ <item row="6" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="6" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="7" column="0"> @@ -222,6 +255,11 @@ <string>0</string> </property> </item> + <item row="7" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="8" column="0"> <property name="text"> <string>鍋锋紡绋庤垂</string> @@ -235,6 +273,11 @@ <item row="8" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="8" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="9" column="0"> @@ -252,6 +295,11 @@ <string>0</string> </property> </item> + <item row="9" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="10" column="0"> <property name="text"> <string>鍏朵粬</string> @@ -267,6 +315,31 @@ <string>0</string> </property> </item> + <item row="10" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>闂閲戦</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--闂閲戦</string> + </property> </widget> </item> </layout> diff --git a/internal_system_v1/problemnotmoney.cpp b/internal_system_v1/problemnotmoney.cpp index 21e6c3f..e5072a1 100644 --- a/internal_system_v1/problemnotmoney.cpp +++ b/internal_system_v1/problemnotmoney.cpp @@ -1,12 +1,30 @@ #include "problemnotmoney.h" #include "ui_problemnotmoney.h" +#include <QFileDialog> +#include <QPushButton> +#include <QSqlQuery> +#include <QDebug> + ProblemNotMoney::ProblemNotMoney(QWidget *parent) : QMainWindow(parent), ui(new Ui::ProblemNotMoney) { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,300); + m_comId = 1; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + QPushButton *btn = new QPushButton("涓婁紶",this); + ui->tableWidget->setCellWidget(i,3,btn); + connect(btn,&QPushButton::clicked,this,[=]{ + QStringList files = QFileDialog::getOpenFileNames(); + QString str; + for(auto f:files){ + str += f + " "; + } + ui->tableWidget->setItem(i,4,new QTableWidgetItem(str)); + }); + } } ProblemNotMoney::~ProblemNotMoney() @@ -22,3 +40,26 @@ } ui->tableWidget->setItem(0,2,new QTableWidgetItem(QString::number(allCnt))); } + +void ProblemNotMoney::on_pushButton_clicked() +{ + // 鍐嶇粺璁′竴鎶� + on_tableWidget_clicked(QModelIndex()); + + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2',%3,'%4',%5),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) + .arg(ui->tableWidget->item(i,4)->text()) + .arg(m_comId); + } + values = values.left(values.length()-1); + QString sql = QString("insert into problem_no_money (kpi_name,code,num,evidences,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/problemnotmoney.h b/internal_system_v1/problemnotmoney.h index 9bc6126..a76e4e8 100644 --- a/internal_system_v1/problemnotmoney.h +++ b/internal_system_v1/problemnotmoney.h @@ -18,8 +18,11 @@ private slots: void on_tableWidget_clicked(const QModelIndex &index); + void on_pushButton_clicked(); + private: Ui::ProblemNotMoney *ui; + int m_comId; }; #endif // PROBLEMNOTMONEY_H diff --git a/internal_system_v1/problemnotmoney.ui b/internal_system_v1/problemnotmoney.ui index 794dbce..a4c003c 100644 --- a/internal_system_v1/problemnotmoney.ui +++ b/internal_system_v1/problemnotmoney.ui @@ -72,6 +72,11 @@ <string>涓婁紶浣愯瘉璧勬枡</string> </property> </column> + <column> + <property name="text"> + <string>浣愯瘉璧勬枡</string> + </property> + </column> <item row="0" column="0"> <property name="text"> <string>瀹¤鍙戠幇闂鏁存敼锛堥潪閲戦绫伙級</string> @@ -85,6 +90,11 @@ <item row="0" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="0" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="1" column="0"> @@ -102,6 +112,11 @@ <string>0</string> </property> </item> + <item row="1" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="2" column="0"> <property name="text"> <string>淇瀹屽杽鍒跺害</string> @@ -115,6 +130,11 @@ <item row="2" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="2" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="3" column="0"> @@ -132,6 +152,11 @@ <string>0</string> </property> </item> + <item row="3" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="4" column="0"> <property name="text"> <string>鍏朵粬</string> @@ -147,6 +172,24 @@ <string>0</string> </property> </item> + <item row="4" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> + </widget> + </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--闂鏁存敼闈為噾棰�</string> + </property> </widget> </item> </layout> diff --git a/internal_system_v1/problemrectification.cpp b/internal_system_v1/problemrectification.cpp index b013cad..8452de3 100644 --- a/internal_system_v1/problemrectification.cpp +++ b/internal_system_v1/problemrectification.cpp @@ -1,12 +1,30 @@ #include "problemrectification.h" #include "ui_problemrectification.h" +#include <QFileDialog> +#include <QPushButton> +#include <QSqlQuery> +#include <QDebug> + ProblemRectification::ProblemRectification(QWidget *parent) : QMainWindow(parent), ui(new Ui::ProblemRectification) { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,300); + m_comId = 1; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + QPushButton *btn = new QPushButton("涓婁紶",this); + ui->tableWidget->setCellWidget(i,3,btn); + connect(btn,&QPushButton::clicked,this,[=]{ + QStringList files = QFileDialog::getOpenFileNames(); + QString str; + for(auto f:files){ + str += f + " "; + } + ui->tableWidget->setItem(i,4,new QTableWidgetItem(str)); + }); + } } ProblemRectification::~ProblemRectification() @@ -22,3 +40,26 @@ } ui->tableWidget->setItem(0,2,new QTableWidgetItem(QString::number(allCnt))); } + +void ProblemRectification::on_pushButton_clicked() +{ + // 鍐嶇粺璁′竴鎶� + on_tableWidget_clicked(QModelIndex()); + + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2',%3,'%4',%5),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) + .arg(ui->tableWidget->item(i,4)->text()) + .arg(m_comId); + } + values = values.left(values.length()-1); + QString sql = QString("insert into problem_rectification (kpi_name,code,num,evidences,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/problemrectification.h b/internal_system_v1/problemrectification.h index 8956cf1..0828873 100644 --- a/internal_system_v1/problemrectification.h +++ b/internal_system_v1/problemrectification.h @@ -18,8 +18,11 @@ private slots: void on_tableWidget_clicked(const QModelIndex &index); + void on_pushButton_clicked(); + private: Ui::ProblemRectification *ui; + int m_comId; }; #endif // PROBLEMRECTIFICATION_H diff --git a/internal_system_v1/problemrectification.ui b/internal_system_v1/problemrectification.ui index 177c1b7..c80277e 100644 --- a/internal_system_v1/problemrectification.ui +++ b/internal_system_v1/problemrectification.ui @@ -82,6 +82,11 @@ <string>涓婁紶浣愯瘉璧勬枡</string> </property> </column> + <column> + <property name="text"> + <string>浣愯瘉璧勬枡</string> + </property> + </column> <item row="0" column="0"> <property name="text"> <string>瀹¤鍙戠幇闂鏁存敼锛堥噾棰濈被锛�</string> @@ -95,6 +100,11 @@ <item row="0" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="0" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="1" column="0"> @@ -112,6 +122,11 @@ <string>0</string> </property> </item> + <item row="1" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="2" column="0"> <property name="text"> <string>鏀跺洖璧勯噾</string> @@ -125,6 +140,11 @@ <item row="2" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="2" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="3" column="0"> @@ -142,6 +162,11 @@ <string>0</string> </property> </item> + <item row="3" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="4" column="0"> <property name="text"> <string>褰掕繕鍘熻祫閲戞笭閬�</string> @@ -155,6 +180,11 @@ <item row="4" column="2"> <property name="text"> <string>0</string> + </property> + </item> + <item row="4" column="4"> + <property name="text"> + <string>鏃�</string> </property> </item> <item row="5" column="0"> @@ -172,6 +202,11 @@ <string>0</string> </property> </item> + <item row="5" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> <item row="6" column="0"> <property name="text"> <string>鍏朵粬</string> @@ -187,6 +222,24 @@ <string>0</string> </property> </item> + <item row="6" column="4"> + <property name="text"> + <string>鏃�</string> + </property> + </item> + </widget> + </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--闂鏁存敼</string> + </property> </widget> </item> </layout> diff --git a/internal_system_v1/punish.cpp b/internal_system_v1/punish.cpp index 3657d19..225bdb0 100644 --- a/internal_system_v1/punish.cpp +++ b/internal_system_v1/punish.cpp @@ -1,12 +1,16 @@ #include "punish.h" #include "ui_punish.h" +#include <QSqlQuery> +#include <QDebug> + Punish::Punish(QWidget *parent) : QMainWindow(parent), ui(new Ui::Punish) { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,320); + m_comId = 1; } Punish::~Punish() @@ -22,3 +26,25 @@ } ui->tableWidget->setItem(0,2,new QTableWidgetItem(QString::number(allCnt))); } + +void Punish::on_pushButton_clicked() +{ + // 鍐嶇粺璁′竴鎶� + on_tableWidget_clicked(QModelIndex()); + + QString values = ""; + for(int i=0;i<ui->tableWidget->rowCount();++i){ + values += QString("('%1','%2',%3,%4),").arg(ui->tableWidget->item(i,0)->text()) + .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) + .arg(m_comId); + } + values = values.left(values.length()-1); + QString sql = QString("insert into punish (kpi_name,code,num,com_id) values %1").arg(values); + qDebug()<<sql; + QSqlQuery query; + if(query.exec(sql)){ + qDebug()<<"OK sql"<<__FUNCTION__; + }else{ + qDebug()<<"fail sql"<<__FUNCTION__; + } +} diff --git a/internal_system_v1/punish.h b/internal_system_v1/punish.h index 1ce3044..b431ce3 100644 --- a/internal_system_v1/punish.h +++ b/internal_system_v1/punish.h @@ -18,8 +18,11 @@ private slots: void on_tableWidget_clicked(const QModelIndex &index); + void on_pushButton_clicked(); + private: Ui::Punish *ui; + int m_comId; }; #endif // PUNISH_H diff --git a/internal_system_v1/punish.ui b/internal_system_v1/punish.ui index 6af124a..620a5ee 100644 --- a/internal_system_v1/punish.ui +++ b/internal_system_v1/punish.ui @@ -124,6 +124,19 @@ </item> </widget> </item> + <item row="2" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="text"> + <string>鎻愪氦--澶勫垎</string> + </property> + </widget> + </item> </layout> </widget> <widget class="QMenuBar" name="menubar"> diff --git a/internal_system_v1/searchinfo.cpp b/internal_system_v1/searchinfo.cpp index 52166f7..8b6ab54 100644 --- a/internal_system_v1/searchinfo.cpp +++ b/internal_system_v1/searchinfo.cpp @@ -1,6 +1,8 @@ #include "searchinfo.h" #include "ui_searchinfo.h" #include <QDebug> +#include <QSqlError> +#include <QSqlQuery> SearchInfo::SearchInfo(QWidget *parent) : QMainWindow(parent), @@ -15,7 +17,8 @@ m_db.setDatabaseName("sqlData.db"); if(m_db.open()){ qDebug()<<"db open ok"; - m_db.close(); + createSqlite(); + //m_db.close(); }else{ qDebug()<<"db open fail"; } @@ -25,5 +28,121 @@ SearchInfo::~SearchInfo() { + m_db.close(); delete ui; } + +void SearchInfo::createSqlite() +{ + // 寤鸿〃 + QString sql = "create table Internal_1 (id int primary key, name varchar(30), _020100 int)"; + QSqlQuery query; + if(query.exec(sql)) + { + qDebug()<<"create Internal_1 ok..."; + }else{ + qDebug()<<"create Internal_1 fail..."<<query.lastError().text(); + } + + sql = "CREATE TABLE file_up_info (\ + id INTEGER PRIMARY KEY AUTOINCREMENT,\ + name VARCHAR (30),\ + code TEXT,\ + up_time TEXT\ + )"; + if(query.exec(sql)) + { + qDebug()<<"create file_up_info ok..."; + }else{ + qDebug()<<"create file_up_info fail..."<<query.lastError().text(); + } + + sql = "create table company_info (id INTEGER PRIMARY key AUTOINCREMENT, name varchar(30), code varchar(30))"; + if(query.exec(sql)) + { + qDebug()<<"create company_info ok..."; + }else{ + qDebug()<<"create company_info fail..."<<query.lastError().text(); + } + + // 瀹¤椤圭洰琛� + createTableNoEvidences("audit_project"); + + // 鍐呭宸ヤ綔閲忚〃 + createTableNoEvidences("audit_workload"); + + // 闂閲戦琛� + createTableHasEvidences("problem_money"); + + // 闂涓暟琛� + createTableHasEvidences("problem_count"); + + // 闂鏁存敼琛� + createTableHasEvidences("problem_rectification"); + + // 闂鏁存敼--闈為噾棰濊〃 + createTableHasEvidences("problem_no_money"); + + // 澶勫垎琛� + createTableNoEvidences("punish"); + + // 妗堜欢绾跨储琛� + createTableHasUnit("case_clue"); + +} + +void SearchInfo::createTableHasEvidences(QString tableName) +{ + QString sql =QString( "CREATE TABLE %1 ( \ + id INTEGER PRIMARY KEY AUTOINCREMENT,\ + kpi_name TEXT,\ + code TEXT,\ + num INTEGER,\ + evidences TEXT,\ + com_id INTEGER\ + )").arg(tableName); + QSqlQuery query; + if(query.exec(sql)) + { + qDebug()<<QString("create %1 ok...").arg(tableName); + }else{ + qDebug()<<QString("create %1 fail...").arg(tableName)<<query.lastError().text(); + } +} + +void SearchInfo::createTableNoEvidences(QString tableName) +{ + QString sql = QString("CREATE TABLE %1 (\ + id INTEGER PRIMARY KEY AUTOINCREMENT,\ + kpi_name TEXT,\ + code TEXT,\ + num INTEGER,\ + com_id INTEGER\ + )").arg(tableName); + QSqlQuery query; + if(query.exec(sql)) + { + qDebug()<<QString("create %1 ok...").arg(tableName); + }else{ + qDebug()<<QString("create %1 fail...").arg(tableName)<<query.lastError().text(); + } +} + +void SearchInfo::createTableHasUnit(QString tableName) +{ + QString sql = QString("CREATE TABLE %1 (\ + id INTEGER PRIMARY KEY AUTOINCREMENT,\ + kpi_name TEXT,\ + code TEXT,\ + unit TEXT,\ + num INTEGER,\ + com_id INTEGER\ + )").arg(tableName); + QSqlQuery query; + if(query.exec(sql)) + { + qDebug()<<QString("create %1 ok...").arg(tableName); + }else{ + qDebug()<<QString("create %1 fail...").arg(tableName)<<query.lastError().text(); + } +} diff --git a/internal_system_v1/searchinfo.h b/internal_system_v1/searchinfo.h index 2685c06..a809041 100644 --- a/internal_system_v1/searchinfo.h +++ b/internal_system_v1/searchinfo.h @@ -15,6 +15,10 @@ public: explicit SearchInfo(QWidget *parent = 0); ~SearchInfo(); + void createSqlite(); + void createTableHasEvidences(QString tableName); // 鏈変綈璇佺殑琛� + void createTableNoEvidences(QString tableName); // 鏃犱綈璇佺殑琛� + void createTableHasUnit(QString tableName); // 鏃犱綈璇佺殑琛ㄤ笖鏈夎閲忓崟浣嶇殑琛� private: Ui::SearchInfo *ui; diff --git a/internal_system_v1/searchinfo.ui b/internal_system_v1/searchinfo.ui index eac1b36..e09b2a3 100644 --- a/internal_system_v1/searchinfo.ui +++ b/internal_system_v1/searchinfo.ui @@ -37,12 +37,37 @@ </item> <item> <property name="text"> + <string>鍐呭宸ヤ綔閲�</string> + </property> + </item> + <item> + <property name="text"> <string>闂閲戦</string> </property> </item> <item> <property name="text"> + <string>闂涓暟</string> + </property> + </item> + <item> + <property name="text"> <string>闂鏁存敼</string> + </property> + </item> + <item> + <property name="text"> + <string>闂鏁存敼--闈為噾棰�</string> + </property> + </item> + <item> + <property name="text"> + <string>澶勫垎</string> + </property> + </item> + <item> + <property name="text"> + <string>妗堜欢绾跨储</string> </property> </item> </widget> @@ -69,6 +94,16 @@ </item> <item> <widget class="QDateTimeEdit" name="dateTimeEdit"> + <property name="dateTime"> + <datetime> + <hour>0</hour> + <minute>0</minute> + <second>0</second> + <year>2022</year> + <month>1</month> + <day>1</day> + </datetime> + </property> <property name="calendarPopup"> <bool>true</bool> </property> @@ -83,6 +118,16 @@ </item> <item> <widget class="QDateTimeEdit" name="dateTimeEdit_2"> + <property name="dateTime"> + <datetime> + <hour>0</hour> + <minute>0</minute> + <second>0</second> + <year>2023</year> + <month>1</month> + <day>1</day> + </datetime> + </property> <property name="calendarPopup"> <bool>true</bool> </property> diff --git a/sqlData.sql b/sqlData.sql new file mode 100644 index 0000000..5066e90 --- /dev/null +++ b/sqlData.sql @@ -0,0 +1,16 @@ +-- +-- SQLiteStudio v3.4.3 生成的文件,周五 8月 25 15:43:41 2023 +-- +-- 所用的文本编码:System +-- +PRAGMA foreign_keys = off; +BEGIN TRANSACTION; + +-- 表:file_up_info +CREATE TABLE IF NOT EXISTS file_up_info (id int PRIMARY KEY, name varchar (30), code int, up_time TEXT); + +-- 表:Internal_1 +CREATE TABLE IF NOT EXISTS Internal_1 (id int PRIMARY KEY, name varchar (30), _020100 int, _020101 int, _020102 int, _020103 int, _020104 int, _020105 int, _020106 int, _020107 int, _020108 int, _020111 int, _020200 int, _020700 int, _020701 int, _020702 int, _020703 int, _020800 int, _020801 int); + +COMMIT TRANSACTION; +PRAGMA foreign_keys = on; -- Gitblit v1.8.0