feat: Remove check empty scan validity date.

This commit is contained in:
sunwen
2025-06-05 15:58:21 +08:00
parent 260606fdf0
commit 323cc58a5e
6 changed files with 87 additions and 130 deletions

View File

@@ -75,7 +75,7 @@ MainWindow::MainWindow(QWidget* aParent)
QApplication::processEvents();
});
connect(EventCenter::Default(), &EventCenter::LoginSuccess, this,&MainWindow::checkEmptyScanValidity);
//connect(EventCenter::Default(), &EventCenter::LoginSuccess, this,&MainWindow::checkEmptyScanValidity);
connect(EventCenter::Default(), &EventCenter::EmptyScanFinished, this,&MainWindow::enableAllTabWidget);
connect(EventCenter::Default(), &EventCenter::EmptyScanDataCorrupted, this, &MainWindow::handleEmptyScanDataCorrupted);
@@ -162,28 +162,28 @@ void MainWindow::initializeLayout()
mShutdownWidget->setVisible(false);
}
void MainWindow::checkEmptyScanValidity()
{
QDate lastScanDate = SQLHelper::queryValue("SELECT ScanDateTime FROM EScan ORDER BY ScanDateTime DESC LIMIT 1").toDate();
QDate expirationScanDate = lastScanDate.addMonths(1);
QDate currentDate = QDate::currentDate();
if(lastScanDate.isNull() || currentDate.daysTo(expirationScanDate) < 0)
{
mTabWidget->setCurrentIndex(3);
EventCenter::Default()->triggerEvent(EmptyScanDataExpire, nullptr, nullptr);
DialogManager::Default()->requestAlertMessage(tr("Please execute the empty scan, assist with system calibration, when empty scan is completed, the system should operate normally."), OkOnly, tr("Warning"));
mTabWidget->setTabEnabled(2, false);
mTabWidget->setTabEnabled(1, false);
mTabWidget->setTabEnabled(0, false);
return;
}
//void MainWindow::checkEmptyScanValidity()
//{
// QDate lastScanDate = SQLHelper::queryValue("SELECT ScanDateTime FROM EScan ORDER BY ScanDateTime DESC LIMIT 1").toDate();
// QDate expirationScanDate = lastScanDate.addMonths(1);
// QDate currentDate = QDate::currentDate();
// if(lastScanDate.isNull() || currentDate.daysTo(expirationScanDate) < 0)
// {
// mTabWidget->setCurrentIndex(3);
// EventCenter::Default()->triggerEvent(EmptyScanDataExpire, nullptr, nullptr);
// DialogManager::Default()->requestAlertMessage(tr("Please execute the empty scan, assist with system calibration, when empty scan is completed, the system should operate normally."), OkOnly, tr("Warning"));
// mTabWidget->setTabEnabled(2, false);
// mTabWidget->setTabEnabled(1, false);
// mTabWidget->setTabEnabled(0, false);
// return;
// }
if(currentDate.daysTo(expirationScanDate) < 3)
{
DialogManager::Default()->requestAlertMessage(tr("There are %1 days left until the next empty scan. Please remind users to conduct the empty scan in time.").arg(currentDate.daysTo(expirationScanDate) + 1), OkOnly, tr("Warning"));
return;
}
}
// if(currentDate.daysTo(expirationScanDate) < 3)
// {
// DialogManager::Default()->requestAlertMessage(tr("There are %1 days left until the next empty scan. Please remind users to conduct the empty scan in time.").arg(currentDate.daysTo(expirationScanDate) + 1), OkOnly, tr("Warning"));
// return;
// }
//}
void MainWindow::initializeTabWidget()
{

View File

@@ -53,7 +53,7 @@ private:
void loadStyleSheet(const QString& aSheetName);
void showShutdownWidget();
void processShutdownDmsFailed();
void checkEmptyScanValidity();
// void checkEmptyScanValidity();
void enableAllTabWidget();
void handleEmptyScanDataCorrupted();