Jelajahi Sumber

修改测试类BUG

louhr 5 tahun lalu
induk
melakukan
ee647de8e3

+ 13 - 4
kernel/src/main/java/com/lantone/qc/kernel/web/controller/QCTestController.java

@@ -57,10 +57,10 @@ public class QCTestController {
                     "qc_inputcases_mapping qmap, qc_inputcases qi, qc_cases_entry entry, qc_cases ca\n" +
                     "where qmap.text_id = qi.id and qmap.cases_entry_id = entry.id and entry.cases_id = ca.id ";
 
-            if (!StringUtils.isNotEmpty(caseIds)) {
+            if (StringUtils.isNotEmpty(caseIds)) {
                 sql = sql + " and entry.cases_id in (" + caseIds + ")";
             }
-            if (!StringUtils.isNotEmpty(txtId)) {
+            if (StringUtils.isNotEmpty(txtId)) {
                 sql = sql + " and qi.id = " + txtId;
             }
             sql = sql + " order by qi.id";
@@ -77,19 +77,19 @@ public class QCTestController {
             List<String> caseList = new ArrayList<>();
             List<Map<String, String>> updateList = new ArrayList<>();
             String textId = ""; int index = 0;
+            String text = ""; String caseName = "";
             while (rs.next()) {
                 r1 = rs.getString(1);
                 r2 = rs.getString(2);
                 r3 = rs.getString(3);
                 r4 = rs.getString(4);
                 r5 = rs.getString(5);
-                if (!textId.equals(r2)) {
+                if (!textId.equals(String.valueOf(r2))) {
                     if (StringUtils.isNotEmpty(textId)) {
                         index++;
                         if (index > length) {
                             break;
                         }
-
                         catalogueList.add(catalogueMap);
                         updateList.add(updateMap);
                         textList.add(r3);
@@ -100,6 +100,15 @@ public class QCTestController {
                 catalogueMap.put(r5, new HashMap<>());
                 updateMap.put(r5, r1);
                 textId = r2;
+                text = r3;
+                caseName = r4;
+            }
+            //最后一份病历无法在循环中写入 需要填回
+            if (StringUtils.isNotEmpty(textId)) {
+                catalogueList.add(catalogueMap);
+                updateList.add(updateMap);
+                textList.add(text);
+                caseList.add(caseName);
             }
 
             for (int i = 0; i < textList.size(); i++) {