diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/DataService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/DataService.java index 654e8e2..6bd8f0c 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/DataService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/DataService.java @@ -436,8 +436,6 @@ public class DataService extends ServiceImpl { list_item.add(item.get("second_dept_name1")); list_item.add(item.get("allcount1")); for (int i = 0;i { public void exportcategory(HttpServletResponse response, DataSearchValidate dataSearchValidate) throws IOException { List> head = new ArrayList<>(); List> list = new ArrayList<>(); + List> listdata = new ArrayList<>(); List> data1 = new ArrayList<>(); List variables = new ArrayList<>(); - list = getsourcelist(new Page<>(1, 10000),dataSearchValidate).getRecords(); - System.out.println(list); - Map item_one = list.get(0); - for (Map.Entry entry : item_one.entrySet()) { - // 获取键和值 - String key = entry.getKey(); - Object value = entry.getValue(); - // 打印键和值 - if (key.contains("name")&&!key.contains("second_dept_name")){ - variables.add(value.toString()); + list = listForCategoryHeader(dataSearchValidate); + listdata = listForCategory(new Page<>(1, 10000),dataSearchValidate).getRecords(); + head.add(List.of("局长信箱即接即办信件分类统计","单位名称","单位名称","单位名称","单位名称")); + head.add(List.of("局长信箱即接即办信件分类统计","信件总量","信件总量","信件总量","信件总量")); + for(int father = 2;father>)list.get(father).get("children")).size();firstchildren++){ + if (((List>)list.get(father).get("children")).get(firstchildren).get("children")==null){ + List stringList = new ArrayList<>(); + stringList.add("局长信箱即接即办信件分类统计"); + stringList.add(list.get(father).get("label").toString()); + stringList.add(((List>)list.get(father).get("children")).get(firstchildren).get("label").toString()); + stringList.add(((List>)list.get(father).get("children")).get(firstchildren).get("label").toString()); + stringList.add(((List>)list.get(father).get("children")).get(firstchildren).get("label").toString()); + System.out.println(stringList); + variables.add(((List>)list.get(father).get("children")).get(firstchildren).get("prop").toString()); + head.add(stringList); + }else{ + + for (int secondchildren = 0;secondchildren<((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).size();secondchildren++){ + if (((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("children")==null){ + List stringList = new ArrayList<>(); + stringList.add("局长信箱即接即办信件分类统计"); + stringList.add(list.get(father).get("label").toString()); + stringList.add(((List>)list.get(father).get("children")).get(firstchildren).get("label").toString()); + stringList.add(((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("label").toString()); + stringList.add(((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("label").toString()); + head.add(stringList); + variables.add(((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("prop").toString()); + continue; + }else{ + for (int threechildren = 0;threechildren<((List>)((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("children")).size();threechildren++) { + if (((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("children")==null) { + List stringList = new ArrayList<>(); + stringList.add("局长信箱即接即办信件分类统计"); + stringList.add(list.get(father).get("label").toString()); + stringList.add(((List>) list.get(father).get("children")).get(firstchildren).get("label").toString()); + stringList.add(((List>) ((List>) list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("label").toString()); + stringList.add(((List>) ((List>) list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("label").toString()); + variables.add(((List>) ((List>) list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("prop").toString()); + head.add(stringList); + }else{ + List stringList = new ArrayList<>(); + stringList.add("局长信箱即接即办信件分类统计"); + stringList.add(list.get(father).get("label").toString()); + stringList.add(((List>) list.get(father).get("children")).get(firstchildren).get("label").toString()); + stringList.add(((List>) ((List>) list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("label").toString()); + stringList.add(((List>)((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("children")).get(threechildren).get("label").toString()); + variables.add(((List>)((List>)((List>)list.get(father).get("children")).get(firstchildren).get("children")).get(secondchildren).get("children")).get(threechildren).get("prop").toString()); + head.add(stringList); + } + + } + } + } + } + } + } - head.add(List.of("局长信箱即接即办信件来源统计","单位名称","单位名称")); - head.add(List.of("局长信箱即接即办信件来源统计","信件总量","信件总量")); - for (int i = 0;i item : list){ + for (Map item : listdata){ List list_item = new ArrayList<>(); - list_item.add(item.get("second_dept_name1")); - list_item.add(item.get("allcount1")); + list_item.add(item.get("second_dept_name")); + list_item.add(item.get("allcount")); for (int i = 0;i { } } } + } \ No newline at end of file