|
@@ -1,6 +1,7 @@
|
|
package com.onemap.analyse.service.impl;
|
|
package com.onemap.analyse.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
|
import com.onemap.analyse.domain.FactorUseDTO;
|
|
import com.onemap.analyse.domain.FactorUseDTO;
|
|
import com.onemap.analyse.domain.FzxzEntityDTO;
|
|
import com.onemap.analyse.domain.FzxzEntityDTO;
|
|
import com.onemap.analyse.domain.FzxzReport;
|
|
import com.onemap.analyse.domain.FzxzReport;
|
|
@@ -20,17 +21,15 @@ import com.onemap.analyse.utils.NumberUtil;
|
|
import com.onemap.analyse.utils.UnitsUtil;
|
|
import com.onemap.analyse.utils.UnitsUtil;
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
+import org.apache.poi.util.Units;
|
|
import org.apache.poi.xwpf.usermodel.*;
|
|
import org.apache.poi.xwpf.usermodel.*;
|
|
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth;
|
|
|
|
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
|
|
|
|
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth;
|
|
|
|
-import org.python.antlr.ast.Num;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import javax.imageio.ImageIO;
|
|
|
|
+import java.awt.image.BufferedImage;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
-import java.math.BigInteger;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -109,7 +108,7 @@ public class ReportServiceImpl implements IReportService {
|
|
*
|
|
*
|
|
* @param res
|
|
* @param res
|
|
* @param reportPath
|
|
* @param reportPath
|
|
- * @param dkIds 没有导出全部地块
|
|
+ * @param dkIds 没有导出全部地块
|
|
*/
|
|
*/
|
|
private void createReport(FzxzEntityDTO res, String reportPath, List<String> dkIds) {
|
|
private void createReport(FzxzEntityDTO res, String reportPath, List<String> dkIds) {
|
|
GeomRes geomRes = shpFileMapper.getOne(res.getGeomId());
|
|
GeomRes geomRes = shpFileMapper.getOne(res.getGeomId());
|
|
@@ -295,80 +294,32 @@ public class ReportServiceImpl implements IReportService {
|
|
NpoiHelper.mergeHorizontal(table, dkList.size() + 2, 0, 3);
|
|
NpoiHelper.mergeHorizontal(table, dkList.size() + 2, 0, 3);
|
|
table.getRow(dkList.size() + 2).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地块位置", optionIsBold));
|
|
table.getRow(dkList.size() + 2).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地块位置", optionIsBold));
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
NpoiHelper.mergeHorizontal(table, dkList.size() + 3, 0, 3);
|
|
NpoiHelper.mergeHorizontal(table, dkList.size() + 3, 0, 3);
|
|
- XWPFParagraph para6 = table.getRow(dkList.size() + 3).getCell(0).addParagraph();
|
|
+ XWPFTableRow row = table.getRow(dkList.size() + 3);
|
|
- para6.setAlignment(ParagraphAlignment.LEFT);
|
|
+
|
|
|
|
+
|
|
|
|
+ XWPFTableCell cell = row.getCell(0);
|
|
|
|
+ while (cell.getParagraphs().size() > 0) {
|
|
|
|
+ cell.removeParagraph(0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ XWPFParagraph paraImag = row.getCell(0).addParagraph();
|
|
|
|
+ paraImag.setAlignment(ParagraphAlignment.CENTER);
|
|
|
|
+
|
|
|
|
+ XWPFRun run = paraImag.createRun();
|
|
|
|
+ File imageFile = new File("states.png");
|
|
|
|
+ BufferedImage bufferedImage = ImageIO.read(imageFile);
|
|
|
|
+
|
|
|
|
+ int originalWidth = bufferedImage.getWidth();
|
|
|
|
+ int originalHeight = bufferedImage.getHeight();
|
|
|
|
+
|
|
|
|
+ int useWidth = 300;
|
|
|
|
+ int useHeight = useWidth * originalHeight / originalWidth;
|
|
|
|
+
|
|
|
|
+ InputStream is = new FileInputStream(imageFile);
|
|
|
|
+ run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG, null, Units.toEMU(useWidth), Units.toEMU(useHeight));
|
|
}
|
|
}
|
|
File fileDoc = new File(reportPath);
|
|
File fileDoc = new File(reportPath);
|
|
if (fileDoc.exists()) {
|
|
if (fileDoc.exists()) {
|
|
@@ -479,9 +430,9 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
Map<String, String> row4ItemMap = new HashMap<>();
|
|
Map<String, String> row4ItemMap = new HashMap<>();
|
|
row4ItemMap.put("colum0", "容积率上限");
|
|
row4ItemMap.put("colum0", "容积率上限");
|
|
- row4ItemMap.put("colum1", NumberUtil.double2TwoDecimal(UnitsUtil.m2ToMu((Double)rawTable.get("rjld"))) + "");
|
|
+ row4ItemMap.put("colum1", NumberUtil.double2TwoDecimal(UnitsUtil.m2ToMu((Double) rawTable.get("rjld"))) + "");
|
|
row4ItemMap.put("colum2", "容积率下限");
|
|
row4ItemMap.put("colum2", "容积率下限");
|
|
- row4ItemMap.put("colum3", NumberUtil.double2TwoDecimal(UnitsUtil.m2ToMu((Double)rawTable.get("rjlx"))) + "");
|
|
+ row4ItemMap.put("colum3", NumberUtil.double2TwoDecimal(UnitsUtil.m2ToMu((Double) rawTable.get("rjlx"))) + "");
|
|
rows.add(row4ItemMap);
|
|
rows.add(row4ItemMap);
|
|
|
|
|
|
Map<String, String> row5ItemMap = new HashMap<>();
|
|
Map<String, String> row5ItemMap = new HashMap<>();
|