|
@@ -20,6 +20,9 @@ import com.onemap.analyse.utils.NpoiHelper;
|
|
import com.onemap.analyse.utils.NumberUtil;
|
|
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 com.onemap.common.core.web.domain.RequestResult;
|
|
|
|
+import com.onemap.system.api.SpatialService;
|
|
|
|
+import com.onemap.system.api.domain.WktsVo;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.poi.util.Units;
|
|
import org.apache.poi.util.Units;
|
|
import org.apache.poi.xwpf.usermodel.*;
|
|
import org.apache.poi.xwpf.usermodel.*;
|
|
@@ -57,6 +60,9 @@ public class ReportServiceImpl implements IReportService {
|
|
@Resource
|
|
@Resource
|
|
GhdkaMapper ghdkaMapper;
|
|
GhdkaMapper ghdkaMapper;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ SpatialService spatialService;
|
|
|
|
+
|
|
|
|
|
|
public FzxzReport createReport(String bsm, List<String> dkIds) {
|
|
public FzxzReport createReport(String bsm, List<String> dkIds) {
|
|
|
|
|
|
@@ -233,13 +239,7 @@ public class ReportServiceImpl implements IReportService {
|
|
tabYztbTitles.add(tableTitleTb);
|
|
tabYztbTitles.add(tableTitleTb);
|
|
XWPFTable tableYztb = NpoiHelper.setComTable(document, tabYztbTitles, fztable, "表2:地类分析统计表", pos++);
|
|
XWPFTable tableYztb = NpoiHelper.setComTable(document, tabYztbTitles, fztable, "表2:地类分析统计表", pos++);
|
|
|
|
|
|
- QueryWrapper<SelectionResDTO> giswrapper = new QueryWrapper<>();
|
|
+ List<SelectionResDTO> fzxzJgGisDTOList = fzxzResMapper.getListByRwbsm(res.getBsm(), dkIds);
|
|
- giswrapper.eq("rwbsm", res.getBsm());
|
|
|
|
-
|
|
|
|
- if (dkIds != null && dkIds.size() > 0) {
|
|
|
|
- giswrapper.in("bsm", dkIds);
|
|
|
|
- }
|
|
|
|
- List<SelectionResDTO> fzxzJgGisDTOList = fzxzResMapper.selectList(giswrapper);
|
|
|
|
NpoiHelper.catalog(document, "三、选址分析", pos++);
|
|
NpoiHelper.catalog(document, "三、选址分析", pos++);
|
|
String ydmc = res.getYdmc();
|
|
String ydmc = res.getYdmc();
|
|
if (!StringUtils.isEmpty(ydmc)) {
|
|
if (!StringUtils.isEmpty(ydmc)) {
|
|
@@ -294,12 +294,16 @@ public class ReportServiceImpl implements IReportService {
|
|
cell.removeParagraph(0);
|
|
cell.removeParagraph(0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String geomWkt = item.getGeom();
|
|
|
|
+ String path = reportImg(geomWkt);
|
|
|
|
+
|
|
|
|
|
|
XWPFParagraph paraImag = row.getCell(0).addParagraph();
|
|
XWPFParagraph paraImag = row.getCell(0).addParagraph();
|
|
paraImag.setAlignment(ParagraphAlignment.CENTER);
|
|
paraImag.setAlignment(ParagraphAlignment.CENTER);
|
|
|
|
|
|
XWPFRun run = paraImag.createRun();
|
|
XWPFRun run = paraImag.createRun();
|
|
- File imageFile = new File("states.png");
|
|
+
|
|
|
|
+ File imageFile = new File(path);
|
|
BufferedImage bufferedImage = ImageIO.read(imageFile);
|
|
BufferedImage bufferedImage = ImageIO.read(imageFile);
|
|
|
|
|
|
int originalWidth = bufferedImage.getWidth();
|
|
int originalWidth = bufferedImage.getWidth();
|
|
@@ -458,35 +462,25 @@ public class ReportServiceImpl implements IReportService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- * TODO 待定
|
|
|
|
* 导出报告图片
|
|
* 导出报告图片
|
|
*
|
|
*
|
|
- * @param res
|
|
+ * @param wkt
|
|
- * @param xzbsmList 没有导出全部的地块
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
-
|
|
+ private String reportImg(String wkt) {
|
|
-
|
|
+ String path = "";
|
|
-
|
|
+
|
|
-
|
|
+ WktsVo wktsVo = new WktsVo();
|
|
-
|
|
+
|
|
-
|
|
+ WktsVo.WktInfo wktInfo = new WktsVo.WktInfo();
|
|
-
|
|
+ wktInfo.setWkt(wkt);
|
|
-
|
|
+ wktsVo.getWktInfos().add(wktInfo);
|
|
-
|
|
+
|
|
-
|
|
+ RequestResult requestResult = spatialService.getImage(wktsVo);
|
|
-
|
|
+ if (requestResult.isSuccess()) {
|
|
-
|
|
+ Map<String, String> map = (Map<String, String>) requestResult.get("data");
|
|
-
|
|
+ path=map.get("path");
|
|
-
|
|
+ }
|
|
-
|
|
+ return path;
|
|
-
|
|
+ }
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|