1
0
فهرست منبع

Merge branch 'dev-excel0521' into dev-to-user-1

chenendian 1 هفته پیش
والد
کامیت
039de55693
26فایلهای تغییر یافته به همراه648 افزوده شده و 209 حذف شده
  1. 1 1
      siwei-common/siwei-common-core/src/main/java/com/siwei/common/core/utils/file/MimeTypeUtils.java
  2. 2 2
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/common/Constant.java
  3. 26 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/CadastreManageController.java
  4. 35 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/third/DealExcelController.java
  5. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Tdgy.java
  6. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/TdgyVo.java
  7. 7 5
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/enums/DecisionType.java
  8. 1 3
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/LandOneCodeMapper.java
  9. 2 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/cadastre/ZdbhqkMapper.java
  10. 11 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/ProjectService.java
  11. 5 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/CadastreManageService.java
  12. 7 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java
  13. 3 16
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/DecisionTaskServiceImpl.java
  14. 1 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/GyjsydscdjImpl.java
  15. 64 14
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ProjectImpl.java
  16. 0 8
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/TakeDataService.java
  17. 74 73
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/TakeDataServiceImpl.java
  18. 174 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ArcGisUtil.java
  19. 6 3
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ServiceFileUtil.java
  20. 7 0
      siwei-modules/siwei-apply/src/main/resources/mapper/LandOneCodeMapper.xml
  21. 157 80
      siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml
  22. 4 2
      siwei-modules/siwei-apply/src/main/resources/mapper/TdgyMapper.xml
  23. 14 0
      siwei-modules/siwei-apply/src/main/resources/mapper/cadastre/ZdbhqkMapper.xml
  24. 3 0
      siwei-modules/siwei-spatial/src/main/java/com/siwei/spatial/controller/file/SpatialFilesDbController.java
  25. 2 2
      siwei-modules/siwei-spatial/src/main/java/com/siwei/spatial/service/file/ISpatialFilesDbService.java
  26. 40 0
      siwei-modules/siwei-spatial/src/main/java/com/siwei/spatial/service/file/impl/SpatialFilesDbServiceImpl.java

+ 1 - 1
siwei-common/siwei-common-core/src/main/java/com/siwei/common/core/utils/file/MimeTypeUtils.java

@@ -36,7 +36,7 @@ public class MimeTypeUtils
             // 视频格式
             "mp4", "avi", "rmvb",
             // pdf
-            "pdf" };
+            "pdf","dwg" };
 
     public static String getExtension(String prefix)
     {

+ 2 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/common/Constant.java

@@ -66,10 +66,10 @@ public class Constant {
 
 
     // 宗地所有权的相关值
-    public static final String ZD_DICT_A6_VALUE_SUOYOUQUAN ="1,2,4,6,8,16,18,24,25,26,33,35,36";
+    public static final String ZD_DICT_A6_VALUE_SUOYOUQUAN ="1,2,6,8,18,25,26,33,35,36";
 
     // 使用权的相关值
-    public static final String ZD_DICT_A6_VALUE_SHIYONGQUAN ="3,4,5,7,11,12,15,16,17,23,24,25,26,29,30,31,34";
+    public static final String ZD_DICT_A6_VALUE_SHIYONGQUAN ="3,4,5,7,11,12,15,16,17,23,24,29,30,31,34";
 
 
     //汇交矢量表

+ 26 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/CadastreManageController.java

@@ -6,6 +6,7 @@ import com.siwei.apply.domain.FzssFxrwrz;
 import com.siwei.apply.domain.LayerAndDbData;
 import com.siwei.apply.domain.MdbAndDbData;
 import com.siwei.apply.domain.RowUpdateContent;
+import com.siwei.apply.domain.cadastre.Zdbhqk;
 import com.siwei.apply.domain.vo.*;
 import com.siwei.apply.service.cadastre.CadastreManageService;
 import com.siwei.apply.service.cadastre.IZymlService;
@@ -464,4 +465,29 @@ public class CadastreManageController extends BaseController {
     }
 
 
+    /**
+     * 宗地变化情况结果
+     * @param zddm
+     * @param bdcdyh
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/zdbhqk/list")
+    public  R<?> zdbhqkList(
+            @RequestParam(value = "zddm",required = false) String zddm,
+            @RequestParam(value = "bdcdyh",required = false) String bdcdyh,
+            @RequestParam(value = "pageNum", required = false) Integer pageNum,
+            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
+        try {
+            startPage();
+            List<Zdbhqk>  resList = cadastreManageService.zdbhqkList(zddm,bdcdyh);
+            return R.ok(getDataTable(resList));
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
+
 }

+ 35 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/third/DealExcelController.java

@@ -1,6 +1,7 @@
 package com.siwei.apply.controller.third;
 
 import com.siwei.apply.common.Constant;
+import com.siwei.apply.service.NodeAttachmentService;
 import com.siwei.apply.service.third.impl.DealExcelServiceImpl;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
@@ -22,6 +23,7 @@ import java.nio.file.Paths;
 import java.util.*;
 
 /**
+ *
  *
  * excel  处理器
  */
@@ -34,6 +36,39 @@ public class DealExcelController extends BaseController {
     @Autowired
     DealExcelServiceImpl  dealExcelService;
 
+    @Autowired
+    private NodeAttachmentService nodeAttachmentService;
+
+
+    /**
+     * 附件入库后,附件名称未进入查询表,需要刷新数据
+     * @param fileName
+     * @return
+     */
+    @PostMapping("/attachmentToDb/{fileName}")
+    public R<Map<String, List<Map<String, String>>>> dealAttachmentInfo(@PathVariable String fileName) {
+        try {
+            String uploadFile = Constant.IMPORT_EXCEL_DATA_FILE_PATH+"\\"+fileName;
+            Path filePath = Paths.get(uploadFile);
+            File file = filePath.toFile();
+            Map<String, List<Map<String, String>>> dataMap = readExcelWithMergedHeaders(file);
+            List<Map<String, String>>  list =  dataMap.get("data_info");
+            for(Map<String, String>  obj :  list){
+                String projectId = obj.get("project_id");
+                String nodeId = obj.get("node_id");
+                String id = obj.get("attachment_id");
+                //Boolean res  = nodeAttachmentService.modifyAttachmentInfo(projectId,nodeId,id);
+                //logger.info("数据入库结果{},id{},projectId{},nodeId{}",res,id,projectId,nodeId);
+            }
+            return R.ok(dataMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
+
+
 
 
     @GetMapping("testData/{fileName}")

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Tdgy.java

@@ -27,6 +27,7 @@ public class Tdgy extends BaseId {
     private Boolean hasOnchain;    // 是否上链
     private String creatorId;      // 创建人ID
     private String gdUnit;        // 供地单位
+    private String dzjgh;         // 电子监管号
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createdAt;        // 创建时间

+ 1 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/TdgyVo.java

@@ -18,5 +18,6 @@ public class TdgyVo {
     private String hbcrhtbh;       // 划拨决定书/出让合同编号
     private String hbcrhtDate;       // 划拨决定书/出让合同日期
     private String gdUnit;        // 供地单位
+    private String dzjgh;         // 电子监管号
     private String bz;            // 备注(数据清单)
 }

+ 7 - 5
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/enums/DecisionType.java

@@ -14,13 +14,15 @@ public enum DecisionType {
     DECISION_TYPE_1("1", "现状数据", "vector.gj_sandiao", "gid", "gj_sandiao", "gid", "dlmc","dlbm"),
     DECISION_TYPE_2("2", "城镇开发边界", "vector.gj_chengzhen", "gid", "gj_chengzhen", "gid", "ghfqmc","ghfqdm"),
     DECISION_TYPE_3("3", "控规数据", "vector.gj_konggui", "gid", "gj_konggui", "gid", "dkbh","ydxz"),
-    //DECISION_TYPE_4("4", "所有权宗地", "vector.zdjbxx", "zddm", "zdjbxx", "zddm", "qlrsjsyrlxm","zdszx"),
+    DECISION_TYPE_4("4", "所有权宗地", "vector.zdjbxx", "zddm", "zdjbxx", "zddm", "qlrsjsyrlxm","zdszx"),
     DECISION_TYPE_5("5", "使用权宗地", "vector.zdjbxx", "zddm", "zdjbxx", "zddm", "qlrsjsyrlxm","zdszx"),
-    DECISION_TYPE_6("6", "供地数据", "vector.gj_gd_data", "gid", "gj_gd_data", "gid","srr", "nf"),
-    DECISION_TYPE_7("7", "用地报批(存量)数据", "vector.gj_bp_data", "gid", "gj_bp_data", "gid", "xmmc","xmlx"),
-    DECISION_TYPE_6_1("6", "土地供应数据", "public.c_one_code_tdgy", "node_id", "c_one_code_tdgy", "node_id","srf","hbcrht_date"),
-//    DECISION_TYPE_7_1("7", "用地报批数据", "public.t_ydbp_data", "id", "t_ydbp_data", "id", "name","pfwh"),
+    DECISION_TYPE_6("6", "土地供应数据", "public.c_one_code_decision_supply", "details_id", "c_one_code_decision_supply", "details_id","srf", "hbcrht_date"),
+    DECISION_TYPE_7("7", "用地报批数据", "public.c_one_code_decision_batch", "details_id", "c_one_code_decision_batch", "details_id", "node_name","pfwh"),
 
+//    DECISION_TYPE_6("6", "供地数据", "vector.gj_gd_data", "gid", "gj_gd_data", "gid","srr", "nf"),
+//    DECISION_TYPE_7("7", "用地报批(存量)数据", "vector.gj_bp_data", "gid", "gj_bp_data", "gid", "xmmc","xmlx"),
+//    DECISION_TYPE_6_1("6", "土地供应数据", "public.c_one_code_tdgy", "node_id", "c_one_code_tdgy", "node_id","srf","hbcrht_date"),
+//    DECISION_TYPE_7_1("7", "用地报批数据", "public.t_ydbp_data", "id", "t_ydbp_data", "id", "name","pfwh"),
 //    DECISION_TYPE_6_2("6", "供地数据", "c_one_code_tdgy", "node_id", "供地数据2", "project_name","project_code"),
 //    DECISION_TYPE_7_2("7", "报批数据", "c_one_code_ydbp", "node_id", "报批数据2", "node_id", "project_name","project_code");
     DECISION_TYPE_8("8", "永久基本农田", "vector.gj_nongtian", "gid", "gj_nongtian", "gid", "dlmc","dlbm");

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

@@ -24,15 +24,13 @@ public interface LandOneCodeMapper {
     // 根据环节ID(project_workflow_id)修改三类编码
     void updateCodeByProjectWorkflowId(LandOneCode entity);
 
+    void updateCodeByProjectId(@Param("projectId") String projectId,@Param("resourceImmobileCode") String resourceImmobileCode);
 
     // 根据主键ID查询
     LandOneCode getByWorkflowId(@Param("workflowId") String workflowId);
 
 
-
     LandOneCode getByProjectId(@Param("projectId") String projectId);
 
 
-
-
 }

+ 2 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/cadastre/ZdbhqkMapper.java

@@ -29,6 +29,8 @@ public interface ZdbhqkMapper {
      */
     List<Zdbhqk> getList();
 
+    List<Zdbhqk> selectZdbhqkList(@Param("zddm") String zddm,@Param("bdcdyh") String bdcdyh);
+
     /**
      * 更新不动产权属变更记录
      */

+ 11 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/ProjectService.java

@@ -95,6 +95,17 @@ public interface ProjectService {
     void addPreAssignCode(String nodeId,String projectId,String geomDbId,Integer validFlag) throws RuntimeException ;
 
 
+    /**
+     * 获取三方数据最大序列号
+     * @param projectId
+     * @param nodeId
+     * @param detailsId
+     * @return
+     */
+    Map<String, String> getThirdMaxSequence(String projectId,String nodeId,String detailsId);
+
+
+
     void testData() ;
 
 }

+ 5 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/CadastreManageService.java

@@ -4,6 +4,7 @@ import com.siwei.apply.domain.CadastreFile;
 import com.siwei.apply.domain.FzssFxrwrz;
 import com.siwei.apply.domain.LayerAndDbData;
 import com.siwei.apply.domain.MdbAndDbData;
+import com.siwei.apply.domain.cadastre.Zdbhqk;
 import com.siwei.apply.domain.vo.CadastreFileFilterVo;
 import com.siwei.apply.domain.vo.CheckInfoResultVo;
 import com.siwei.apply.domain.vo.CompareResultVo;
@@ -70,4 +71,8 @@ public interface CadastreManageService {
 
     String getQlrList(String name);
 
+    List<Zdbhqk> zdbhqkList(String zddm, String bdcdyh);
+
+
+
 }

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

@@ -2018,5 +2018,12 @@ public class CadastreManageServiceImpl implements CadastreManageService {
     }
 
 
+    @Override
+    public List<Zdbhqk> zdbhqkList(String zddm,String bdcdyh) {
+        // 名称为空直接返回空
+        List<Zdbhqk> list = zdbhqkMapper.selectZdbhqkList(zddm,bdcdyh);
+        return  list;
+    }
+
 
 }

+ 3 - 16
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/DecisionTaskServiceImpl.java

@@ -192,7 +192,6 @@ public class DecisionTaskServiceImpl implements DecisionTaskService {
      * @param taskId
      * @return
      */
-    @Transactional(rollbackFor = Exception.class)
     @Override
     public List<DecisionDetailsVo> detailsList(String taskId) {
         if (StringUtils.isBlank(taskId)) {
@@ -227,18 +226,6 @@ public class DecisionTaskServiceImpl implements DecisionTaskService {
 
             List<Map<String, Object>> dataList = decisionTaskMapper.getDetailsList(param);
             if (CollectionUtils.isNotEmpty(dataList)) {
-                if(decisionType.getCode().equalsIgnoreCase("7") && decisionType.getSourceId().equalsIgnoreCase("node_id") ){
-                    //这里把用途转为名称展示
-                    for(Map<String,Object> data : dataList){
-                        if(data.get("tdyt") != null){
-                            String code = data.get("tdyt").toString();
-                            LandType landType = landTypeMapper.selectByCode(code);
-                            if(Objects.nonNull(landType)){
-                                data.put("tdyt",landType.getName());
-                            }
-                        }
-                    }
-                }
                 DecisionDetailsVo vo = new DecisionDetailsVo();
                 vo.setName(decisionType.getName());
                 vo.setType(Integer.parseInt(decisionType.getCode()));
@@ -664,7 +651,7 @@ public class DecisionTaskServiceImpl implements DecisionTaskService {
                 }else {
 
                     NpoiHelper.TableTitle xmmcTitle = new NpoiHelper.TableTitle();
-                    xmmcTitle.setKey("project_name");
+                    xmmcTitle.setKey("node_name");
                     xmmcTitle.setName("项目名称");
                     xmmcTitle.setWidth(2484);
                     xmmcTitle.setAlign(ParagraphAlignment.CENTER);
@@ -681,8 +668,8 @@ public class DecisionTaskServiceImpl implements DecisionTaskService {
 
                     // 项目类型
                     NpoiHelper.TableTitle xmlxTitle = new NpoiHelper.TableTitle();
-                    xmlxTitle.setKey("tdyt");
-                    xmlxTitle.setName("报批用途");
+                    xmlxTitle.setKey("pfwh");
+                    xmlxTitle.setName("批复文号");
                     xmlxTitle.setWidth(1880);
                     xmlxTitle.setAlign(ParagraphAlignment.CENTER);
                     titles.add(xmlxTitle);

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

@@ -10,6 +10,7 @@ import com.siwei.apply.mapper.GyjsydscdjMapper;
 import com.siwei.apply.mapper.ProjectMapper;
 import com.siwei.apply.service.GyjsydscdjService;
 import com.siwei.apply.service.LandOneCodeService;
+import com.siwei.apply.service.ProjectService;
 import com.siwei.common.core.utils.bean.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 64 - 14
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ProjectImpl.java

@@ -14,11 +14,10 @@ import com.siwei.apply.domain.vo.ProjectVo;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
 import com.siwei.apply.enums.ProjectType;
 import com.siwei.apply.mapper.*;
-import com.siwei.apply.service.NodeAttachmentService;
 import com.siwei.apply.service.NodeLandService;
 import com.siwei.apply.service.ProjectService;
-import com.siwei.apply.service.third.TakeDataService;
 import com.siwei.apply.utils.ServiceFileUtil;
+import com.siwei.apply.utils.ServiceUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.MapUtils;
 import org.geotools.data.DefaultTransaction;
@@ -143,24 +142,16 @@ public class ProjectImpl implements ProjectService {
     @Autowired
     private NodeLandMapper nodeLandMapper;
 
-    @Autowired
-    private NodeAttachmentService nodeAttachmentService;
-
     @Autowired
     private NodeLandService nodeLandService;
 
-
-    @Autowired
-    private TakeDataService takeDataService;
+//    @Autowired
+//    private TakeDataService takeDataService;
 
     @Autowired
     private ProjectImmobileCodeMapper projectImmobileCodeMapper;
 
 
-
-
-
-
     @Override
     public String add(ProjectVo projectVo) {
         Project project = new Project();
@@ -326,7 +317,7 @@ public class ProjectImpl implements ProjectService {
                 String projectId = project.getId();
                 List<ProjectWorkflow> projectWorkflowList = projectWorkflowMapper.selectByProjectId(projectId);
                 if(project.getProjectType()==2){
-                    projectWorkflowList.stream().filter(s->!s.getWorkflowId().equals("17")).collect(Collectors.toList());
+                    projectWorkflowList = projectWorkflowList.stream().filter(s->!s.getWorkflowId().equals("17")).collect(Collectors.toList());
                 }
                 // 倒叙排序
                 projectWorkflowList = projectWorkflowList.stream()
@@ -2017,7 +2008,7 @@ public class ProjectImpl implements ProjectService {
                 if(com.siwei.common.core.utils.StringUtils.isBlank(preAssignCode) && com.siwei.common.core.utils.StringUtils.isBlank(sequenceNumber)) {
                     String plotCode = "";
                     String regionCode = "";
-                    Map<String, String> maxSequenceMap = takeDataService.getThirdMaxSequence(projectId,nodeId,detailsId);
+                    Map<String, String> maxSequenceMap = this.getThirdMaxSequence(projectId,nodeId,detailsId);
                     if (MapUtils.isNotEmpty(maxSequenceMap) && maxSequenceMap.get("code").equalsIgnoreCase("200")) {
                         regionCode = maxSequenceMap.get("regionCode");
                         plotCode = maxSequenceMap.get("plotCode");
@@ -2070,6 +2061,65 @@ public class ProjectImpl implements ProjectService {
 
 
 
+    /**
+     * 远程获取第三方最大序号
+     * 然后根据规则生成预赋不动产单元号
+     * @param projectId
+     * @param nodeId
+     * @return
+     */
+    @Override
+    public Map<String, String> getThirdMaxSequence(String projectId, String nodeId,String detailsId) {
+        Map<String, String> retMap = new LinkedHashMap<>();
+        Project project = projectMapper.get(projectId);
+        String firstPlotCode = project.getFirstPlotCode();
+        String secondPlotCode = project.getSecondPlotCode();
+        if (com.siwei.common.core.utils.StringUtils.isEmpty(firstPlotCode)) {
+            firstPlotCode = "G";
+        }
+        if (com.siwei.common.core.utils.StringUtils.isEmpty(secondPlotCode)) {
+            secondPlotCode = "B";
+        }
+
+        //获取地籍子区的代码
+        String regionCode = "";
+        //当前地块所属地籍子区编号
+        Map<String, String> detailGeomBelongToDjzqMap = nodeLandService.getDjzqContainsNodeList(detailsId);
+        if (!MapUtils.isEmpty(detailGeomBelongToDjzqMap)) {
+            regionCode = detailGeomBelongToDjzqMap.get("djzqdm");
+        }
+
+        log.info("这里计算地籍子区的代码,区域号:{}", regionCode);
+        //这里三方接口入参
+        retMap.put("maxSequence", "");
+        retMap.put("plotCode", firstPlotCode + secondPlotCode);
+        retMap.put("regionCode", regionCode);
+        retMap.put("code", "201");
+
+        if (com.siwei.common.core.utils.StringUtils.isNotBlank(regionCode)) {
+            retMap.put("code", "200");
+            try{
+                Map<String,Object> paramMap = new LinkedHashMap<>();
+                paramMap.put("regionCode",regionCode+firstPlotCode + secondPlotCode);
+                //这里调用 httpClient 进行远程调用
+                String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.getMaxSeq.datas",paramMap);
+                log.info("远程获取最大序列号解析数据为:{}", remoteResult);
+
+                JSONObject root = JSON.parseObject(remoteResult);
+                JSONObject innerData = root.getJSONObject("data");
+
+                if(innerData.get("code").equals("200") && com.siwei.common.core.utils.StringUtils.isNumeric(String.valueOf(innerData.get("maxsequence")))){
+                    retMap.put("maxSequence", innerData.get("maxsequence").toString());
+                }
+            }  catch (Exception e) {
+                log.error("调用矢量保存文件错误,区域号:{}", regionCode,e);
+            }
+        }else {
+            log.error("远程获取最大序列号-计算区域代码为空-项目号:{},", projectId);
+        }
+        return retMap;
+    }
+
 
 
     /**

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

@@ -21,14 +21,6 @@ public interface TakeDataService {
     String add(TakeDataAddVo takeDataAddVo);
 
 
-    /**
-     * 获取三方数据最大序列号
-     * @param projectId
-     * @param nodeId
-     * @param detailsId
-     * @return
-     */
-    Map<String, String> getThirdMaxSequence(String projectId,String nodeId,String detailsId);
 
     Map<String, Object> remoteLandFirstRegistration(ThirdRecordStatusParamVo paramVo);
 

+ 74 - 73
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/TakeDataServiceImpl.java

@@ -3,24 +3,25 @@ package com.siwei.apply.service.third.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.databind.JsonNode;
 import com.siwei.apply.domain.*;
 
 import com.siwei.apply.domain.vo.*;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
 
 import com.siwei.apply.mapper.*;
-import com.siwei.apply.service.GyjsydjfwscdjService;
-import com.siwei.apply.service.GyjsydscdjService;
-import com.siwei.apply.service.NodeAttachmentService;
-import com.siwei.apply.service.NodeLandService;
+import com.siwei.apply.service.*;
 import com.siwei.apply.service.third.TakeDataService;
+import com.siwei.apply.utils.ArcGisUtil;
 import com.siwei.apply.utils.HttpClientUtil;
 import com.siwei.apply.utils.ServiceUtil;
+import com.siwei.common.core.domain.R;
 import com.siwei.common.core.exception.ServiceException;
 import com.siwei.common.core.utils.DateUtils;
 import com.siwei.common.core.utils.StringUtils;
 import com.siwei.common.core.utils.bean.BeanUtils;
 import com.siwei.spatial.api.RemoteSpatialFilesDbService;
+import com.siwei.spatial.api.domain.file.TGeomDb;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
@@ -74,6 +75,17 @@ public class TakeDataServiceImpl implements TakeDataService {
     @Autowired
     private FwmxMapper fwmxMapper;
 
+    @Autowired
+    private  LandOneCodeMapper landOneCodeMapper;
+
+
+    @Autowired
+    LandOneCodeService landOneCodeService;
+
+
+    @Autowired
+    ProjectService projectService;
+
 
 
     @Override
@@ -82,8 +94,6 @@ public class TakeDataServiceImpl implements TakeDataService {
         return "1";
     }
 
-
-
     /**
      * 同步土地或房屋首次登记数据
      * @param projectId
@@ -139,65 +149,6 @@ public class TakeDataServiceImpl implements TakeDataService {
 
 
 
-    /**
-     * 远程获取第三方最大序号
-     * 然后根据规则生成预赋不动产单元号
-     * @param projectId
-     * @param nodeId
-     * @return
-     */
-    @Override
-    public Map<String, String> getThirdMaxSequence(String projectId, String nodeId,String detailsId) {
-        Map<String, String> retMap = new LinkedHashMap<>();
-        Project project = projectMapper.get(projectId);
-        String firstPlotCode = project.getFirstPlotCode();
-        String secondPlotCode = project.getSecondPlotCode();
-        if (StringUtils.isEmpty(firstPlotCode)) {
-            firstPlotCode = "G";
-        }
-        if (StringUtils.isEmpty(secondPlotCode)) {
-            secondPlotCode = "B";
-        }
-
-        //获取地籍子区的代码
-        String regionCode = "";
-        //当前地块所属地籍子区编号
-        Map<String, String> detailGeomBelongToDjzqMap = nodeLandService.getDjzqContainsNodeList(detailsId);
-        if (!MapUtils.isEmpty(detailGeomBelongToDjzqMap)) {
-            regionCode = detailGeomBelongToDjzqMap.get("djzqdm");
-        }
-
-        log.info("这里计算地籍子区的代码,区域号:{}", regionCode);
-        //这里三方接口入参
-        retMap.put("maxSequence", "");
-        retMap.put("plotCode", firstPlotCode + secondPlotCode);
-        retMap.put("regionCode", regionCode);
-        retMap.put("code", "201");
-
-        if (StringUtils.isNotBlank(regionCode)) {
-            retMap.put("code", "200");
-            try{
-                Map<String,Object> paramMap = new LinkedHashMap<>();
-                paramMap.put("regionCode",regionCode+firstPlotCode + secondPlotCode);
-                //这里调用 httpClient 进行远程调用
-                String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.getMaxSeq.datas",paramMap);
-                log.info("远程获取最大序列号解析数据为:{}", remoteResult);
-
-                JSONObject root = JSON.parseObject(remoteResult);
-                JSONObject innerData = root.getJSONObject("data");
-
-                if(innerData.get("code").equals("200") && StringUtils.isNumeric(String.valueOf(innerData.get("maxsequence")))){
-                    retMap.put("maxSequence", innerData.get("maxsequence").toString());
-                }
-            }  catch (Exception e) {
-                log.error("调用矢量保存文件错误,区域号:{}", regionCode,e);
-            }
-        }else {
-            log.error("远程获取最大序列号-计算区域代码为空-项目号:{},", projectId);
-        }
-        return retMap;
-    }
-
 
     @Override
     public Map<String, String> getImmobileCode(String projectId) {
@@ -244,6 +195,11 @@ public class TakeDataServiceImpl implements TakeDataService {
         if (StringUtils.isBlank(yfbdcdyh)) {
             throw new ServiceException("预赋不动产单元号为空");
         }
+        String bdcdyh = paramVo.getBdcdyh();
+        if (StringUtils.isBlank(bdcdyh)) {
+            throw new ServiceException("不动产单元号为空");
+        }
+
         String ywh = paramVo.getYwh();
         if (StringUtils.isBlank(ywh)) {
             throw new ServiceException("业务编号为空");
@@ -257,7 +213,7 @@ public class TakeDataServiceImpl implements TakeDataService {
         try {
             Map<String,Object> paramMap = new LinkedHashMap<>();
             paramMap.put("ywbh",ywh);
-            paramMap.put("yfbdcdyh",yfbdcdyh);
+            //paramMap.put("yfbdcdyh",yfbdcdyh);
 
             String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.landRegist.datas",paramMap);
             JSONObject root = JSON.parseObject(remoteResult);
@@ -285,6 +241,48 @@ public class TakeDataServiceImpl implements TakeDataService {
                 retMap.put("projectId",projectId);
                 retMap.put("nodeId",addNodeId);
             }
+        } catch (Exception e) {
+            log.error("调用不动产基本信息保存错误,业务编号:{}: ", ywh);
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+
+
+        //todo 这里进行远程请求,获取不动产矢量数据
+        try {
+
+            String projectId = retMap.get("projectId").toString();
+            String nodeId = retMap.get("nodeId").toString();
+
+            ArcGisUtil client = new ArcGisUtil(ArcGisUtil.ARCGIS_BASE_URL, ArcGisUtil.LAYER_ID, ArcGisUtil.SRID);
+            String where = "BDCDYH='"+bdcdyh+"'";
+            JsonNode page = client.query(where, ArcGisUtil.WITH_GEOMETRY, 0, ArcGisUtil.PAGE_SIZE);
+            log.info("run get ArcGIS service  OK: {} (layer={}, srid={})", ArcGisUtil.PAGE_SIZE, ArcGisUtil.LAYER_ID, ArcGisUtil.SRID);
+            JsonNode features = page.path("features");
+            JsonNode f = features.get(0);
+            if (ArcGisUtil.WITH_GEOMETRY) {
+                JsonNode rings = f.path("geometry").path("rings");
+                String ewkt4490 = client.ringsToEwkt(rings);
+                log.info("ewkt OK: {} ", ewkt4490);
+                // 这里进行数据入库更新建立关联
+                Map<String, Object> map = new HashMap<>();
+                map.put("geoms", ewkt4490);
+                map.put("sourceType", "bdc");
+                R<TGeomDb> saveGeomRes = remoteSpatialFilesDbService.saveGeom(map);
+                TGeomDb tGeomDb = saveGeomRes.getData();
+                log.info("远程调用geom保存,返回结果:{}", tGeomDb);
+                //这里保存geom映射关系
+                nodeLandService.createNodeLand(nodeId, tGeomDb.getId());
+                //预赋码逻辑
+                projectService.addPreAssignCode(nodeId,projectId,tGeomDb.getId(),0);
+                //这里进行上链操作:
+                gyjsydscdjService.updateHasOnchain(nodeId,true);
+                // 更新项目表的上链数量
+                projectService.countOnChinaNum(projectId);
+                //这里生成资源吗
+                landOneCodeService.addOrUpdateLandOneCodeInfo(projectId,nodeId);
+            }
+
         } catch (Exception e) {
             log.error("调用矢量保存文件错误,业务编号:{}: ", ywh);
             e.printStackTrace();
@@ -390,8 +388,6 @@ public class TakeDataServiceImpl implements TakeDataService {
 
 
 
-
-
     public String  addOrUpdateLandFirstRegistration(LandFirstParamVo body,String projectId,String needUpdateNodeId) {
         String addNodeId = "";
         if (StringUtils.isNotBlank(needUpdateNodeId)) {
@@ -785,11 +781,16 @@ public class TakeDataServiceImpl implements TakeDataService {
             updateVo.setTbzt("1");
             thirdRecordStatusMapper.updateById(updateVo);
 
-            //这里需要更新绑定关系
-            ProjectImmobileCode updateImmobileCode = new ProjectImmobileCode();
-            updateImmobileCode.setCode(bdcdyh);
-            updateImmobileCode.setPreAssignCode(yfbdcdyh);
-            projectImmobileCodeMapper.updateByPreCode(updateImmobileCode);
+            ProjectImmobileCode immobileCodeRes = projectImmobileCodeMapper.selectByPreAssignCode(yfbdcdyh);
+            if(Objects.nonNull(immobileCodeRes)){
+                //这里需要更新绑定关系
+                ProjectImmobileCode updateImmobileCode = new ProjectImmobileCode();
+                updateImmobileCode.setCode(bdcdyh);
+                projectImmobileCodeMapper.updateById(updateImmobileCode);
+                //这里需要更新当前项目的不动产登记号(保证资源码正确)
+                String projectId = immobileCodeRes.getProjectId();
+                landOneCodeMapper.updateCodeByProjectId(projectId,bdcdyh);
+            }
             return body.getId();
         }).exceptionally(e -> {
             log.error("不动产远程抓取数据失败: ywh={}, ywlx={}", ywh, ywlx, e);

+ 174 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ArcGisUtil.java

@@ -0,0 +1,174 @@
+package com.siwei.apply.utils;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.URI;
+import java.net.URLEncoder;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.nio.charset.StandardCharsets;
+import java.sql.*;
+import java.time.Duration;
+import java.util.*;
+
+
+/**
+ * arcgis rest api 工具类,支持分页查询 features、转换 rings 为 PostGIS EWKT。
+ */
+public class ArcGisUtil {
+
+    private static final Logger log = LoggerFactory.getLogger(ArcGisUtil.class);
+    public static final int PAGE_SIZE = 1000;
+    public static final int LAYER_ID = 0;
+    public static final int SRID = 4490;
+    public static final boolean WITH_GEOMETRY = true;
+    public static final String ARCGIS_BASE_URL = "http://192.168.100.1:6080/arcgis/rest/services/GJXQ/BDC_DBZD/MapServer";
+
+    private final ObjectMapper mapper = new ObjectMapper();
+
+    private final String base;
+    private final int layerId;
+    private final int srid;
+    private final HttpClient http;
+
+    public ArcGisUtil(String base, int layerId, int srid) {
+        this.base = base.endsWith("/") ? base.substring(0, base.length() - 1) : base;
+        this.layerId = layerId;
+        this.srid = srid;
+        this.http = HttpClient.newBuilder()
+                .connectTimeout(Duration.ofSeconds(15))
+                .version(HttpClient.Version.HTTP_1_1)
+                .build();
+    }
+
+
+
+    /**
+     * 拉取一页 features
+     *
+     * @param where           ArcGIS SQL92 过滤条件;查全部传 "1=1"
+     * @param returnGeometry  true=带 geometry;只要属性传 false
+     * @param offset          分页起点 (resultOffset)
+     * @param count           分页大小 (resultRecordCount),不超过服务 maxRecordCount
+     * @return 完整 query 响应(features + exceededTransferLimit)
+     */
+    public JsonNode query(String where, boolean returnGeometry, int offset, int count) throws Exception {
+        String qs = "where=" + encode(where)
+                + "&outFields=*"
+                + "&returnGeometry=" + returnGeometry
+                + "&outSR=" + srid
+                + "&resultOffset=" + offset
+                + "&resultRecordCount=" + count
+                + "&orderByFields=OBJECTID+ASC"
+                + "&f=json";
+
+        HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/" + layerId + "/query?" + qs))
+                .header("Accept", "application/json")
+                .timeout(Duration.ofSeconds(120)).GET().build();
+
+        HttpResponse<String> resp = http.send(req, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
+        if (resp.statusCode() != 200) {
+            String body = resp.body();
+            throw new RuntimeException("ArcGIS HTTP " + resp.statusCode()
+                    + " : " + body.substring(0, Math.min(400, body.length())));
+        }
+        JsonNode root = mapper.readTree(resp.body());
+        if (root.has("error") && !root.get("error").isNull()) {
+            throw new RuntimeException("ArcGIS error: " + root.get("error"));
+        }
+        return root;
+    }
+
+    /**
+     * ArcGIS rings 转换为 EWKT (PostGIS 扩展)。
+     *
+     * <p>ArcGIS rings 结构 {@code [[[lng,lat],...],...]},仅取第一个环并显式闭合。
+     * 通过 JTS WKTReader 重解析几何对象,强制按右手规则确定外环,确保 PostGIS 接受。</p>
+     *
+     * <p>本实现只处理最常见的「单外环、无洞」宗地。带洞或多面的图斑需要在 GIS 工具
+     * 中合并或重绘后再入 ArcGIS 层。</p>
+     *
+     * @return 形如 {@code SRID=4490;POLYGON((x y, x y, ..., x y))},入参为空时返回 null
+     */
+    public String ringsToEwkt(JsonNode rings) throws Exception {
+        if (rings == null || !rings.isArray() || rings.isEmpty()) return null;
+        JsonNode firstRing = rings.get(0);
+        if (!firstRing.isArray() || firstRing.isEmpty()) return null;
+        StringBuilder pts = new StringBuilder();
+        for (int i = 0; i < firstRing.size(); i++) {
+            JsonNode pt = firstRing.get(i);
+            double x = pt.get(0).asDouble();
+            double y = pt.get(1).asDouble();
+            if (i > 0) pts.append(", ");
+            pts.append(String.format("%.6f %.6f", x, y));
+        }
+        // 显式闭合:首末相同,便于 WKTReader 严格解析
+        JsonNode head = firstRing.get(0);
+        pts.append(", ").append(String.format("%.6f %.6f", head.get(0).asDouble(), head.get(1).asDouble()));
+        // ========= 修改1:外层改为 MULTIPOLYGON 包裹 =========
+        String wkt = "MULTIPOLYGON(((" + pts + ")))";
+        org.locationtech.jts.geom.Geometry jts = new org.locationtech.jts.io.WKTReader().read(wkt);
+        // ========= 修改2:固定SRID=4490 =========
+        return "SRID=" + srid + ";" + jts.toText();
+    }
+
+
+
+    /**
+     * 只取要素总数(用于同步前估算总量)。
+     */
+    public long count(String where) throws Exception {
+        String qs = "where=" + encode(where)
+                + "&returnCountOnly=true"
+                + "&f=json";
+        HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/" + layerId + "/query?" + qs))
+                .timeout(Duration.ofSeconds(60)).GET().build();
+        HttpResponse<String> resp = http.send(req, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
+        if (resp.statusCode() != 200) {
+            throw new RuntimeException("ArcGIS HTTP " + resp.statusCode());
+        }
+        JsonNode root = mapper.readTree(resp.body());
+        return root.path("count").asLong(-1);
+    }
+
+    private static String encode(String s) {
+        return URLEncoder.encode(s, StandardCharsets.UTF_8);
+    }
+
+
+    /**
+     *
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String[] args) throws Exception {
+        String arcgisBase = "http://192.168.100.1:6080/arcgis/rest/services/GJXQ/BDC_DBZD/MapServer";
+        int layerId = 0;
+        int srid = 4490;          // CGCS2000 经纬度;如取 4527(3度带)同步改这里
+        ArcGisUtil client = new ArcGisUtil(arcgisBase, layerId, srid);
+        boolean withGeometry = true;
+        //String where = "BDCDYH='360425005005GN00002W00000000'";
+        String where = "BDCDYH='360425005005GB60012W00000000'";
+        //String where = "BDCDYH='360122014004GB00091F00040022'";
+        JsonNode page = client.query(where, withGeometry, 0, PAGE_SIZE);
+        JsonNode features = page.path("features");
+        //int n = features.size();
+        JsonNode f = features.get(0);
+        JsonNode attrs = f.path("attributes");
+        String ewkt = null;
+        if (withGeometry) {
+            JsonNode rings = f.path("geometry").path("rings");
+            ewkt = client.ringsToEwkt(rings);
+            log.info("ewkt OK: {} ", ewkt);
+        }
+        log.info("ArcGIS OK: {} (layer={}, srid={})", arcgisBase, layerId, srid);
+    }
+
+
+
+
+}

+ 6 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ServiceFileUtil.java

@@ -106,12 +106,15 @@ public class ServiceFileUtil {
             logger.warn("目录不存在: {}", directoryPath);
             throw new ServiceException("目录不存在: " + directoryPath);
         }
-        //这里拼接文件名
+
+        //这里拼接文件名,把前缀去掉
+        String tmpFileName = file.getFileName().toString().replaceAll("_\\d+A\\d+\\.",".");
         if (directoryPath.endsWith("/")) {
-            directoryPath += file.getFileName();
+            directoryPath += tmpFileName;
         } else {
-            directoryPath += "/" + file.getFileName();
+            directoryPath += "/" + tmpFileName;
         }
+
         dirPath = Paths.get(directoryPath);
         try {
             //Files.copy(file, dirPath, StandardCopyOption.REPLACE_EXISTING);

+ 7 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/LandOneCodeMapper.xml

@@ -76,4 +76,11 @@
             resource_project_code = #{resourceProjectCode}
         WHERE project_workflow_id = #{projectWorkflowId}
     </update>
+
+    <update id="updateCodeByProjectId" parameterType="com.siwei.apply.domain.LandOneCode">
+        UPDATE t_land_one_code
+        SET resource_immobile_code = #{resourceImmobileCode}
+        WHERE project_id = #{projectId}
+    </update>
+
 </mapper>

+ 157 - 80
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

@@ -405,16 +405,16 @@
     <select id="getListSearch" parameterType="com.siwei.apply.domain.vo.ProjectFilterVo"  resultMap="SearchProjectUnionMap">
             <if test="filterType==0 or filterType==1">
                 SELECT
-                P."id" AS ID,
-                P."name" AS NAME,
-                P."code" AS code,
-                P."company" AS company,
-                P."created_at" AS createAt,
-                P."updated_at" AS updateAt,
-                P."project_type" AS projectType,
-                P."on_chain_num" AS onChainNum,
-                P."creator_id" AS creatorId,
-                P."updated_at" AS updatedAt,
+                "id" AS ID,
+                "name" AS NAME,
+                "code" AS code,
+                "company" AS company,
+                "created_at" AS createAt,
+                "updated_at" AS updateAt,
+                "project_type" AS projectType,
+                "on_chain_num" AS onChainNum,
+                "creator_id" AS creatorId,
+                "updated_at" AS updatedAt,
                 '1'  AS selectType,
                 '' AS attachmentId,
                 '' AS nodeId,
@@ -423,37 +423,61 @@
                 ''  AS resourceCode,
                 ''  AS zl,
                 ''  AS area
-                FROM  PUBLIC.t_project P
-
+                from (
+                    SELECT P.*,
+                    (SELECT  hbcrfapfwh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) hbcrfapfwh,
+                    (SELECT  hbcrhtbh   FROM "public"."t_tdgy"  WHERE   project_id  = P.id) hbcrhtbh,
+                    (SELECT  dzjgh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) dzjgh
+                    FROM  PUBLIC.t_project P
+                    where 	 1=1
+                    <if test="isOnchain != null and isOnchain">
+                        AND on_chain_num > 0
+                    </if>
+                ) as t_out
                 <where>
                     <if test="keyWords != null and keyWords.size() > 0">
-                        regexp_like(P.name,
+                        regexp_like(t_out.name,
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
                         OR
-                        regexp_like(P.code,
+                        regexp_like(t_out.code,
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
                         OR
-                        regexp_like(P.company,
+                        regexp_like(t_out.company,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.hbcrfapfwh,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.hbcrhtbh,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.dzjgh,
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
-                    </if>
-                    <if test="isOnchain != null and isOnchain">
-                        AND on_chain_num > 0
                     </if>
                 </where>
             </if>
 
-                <if test="filterType==0">
-                    UNION
-                </if>
+            <if test="filterType==0">
+                UNION
+            </if>
 
             <if test="filterType==0 or filterType==2">
                 SELECT
@@ -530,6 +554,7 @@
                     <if test="keyWords != null and keyWords.size() > 0">
                         regexp_like((code.resource_immobile_code || code.resource_business_code || code.resource_project_code),
                         REGEXP_REPLACE(
+
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
@@ -550,47 +575,72 @@
         FROM (
             <if test="filterType==0 or filterType==1">
                 SELECT
-                P."id" AS ID,
-                P."name" AS NAME,
-                P."code" AS code,
-                P."company" AS company,
-                P."created_at" AS createAt,
-                P."updated_at" AS updateAt,
-                P."project_type" AS projectType,
-                P."on_chain_num" AS onChainNum,
-                P."creator_id" AS creatorId,
-                P."updated_at" AS updatedAt,
+                "id" AS ID,
+                "name" AS NAME,
+                "code" AS code,
+                "company" AS company,
+                "created_at" AS createAt,
+                "updated_at" AS updateAt,
+                "project_type" AS projectType,
+                "on_chain_num" AS onChainNum,
+                "creator_id" AS creatorId,
+                "updated_at" AS updatedAt,
                 '1'  AS selectType,
                 '' AS attachmentId,
-                '' AS nodeId  ,
+                '' AS nodeId,
                 '' AS fileName,
                 '' AS  filePath,
                 ''  AS resourceCode,
                 ''  AS zl,
                 ''  AS area
+                from (
+                SELECT P.*,
+                (SELECT  hbcrfapfwh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) hbcrfapfwh,
+                (SELECT  hbcrhtbh   FROM "public"."t_tdgy"  WHERE   project_id  = P.id) hbcrhtbh,
+                (SELECT  dzjgh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) dzjgh
                 FROM  PUBLIC.t_project P
+                where 	 1=1
+                <if test="isOnchain != null and isOnchain">
+                    AND on_chain_num > 0
+                </if>
+                ) as t_out
                 <where>
                     <if test="keyWords != null and keyWords.size() > 0">
-                        regexp_like(P.name,
+                        regexp_like(t_out.name,
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
                         OR
-                        regexp_like(P.code,
+                        regexp_like(t_out.code,
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
                         OR
-                        regexp_like(P.company,
+                        regexp_like(t_out.company,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.hbcrfapfwh,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.hbcrhtbh,
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                        OR
+                        regexp_like(t_out.dzjgh,
                         REGEXP_REPLACE(
                         <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
                         , '[\r\n\s]+', '', 'g')
                         , 'i')
-                    </if>
-                    <if test="isOnchain != null and isOnchain">
-                        AND on_chain_num > 0
                     </if>
                 </where>
             </if>
@@ -693,51 +743,78 @@
     <select id="getSearchProjectCount" parameterType="com.siwei.apply.domain.vo.ProjectFilterVo" resultType="int">
         SELECT COUNT(*)
         FROM (
-                SELECT
-                P."id" AS ID,
-                P."name" AS NAME,
-                P."code" AS code,
-                P."company" AS company,
-                P."created_at" AS createAt,
-                P."updated_at" AS updateAt,
-                P."project_type" AS projectType,
-                P."on_chain_num" AS onChainNum,
-                P."creator_id" AS creatorId,
-                P."updated_at" AS updatedAt,
-                '1'  AS selectType,
-                '' AS attachmentId,
-                '' AS nodeId  ,
-                '' AS fileName,
-                '' AS  filePath
-                FROM  PUBLIC.t_project P
-                <where>
-                    <if test="keyWords != null and keyWords.size() > 0">
-                        regexp_like(P.name,
-                        REGEXP_REPLACE(
-                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
-                        , '[\r\n\s]+', '', 'g')
-                        , 'i')
-                        OR
-                        regexp_like(P.code,
-                        REGEXP_REPLACE(
-                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
-                        , '[\r\n\s]+', '', 'g')
-                        , 'i')
-                        OR
-                        regexp_like(P.company,
-                        REGEXP_REPLACE(
-                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
-                        , '[\r\n\s]+', '', 'g')
-                        , 'i')
-                    </if>
-                    <if test="isOnchain != null and isOnchain">
-                        AND on_chain_num > 0
-                    </if>
-                </where>
+            SELECT
+            "id" AS ID,
+            "name" AS NAME,
+            "code" AS code,
+            "company" AS company,
+            "created_at" AS createAt,
+            "updated_at" AS updateAt,
+            "project_type" AS projectType,
+            "on_chain_num" AS onChainNum,
+            "creator_id" AS creatorId,
+            "updated_at" AS updatedAt,
+            '1'  AS selectType,
+            '' AS attachmentId,
+            '' AS nodeId,
+            '' AS fileName,
+            '' AS  filePath,
+            ''  AS resourceCode,
+            ''  AS zl,
+            ''  AS area
+            from (
+            SELECT P.*,
+            (SELECT  hbcrfapfwh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) hbcrfapfwh,
+            (SELECT  hbcrhtbh   FROM "public"."t_tdgy"  WHERE   project_id  = P.id) hbcrhtbh,
+            (SELECT  dzjgh   FROM "public"."t_tdgy" 	WHERE   project_id  = P.id) dzjgh
+            FROM  PUBLIC.t_project P
+            where 	 1=1
+            <if test="isOnchain != null and isOnchain">
+                AND on_chain_num > 0
+            </if>
+            ) as t_out
+            <where>
+                <if test="keyWords != null and keyWords.size() > 0">
+                    regexp_like(t_out.name,
+                    REGEXP_REPLACE(
+                    <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                    , '[\r\n\s]+', '', 'g')
+                    , 'i')
+                    OR
+                    regexp_like(t_out.code,
+                    REGEXP_REPLACE(
+                    <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                    , '[\r\n\s]+', '', 'g')
+                    , 'i')
+                    OR
+                    regexp_like(t_out.company,
+                    REGEXP_REPLACE(
+                    <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                    , '[\r\n\s]+', '', 'g')
+                    , 'i')
+                    OR
+                    regexp_like(t_out.hbcrfapfwh,
+                    REGEXP_REPLACE(
+                    <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                    , '[\r\n\s]+', '', 'g')
+                    , 'i')
+                    OR
+                    regexp_like(t_out.hbcrhtbh,
+                    REGEXP_REPLACE(
+                    <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                    , '[\r\n\s]+', '', 'g')
+                    , 'i')
+                    OR
+                    regexp_like(t_out.dzjgh,
+                    REGEXP_REPLACE(
+                    <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                    , '[\r\n\s]+', '', 'g')
+                    , 'i')
+                </if>
+            </where>
         ) AS distinct_projects
     </select>
 
-
     <select id="getSearchAttachmentCount" parameterType="com.siwei.apply.domain.vo.ProjectFilterVo" resultType="int">
         SELECT COUNT(*)
         FROM (

+ 4 - 2
siwei-modules/siwei-apply/src/main/resources/mapper/TdgyMapper.xml

@@ -24,6 +24,7 @@
         <result property="gdUnit" column="gd_unit"/>
         <result property="nf" column="nf"/>
         <result property="bz" column="bz"/>
+        <result property="dzjgh" column="dzjgh"/>
     </resultMap>
 
     <select id="isExit" resultType="Boolean">
@@ -36,11 +37,11 @@
     <insert id="add" parameterType="com.siwei.apply.domain.Tdgy">
         INSERT INTO t_tdgy (id, project_id, srf, tdyt, jswz,
                             gd_area, gd_type, has_zz, hbcrfapfwh, hbcrhtbh,
-                            hbcrht_date, gd_unit, bz, has_onchain, creator_id,
+                            hbcrht_date, gd_unit, dzjgh, bz, has_onchain, creator_id,
                             created_at, updated_at)
         VALUES (#{id}, #{projectId}, #{srf}, #{tdyt}, #{jswz},
                 #{gdArea}, #{gdType}, #{hasZz}, #{hbcrfapfwh}, #{hbcrhtbh},
-                #{hbcrhtDate}, #{gdUnit}, #{bz}, false, #{creatorId},
+                #{hbcrhtDate}, #{gdUnit}, #{dzjgh}, #{bz}, false, #{creatorId},
                 now(), now())
     </insert>
 
@@ -74,6 +75,7 @@
             <if test="hbcrhtDate != null">hbcrht_date = #{hbcrhtDate},</if>
             <if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
             <if test="gdUnit != null">gd_unit = #{gdUnit},</if>
+            <if test="dzjgh != null">dzjgh = #{dzjgh},</if>
             <if test="bz != null">bz = #{bz},</if>
             updated_at = now()
         </set>

+ 14 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/cadastre/ZdbhqkMapper.xml

@@ -39,6 +39,20 @@
         WHERE valid_flag = 0
     </select>
 
+    <select id="selectZdbhqkList"  resultMap="BaseResultMap">
+        SELECT *
+        FROM  vector.zdbhqk
+        where  valid_flag = 0
+        <if test="zddm != null and zddm != ''">
+            and zddm = #{zddm}
+        </if>
+        <if test="bdcdyh != null and bdcdyh != ''">
+            and bdcdyh = #{bdcdyh}
+        </if>
+        ORDER BY ywh DESC
+    </select>
+
+
     <update id="update" parameterType="com.siwei.apply.domain.cadastre.Zdbhqk">
         UPDATE vector.zdbhqk
         <set>

+ 3 - 0
siwei-modules/siwei-spatial/src/main/java/com/siwei/spatial/controller/file/SpatialFilesDbController.java

@@ -161,6 +161,9 @@ public class SpatialFilesDbController extends BaseController {
         }else if(sourceType.equalsIgnoreCase("excel")){//兼容一键导入数据
             List<String> gdIdList = (List<String>) geoms.get("gdIdList");
             return R.ok(iSpatialFilesDbService.excelImportGeom(gdIdList));
+        }else if(sourceType.equalsIgnoreCase("bdc")){//兼容不动产数据
+            String geomData =  String.valueOf(geoms.get("geoms"));
+            return R.ok(iSpatialFilesDbService.bdcArcgisGeom(geomData));
         }
         return null;
     }

+ 2 - 2
siwei-modules/siwei-spatial/src/main/java/com/siwei/spatial/service/file/ISpatialFilesDbService.java

@@ -29,14 +29,14 @@ public interface ISpatialFilesDbService {
 
     String testInsertShpZD(List<Map<String,Object>> shpDataMapList);
 
-
     void  dealShpFileDownLoad(HttpServletResponse response, String ysdm );
 
-
     void writeShapefileByTable(String tableName, String filePath, String fileName) throws Exception ;
 
     TGeomDb excelImportGeom(List<String> gdIdList);
 
+    TGeomDb bdcArcgisGeom(String geoms);
+
     List<Map<String, Object>> readShpFileByPath(String shpFilePath) throws IOException;
 
 }

+ 40 - 0
siwei-modules/siwei-spatial/src/main/java/com/siwei/spatial/service/file/impl/SpatialFilesDbServiceImpl.java

@@ -494,6 +494,46 @@ public class SpatialFilesDbServiceImpl implements ISpatialFilesDbService {
         return dto;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public TGeomDb bdcArcgisGeom(String geoms){
+        String tDbId = IdUtils.fastSimpleUUID();
+        Long sort = 0L;
+        if(StringUtils.isNotBlank(geoms)) {
+            String shpGeom = geoms;
+            TGeomDbDetails detailsDTO = new TGeomDbDetails();
+            detailsDTO.setShpDbSRID(shpDbSRID);
+            detailsDTO.setShpAreaSRID(shpAreaSRID);
+            detailsDTO.setShpOutSRID(shpOutSRID);
+            detailsDTO.setShpAreaGeography(shpAreaGeography);
+            detailsDTO.setId(IdUtils.fastSimpleUUID());
+            detailsDTO.setUploadId(tDbId);
+            //直接获取geom
+            detailsDTO.setGeom(shpGeom);
+            detailsDTO.setSort(sort);
+            //这里如何获取其他属性
+            detailsDTO.setGeomJson("{\"id\":\"" + detailsDTO.getId() + "\"}");
+            itGeomDbDetailsService.insertTGeomDbDetails(detailsDTO);
+        }
+
+        TGeomDb dto = new TGeomDb();
+        dto.setId(tDbId);
+        dto.setName("bdc_data");
+        dto.setShppath("0");
+        dto.setFiletype("4");
+        dto.setFromroute("remote");
+
+        TGeomDb retDto = itGeomDbDetailsService.sumGeomDetailsByUploadId(tDbId);
+        dto.setGeom(retDto.getGeom());
+        dto.setGeomNumber(retDto.getGeomNumber());
+        dto.setGeomArea(retDto.getGeomArea());
+        dto.setShpDbSRID(shpDbSRID);
+        dto.setShpAreaSRID(shpAreaSRID);
+        dto.setShpOutSRID(shpOutSRID);
+        dto.setShpAreaGeography(shpAreaGeography);
+        itGeomDbService.insertTGeomDb(dto);
+        return dto;
+    }
 
 
     //todo 这里文件上传获取矢量处理