|
@@ -119,7 +119,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
*
|
|
|
* @param res
|
|
|
* @param reportPath
|
|
|
- * @param dkIds 没有导出全部地块
|
|
|
+ * @param dkIds 没有就导出全部地块
|
|
|
*/
|
|
|
private void createReport(FzxzEntityDTO res, String reportPath, List<String> dkIds) {
|
|
|
GeomRes geomRes = shpFileMapper.getOne(res.getGeomId());
|
|
@@ -371,6 +371,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
String scopeEwkt = geomRes.getGeom();
|
|
|
String landEwkt = geomWkt;
|
|
|
for (Map.Entry<String, List<FactorUseDTO>> entry : factorTypeMap.entrySet()) {
|
|
|
+ // 遍历大的因子分类
|
|
|
String key = entry.getKey(); // 获取Map中的键
|
|
|
String factorName = rootMap.get(key).getName();
|
|
|
|
|
@@ -389,11 +390,18 @@ public class ReportServiceImpl implements IReportService {
|
|
|
wktInfo1.setBorderColor("#FF0000");
|
|
|
wktInfos.add(wktInfo1);
|
|
|
|
|
|
+ List<String> warnings = new ArrayList<>();
|
|
|
for (FactorUseDTO factorUseDTO : factorUseDTOS) {
|
|
|
if (factorUseDTO.getFactorName().equals("坡度") || factorUseDTO.getFactorName().equals("高程"))
|
|
|
continue;
|
|
|
String ewkt = getFactorWkt(scopeEwkt, factorUseDTO.getFactorBsm());
|
|
|
|
|
|
+ if (ewkt == null && factorUseDTO.getConditionInfoObj().getSpatialType().equals("distance")) {
|
|
|
+ String warn = factorUseDTO.getFactorName() + "距离大于" + factorUseDTO.getConditionInfoObj().getDefaultValue() + "米";
|
|
|
+ warnings.add(warn);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
Random random = new Random();
|
|
|
int rgb = random.nextInt(0xFFFFFF + 1);
|
|
|
String color = String.format("#%06X", rgb);
|
|
@@ -412,7 +420,13 @@ public class ReportServiceImpl implements IReportService {
|
|
|
if (imagePath.equals("")) continue;
|
|
|
// 获取插入标题、图片
|
|
|
NpoiHelper.content(document, "", pos++, ParagraphAlignment.CENTER);
|
|
|
+ // 图片标题
|
|
|
NpoiHelper.content(document, factorName, pos++, ParagraphAlignment.CENTER);
|
|
|
+ // 插入距离较远的因子说明
|
|
|
+ for (String warning : warnings) {
|
|
|
+ NpoiHelper.content(document, warning, pos++, ParagraphAlignment.LEFT);
|
|
|
+ }
|
|
|
+
|
|
|
ReportImage reportImageFactor = getPathImage(imagePath, 400);
|
|
|
|
|
|
XWPFParagraph imageParagraphFactor = document.createParagraph();
|