Browse Source

分类统计结果

gushoubang 1 year ago
parent
commit
dbbb3f53a6

+ 27 - 0
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/domain/FzxzGeomInfoDTO.java

@@ -0,0 +1,27 @@
+package com.onemap.analyse.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// 辅助选址分析列表
+@TableName("t_fzss_fzxz_geom_info")
+@Data
+public class FzxzGeomInfoDTO {
+    private int objectid;
+    // 选址标识码
+    private String rwbsm;
+    // 存储选址范围地块信息 json结构
+    private String info;
+
+    // info中的地块详细信息
+    class GeomInfo {
+        private String code;
+        private String name;
+        private double area;// 面积
+        private float ratio;// 占比
+        List<GeomInfo> geomInfoList = new ArrayList<>();
+    }
+}

+ 0 - 67
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/domain/FzxzTbEntityDTO.java

@@ -1,67 +0,0 @@
-package com.onemap.analyse.domain;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-
-//辅助选址分析列表
-@TableName("T_FZSS_FZXZ_TB")
-public class FzxzTbEntityDTO {
-    private int objectid;
-    //选址标识码
-    private String rwbsm;
-    //地类编码
-    private String ydyhfldm;
-    //地类名称
-    private String ydyhflmc;
-    //图斑数量
-    private double frequency;
-    //汇总面积
-    private double sumMj;
-
-    public int getObjectid() {
-        return objectid;
-    }
-
-    public void setObjectid(int objectid) {
-        this.objectid = objectid;
-    }
-
-    public String getRwbsm() {
-        return rwbsm;
-    }
-
-    public void setRwbsm(String rwbsm) {
-        this.rwbsm = rwbsm;
-    }
-
-    public String getYdyhfldm() {
-        return ydyhfldm;
-    }
-
-    public void setYdyhfldm(String ydyhfldm) {
-        this.ydyhfldm = ydyhfldm;
-    }
-
-    public String getYdyhflmc() {
-        return ydyhflmc;
-    }
-
-    public void setYdyhflmc(String ydyhflmc) {
-        this.ydyhflmc = ydyhflmc;
-    }
-
-    public double getFrequency() {
-        return frequency;
-    }
-
-    public void setFrequency(double frequency) {
-        this.frequency = frequency;
-    }
-
-    public double getSumMj() {
-        return sumMj;
-    }
-
-    public void setSumMj(double sumMj) {
-        this.sumMj = sumMj;
-    }
-}

+ 2 - 7
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/mapper/FzxzTbMapper.java

@@ -1,17 +1,12 @@
 package com.onemap.analyse.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.onemap.analyse.domain.FzxzDTO;
-import com.onemap.analyse.domain.FzxzEntityDTO;
-import com.onemap.analyse.domain.FzxzTbEntityDTO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
+import com.onemap.analyse.domain.FzxzGeomInfoDTO;
 
 /**
  * 辅助选址图斑
  *
  * @author onemap
  */
-public interface FzxzTbMapper extends BaseMapper<FzxzTbEntityDTO> {
+public interface FzxzTbMapper extends BaseMapper<FzxzGeomInfoDTO> {
 }

+ 5 - 1
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/FzssServiceImpl.java

@@ -14,7 +14,6 @@ import com.onemap.analyse.mapper.vector.GhdkaMapper;
 import com.onemap.analyse.service.IFzssService;
 import com.onemap.analyse.service.ILogService;
 import com.onemap.analyse.service.IReportService;
-import com.onemap.analyse.task.FzxzSchedule;
 import com.onemap.analyse.utils.DozerUtils;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.domain.RequestResult;
@@ -25,6 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.io.IOException;
 import java.util.*;
 
@@ -70,6 +70,10 @@ public class FzssServiceImpl implements IFzssService {
     @Autowired
     private ILogService iLogService;
 
+    // 选址结果汇总
+    @Resource
+    private FzxzTbMapper fzxzTbMapper;
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {

+ 28 - 27
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ReportServiceImpl.java

@@ -1,7 +1,6 @@
 package com.onemap.analyse.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.google.common.base.Joiner;
 import com.onemap.analyse.domain.*;
 import com.onemap.analyse.mapper.FzxzMapper;
 import com.onemap.analyse.mapper.FzxzTbMapper;
@@ -12,10 +11,6 @@ import com.onemap.analyse.service.IReportService;
 import com.onemap.analyse.utils.NpoiHelper;
 import com.onemap.analyse.utils.NumberUtil;
 import com.onemap.common.core.utils.StringUtils;
-import net.lingala.zip4j.core.ZipFile;
-import net.lingala.zip4j.exception.ZipException;
-import net.lingala.zip4j.model.ZipParameters;
-import net.lingala.zip4j.util.Zip4jConstants;
 import org.apache.commons.io.FileUtils;
 import org.apache.poi.xwpf.usermodel.*;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth;
@@ -106,12 +101,14 @@ public class ReportServiceImpl implements IReportService {
         try {
             document = new XWPFDocument();
             int pos = 0;
-            // 文本标题
+            // 0、文本标题
             NpoiHelper.title(document, res.getXmmc() + "选址报告", pos++);
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
             NpoiHelper.Option optionCENTER = new NpoiHelper.Option();
             optionCENTER.setAlign(ParagraphAlignment.CENTER);
             document.setParagraph(NpoiHelper.newParagraph(document, sdf.format(new Date()), optionCENTER), pos++);
+
+            // 1、项目选址信息
             NpoiHelper.catalog(document, "一、项目选址信息", pos++);
             String ydmj = res.getYdmjbegin() + " - " + res.getYdmjend();
             if (StringUtils.isEmpty(res.getYdmjbegin()) || Double.parseDouble(res.getYdmjbegin()) == 0)
@@ -174,37 +171,41 @@ public class ReportServiceImpl implements IReportService {
                 dataTablelist.add(map);
             }
             XWPFTable tableYz = NpoiHelper.setComTable(document, tabYzTitles, dataTablelist, "表1:选址影响因子", pos++);
+
+            // TODO 二、选址范围分析
             NpoiHelper.catalog(document, "二、选址范围分析", pos++);
             // 查询辅助选址分析图斑
-            QueryWrapper<FzxzTbEntityDTO> wrapperTb = new QueryWrapper<FzxzTbEntityDTO>();
+            QueryWrapper<FzxzGeomInfoDTO> wrapperTb = new QueryWrapper<>();
             wrapperTb.eq("rwbsm", res.getBsm());
             wrapperTb.groupBy("objectid", "rwbsm", "ydyhfldm", "ydyhflmc", "frequency", "sum_mj");
-            List<FzxzTbEntityDTO> fzxzTbEntityDTOList = fzxzTbMapper.selectList(wrapperTb);
+            List<FzxzGeomInfoDTO> fzxzTbEntityDTOList = fzxzTbMapper.selectList(wrapperTb);
             // 计算面积总和
+            // TODO
             double sumcount = 0;
-            for (int i = 0; i < fzxzTbEntityDTOList.size(); i++) {
-                sumcount = sumcount + fzxzTbEntityDTOList.get(i).getSumMj();
-            }
+            // for (int i = 0; i < fzxzTbEntityDTOList.size(); i++) {
+            //     sumcount = sumcount + fzxzTbEntityDTOList.get(i).getSumMj();
+            // }
 
-            List<FzxzTbEntityDTO> list = fzxzTbEntityDTOList.stream().sorted(Comparator.comparing(FzxzTbEntityDTO::getSumMj).reversed()).collect(Collectors.toList());
+            // List<FzxzGeomInfoDTO> list = fzxzTbEntityDTOList.stream().sorted(Comparator.comparing(FzxzGeomInfoDTO::getSumMj).reversed()).collect(Collectors.toList());
             String fwfx = "\t根据指定选址分析得出,所选范围共" + Math.round(sumcount) + "平方米,其中";
             List<Map<String, Object>> fztable = new ArrayList<>();
             // 生成地类分析统计表
-            for (int i = 0; i < list.size(); i++) {
-                FzxzTbEntityDTO item = list.get(i);
-                String zb = String.format("%.1f", item.getSumMj() / sumcount * 100);
-                if (i < 5) {
-                    // 面积前五的占比地类计算
-                    fwfx += item.getYdyhflmc() + Math.round(item.getSumMj()) + "平方米,占比" + zb + "%;";
-                }
-                // List<FzxzTbEntityDTO>转List<Map<String, Object>> 地类编码	地类名称	面积(平方千米)	占比(%)
-                Map map = new HashMap();
-                map.put("ZB", zb);
-                map.put("YDYHFLDM", item.getYdyhfldm());
-                map.put("YDYHFLMC", item.getYdyhflmc());
-                map.put("SUM_MJ", Math.round(item.getSumMj()));
-                fztable.add(map);
-            }
+            // TODO
+            // for (int i = 0; i < list.size(); i++) {
+            //     FzxzGeomInfoDTO item = list.get(i);
+            //     String zb = String.format("%.1f", item.getSumMj() / sumcount * 100);
+            //     if (i < 5) {
+            //         // 面积前五的占比地类计算
+            //         fwfx += item.getYdyhflmc() + Math.round(item.getSumMj()) + "平方米,占比" + zb + "%;";
+            //     }
+            //     // List<FzxzTbEntityDTO>转List<Map<String, Object>> 地类编码	地类名称	面积(平方千米)	占比(%)
+            //     Map map = new HashMap();
+            //     map.put("ZB", zb);
+            //     map.put("YDYHFLDM", item.getYdyhfldm());
+            //     map.put("YDYHFLMC", item.getYdyhflmc());
+            //     map.put("SUM_MJ", Math.round(item.getSumMj()));
+            //     fztable.add(map);
+            // }
             fwfx = fwfx.substring(0, fwfx.length() - 1) + "。详情如下:";
             NpoiHelper.content(document, fwfx, pos++);
             // 地类编码	地类名称	面积(平方千米)	占比(%)

+ 302 - 302
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/FzxzSchedule.java

@@ -547,307 +547,307 @@ public class FzxzSchedule {
 //         System.out.println(outfilepath);
 //     }
 
-    /**
-     * 选址简报
-     */
-    private void createSimpleReport(FzxzEntityDTO res, String reportPath, List<String> xzbsmList) {
-        // 创建document文档对象对象实例
-        XWPFDocument document = null;
-        OutputStream outputStream = null;// 把doc输出到输出流
-        try {
-            // 创建document文档对象对象实例
-            document = new XWPFDocument();
-            int pos = 0;
-            NpoiHelper.Option optionCENTER = new NpoiHelper.Option();
-            optionCENTER.setAlign(ParagraphAlignment.CENTER);
-            // 文本标题
-            NpoiHelper.title(document, res.getXmmc() + "选址简报", pos++);
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
-            document.setParagraph(NpoiHelper.newParagraph(document, sdf.format(new Date()), optionCENTER), pos++);
-
-            NpoiHelper.catalog(document, "一、项目选址信息", pos++);
-            XWPFTable table = document.createTable(4, 4);
-            table.setWidth(8500);// 总宽度
-            for (int k = 0; k < 4; k++) {
-                XWPFTableCell cell = table.getRow(0).getCell(k);
-                CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
-                CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
-                ctTblWidth.setW(BigInteger.valueOf(2125));
-                ctTblWidth.setType(STTblWidth.DXA);
-            }
-            // Table 表格第一行
-            NpoiHelper.Option optionIsBoldCENTER = new NpoiHelper.Option();
-            optionIsBoldCENTER.setAlign(ParagraphAlignment.CENTER);
-            optionIsBoldCENTER.setBold(true);
-            table.getRow(0).getCell(0).setColor("DBE5F1");
-            table.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(table, "项目名称", optionIsBoldCENTER));
-            NpoiHelper.mergeHorizontal(table, 0, 1, 3);
-            table.getRow(0).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getXmmc(), null));
-            // Table 表格第二行
-            table.getRow(1).getCell(0).setColor("DBE5F1");
-            table.getRow(1).getCell(0).setParagraph(NpoiHelper.setCellText(table, "建设单位", optionIsBoldCENTER));
-            NpoiHelper.mergeHorizontal(table, 1, 1, 3);
-            table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getJsdw(), null));
-            // Table 表格第三行
-            String ydmj = res.getYdmjbegin() + " - " + res.getYdmjend();
-            if (StringUtils.isEmpty(res.getYdmjbegin()) || Double.parseDouble(res.getYdmjbegin()) == 0)
-                ydmj = "≤" + res.getYdmjend();
-            else if (StringUtils.isEmpty(res.getYdmjend()) || Double.parseDouble(res.getYdmjend()) == 0)
-                ydmj = "≥" + res.getYdmjbegin();
-            table.getRow(2).getCell(0).setColor("DBE5F1");
-            table.getRow(2).getCell(0).setParagraph(NpoiHelper.setCellText(table, "用地面积", optionIsBoldCENTER));
-            table.getRow(2).getCell(1).setParagraph(NpoiHelper.setCellText(table, ydmj + "平方米", null));
-            table.getRow(2).getCell(2).setColor("DBE5F1");
-            table.getRow(2).getCell(2).setParagraph(NpoiHelper.setCellText(table, "用地性质", optionIsBoldCENTER));
-            table.getRow(2).getCell(3).setParagraph(NpoiHelper.setCellText(table, res.getYdmc(), null));
-            // Table 表格第四行
-            table.getRow(3).getCell(1).setColor("DBE5F1");
-            table.getRow(3).getCell(2).setColor("DBE5F1");
-            table.getRow(3).getCell(3).setColor("DBE5F1");
-            table.getRow(3).getCell(0).setParagraph(NpoiHelper.setCellText(table, "选址因子", optionIsBoldCENTER));
-            table.getRow(3).getCell(1).setParagraph(NpoiHelper.setCellText(table, "因子名称", optionIsBoldCENTER));
-            table.getRow(3).getCell(2).setParagraph(NpoiHelper.setCellText(table, "影响条件", optionIsBoldCENTER));
-            table.getRow(3).getCell(3).setParagraph(NpoiHelper.setCellText(table, "约束范围值(M)", optionIsBoldCENTER));
-            // 查询选址因子,并且转换为List<Map> 因子条件(包含:C、不包含:N、分析:A)
-            QueryWrapper<FzxzXzyzDTO> wrapper = new QueryWrapper<FzxzXzyzDTO>();
-            wrapper.eq("rwbsm", res.getBsm());
-            List<FzxzXzyzDTO> fzxzXzyzDTOList = fzxzXzyzMapper.selectList(wrapper);
-            for (int i = 0; i < fzxzXzyzDTOList.size(); i++) {
-                FzxzXzyzDTO fzxzXzyzDTO = fzxzXzyzDTOList.get(i);
-                String yztj = "";
-                // if (fzxzXzyzDTO.getYztj() != null) {
-                //     if ("C".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
-                //         yztj = "包含";
-                //     }
-                //     if ("N".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
-                //         yztj = "不包含";
-                //     }
-                //     if ("A".equals(fzxzXzyzDTO.getYztj().toUpperCase()) || "F".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
-                //         yztj = "分析";
-                //     }
-                // }
-                String yxz = "";
-                // if (StringUtils.isNotEmpty(fzxzXzyzDTO.getYxz())) {
-                //     yxz = fzxzXzyzDTO.getYxz();
-                // }
-                XWPFTableRow mr = table.createRow();
-
-                mr.getCell(1).setParagraph(NpoiHelper.setCellText(table, fzxzXzyzDTO.getYxyzmc(), optionCENTER));
-                mr.getCell(2).setParagraph(NpoiHelper.setCellText(table, yztj, optionCENTER));
-                mr.getCell(3).setParagraph(NpoiHelper.setCellText(table, yxz, optionCENTER));
-            }
-            NpoiHelper.mergeCellsVertically(table, 0, 3, 3 + fzxzXzyzDTOList.size());
-            table.getRow(3).getCell(0).setColor("DBE5F1");
-            // 选址分析
-            NpoiHelper.catalog(document, "二、选址分析", pos++);
-            XWPFTable tableFx = document.createTable(1, 4);
-            tableFx.setWidth(8500);// 总宽度
-            for (int k = 0; k < 4; k++) {
-                XWPFTableCell cell = tableFx.getRow(0).getCell(k);
-                CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
-                CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
-                ctTblWidth.setW(BigInteger.valueOf(2125));
-                ctTblWidth.setType(STTblWidth.DXA);
-            }
-            // 查询结果GIS FzxzJgGisDTO
-            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);
-            int index = 1;
-            NpoiHelper.Option optionIsBold = new NpoiHelper.Option();
-            optionIsBold.setBold(true);
-            int rowIndex = 0;
-            for (int i = 0; i < fzxzJgGisDTOList.size(); i++) {
-                FzxzResDTO item = fzxzJgGisDTOList.get(i);
-                XWPFTableRow mr = tableFx.createRow();
-                rowIndex++;
-                mr.getCell(0).setColor("DBE5F1");
-                NpoiHelper.mergeHorizontal(tableFx, rowIndex, 0, 1);
-                mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "方案" + NumberUtil.int2chineseNum(index), optionIsBold));
-                // tableFx 表格第二行
-                mr = tableFx.createRow();
-                rowIndex++;
-                mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "地类编码", optionIsBoldCENTER));
-                // mr.getCell(1).setParagraph(NpoiHelper.setCellText(tableFx, item.getDlbm(), null));
-                mr.getCell(2).setParagraph(NpoiHelper.setCellText(tableFx, "地类名称", optionIsBoldCENTER));
-                // mr.getCell(3).setParagraph(NpoiHelper.setCellText(tableFx, item.getDlmc(), null));
-                // tableFx 表格第三行
-                mr = tableFx.createRow();
-                rowIndex++;
-                mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "地块面积", optionIsBoldCENTER));
-                // mr.getCell(1).setParagraph(NpoiHelper.setCellText(tableFx, Math.round(item.getTbmj()) + "平方米", null));
-                mr.getCell(2).setParagraph(NpoiHelper.setCellText(tableFx, "土地位置", optionIsBoldCENTER));
-                // mr.getCell(3).setParagraph(NpoiHelper.setCellText(tableFx, item.getXzqmc(), null));
-                // tableFx 表格第四行
-                mr = tableFx.createRow();
-                rowIndex++;
-                mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "压占分析", optionIsBoldCENTER));
-                NpoiHelper.mergeHorizontal(tableFx, rowIndex, 1, 3);
-
-                XWPFParagraph para6 = mr.getCell(1).addParagraph();
-                para6.setAlignment(ParagraphAlignment.LEFT);
-                // 查询选址因子 因子条件(包含:C、不包含:N、分析:A)
-                // QueryWrapper<fzxzXzyzDTO> fzxzJgyzDTOQueryWrapper = new QueryWrapper<>();
-                // fzxzJgyzDTOQueryWrapper.eq("jbbsm", item.getBsm());
-                // fzxzJgyzDTOQueryWrapper.eq("yztj", "F");
-                // List<fzxzXzyzDTO> fzxzJgyzDTOList = fzxzXzyzMapper.selectList(fzxzJgyzDTOQueryWrapper);
-                // int jgyzid = 1;
-                // for (int j = 0; j < fzxzJgyzDTOList.size(); j++) {
-                //     FzxzXzyzDTO jgyz = fzxzJgyzDTOList.get(j);
-                //     XWPFRun run = para6.createRun();
-                //     String jg = jgyz.getFxjg();
-                //     Double jgDouble = 0.0;
-                //     try {
-                //         jgDouble = Double.parseDouble(jg);
-                //         run.setText(jgyzid + "、压占" + jgyz.getYxyzmc() + "面积" + jg + "平方米");
-                //     } catch (Exception e) {
-                //         run.setText(jgyzid + "、" + jg);
-                //     }
-                //
-                //     if (jgyzid < fzxzJgyzDTOList.size())
-                //         run.addBreak(BreakType.TEXT_WRAPPING);
-                //     jgyzid++;
-                // }
-                index++;
-            }
-            tableFx.removeRow(0);
-            File fileDoc = new File(reportPath);
-            if (fileDoc.exists()) {
-                FileUtils.forceDelete(fileDoc);
-            }
-            // word文件输出流
-            outputStream = new FileOutputStream(reportPath);
-            document.write(outputStream);
-        } catch (Exception e) {
-            e.printStackTrace();
-            System.out.println(e.toString());
-            // 插入任务日志
-            FxrwrzDTO errorDto = new FxrwrzDTO();
-            errorDto.setRwbsm(res.getBsm());
-            errorDto.setRwlx("辅助选址");
-            errorDto.setRzlr("生成选址简报错误:" + e.getMessage());
-            errorDto.setRzsj(new Date());
-            errorDto.setRzlx("error");
-            fxrwrzMapper.insert(errorDto);
-        } finally {
-            if (document != null) {
-                try {
-                    document.close();
-                } catch (Exception ex) {
-                    System.out.println(ex.toString());
-                }
-            }
-            if (outputStream != null) {
-                try {
-                    outputStream.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        // 转PDF
-        String outfilepath = reportPath.replace(".docx", ".pdf");
-        NpoiHelper.doc2pdf(reportPath, outfilepath);
-        System.out.println(outfilepath);
-    }
-
-    /**
-     * 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());
-                // 插入任务日志
-                FxrwrzDTO errorDto = new FxrwrzDTO();
-                errorDto.setRwbsm(res.getBsm());
-                errorDto.setRwlx("辅助选址");
-                errorDto.setRzlr("生成选址报告zip打包错误:" + e.getMessage());
-                errorDto.setRzsj(new Date());
-                errorDto.setRzlx("error");
-                fxrwrzMapper.insert(errorDto);
-            }
-        }
-    }
-
-    /**
-     * 导出报告图片
-     *
-     * @param res
-     * @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);
-        return result;
-    }
+//     /**
+//      * 选址简报
+//      */
+//     private void createSimpleReport(FzxzEntityDTO res, String reportPath, List<String> xzbsmList) {
+//         // 创建document文档对象对象实例
+//         XWPFDocument document = null;
+//         OutputStream outputStream = null;// 把doc输出到输出流
+//         try {
+//             // 创建document文档对象对象实例
+//             document = new XWPFDocument();
+//             int pos = 0;
+//             NpoiHelper.Option optionCENTER = new NpoiHelper.Option();
+//             optionCENTER.setAlign(ParagraphAlignment.CENTER);
+//             // 文本标题
+//             NpoiHelper.title(document, res.getXmmc() + "选址简报", pos++);
+//             SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+//             document.setParagraph(NpoiHelper.newParagraph(document, sdf.format(new Date()), optionCENTER), pos++);
+//
+//             NpoiHelper.catalog(document, "一、项目选址信息", pos++);
+//             XWPFTable table = document.createTable(4, 4);
+//             table.setWidth(8500);// 总宽度
+//             for (int k = 0; k < 4; k++) {
+//                 XWPFTableCell cell = table.getRow(0).getCell(k);
+//                 CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
+//                 CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
+//                 ctTblWidth.setW(BigInteger.valueOf(2125));
+//                 ctTblWidth.setType(STTblWidth.DXA);
+//             }
+//             // Table 表格第一行
+//             NpoiHelper.Option optionIsBoldCENTER = new NpoiHelper.Option();
+//             optionIsBoldCENTER.setAlign(ParagraphAlignment.CENTER);
+//             optionIsBoldCENTER.setBold(true);
+//             table.getRow(0).getCell(0).setColor("DBE5F1");
+//             table.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(table, "项目名称", optionIsBoldCENTER));
+//             NpoiHelper.mergeHorizontal(table, 0, 1, 3);
+//             table.getRow(0).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getXmmc(), null));
+//             // Table 表格第二行
+//             table.getRow(1).getCell(0).setColor("DBE5F1");
+//             table.getRow(1).getCell(0).setParagraph(NpoiHelper.setCellText(table, "建设单位", optionIsBoldCENTER));
+//             NpoiHelper.mergeHorizontal(table, 1, 1, 3);
+//             table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, res.getJsdw(), null));
+//             // Table 表格第三行
+//             String ydmj = res.getYdmjbegin() + " - " + res.getYdmjend();
+//             if (StringUtils.isEmpty(res.getYdmjbegin()) || Double.parseDouble(res.getYdmjbegin()) == 0)
+//                 ydmj = "≤" + res.getYdmjend();
+//             else if (StringUtils.isEmpty(res.getYdmjend()) || Double.parseDouble(res.getYdmjend()) == 0)
+//                 ydmj = "≥" + res.getYdmjbegin();
+//             table.getRow(2).getCell(0).setColor("DBE5F1");
+//             table.getRow(2).getCell(0).setParagraph(NpoiHelper.setCellText(table, "用地面积", optionIsBoldCENTER));
+//             table.getRow(2).getCell(1).setParagraph(NpoiHelper.setCellText(table, ydmj + "平方米", null));
+//             table.getRow(2).getCell(2).setColor("DBE5F1");
+//             table.getRow(2).getCell(2).setParagraph(NpoiHelper.setCellText(table, "用地性质", optionIsBoldCENTER));
+//             table.getRow(2).getCell(3).setParagraph(NpoiHelper.setCellText(table, res.getYdmc(), null));
+//             // Table 表格第四行
+//             table.getRow(3).getCell(1).setColor("DBE5F1");
+//             table.getRow(3).getCell(2).setColor("DBE5F1");
+//             table.getRow(3).getCell(3).setColor("DBE5F1");
+//             table.getRow(3).getCell(0).setParagraph(NpoiHelper.setCellText(table, "选址因子", optionIsBoldCENTER));
+//             table.getRow(3).getCell(1).setParagraph(NpoiHelper.setCellText(table, "因子名称", optionIsBoldCENTER));
+//             table.getRow(3).getCell(2).setParagraph(NpoiHelper.setCellText(table, "影响条件", optionIsBoldCENTER));
+//             table.getRow(3).getCell(3).setParagraph(NpoiHelper.setCellText(table, "约束范围值(M)", optionIsBoldCENTER));
+//             // 查询选址因子,并且转换为List<Map> 因子条件(包含:C、不包含:N、分析:A)
+//             QueryWrapper<FzxzXzyzDTO> wrapper = new QueryWrapper<FzxzXzyzDTO>();
+//             wrapper.eq("rwbsm", res.getBsm());
+//             List<FzxzXzyzDTO> fzxzXzyzDTOList = fzxzXzyzMapper.selectList(wrapper);
+//             for (int i = 0; i < fzxzXzyzDTOList.size(); i++) {
+//                 FzxzXzyzDTO fzxzXzyzDTO = fzxzXzyzDTOList.get(i);
+//                 String yztj = "";
+//                 // if (fzxzXzyzDTO.getYztj() != null) {
+//                 //     if ("C".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
+//                 //         yztj = "包含";
+//                 //     }
+//                 //     if ("N".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
+//                 //         yztj = "不包含";
+//                 //     }
+//                 //     if ("A".equals(fzxzXzyzDTO.getYztj().toUpperCase()) || "F".equals(fzxzXzyzDTO.getYztj().toUpperCase())) {
+//                 //         yztj = "分析";
+//                 //     }
+//                 // }
+//                 String yxz = "";
+//                 // if (StringUtils.isNotEmpty(fzxzXzyzDTO.getYxz())) {
+//                 //     yxz = fzxzXzyzDTO.getYxz();
+//                 // }
+//                 XWPFTableRow mr = table.createRow();
+//
+//                 mr.getCell(1).setParagraph(NpoiHelper.setCellText(table, fzxzXzyzDTO.getYxyzmc(), optionCENTER));
+//                 mr.getCell(2).setParagraph(NpoiHelper.setCellText(table, yztj, optionCENTER));
+//                 mr.getCell(3).setParagraph(NpoiHelper.setCellText(table, yxz, optionCENTER));
+//             }
+//             NpoiHelper.mergeCellsVertically(table, 0, 3, 3 + fzxzXzyzDTOList.size());
+//             table.getRow(3).getCell(0).setColor("DBE5F1");
+//             // 选址分析
+//             NpoiHelper.catalog(document, "二、选址分析", pos++);
+//             XWPFTable tableFx = document.createTable(1, 4);
+//             tableFx.setWidth(8500);// 总宽度
+//             for (int k = 0; k < 4; k++) {
+//                 XWPFTableCell cell = tableFx.getRow(0).getCell(k);
+//                 CTTcPr ctTcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr();
+//                 CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
+//                 ctTblWidth.setW(BigInteger.valueOf(2125));
+//                 ctTblWidth.setType(STTblWidth.DXA);
+//             }
+//             // 查询结果GIS FzxzJgGisDTO
+//             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);
+//             int index = 1;
+//             NpoiHelper.Option optionIsBold = new NpoiHelper.Option();
+//             optionIsBold.setBold(true);
+//             int rowIndex = 0;
+//             for (int i = 0; i < fzxzJgGisDTOList.size(); i++) {
+//                 FzxzResDTO item = fzxzJgGisDTOList.get(i);
+//                 XWPFTableRow mr = tableFx.createRow();
+//                 rowIndex++;
+//                 mr.getCell(0).setColor("DBE5F1");
+//                 NpoiHelper.mergeHorizontal(tableFx, rowIndex, 0, 1);
+//                 mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "方案" + NumberUtil.int2chineseNum(index), optionIsBold));
+//                 // tableFx 表格第二行
+//                 mr = tableFx.createRow();
+//                 rowIndex++;
+//                 mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "地类编码", optionIsBoldCENTER));
+//                 // mr.getCell(1).setParagraph(NpoiHelper.setCellText(tableFx, item.getDlbm(), null));
+//                 mr.getCell(2).setParagraph(NpoiHelper.setCellText(tableFx, "地类名称", optionIsBoldCENTER));
+//                 // mr.getCell(3).setParagraph(NpoiHelper.setCellText(tableFx, item.getDlmc(), null));
+//                 // tableFx 表格第三行
+//                 mr = tableFx.createRow();
+//                 rowIndex++;
+//                 mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "地块面积", optionIsBoldCENTER));
+//                 // mr.getCell(1).setParagraph(NpoiHelper.setCellText(tableFx, Math.round(item.getTbmj()) + "平方米", null));
+//                 mr.getCell(2).setParagraph(NpoiHelper.setCellText(tableFx, "土地位置", optionIsBoldCENTER));
+//                 // mr.getCell(3).setParagraph(NpoiHelper.setCellText(tableFx, item.getXzqmc(), null));
+//                 // tableFx 表格第四行
+//                 mr = tableFx.createRow();
+//                 rowIndex++;
+//                 mr.getCell(0).setParagraph(NpoiHelper.setCellText(tableFx, "压占分析", optionIsBoldCENTER));
+//                 NpoiHelper.mergeHorizontal(tableFx, rowIndex, 1, 3);
+//
+//                 XWPFParagraph para6 = mr.getCell(1).addParagraph();
+//                 para6.setAlignment(ParagraphAlignment.LEFT);
+//                 // 查询选址因子 因子条件(包含:C、不包含:N、分析:A)
+//                 // QueryWrapper<fzxzXzyzDTO> fzxzJgyzDTOQueryWrapper = new QueryWrapper<>();
+//                 // fzxzJgyzDTOQueryWrapper.eq("jbbsm", item.getBsm());
+//                 // fzxzJgyzDTOQueryWrapper.eq("yztj", "F");
+//                 // List<fzxzXzyzDTO> fzxzJgyzDTOList = fzxzXzyzMapper.selectList(fzxzJgyzDTOQueryWrapper);
+//                 // int jgyzid = 1;
+//                 // for (int j = 0; j < fzxzJgyzDTOList.size(); j++) {
+//                 //     FzxzXzyzDTO jgyz = fzxzJgyzDTOList.get(j);
+//                 //     XWPFRun run = para6.createRun();
+//                 //     String jg = jgyz.getFxjg();
+//                 //     Double jgDouble = 0.0;
+//                 //     try {
+//                 //         jgDouble = Double.parseDouble(jg);
+//                 //         run.setText(jgyzid + "、压占" + jgyz.getYxyzmc() + "面积" + jg + "平方米");
+//                 //     } catch (Exception e) {
+//                 //         run.setText(jgyzid + "、" + jg);
+//                 //     }
+//                 //
+//                 //     if (jgyzid < fzxzJgyzDTOList.size())
+//                 //         run.addBreak(BreakType.TEXT_WRAPPING);
+//                 //     jgyzid++;
+//                 // }
+//                 index++;
+//             }
+//             tableFx.removeRow(0);
+//             File fileDoc = new File(reportPath);
+//             if (fileDoc.exists()) {
+//                 FileUtils.forceDelete(fileDoc);
+//             }
+//             // word文件输出流
+//             outputStream = new FileOutputStream(reportPath);
+//             document.write(outputStream);
+//         } catch (Exception e) {
+//             e.printStackTrace();
+//             System.out.println(e.toString());
+//             // 插入任务日志
+//             FxrwrzDTO errorDto = new FxrwrzDTO();
+//             errorDto.setRwbsm(res.getBsm());
+//             errorDto.setRwlx("辅助选址");
+//             errorDto.setRzlr("生成选址简报错误:" + e.getMessage());
+//             errorDto.setRzsj(new Date());
+//             errorDto.setRzlx("error");
+//             fxrwrzMapper.insert(errorDto);
+//         } finally {
+//             if (document != null) {
+//                 try {
+//                     document.close();
+//                 } catch (Exception ex) {
+//                     System.out.println(ex.toString());
+//                 }
+//             }
+//             if (outputStream != null) {
+//                 try {
+//                     outputStream.close();
+//                 } catch (IOException e) {
+//                     e.printStackTrace();
+//                 }
+//             }
+//         }
+//         // 转PDF
+//         String outfilepath = reportPath.replace(".docx", ".pdf");
+//         NpoiHelper.doc2pdf(reportPath, outfilepath);
+//         System.out.println(outfilepath);
+//     }
 
-    /**
-     * SDE转SHP
-     *
-     * @param table   SDE表
-     * @param shpfile shp文件
-     * @param where   追加字段
-     * @return
-     */
-    public static String sde2Shp(String table, String shpfile, String where) {
-        if (StringUtils.isNotEmpty(where)) {
-            Map<String, String> params = new HashMap<>();
-            params.put("table", table);
-            params.put("shpfile", shpfile);
-            params.put("where", where);
-            return PythonExecute.RunGisHelper("sde2shp", params);
-        } else {
-            Map<String, String> params = new HashMap<>();
-            params.put("table", table);
-            params.put("shpfile", shpfile);
-            return PythonExecute.RunGisHelper("sde2shp", params);
-        }
-    }
+//     /**
+//      * 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());
+//                 // 插入任务日志
+//                 FxrwrzDTO errorDto = new FxrwrzDTO();
+//                 errorDto.setRwbsm(res.getBsm());
+//                 errorDto.setRwlx("辅助选址");
+//                 errorDto.setRzlr("生成选址报告zip打包错误:" + e.getMessage());
+//                 errorDto.setRzsj(new Date());
+//                 errorDto.setRzlx("error");
+//                 fxrwrzMapper.insert(errorDto);
+//             }
+//         }
+//     }
+//
+//     /**
+//      * 导出报告图片
+//      *
+//      * @param res
+//      * @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);
+//         return result;
+//     }
+//
+//     /**
+//      * SDE转SHP
+//      *
+//      * @param table   SDE表
+//      * @param shpfile shp文件
+//      * @param where   追加字段
+//      * @return
+//      */
+//     public static String sde2Shp(String table, String shpfile, String where) {
+//         if (StringUtils.isNotEmpty(where)) {
+//             Map<String, String> params = new HashMap<>();
+//             params.put("table", table);
+//             params.put("shpfile", shpfile);
+//             params.put("where", where);
+//             return PythonExecute.RunGisHelper("sde2shp", params);
+//         } else {
+//             Map<String, String> params = new HashMap<>();
+//             params.put("table", table);
+//             params.put("shpfile", shpfile);
+//             return PythonExecute.RunGisHelper("sde2shp", params);
+//         }
+//     }
 }

+ 1 - 1
onemap-modules/onemap-analyse/src/main/resources/mapper/oracle/fzss/FzxzMapper.xml

@@ -51,7 +51,7 @@
         where t.bsm = #{bsm}
         order by t.cjsj desc
     </select>
-    <select id="GetOneByBsm" parameterType="java.lang.String" resultType="com.onemap.analyse.domain.FzxzTbEntityDTO">
+    <select id="GetOneByBsm" parameterType="java.lang.String" resultType="com.onemap.analyse.domain.FzxzGeomInfoDTO">
         select t.OBJECTID as "objectid",
         t.RWBSM as "rwbsm",
         t.YDYHFLDM as "ydyhfldm",