Sfoglia il codice sorgente

bug

Signed-off-by: liuyc <56808083@qq.com>
liuyc 8 mesi fa
parent
commit
b73095974f

+ 5 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialSummaryController.java

@@ -206,7 +206,7 @@ public class TrialSummaryController {
                 String tabPkeyId = entry.getKey().split("###")[1];
 
                 List<TrialSummaryExcelTabReflection> value = entry.getValue();
-                Map<String, String> elementKeyWithHtmlKeyNameMap = value.stream().collect(Collectors.toMap(TrialSummaryExcelTabReflection::getElementKey, TrialSummaryExcelTabReflection::getHtmlKeyName));
+                Map<String, List<TrialSummaryExcelTabReflection>> elementKeyWithHtmlKeyNameMap = value.stream().collect(Collectors.groupingBy(TrialSummaryExcelTabReflection::getElementKey));
                 Set<String> elementKeys = elementKeyWithHtmlKeyNameMap.keySet();
 
                 String sql_3 = "SELECT " + String.join(",", elementKeys) + " FROM " + tabName + " WHERE p_key_id = " + tabPkeyId + " AND group_id in(" + StringUtils.join(recordIds, ",") + ")";
@@ -216,12 +216,12 @@ public class TrialSummaryController {
                 }
 
                 for (String elementKey : elementKeys) {
-                    String htmlKeyName = elementKeyWithHtmlKeyNameMap.getOrDefault(elementKey, null);
-                    if (ObjectUtil.isEmpty(htmlKeyName)) {
-                        continue;
-                    }
                     for (Map<String, Object> stringObjectMap : tabDataList) {
+                        stringObjectMap.entrySet().removeIf(obj -> obj.getValue() == null || obj.getValue().equals(""));
                         Object tabData = stringObjectMap.getOrDefault(elementKey, null);
+                        if (ObjectUtil.isEmpty(tabData)) {
+                            continue;
+                        }
 
                         String tabDataStr = (String) tabData;
                         //跨行