gushoubang 11 месяцев назад
Родитель
Сommit
7921b9da72

+ 20 - 0
onemap-api/onemap-api-system/src/main/java/com/onemap/system/api/ApplyService.java

@@ -0,0 +1,20 @@
+package com.onemap.system.api;
+
+import com.onemap.common.core.constant.ServiceNameConstants;
+import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.system.api.factory.ApplyFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * 分析服务
+ */
+@FeignClient(contextId = "applyService", value = ServiceNameConstants.APPLY_SERVICE, fallbackFactory = ApplyFallbackFactory.class)
+public interface ApplyService {
+    @GetMapping("/fzxz/GetCascadeList")
+    RequestResult GetCascadeList(String param);
+
+    @PostMapping("/tabledata/polygon/GetTableData")
+    RequestResult queryTableListByPolygon(String sourceDataId, String sourcePolygonWkt, String sourceLayerId, String sourceLayerType, String queryTableId);
+}

+ 28 - 0
onemap-api/onemap-api-system/src/main/java/com/onemap/system/api/factory/ApplyFallbackFactory.java

@@ -0,0 +1,28 @@
+package com.onemap.system.api.factory;
+
+import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.system.api.ApplyService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ApplyFallbackFactory implements FallbackFactory<ApplyService> {
+    private static final Logger log = LoggerFactory.getLogger(ApplyFallbackFactory.class);
+
+    @Override
+    public ApplyService create(Throwable cause) {
+        return new ApplyService() {
+            @Override
+            public RequestResult queryTableListByPolygon(String sourceDataId, String sourcePolygonWkt, String sourceLayerId, String sourceLayerType, String queryTableId) {
+                return RequestResult.error("内部错误");
+            }
+
+            @Override
+            public RequestResult GetCascadeList(String param) {
+                return RequestResult.error("内部错误");
+            }
+        };
+    }
+}

+ 6 - 3
onemap-common/onemap-common-core/src/main/java/com/onemap/common/core/constant/ServiceNameConstants.java

@@ -2,11 +2,10 @@ package com.onemap.common.core.constant;
 
 /**
  * 服务名称
- * 
+ *
  * @author onemap
  */
-public class ServiceNameConstants
-{
+public class ServiceNameConstants {
     /**
      * 认证服务的serviceid
      */
@@ -31,4 +30,8 @@ public class ServiceNameConstants
      * 空间服务的serviceid
      */
     public static final String SPATIAL_SERVICE = "onemap-spatial";
+    /**
+     * 服务的serviceid
+     */
+    public static final String APPLY_SERVICE = "onemap-apply";
 }

+ 16 - 0
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/domain/res/TableSortRes.java

@@ -0,0 +1,16 @@
+package com.onemap.analyse.domain.res;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class TableSortRes {
+    @JsonProperty("tableId")
+    private String tableId;
+    @JsonProperty("tableName")
+    private String tableName;
+    @JsonProperty("sort")
+    private String sort;
+}

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

@@ -98,7 +98,7 @@ public class FzssServiceImpl implements IFzssService {
         fzxzDTO.setYdxz_bsm(fzxzDTO.getYdxz_bsm().replaceAll("\\[", "").replaceAll("\\]", ""));
         // TODO 数据源
         if (fzxzDTO.getSjy() == null) {
-            fzxzDTO.setSjy("TB_GHDK_SITUATION");
+            fzxzDTO.setSjy("TB_GHDK");
         }
 
         // 选址因子
@@ -548,7 +548,7 @@ public class FzssServiceImpl implements IFzssService {
             String rawTableName = selectionInfo.getSjy();
             String rawItemIds = selectionRes.getDkid();
             List<String> columns = new ArrayList<>();
-            columns.add("kzxxgyddm");
+            columns.add("dkbm");
             columns.add("kzxxgydmc");
             columns.add("jzxgd");
 

+ 22 - 46
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ReportServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.onemap.analyse.domain.*;
 import com.onemap.analyse.domain.calculation.ReportImage;
 import com.onemap.analyse.domain.res.GeomRes;
+import com.onemap.analyse.domain.res.TableSortRes;
 import com.onemap.analyse.domain.vo.FactorSpatialVo;
 import com.onemap.analyse.domain.vo.TableNameIdsVo;
 import com.onemap.analyse.mapper.FactorUseMapper;
@@ -22,6 +23,7 @@ import com.onemap.analyse.utils.NumberUtil;
 import com.onemap.analyse.utils.UnitsUtil;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.system.api.ApplyService;
 import com.onemap.system.api.SpatialService;
 import com.onemap.system.api.domain.WktsVo;
 import org.apache.commons.io.FileUtils;
@@ -33,12 +35,10 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import javax.imageio.ImageIO;
-import java.awt.*;
 import java.awt.image.BufferedImage;
 import java.io.*;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.List;
 
 /**
  * 生成报告
@@ -69,6 +69,9 @@ public class ReportServiceImpl implements IReportService {
     @Resource
     SpatialService spatialService;
 
+    // @Resource
+    // ApplyService applyService;
+
     @Resource
     CreateUtilsDBService createUtilsDBService;
     @Resource
@@ -207,50 +210,6 @@ public class ReportServiceImpl implements IReportService {
             }
             NpoiHelper.setComTable(document, tabYzTitles, dataTablelist, "表1:选址影响因子", pos++);
 
-            // // 生成因子图片
-            // for (FzxzFactorDTO rootFactor : rootFactors) {
-            //     if (factorImageMap.containsKey(rootFactor.getId())) {
-            //         List<FactorUseDTO> factorUseDTOS = factorImageMap.get(rootFactor.getId());
-            //         List<WktsVo.WktInfo> wktInfos = new ArrayList<>();
-            //         for (FactorUseDTO factorUseDTO : factorUseDTOS) {
-            //             if (factorUseDTO.getFactorName().equals("坡度") || factorUseDTO.getFactorName().equals("高程"))
-            //                 continue;
-            //             String ewkt = getFactorWkt(geomRes.getGeom(), factorUseDTO.getFactorBsm());
-            //
-            //             Random random = new Random();
-            //             int rgb = random.nextInt(0xFFFFFF + 1);
-            //             String color = String.format("#%06X", rgb);
-            //
-            //
-            //             WktsVo.WktInfo wktInfo = new WktsVo.WktInfo();
-            //             wktInfo.setWkt(ewkt);
-            //             wktInfo.setBorderColor(color);
-            //             wktInfo.setBorderColor(color);
-            //
-            //             wktInfos.add(wktInfo);
-            //         }
-            //         if (wktInfos.size() == 0) continue;
-            //
-            //         String imagePath = reportImg(wktInfos);
-            //         if (imagePath.equals("")) continue;
-            //         // 获取插入图片
-            //         NpoiHelper.content(document, rootFactor.getName(), pos++, ParagraphAlignment.CENTER);
-            //         ReportImage reportImage = getPathImage(imagePath, 400);
-            //
-            //         XWPFParagraph imageParagraph = document.createParagraph();
-            //         imageParagraph.setAlignment(ParagraphAlignment.CENTER); // Center align the image
-            //         XWPFRun imageRun = imageParagraph.createRun();
-            //         imageRun.addPicture(reportImage.getInputStream(), XWPFDocument.PICTURE_TYPE_PNG, null, Units.toEMU(reportImage.getUseWidth()), Units.toEMU(reportImage.getUseHeight()));
-            //         pos++;
-            //     }
-            // }
-            //
-            // // 添加分页
-            // XWPFParagraph pageBreakParagraph0 = document.createParagraph();
-            // XWPFRun pageBreakRun0 = pageBreakParagraph0.createRun();
-            // pageBreakRun0.addBreak(BreakType.PAGE);
-            // pos++;
-
             // TODO 二、选址范围分析
             NpoiHelper.catalog(document, "二、选址范围分析", pos++);
             String fwfx = "\t根据指定选址分析得出,所选范围共" + NumberUtil.double2TwoDecimal(UnitsUtil.m2ToMu(geomRes.getArea())) + "亩,其中";
@@ -668,4 +627,21 @@ public class ReportServiceImpl implements IReportService {
         String ewktRes = tableDateService.getGeomUnion(tableNameIdsVo);
         return ewktRes;
     }
+
+    // /**
+    //  * 获取级联列表
+    //  */
+    // private void GetCascadeList() {
+    //     RequestResult requestResult = applyService.GetCascadeList("");
+    //     List<TableSortRes> tableSortResList = (List<TableSortRes>) requestResult.get("data");
+    // }
+
+    // /**
+    //  * 获取表格数据
+    //  */
+    // private void getTableData() {
+    //
+    //     String sourceDataId, String sourcePolygonWkt, String sourceLayerId, String sourceLayerType, String queryTableId
+    //     applyService.queryTableListByPolygon()
+    // }
 }

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

@@ -6,7 +6,10 @@ import com.onemap.apply.mapper.table.*;
 import com.onemap.apply.service.analyse.HttpAnalyseService;
 import com.onemap.apply.service.table.TableDataSelectService;
 import com.onemap.common.core.utils.StringUtils;
-import com.onemap.system.api.domain.*;
+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 org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;

+ 4 - 4
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/table/TableDataSelectService.java

@@ -7,7 +7,7 @@ import java.util.Map;
 
 public interface TableDataSelectService {
 
-    public Map dataSelectByPoint(String pointEWkt, String bsm);
+    Map dataSelectByPoint(String pointEWkt, String bsm);
 
     /**
      * @param sourcePointWkt
@@ -16,10 +16,10 @@ public interface TableDataSelectService {
      * @param queryTableId
      * @return
      */
-    public Map dataQueryByPoint(String sourcePointWkt, String sourceLayerId, String sourceLayerType, String queryTableId);
+    Map dataQueryByPoint(String sourcePointWkt, String sourceLayerId, String sourceLayerType, String queryTableId);
 
-    public Map dataQueryByPolygon(String sourceDataId, String sourcePolygonWkt, String sourceLayerId, String sourceLayerType, String queryTableId);
+    Map dataQueryByPolygon(String sourceDataId, String sourcePolygonWkt, String sourceLayerId, String sourceLayerType, String queryTableId);
 
 
-    public List<TableLayerDTO> dataQueryLayer(String defaultType, String layerId);
+    List<TableLayerDTO> dataQueryLayer(String defaultType, String layerId);
 }