diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java index 7f1a6e28..baa54322 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -173,6 +173,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService headerData = firstRow.clone(); rowList.remove(0); } + putEmptyTitleToNotFirstRow(rowList); resultData.put("headerData", headerData); resultData.put("tableList", rowList); String formData = mainData.getFormData(); @@ -306,6 +307,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService headerData = firstRow.clone(); rows.remove(0); } + putEmptyTitleToNotFirstRow(rows); resultData.put("headerData", headerData); resultData.put("tableList", rows); resultData.put("formData", formDataJson.clone()); @@ -317,6 +319,26 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService 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){ if(rowList.isEmpty()) return rowList; @@ -440,7 +462,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService putEmptyData(emptyRow, 1,10); 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); //检出限 @@ -455,12 +477,12 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService * @param * * */ - private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List fieldList, Integer groupIndex){ + private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List fieldList){ //处理固定列 int index = 1; String colKey = ""; //固定列-左 - + String fixedColKeys = ""; for(int i=0;i