git-svn-id: svn://192.168.0.12/source@344 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -300,6 +300,39 @@ bool SInitializer::init(const QString& _strFilterProcessGroupID, const QString&
|
||||
return b_ok;
|
||||
}
|
||||
|
||||
bool SInitializer::init(const QString& _strFilterProcessGroupID, const QString& _strFilterProcessGroupName, QString _strInfluencerLimit)
|
||||
{
|
||||
m_stFilterProcessGroup.m_nFilterProcessGroupID = _strFilterProcessGroupID.toInt();
|
||||
m_stFilterProcessGroup.m_strFilterProcessGroupName = _strFilterProcessGroupName;
|
||||
m_strInfluencerLimitFrom = _strInfluencerLimit.split('~').first();
|
||||
m_strInfluencerLimitTo = _strInfluencerLimit.split('~').last();
|
||||
|
||||
bool b_ok = true;
|
||||
b_ok &= initDBConnection();
|
||||
b_ok &= initColumn();
|
||||
b_ok &= initDays();
|
||||
b_ok &= initInfluencer();
|
||||
b_ok &= initSpammer();
|
||||
b_ok &= initBlogPageNum();
|
||||
b_ok &= initFilterProcess();
|
||||
b_ok &= initCompanyNum();
|
||||
b_ok &= initPlatform();
|
||||
//b_ok &= initConsumerCategory();
|
||||
b_ok &= initCategory();
|
||||
b_ok &= initConsumerMarketer();
|
||||
b_ok &= initConsumerCheckList();
|
||||
b_ok &= initUpload();
|
||||
b_ok &= initDebug();
|
||||
|
||||
/*
|
||||
if (!b_ok)
|
||||
cout << "FALSE" << endl;
|
||||
else
|
||||
cout << "TRUE" << endl;
|
||||
*/
|
||||
return b_ok;
|
||||
}
|
||||
|
||||
bool SInitializer::initInfluencer()
|
||||
{
|
||||
m_stInfluencerParam.m_dBody = 0.4;
|
||||
@@ -396,6 +429,80 @@ bool SInitializer::initFilterProcess()
|
||||
return true;
|
||||
}
|
||||
|
||||
//bool SInitializer::initCategory()
|
||||
//{
|
||||
// for (int i = 0; i < E_SERVICE_MAX; i++)
|
||||
// {
|
||||
// m_anAllCategory[i] = -1;
|
||||
// }
|
||||
// int company_num = -1;
|
||||
// foreach (const stFilterProcess& stfilterprocess, m_listFilterProcess)
|
||||
// {
|
||||
// if (stfilterprocess.m_nFilterProcessType == 2)
|
||||
// {
|
||||
// company_num = stfilterprocess.m_nCompanyNum;
|
||||
// }
|
||||
// }
|
||||
// if (company_num == -1)
|
||||
// return false;
|
||||
|
||||
// QSqlQuery query(m_sDBManager[SDBManager::E_DATABASE_WEB]);
|
||||
|
||||
// QString strQuery = "select num, servicenum, name from category where company_num = ";
|
||||
// strQuery += QString::number(company_num) + " order by servicenum asc, num asc";
|
||||
|
||||
// if (query.exec(strQuery.toUtf8()) == false)
|
||||
// {
|
||||
// insertLog(query.lastQuery());
|
||||
// insertLog(query.lastError().text());
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// int nService[E_SERVICE_MAX] = {0,};
|
||||
|
||||
// while(query.next())
|
||||
// {
|
||||
// m_mapCategory.insert(query.value(0).toInt(), query.value(2).toString());
|
||||
|
||||
// switch(query.value(1).toInt())
|
||||
// {
|
||||
// case E_SERVICE_INFLUENCER:
|
||||
// {
|
||||
// if (0 == nService[E_SERVICE_INFLUENCER]++)
|
||||
// {
|
||||
// m_anAllCategory[E_SERVICE_INFLUENCER] = query.value(0).toInt();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// case E_SERVICE_CONSUMER:
|
||||
// {
|
||||
// if (0 == nService[E_SERVICE_CONSUMER]++)
|
||||
// {
|
||||
// m_anAllCategory[E_SERVICE_CONSUMER] = query.value(0).toInt();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// case E_SERVICE_SPAMMER:
|
||||
// {
|
||||
// if (0 == nService[E_SERVICE_SPAMMER]++)
|
||||
// {
|
||||
// m_anAllCategory[E_SERVICE_SPAMMER] = query.value(0).toInt();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// case E_SERVICE_POWERCAFE:
|
||||
// {
|
||||
// if (0 == nService[E_SERVICE_POWERCAFE]++)
|
||||
// {
|
||||
// m_anAllCategory[E_SERVICE_POWERCAFE] = query.value(0).toInt();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
//}
|
||||
|
||||
bool SInitializer::initCategory()
|
||||
{
|
||||
for (int i = 0; i < E_SERVICE_MAX; i++)
|
||||
@@ -415,7 +522,7 @@ bool SInitializer::initCategory()
|
||||
|
||||
QSqlQuery query(m_sDBManager[SDBManager::E_DATABASE_WEB]);
|
||||
|
||||
QString strQuery = "select num, servicenum, name from category where company_num = ";
|
||||
QString strQuery = "select num, servicenum, name, categorygroup_num from category where company_num = ";
|
||||
strQuery += QString::number(company_num) + " order by servicenum asc, num asc";
|
||||
|
||||
if (query.exec(strQuery.toUtf8()) == false)
|
||||
@@ -439,6 +546,9 @@ bool SInitializer::initCategory()
|
||||
{
|
||||
m_anAllCategory[E_SERVICE_INFLUENCER] = query.value(0).toInt();
|
||||
}
|
||||
|
||||
m_mapInfluencerGroup[query.value(3).toInt()].append(query.value(0).toInt());
|
||||
|
||||
break;
|
||||
}
|
||||
case E_SERVICE_CONSUMER:
|
||||
@@ -828,3 +938,17 @@ int SInitializer::getAllCategoryNum(int _nService)
|
||||
return m_anAllCategory[_nService];
|
||||
}
|
||||
|
||||
QMap<int, QList<int>> SInitializer::getInfluencerGroup()
|
||||
{
|
||||
return m_mapInfluencerGroup;
|
||||
}
|
||||
|
||||
QString SInitializer::getInfluencerLimitFrom()
|
||||
{
|
||||
return m_strInfluencerLimitFrom;
|
||||
}
|
||||
|
||||
QString SInitializer::getInfluencerLimitTo()
|
||||
{
|
||||
return m_strInfluencerLimitTo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user