1
0
Просмотр исходного кода

联调down 矢量数据& 不动产功能测试

chenendian 2 недель назад
Родитель
Сommit
354825907d

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/third/OfferDataController.java

@@ -48,7 +48,7 @@ public class OfferDataController extends BaseController {
 
 
     /**
-     *  j接收推送的登簿状体数据
+     *  接收推送的登簿状体数据
      * @param body
      * @return
      */

+ 3 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/NodeLandMapper.java

@@ -59,8 +59,10 @@ public interface NodeLandMapper {
 
     List<Map<String, Object>> selectGeomDetailsByGeomDbId( @Param("geomDbId")String geomDbId);
 
+    List<NodeLand> selectByGeom(@Param("ewkt") String ewkt);
+
+    Map<String, String> selectDjzqContainsNodeList(@Param("detailsId")String detailsId);
 
 
-    List<NodeLand> selectByGeom(@Param("ewkt") String ewkt);
 
 }

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/NodeLandService.java

@@ -53,6 +53,7 @@ public interface NodeLandService {
 
     Map<String, Object> selectGeomByDbId(String geomDetailsId) ;
 
+    Map<String, String> getDjzqContainsNodeList(String geomDetailsId);
 
 
 

+ 3 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java

@@ -42,9 +42,9 @@ import java.util.stream.Collectors;
 @Slf4j
 @Service
 public class CadastreManageServiceImpl implements CadastreManageService {
-//    static {
-//        ogr.RegisterAll();
-//    }
+    static {
+        ogr.RegisterAll();
+    }
 
     @Autowired
     private CadastreFileMapper cadastreFileMapper;

+ 1 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/ParcelServiceImpl.java

@@ -57,12 +57,12 @@ public class ParcelServiceImpl implements IParcelService {
     }
 
 
-
     @Override
     public List<Map<String, Object>> djzqList() {
         return zdjbxxMapper.getDjzqWithDjqList();
     }
 
+
     /**
      * type 1,使用权数据多。
      * type 2,所有权数据少。
@@ -72,7 +72,6 @@ public class ParcelServiceImpl implements IParcelService {
      */
     @Override
     public ParcelStatisticsRes statistics(String djzqdm,String type) {
-
         if(StringUtils.isBlank(djzqdm) || djzqdm.matches("[0]+")){
             djzqdm = "";
         }

+ 7 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/NodeLandImpl.java

@@ -230,5 +230,12 @@ public class NodeLandImpl implements NodeLandService {
     }
 
 
+    @Override
+    public Map<String, String> getDjzqContainsNodeList(String geomDetailsId) {
+        return nodeLandMapper.selectDjzqContainsNodeList(geomDetailsId);
+    }
+
+
+
 
 }

+ 10 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/TakeDataService.java

@@ -43,4 +43,14 @@ public interface TakeDataService {
      */
     void update(GyjsydscdjUpdateVo gyjsydscdjUpdateVo);
 
+
+    /**
+     * 获取三方数据最大序列号
+     * @param projectId
+     * @param tableName
+     * @return
+     */
+    Map<String, String> getThirdMaxSequence(String projectId,String tableName);
+
+
 }

+ 55 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/TakeDataServiceImpl.java

@@ -13,8 +13,10 @@ import com.siwei.apply.service.NodeLandService;
 import com.siwei.apply.service.ProjectService;
 import com.siwei.apply.service.third.TakeDataService;
 import com.siwei.apply.utils.HttpClientUtil;
+import com.siwei.common.core.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -45,9 +47,54 @@ public class TakeDataServiceImpl implements TakeDataService {
     }
 
     @Override
-    public Map<String, String> getImmobileCode(String projectId) {
+    public Map<String, String> getThirdMaxSequence(String projectId,String tableName) {
         Map<String, String> retMap = new LinkedHashMap<>();
+        Project project = projectService.get(projectId);
+        String firstPlotCode = project.getFirstPlotCode();
+        String secondPlotCode = project.getSecondPlotCode();
+        if(StringUtils.isEmpty(firstPlotCode)){
+            firstPlotCode = "G";
+        }
+        if(StringUtils.isEmpty(secondPlotCode)){
+            secondPlotCode = "B";
+        }
+
+        //获取地籍子区的代码
+        String regionCode = "";
+        List<ProjectWorkflow> projectWorkflows = projectWorkflowMapper.selectByProjectIdAndNodeTableName(projectId, tableName);
+        if (CollectionUtils.isNotEmpty(projectWorkflows)) {
+            String nodeId = projectWorkflows.get(0).getNodeId();
+            //这里查询出来所有的geometryId,然后循环查询某个区域的
+            List<Map<String, String>> geomDetailsList = nodeLandService.selectTGeomDbDetailsByNodeId(nodeId);
+            for (Map<String, String> geomDetailsMap : geomDetailsList) {
+                String geomDetailsId = geomDetailsMap.get("id");
+                //当前地块所属地籍子区编号
+                Map<String, String>  detailGeomBelongToDjzqMap = nodeLandService.getDjzqContainsNodeList(geomDetailsId);
+                if(!MapUtils.isEmpty(detailGeomBelongToDjzqMap)){
+                    String djzqdm = detailGeomBelongToDjzqMap.get("djzqdm");
+                    regionCode = djzqdm + firstPlotCode + secondPlotCode;
+                }
+            }
+        }
+
+        if(StringUtils.isNotBlank(regionCode)){
+            Map<String, Object> paramMap = new LinkedHashMap<>();
+            paramMap.put("regionCode", regionCode);
+            // todo 这里调用 httpClient 进行远程调用
+            String result = HttpClientUtil.doGet("https://www.baidu.com", paramMap);
+            log.info("获取解析数据为:{}", result);
+            String maxSequence = "";
+            retMap.put("maxSequence", maxSequence);
+            retMap.put("state", "success");
+        }
+        return retMap;
+    }
 
+
+
+    @Override
+    public Map<String, String> getImmobileCode(String projectId) {
+        Map<String, String> retMap = new LinkedHashMap<>();
         Project project = projectService.get(projectId);
         String firstPlotCode = project.getFirstPlotCode();
         String secondPlotCode = project.getSecondPlotCode();
@@ -71,11 +118,15 @@ public class TakeDataServiceImpl implements TakeDataService {
             log.info("获取解析数据为:{}", result);
             // 构造结果进行入库
         }
+
         retMap.put("code", "12345678");
         retMap.put("projectId", projectId);
         return retMap;
     }
 
+
+
+
     @Override
     public GyjsydscdjRes get(String projectId) {
         return null;
@@ -90,4 +141,7 @@ public class TakeDataServiceImpl implements TakeDataService {
     public void update(GyjsydscdjUpdateVo gyjsydscdjUpdateVo) {
 
     }
+
+
+
 }

+ 15 - 1
siwei-modules/siwei-apply/src/main/resources/mapper/NodeLandMapper.xml

@@ -146,7 +146,6 @@
         WHERE details.upload_id = #{geomDbId}
     </select>
 
-
     <select id="selectByGeom"  parameterType="String"  resultMap="BaseResultMap">
          SELECT  bb.*   from  t_geom_db_details aa
          LEFT JOIN t_node_land bb  on aa.upload_id = bb.geom_db_id
@@ -155,4 +154,19 @@
          where  public.ST_Intersects(aa.geom,public.ST_GeomFromEWKT(#{ewkt})) and   cc.id is not null
     </select>
 
+    <select id="selectDjzqContainsNodeList" resultType="Map">
+        SELECT
+            djzq.bsm,
+            djzq.ysdm,
+            djzq.djzqdm,
+            djzq.djzqmc,
+            djzq.bz,
+            djq.djqmc,
+            djq.djqdm
+        FROM vector.djzq
+        WHERE (djzq.valid_flag IS NULL OR djzq.valid_flag = 0)
+            and st_contains(ST_Buffer(djzq.geom::geography, 0.1)::geometry, (SELECT geom FROM   "public".t_geom_db_details   WHERE id = #{detailsId})) )
+            limit 1
+        </select>
+
 </mapper>