fix:报告换行后,左侧固定列标题显示为空
This commit is contained in:
@@ -173,6 +173,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
headerData = firstRow.clone();
|
headerData = firstRow.clone();
|
||||||
rowList.remove(0);
|
rowList.remove(0);
|
||||||
}
|
}
|
||||||
|
putEmptyTitleToNotFirstRow(rowList);
|
||||||
resultData.put("headerData", headerData);
|
resultData.put("headerData", headerData);
|
||||||
resultData.put("tableList", rowList);
|
resultData.put("tableList", rowList);
|
||||||
String formData = mainData.getFormData();
|
String formData = mainData.getFormData();
|
||||||
@@ -306,6 +307,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
headerData = firstRow.clone();
|
headerData = firstRow.clone();
|
||||||
rows.remove(0);
|
rows.remove(0);
|
||||||
}
|
}
|
||||||
|
putEmptyTitleToNotFirstRow(rows);
|
||||||
resultData.put("headerData", headerData);
|
resultData.put("headerData", headerData);
|
||||||
resultData.put("tableList", rows);
|
resultData.put("tableList", rows);
|
||||||
resultData.put("formData", formDataJson.clone());
|
resultData.put("formData", formDataJson.clone());
|
||||||
@@ -317,6 +319,26 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void putEmptyTitleToNotFirstRow(JSONArray rows){
|
||||||
|
for(int i = 1; i < rows.size(); i++){
|
||||||
|
JSONObject t = rows.getJSONObject(i);
|
||||||
|
if(!rowTypeTitle.equals(t.getString(rowTypeKey))){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String fixedColKeys = t.getString("fixedColKeys");
|
||||||
|
if(ObjectUtils.isEmpty(fixedColKeys))
|
||||||
|
continue;
|
||||||
|
String[] keyV = fixedColKeys.split(",");
|
||||||
|
for(String s : keyV){
|
||||||
|
t.put(s, " ");
|
||||||
|
}
|
||||||
|
// t.put(colPrefix + "01", t.getString(colPrefix + "01"));
|
||||||
|
// t.put(colPrefix + "01", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private JSONArray assembleEmpty(JSONObject configJson, JSONArray rowList){
|
private JSONArray assembleEmpty(JSONObject configJson, JSONArray rowList){
|
||||||
if(rowList.isEmpty())
|
if(rowList.isEmpty())
|
||||||
return rowList;
|
return rowList;
|
||||||
@@ -440,7 +462,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, i);
|
addTitleToRowList(fixedCol, fixedColRight, dynamicColCount, t, rowList, fieldList);
|
||||||
//插入样品数据
|
//插入样品数据
|
||||||
addDataToRowList(fixedCol, fixedColRight, dynamicFieldList, dataList, rowList, fixedColCount_left, dynamicColCount, hasRemark);
|
addDataToRowList(fixedCol, fixedColRight, dynamicFieldList, dataList, rowList, fixedColCount_left, dynamicColCount, hasRemark);
|
||||||
//检出限
|
//检出限
|
||||||
@@ -455,12 +477,12 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
* @param
|
* @param
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List<ConfigReportFieldDO> fieldList, Integer groupIndex){
|
private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List<ConfigReportFieldDO> fieldList){
|
||||||
//处理固定列
|
//处理固定列
|
||||||
int index = 1;
|
int index = 1;
|
||||||
String colKey = "";
|
String colKey = "";
|
||||||
//固定列-左
|
//固定列-左
|
||||||
|
String fixedColKeys = "";
|
||||||
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) {
|
||||||
@@ -479,15 +501,15 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
colKey = parseNumToString(index, 2);
|
colKey = parseNumToString(index, 2);
|
||||||
}
|
}
|
||||||
if(!ObjectUtils.isEmpty(colKey)){
|
if(!ObjectUtils.isEmpty(colKey)){
|
||||||
if(groupIndex == 0) {
|
|
||||||
t.put(colPrefix + colKey, fieldName);
|
t.put(colPrefix + colKey, fieldName);
|
||||||
}else{
|
fixedColKeys += colPrefix + colKey + ",";
|
||||||
t.put(colPrefix + colKey, " ");
|
|
||||||
}
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!ObjectUtils.isEmpty(fixedColKeys))
|
||||||
|
fixedColKeys = fixedColKeys.substring(0, fixedColKeys.length() - 1);
|
||||||
|
t.put("fixedColKeys", fixedColKeys);
|
||||||
//固定列-右
|
//固定列-右
|
||||||
index = fixedCol.size() + dynamicColCount + 1;
|
index = fixedCol.size() + dynamicColCount + 1;
|
||||||
for(int i=0;i<fixedColRight.size();i++) {
|
for(int i=0;i<fixedColRight.size();i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user