소스 검색

结果列表字段调整

gushoubang 1 년 전
부모
커밋
b493368a81

+ 2 - 2
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/FzssController.java

@@ -82,7 +82,7 @@ public class FzssController extends BaseController {
     public RequestResult SaveWordFile(@RequestBody Map params) {
         String bsm = (String) params.get("bsm");
         ArrayList xzbsm = (ArrayList) params.get("xzbsm");
-        RequestResult res = fzssService.saveWordFile(bsm, xzbsm);
-        return res;
+        // RequestResult res = fzssService.saveWordFile(bsm, xzbsm);
+        return null;
     }
 }

+ 2 - 1
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/domain/res/FzxzResultDTO.java

@@ -18,7 +18,8 @@ public class FzxzResultDTO {
     private String bsm;
     private String xmmc;
     private String xmlx;
-    private String jsdw;
+    private Integer rwzt;// 任务状态(0创建 1执行中 2完成 3错误)
+    private String jsdw;// 建设单位
     private String fxbg;// 分析报告地址
     private String geom;
 

+ 1 - 2
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/IFzssService.java

@@ -5,7 +5,6 @@ import com.onemap.analyse.domain.calculation.FzxzCalc;
 import com.onemap.common.core.web.domain.RequestResult;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Map;
 
 public interface IFzssService {
@@ -21,5 +20,5 @@ public interface IFzssService {
 
     RequestResult GetXzResList(String startTime, String endTime, String name, Integer pageNum, Integer pageSize);
 
-    RequestResult saveWordFile(String bsm, ArrayList xzbsm);
+    // RequestResult saveWordFile(String bsm, ArrayList xzbsm);
 }

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

@@ -43,8 +43,8 @@ public class FzssServiceImpl implements IFzssService {
     private HgxfxHgscxMapper hgxfxHgscxMapper;
     @Autowired
     private HgxfxMapper hgxfxMapper;
-    @Autowired
-    FzxzSchedule fzxzSchedule;
+    // @Autowired
+    // FzxzSchedule fzxzSchedule;
 
     //**后写逻辑**//
     @Autowired
@@ -421,16 +421,16 @@ public class FzssServiceImpl implements IFzssService {
         return RequestResult.success("查询成功!", resMap);
     }
 
-    /**
-     * 生成word文件
-     *
-     * @param bsm
-     * @param xzbsm
-     * @return
-     */
-    @Override
-    public RequestResult saveWordFile(String bsm, ArrayList xzbsm) {
-        FzxzReport fzxzReport = fzxzSchedule.createReport(bsm, xzbsm);
-        return RequestResult.success(fzxzReport);
-    }
+    // /**
+    //  * 生成word文件
+    //  *
+    //  * @param bsm
+    //  * @param xzbsm
+    //  * @return
+    //  */
+    // @Override
+    // public RequestResult saveWordFile(String bsm, ArrayList xzbsm) {
+    //     // FzxzReport fzxzReport = fzxzSchedule.createReport(bsm, xzbsm);
+    //     return RequestResult.success(fzxzReport);
+    // }
 }

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

@@ -147,51 +147,51 @@ public class FzxzSchedule {
     // }
 
     // 根据选址任务生成报告
-    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;
-    }
+    // 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;
+    // }
 
     /**
      * 选址报告
@@ -200,352 +200,352 @@ public class FzxzSchedule {
      * @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 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);
+//     }
 
     /**
      * 选址简报

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

@@ -73,10 +73,10 @@
             and xmmc like '%'||#{xmmc}||'%'
         </if>
         <if test="startTime != null and startTime != ''">
-            and cjsj &gt;= TO_TIMESTAMP(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
+            and cjsj &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD')
         </if>
         <if test="endTime != null and endTime != ''">
-            and cjsj &lt;= TO_TIMESTAMP(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
+            and cjsj &lt;= TO_DATE(#{endTime}, 'YYYY-MM-DD')+ INTERVAL '1 day'
         </if>
         order by cjsj desc
         LIMIT #{limit} OFFSET #{offset}