瀏覽代碼

Merge branch 'master' into dev

gushoubang 3 月之前
父節點
當前提交
ac32278969

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

@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.*;
 
 /**
@@ -509,7 +510,13 @@ public class FzssServiceImpl implements IFzssService {
         for (Map<String, Object> landMap : resList) {
             Integer dkId = (Integer) landMap.get("id");
             String geom = (String) landMap.get("geom");
-            Double area = (Double) landMap.get("siweiarea");
+            Double area = null;
+            Object value = landMap.get("siweiarea");
+            if (value instanceof BigDecimal) {
+                area = ((BigDecimal) value).doubleValue();
+            } else {
+                area = (Double) value;
+            }
 
             SelectionResDTO fzxzResDTO = DozerUtils.map(resMap, SelectionResDTO.class);
             fzxzResDTO.setBsm(StringUtils.getUUID());

+ 14 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/dimentity/DimEntityController.java

@@ -22,11 +22,15 @@ public class DimEntityController extends BaseController {
     @Resource
     private DimEntityService dimEntityService;
 
+    // 查询树结构
     @GetMapping("/entity/code/table/tree")
     public RequestResult queryEntityCodeTableTree(String id) {
+        // 实体图元关联表:建立关联关系
+        // 根据表名称查询数量
         return RequestResult.success(dimEntityService.queryEntityCodeTableTree(id));
     }
 
+    // 查询类别列表
     @GetMapping("/entity/code/table/list")
     public TableDataInfo queryEntityCodeTableList(String id, String entityid, String entityname) {
         List<String> tablesList = dimEntityService.queryEntityCodeTableListFront(id);
@@ -37,11 +41,13 @@ public class DimEntityController extends BaseController {
         return getDataTable(dimEntityService.queryEntityCodeTableList(id, entityid, entityname, tablesList));
     }
 
+    // 查询单个实体图元信息
     @GetMapping("/entity/data")
     public RequestResult queryEntityData(String entityid) {
         return RequestResult.success(dimEntityService.queryEntityData(entityid));
     }
 
+    // 查询实体图元关系
     @GetMapping("/entity/relationship")
     public RequestResult queryEntityRelationship(String entityid) {
         return RequestResult.success(dimEntityService.queryEntityRelationshipToNeo4j(entityid));
@@ -76,4 +82,12 @@ public class DimEntityController extends BaseController {
         return RequestResult.success("操作成功", 0);
     }
 
+    @PostMapping("/entity/add/relationship/data")
+    public RequestResult addEntityRelationshipData() {
+        List<EntityRelationshipToNeo4jVo> list = dimEntityService.queryRelationshipDateByTableName("syst_实体关系表");
+        for (EntityRelationshipToNeo4jVo entityRelationshipToNeo4jVo : list) {
+            dimEntityService.createEntityRelationshipToNeo4j(entityRelationshipToNeo4jVo);
+        }
+        return RequestResult.success("操作成功", 0);
+    }
 }

+ 2 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/dimentity/DimEntityService.java

@@ -32,4 +32,6 @@ public interface DimEntityService {
     Map<String, Object> queryEntityRelationshipFilter(Map map);
 
     List<Map> queryEntityColor();
+
+    List<EntityRelationshipToNeo4jVo> queryRelationshipDateByTableName(String tableName);
 }

+ 10 - 3
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/dimentity/impl/DimEntityServiceImpl.java

@@ -68,10 +68,11 @@ public class DimEntityServiceImpl implements DimEntityService {
     public Map<String, Object> queryEntityData(String entityid) {
         Map<String, Object> result = new HashMap<>();
         //获取所有的实体关系表
-        List<String> tablesList = dimEntityMapper.querySchemaTableByName("vector", "实体图元关联表");
+        List<String> tablesList = dimEntityMapper.querySchemaTableByName("vector", "syst_实体图元关联表");
         if (tablesList == null || tablesList.size() == 0) {
             return result;
         }
+        // ###### TODO:这里用到了关联关系图层
         List<EntityRelationshipVo> relationshipVos = dimEntityMapper.queryEntityRelationshipDataByEntityId(entityid, tablesList);
         if (relationshipVos == null || relationshipVos.size() == 0) {
             return result;
@@ -125,7 +126,7 @@ public class DimEntityServiceImpl implements DimEntityService {
             return;
         }
         //获取所有的实体关系表
-        List<String> tablesList = dimEntityMapper.querySchemaTableByName("vector", "实体图元关联表");
+        List<String> tablesList = dimEntityMapper.querySchemaTableByName("vector", "syst_实体图元关联表");
 
 
         //通过实体关系表,获取实体关系表中,所有映射的实体代理点。此处创建视图,视图将一个小时后删除
@@ -173,7 +174,7 @@ public class DimEntityServiceImpl implements DimEntityService {
     @Override
     public void createEntityRelationshipToNeo4j(EntityRelationshipToNeo4jVo entityRelationshipToNeo4jVo) {
         //        String cql = "match (a:Entity {entityid:'MA1001NE103K1034230XXXXXXXXXXXXX2501010009'}), (b:Entity {entityid:'MA1001NE103K103423043622XXXXXXXX2301010018'}) MERGE (a)-[r:关系]->(b)";
-        String cql = "match " + "(a:Entity {entityid:'" + entityRelationshipToNeo4jVo.getEntityid() + "'})," + "(b:Entity {entityid:'" + entityRelationshipToNeo4jVo.getComentityid() + "'}) " + " MERGE (a)-[r:" + entityRelationshipToNeo4jVo.getComrelation() + "]->(b) ";
+        String cql = "MERGE (a:Entity {entityid:'" + entityRelationshipToNeo4jVo.getEntityid() + "'})" + " MERGE (b:Entity {entityid:'" + entityRelationshipToNeo4jVo.getComentityid() + "'}) " + " MERGE (a)-[r:" + entityRelationshipToNeo4jVo.getComrelation() + "]->(b) ";
         neo4jClient.query(cql).run();
     }
 
@@ -282,6 +283,12 @@ public class DimEntityServiceImpl implements DimEntityService {
         return retList;
     }
 
+    @Override
+    public List<EntityRelationshipToNeo4jVo> queryRelationshipDateByTableName(String tableName) {
+        List<EntityRelationshipToNeo4jVo> list = dimEntityMapper.queryRelationshipDateByTableName(tableName);
+        return list;
+    }
+
     @Override
     public Map<String, Object> queryEntityRelationshipFilter(Map map) {
         String query_data = (String) map.get("query_data");

+ 3 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/yzt/ZymlServiceImpl.java

@@ -221,6 +221,9 @@ public class ZymlServiceImpl implements IZymlService {
                 c.setFavorite(cur.getMy());
                 c.setUrl(cur.getUrl());
                 c.setLegend(cur.getLegend());
+                c.setFwmc(cur.getFwmc());
+                c.setFwys(cur.getFwys());
+                c.setFwgzkj(cur.getFwgzkj());
                 treedata.add(c);
             }
             return RequestResult.success("成功", treedata);

+ 4 - 1
onemap-modules/onemap-apply/src/main/resources/mapper/oracle/yzt/ZymlMapper.xml

@@ -155,7 +155,10 @@
           t.gltj as "gltj",
           t.sjly as "sjly",
           t.legend as "legend",
-        t.ywlx as "ywlx",
+          t.ywlx as "ywlx",
+          t.fwmc AS "fwmc",
+          t.fwys AS "fwys",
+          t.fwgzkj AS "fwgzkj",
         #{username} as "my",
           null as "fzbsm",
           to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",

+ 2 - 2
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/dimentity/DimEntityMapper.xml

@@ -85,7 +85,7 @@
     <select id="queryEntityCodeTableTreeDataByCodeV1" parameterType="String" resultMap="EntityCodeListVoResult">
         select * from (
         <foreach item="item" index="index" collection="tables" separator="UNION ALL">
-            select entityname,alias,entityid,formerid,elementid,elementcode,locationid,classid,classname,borntime,endtime,loadtime,updatests,updatetime,gb
+            select entityname,alias,entityid,formerid,elementid,locationid,classid,classname,borntime,endtime,loadtime,updatests,updatetime
             from vector.${item} where classid::varchar like concat(#{code},'%')
             <if test="entityid != null and entityid != '' "> and entityid::varchar like concat('%',#{entityid},'%') </if>
             <if test="entityname != null and entityname != '' "> and entityname::varchar like concat('%',#{entityname},'%') </if>
@@ -138,7 +138,7 @@
                        ${viewSql}
                        ) x
               group by entilayer) v1
-                 left join base.t_entity_code_table v2 on LOWER(v1.entilayer) like concat('%', LOWER(v2.entilayer))
+                 left join base.t_entity_code_table v2 on LOWER(v1.entilayer) like concat('%', LOWER(v2.entilayer), '%')
     </update>
 
     <select id="queryRelationshipDateByTableName" parameterType="String" resultMap="EntityRelationshipToNeo4jVoResult">

+ 1 - 1
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/XzqMapper.xml

@@ -49,6 +49,6 @@
     </select>
 
     <select id="GetGeom" resultType="java.lang.String" parameterType="java.lang.String">
-        select st_asewkt(t.geom) from xzqh t where t.id = #{id}
+        select public.st_asewkt(t.geom) from xzqh t where t.id = #{id}
     </select>
 </mapper>

+ 4 - 1
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/ZymlMapper.xml

@@ -227,7 +227,10 @@
           t.gltj as "gltj",
           t.sjly as "sjly",
           t.legend as "legend",
-        t.ywlx as "ywlx",
+          t.ywlx as "ywlx",
+          t.fwmc AS "fwmc",
+          t.fwys AS "fwys",
+          t.fwgzkj AS "fwgzkj",
         #{username} as "my",
         #{username} as "favorite"
        from T_YZT_ZYML t