에러 발생시 로그 저장
git-svn-id: svn://192.168.0.12/source@220 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -192,6 +192,7 @@ void SFilterProcess::run(QString _strFindID,QString _strFilterGroupName)
|
||||
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());
|
||||
m_db.close();
|
||||
return;
|
||||
@@ -592,7 +593,7 @@ void SFilterProcess::DataFilter(QString _strFilterGroupID)
|
||||
}
|
||||
QString sql = "select type,data from filter where filtergroup_id = " + _strFilterGroupID;
|
||||
QSqlQuery query;
|
||||
if(query.exec(sql) == false) { InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(sql) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
while (query.next())
|
||||
{
|
||||
switch(query.value(0).toInt())
|
||||
@@ -867,7 +868,7 @@ void SFilterProcess::DataLoad(QString _strDataNum)
|
||||
astrWhere[E_ARTICLE_BODY] += " Order by article_date DESC";
|
||||
for (int i = 0; i < E_ARTICLE_MAX ; i++)
|
||||
{
|
||||
if(query.exec(QString(strSelect + astrWhere[i]).toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(QString(strSelect + astrWhere[i]).toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
int nCount = 0;
|
||||
while(query.next())
|
||||
{
|
||||
@@ -1110,7 +1111,7 @@ void SFilterProcess::DataInfluenceBuzzCount(QString _strCompanyNum)
|
||||
}
|
||||
else
|
||||
strQuery += ",0,0,0)";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());qDebug() << strQuery;return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());qDebug() << strQuery;return;}
|
||||
}
|
||||
m_db.close();
|
||||
}
|
||||
@@ -1231,13 +1232,13 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
QSqlQuery query;
|
||||
QString strQuery;
|
||||
strQuery = "delete from stats_inf_blogger_rank where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "delete from influencer where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "truncate body_influencer_map_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "truncate reply_influencer_map_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
QList<SInfluenceCount> list = mapCount.values();
|
||||
qSort(list.begin(),list.end(),QSortInfulrence);
|
||||
@@ -1272,7 +1273,7 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
|
||||
query.bindValue(":ID_ID",stIn.m_strID.trimmed().toUtf8());
|
||||
query.bindValue(":RANK",ncRank++);
|
||||
if(query.exec() == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec() == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
}
|
||||
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Influence (rank influence value Insert)");
|
||||
@@ -1282,7 +1283,7 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
{
|
||||
if (nCount >= 10) break; nCount++;
|
||||
strQuery = MakeInfluencerrankQuery(stIn,nCount,"influencevalue",strCompanyNum);
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
}
|
||||
nCount = 0;
|
||||
qSort(list.begin(),list.end(),QSortBody);
|
||||
@@ -1292,7 +1293,7 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
{
|
||||
if (nCount >= 10) break; nCount++;
|
||||
strQuery = MakeInfluencerrankQuery(stIn,nCount,"bodycount",strCompanyNum);
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
}
|
||||
|
||||
qSort(list.begin(),list.end(),QSortReply);
|
||||
@@ -1302,7 +1303,7 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
{
|
||||
if (nCount >= 10) break; nCount++;
|
||||
strQuery = MakeInfluencerrankQuery(stIn,nCount,"replycount",strCompanyNum);
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
}
|
||||
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Influence (Map body Insert)");
|
||||
@@ -1318,7 +1319,7 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
strQuery += QString::number(stMap.m_nId) + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
qDebug() << strQuery;InsertLog(query.lastQuery()); InsertLog(query.lastError().text());
|
||||
InsertLog(strQuery);
|
||||
}
|
||||
}
|
||||
@@ -1336,7 +1337,9 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
strQuery += QString::number(stMap.m_nId) + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
qDebug() << strQuery;
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());
|
||||
InsertLog(strQuery);
|
||||
}
|
||||
}
|
||||
@@ -1349,7 +1352,7 @@ void SFilterProcess::DataInfluenceCount(QString _strFilter,QString _strCompanyNu
|
||||
strQuery = "update dbinfo set "
|
||||
"influencercount = " + QString::number(list.size()) + " "
|
||||
"where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) { InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Influence (Finish)");
|
||||
m_db.close();
|
||||
InsertLog("Influence Rank Count Send End");
|
||||
@@ -1547,13 +1550,13 @@ void SFilterProcess::DataSpammersCount(QString _strFilter,QString _strCompanyNum
|
||||
QString strQuery;
|
||||
QString strCompanyNum = _strCompanyNum;
|
||||
strQuery = "delete from stats_spa_spammer_rank where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "delete from spammer where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "truncate body_spammer_map_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "truncate reply_spammer_map_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
QMap <QString,int> mapPlatformnameCount;
|
||||
|
||||
@@ -1588,7 +1591,9 @@ void SFilterProcess::DataSpammersCount(QString _strFilter,QString _strCompanyNum
|
||||
strQuery += QString::number(nCount) + ",";
|
||||
strQuery += strValue + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
qDebug() << strQuery;
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());
|
||||
InsertLog(strQuery);
|
||||
continue;
|
||||
}
|
||||
@@ -1600,7 +1605,9 @@ void SFilterProcess::DataSpammersCount(QString _strFilter,QString _strCompanyNum
|
||||
strQuery += QString::number(mapPlatformnameCount[strPlatformname]) + ",";
|
||||
strQuery += strValue + ",'" + strPlatformname + "','spammervalue')";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
qDebug() << strQuery;
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());
|
||||
InsertLog(strQuery);
|
||||
continue;
|
||||
}
|
||||
@@ -1622,7 +1629,9 @@ void SFilterProcess::DataSpammersCount(QString _strFilter,QString _strCompanyNum
|
||||
strQuery += QString::number(stMap.m_nId_num) + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
qDebug() << strQuery;
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());
|
||||
InsertLog(strQuery);
|
||||
}
|
||||
}
|
||||
@@ -1642,7 +1651,9 @@ void SFilterProcess::DataSpammersCount(QString _strFilter,QString _strCompanyNum
|
||||
strQuery += QString::number(stMap.m_nId_num) + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
qDebug() << strQuery;
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());
|
||||
InsertLog(strQuery);
|
||||
}
|
||||
}
|
||||
@@ -1655,7 +1666,7 @@ void SFilterProcess::DataSpammersCount(QString _strFilter,QString _strCompanyNum
|
||||
strQuery = "update dbinfo set "
|
||||
"spammercount = " + QString::number(list.size()) + " "
|
||||
"where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Spammer (Finish)");
|
||||
|
||||
@@ -1823,6 +1834,7 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
m_db.setDatabaseName(m_strWebDataBaseName);
|
||||
if (m_db.open() == false)
|
||||
{
|
||||
|
||||
InsertLog(m_db.lastError().text());
|
||||
return;
|
||||
}
|
||||
@@ -1831,13 +1843,13 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
QString strCompanyNum = _strCompanyNum;
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Power Cafe (Delete)");
|
||||
strQuery = "delete from powercafe where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "delete from stats_pow_cafe_rank where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "truncate body_powercafe_map_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
strQuery = "truncate reply_powercafe_map_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
QList<SPowerCafeCount> list = mapRealCount.values();
|
||||
qSort(list.begin(),list.end(),QSortPowerCafeReal);
|
||||
@@ -1861,6 +1873,7 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
query.bindValue(":USER_REAL",stIn.m_mapUser.size());
|
||||
query.bindValue(":RANK",++nCount);
|
||||
if(query.exec() == false) {
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());return;
|
||||
}
|
||||
}
|
||||
@@ -1880,6 +1893,7 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
query.bindValue(":COUNT_ALL",stIn.m_ncAllReal);
|
||||
query.bindValue(":RANK",nCount);
|
||||
if(query.exec() == false) {
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());return;
|
||||
}
|
||||
}
|
||||
@@ -1903,6 +1917,7 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
query.bindValue(":COUNT_ALL",stIn.m_ncAll);
|
||||
query.bindValue(":RANK",nCount);
|
||||
if(query.exec() == false) {
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());
|
||||
return;}
|
||||
}
|
||||
@@ -1919,6 +1934,7 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(strQuery);
|
||||
}
|
||||
}
|
||||
@@ -1935,7 +1951,9 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
strQuery += QString::number(stMap.m_nReply) + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
qDebug() << strQuery;InsertLog(query.lastError().text());
|
||||
qDebug() << strQuery;
|
||||
InsertLog(query.lastError().text());
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(strQuery);
|
||||
}
|
||||
}
|
||||
@@ -1946,7 +1964,7 @@ void SFilterProcess::DataPowerCafeCount(QString _strFilter,QString _strCompanyNu
|
||||
strQuery = "update dbinfo set "
|
||||
"powercafecount = " + QString::number(listAll.size()) + " "
|
||||
"where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Power Cafe (Finish)");
|
||||
|
||||
@@ -1997,10 +2015,10 @@ void SFilterProcess::DataConsumerSupervisionCount(QString _strCompanyNum)
|
||||
QSqlQuery query;
|
||||
QString strQuery;
|
||||
strQuery = "delete from stats_con_client_buzzbymaketer where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
strQuery = "select id,platformname from marketer where company_num = " + strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
while(query.next())
|
||||
{
|
||||
SMaketer stMaketer;
|
||||
@@ -2074,7 +2092,7 @@ void SFilterProcess::DataConsumerSupervisionCount(QString _strCompanyNum)
|
||||
strQuery += QString::number(stMaket.m_nBodyCount) + ",";
|
||||
strQuery += QString::number(stMaket.m_nReplyCount) + ",";
|
||||
strQuery += strCompanyNum + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
}
|
||||
InsertLog("Markter Rank Count Send End");
|
||||
}
|
||||
@@ -2093,7 +2111,7 @@ void SFilterProcess::DataConsumerSupervisionCount(QString _strCompanyNum)
|
||||
strQuery += QString::number(stMaket.m_nBodyCount) + ",";
|
||||
strQuery += QString::number(stMaket.m_nReplyCount) + ",";
|
||||
strQuery += strCompanyNum + ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
}
|
||||
InsertLog("Maketer in Cafe Rank Count Send End");
|
||||
}
|
||||
@@ -2110,7 +2128,7 @@ bool SFilterProcess::RenameTable(QString _strOld, QString _strNew , QString _str
|
||||
strQuery += _strOld + " TO " + _strTmp + ",";
|
||||
strQuery += _strNew + " TO " + _strOld + ",";
|
||||
strQuery += _strTmp + " TO " + _strNew;
|
||||
if (query.exec(strQuery.toUtf8())==false) { InsertLog(query.lastError().text());return false;}
|
||||
if (query.exec(strQuery.toUtf8())==false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return false;}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2166,22 +2184,22 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Data (Delete)");
|
||||
|
||||
strQuery = "truncate body_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
strQuery = "truncate reply_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
strQuery = "truncate body_consumer_map_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
strQuery = "delete from id_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
strQuery = "truncate nickname_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
strQuery = "delete from community_" + _strCompanyNum + "_update";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
QString strReplyQuery = QString("insert into reply_" + _strCompanyNum + "_update (num,id_num,nickname_num,community_num,id_id,parent,data,date,body_num,realbycategorynum) VALUES (:NUM,:ID_NUM,:NICKNAME_NUM,:COMMUNITY_NUM,:ID_ID,:PARENT,:DATA,:DATE,:BODY_NUM,:REALBYCATEGORYNUM)").toUtf8();
|
||||
QString strBodyQuery = QString("insert into body_" + _strCompanyNum + "_update(num,id_num,nickname_num,community_num,id_id,platformname_num,platformform_num, title, data, url, view, date, reply_startnum, reply_endnum, reply_count, lastupdate, realbycategorynum)"
|
||||
@@ -2204,6 +2222,7 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
strQuery += ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());m_db.close();qDebug() << strQuery;return;
|
||||
}
|
||||
}
|
||||
@@ -2219,6 +2238,7 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
strQuery += "," + QString::number(stID.m_nCommunity);
|
||||
strQuery += ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false) {
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());m_db.close();qDebug() << strQuery;return;
|
||||
}
|
||||
}
|
||||
@@ -2236,6 +2256,7 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
strQuery += ")";
|
||||
if(query.exec(strQuery.toUtf8()) == false)
|
||||
{
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());m_db.close();qDebug() << strQuery;return;
|
||||
}
|
||||
}
|
||||
@@ -2261,6 +2282,7 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
query.bindValue(":BODY_NUM",m_mapData[strUrl].m_nNum);
|
||||
query.bindValue(":REALBYCATEGORYNUM",GetVectorToString(stReply.m_vecCategory," ").trimmed());
|
||||
if (query.exec()==false){
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());m_db.close();return;
|
||||
}
|
||||
{
|
||||
@@ -2321,6 +2343,7 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
|
||||
query.bindValue(":REALBYCATEGORYNUM",GetVectorToString(m_mapData[strUrl].m_vecCategory," ").trimmed());
|
||||
if (query.exec()==false) {
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());m_db.close();return;
|
||||
}
|
||||
nBodyCount++;
|
||||
@@ -2337,11 +2360,12 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
query.bindValue(":CATEGORY_NUM",stMap.m_nCategory);
|
||||
query.bindValue(":REALIN",stMap.m_nRealIn);
|
||||
if (query.exec()==false){
|
||||
InsertLog(query.lastQuery());
|
||||
InsertLog(query.lastError().text());m_db.close();return;}
|
||||
}
|
||||
|
||||
strQuery = "delete from stats_con_user_buzzbyday where company_num = " + _strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
|
||||
QDate date = QDate::currentDate().addDays(m_nCutDays);
|
||||
QString astrOrderBy[D_ARTICLE_MAX] = {"body","reply","all"};
|
||||
@@ -2380,7 +2404,7 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
strQuery += astrOrderBy[i];
|
||||
strQuery += "',company_num = ";
|
||||
strQuery += _strCompanyNum;
|
||||
if (query.exec(strQuery.toUtf8())==false) { InsertLog(query.lastError().text());m_db.close();qDebug() << strQuery;return;}
|
||||
if (query.exec(strQuery.toUtf8())==false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());m_db.close();qDebug() << strQuery;return;}
|
||||
}
|
||||
date = date.addDays(1);
|
||||
}
|
||||
@@ -2399,7 +2423,7 @@ void SFilterProcess::DataPut(QString _strCompanyNum)
|
||||
"mindate = '" + dtMin.toString("yyyy-MM-dd HH:mm:ss") + "' , "
|
||||
"maxdate = '" + dtMax.toString("yyyy-MM-dd HH:mm:ss") + "' "
|
||||
"where company_num = " + _strCompanyNum;
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastError().text());return;}
|
||||
if(query.exec(strQuery.toUtf8()) == false) {InsertLog(query.lastQuery()); InsertLog(query.lastError().text());return;}
|
||||
UpdateDBInfoState(m_db,_strCompanyNum,"Data (Finish)");
|
||||
m_db.close();
|
||||
InsertLog("Data Put End");
|
||||
|
||||
Reference in New Issue
Block a user