Przeglądaj źródła

优化房屋首登数据抓取

chenendian 2 dni temu
rodzic
commit
73c53e65da

+ 0 - 7
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/OfferDataService.java

@@ -1,8 +1,6 @@
 package com.siwei.apply.service.third;
 package com.siwei.apply.service.third;
 
 
 import com.siwei.apply.domain.NodeAttachment;
 import com.siwei.apply.domain.NodeAttachment;
-import com.siwei.apply.domain.vo.HouseFirstParamVo;
-import com.siwei.apply.domain.vo.LandFirstParamVo;
 import com.siwei.apply.domain.vo.ThirdProjectParamVo;
 import com.siwei.apply.domain.vo.ThirdProjectParamVo;
 import com.siwei.apply.domain.vo.ThirdRecordStatusParamVo;
 import com.siwei.apply.domain.vo.ThirdRecordStatusParamVo;
 
 
@@ -22,7 +20,6 @@ public interface OfferDataService {
      */
      */
     Map<String,String> get(String projectId);
     Map<String,String> get(String projectId);
 
 
-
     /**
     /**
      *
      *
      */
      */
@@ -32,10 +29,6 @@ public interface OfferDataService {
 
 
     NodeAttachment getThirdNodeAttachment(String preImmobileCode, String projectId, String dqjd) throws Exception;
     NodeAttachment getThirdNodeAttachment(String preImmobileCode, String projectId, String dqjd) throws Exception;
 
 
-    Map<String, Object> landFirstRegistration(LandFirstParamVo body);
-
-    Map<String, Object> houseFirstRegistration(HouseFirstParamVo body);
-
     List<Map<String, Object>> landSupplyAndProjectList(ThirdProjectParamVo body) ;
     List<Map<String, Object>> landSupplyAndProjectList(ThirdProjectParamVo body) ;
 
 
     Map<String, Object> addRecordStatusData(ThirdRecordStatusParamVo body);
     Map<String, Object> addRecordStatusData(ThirdRecordStatusParamVo body);

+ 0 - 108
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/OfferDataServiceImpl.java

@@ -165,9 +165,7 @@ public class OfferDataServiceImpl implements OfferDataService {
         if (StringUtils.isBlank(ywh)) {
         if (StringUtils.isBlank(ywh)) {
             throw new ServiceException("业务号为空");
             throw new ServiceException("业务号为空");
         }
         }
-
         log.info("登簿数据校验通过开始入库: {}" , JSON.toJSONString(body));
         log.info("登簿数据校验通过开始入库: {}" , JSON.toJSONString(body));
-
         String id="";
         String id="";
         String tbztFlag="0";
         String tbztFlag="0";
         // 入库:以 yfbdcdyh 或 ywh 及 ywlx 判重,已存在则按主键覆盖更新,避免重复插入
         // 入库:以 yfbdcdyh 或 ywh 及 ywlx 判重,已存在则按主键覆盖更新,避免重复插入
@@ -192,117 +190,11 @@ public class OfferDataServiceImpl implements OfferDataService {
         return map;
         return map;
     }
     }
 
 
-    @Override
-    public Map<String, Object> landFirstRegistration(LandFirstParamVo body) {
-        String yfbdcdyh = body.getYfbdcdyh();
-        if (StringUtils.isBlank(yfbdcdyh)) {
-            throw new ServiceException("预分不动产单元号为空");
-        }
-        String ywbh = body.getYwbh();
-        if (StringUtils.isBlank(ywbh)) {
-            throw new ServiceException("业务编号为空");
-        }
-        List<String> geomsList = body.getGeoms();
-        if (CollectionUtils.isEmpty(geomsList)) {
-            throw new ServiceException("geom信息为空");
-        }
-        //todo 这里进行文件下载入库:
-
-        try {
-            GyjsydscdjVo gyjsydscdjVo = new GyjsydscdjVo();
-            gyjsydscdjVo.setProjectId(body.getXmbh());
-            gyjsydscdjVo.setQlr(body.getQlr());
-            gyjsydscdjVo.setGyqk(body.getGyqk());
-            gyjsydscdjVo.setZl(body.getZl());
-            gyjsydscdjVo.setQllx(body.getQllx());
-            gyjsydscdjVo.setQlxz(body.getQlxz());
-            gyjsydscdjVo.setTdyt(body.getTdyt());
-            if (StringUtils.isNotBlank(body.getTdmj())) {
-                gyjsydscdjVo.setArea(Float.valueOf(body.getTdmj()));
-            }
-            gyjsydscdjVo.setAreaUnit(body.getTdmjdw());
-            gyjsydscdjVo.setBdcdyh(StringUtils.isNotBlank(body.getBdcdyh()) ? body.getBdcdyh() : body.getYfbdcdyh());
-            gyjsydscdjVo.setBdczh(body.getBdczh());
-            gyjsydscdjVo.setDjjg(body.getDjjg());
-            gyjsydscdjVo.setDjDate(body.getDjrq());
-
-            String nodeId = gyjsydscdjService.add(gyjsydscdjVo);
-            Map<String, Object> map1 = new HashMap<>();
-            map1.put("geomData", geomsList);
-            map1.put("sourceType", "third");
-            //todo 这里进行矢量文件的保存及其传输。
-            R<TGeomDb> res = remoteSpatialFilesDbService.saveGeom(map1);
-            TGeomDb tGeomDb = res.getData();
-            //这里保存geom映射关系
-            nodeLandService.createNodeLand(nodeId, tGeomDb.getId());
-            Map<String, Object> map = new HashMap<>();
-            map.put("id", nodeId);
-            return map;
-        } catch (Exception e) {
-            log.error("调用矢量保存文件错误,业务编号:{}: ", ywbh);
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-
-    @Override
-    public Map<String, Object> houseFirstRegistration(HouseFirstParamVo body) {
-        String yfbdcdyh = body.getYfbdcdyh();
-        if (StringUtils.isBlank(yfbdcdyh)) {
-            throw new ServiceException("预分不动产单元号为空");
-        }
-        String ywbh = body.getYwbh();
-        if (StringUtils.isBlank(ywbh)) {
-            throw new ServiceException("业务编号为空");
-        }
-        List<String> geomsList = body.getGeoms();
-        if (CollectionUtils.isEmpty(geomsList)) {
-            throw new ServiceException("geom信息为空");
-        }
-        //todo 这里进行文件下载入库:
-        try {
-            GyjsydjfwscdjVo gyjsydjfwscdjVo = new GyjsydjfwscdjVo();
-            gyjsydjfwscdjVo.setProjectId(body.getXmbh());
-//            gyjsydjfwscdjVo.setYwh(body.getYwh());
-//            gyjsydjfwscdjVo.setGzdgzsj(body.getGzdgzsj());
-//            gyjsydjfwscdjVo.setKfdw(body.getKfdw());
-//            gyjsydjfwscdjVo.setBdcqk(body.getBdcqk());
-//            if (StringUtils.isNotBlank(body.getJzmj())) {
-//                gyjsydjfwscdjVo.setJzmj(body.getJzmj());
-//            }
-//            gyjsydjfwscdjVo.setJzmjDw(body.getJzmjDw());
-//            gyjsydjfwscdjVo.setTnmj(body.getTnmj());
-//            gyjsydjfwscdjVo.setTnmjDw(body.getTnmjDw());
-//            gyjsydjfwscdjVo.setFtmj(body.getFtmj());
-//            gyjsydjfwscdjVo.setFtmjDw(body.getFtmjDw());
-//            gyjsydjfwscdjVo.setBz(body.getBz());
-
-            String nodeId = gyjsydjfwscdjService.add(gyjsydjfwscdjVo);
-            Map<String, Object> map1 = new HashMap<>();
-            map1.put("geomData", geomsList);
-            //todo 这里进行矢量文件的保存及其传输。
-            R<TGeomDb> res = remoteSpatialFilesDbService.saveGeom(map1);
-            TGeomDb tGeomDb = res.getData();
-            //这里保存geom映射关系
-            nodeLandService.createNodeLand(nodeId, tGeomDb.getId());
-            Map<String, Object> map = new HashMap<>();
-            map.put("id", nodeId);
-            return map;
-        } catch (Exception e) {
-            log.error("调用矢量保存文件错误,业务编号:{}: ", ywbh);
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-
     @Override
     @Override
     public String getTheFile(String attachmentId, String dirName, String fileName) {
     public String getTheFile(String attachmentId, String dirName, String fileName) {
         String fileAndPath = "";
         String fileAndPath = "";
         NodeAttachment nodeAttachment = nodeAttachmentService.getById(attachmentId);
         NodeAttachment nodeAttachment = nodeAttachmentService.getById(attachmentId);
         nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeAttachment.getNodeId(), null);
         nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeAttachment.getNodeId(), null);
-
         if (Objects.nonNull(nodeAttachment)) {
         if (Objects.nonNull(nodeAttachment)) {
             List<Map<String, String>> fileList = ServiceUtil.getDirChildrenList(dirName, nodeAttachment);
             List<Map<String, String>> fileList = ServiceUtil.getDirChildrenList(dirName, nodeAttachment);
             if (Objects.nonNull(fileList)) {
             if (Objects.nonNull(fileList)) {

+ 6 - 86
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/TakeDataServiceImpl.java

@@ -444,13 +444,14 @@ public class TakeDataServiceImpl implements TakeDataService {
                     throw new ServiceException("检查预赋不动产单元号是否正确");
                     throw new ServiceException("检查预赋不动产单元号是否正确");
                 }
                 }
                 String projectId = immobileCodeRes.getProjectId();
                 String projectId = immobileCodeRes.getProjectId();
-                String needUpdateNodeId = "";
                 String sourceId = body.getYwbh();
                 String sourceId = body.getYwbh();
+                String addNodeId = "";
                 Gyjsydjfwscdj existsNode = gyjsydjfwscdjService.getBySourceId(sourceId);//这里需要根据sourceId 检查已经存在
                 Gyjsydjfwscdj existsNode = gyjsydjfwscdjService.getBySourceId(sourceId);//这里需要根据sourceId 检查已经存在
-                if(Objects.nonNull(existsNode)){
-                    needUpdateNodeId = existsNode.getId();
+                if(Objects.nonNull(existsNode)){ //如果已经存在不做处理
+                    addNodeId = existsNode.getId();
+                }else  {
+                    addNodeId = addOrUpdateHouseFirstRegistration(body,projectId,"");
                 }
                 }
-                String addNodeId = addOrUpdateHouseFirstRegistration(body,projectId,needUpdateNodeId);
                 //这里保存附件信息
                 //这里保存附件信息
                 // todo 这里的附件下载,为了性能考虑,是否要放在最后面
                 // todo 这里的附件下载,为了性能考虑,是否要放在最后面
                 if(Objects.nonNull(body.getAttachment()) && !body.getAttachment().isEmpty()){
                 if(Objects.nonNull(body.getAttachment()) && !body.getAttachment().isEmpty()){
@@ -494,8 +495,8 @@ public class TakeDataServiceImpl implements TakeDataService {
                     FwmxVo body = JSON.parseObject(innerData.toString(), FwmxVo.class);
                     FwmxVo body = JSON.parseObject(innerData.toString(), FwmxVo.class);
                     if(Objects.nonNull(body)) {
                     if(Objects.nonNull(body)) {
                         Fwmx fwmx = new Fwmx();
                         Fwmx fwmx = new Fwmx();
-                        BeanUtils.copyProperties(body, fwmx);
                         fwmx.generateId();
                         fwmx.generateId();
+                        BeanUtils.copyProperties(body, fwmx);
                         fwmxMapper.add(fwmx);
                         fwmxMapper.add(fwmx);
                     }
                     }
                     pageNumber++;
                     pageNumber++;
@@ -526,85 +527,6 @@ public class TakeDataServiceImpl implements TakeDataService {
         return retMap;
         return retMap;
     }
     }
 
 
-
-
-
-/*
-    public Map<String, Object> remoteHouseFirstRegistration222_delete(ThirdRecordStatusParamVo paramVo) {
-        String yfbdcdyh = paramVo.getYfbdcdyh();
-        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("业务号为空");
-        }
-        String ywlx = paramVo.getYwlx();
-        if (StringUtils.isBlank(ywlx)) {
-            throw new ServiceException("业务类型为空");
-        }
-        Map<String, Object> retMap = new HashMap<>();
-
-        //todo 这里进行远程请求,获取相关数据,解析后入库
-        try {
-            Map<String,Object> paramMap = new LinkedHashMap<>();
-            paramMap.put("ywbh","");
-            //paramMap.put("bdcdyh",yfbdcdyh);
-            paramMap.put("bdcdyh",bdcdyh);
-            String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.houseRegist.datas",paramMap);
-            JSONObject root = JSON.parseObject(remoteResult);
-            JSONObject innerData = root.getJSONObject("data").getJSONObject("data");
-            HouseFirstParamVo body = JSON.parseObject(innerData.toString(), HouseFirstParamVo.class);
-
-            if(Objects.nonNull(body)) {
-                ProjectImmobileCode immobileCodeRes = projectImmobileCodeMapper.selectByPreAssignCode(yfbdcdyh);
-                if (Objects.isNull(immobileCodeRes)) {
-                    throw new ServiceException("检查预赋不动产单元号是否正确");
-                }
-                String projectId = immobileCodeRes.getProjectId();
-                GyjsydjfwscdjVo gyjsydjfwscdjVo = new GyjsydjfwscdjVo();
-
-                gyjsydjfwscdjVo.setProjectId(projectId);
-                gyjsydjfwscdjVo.setYwh(body.getYwbh());
-
-                if(StringUtils.isNotBlank(body.getDjrq())){
-                    Date djDate = DateUtils.parseDate(body.getDjrq());
-                    gyjsydjfwscdjVo.setGzdgzsj(djDate);//告知单时间
-                }
-                gyjsydjfwscdjVo.setKfdw(body.getQlr());
-                gyjsydjfwscdjVo.setBdcqk(""); //不动产情况
-
-                gyjsydjfwscdjVo.setJzmj(body.getTdmj()); //建筑面积
-                gyjsydjfwscdjVo.setJzmjDw(body.getTdmjdw());//建筑面积单位
-                gyjsydjfwscdjVo.setTnmj(body.getTdmj());
-                gyjsydjfwscdjVo.setTnmjDw(body.getTdmjdw());
-                gyjsydjfwscdjVo.setFtmj("0");
-                gyjsydjfwscdjVo.setFtmjDw(body.getTdmjdw());
-                gyjsydjfwscdjVo.setBz("");//备注
-                gyjsydjfwscdjVo.setSourceId(ywh);
-                String nodeId = gyjsydjfwscdjService.add(gyjsydjfwscdjVo);
-                retMap.put("id", nodeId);
-                //这里保存附件信息
-                if(Objects.nonNull(body.getAttachment()) && !body.getAttachment().isEmpty()){
-                    nodeAttachmentService.getThirdAttachment(projectId,nodeId,AloneWorkFlowEnum.NODE_7.getName(),body.getAttachment());
-                }
-            }
-            return retMap;
-        } catch (Exception e) {
-            log.error("调用矢量保存文件错误,业务号:{}: ", ywh);
-            e.printStackTrace();
-        }
-        return null;
-    }
-*/
-
-
-
-
     /**
     /**
      * 通过土地用途名称获取土地的编码
      * 通过土地用途名称获取土地的编码
      * @param useName
      * @param useName
@@ -624,7 +546,6 @@ public class TakeDataServiceImpl implements TakeDataService {
         return code;
         return code;
     }
     }
 
 
-
     /**
     /**
      * 根据登簿数据同步不动产数据
      * 根据登簿数据同步不动产数据
      * 异步执行
      * 异步执行
@@ -661,7 +582,6 @@ public class TakeDataServiceImpl implements TakeDataService {
             return null;
             return null;
         });
         });
 
 
-
     }
     }