chenendian 1 viikko sitten
vanhempi
commit
a043a4319f

+ 43 - 12
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/DealExcelServiceImpl.java

@@ -8,11 +8,16 @@ import com.siwei.apply.domain.res.TdgyRes;
 import com.siwei.apply.domain.vo.ProjectVo;
 import com.siwei.apply.domain.vo.TdgyVo;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
+import com.siwei.apply.mapper.CadastreFileMapper;
 import com.siwei.apply.mapper.LandTypeMapper;
 import com.siwei.apply.mapper.ProjectWorkflowMapper;
 import com.siwei.apply.service.*;
+import com.siwei.common.core.domain.R;
 import com.siwei.common.core.utils.StringUtils;
+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.io.FileUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -59,6 +64,17 @@ public class DealExcelServiceImpl{
     private YdbpDataService ydbpDataService;
 
 
+    @Autowired
+    private RemoteSpatialFilesDbService remoteSpatialFilesDbService;
+
+    @Autowired
+    private CadastreFileMapper cadastreFileMapper;
+
+
+
+
+
+
 
     /**
      * 检查excel数据到数据库
@@ -92,8 +108,6 @@ public class DealExcelServiceImpl{
                 writeToLog("tdgy_err.log","行("+i+")项目类型不合法,项目类型只能是单独选址或者批次报批");
             }
         }
-
-
         return "successs";
     }
 
@@ -101,6 +115,7 @@ public class DealExcelServiceImpl{
 
 
 
+
     /**
      * 添加excel数据到数据库
      * @param dataMap
@@ -227,28 +242,44 @@ public class DealExcelServiceImpl{
                 log.info("关于项目{}的土地供应环节,文件{}关联结果{}", projectId, nodeFileName, nodeAttachmentId);
             }
 
+
+            //矢量数据处理  -- 数据治理文件名
+            try {
+                String dzjgh = jdMap.get("划拨决定书/出让合同电子监管号");
+                String ywh = "dzjgh = " + "'"+dzjgh+"'";
+                List<Map<String,Object>> gdRes = cadastreFileMapper.selectTableDataByCondition("","gj_gd_data","",ywh);
+
+                log.info("获取excel中电子监管号:{}", dzjgh);
+                List<String> gdIdList = gdRes.stream().filter(s->s.get("dzjgh")!=null).map(s->s.get("gid").toString()).collect(Collectors.toList());
+                log.info("获取供地图层gid为:{}", gdIdList);
+
+                if(CollectionUtils.isNotEmpty(gdIdList)){
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("geomData", gdIdList);
+                    map.put("sourceType", "excel");
+                    R<TGeomDb> saveGeomRes = remoteSpatialFilesDbService.saveGeom(map);
+                    TGeomDb tGeomDb = saveGeomRes.getData();
+                    log.info("远程调用geom保存,返回结果:{}", tGeomDb);
+                    //这里保存geom映射关系
+                    nodeLandService.createNodeLand(id, tGeomDb.getId());
+                }
+
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+
             // -----------------第二部分增加项目关联的(土地供应)环节结束-------------------------------
             i++;
             if (i>2) {
                 log.warn("目前只支持处理一条土地供应数据,后续增加处理逻辑");
                 break;
             }
-
-
-
-
-
-
         }
         return "successs";
     }
 
 
 
-
-
-
-
     public static String copyFileToDirectory(String sourceFilePath, String targetDirectoryPath,String FileName){
         String fullTargetFilePath = "";
         try {