Sfoglia il codice sorgente

fw明细信息数据同步

chenendian 1 giorno fa
parent
commit
1949b90c2a

+ 13 - 6
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/NodeAttachmentImpl.java

@@ -446,9 +446,13 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
 
                 }else if(AloneWorkFlowEnum.NODE_3.getTableName().equalsIgnoreCase(nodeTableName)){
                     //处理-主体资格文件
-                    nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_2,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_3,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_4,nodeAttachment);
+                    String sourceId =  projectMapper.getNodeSourceIdByTable(nodeId,nodeTableName);
+                    if(StringUtils.isBlank(sourceId)) {
+                        nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_2,nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_3,nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId,GyjsydscdjAttachmentNameEnum.NAME_4,nodeAttachment);
+                    }
+
                 } else if(AloneWorkFlowEnum.NODE_4.getTableName().equalsIgnoreCase(nodeTableName)){
                     String sourceId =  projectMapper.getNodeSourceIdByTable(nodeId,nodeTableName);
                     if(StringUtils.isBlank(sourceId)){
@@ -470,9 +474,12 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                         nodeAttachment = this.assemblyAttachment(projectId, TdhyhsAttachmentNameEnum.NAME_5, nodeAttachment);
                     }
                 }else if(AloneWorkFlowEnum.NODE_7.getTableName().equalsIgnoreCase(nodeTableName)){
-                    nodeAttachment = this.assemblyAttachment(projectId,GyjsydjfwscdjAttachmentNameEnum.NAME_1,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,GyjsydjfwscdjAttachmentNameEnum.NAME_2,nodeAttachment);
-                    nodeAttachment = this.assemblyAttachment(projectId,GyjsydjfwscdjAttachmentNameEnum.NAME_3,nodeAttachment);
+                    String sourceId =  projectMapper.getNodeSourceIdByTable(nodeId,nodeTableName);
+                    if(StringUtils.isBlank(sourceId)) {
+                        nodeAttachment = this.assemblyAttachment(projectId, GyjsydjfwscdjAttachmentNameEnum.NAME_1, nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId, GyjsydjfwscdjAttachmentNameEnum.NAME_2, nodeAttachment);
+                        nodeAttachment = this.assemblyAttachment(projectId, GyjsydjfwscdjAttachmentNameEnum.NAME_3, nodeAttachment);
+                    }
                 }
 
             }

+ 23 - 14
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/TakeDataServiceImpl.java

@@ -1,6 +1,7 @@
 package com.siwei.apply.service.third.impl;
 
 import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import com.siwei.apply.domain.*;
 
@@ -255,8 +256,9 @@ public class TakeDataServiceImpl implements TakeDataService {
         //todo 这里进行远程请求,获取相关数据,解析后入库
         try {
             Map<String,Object> paramMap = new LinkedHashMap<>();
-            paramMap.put("ywbh","20260602500601");
-            paramMap.put("yfbdcdyh","360122014005GB60012");
+            paramMap.put("ywbh","HL20260126500101");
+            paramMap.put("yfbdcdyh","360122014005GB00046");
+
             String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.landRegist.datas",paramMap);
             JSONObject root = JSON.parseObject(remoteResult);
             //todo 这里需要确认用户返回的是数组还是对象
@@ -433,7 +435,7 @@ public class TakeDataServiceImpl implements TakeDataService {
         try {
             Map<String,Object> paramMap = new LinkedHashMap<>();
             paramMap.put("ywbh",ywh);
-            String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.houseRegist.datas222",paramMap);
+            String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.ywFiles.datas",paramMap);
             JSONObject root = JSON.parseObject(remoteResult);
             //todo 这里需要确认返回数据是否是array结构
             JSONObject innerData = root.getJSONObject("data").getJSONObject("data");
@@ -444,12 +446,13 @@ public class TakeDataServiceImpl implements TakeDataService {
                     throw new ServiceException("检查预赋不动产单元号是否正确");
                 }
                 String projectId = immobileCodeRes.getProjectId();
-                String sourceId = body.getYwbh();
+                //todo 这里的业务号不一定等于房屋中的业务号ywh
                 String addNodeId = "";
-                Gyjsydjfwscdj existsNode = gyjsydjfwscdjService.getBySourceId(sourceId);//这里需要根据sourceId 检查已经存在
+                Gyjsydjfwscdj existsNode = gyjsydjfwscdjService.getBySourceId(ywh);//这里需要根据sourceId 检查已经存在
                 if(Objects.nonNull(existsNode)){ //如果已经存在不做处理
                     addNodeId = existsNode.getId();
                 }else  {
+                    body.setYwbh(ywh);
                     addNodeId = addOrUpdateHouseFirstRegistration(body,projectId,"");
                 }
                 //这里保存附件信息
@@ -485,19 +488,25 @@ public class TakeDataServiceImpl implements TakeDataService {
                     paramMap.put("yfbdcdyh",yfbdcdyh);
                     paramMap.put("pageNumber",pageNumber);
                     paramMap.put("pageSize",pageSize);
-                    String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.houseRegist.datas333",paramMap);
+                    String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.houseRegist.datas",paramMap);
                     JSONObject root = JSON.parseObject(remoteResult);
                     //todo 这里需要确认返回数据是否是array结构
-                    JSONObject innerData = root.getJSONObject("data").getJSONObject("data");
+                    JSONObject innerData = root.getJSONObject("data");
                     if(Objects.nonNull(innerData.get("total")) && totalNum == 0){
                         totalNum = (Integer) innerData.get("total");//获取总条数
                     }
-                    FwmxVo body = JSON.parseObject(innerData.toString(), FwmxVo.class);
-                    if(Objects.nonNull(body)) {
-                        Fwmx fwmx = new Fwmx();
-                        fwmx.generateId();
-                        BeanUtils.copyProperties(body, fwmx);
-                        fwmxMapper.add(fwmx);
+                    JSONArray innerArr = innerData.getJSONArray("data");
+                    if(innerArr != null && !innerArr.isEmpty()) {
+                        for (int i = 0; i < innerArr.size(); i++) {
+                            JSONObject innerObj = innerArr.getJSONObject(i);
+                            FwmxVo body = JSON.parseObject(innerObj.toString(), FwmxVo.class);
+                            if (Objects.nonNull(body)) {
+                                Fwmx fwmx = new Fwmx();
+                                fwmx.generateId();
+                                BeanUtils.copyProperties(body, fwmx);
+                                fwmxMapper.add(fwmx);
+                            }
+                        }
                     }
                     pageNumber++;
                     //todo 这里是否需要考虑不满20条情况
@@ -508,7 +517,7 @@ public class TakeDataServiceImpl implements TakeDataService {
                 //这边直接更新当前数据
                 if(Objects.nonNull(statisticsData)){
                     HouseFirstParamVo body = new HouseFirstParamVo();
-                    body.setYwbh(statisticsData.getYwh()); //todo 这里的业务号不一定等于房屋中的业务号ywh
+
                     body.setGzdgzsj(statisticsData.getGzdgzsj());
                     body.setKfdw(statisticsData.getKfdw());
                     body.setBdcqk(statisticsData.getBdcqk());