gushoubang 1 жил өмнө
parent
commit
e2a3385079

+ 4 - 113
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/domain/FzxzEntityDTO.java

@@ -1,6 +1,9 @@
 package com.onemap.analyse.domain;
 package com.onemap.analyse.domain;
 
 
-//辅助选址分析列表
+import lombok.Data;
+
+// 辅助选址分析列表
+@Data
 public class FzxzEntityDTO {
 public class FzxzEntityDTO {
     private String bsm;
     private String bsm;
     private String sjy;
     private String sjy;
@@ -16,116 +19,4 @@ public class FzxzEntityDTO {
     private Integer fwlx;
     private Integer fwlx;
     private String xzfw;
     private String xzfw;
     private String zip;
     private String zip;
-
-    public String getBsm() {
-        return bsm;
-    }
-
-    public void setBsm(String bsm) {
-        this.bsm = bsm;
-    }
-
-    public String getSjy() {
-        return sjy;
-    }
-
-    public void setSjy(String sjy) {
-        this.sjy = sjy;
-    }
-
-    public String getSjymc() {
-        return sjymc;
-    }
-
-    public void setSjymc(String sjymc) {
-        this.sjymc = sjymc;
-    }
-
-    public String getYdbsm() {
-        return ydbsm;
-    }
-
-    public void setYdbsm(String ydbsm) {
-        this.ydbsm = ydbsm;
-    }
-
-    public String getYdmc() {
-        return ydmc;
-    }
-
-    public void setYdmc(String ydmc) {
-        this.ydmc = ydmc;
-    }
-
-    public String getYdmjbegin() {
-        return ydmjbegin;
-    }
-
-    public void setYdmjbegin(String ydmjbegin) {
-        this.ydmjbegin = ydmjbegin;
-    }
-
-    public String getYdmjend() {
-        return ydmjend;
-    }
-
-    public void setYdmjend(String ydmjend) {
-        this.ydmjend = ydmjend;
-    }
-
-    public String getXmmc() {
-        return xmmc;
-    }
-
-    public void setXmmc(String xmmc) {
-        this.xmmc = xmmc;
-    }
-
-    public String getJsdw() {
-        return jsdw;
-    }
-
-    public void setJsdw(String jsdw) {
-        this.jsdw = jsdw;
-    }
-
-    public String getFxbg() {
-        return fxbg;
-    }
-
-    public void setFxbg(String fxbg) {
-        this.fxbg = fxbg;
-    }
-
-    public Integer getRwzt() {
-        return rwzt;
-    }
-
-    public void setRwzt(Integer rwzt) {
-        this.rwzt = rwzt;
-    }
-
-    public Integer getFwlx() {
-        return fwlx;
-    }
-
-    public void setFwlx(Integer fwlx) {
-        this.fwlx = fwlx;
-    }
-
-    public String getXzfw() {
-        return xzfw;
-    }
-
-    public void setXzfw(String xzfw) {
-        this.xzfw = xzfw;
-    }
-
-    public String getZip() {
-        return zip;
-    }
-
-    public void setZip(String zip) {
-        this.zip = zip;
-    }
 }
 }

+ 2 - 0
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/mapper/FzxzMapper.java

@@ -3,6 +3,7 @@ package com.onemap.analyse.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.onemap.analyse.domain.FzxzDTO;
 import com.onemap.analyse.domain.FzxzDTO;
 import com.onemap.analyse.domain.FzxzEntityDTO;
 import com.onemap.analyse.domain.FzxzEntityDTO;
+import com.onemap.common.datasource.annotation.Master;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
@@ -15,5 +16,6 @@ import java.util.List;
 public interface FzxzMapper extends BaseMapper<FzxzDTO> {
 public interface FzxzMapper extends BaseMapper<FzxzDTO> {
     List<FzxzEntityDTO> GetFzxzList(@Param("xmmc") String xmmc, @Param("kssj") String kssj, @Param("jssj") String jssj);
     List<FzxzEntityDTO> GetFzxzList(@Param("xmmc") String xmmc, @Param("kssj") String kssj, @Param("jssj") String jssj);
 
 
+    @Master
     FzxzEntityDTO GetFzxzByBsm(@Param("bsm") String bsm);
     FzxzEntityDTO GetFzxzByBsm(@Param("bsm") String bsm);
 }
 }

+ 1 - 2
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/mapper/base/FzxzResMapper.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.onemap.analyse.domain.FzxzResDTO;
 import com.onemap.analyse.domain.FzxzResDTO;
 
 
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 /**
 /**
  * 辅助选址结果
  * 辅助选址结果
@@ -12,5 +11,5 @@ import java.util.Map;
 public interface FzxzResMapper extends BaseMapper<FzxzResDTO> {
 public interface FzxzResMapper extends BaseMapper<FzxzResDTO> {
     void saveOne(FzxzResDTO fzxzResDTO);
     void saveOne(FzxzResDTO fzxzResDTO);
 
 
-   List<FzxzResDTO> getListByRwbsm(String rwbsm);
+    List<FzxzResDTO> getListByRwbsm(String rwbsm);
 }
 }

+ 9 - 0
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/IReportService.java

@@ -0,0 +1,9 @@
+package com.onemap.analyse.service;
+
+import com.onemap.analyse.domain.FzxzReport;
+
+import java.util.List;
+
+public interface IReportService {
+    FzxzReport createReport(String bsm, List<String> xzbsmList);
+}

+ 31 - 8
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/FzssServiceImpl.java

@@ -12,6 +12,7 @@ import com.onemap.analyse.mapper.base.FzxzResMapper;
 import com.onemap.analyse.mapper.base.ShpFileMapper;
 import com.onemap.analyse.mapper.base.ShpFileMapper;
 import com.onemap.analyse.mapper.vector.GhdkaMapper;
 import com.onemap.analyse.mapper.vector.GhdkaMapper;
 import com.onemap.analyse.service.IFzssService;
 import com.onemap.analyse.service.IFzssService;
+import com.onemap.analyse.service.IReportService;
 import com.onemap.analyse.task.FzxzSchedule;
 import com.onemap.analyse.task.FzxzSchedule;
 import com.onemap.analyse.utils.DozerUtils;
 import com.onemap.analyse.utils.DozerUtils;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.utils.StringUtils;
@@ -36,18 +37,12 @@ public class FzssServiceImpl implements IFzssService {
     private String temp;
     private String temp;
     // 任务状态标识码
     // 任务状态标识码
     private RwztDTO Rwzt = new RwztDTO();
     private RwztDTO Rwzt = new RwztDTO();
-    // shp入库的方法标识码
-    private String shpPyFun = "shp2sde";
-    // esrijson入库的方法标识码
-    private String esrijsonPyFun = "esriJson2sde";
     @Autowired
     @Autowired
     private HgxfxScxMapper hgxfxScxMapper;
     private HgxfxScxMapper hgxfxScxMapper;
     @Autowired
     @Autowired
     private HgxfxHgscxMapper hgxfxHgscxMapper;
     private HgxfxHgscxMapper hgxfxHgscxMapper;
     @Autowired
     @Autowired
     private HgxfxMapper hgxfxMapper;
     private HgxfxMapper hgxfxMapper;
-
-
     @Autowired
     @Autowired
     FzxzSchedule fzxzSchedule;
     FzxzSchedule fzxzSchedule;
 
 
@@ -69,6 +64,10 @@ public class FzssServiceImpl implements IFzssService {
     @Autowired
     @Autowired
     private FzxzXzyzMapper fzxzXzyzMapper;
     private FzxzXzyzMapper fzxzXzyzMapper;
 
 
+    // 报告服务
+    @Autowired
+    private IReportService iReportService;
+
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @Override
     @Override
     public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
     public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
@@ -104,6 +103,12 @@ public class FzssServiceImpl implements IFzssService {
         return RequestResult.success("保存成功!", requestHgxfxDTO.getBsm());
         return RequestResult.success("保存成功!", requestHgxfxDTO.getBsm());
     }
     }
 
 
+    /**
+     * 保存选址参数
+     *
+     * @param params
+     * @return
+     */
     @Override
     @Override
     @Master
     @Master
     public FzxzCalc saveScheduleParam(Map params) {
     public FzxzCalc saveScheduleParam(Map params) {
@@ -208,7 +213,7 @@ public class FzssServiceImpl implements IFzssService {
         }
         }
 
 
 
 
-        // 保存规划结果
+        // 4.保存规划结果
         Map<String, Object> resMap = new HashMap<>();
         Map<String, Object> resMap = new HashMap<>();
         resMap.put("dkIds", ids);
         resMap.put("dkIds", ids);
         resMap.put("rwbsm", fzxzDTO.getBsm());
         resMap.put("rwbsm", fzxzDTO.getBsm());
@@ -219,6 +224,12 @@ public class FzssServiceImpl implements IFzssService {
 
 
         // 保存成功日志
         // 保存成功日志
         saveLog(fzxzDTO.getBsm(), "辅助选址", "计算完成", "info");
         saveLog(fzxzDTO.getBsm(), "辅助选址", "计算完成", "info");
+
+        // 5.生成报告
+        // 保存生成报告日志
+        saveLog(fzxzDTO.getBsm(), "辅助选址", "开始生成选址报告", "info");
+        // 生成world文件
+        iReportService.createReport(fzxzDTO.getBsm(), null);
         return RequestResult.success(ids);
         return RequestResult.success(ids);
     }
     }
 
 
@@ -279,11 +290,16 @@ public class FzssServiceImpl implements IFzssService {
                 fzxzResDTO.setArea((Double) dkMap.get("ydmj"));
                 fzxzResDTO.setArea((Double) dkMap.get("ydmj"));
                 fzxzResDTO.setGeom((String) dkMap.get("geom"));
                 fzxzResDTO.setGeom((String) dkMap.get("geom"));
             }
             }
-
             fzxzResMapper.saveOne(fzxzResDTO);
             fzxzResMapper.saveOne(fzxzResDTO);
         }
         }
     }
     }
 
 
+    /**
+     * 获取选址结果
+     *
+     * @param bsm
+     * @return
+     */
     @Override
     @Override
     public RequestResult GetXzjg(String bsm) {
     public RequestResult GetXzjg(String bsm) {
         if (StringUtils.isEmpty(bsm)) {
         if (StringUtils.isEmpty(bsm)) {
@@ -311,6 +327,13 @@ public class FzssServiceImpl implements IFzssService {
         return RequestResult.success("查询成功!", result);
         return RequestResult.success("查询成功!", result);
     }
     }
 
 
+    /**
+     * 生成word文件
+     *
+     * @param bsm
+     * @param xzbsm
+     * @return
+     */
     @Override
     @Override
     public RequestResult saveWordFile(String bsm, ArrayList xzbsm) {
     public RequestResult saveWordFile(String bsm, ArrayList xzbsm) {
         FzxzReport fzxzReport = fzxzSchedule.createReport(bsm, xzbsm);
         FzxzReport fzxzReport = fzxzSchedule.createReport(bsm, xzbsm);

+ 740 - 0
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ReportServiceImpl.java

@@ -0,0 +1,740 @@
+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.FxrwrzMapper;
+import com.onemap.analyse.mapper.FzxzMapper;
+import com.onemap.analyse.mapper.FzxzTbMapper;
+import com.onemap.analyse.mapper.FzxzXzyzMapper;
+import com.onemap.analyse.mapper.base.FzxzResMapper;
+import com.onemap.analyse.service.IReportService;
+import com.onemap.analyse.task.PythonExecute;
+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;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.*;
+import java.math.BigInteger;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 生成报告
+ */
+@Service
+public class ReportServiceImpl implements IReportService {
+    @Autowired
+    private FzxzMapper fzxzMapper;
+    @Autowired
+    private FzxzResMapper fzxzResMapper;
+    @Autowired
+    private FxrwrzMapper fxrwrzMapper;
+    @Autowired
+    private FzxzTbMapper fzxzTbMapper;
+    @Resource
+    private FzxzXzyzMapper fzxzXzyzMapper;
+
+    @Value("${Hgxfx.temp}")
+    private String temp;
+    @Value("${Fzxz.fzxzShp}")
+    private String fzxzShp;
+
+    // 根据选址任务生成报告
+    public FzxzReport createReport(String bsm, List<String> xzbsmList) {
+        FzxzEntityDTO res = fzxzMapper.GetFzxzByBsm(bsm);
+        FzxzReport fzxzReport = new FzxzReport();
+        if (res != null) {
+            // 文件硬盘真实路径
+            String timeStamp = new Date().getTime() + "";
+            String rootPath = temp + File.separator + "辅助选址报告" + File.separator + res.getBsm();
+            File f = new File(rootPath);
+            if (!f.exists()) {
+                f.mkdirs();
+            }
+            String reportPath = res.getXmmc() + "(选址报告)_" + timeStamp + ".docx";
+            String simplePath = res.getXmmc() + "(选址简报)_" + timeStamp + ".docx";
+            String zipPath = res.getXmmc() + "_" + timeStamp + ".zip";
+            // 选址报告
+            createReport(res, rootPath + File.separator + reportPath, xzbsmList);
+            // 选址简报
+            createSimpleReport(res, rootPath + File.separator + simplePath, xzbsmList);
+            // zip打包
+            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));
+            fzxzReport.setSimplefile(StringUtils.getFileStaticPath(rootPath + File.separator + simplePath));
+            fzxzReport.setZipfile(StringUtils.getFileStaticPath(rootPath + File.separator + zipPath));
+            fzxzReport.setBsm(bsm);
+            fzxzReport.setFxbg(fzxzReport.getReportfile());
+            fzxzReport.setJsdw(res.getJsdw());
+            fzxzReport.setXmmc(res.getXmmc());
+            // 查询分析结果图斑信息
+            QueryWrapper<FzxzResDTO> giswrapper = new QueryWrapper<>();
+            giswrapper.eq("rwbsm", res.getBsm());
+            List<FzxzResDTO> gisinfo = fzxzResMapper.selectList(giswrapper);
+            fzxzReport.setItems(gisinfo);
+        }
+        // 插入开始生成报告日志
+        FxrwrzDTO successDto2 = new FxrwrzDTO();
+        successDto2.setRwbsm(bsm);
+        successDto2.setRwlx("辅助选址");
+        successDto2.setRzlr("选址报告生成结束");
+        successDto2.setRzlx("info");
+        successDto2.setRzsj(new Date());
+        fxrwrzMapper.insert(successDto2);
+        return fzxzReport;
+    }
+
+    /**
+     * 选址报告
+     *
+     * @param res
+     * @param reportPath
+     * @param xzbsmList  没有导出全部地块
+     */
+    private void createReport(FzxzEntityDTO res, String reportPath, List<String> xzbsmList) {
+        List<String> imgList = ReportImg(res, xzbsmList);
+        // 创建document文档对象对象实例
+        XWPFDocument document = null;
+        OutputStream outputStream = null;// 把doc输出到输出流
+        try {
+            document = new XWPFDocument();
+            int pos = 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++);
+            NpoiHelper.catalog(document, "一、项目选址信息", pos++);
+            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();
+            List<String> listTemp = new ArrayList<String>();
+            listTemp.add("\t项目名称:" + res.getXmmc());
+            listTemp.add("\t建设单位:" + res.getJsdw());
+            listTemp.add("\t用地面积:" + ydmj + "平方米");
+            listTemp.add("\t用地性质:" + res.getYdmc());
+            listTemp.add("\t影响因子:");
+            NpoiHelper.content(document, listTemp, pos++);
+            List tabYzTitles = new ArrayList<NpoiHelper.TableTitle>();
+            NpoiHelper.TableTitle tableTitle = new NpoiHelper.TableTitle();
+            tableTitle.setKey("YXYZMC");
+            tableTitle.setName("因子名称");
+            tableTitle.setWidth(2880);
+            tabYzTitles.add(tableTitle);
+            tableTitle = new NpoiHelper.TableTitle();
+            tableTitle.setKey("YZTJ_TEXT");
+            tableTitle.setName("影响条件");
+            tableTitle.setAlign(ParagraphAlignment.CENTER);
+            tableTitle.setWidth(2880);
+            tabYzTitles.add(tableTitle);
+            tableTitle = new NpoiHelper.TableTitle();
+            tableTitle.setKey("YXZ");
+            tableTitle.setName("约束范围值(M)");
+            tableTitle.setAlign(ParagraphAlignment.CENTER);
+            tableTitle.setWidth(2880);
+            tabYzTitles.add(tableTitle);
+            // 查询选址因子,并且转换为List<Map> 因子条件(包含:C、不包含:N、分析:A)
+            QueryWrapper<FzxzXzyzDTO> wrapper = new QueryWrapper<FzxzXzyzDTO>();
+            wrapper.eq("rwbsm", res.getBsm());
+            List<FzxzXzyzDTO> fzxzXzyzDTOList = fzxzXzyzMapper.selectList(wrapper);
+            List<Map<String, Object>> dataTablelist = new ArrayList<>();
+            for (int i = 0; i < fzxzXzyzDTOList.size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                FzxzXzyzDTO fzxzXzyzDTO = fzxzXzyzDTOList.get(i);
+                map.put("YXYZMC", fzxzXzyzDTO.getYxyzmc());
+                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 = "分析";
+                //     }
+                // }
+
+                map.put("YZTJ_TEXT", yztj);
+                Float yxz = (float) 0;
+                if (fzxzXzyzDTO.getYxz() != null) {
+                    yxz = fzxzXzyzDTO.getYxz();
+                }
+                map.put("YXZ", yxz);
+                dataTablelist.add(map);
+            }
+            XWPFTable tableYz = NpoiHelper.setComTable(document, tabYzTitles, dataTablelist, "表1:选址影响因子", pos++);
+            NpoiHelper.catalog(document, "二、选址范围分析", pos++);
+            // 查询辅助选址分析图斑
+            QueryWrapper<FzxzTbEntityDTO> wrapperTb = new QueryWrapper<FzxzTbEntityDTO>();
+            wrapperTb.eq("rwbsm", res.getBsm());
+            wrapperTb.groupBy("objectid", "rwbsm", "ydyhfldm", "ydyhflmc", "frequency", "sum_mj");
+            List<FzxzTbEntityDTO> fzxzTbEntityDTOList = fzxzTbMapper.selectList(wrapperTb);
+            // 计算面积总和
+            double sumcount = 0;
+            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());
+            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);
+            }
+            fwfx = fwfx.substring(0, fwfx.length() - 1) + "。详情如下:";
+            NpoiHelper.content(document, fwfx, pos++);
+            // 地类编码	地类名称	面积(平方千米)	占比(%)
+            List<NpoiHelper.TableTitle> tabYztbTitles = new ArrayList();
+            NpoiHelper.TableTitle tableTitleTb = new NpoiHelper.TableTitle();
+            tableTitleTb.setKey("YDYHFLDM");
+            tableTitleTb.setName("地类编码");
+            tableTitleTb.setAlign(ParagraphAlignment.CENTER);
+            tableTitleTb.setWidth(2010);
+            tabYztbTitles.add(tableTitleTb);
+            tableTitleTb = new NpoiHelper.TableTitle();
+            tableTitleTb.setKey("YDYHFLMC");
+            tableTitleTb.setName("地类名称");
+            tableTitleTb.setWidth(2910);
+            tabYztbTitles.add(tableTitleTb);
+            tableTitleTb = new NpoiHelper.TableTitle();
+            tableTitleTb.setKey("SUM_MJ");
+            tableTitleTb.setName("面积(平方千米)");
+            tableTitleTb.setAlign(ParagraphAlignment.CENTER);
+            tableTitleTb.setWidth(1870);
+            tabYztbTitles.add(tableTitleTb);
+            tableTitleTb = new NpoiHelper.TableTitle();
+            tableTitleTb.setKey("ZB");
+            tableTitleTb.setName("占比(%)");
+            tableTitleTb.setAlign(ParagraphAlignment.CENTER);
+            tableTitleTb.setWidth(1700);
+            tabYztbTitles.add(tableTitleTb);
+            XWPFTable tableYztb = NpoiHelper.setComTable(document, tabYztbTitles, fztable, "表2:地类分析统计表", pos++);
+            // 查询结果
+            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);
+            NpoiHelper.catalog(document, "三、选址分析", pos++);
+            String ydmc = res.getYdmc();
+            if (!StringUtils.isEmpty(ydmc)) {
+                if (ydmc.lastIndexOf("用地") == ydmc.length() - 2) {
+                    ydmc = res.getYdmc().substring(0, ydmc.length() - 2);
+                }
+                NpoiHelper.content(document, "\t按照项目选址要求和影响因子,经对所选范围内的所有" + ydmc + "用地进行分析,筛选出符合要求的方案共" + fzxzJgGisDTOList.size() + "个。", pos++);
+            } else {
+                NpoiHelper.content(document, "\t按照项目选址要求和影响因子,经对所选范围内的所有用地进行分析,筛选出符合要求的方案共" + fzxzJgGisDTOList.size() + "个。", pos++);
+            }
+
+            int index = 1;
+            NpoiHelper.Option optionIsBold = new NpoiHelper.Option();
+            optionIsBold.setBold(true);
+            for (int i = 0; i < fzxzJgGisDTOList.size(); i++) {
+                FzxzResDTO item = fzxzJgGisDTOList.get(i);
+                document.setParagraph(NpoiHelper.newParagraph(document, index + "、方案" + NumberUtil.int2chineseNum(index), optionIsBold), pos++);
+                XWPFTable table = document.createTable(7, 4);
+                table.setWidth(9000);// 总宽度
+                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(2250));
+                    ctTblWidth.setType(STTblWidth.DXA);
+                }
+                // Table 表格第一行
+                table.getRow(0).getCell(0).setColor("DBE5F1");
+                NpoiHelper.mergeHorizontal(table, 0, 0, 3);
+                table.getRow(0).getCell(0).setParagraph(NpoiHelper.setCellText(table, "符合用地情况", optionIsBold));
+                // Table 表格第二行
+                table.getRow(1).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地类编码", optionIsBold));
+                // table.getRow(1).getCell(1).setParagraph(NpoiHelper.setCellText(table, item.getDlbm(), null));
+                table.getRow(1).getCell(2).setParagraph(NpoiHelper.setCellText(table, "地类名称", optionIsBold));
+                // table.getRow(1).getCell(3).setParagraph(NpoiHelper.setCellText(table, item.getDlmc(), null));
+                // Table 表格第三行
+                table.getRow(2).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地块面积", optionIsBold));
+                // table.getRow(2).getCell(1).setParagraph(NpoiHelper.setCellText(table, Math.round(item.getTbmj()) + "平方米", null));
+                table.getRow(2).getCell(2).setParagraph(NpoiHelper.setCellText(table, "土地位置", optionIsBold));
+                // table.getRow(2).getCell(3).setParagraph(NpoiHelper.setCellText(table, item.getXzqmc(), null));
+                // Table 表格第四行
+                table.getRow(3).getCell(0).setColor("DBE5F1");
+                NpoiHelper.mergeHorizontal(table, 3, 0, 3);
+                table.getRow(3).getCell(0).setParagraph(NpoiHelper.setCellText(table, "地块位置信息", optionIsBold));
+                // Table 表格第五行 -专题图
+                NpoiHelper.mergeHorizontal(table, 4, 0, 1);
+                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;// 局部
+                        }
+                    }
+                }
+                if (StringUtils.isNotEmpty(mapF)) {
+                    FileInputStream fis = null;
+                    try {
+                        fis = new FileInputStream(new File(mapF));
+                        XWPFParagraph paragraph = table.getRow(4).getCell(0).addParagraph();
+                        paragraph.setAlignment(ParagraphAlignment.CENTER);
+                        XWPFRun run = paragraph.createRun();
+                        run.addPicture(fis,    // 条形码图片的位置
+                                Document.PICTURE_TYPE_JPEG, // 图片类型
+                                item.getBsm() + "_F.jpeg", // 图片名称
+                                2200000, // 图片的长
+                                1700000 // 图片的宽
+                        );
+                        run.addBreak(BreakType.TEXT_WRAPPING);
+                        run.setText("(宏观位置)");
+                    } catch (Exception e) {
+                        System.out.println(e.toString());
+                    } finally {
+                        if (fis != null) {
+                            try {
+                                fis.close();
+                            } catch (IOException e) {
+                                throw e;
+                            }
+                        }
+                    }
+                }
+                if (StringUtils.isNotEmpty(mapM)) {
+                    FileInputStream fis = null;
+                    try {
+                        fis = new FileInputStream(new File(mapM));
+                        XWPFParagraph paragraph = table.getRow(4).getCell(2).addParagraph();
+                        paragraph.setAlignment(ParagraphAlignment.CENTER);
+                        XWPFRun run = paragraph.createRun();
+                        run.addPicture(fis,    // 条形码图片的位置
+                                Document.PICTURE_TYPE_JPEG, // 图片类型
+                                item.getBsm() + "_M.jpeg", // 图片名称
+                                2200000, // 图片的长
+                                1700000 // 图片的宽
+                        );
+                        run.addBreak(BreakType.TEXT_WRAPPING);
+                        run.setText("(具体位置)");
+                    } catch (Exception e) {
+                        System.out.println(e.toString());
+                        throw e;
+                    } finally {
+                        if (fis != null) {
+                            try {
+                                fis.close();
+                            } catch (IOException e) {
+                                throw e;
+                            }
+                        }
+                    }
+                }
+                // Table 表格第六行
+                table.getRow(5).getCell(0).setColor("DBE5F1");
+                NpoiHelper.mergeHorizontal(table, 5, 0, 3);
+                table.getRow(5).getCell(0).setParagraph(NpoiHelper.setCellText(table, "分析结论", optionIsBold));
+                // Table 表格第七行
+                NpoiHelper.mergeHorizontal(table, 6, 0, 3);
+                XWPFParagraph para6 = table.getRow(6).getCell(0).addParagraph();
+                para6.setAlignment(ParagraphAlignment.LEFT);
+
+                // 查询辅助选址因子
+                // QueryWrapper<FzxzResDTO> jgyzWrapper = new QueryWrapper<>();
+                // jgyzWrapper.eq("jbbsm", item.getBsm());
+                // jgyzWrapper.ne("yztj", "F");
+                // List<FzxzXzyzDTO> jgyzList = fzxzJgyzMapper.selectList(jgyzWrapper);
+
+                int jgyzid = 1;
+                for (int j = 0; j < fzxzXzyzDTOList.size(); j++) {
+                    FzxzXzyzDTO fzxzJgyzDTO = fzxzXzyzDTOList.get(j);
+                    XWPFRun run = para6.createRun();
+                    // TODO
+                    // run.setText(jgyzid + "、" + fzxzJgyzDTO.getFxjg());
+                    run.addBreak(BreakType.TEXT_WRAPPING);
+                    jgyzid++;
+                }
+                // 查询辅助选址因子
+                // jgyzWrapper = new QueryWrapper<FzxzJgyzDTO>();
+                // jgyzWrapper.eq("jbbsm", item.getBsm());
+                // jgyzWrapper.eq("yztj", "F");
+                // jgyzList = fzxzJgyzMapper.selectList(jgyzWrapper);
+
+                for (int j = 0; j < fzxzXzyzDTOList.size(); j++) {
+                    FzxzXzyzDTO jgyz = fzxzXzyzDTOList.get(j);
+                    XWPFRun run = para6.createRun();
+                    // String jg = jgyz.getFxjg();
+                    // TODO
+                    String jg = "";
+                    Double jgDouble = 0.0;
+                    try {
+                        // jgDouble = Double.parseDouble(jg);
+                        // TODO
+                        run.setText(jgyzid + "、压占" + jgyz.getYxyzmc() + "面积" + jg + "平方米");
+                    } catch (Exception e) {
+                        run.setText(jg);
+                    }
+                    run.addBreak(BreakType.TEXT_WRAPPING);
+                    jgyzid++;
+                }
+                index++;
+            }
+            File fileDoc = new File(reportPath);
+            if (fileDoc.exists()) {
+                FileUtils.forceDelete(fileDoc);
+            }
+            // word文件输出流
+            outputStream = new FileOutputStream(reportPath);
+            document.write(outputStream);
+        } catch (Exception e) {
+            e.printStackTrace();
+            // 插入任务日志
+            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);
+    }
+
+    /**
+     * 选址简报
+     */
+    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);
+            }
+        }
+    }
+
+    /**
+     * TODO 待定
+     * 导出报告图片
+     *
+     * @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);
+        List<String> result = new ArrayList<>();
+        return result;
+    }
+}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 395 - 402
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/task/FzxzSchedule.java


+ 0 - 2
onemap-modules/onemap-analyse/src/main/resources/mapper/oracle/base/FzxzResMapper.xml

@@ -2,7 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
 
 <mapper namespace="com.onemap.analyse.mapper.base.FzxzResMapper">
 <mapper namespace="com.onemap.analyse.mapper.base.FzxzResMapper">
-
     <resultMap type="com.onemap.analyse.domain.FzxzResDTO" id="fzxzResMap">
     <resultMap type="com.onemap.analyse.domain.FzxzResDTO" id="fzxzResMap">
 
 
     </resultMap>
     </resultMap>
@@ -22,6 +21,5 @@
            dkid
            dkid
     FROM t_fzss_fzxz_res
     FROM t_fzss_fzxz_res
     WHERE rwbsm = #{rwbsm}
     WHERE rwbsm = #{rwbsm}
-
 </select>
 </select>
 </mapper>
 </mapper>

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

@@ -32,21 +32,26 @@
         order by t.cjsj desc
         order by t.cjsj desc
     </select>
     </select>
     <select id="GetFzxzByBsm" parameterType="java.lang.String" resultType="com.onemap.analyse.domain.FzxzEntityDTO">
     <select id="GetFzxzByBsm" parameterType="java.lang.String" resultType="com.onemap.analyse.domain.FzxzEntityDTO">
-        select t.bsm as "bsm",
-        t.sjy as "sjy",
-        sjy.sjymc "sjymc",
-        t.fwlx as "fwlx",
-        t.ydxz_bsm as "ydbsm",
-        (select dict.mc from t_fzss_fzxz_dict dict where dict.dm = t.ydxz_bsm and dict.fzbs = sjy.fzbs) as "ydmc",
-        t.ydmjbegin as "ydmjbegin",
-        t.ydmjend as "ydmjend",
-        t.xmmc as "xmmc",
-        t.jsdw as "jsdw",
-        t.fxbg as "fxbg",
-        t.rwzt as "rwzt",
-        t.xzfw as "xzfw",
-        t.zip as "zip" from t_fzss_fzxz t left join t_fzss_fzxz_sjy sjy on sjy.bsm = t.sjy
-        where  t.bsm = #{bsm}
+        select t.bsm                        as "bsm",
+               t.sjy                        as "sjy",
+               sjy.sjymc                       "sjymc",
+--                t.fwlx                       as "fwlx",
+               t.ydxz_bsm                   as "ydbsm",
+               (select dict.mc
+                from t_fzss_fzxz_dict dict
+                where dict.dm = t.ydxz_bsm
+                  and dict.fzbs = sjy.fzbs) as "ydmc",
+               t.ydmjbegin                  as "ydmjbegin",
+               t.ydmjend                    as "ydmjend",
+               t.xmmc                       as "xmmc",
+               t.jsdw                       as "jsdw",
+               t.fxbg                       as "fxbg",
+               t.rwzt                       as "rwzt"
+--                t.xzfw                       as "xzfw",
+--                t.zip                        as "zip"
+        from t_fzss_fzxz t
+                 left join t_fzss_fzxz_sjy sjy on sjy.bsm = t.sjy
+        where t.bsm = #{bsm}
         order by t.cjsj desc
         order by t.cjsj desc
     </select>
     </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.FzxzTbEntityDTO">

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно