Skip to content

Commit

Permalink
Merge pull request #61 from csthenry/dev
Browse files Browse the repository at this point in the history
修复bug,优化交互。
  • Loading branch information
csthenry authored Mar 14, 2023
2 parents 5b775c1 + f77ab84 commit 73e77ca
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 38 deletions.
4 changes: 2 additions & 2 deletions MagicLightAssistant.vcxproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtLastBackgroundBuild>2023-02-23T09:48:54.7583650Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-03-14T12:37:28.3943389Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtLastBackgroundBuild>2023-02-23T09:48:54.8438294Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-03-14T12:37:28.4952107Z</QtLastBackgroundBuild>
</PropertyGroup>
</Project>
19 changes: 18 additions & 1 deletion approvalwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,14 @@ void ApprovalWork::autoExecuteSystemApplyItems()
if (options[2] != "") //更新手机号
subQuery.exec(QString("UPDATE magic_users SET telephone='%1' WHERE uid=%2").arg(options[2], record.value("uid").toString()));
subQuery.exec(QString("UPDATE magic_apply SET status=3 WHERE apply_id='%1'").arg(apply_id)); //已自动处理数据
subQuery.exec(QString("SELECT mail FROM magic_users WHERE uid='%1';").arg(record.value("uid").toString()));
QString mail;
if (subQuery.next())
mail = subQuery.value("mail").toString();
DB_SECOND.close();
finishedNum++;
finishedNum++;
if(!mail.isEmpty())
service::sendMail(smtp_config, mail, "WePlanet 审批进度更新", QString("用户%1:\n你的【个人信息异动申请】现已完成审核,个人信息现已更新。\n\n注:若异动信息有误,请联系管理员。").arg(record.value("uid").toString()));
}
}
}
Expand Down Expand Up @@ -266,8 +272,14 @@ void ApprovalWork::autoExecuteSystemApplyItems()
QSqlQuery subQuery(DB_SECOND);
subQuery.exec(QString("INSERT INTO magic_verify (v_uid, vid, info) VALUES ('%1', '%2', '%3') ON DUPLICATE KEY UPDATE vid='%4', info='%5';").arg(record.value("uid").toString(), options[0], options[1], options[0], options[1]));
subQuery.exec(QString("UPDATE magic_apply SET status=3 WHERE apply_id='%1'").arg(apply_id)); //已自动处理数据
subQuery.exec(QString("SELECT mail FROM magic_users WHERE uid='%1';").arg(record.value("uid").toString()));
QString mail;
if (subQuery.next())
mail = subQuery.value("mail").toString();
DB_SECOND.close();
finishedNum++;
if (!mail.isEmpty())
service::sendMail(smtp_config, mail, "WePlanet 审批进度更新", QString("用户%1:\n你的【账号认证申请】现已完成审核,账号认证信息现已更新。\n\n注:若认证信息有误,请联系管理员。").arg(record.value("uid").toString()));
}
}
}
Expand Down Expand Up @@ -531,5 +543,10 @@ QList<QString> ApprovalWork::getAuthApplyTokenResultList()
return authApplyTokenResultList;
}

void ApprovalWork::setSmtpConfig(const QList<QString> config)
{
smtp_config = config;
}

ApprovalWork::~ApprovalWork()
{}
2 changes: 2 additions & 0 deletions approvalwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ApprovalWork : public QObject
QHash<QString, QString> currentFormOptionsText; //当前申请表单 用户填写的文本
QList<QByteArray> applyFormList, applyFormListDone; //等待审核的列表,已经审核的列表(apply_id, uid, item_id, options, operate_time)
QList<QString> authApplyTokenResultList; //包含申请表id,申请人,申请项目名,审核状态,申请时间
QList<QString> smtp_config;

public:
void getManagePageApplyItems(const QString& uid);
Expand All @@ -48,6 +49,7 @@ class ApprovalWork : public QObject
QList<QByteArray> getCurrentApplyProcess(const QString& id);
QString getCurrentFormOptionsText(const QString& id); //当前申请表单的填写项的文本
QList<QString> getAuthApplyTokenResultList();
void setSmtpConfig(const QList<QString> config);

private slots:

Expand Down
4 changes: 2 additions & 2 deletions checkupdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

checkUpdate::checkUpdate()
{
CurVersion = "1.2.8.8"; //在此处定义软件当前版本
AutoUpdateToolVersion = 11288; //自动更新工具识别版本
CurVersion = "1.2.8.9"; //在此处定义软件当前版本
AutoUpdateToolVersion = 11289; //自动更新工具识别版本
writeVersion();
}
checkUpdate::~checkUpdate()
Expand Down
12 changes: 11 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ void MainWindow::on_actExit_triggered()

void MainWindow::on_actHome_triggered()
{
if (ui->stackedWidget->currentIndex() == 13)
if (homeLoading)
return;
initModelViewIsDisplay();
ui->stackedWidget->setCurrentIndex(0);
Expand Down Expand Up @@ -1670,6 +1670,7 @@ void MainWindow::setApplyListManagePage()
QList<QString> currentFormOptionsList = currentOptions.split("$", QString::SkipEmptyParts);
updateApplyItemOptions(1, currentFormOptionsList);

ui->groupBox_inputApproveResult->setVisible(true);
ui->textEdit_applyResultText->setEnabled(true);
ui->btn_submitApplyResult_argee->setEnabled(true);
ui->btn_submitApplyResult_reject->setEnabled(true);
Expand Down Expand Up @@ -1710,6 +1711,7 @@ void MainWindow::setApplyListManagePage()
QList<QString> currentFormOptionsList = currentOptions.split("$", QString::SkipEmptyParts);
updateApplyItemOptions(1, currentFormOptionsList);

ui->groupBox_inputApproveResult->setVisible(false);
ui->textEdit_applyResultText->setEnabled(false);
ui->btn_submitApplyResult_argee->setEnabled(false);
ui->btn_submitApplyResult_reject->setEnabled(false);
Expand Down Expand Up @@ -2636,6 +2638,7 @@ void MainWindow::on_btn_setApplyToken_clicked()
void MainWindow::on_btn_autoExecuteSystemApplyItems_clicked()
{
autoExecuteSystemApplyItemsLoading = true;
approvalWork->setSmtpConfig(setBaseInfoWork->getSmtpConfig());
emit autoExecuteSystemApplyItems();
}

Expand Down Expand Up @@ -2932,8 +2935,15 @@ void MainWindow::on_actRefresh_triggered()
}
}

void MainWindow::on_btn_openStore_clicked()
{
QMessageBox::information(this, "提示", "迫不及待了?积分商城目前正在装修中...将在今年稍后推出。", QMessageBox::Ok);
}

void MainWindow::on_actSettings_triggered()
{
if (settingLoading)
return;
initModelViewIsDisplay();
if (ui->groupBox_system->isEnabled())
{
Expand Down
2 changes: 2 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ private slots:

void receiveData(QString uid); //接收登录窗口信号

void on_btn_openStore_clicked();

void on_actExit_triggered();

void on_actHome_triggered();
Expand Down
89 changes: 58 additions & 31 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</font>
</property>
<property name="currentIndex">
<number>9</number>
<number>0</number>
</property>
<widget class="QWidget" name="home">
<layout class="QGridLayout" name="gridLayout_77">
Expand Down Expand Up @@ -547,6 +547,9 @@
<property name="text">
<string>--</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
Expand Down Expand Up @@ -576,6 +579,29 @@
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="btn_openStore">
<property name="minimumSize">
<size>
<width>100</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>积分商城</string>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/images/color_icon/color-star_2.svg</normaloff>:/images/color_icon/color-star_2.svg</iconset>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="label_verifyIcon">
<property name="geometry">
Expand Down Expand Up @@ -607,6 +633,7 @@
</widget>
<zorder>avatar</zorder>
<zorder>label_verifyIcon</zorder>
<zorder>btn_openStore</zorder>
</widget>
</item>
<item row="1" column="0">
Expand Down Expand Up @@ -2116,8 +2143,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>259</width>
<height>16</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -2149,8 +2176,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -3997,8 +4024,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>259</width>
<height>16</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -4030,8 +4057,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -4063,8 +4090,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -4148,8 +4175,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>22</width>
<height>16</height>
<width>100</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" name="ApplyProcess_Layout">
Expand Down Expand Up @@ -4188,8 +4215,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>20</width>
<height>263</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QVBoxLayout" name="applyForm_Layout">
Expand Down Expand Up @@ -7587,8 +7614,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>280</width>
<height>557</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -7620,8 +7647,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>280</width>
<height>557</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -7735,8 +7762,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>1048</width>
<height>278</height>
<width>100</width>
<height>30</height>
</rect>
</property>
<layout class="QVBoxLayout" name="applyForm_manage_Layout">
Expand Down Expand Up @@ -7843,7 +7870,7 @@ padding: 0px 5px;</string>
</widget>
</item>
<item row="2" column="0" colspan="8">
<widget class="QGroupBox" name="groupBox_13">
<widget class="QGroupBox" name="groupBox_inputApproveResult">
<property name="minimumSize">
<size>
<width>0</width>
Expand Down Expand Up @@ -8032,8 +8059,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>557</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -8065,8 +8092,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -8231,8 +8258,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>1016</width>
<height>83</height>
<width>100</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" name="manageApplyProcess_Layout">
Expand Down Expand Up @@ -8547,8 +8574,8 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>226</width>
<height>267</height>
<width>100</width>
<height>30</height>
</rect>
</property>
<layout class="QVBoxLayout" name="manageApplyAuditorList_Layout">
Expand Down Expand Up @@ -10233,7 +10260,7 @@ padding: 0px 5px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>439</width>
<width>421</width>
<height>291</height>
</rect>
</property>
Expand Down
2 changes: 1 addition & 1 deletion service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ bool service::initDatabaseTables(QSqlDatabase db)
"CREATE TABLE IF NOT EXISTS magic_verify"
"(v_uid int(10) NOT NULL AUTO_INCREMENT,"
"vid int(10) NOT NUll,"
"info varchar(64),"
"info varchar(256),"
"PRIMARY KEY (v_uid)"
")ENGINE=InnoDB;";
if (res)
Expand Down

0 comments on commit 73e77ca

Please sign in to comment.