fix:报告数据组装
This commit is contained in:
@@ -3,8 +3,6 @@ package com.zt.plat.module.qms.business.reportdoc.service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
@@ -146,11 +144,12 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
||||
if(rowList.size() < maxRowCount){
|
||||
JSONObject t = new JSONObject();
|
||||
t.put(colPrefix + "01", emptyText);
|
||||
putEmptyData(t, 2,10);
|
||||
rowList.add(t.clone());
|
||||
}
|
||||
while(rowList.size() < maxRowCount){
|
||||
JSONObject t = new JSONObject();
|
||||
t.put(colPrefix + "01", " ");
|
||||
putEmptyData(t, 1,10);
|
||||
rowList.add(t.clone());
|
||||
}
|
||||
/*
|
||||
@@ -182,6 +181,12 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
void putEmptyData(JSONObject t, int start, int length){
|
||||
for(int i = start; i < start + length; i++){
|
||||
t.put(colPrefix + parseNumToString(i, 2), " ");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 处理分页
|
||||
*
|
||||
@@ -396,7 +401,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
||||
}
|
||||
if(i > 0 || groupIndex > 0){ //插入空行
|
||||
JSONObject emptyRow = new JSONObject();
|
||||
emptyRow.put(colPrefix + "01", " ");
|
||||
putEmptyData(emptyRow, 1,10);
|
||||
rowList.add(emptyRow);
|
||||
}
|
||||
addTitleToRowList(fixedCol, fixedColRight, dynamicColCount, t, rowList, fieldList);
|
||||
@@ -498,6 +503,8 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
||||
if(!ObjectUtils.isEmpty(externalContent))
|
||||
e = JSONObject.parseObject(externalContent);
|
||||
String remark = e.getString("remark");
|
||||
if(ObjectUtils.isEmpty(remark))
|
||||
remark = " ";
|
||||
colIndex = fixedColCount + 1;
|
||||
t = new JSONObject();
|
||||
int colCountOneSample = fixedColCount + dynamicColCount;
|
||||
|
||||
Reference in New Issue
Block a user