|
@@ -52,8 +52,8 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
@Value("${Hgxfx.temp}")
|
|
|
private String temp;
|
|
|
- @Value("${Fzxz.fzxzShp}")
|
|
|
- private String fzxzShp;
|
|
|
+ // @Value("${Fzxz.fzxzShp}")
|
|
|
+ // private String fzxzShp;
|
|
|
|
|
|
// 根据选址任务生成报告
|
|
|
public FzxzReport createReport(String bsm, List<String> xzbsmList) {
|
|
@@ -78,7 +78,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
// 选址简报
|
|
|
createSimpleReport(res, rootPath + File.separator + simplePath, xzbsmList);
|
|
|
// zip打包
|
|
|
- createZipReport(res, rootPath + File.separator + zipPath, rootPath + File.separator + reportPath, rootPath + File.separator + simplePath);
|
|
|
+ // createZipReport(res, rootPath + File.separator + zipPath, rootPath + File.separator + reportPath, rootPath + File.separator + simplePath);
|
|
|
// 生成返回结果
|
|
|
fzxzReport.setRootPath(StringUtils.getFileStaticPath(rootPath));
|
|
|
fzxzReport.setReportfile(StringUtils.getFileStaticPath(rootPath + File.separator + reportPath));
|
|
@@ -107,7 +107,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
* @param xzbsmList 没有导出全部地块
|
|
|
*/
|
|
|
private void createReport(FzxzEntityDTO res, String reportPath, List<String> xzbsmList) {
|
|
|
- List<String> imgList = ReportImg(res, xzbsmList);
|
|
|
+ // List<String> imgList = ReportImg(res, xzbsmList);
|
|
|
// 创建document文档对象对象实例
|
|
|
XWPFDocument document = null;
|
|
|
OutputStream outputStream = null;// 把doc输出到输出流
|
|
@@ -299,17 +299,19 @@ public class ReportServiceImpl implements IReportService {
|
|
|
NpoiHelper.mergeHorizontal(table, 4, 2, 3);
|
|
|
String mapF = "";
|
|
|
String mapM = "";
|
|
|
- if (imgList != null && imgList.size() > 0) {
|
|
|
- for (int j = 0; j < imgList.size(); j++) {
|
|
|
- String s = imgList.get(j);
|
|
|
- if (s.indexOf(item.getBsm() + "_F") >= 0) {
|
|
|
- mapF = s;// 全局
|
|
|
- }
|
|
|
- if (s.indexOf(item.getBsm() + "_M") >= 0) {
|
|
|
- mapM = s;// 局部
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ // TODO 生成位置图片
|
|
|
+ // if (imgList != null && imgList.size() > 0) {
|
|
|
+ // for (int j = 0; j < imgList.size(); j++) {
|
|
|
+ // String s = imgList.get(j);
|
|
|
+ // if (s.indexOf(item.getBsm() + "_F") >= 0) {
|
|
|
+ // mapF = s;// 全局
|
|
|
+ // }
|
|
|
+ // if (s.indexOf(item.getBsm() + "_M") >= 0) {
|
|
|
+ // mapM = s;// 局部
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
if (StringUtils.isNotEmpty(mapF)) {
|
|
|
FileInputStream fis = null;
|
|
|
try {
|
|
@@ -653,37 +655,37 @@ public class ReportServiceImpl implements IReportService {
|
|
|
/**
|
|
|
* zip打包
|
|
|
*/
|
|
|
- private void createZipReport(FzxzEntityDTO res, String reportZip, String reportPath, String simplePath) {
|
|
|
- File f = new File(fzxzShp);
|
|
|
- System.out.println("选址分析报告打包zip:" + reportPath);
|
|
|
- System.out.println("选址分析报告打包shp:" + fzxzShp);
|
|
|
- if (StringUtils.isNotEmpty(fzxzShp)) {
|
|
|
- String filePath = fzxzShp.substring(0, fzxzShp.lastIndexOf("."));
|
|
|
- String docReportPath = reportPath.substring(0, reportPath.lastIndexOf("."));
|
|
|
- String docSimplePath = reportPath.substring(0, reportPath.lastIndexOf("."));
|
|
|
- // 生成的压缩文件
|
|
|
- ZipFile zipFile = null;
|
|
|
- try {
|
|
|
- zipFile = new ZipFile(reportZip);
|
|
|
- ZipParameters parameters = new ZipParameters();
|
|
|
- // 压缩方式
|
|
|
- parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
|
|
|
- // 压缩级别
|
|
|
- parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
|
|
|
- zipFile.addFile(new File(simplePath), parameters);
|
|
|
- zipFile.addFile(new File(reportPath), parameters);
|
|
|
- zipFile.addFile(new File(filePath + ".shp"), parameters);
|
|
|
- zipFile.addFile(new File(filePath + ".shx"), parameters);
|
|
|
- zipFile.addFile(new File(filePath + ".dbf"), parameters);
|
|
|
- zipFile.addFile(new File(filePath + ".cpg"), parameters);
|
|
|
- zipFile.addFile(new File(filePath + ".prj"), parameters);
|
|
|
- } catch (ZipException e) {
|
|
|
- System.out.println(e.toString());
|
|
|
- // 插入任务日志
|
|
|
- iLogService.saveLog(res.getBsm(), "辅助选址", "生成选址报告zip打包错误:" + e.getMessage(), "error");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // private void createZipReport(FzxzEntityDTO res, String reportZip, String reportPath, String simplePath) {
|
|
|
+ // // File f = new File(fzxzShp);
|
|
|
+ // System.out.println("选址分析报告打包zip:" + reportPath);
|
|
|
+ // // System.out.println("选址分析报告打包shp:" + fzxzShp);
|
|
|
+ // if (StringUtils.isNotEmpty(fzxzShp)) {
|
|
|
+ // String filePath = fzxzShp.substring(0, fzxzShp.lastIndexOf("."));
|
|
|
+ // String docReportPath = reportPath.substring(0, reportPath.lastIndexOf("."));
|
|
|
+ // String docSimplePath = reportPath.substring(0, reportPath.lastIndexOf("."));
|
|
|
+ // // 生成的压缩文件
|
|
|
+ // ZipFile zipFile = null;
|
|
|
+ // try {
|
|
|
+ // zipFile = new ZipFile(reportZip);
|
|
|
+ // ZipParameters parameters = new ZipParameters();
|
|
|
+ // // 压缩方式
|
|
|
+ // parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
|
|
|
+ // // 压缩级别
|
|
|
+ // parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
|
|
|
+ // zipFile.addFile(new File(simplePath), parameters);
|
|
|
+ // zipFile.addFile(new File(reportPath), parameters);
|
|
|
+ // zipFile.addFile(new File(filePath + ".shp"), parameters);
|
|
|
+ // zipFile.addFile(new File(filePath + ".shx"), parameters);
|
|
|
+ // zipFile.addFile(new File(filePath + ".dbf"), parameters);
|
|
|
+ // zipFile.addFile(new File(filePath + ".cpg"), parameters);
|
|
|
+ // zipFile.addFile(new File(filePath + ".prj"), parameters);
|
|
|
+ // } catch (ZipException e) {
|
|
|
+ // System.out.println(e.toString());
|
|
|
+ // // 插入任务日志
|
|
|
+ // iLogService.saveLog(res.getBsm(), "辅助选址", "生成选址报告zip打包错误:" + e.getMessage(), "error");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
/**
|
|
|
* TODO 待定
|
|
@@ -693,28 +695,28 @@ public class ReportServiceImpl implements IReportService {
|
|
|
* @param xzbsmList 没有导出全部的地块
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<String> ReportImg(FzxzEntityDTO res, List<String> xzbsmList) {
|
|
|
- // 查询分析结果图斑信息
|
|
|
- QueryWrapper<FzxzResDTO> giswrapper = new QueryWrapper<>();
|
|
|
- giswrapper.eq("rwbsm", res.getBsm());
|
|
|
- // 筛选方案,根据传参或者预选方案
|
|
|
-// giswrapper.ne("yxfa", "0");
|
|
|
- if (xzbsmList != null) {
|
|
|
- giswrapper.in("bsm", xzbsmList);
|
|
|
- }
|
|
|
- List<FzxzResDTO> fzxzJgGisDTOList = fzxzResMapper.selectList(giswrapper);
|
|
|
- // SDE转SHP
|
|
|
- String inShp = fzxzShp;
|
|
|
- List objidlist = new ArrayList<>();
|
|
|
- for (FzxzResDTO cur : fzxzJgGisDTOList) {
|
|
|
- // objidlist.add(cur.getObjectid());
|
|
|
- }
|
|
|
- String objids = Joiner.on(",").join(objidlist);
|
|
|
- // sde2Shp("KJGH.T_FZSS_FZXZ_JG_GIS", inShp, "\"OBJECTID\" IN (" + objids + ")");
|
|
|
- // 执行python
|
|
|
- Map<String, String> params = new HashMap<>();
|
|
|
- // List<String> result = PythonExecute.RunFzxzMap(mapFunctionId, params);
|
|
|
- List<String> result = new ArrayList<>();
|
|
|
- return result;
|
|
|
- }
|
|
|
+// private List<String> ReportImg(FzxzEntityDTO res, List<String> xzbsmList) {
|
|
|
+// // 查询分析结果图斑信息
|
|
|
+// QueryWrapper<FzxzResDTO> giswrapper = new QueryWrapper<>();
|
|
|
+// giswrapper.eq("rwbsm", res.getBsm());
|
|
|
+// // 筛选方案,根据传参或者预选方案
|
|
|
+// // giswrapper.ne("yxfa", "0");
|
|
|
+// if (xzbsmList != null) {
|
|
|
+// giswrapper.in("bsm", xzbsmList);
|
|
|
+// }
|
|
|
+// List<FzxzResDTO> fzxzJgGisDTOList = fzxzResMapper.selectList(giswrapper);
|
|
|
+// // SDE转SHP
|
|
|
+// String inShp = fzxzShp;
|
|
|
+// List objidlist = new ArrayList<>();
|
|
|
+// for (FzxzResDTO cur : fzxzJgGisDTOList) {
|
|
|
+// // objidlist.add(cur.getObjectid());
|
|
|
+// }
|
|
|
+// String objids = Joiner.on(",").join(objidlist);
|
|
|
+// // sde2Shp("KJGH.T_FZSS_FZXZ_JG_GIS", inShp, "\"OBJECTID\" IN (" + objids + ")");
|
|
|
+// // 执行python
|
|
|
+// Map<String, String> params = new HashMap<>();
|
|
|
+// // List<String> result = PythonExecute.RunFzxzMap(mapFunctionId, params);
|
|
|
+// List<String> result = new ArrayList<>();
|
|
|
+// return result;
|
|
|
+// }
|
|
|
}
|