|
@@ -148,6 +148,36 @@ public class ReportExcelUtil {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Author lihui
|
|
|
+ * @Description 按顺序组装导出的标题
|
|
|
+ * @Date 17:11 2021/5/17
|
|
|
+ * @Param [titleDtos, titleType]
|
|
|
+ * @return java.util.List<java.util.List<java.lang.String>>
|
|
|
+ **/
|
|
|
+ public static List<List<String>> toHistoryDataExcelTitleList(List<ReportTitleDto> titleDtos, int titleType,int reportType){
|
|
|
+ List<List<String>> titleList = toTitleList(titleDtos,reportType);
|
|
|
+ String[] shuZu = TITLE_MAP.get(4);
|
|
|
+ if (shuZu == null) {
|
|
|
+ return titleList;
|
|
|
+ }
|
|
|
+ boolean isEmpty = CollectionUtil.isEmpty(titleList);
|
|
|
+ List<List<String>> result = new ArrayList<>();
|
|
|
+ for (String string : shuZu) {
|
|
|
+ List<String> listString = new ArrayList<>();
|
|
|
+ listString.add(string);
|
|
|
+ if (!isEmpty){
|
|
|
+ listString.add(string);
|
|
|
+ listString.add(string);
|
|
|
+ }
|
|
|
+ result.add(listString);
|
|
|
+ }
|
|
|
+ if (!isEmpty) {
|
|
|
+ result.addAll(titleList);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
private static List<List<String>> toTitleList(List<ReportTitleDto> list,int reportType) {
|
|
|
if (CollectionUtil.isEmpty(list)) {
|
|
|
return null;
|