|
@@ -72,7 +72,9 @@ DataCollectionWidget::DataCollectionWidget(ProjectInfo *proj, QWidget *parent) :
|
|
|
connect(m_configExpert, &ConfigExpertDataWidget::sigConfigSelected, this,
|
|
|
&DataCollectionWidget::slotConfigSelected);
|
|
|
connect(m_configScheme, &ConfigSchemeDataWidget::sigAddScheme, this, &DataCollectionWidget::slotAddScheme);
|
|
|
- connect(m_configMeasure, &ConfigMeasureDataWidget::sigAddData, this, &DataCollectionWidget::slotAddData);
|
|
|
+ connect(m_configMeasure, &ConfigMeasureDataWidget::sigAddData, this, &DataCollectionWidget::slotAddMeasureData);
|
|
|
+ connect(m_configMeasure, &ConfigMeasureDataWidget::sigCurrentRowChanged, this,
|
|
|
+ &DataCollectionWidget::slotCurrentMeasureDataChanged);
|
|
|
connect(m_addSchemeWidget, &CreateSchemeWidget::sigSchemeInfoConfirmed, this,
|
|
|
&DataCollectionWidget::slotAddSchemeInfo);
|
|
|
}
|
|
@@ -189,6 +191,7 @@ void DataCollectionWidget::slotTabCurrentChanged(int index)
|
|
|
bool meaure = (table->process().dSource == SchemePlanManager::FromMeasurement) && !scheme;
|
|
|
if (meaure) {
|
|
|
m_configMeasure->setProcess(table->process());
|
|
|
+ m_configMeasure->selectFirst();
|
|
|
}
|
|
|
m_configMeasure->setVisible(meaure);
|
|
|
}
|
|
@@ -399,7 +402,7 @@ void DataCollectionWidget::slotConfigSelected(UserConfig *config)
|
|
|
QList<NodeMatrixInfo *> data;
|
|
|
NodeMatrixService().QueryNodeMatrixListByExpertIdAndEngineerId(&data, config->userId, config->engineerId,
|
|
|
indexName);
|
|
|
- table->setNodeMatrixData(data);
|
|
|
+ table->setNodeMatrixData(data, true);
|
|
|
}
|
|
|
|
|
|
void DataCollectionWidget::slotAddScheme()
|
|
@@ -439,10 +442,87 @@ void DataCollectionWidget::slotAddSchemeInfo(const QString name, const QString r
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void DataCollectionWidget::slotAddData()
|
|
|
+/// 添加实测数据
|
|
|
+void DataCollectionWidget::slotAddMeasureData()
|
|
|
{
|
|
|
+ static bool isBusing = false;
|
|
|
+ if (isBusing) {
|
|
|
+ return; // 添加完成后再响应下一次添加
|
|
|
+ }
|
|
|
+
|
|
|
+ isBusing = true;
|
|
|
+
|
|
|
DataTableWidget *table = (DataTableWidget *)m_tab->currentWidget();
|
|
|
QString indexName = ProjectManager::nameOfIndexType((ProjectManager::IndexType)table->process().indexType);
|
|
|
QString processName = SchemePlanManager::processName(table->process());
|
|
|
- qDebug() << __FUNCTION__ << __LINE__ << indexName << processName << endl;
|
|
|
+
|
|
|
+ QDateTime time = QDateTime::currentDateTime();
|
|
|
+ QString uuid = QString("%1").arg(time.toMSecsSinceEpoch());
|
|
|
+
|
|
|
+ QList<NodeMatrixInfo *> dataList;
|
|
|
+
|
|
|
+ /// 权重数据
|
|
|
+ /// 一种指标: 能力重要度评估指标, 或方案评估指标, 或效能评估指标
|
|
|
+ /// 除根节点外, 每个指标一个权重值
|
|
|
+ if (table->process().type == SchemePlanManager::ImportWeightData) {
|
|
|
+ for (CNodeData n : table->mind1()->nodeList()) {
|
|
|
+ if (n.number <= 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ NodeMatrixInfo *info = new NodeMatrixInfo();
|
|
|
+ info->engineerId = m_proj->id;
|
|
|
+ info->mindId = 1;
|
|
|
+ info->tableMsg = indexName;
|
|
|
+ info->writeDate = time;
|
|
|
+ info->strUuid = uuid;
|
|
|
+
|
|
|
+ info->abscissa = n.name;
|
|
|
+ info->nodeValue = "1";
|
|
|
+ dataList.append(info);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 评估数据
|
|
|
+ /// 两种指标: 能力重要度评估指标, 技术措施重要度评估指标
|
|
|
+ /// 每个技术措施指标, 对应能力重要度指标体系最后一层指标下的数据
|
|
|
+ if (table->process().type == SchemePlanManager::ImportEvalData
|
|
|
+ && table->process().indexType == ProjectManager::TechIndex) {
|
|
|
+ QList<CNodeData> leaves = table->mind2()->leaves();
|
|
|
+ for (CNodeData n1 : table->mind1()->nodeList()) {
|
|
|
+ if (n1.number <= 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (CNodeData n2 : leaves) {
|
|
|
+ NodeMatrixInfo *info = new NodeMatrixInfo();
|
|
|
+ info->engineerId = m_proj->id;
|
|
|
+ info->mindId = 1;
|
|
|
+ info->tableMsg = indexName;
|
|
|
+ info->writeDate = time;
|
|
|
+ info->strUuid = uuid;
|
|
|
+
|
|
|
+ info->abscissa = n1.name;
|
|
|
+ info->ordinate = n2.name;
|
|
|
+ info->nodeValue = "1";
|
|
|
+ dataList.append(info);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (dataList.size() > 0) {
|
|
|
+ bool ret = NodeMatrixService().AddNodeMatrixInfoList(dataList);
|
|
|
+ qDebug() << __FUNCTION__ << __LINE__ << ret << dataList.size() << endl;
|
|
|
+ if (ret) {
|
|
|
+ m_configMeasure->reloadData();
|
|
|
+ m_configMeasure->selectLast();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ isBusing = false;
|
|
|
+}
|
|
|
+
|
|
|
+void DataCollectionWidget::slotCurrentMeasureDataChanged()
|
|
|
+{
|
|
|
+ DataTableWidget *table = (DataTableWidget *)m_tab->currentWidget();
|
|
|
+ table->setNodeMatrixData(m_configMeasure->selectedData(), false);
|
|
|
}
|