git-svn-id: svn://192.168.0.12/source@198 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -490,8 +490,9 @@ void Widget::InsertCopyRow(int _nRow,QTableWidget *_pCurrent,QTableWidget *_pNew
|
|||||||
|
|
||||||
void Widget::SearchDate()
|
void Widget::SearchDate()
|
||||||
{
|
{
|
||||||
STable *pNew = new STable;
|
|
||||||
STable *pCurrent = (STable *)m_ptwData->currentWidget();
|
STable *pCurrent = (STable *)m_ptwData->currentWidget();
|
||||||
|
STable *pNew = new STable;
|
||||||
|
if (pCurrent == NULL) return;
|
||||||
pNew->setArticleSelect(pCurrent->getArticleSelect());
|
pNew->setArticleSelect(pCurrent->getArticleSelect());
|
||||||
pNew->SetHeaderList(&m_vecColumn,E_COLUMN_NAME);
|
pNew->SetHeaderList(&m_vecColumn,E_COLUMN_NAME);
|
||||||
m_pProgress->setRange(0,pCurrent->rowCount()-1);
|
m_pProgress->setRange(0,pCurrent->rowCount()-1);
|
||||||
@@ -1315,8 +1316,6 @@ void Widget::DataBaseCounterFilter(int _nArticle,int _nCategory,int _nComp,int _
|
|||||||
DataBaseFilter(E_FILTER_TYPE_COUNTER,json.Sql(strJson),_nGroup,_nCommand,_strFilterId);
|
DataBaseFilter(E_FILTER_TYPE_COUNTER,json.Sql(strJson),_nGroup,_nCommand,_strFilterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Widget::DataBaseReplaceFilter(int _nArticle,int _nCategory,int _nFind,QString _strFind,QString _strReplace,int _nGroup,int _nCommand,QString _strFilterId)
|
void Widget::DataBaseReplaceFilter(int _nArticle,int _nCategory,int _nFind,QString _strFind,QString _strReplace,int _nGroup,int _nCommand,QString _strFilterId)
|
||||||
{
|
{
|
||||||
QString strJson;
|
QString strJson;
|
||||||
@@ -1680,16 +1679,40 @@ void Widget::CountSave()
|
|||||||
m_pProgress->setRange(0,pCurrent->rowCount()-1);
|
m_pProgress->setRange(0,pCurrent->rowCount()-1);
|
||||||
|
|
||||||
QVector <SCount> vecData;
|
QVector <SCount> vecData;
|
||||||
|
if (nCatalog == m_nColumn)
|
||||||
|
{
|
||||||
|
QDate dateStart(2020,1,1),dateEnd(2000,1,1);
|
||||||
|
QMap <QDate,int> mapDate;
|
||||||
|
for (int nCount = 0 ; nCount < pCurrent->rowCount(); nCount++ )
|
||||||
|
{
|
||||||
|
if (pCurrent->item(nCount,nCatalog)->text().trimmed().isEmpty()) continue;
|
||||||
|
QDate date = QDateTime::fromString(pCurrent->item(nCount,nCatalog)->text().trimmed(),"yyyy-MM-dd hh:mm:ss").date();
|
||||||
|
dateStart = (date < dateStart ) ? date : dateStart;
|
||||||
|
dateEnd = (date > dateEnd ) ? date : dateEnd;
|
||||||
|
if (mapDate.contains(date) == false)
|
||||||
|
mapDate.insert(date,0);
|
||||||
|
mapDate[date]++;
|
||||||
|
m_pProgress->setValue(nCount);
|
||||||
|
m_pProgress->repaint();
|
||||||
|
}
|
||||||
|
for(QDate date = dateStart; date < dateEnd; date=date.addDays(1))
|
||||||
|
{
|
||||||
|
SCount stCount;
|
||||||
|
stCount.m_str = date.toString("yyyy-MM-dd");
|
||||||
|
if (mapDate.contains(date))
|
||||||
|
stCount.m_nCount = mapDate[date];
|
||||||
|
else
|
||||||
|
stCount.m_nCount = 0;
|
||||||
|
vecData.push_back(stCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
for (int nCount = 0 ; nCount < pCurrent->rowCount(); nCount++ )
|
for (int nCount = 0 ; nCount < pCurrent->rowCount(); nCount++ )
|
||||||
{
|
{
|
||||||
QString str;
|
QString str;
|
||||||
if (nCatalog == m_nColumn)
|
|
||||||
{
|
|
||||||
QDateTime date;
|
|
||||||
str = date.fromString(pCurrent->item(nCount,nCatalog)->text().trimmed(),"yyyy-MM-dd hh:mm:ss").date().toString("yyyy-MM-dd");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
str = pCurrent->item(nCount,nCatalog)->text().trimmed();
|
str = pCurrent->item(nCount,nCatalog)->text().trimmed();
|
||||||
|
if (str.isEmpty()) continue;
|
||||||
bool bInsert = true;
|
bool bInsert = true;
|
||||||
for (int i = 0; i < vecData.size(); i++)
|
for (int i = 0; i < vecData.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -1705,6 +1728,7 @@ void Widget::CountSave()
|
|||||||
m_pProgress->setValue(nCount);
|
m_pProgress->setValue(nCount);
|
||||||
m_pProgress->repaint();
|
m_pProgress->repaint();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
QFile file(strFilename);
|
QFile file(strFilename);
|
||||||
if(!file.open(QFile::WriteOnly | QFile::Text)) return;
|
if(!file.open(QFile::WriteOnly | QFile::Text)) return;
|
||||||
QTextStream out(&file);
|
QTextStream out(&file);
|
||||||
|
|||||||
Reference in New Issue
Block a user