|
@@ -959,7 +959,7 @@ bool FromWebAPI::saveTemplateList(const QMap<OneTemplateInfo, QList<OnePlanItemI
|
|
|
|
|
|
|
|
|
/* 获取模板内容 */
|
|
|
-bool FromWebAPI::getOneTemplateData(QString templateName, QList<OnePlanItemInfo>& list)
|
|
|
+bool FromWebAPI::getOneTemplateData(OneTemplateInfo tmpInfo, QList<OnePlanItemInfo>& list)
|
|
|
{
|
|
|
if(m_httpApi == nullptr)
|
|
|
{
|
|
@@ -969,7 +969,8 @@ bool FromWebAPI::getOneTemplateData(QString templateName, QList<OnePlanItemInfo>
|
|
|
nJson json0;
|
|
|
json0["opName"] = "TMS_GetExecPlanTemplateData";
|
|
|
nJson json1;
|
|
|
- json1["templateName"] = templateName.toStdString();
|
|
|
+ json1["templateName"] = tmpInfo.templateName.toStdString();
|
|
|
+ json1["channelID"] = tmpInfo.channelInfo.ChannelID;
|
|
|
json0["paramList"] = json1;
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
@@ -1036,22 +1037,25 @@ bool FromWebAPI::getTemplateData(QList<OneTemplateInfo>& listTemplate, QMap<int,
|
|
|
LH_WRITE_ERROR("WebAPI is nullptr");
|
|
|
return false;
|
|
|
}
|
|
|
- nJson jsonArry = nJson::array();
|
|
|
+ nJson json0 = nJson::array();
|
|
|
for(auto& it : listTemplate)
|
|
|
{
|
|
|
- jsonArry.push_back(it.templateName.toStdString());
|
|
|
+ nJson json1;
|
|
|
+ json1["opName"] = "TMS_GetExecPlanTemplateData";
|
|
|
+ json1["Key"] = QUuid::createUuid().toString().toStdString();
|
|
|
+ nJson json2;
|
|
|
+ json2["templateName"] = it.templateName.toStdString();
|
|
|
+ json2["channelID"] = it.channelInfo.ChannelID;
|
|
|
+ json1["paramList"] = json2;
|
|
|
+ json0.push_back(json1);
|
|
|
}
|
|
|
- nJson json0;
|
|
|
- json0["opName"] = "TMS_GetExecPlanTemplateData";
|
|
|
- nJson json1;
|
|
|
- json1["templateName"] = jsonArry;
|
|
|
- json0["paramList"] = json1;
|
|
|
+
|
|
|
/* 打印生成的JSON */
|
|
|
// LH_WRITE_LOG_DEBUG(QString::fromStdString(json0.dump(4)));
|
|
|
|
|
|
QString strCmd = QString::fromStdString(json0.dump());
|
|
|
QString strRet;
|
|
|
- auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_Select, strCmd, strRet, true);
|
|
|
+ auto ret = m_httpApi->DBDoInterface(enDBOperatorType::EDBOT_BatchTransAction, strCmd, strRet, true);
|
|
|
if(ret != 0)
|
|
|
{
|
|
|
LH_WRITE_ERROR(QString("获取模板失败:%1, 错误信息:%2").arg(ret).arg(m_httpApi->DoGetLastError(&ret)));
|