[ref]同步711
This commit is contained in:
parent
e031f71989
commit
246c448e39
@ -1,4 +1,4 @@
|
|||||||
#ifndef CASSETCOMMON_H
|
#ifndef CASSETCOMMON_H
|
||||||
#define CASSETCOMMON_H
|
#define CASSETCOMMON_H
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CAssetDataMng.h"
|
#include "CAssetDataMng.h"
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "pub_logger_api/logger.h"
|
#include "pub_logger_api/logger.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -170,7 +170,7 @@ int CAssetDataMng::readLocIdByDevg(const QString &devg,int &loc)
|
|||||||
{
|
{
|
||||||
if(!m_pWriteDb->isOpen())
|
if(!m_pWriteDb->isOpen())
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
QString sqlQuery = QString("select LOCATION_ID from dev_group where TAG_NAME='%1'").arg(devg);
|
QString sqlQuery = QString("select LOCATION_ID from dev_group where TAG_NAME='%1'").arg(devg);
|
||||||
@ -180,9 +180,9 @@ int CAssetDataMng::readLocIdByDevg(const QString &devg,int &loc)
|
|||||||
while(query.next())
|
while(query.next())
|
||||||
{
|
{
|
||||||
loc = query.value(0).toInt();
|
loc = query.value(0).toInt();
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<AssetInfo> CAssetDataMng::getAssetInfoByDevg(const QStringList &devgList)
|
QList<AssetInfo> CAssetDataMng::getAssetInfoByDevg(const QStringList &devgList)
|
||||||
@ -357,7 +357,7 @@ int CAssetDataMng::addAsset(const AssetInfo &info)
|
|||||||
if(!m_pWriteDb->isOpen())
|
if(!m_pWriteDb->isOpen())
|
||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString sqlQuery= QString("insert into asset_info(dev_id,dev_name,dev_type,dev_param,setup_date,dev_status,contact,backup,dev_group,maintain_period) values('%1','%2','%3','%4',%5,'%6','%7','%8','%9',%10)").arg(getRandomId()).arg(info.name).arg(info.type).arg(info.param).arg(info.setUpTime)
|
QString sqlQuery= QString("insert into asset_info(dev_id,dev_name,dev_type,dev_param,setup_date,dev_status,contact,backup,dev_group,maintain_period) values('%1','%2','%3','%4',%5,'%6','%7','%8','%9',%10)").arg(getRandomId()).arg(info.name).arg(info.type).arg(info.param).arg(info.setUpTime)
|
||||||
@ -366,9 +366,9 @@ int CAssetDataMng::addAsset(const AssetInfo &info)
|
|||||||
if(m_pWriteDb->execute(sqlQuery) == false)
|
if(m_pWriteDb->execute(sqlQuery) == false)
|
||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAssetDataMng::importAsset(const QMap<QString,AssetInfo> &infoMap,QString &mess)
|
void CAssetDataMng::importAsset(const QMap<QString,AssetInfo> &infoMap,QString &mess)
|
||||||
@ -442,7 +442,7 @@ int CAssetDataMng::updateAsset(const AssetInfo &info)
|
|||||||
if(!m_pWriteDb->isOpen())
|
if(!m_pWriteDb->isOpen())
|
||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
QString sqlQuery =QString("update asset_info set dev_name='%1',dev_type='%2',dev_param='%3',setup_date=%4,dev_status='%5',contact='%6',backup='%7',dev_group='%8',maintain_period= %9 "
|
QString sqlQuery =QString("update asset_info set dev_name='%1',dev_type='%2',dev_param='%3',setup_date=%4,dev_status='%5',contact='%6',backup='%7',dev_group='%8',maintain_period= %9 "
|
||||||
@ -452,9 +452,9 @@ int CAssetDataMng::updateAsset(const AssetInfo &info)
|
|||||||
if(m_pWriteDb->execute(sqlQuery, query) == false)
|
if(m_pWriteDb->execute(sqlQuery, query) == false)
|
||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAssetDataMng::delAsset(const QList<QString> &idList)
|
int CAssetDataMng::delAsset(const QList<QString> &idList)
|
||||||
@ -462,16 +462,16 @@ int CAssetDataMng::delAsset(const QList<QString> &idList)
|
|||||||
if(!m_pWriteDb->isOpen())
|
if(!m_pWriteDb->isOpen())
|
||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
if(idList.isEmpty())
|
if(idList.isEmpty())
|
||||||
{
|
{
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
if(m_pWriteDb->transaction() == false)
|
if(m_pWriteDb->transaction() == false)
|
||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
QString con = QString("dev_id in (");
|
QString con = QString("dev_id in (");
|
||||||
for(int index(0);index<idList.count();index++)
|
for(int index(0);index<idList.count();index++)
|
||||||
@ -494,16 +494,16 @@ int CAssetDataMng::delAsset(const QList<QString> &idList)
|
|||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
m_pWriteDb->rollback();
|
m_pWriteDb->rollback();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAssetDataMng::addRecord(const AssetRecord &info)
|
int CAssetDataMng::addRecord(const AssetRecord &info)
|
||||||
{
|
{
|
||||||
if(!m_pWriteDb->isOpen())
|
if(!m_pWriteDb->isOpen())
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
QString sqlQuery= QString("insert into asset_records(record_id,dev_id,record_name,opt_user,start_time,end_time,content) values('%1','%2','%3','%4',%5,%6,'%7')").arg(getRandomId()).arg(info.dev_id).arg(info.record_name).arg(info.opt_user).arg(info.startTime)
|
QString sqlQuery= QString("insert into asset_records(record_id,dev_id,record_name,opt_user,start_time,end_time,content) values('%1','%2','%3','%4',%5,%6,'%7')").arg(getRandomId()).arg(info.dev_id).arg(info.record_name).arg(info.opt_user).arg(info.startTime)
|
||||||
.arg(info.endTime).arg(info.content);
|
.arg(info.endTime).arg(info.content);
|
||||||
@ -511,9 +511,9 @@ int CAssetDataMng::addRecord(const AssetRecord &info)
|
|||||||
if(m_pWriteDb->execute(sqlQuery) == false)
|
if(m_pWriteDb->execute(sqlQuery) == false)
|
||||||
{
|
{
|
||||||
m_error = m_pWriteDb->getLastErrorString();
|
m_error = m_pWriteDb->getLastErrorString();
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAssetDataMng::importRecord(const QMap<QString, AssetRecord> &infoMap, QString &mess)
|
void CAssetDataMng::importRecord(const QMap<QString, AssetRecord> &infoMap, QString &mess)
|
||||||
@ -583,7 +583,7 @@ int CAssetDataMng::updateRecord(const AssetRecord &info)
|
|||||||
{
|
{
|
||||||
if(!m_pWriteDb->isOpen())
|
if(!m_pWriteDb->isOpen())
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
QString sqlQuery =QString("update asset_records set dev_id='%1',record_name='%2',opt_user='%3',start_time=%4,end_time=%5,content='%6' "
|
QString sqlQuery =QString("update asset_records set dev_id='%1',record_name='%2',opt_user='%3',start_time=%4,end_time=%5,content='%6' "
|
||||||
@ -592,20 +592,20 @@ int CAssetDataMng::updateRecord(const AssetRecord &info)
|
|||||||
LOGDEBUG("updateRecord():sql[%s]",sqlQuery.toStdString().c_str());
|
LOGDEBUG("updateRecord():sql[%s]",sqlQuery.toStdString().c_str());
|
||||||
if(m_pWriteDb->execute(sqlQuery, query) == false)
|
if(m_pWriteDb->execute(sqlQuery, query) == false)
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAssetDataMng::delRecord(const QList<QString> &intList)
|
int CAssetDataMng::delRecord(const QList<QString> &intList)
|
||||||
{
|
{
|
||||||
if(!m_pWriteDb->isOpen())
|
if(!m_pWriteDb->isOpen())
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
if(intList.isEmpty())
|
if(intList.isEmpty())
|
||||||
{
|
{
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
QString con = QString("record_id in (");
|
QString con = QString("record_id in (");
|
||||||
for(int index(0);index<intList.count();index++)
|
for(int index(0);index<intList.count();index++)
|
||||||
@ -621,7 +621,7 @@ int CAssetDataMng::delRecord(const QList<QString> &intList)
|
|||||||
QString sqlQuery =QString("delete from asset_records where %1 ").arg(con);
|
QString sqlQuery =QString("delete from asset_records where %1 ").arg(con);
|
||||||
LOGDEBUG("delRecord():sql[%s]",sqlQuery.toStdString().c_str());
|
LOGDEBUG("delRecord():sql[%s]",sqlQuery.toStdString().c_str());
|
||||||
m_pWriteDb->execute(sqlQuery);
|
m_pWriteDb->execute(sqlQuery);
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAssetDataMng::getCount()
|
int CAssetDataMng::getCount()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#ifndef CASSETDATAMNG_H
|
#ifndef CASSETDATAMNG_H
|
||||||
#define CASSETDATAMNG_H
|
#define CASSETDATAMNG_H
|
||||||
|
|
||||||
#include "db_api_ex/CDbApi.h"
|
#include "db_api_ex/CDbApi.h"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CAssetDelegate.h"
|
#include "CAssetDelegate.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
@ -64,7 +64,7 @@ bool CAssetDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AssetInfo info;
|
AssetInfo info;
|
||||||
if(m_pModel->getAssetInfo(index,info) != kbdSuccess)
|
if(m_pModel->getAssetInfo(index,info) != iotSuccess)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#ifndef CASSETDELEGATE_H
|
#ifndef CASSETDELEGATE_H
|
||||||
#define CASSETDELEGATE_H
|
#define CASSETDELEGATE_H
|
||||||
|
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CAssetPluginWidget.h"
|
#include "CAssetPluginWidget.h"
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "CAssetWidget.h"
|
#include "CAssetWidget.h"
|
||||||
#include "pub_logger_api/logger.h"
|
#include "pub_logger_api/logger.h"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#ifndef CASSETPLUGINWIDGET_H
|
#ifndef CASSETPLUGINWIDGET_H
|
||||||
#define CASSETPLUGINWIDGET_H
|
#define CASSETPLUGINWIDGET_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -7,7 +7,7 @@
|
|||||||
class CAssetPluginWidget : public QObject, public CPluginWidgetInterface
|
class CAssetPluginWidget : public QObject, public CPluginWidgetInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0")
|
Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
|
||||||
Q_INTERFACES(CPluginWidgetInterface)
|
Q_INTERFACES(CPluginWidgetInterface)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CAssetTableModel.h"
|
#include "CAssetTableModel.h"
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
CAssetTableModel::CAssetTableModel(QObject *parent)
|
CAssetTableModel::CAssetTableModel(QObject *parent)
|
||||||
@ -146,10 +146,10 @@ int CAssetTableModel::getAssetInfo(const QModelIndex &index,AssetInfo &info)
|
|||||||
if(index.row() < m_listShowInfo.size())
|
if(index.row() < m_listShowInfo.size())
|
||||||
{
|
{
|
||||||
info = m_listShowInfo.at(index.row());
|
info = m_listShowInfo.at(index.row());
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CAssetUuid.h"
|
#include "CAssetUuid.h"
|
||||||
#include "boost/typeof/typeof.hpp"
|
#include "boost/typeof/typeof.hpp"
|
||||||
#include "boost/algorithm/string/replace.hpp"
|
#include "boost/algorithm/string/replace.hpp"
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#ifndef CASSETUUID_H
|
#ifndef CASSETUUID_H
|
||||||
#define CASSETUUID_H
|
#define CASSETUUID_H
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CAssetView.h"
|
#include "CAssetView.h"
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CAssetWidget.h"
|
#include "CAssetWidget.h"
|
||||||
#include "ui_CAssetWidget.h"
|
#include "ui_CAssetWidget.h"
|
||||||
#include "pub_logger_api/logger.h"
|
#include "pub_logger_api/logger.h"
|
||||||
#include <CAssetDataMng.h>
|
#include <CAssetDataMng.h>
|
||||||
@ -246,7 +246,7 @@ bool CAssetWidget::containsFilterText(const AssetInfo &info, const QString &filt
|
|||||||
void CAssetWidget::inAssetInfo()
|
void CAssetWidget::inAssetInfo()
|
||||||
{
|
{
|
||||||
QString fileName= QString();
|
QString fileName= QString();
|
||||||
if(kbdSuccess !=getOpenFileName(fileName))
|
if(iotSuccess !=getOpenFileName(fileName))
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ void CAssetWidget::inRecordInfo()
|
|||||||
{
|
{
|
||||||
|
|
||||||
QString fileName= QString();
|
QString fileName= QString();
|
||||||
if(kbdSuccess !=getOpenFileName(fileName))
|
if(iotSuccess !=getOpenFileName(fileName))
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -269,7 +269,7 @@ void CAssetWidget::inRecordInfo()
|
|||||||
void CAssetWidget::outAssetInfo()
|
void CAssetWidget::outAssetInfo()
|
||||||
{
|
{
|
||||||
QString fileName= QString();
|
QString fileName= QString();
|
||||||
if(kbdSuccess !=getSaveFileName(fileName))
|
if(iotSuccess !=getSaveFileName(fileName))
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ void CAssetWidget::outAssetInfo()
|
|||||||
void CAssetWidget::outRecordInfo()
|
void CAssetWidget::outRecordInfo()
|
||||||
{
|
{
|
||||||
QString fileName= QString();
|
QString fileName= QString();
|
||||||
if(kbdSuccess !=getSaveFileName(fileName))
|
if(iotSuccess !=getSaveFileName(fileName))
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -307,13 +307,13 @@ int CAssetWidget::getSaveFileName(QString &fileName)
|
|||||||
fileName = QFileDialog::getSaveFileName(this,tr("Save File"),QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),"Excel 文件(*.xlsx)");//获取保存路径*.xls
|
fileName = QFileDialog::getSaveFileName(this,tr("Save File"),QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),"Excel 文件(*.xlsx)");//获取保存路径*.xls
|
||||||
if(fileName.isEmpty())
|
if(fileName.isEmpty())
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
if(!fileName.endsWith(".xlsx",Qt::CaseInsensitive))
|
if(!fileName.endsWith(".xlsx",Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
fileName = fileName+".xlsx";
|
fileName = fileName+".xlsx";
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAssetWidget::getOpenFileName(QString &fileName)
|
int CAssetWidget::getOpenFileName(QString &fileName)
|
||||||
@ -321,9 +321,9 @@ int CAssetWidget::getOpenFileName(QString &fileName)
|
|||||||
fileName = QFileDialog::getOpenFileName(this,tr("Open File"),"","Excel(*.xlsx)");
|
fileName = QFileDialog::getOpenFileName(this,tr("Open File"),"","Excel(*.xlsx)");
|
||||||
if(fileName.isEmpty())
|
if(fileName.isEmpty())
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAssetWidget::filterText(QList<AssetInfo> &assetList)
|
void CAssetWidget::filterText(QList<AssetInfo> &assetList)
|
||||||
@ -473,7 +473,7 @@ void CAssetWidget::addAsset()
|
|||||||
}
|
}
|
||||||
if(loc == -1 && !devg.isEmpty())
|
if(loc == -1 && !devg.isEmpty())
|
||||||
{
|
{
|
||||||
if(kbdFailed == CAssetDataMng::instance()->readLocIdByDevg(devg,loc))
|
if(iotFailed == CAssetDataMng::instance()->readLocIdByDevg(devg,loc))
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -505,7 +505,7 @@ void CAssetWidget::delAsset()
|
|||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
if(CAssetDataMng::instance()->delAsset(idList) == kbdFailed)
|
if(CAssetDataMng::instance()->delAsset(idList) == iotFailed)
|
||||||
{
|
{
|
||||||
messBox(tr("删除失败!"));
|
messBox(tr("删除失败!"));
|
||||||
}else
|
}else
|
||||||
@ -568,12 +568,12 @@ void CAssetWidget::assetDoubleClicked(const QModelIndex &index)
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
AssetInfo info;
|
AssetInfo info;
|
||||||
if(m_pModel->getAssetInfo(index,info) != kbdSuccess)
|
if(m_pModel->getAssetInfo(index,info) != iotSuccess)
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
int loc = 0;
|
int loc = 0;
|
||||||
if(CAssetDataMng::instance()->readLocIdByDevg(info.dev_group,loc) == kbdFailed)
|
if(CAssetDataMng::instance()->readLocIdByDevg(info.dev_group,loc) == iotFailed)
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#ifndef CASSETWIDGET_H
|
#ifndef CASSETWIDGET_H
|
||||||
#define CASSETWIDGET_H
|
#define CASSETWIDGET_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CPropertyDialog.h"
|
#include "CPropertyDialog.h"
|
||||||
#include "ui_CPropertyDialog.h"
|
#include "ui_CPropertyDialog.h"
|
||||||
#include "CAssetDataMng.h"
|
#include "CAssetDataMng.h"
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
@ -171,7 +171,7 @@ void CPropertyDialog::okClicked()
|
|||||||
m_assetInfo.dev_group = ui->cDevG->currentData().toString();
|
m_assetInfo.dev_group = ui->cDevG->currentData().toString();
|
||||||
m_assetInfo.backup = ui->tBackup->toPlainText();
|
m_assetInfo.backup = ui->tBackup->toPlainText();
|
||||||
|
|
||||||
if(save() == kbdSuccess)
|
if(save() == iotSuccess)
|
||||||
{
|
{
|
||||||
accept();
|
accept();
|
||||||
}else
|
}else
|
||||||
@ -194,5 +194,5 @@ int CPropertyDialog::save()
|
|||||||
{
|
{
|
||||||
return CAssetDataMng::instance()->updateAsset(m_assetInfo);
|
return CAssetDataMng::instance()->updateAsset(m_assetInfo);
|
||||||
}
|
}
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CRecordDialog.h"
|
#include "CRecordDialog.h"
|
||||||
#include "ui_CRecordDialog.h"
|
#include "ui_CRecordDialog.h"
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include "CAssetDataMng.h"
|
#include "CAssetDataMng.h"
|
||||||
@ -132,7 +132,7 @@ void CRecordDialog::delRecord()
|
|||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
if(CAssetDataMng::instance()->delRecord(idList) == kbdFailed)
|
if(CAssetDataMng::instance()->delRecord(idList) == iotFailed)
|
||||||
{
|
{
|
||||||
messBox(tr("删除失败!"));
|
messBox(tr("删除失败!"));
|
||||||
}else
|
}else
|
||||||
@ -145,7 +145,7 @@ void CRecordDialog::delRecord()
|
|||||||
void CRecordDialog::outRecord()
|
void CRecordDialog::outRecord()
|
||||||
{
|
{
|
||||||
QString fileName= QString();
|
QString fileName= QString();
|
||||||
if(kbdSuccess !=getFileName(fileName))
|
if(iotSuccess !=getFileName(fileName))
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ void CRecordDialog::recordDoubleClicked(const QModelIndex &index)
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
AssetRecord info;
|
AssetRecord info;
|
||||||
if(m_pModel->getRecordInfo(index,info) != kbdSuccess)
|
if(m_pModel->getRecordInfo(index,info) != iotSuccess)
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@ -287,11 +287,11 @@ int CRecordDialog::getFileName(QString &fileName)
|
|||||||
fileName = QFileDialog::getSaveFileName(this,tr("Save File"),QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),"Excel 文件(*.xlsx)");//获取保存路径*.xls
|
fileName = QFileDialog::getSaveFileName(this,tr("Save File"),QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),"Excel 文件(*.xlsx)");//获取保存路径*.xls
|
||||||
if(fileName.isEmpty())
|
if(fileName.isEmpty())
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
if(!fileName.endsWith(".xlsx",Qt::CaseInsensitive))
|
if(!fileName.endsWith(".xlsx",Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
fileName = fileName+".xlsx";
|
fileName = fileName+".xlsx";
|
||||||
}
|
}
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CRecordPropertyDialog.h"
|
#include "CRecordPropertyDialog.h"
|
||||||
#include "ui_CRecordPropertyDialog.h"
|
#include "ui_CRecordPropertyDialog.h"
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
@ -98,7 +98,7 @@ void CRecordPropertyDialog::okClicked()
|
|||||||
messBox(tr("开始时间不能大于结束时间!"));
|
messBox(tr("开始时间不能大于结束时间!"));
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
if(save() == kbdSuccess)
|
if(save() == iotSuccess)
|
||||||
{
|
{
|
||||||
accept();
|
accept();
|
||||||
}else
|
}else
|
||||||
@ -121,5 +121,5 @@ int CRecordPropertyDialog::save()
|
|||||||
{
|
{
|
||||||
return CAssetDataMng::instance()->updateRecord(m_assetRecord);
|
return CAssetDataMng::instance()->updateRecord(m_assetRecord);
|
||||||
}
|
}
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CRecordTablModel.h"
|
#include "CRecordTablModel.h"
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
@ -107,10 +107,10 @@ int CRecordTablModel::getRecordInfo(const QModelIndex &index, AssetRecord &info)
|
|||||||
if(index.row() < m_listShowInfo.size())
|
if(index.row() < m_listShowInfo.size())
|
||||||
{
|
{
|
||||||
info = m_listShowInfo.at(index.row());
|
info = m_listShowInfo.at(index.row());
|
||||||
return kbdSuccess;
|
return iotSuccess;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
return kbdFailed;
|
return iotFailed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "CWorker.h"
|
#include "CWorker.h"
|
||||||
#include "model_excel/xlsx/xlsxdocument.h"
|
#include "model_excel/xlsx/xlsxdocument.h"
|
||||||
#include "model_excel/xlsx/xlsxformat.h"
|
#include "model_excel/xlsx/xlsxformat.h"
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user