Explorar o código

修复设置指标无效时的页面显示异常

chengxr hai 1 ano
pai
achega
b12070fd01
Modificáronse 1 ficheiros con 16 adicións e 3 borrados
  1. 16 3
      QFD/dbService/CNodeDataService.cpp

+ 16 - 3
QFD/dbService/CNodeDataService.cpp

@@ -149,9 +149,12 @@ bool CNodeDataService::QueryAllValid(QList<CNodeData> &cNodeDataList, int projec
     QString selectSql =
             QString("SELECT id,project_id, eval_type,number,p_number,name,remark,dimension,type,is_effective FROM "
                     "t_node_data WHERE "
-                    "project_id = %1 and eval_type= %2 and is_effective!=1 order by number")
+                    "project_id = %1 and eval_type= %2 order by number")
                     .arg(projectId)
                     .arg(evalType);
+    qDebug() << __FUNCTION__ << __LINE__ << selectSql << endl;
+
+    QList<CNodeData> tempList;
     if (query.exec(selectSql)) {
         while (query.next()) {
             if (query.isNull(0) == false) {
@@ -166,12 +169,22 @@ bool CNodeDataService::QueryAllValid(QList<CNodeData> &cNodeDataList, int projec
                 cNodeData.dimension   = query.value(7).toString();
                 cNodeData.type        = query.value(8).toInt();
                 cNodeData.isEffective = query.value(9).toInt();
-                cNodeDataList.append(cNodeData);
+
+                tempList.append(cNodeData);
             }
         }
         ret = true;
+
+        CMind mind;
+        mind.setNodeList(tempList);
+
+        for (CNodeData node : tempList) {
+            if (mind.isInvalidated(node.number) == false) {
+                cNodeDataList.append(node);
+            }
+        }
     } else {
-        qDebug() << "QueryAll" << query.lastError();
+        qDebug() << "QueryAllValid" << query.lastError();
     }
     return ret;
 }