Przeglądaj źródła

房屋数据获取,关联登记时间转成-盖章时间

chenendian 3 dni temu
rodzic
commit
bfaebd3bdd

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

@@ -69,7 +69,7 @@ public class DealExcelController extends BaseController {
                 tdgyShpOfZdList = dealExcelService.getBusinessCodeFromExcel(tdgyShpOfZdList, excelDataMap);
 
                 //这里进行数据入库处理,直接根据业务号,和项目id去抓取不动产的附件信息并且增加节点:
-                //dealExcelService.addBDCDataAndAttachment(tdgyShpOfZdList,1);
+                dealExcelService.addBDCDataAndAttachment(tdgyShpOfZdList,1);
             }
             return R.ok(tdgyShpOfZdList);
         } catch (Exception e) {
@@ -96,7 +96,7 @@ public class DealExcelController extends BaseController {
                 tdgyShpOfZdList = dealExcelService.getBusinessCodeFromExcelOfHouse(tdgyShpOfZdList, excelDataMap);
 
                 //这里进行数据入库处理,直接根据业务号,和项目id去抓取不动产的附件信息并且增加节点:
-                //dealExcelService.addBDCDataAndAttachment(tdgyShpOfZdList,2);
+                dealExcelService.addBDCDataAndAttachment(tdgyShpOfZdList,2);
             }
             return R.ok(tdgyShpOfZdList);
         } catch (Exception e) {

+ 5 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/FwmxVo.java

@@ -7,6 +7,7 @@ import java.util.Date;
 
 /**
  * 房屋首次登记明细 视图对象
+ * 开发单位对应的就是权利人字段;不动产没有告知单盖章时间,你们可以用djsj时间作为告知时间
  */
 @Data
 public class FwmxVo {
@@ -25,4 +26,7 @@ public class FwmxVo {
     private String bdcdyh;         // 不动产单元号
     private String bdcqzh;         // 不动产权证号
     private String zl;             // 坐落
-}
+    private String qlr;             // 权利人
+    private String djrq;             // 登记日期
+}
+

+ 2 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/NodeAttachmentImpl.java

@@ -744,7 +744,6 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                             .map(String::valueOf)
                             .orElse("");
 
-
                     if(StringUtils.isBlank(url)){ //这里避免空值造成数据无法传输
                         continue;
                     }
@@ -761,9 +760,9 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                     String fileName = Optional.ofNullable(attachment.getOrDefault("file_name", attachment.get("FILE_NAME")))
                             .map(String::valueOf)
                             .orElse("");
-
+                    //兼容 "file_name": "出让合同/划拨裁定书1.pdf",
+                    fileName = StringUtils.replace(fileName,"/","_");
                     String subDownLoadFilePath = fileDownLoadPath + "/" + directoryName;
-
                     //todo 这里不需要try catch 如果下载不了,不进行入库,可以便于查找问题
                     try {
                         ServiceFileUtil.downloadFile(url,fileName, subDownLoadFilePath,Constant.BDC);

+ 2 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/DealExcelServiceImpl.java

@@ -164,6 +164,8 @@ public class DealExcelServiceImpl {
         for (Map<String, String> map : list) {
             String ywh = map.get("ywh");
             String projectId = map.get("projectId");
+            if(StringUtils.isBlank(ywh))continue;
+            ywh +="01";
             if(1==type){
                 Map<String, Object> retMap = takeDataService.remoteLandFirstRegistration_tmp(projectId,ywh);
                 log.info("result type1 map:{}",retMap);

+ 12 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/TakeDataServiceImpl.java

@@ -17,6 +17,7 @@ import com.siwei.apply.service.third.TakeDataService;
 import com.siwei.apply.utils.HttpClientUtil;
 import com.siwei.apply.utils.ServiceUtil;
 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;
@@ -333,8 +334,13 @@ public class TakeDataServiceImpl implements TakeDataService {
             String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.landRegist.datas",paramMap);
             JSONObject root = JSON.parseObject(remoteResult);
             //todo 这里需要确认用户返回的是数组还是对象
-            JSONObject innerData = (JSONObject) root.getJSONObject("data").getJSONArray("data").get(0);
+            JSONObject checkInnerData = root.getJSONObject("data");
+            if(!checkInnerData.get("code").equals("200")){
+                log.warn("当前业务不存在,业务号:{},返回数据: {}", ywh,checkInnerData);
+                return retMap;
+            }
 
+            JSONObject innerData = (JSONObject) root.getJSONObject("data").getJSONArray("data").get(0);
             LandFirstParamVo body = JSON.parseObject(innerData.toString(), LandFirstParamVo.class);
             if(Objects.nonNull(body)){
                 //todo 这里需要确认是否返回ywh字段
@@ -352,7 +358,7 @@ public class TakeDataServiceImpl implements TakeDataService {
                 retMap.put("nodeId",addNodeId);
             }
         } catch (Exception e) {
-            log.error("调用矢量保存文件错误,业务编号:{}: ", ywh);
+            log.error("调用不动产土地首登记数据保存错误,业务编号:{}: ", ywh);
             e.printStackTrace();
             throw new RuntimeException(e);
         }
@@ -666,7 +672,7 @@ public class TakeDataServiceImpl implements TakeDataService {
         try {
             //todo 这里需要同步房屋明细数据
             // 同步完成后再次修改更新当前节点数据。把统计信息更新到数据表中。
-            // todo 这里需要分页进行查询,并且把数据都同步完毕。
+            // 这里需要分页进行查询,并且把数据都同步完毕。
             // 既然开启了同步,需要把当前业务号的数据进行删除。
             // 数据同步完成后,再计算统计数据,然后修改主表数据。
             if(MapUtils.isNotEmpty(retMap)){
@@ -698,6 +704,9 @@ public class TakeDataServiceImpl implements TakeDataService {
                                 Fwmx fwmx = new Fwmx();
                                 fwmx.generateId();
                                 BeanUtils.copyProperties(body, fwmx);
+                                fwmx.setKfdw(body.getQlr()); //权利人
+                                Date djDate = DateUtils.parseDate(body.getDjrq());
+                                fwmx.setGzdgzsj(djDate);//登记日期
                                 fwmxMapper.add(fwmx);
                             }
                         }