Преглед изворни кода

Merge branch 'dev' into f-xiaogu

gushoubang пре 9 месеци
родитељ
комит
f20a6a9670

+ 1 - 1
onemap-modules/onemap-analyse/src/main/resources/bootstrap.yml

@@ -20,7 +20,7 @@ spring:
       discovery:
         namespace: model
         # 服务注册地址
-        server-addr: 127.0.0.1:8848
+        server-addr: 192.168.100.30:8848
       config:
         namespace: model
         # 配置中心地址

+ 9 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/config/fzss/HgxfxScxDTO.java

@@ -7,6 +7,7 @@ public class HgxfxScxDTO {
     private String bsm;
     private String bsmmc;
     private String pbsm;
+    private String parameter;
     private Integer kzxjb;
     private Integer xssx;
     private Integer status;
@@ -58,4 +59,12 @@ public class HgxfxScxDTO {
     public void setStatus(Integer status) {
         this.status = status;
     }
+
+    public String getParameter() {
+        return parameter;
+    }
+
+    public void setParameter(String parameter) {
+        this.parameter = parameter;
+    }
 }

+ 9 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/config/fzss/HgxfxScxRwDTO.java

@@ -14,6 +14,7 @@ public class HgxfxScxRwDTO {
     private String scxbsm;
     @TableField(exist = false)
     private String scxname;
+    private String parameter;
     private Date rwkssj;
     private Date rwjssj;
 
@@ -57,6 +58,14 @@ public class HgxfxScxRwDTO {
         this.rwjssj = rwjssj;
     }
 
+    public String getParameter() {
+        return parameter;
+    }
+
+    public void setParameter(String parameter) {
+        this.parameter = parameter;
+    }
+
     public String getScxname() {
         return scxname;
     }

+ 4 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fzss/HgxfxScxTableMapper.java

@@ -2,6 +2,9 @@ package com.onemap.apply.mapper.fzss;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.onemap.apply.domain.config.fzss.HgxfxScxTableDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 数据层
@@ -9,4 +12,5 @@ import com.onemap.apply.domain.config.fzss.HgxfxScxTableDTO;
  * @author onemap
  */
 public interface HgxfxScxTableMapper extends BaseMapper<HgxfxScxTableDTO> {
+    List<HgxfxScxTableDTO> selectListByBsm(@Param("bsm") String bsm);
 }

+ 6 - 4
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/analyse/impl/HttpAnalyseServiceImpl.java

@@ -4,10 +4,7 @@ import com.onemap.apply.service.analyse.HttpAnalyseService;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.domain.RequestResult;
 import com.onemap.system.api.AnalyseService;
-import com.onemap.system.api.domain.IntersectionTableWktVo;
-import com.onemap.system.api.domain.IntersectsTableWktVo;
-import com.onemap.system.api.domain.RawTableVo;
-import com.onemap.system.api.domain.TargetTableVo;
+import com.onemap.system.api.domain.*;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -24,7 +21,12 @@ public class HttpAnalyseServiceImpl implements HttpAnalyseService {
         RequestResult result = new RequestResult();
         if (objectVo instanceof IntersectsTableWktVo) {
             result = analyseService.rawTable((RawTableVo) objectVo);
+        } else if (objectVo instanceof DistanceTableWktVo) {
+            result = analyseService.distanceTableWkt((DistanceTableWktVo) objectVo);
+        } else if (objectVo instanceof RawTableLengthVo) {
+            result = analyseService.rawTableLength((RawTableLengthVo) objectVo);
         }
+
         if (StringUtils.isNull(result)) {
             return null;
         }

+ 120 - 33
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fzss/hgxfxjg/HgxfxHandleService.java

@@ -1,35 +1,44 @@
 package com.onemap.apply.service.impl.fzss.hgxfxjg;
 
+import com.alibaba.nacos.shaded.com.google.gson.Gson;
+import com.alibaba.nacos.shaded.com.google.gson.JsonElement;
+import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.onemap.apply.domain.config.fzss.*;
+import com.onemap.apply.domain.table.TableDataVo;
 import com.onemap.apply.mapper.fzss.*;
+import com.onemap.apply.service.analyse.HttpAnalyseService;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.domain.RequestResult;
 import com.onemap.system.api.AnalyseService;
+import com.onemap.system.api.domain.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.*;
 
 @Service
 public class HgxfxHandleService {
-    @Autowired
+    @Resource
     private HgxfxMapper hgxfxMapper;
-    @Autowired
+    @Resource
     private HgxfxScxMapper hgxfxScxMapper;
-    @Autowired
+    @Resource
     private HgxfxScxRwMapper hgxfxScxRwMapper;
-    @Autowired
+    @Resource
     private HgxfxRwJgMapper hgxfxRwJgMapper;
-    @Autowired
+    @Resource
     private HgxfxScxTableMapper hgxfxScxTableMapper;
-    @Autowired
+    @Resource
     private HgxfxScxSortationMapper hgxfxScxSortationMapper;
-    @Autowired
+    @Resource
     private AnalyseService analyseService;
-    @Autowired
+    @Resource
     private FxrwrzMapper fxrwrzMapper;
+    @Autowired
+    private HttpAnalyseService httpAnalyseService;
 
     public void hgxfxHandle(String bsm, String ewkt) {
         System.out.println("进入hgxfxHandle.....................");
@@ -60,7 +69,7 @@ public class HgxfxHandleService {
     }
 
 
-    private void getHgxfxScx(String rwbsm, String ewkt, String scxPBsm) {
+    private int getHgxfxScx(String rwbsm, String ewkt, String scxPBsm) {
         if (StringUtils.isEmpty(scxPBsm)) {
             scxPBsm = "0";
         }
@@ -69,20 +78,48 @@ public class HgxfxHandleService {
             String bsm = v01_scx.getBsm();
             String scxbsm = v01_scx.getScxbsm();
             String scxName = v01_scx.getScxname();
+            String scxParameter = v01_scx.getParameter();
+            Gson gson = new Gson();
+            JsonObject jsonObject = null;
+            if (StringUtils.isNotEmpty(scxParameter)) {
+                jsonObject = gson.fromJson(scxParameter, JsonObject.class);
+            }
             // 任务开始时间
             Date kssj = new Date();
-            QueryWrapper<HgxfxScxTableDTO> v1_select = new QueryWrapper<HgxfxScxTableDTO>();
-            v1_select.eq("bsm", v01_scx.getScxbsm());
-            List<HgxfxScxTableDTO> data_table_list = hgxfxScxTableMapper.selectList(v1_select);
+            List<HgxfxScxTableDTO> data_table_list = hgxfxScxTableMapper.selectListByBsm(v01_scx.getScxbsm());
             for (HgxfxScxTableDTO v_dataTable : data_table_list) {
-                List<String> idsList = getHgxfxScxJgIntersects(bsm, rwbsm, scxbsm, ewkt, v_dataTable);
-                List<Map> dataList = getHgxfxScxJgIntersection(bsm, rwbsm, scxbsm, ewkt, idsList, v_dataTable);
+
+                JsonElement fildObject = jsonObject.get("find");
+                if (fildObject.isJsonNull()) {
+                    return 3;
+                }
+                String fildString = fildObject.getAsString();
+                if (StringUtils.isEmpty(fildString)) {
+                    return 3;
+                }
+                List<Map> dataList = new ArrayList<>();
+                if ("intersection".equals(fildString)) {
+                    //先获取交集
+                    List<String> idsList = getHgxfxScxJgIntersects(bsm, rwbsm, scxbsm, ewkt, v_dataTable);
+                    dataList = getHgxfxScxJgIntersection(bsm, rwbsm, scxbsm, ewkt, idsList, v_dataTable);
+                } else if ("distance".equals(fildString)) {
+                    JsonElement findValueObject = jsonObject.get("findvalue");
+                    if (findValueObject.isJsonNull()) {
+                        return 3;
+                    }
+                    int d_FindValue = findValueObject.getAsInt();
+                    if (d_FindValue <= 0) {
+                        return 3;
+                    }
+                    dataList = getHgxfxScxJgDistance(bsm, rwbsm, scxbsm, ewkt, null, v_dataTable, d_FindValue);
+                }
                 insertHgxfxScxJgIntersection(bsm, rwbsm, scxbsm, dataList, v_dataTable);
             }
             getHgxfxScx(rwbsm, ewkt, v01_scx.getScxbsm());
             // 任务开始时间
             insertFxrwrz(bsm, rwbsm, scxName, null);
         }
+        return 0;
     }
 
     private void insertFxrwrz(String bsm, String rwbsm, String scxName, String rznr) {
@@ -101,22 +138,49 @@ public class HgxfxHandleService {
     }
 
     private List<String> getHgxfxScxJgIntersects(String bsm, String rwbsm, String scxbsm, String ewkt, HgxfxScxTableDTO dataTable) {
+        IntersectsTableWktVo analyseUtilsVo = new IntersectsTableWktVo();
+        analyseUtilsVo.setTableName(dataTable.getSjy());
+        analyseUtilsVo.setEwkt(ewkt);
+        return httpAnalyseService.intersectsTableWkt(analyseUtilsVo);
+    }
+
+    private List<Map> getHgxfxScxJgDistance(String bsm, String rwbsm, String scxbsm, String ewkt, List<String> idsList, HgxfxScxTableDTO dataTable, int findValue) {
+        List<Map> retList = new ArrayList<Map>();
         String v_sjy = dataTable.getSjy();
         Integer v_sjy_srid = dataTable.getSjySrid();
         Integer v_analyse_srid = dataTable.getAnalyseSrid();
-        RequestResult result = analyseService.intersectsTableWkt(v_sjy, v_sjy_srid, null, ewkt, v_analyse_srid);
-        Integer statuscode = (Integer) result.get("statuscode");
-        if (statuscode == 200) {
-            Object resultDataObject = result.get("data");
-            if (StringUtils.isNotNull(resultDataObject)) {
-                List<String> idsList = (List<String>) resultDataObject;
-                return idsList;
-            }
+        List<String> outputColumn = null;
+        if (StringUtils.isNotEmpty(dataTable.getAnalyseTjzd())) {
+            outputColumn = Arrays.asList(dataTable.getAnalyseTjzd().split(","));
+        }
+
+        DistanceTableWktVo distanceTableWktVo = new DistanceTableWktVo();
+        distanceTableWktVo.setEwkt(ewkt);
+        distanceTableWktVo.setTableIds(idsList);
+        distanceTableWktVo.setTableName(v_sjy);
+        distanceTableWktVo.setDistanceType(4);
+        distanceTableWktVo.setDistance(findValue);
+        Object from_kj_data = httpAnalyseService.getHttpAnalyse(distanceTableWktVo);
+        if (StringUtils.isNull(from_kj_data)) {
+            return retList;
+        }
+        List<String> fromkjdataList = (List<String>) from_kj_data;
+
+        RawTableLengthVo rawTableLengthVo = new RawTableLengthVo();
+        rawTableLengthVo.setRawTableName(v_sjy);
+        rawTableLengthVo.setIds(fromkjdataList);
+        rawTableLengthVo.setColumns(outputColumn);
+        rawTableLengthVo.setSiweiLength(true);
+        rawTableLengthVo.setEwkt(ewkt);
+        Object newRetList = httpAnalyseService.getHttpAnalyse(rawTableLengthVo);
+        if (newRetList == null) {
+            return retList;
         }
-        return null;
+        return (List<Map>) newRetList;
     }
 
     private List<Map> getHgxfxScxJgIntersection(String bsm, String rwbsm, String scxbsm, String ewkt, List<String> idsList, HgxfxScxTableDTO dataTable) {
+        List<Map> retList = new ArrayList<Map>();
         if (StringUtils.isNotEmpty(idsList)) {
             String v_sjy = dataTable.getSjy();
             Integer v_sjy_srid = dataTable.getSjySrid();
@@ -125,17 +189,31 @@ public class HgxfxHandleService {
             if (StringUtils.isNotEmpty(dataTable.getAnalyseTjzd())) {
                 outputColumn = Arrays.asList(dataTable.getAnalyseTjzd().split(","));
             }
-            RequestResult result = analyseService.intersectionTableWkt(v_sjy, v_sjy_srid, idsList, ewkt, v_analyse_srid, outputColumn);
-            Integer statuscode = (Integer) result.get("statuscode");
-            if (statuscode == 200) {
-                Object resultDataObject = result.get("data");
-                if (StringUtils.isNotNull(resultDataObject)) {
-                    List<Map> resultList = (List<Map>) resultDataObject;
-                    return resultList;
-                }
+
+            IntersectionTableWktVo intersectionTableWktVo = new IntersectionTableWktVo();
+            intersectionTableWktVo.setEwkt(ewkt);
+            intersectionTableWktVo.setTableIds(idsList);
+            intersectionTableWktVo.setTableName(v_sjy);
+            String from_kj_data = httpAnalyseService.intersectionTableWkt(intersectionTableWktVo);
+            if (StringUtils.isEmpty(from_kj_data)) {
+                return retList;
+            }
+
+            TargetTableVo targetTableVo = new TargetTableVo();
+            targetTableVo.setTargetTableName(from_kj_data);
+            targetTableVo.setColumns(outputColumn);
+            targetTableVo.setRawTableName(v_sjy);
+            targetTableVo.setIsGeography(false);
+            targetTableVo.setSiweiArea(true);
+            targetTableVo.setSrid(v_analyse_srid);
+            List<Map> newRetList = httpAnalyseService.targetTable(targetTableVo);
+            if (newRetList == null || newRetList.size() <= 0) {
+                return retList;
             }
+            return newRetList;
         }
-        return null;
+        ;
+        return retList;
     }
 
     private void insertHgxfxScxJgIntersection(String bsm, String rwbsm, String scxbsm, List<Map> dataList, HgxfxScxTableDTO dataTable) {
@@ -145,13 +223,22 @@ public class HgxfxHandleService {
                 outputColumn = Arrays.asList(dataTable.getAnalyseTjzd().split(","));
             }
             for (Map<String, Object> v_data : dataList) {
+                Object siweiarea = v_data.get("siweiarea");
+                Object siweilength = v_data.get("siweilength");
+                Double mj = null;
+                if (StringUtils.isNotNull(siweiarea)) {
+                    mj = Double.parseDouble(siweiarea.toString());
+                }
+                if (StringUtils.isNotNull(siweilength)) {
+                    mj = Double.parseDouble(siweilength.toString());
+                }
                 HgxfxRwJgDTO dtoRk = new HgxfxRwJgDTO();
                 dtoRk.setBsm(bsm);
                 dtoRk.setRwbsm(rwbsm);
                 dtoRk.setScxbsm(scxbsm);
                 dtoRk.setYslx(outputColumn.size() > 0 ? v_data.get(outputColumn.get(0).toString()).toString() : null);
                 dtoRk.setYslxmc(outputColumn.size() > 1 ? v_data.get(outputColumn.get(1).toString()).toString() : null);
-                dtoRk.setMj(Double.parseDouble(v_data.get("geom_area").toString()));
+                dtoRk.setMj(mj);
                 dtoRk.setGeom(v_data.get("geom").toString());
                 hgxfxRwJgMapper.insert(dtoRk);
             }

+ 2 - 2
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/table/TableDataSelectServiceImpl.java

@@ -162,7 +162,7 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
         rawTableVo.setRawTableName(tableName);
         rawTableVo.setSrid(SRID);
         rawTableVo.setIds(from_kj_ids);
-        rawTableVo.setsIsGeography(false);
+        rawTableVo.setIsGeography(false);
         rawTableVo.setColumns(outputColumn);
         List<Map> retDataList = httpAnalyseService.rawTable(rawTableVo);
         if (retDataList == null || retDataList.size() <= 0) {
@@ -201,7 +201,7 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
         targetTableVo.setTargetTableName(from_kj_data);
         targetTableVo.setColumns(outputColumn);
         targetTableVo.setRawTableName(tableName);
-        targetTableVo.setsIsGeography(false);
+        targetTableVo.setIsGeography(false);
         targetTableVo.setSrid(SRID);
         List<Map> from_jg = httpAnalyseService.targetTable(targetTableVo);
         if (from_jg == null || from_jg.size() <= 0) {

+ 1 - 1
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/fzss/HgxfxMapper.xml

@@ -38,7 +38,7 @@
 
     <select id="getXzfw" parameterType="java.lang.String" resultType="map">
         SELECT id,
-               public.st_asewkt(public.st_transform(geom,4525)) AS geom,
+               public.st_asewkt(geom) AS geom,
                area,
                create_time
         FROM t_fzss_zhxz_file

+ 37 - 44
onemap-modules/onemap-model/src/main/java/com/onemap/sanya/controller/SanYaController.java

@@ -12,6 +12,7 @@ import com.deepoove.poi.data.Pictures;
 import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
 import com.deepoove.poi.template.MetaTemplate;
 import com.deepoove.poi.template.run.RunTemplate;
+import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.controller.BaseController;
 import com.onemap.common.core.web.domain.AjaxResult;
 import com.onemap.sanya.domain.*;
@@ -58,24 +59,21 @@ public class SanYaController extends BaseController {
                 log.info("选址报告数据为空,导出失败!");
                 return;
             }
-//            String basePath = ClassUtils.getDefaultClassLoader().getResource("").getPath() + "template/word/";
-//            //word模板地址
-//            String resource = basePath + "01-选址报告-02.docx";
 
-            String basePath = this.getClass().getClassLoader().getResource("template/word/").getPath();
-            String resource = basePath + "02-合规性分析报告-02.docx";
-            FileInputStream fileInputStream = new FileInputStream(resource);
+            ClassPathResource classPathResource = new ClassPathResource("template/word/"+"01-选址报告-02.docx");
+            InputStream inputStream = classPathResource.getInputStream();
+
 
             Configure configure = Configure.builder()
                     .bind("tableList", new LoopRowTableRenderPolicy())
                     .bind("analyseList", new AnalyseDetailTablePolicy()).build();
             // 通过 XWPFTemplate 编译文件并渲染数据到模板中
-            XWPFTemplate template = XWPFTemplate.compile(fileInputStream, configure).render(siteSelectionReport);
+            XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(siteSelectionReport);
             //生成临时文件存放地址
-            String temDir = basePath;
+            //String temDir = basePath;
             //生成文件名
             String wordName = "01-选址报告-02" + "-" + System.currentTimeMillis();
-            writeWord(response, temDir, wordName, template);
+            writeWord(response, null, wordName, template);
         } catch (Exception e) {
             e.printStackTrace();
             log.error("选址报告导出异常,{}" + e);
@@ -95,13 +93,11 @@ public class SanYaController extends BaseController {
                 log.info("合规性分析报告数据为空,导出失败!");
                 return;
             }
-//            String basePath = ClassUtils.getDefaultClassLoader().getResource("").getPath() + "template/word/";
-//            //word模板地址
-//            String resource = basePath + "02-合规性分析报告-02.docx";
 
-            String basePath = this.getClass().getClassLoader().getResource("template/word/").getPath();
-            String resource = basePath + "02-合规性分析报告-02.docx";
-            FileInputStream fileInputStream = new FileInputStream(resource);
+            ClassPathResource classPathResource = new ClassPathResource("template/word/"+"02-合规性分析报告-02.docx");
+            InputStream inputStream = classPathResource.getInputStream();
+
+
 
             Configure configure = Configure.builder()
                     .bind("tableList01", new LoopRowTableRenderPolicy())
@@ -109,7 +105,7 @@ public class SanYaController extends BaseController {
                     .bind("analyseList01", new AnalyseDetailTablePolicy())
                     .bind("analyseList02", new AnalyseDetailTablePolicy()).build();
             // 通过 XWPFTemplate 编译文件并渲染数据到模板中
-            XWPFTemplate template = XWPFTemplate.compile(fileInputStream, configure).render(complianceAnalysisReport);
+            XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(complianceAnalysisReport);
             List<MetaTemplate> elementTemplates = template.getElementTemplates();
             for (MetaTemplate elementTemplate : elementTemplates) {
                 String variable = elementTemplate.variable();
@@ -124,10 +120,10 @@ public class SanYaController extends BaseController {
                 }
             }
             //生成临时文件存放地址
-            String temDir = basePath;
+            //String temDir = basePath;
             //生成文件名
             String wordName = "02-合规性分析报告-02" + "-" + System.currentTimeMillis();
-            writeWord(response, temDir, wordName, template);
+            writeWord(response, null, wordName, template);
         } catch (Exception e) {
             e.printStackTrace();
             log.error("合规性分析报告导出异常,{}" + e);
@@ -147,23 +143,20 @@ public class SanYaController extends BaseController {
                 log.info("征收补偿预估报告数据为空,导出失败!");
                 return;
             }
-//            String basePath = ClassUtils.getDefaultClassLoader().getResource("").getPath() + "template/word/";
-//            //word模板地址
-//            String resource = basePath + "03-征收补偿预估报告-02.docx";
 
-            String basePath = this.getClass().getClassLoader().getResource("template/word/").getPath();
-            String resource = basePath + "03-征收补偿预估报告-02.docx";
-            FileInputStream fileInputStream = new FileInputStream(resource);
+            ClassPathResource classPathResource = new ClassPathResource("template/word/"+"03-征收补偿预估报告-02.docx");
+            InputStream inputStream = classPathResource.getInputStream();
+
 
             Configure configure = Configure.builder()
                     .bind("tableList01", new LoopRowTableRenderPolicy()).build();
             // 通过 XWPFTemplate 编译文件并渲染数据到模板中
-            XWPFTemplate template = XWPFTemplate.compile(fileInputStream, configure).render(compensateEstimateReport);
+            XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(compensateEstimateReport);
             //生成临时文件存放地址
-            String temDir = basePath;
+            //String temDir = basePath;
             //生成文件名
             String wordName = "03-征收补偿预估报告-02" + "-" + System.currentTimeMillis();
-            writeWord(response, temDir, wordName, template);
+            writeWord(response, null, wordName, template);
         } catch (Exception e) {
             e.printStackTrace();
             log.error("征收补偿预估报告导出异常,{}" + e);
@@ -176,12 +169,12 @@ public class SanYaController extends BaseController {
      * @param response
      */
     @RequestMapping("/exportWord4")
-    private AjaxResult exportWord4(@RequestBody BenchmarkLandPriceReport benchmarkLandPriceReport, HttpServletRequest request, HttpServletResponse response) {
+    private void exportWord4(@RequestBody BenchmarkLandPriceReport benchmarkLandPriceReport, HttpServletRequest request, HttpServletResponse response) {
         try {
 //            BenchmarkLandPriceReport benchmarkLandPriceReport = setWordData4();
             if (benchmarkLandPriceReport == null) {
                 log.info("基准地价报告数据为空,导出失败!");
-                return error("基准地价报告数据为空,导出失败!");
+                return ;
             }
             List<PicData> picList = new ArrayList<>();
             //将base64图片转为PictureRenderData
@@ -192,19 +185,16 @@ public class SanYaController extends BaseController {
             }
             benchmarkLandPriceReport.setPicList(picList);
 
-//            String basePath = ClassUtils.getDefaultClassLoader().getResource("").getPath() + "template/word/";
-//            //word模板地址
-//            String resource = basePath + "04-基准地价报告-02.docx";
+            ClassPathResource classPathResource = new ClassPathResource("template/word/"+"04-基准地价报告-02.docx");
+            InputStream inputStream = classPathResource.getInputStream();
+
 
-            String basePath = this.getClass().getClassLoader().getResource("template/word/").getPath();
-            String resource = basePath + "04-基准地价报告-02.docx";
-            FileInputStream fileInputStream = new FileInputStream(resource);
 
             Configure configure = Configure.builder()
                     .bind("tableList01", new LoopRowTableRenderPolicy())
                     .bind("tableList02", new LoopRowTableRenderPolicy()).build();
             // 通过 XWPFTemplate 编译文件并渲染数据到模板中
-            XWPFTemplate template = XWPFTemplate.compile(fileInputStream, configure).render(benchmarkLandPriceReport);
+            XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(benchmarkLandPriceReport);
             List<MetaTemplate> elementTemplates = template.getElementTemplates();
             for (MetaTemplate elementTemplate : elementTemplates) {
                 String variable = elementTemplate.variable();
@@ -219,19 +209,19 @@ public class SanYaController extends BaseController {
                 }
             }
             //生成文件存放地址
-            String temDir = ClassUtils.getDefaultClassLoader().getResource("").getPath() + "template/storageword/";;
+//            String temDir = this.getClass().getClassLoader().getResource("template/storageword/").getPath();
+            //ClassUtils.getDefaultClassLoader().getResource("").getPath() + "template/storageword/";;
             //生成文件名
             String wordName = "04-基准地价报告-02" + "-" + System.currentTimeMillis();
-            String fileUrl=storageWord(response, temDir, wordName, template);
+            writeWord(response, null, wordName, template);
 
-            return success(fileUrl);
         } catch (Exception e) {
             e.printStackTrace();
             log.error("基准地价报告导出异常,{}" + e);
-            return error("基准地价报告导出异常,{}" + e.getMessage());
         }
     }
 
+
     /**
      * 下载分析文档
      * @param fileName
@@ -635,6 +625,8 @@ public class SanYaController extends BaseController {
         //=================生成word到设置浏览默认下载地址=================
         // 设置强制下载不打开
         response.setContentType("application/force-download");
+
+        response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
         // 设置文件名
         response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
         OutputStream out = response.getOutputStream();
@@ -643,10 +635,11 @@ public class SanYaController extends BaseController {
         out.close();
         template.close();
         //删除临时文件
-        File file = new File(temDir + fileName);
-        file.setWritable(true);
-        file.delete();
-
+        if(StringUtils.isNotEmpty(temDir)){
+            File file = new File(temDir + fileName);
+            file.setWritable(true);
+            file.delete();
+        }
     }
 
 

+ 5 - 1
sql/pgsql/0_init.sql

@@ -36,4 +36,8 @@ ALTER TABLE "base"."t_fzss_fzxz" ADD COLUMN "is_ydxz" bool;
 
 COMMENT ON COLUMN "base"."t_fzss_fzxz"."is_ydxz" IS '是否与控规用地性质一致';
 
-ALTER TABLE "base"."t_fzss_fzxz" DROP COLUMN "kddk";
+ALTER TABLE "base"."t_fzss_fzxz" DROP COLUMN "kddk";
+
+
+ALTER TABLE base.t_fzss_hgxfx_scx_sortation ADD "style" int2 NULL;
+COMMENT ON COLUMN base.t_fzss_hgxfx_scx_sortation."style" IS '样式,0饼状 1列表(没在此表填写的,都为饼图)';