fix:报告换行后,左侧固定列标题显示为空

This commit is contained in:
FCL
2026-02-28 10:44:33 +08:00
parent aecc3d5eda
commit 5b3d0f6436

View File

@@ -440,7 +440,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
putEmptyData(emptyRow, 1,10); putEmptyData(emptyRow, 1,10);
rowList.add(emptyRow); rowList.add(emptyRow);
} }
addTitleToRowList(fixedCol, fixedColRight, dynamicColCount, t, rowList, fieldList); addTitleToRowList(fixedCol, fixedColRight, dynamicColCount, t, rowList, fieldList, i);
//插入样品数据 //插入样品数据
addDataToRowList(fixedCol, fixedColRight, dynamicFieldList, dataList, rowList, fixedColCount_left, dynamicColCount, hasRemark); addDataToRowList(fixedCol, fixedColRight, dynamicFieldList, dataList, rowList, fixedColCount_left, dynamicColCount, hasRemark);
//检出限 //检出限
@@ -455,11 +455,12 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
* @param * @param
* *
* */ * */
private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List<ConfigReportFieldDO> fieldList){ private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List<ConfigReportFieldDO> fieldList, Integer groupIndex){
//处理固定列 //处理固定列
int index = 1; int index = 1;
String colKey = ""; String colKey = "";
//固定列-左 //固定列-左
for(int i=0;i<fixedCol.size();i++) { for(int i=0;i<fixedCol.size();i++) {
String col = fixedCol.getString(i); String col = fixedCol.getString(i);
for(ConfigReportFieldDO fieldDO : fieldList) { for(ConfigReportFieldDO fieldDO : fieldList) {
@@ -478,7 +479,11 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
colKey = parseNumToString(index, 2); colKey = parseNumToString(index, 2);
} }
if(!ObjectUtils.isEmpty(colKey)){ if(!ObjectUtils.isEmpty(colKey)){
t.put(colPrefix + colKey, fieldName); if(groupIndex == 0) {
t.put(colPrefix + colKey, fieldName);
}else{
t.put(colPrefix + colKey, " ");
}
index++; index++;
} }
} }