|
@@ -105,7 +105,8 @@ bool SchemeProcessService::AddAllSchemeProcess(QList<SchemePlanManager::SchemePr
|
|
|
{
|
|
|
int ret = false;
|
|
|
try {
|
|
|
- foreach (const SchemePlanManager::SchemeProcessInfo &schemeProcessInfo, schemeProcessInfos) {
|
|
|
+ for (int i = 0; i < schemeProcessInfos.size(); i++) {
|
|
|
+ SchemePlanManager::SchemeProcessInfo schemeProcessInfo = schemeProcessInfos.at(i);
|
|
|
Transaction t(SqlDBHelper::getDatabase());
|
|
|
InsertQuery query =
|
|
|
t.insertInto("t_scheme_process_info(`project_id`, `index_type`, `step`, `type`, "
|
|
@@ -118,8 +119,10 @@ bool SchemeProcessService::AddAllSchemeProcess(QList<SchemePlanManager::SchemePr
|
|
|
QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"))
|
|
|
.exec();
|
|
|
t.commit();
|
|
|
+ int id = result.lastInsertId().toInt();
|
|
|
+ qDebug() << id;
|
|
|
+ schemeProcessInfo.id = id;
|
|
|
}
|
|
|
-
|
|
|
ret = true;
|
|
|
} catch (const DBException &ex) {
|
|
|
qDebug() << ex.lastError.text();
|