|
@@ -217,13 +217,13 @@ public class ReportServiceImpl implements IReportService {
|
|
|
NpoiHelper.content(document, fwfx, pos++);
|
|
|
|
|
|
// // 获取插入图片
|
|
|
- // ReportImage reportImage = getWktImage(geomRes.getGeom(), 400);
|
|
|
- //
|
|
|
- // XWPFParagraph imageParagraph = document.createParagraph();
|
|
|
- // imageParagraph.setAlignment(ParagraphAlignment.CENTER); // Center align the image
|
|
|
- // XWPFRun imageRun = imageParagraph.createRun();
|
|
|
- // imageRun.addPicture(reportImage.getInputStream(), XWPFDocument.PICTURE_TYPE_PNG, null, Units.toEMU(reportImage.getUseWidth()), Units.toEMU(reportImage.getUseHeight()));
|
|
|
- // pos++;
|
|
|
+ ReportImage reportImage = getWktImage(geomRes.getGeom(), 400);
|
|
|
+
|
|
|
+ XWPFParagraph imageParagraph = document.createParagraph();
|
|
|
+ imageParagraph.setAlignment(ParagraphAlignment.CENTER); // Center align the image
|
|
|
+ XWPFRun imageRun = imageParagraph.createRun();
|
|
|
+ imageRun.addPicture(reportImage.getInputStream(), XWPFDocument.PICTURE_TYPE_PNG, null, Units.toEMU(reportImage.getUseWidth()), Units.toEMU(reportImage.getUseHeight()));
|
|
|
+ pos++;
|
|
|
|
|
|
// 添加分页
|
|
|
XWPFParagraph pageBreakParagraph1 = document.createParagraph();
|
|
@@ -307,14 +307,14 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
|
|
|
// // 获取地块图片
|
|
|
- // String geomWkt = item.getGeom();
|
|
|
- // ReportImage imageTable = getWktImage(geomWkt, 300);
|
|
|
- //
|
|
|
- // // 在合并后的单元格中创建一个新的段落
|
|
|
- // XWPFParagraph paraImag = row.getCell(0).addParagraph();
|
|
|
- // paraImag.setAlignment(ParagraphAlignment.CENTER); // 居中对齐
|
|
|
- // XWPFRun run = paraImag.createRun();
|
|
|
- // run.addPicture(imageTable.getInputStream(), XWPFDocument.PICTURE_TYPE_PNG, null, Units.toEMU(imageTable.getUseWidth()), Units.toEMU(imageTable.getUseHeight()));
|
|
|
+ String geomWkt = item.getGeom();
|
|
|
+ ReportImage imageTable = getWktImage(geomWkt, 300);
|
|
|
+
|
|
|
+ // 在合并后的单元格中创建一个新的段落
|
|
|
+ XWPFParagraph paraImag = row.getCell(0).addParagraph();
|
|
|
+ paraImag.setAlignment(ParagraphAlignment.CENTER); // 居中对齐
|
|
|
+ XWPFRun run = paraImag.createRun();
|
|
|
+ run.addPicture(imageTable.getInputStream(), XWPFDocument.PICTURE_TYPE_PNG, null, Units.toEMU(imageTable.getUseWidth()), Units.toEMU(imageTable.getUseHeight()));
|
|
|
|
|
|
|
|
|
// 获取地块信息
|
|
@@ -328,68 +328,56 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
Map<String, Object> mapData = getTableData(polygonDataVo);
|
|
|
// if (j == 1) {
|
|
|
- String dataName = (String) mapData.get("dataname");// 土地现状
|
|
|
-
|
|
|
- String column1 = "";
|
|
|
- if (j == 1) {
|
|
|
- column1 = "权属";
|
|
|
- } else if (j == 2) {
|
|
|
- column1 = "类型";
|
|
|
+ // String dataName = (String) mapData.get("dataname");// 土地现状
|
|
|
+
|
|
|
+ List<Object> d_list = new ArrayList<>();
|
|
|
+
|
|
|
+ // String column1 = "";
|
|
|
+ if (mapData.containsKey("child")) {
|
|
|
+ // column1 = "权属";
|
|
|
+ // mapData.get("datalist");
|
|
|
+ // mapData.get("dataname");
|
|
|
+ List<Object> v_1 = (List<Object>) mapData.get("child");
|
|
|
+ System.out.println("");
|
|
|
+ d_list.addAll(v_1);
|
|
|
+ } else {
|
|
|
+ d_list.add(mapData);
|
|
|
}
|
|
|
|
|
|
- List tabPlanTitles = new ArrayList<NpoiHelper.TableTitle>();
|
|
|
- NpoiHelper.TableTitle planC1Title = new NpoiHelper.TableTitle();
|
|
|
- planC1Title.setKey("type");
|
|
|
- planC1Title.setName(column1);
|
|
|
- planC1Title.setWidth(4150);
|
|
|
- tabPlanTitles.add(planC1Title);
|
|
|
-
|
|
|
- NpoiHelper.TableTitle planC2Title = new NpoiHelper.TableTitle();
|
|
|
- planC2Title.setKey("area");
|
|
|
- planC2Title.setName("面积");
|
|
|
- planC2Title.setWidth(4150);
|
|
|
- tabPlanTitles.add(planC2Title);
|
|
|
-
|
|
|
- List<Map<String, Object>> dataPlanlist = new ArrayList<>();
|
|
|
- if (mapData.containsKey("datalist")) {
|
|
|
- List<Map<String, Object>> mapList = (List<Map<String, Object>>) mapData.get("datalist");
|
|
|
- for (int iLand = 0; iLand < mapList.size(); iLand++) {
|
|
|
- Map<String, Object> planMap = new HashMap<>();
|
|
|
- planMap.put("type", mapList.get(iLand).get("groupvalue"));
|
|
|
- planMap.put("area", mapList.get(iLand).get("sumvalue") + " 平方米");
|
|
|
- dataPlanlist.add(planMap);
|
|
|
+ for (int i1 = 0; i1 < d_list.size(); i1++) {
|
|
|
+ Map<String, Object> v1_MapData = (Map<String, Object>) d_list.get(i1);
|
|
|
+ // if (j == 1) {
|
|
|
+ String dataName = (String) v1_MapData.get("dataname");// 土地现状
|
|
|
+ List tabPlanTitles = new ArrayList<NpoiHelper.TableTitle>();
|
|
|
+ NpoiHelper.TableTitle planC1Title = new NpoiHelper.TableTitle();
|
|
|
+ planC1Title.setKey("type");
|
|
|
+ planC1Title.setName("类别");
|
|
|
+ planC1Title.setWidth(4150);
|
|
|
+ tabPlanTitles.add(planC1Title);
|
|
|
+
|
|
|
+ NpoiHelper.TableTitle planC2Title = new NpoiHelper.TableTitle();
|
|
|
+ planC2Title.setKey("area");
|
|
|
+ planC2Title.setName("面积");
|
|
|
+ planC2Title.setWidth(4150);
|
|
|
+ tabPlanTitles.add(planC2Title);
|
|
|
+
|
|
|
+ List<Map<String, Object>> dataPlanlist = new ArrayList<>();
|
|
|
+ if (v1_MapData.containsKey("datalist")) {
|
|
|
+ List<Map<String, Object>> mapList = (List<Map<String, Object>>) v1_MapData.get("datalist");
|
|
|
+ for (int iLand = 0; iLand < mapList.size(); iLand++) {
|
|
|
+ Map<String, Object> planMap = new HashMap<>();
|
|
|
+ planMap.put("type", mapList.get(iLand).get("groupvalue"));
|
|
|
+ planMap.put("area", mapList.get(iLand).get("sumvalue") + " 平方米");
|
|
|
+ dataPlanlist.add(planMap);
|
|
|
+ }
|
|
|
}
|
|
|
+ NpoiHelper.setComTable(document, tabPlanTitles, dataPlanlist, dataName, pos++);
|
|
|
}
|
|
|
- NpoiHelper.setComTable(document, tabPlanTitles, dataPlanlist, dataName, pos++);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (mapData.containsKey("datalist") && i == 2) {
|
|
|
- // List tabPlanTitles = new ArrayList<NpoiHelper.TableTitle>();
|
|
|
- // NpoiHelper.TableTitle planC1Title = new NpoiHelper.TableTitle();
|
|
|
- // planC1Title.setKey("type");
|
|
|
- // planC1Title.setName("类型");
|
|
|
- // planC1Title.setWidth(4150);
|
|
|
- // tabPlanTitles.add(planC1Title);
|
|
|
- //
|
|
|
- // NpoiHelper.TableTitle planC2Title = new NpoiHelper.TableTitle();
|
|
|
- // planC2Title.setKey("area");
|
|
|
- // planC2Title.setName("面积");
|
|
|
- // planC2Title.setWidth(4150);
|
|
|
- // tabPlanTitles.add(planC2Title);
|
|
|
- //
|
|
|
- // List<Map<String, Object>> dataPlanlist = new ArrayList<>();
|
|
|
- // List<Map<String, Object>> mapList = (List<Map<String, Object>>) mapData.get("datalist");
|
|
|
- // for (int iLand = 0; iLand < mapList.size(); iLand++) {
|
|
|
- // Map<String, Object> planMap = new HashMap<>();
|
|
|
- // planMap.put("type", mapList.get(iLand).get("groupvalue"));
|
|
|
- // planMap.put("area", mapList.get(iLand).get("sumvalue") + " 平方米");
|
|
|
- // dataPlanlist.add(planMap);
|
|
|
- // }
|
|
|
- // NpoiHelper.setComTable(document, tabPlanTitles, dataPlanlist, "规划信息", pos++);
|
|
|
- // }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
// 插入因子
|
|
|
- // insertFactorImage(geomRes.getGeom(), geomWkt, rootFactors, factorTypeMap, document, pos);
|
|
|
+ insertFactorImage(geomRes.getGeom(), geomWkt, rootFactors, factorTypeMap, document, pos);
|
|
|
}
|
|
|
|
|
|
|