|
@@ -11,10 +11,7 @@ import com.siwei.apply.domain.res.GyjsydscdjSinglRes;
|
|
|
import com.siwei.apply.domain.vo.*;
|
|
import com.siwei.apply.domain.vo.*;
|
|
|
import com.siwei.apply.enums.AloneWorkFlowEnum;
|
|
import com.siwei.apply.enums.AloneWorkFlowEnum;
|
|
|
|
|
|
|
|
-import com.siwei.apply.mapper.LandTypeMapper;
|
|
|
|
|
-import com.siwei.apply.mapper.ProjectImmobileCodeMapper;
|
|
|
|
|
-import com.siwei.apply.mapper.ProjectMapper;
|
|
|
|
|
-import com.siwei.apply.mapper.ProjectWorkflowMapper;
|
|
|
|
|
|
|
+import com.siwei.apply.mapper.*;
|
|
|
import com.siwei.apply.service.GyjsydjfwscdjService;
|
|
import com.siwei.apply.service.GyjsydjfwscdjService;
|
|
|
import com.siwei.apply.service.GyjsydscdjService;
|
|
import com.siwei.apply.service.GyjsydscdjService;
|
|
|
import com.siwei.apply.service.NodeAttachmentService;
|
|
import com.siwei.apply.service.NodeAttachmentService;
|
|
@@ -29,11 +26,11 @@ import com.siwei.spatial.api.RemoteSpatialFilesDbService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
-import org.apache.commons.lang3.RandomStringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
|
|
import static com.siwei.apply.service.third.impl.DealExcelServiceImpl.allLandTypeList;
|
|
import static com.siwei.apply.service.third.impl.DealExcelServiceImpl.allLandTypeList;
|
|
|
|
|
|
|
@@ -73,6 +70,11 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
private LandTypeMapper landTypeMapper;
|
|
private LandTypeMapper landTypeMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ThirdRecordStatusMapper thirdRecordStatusMapper;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public String add(TakeDataAddVo takeDataAddVo) {
|
|
public String add(TakeDataAddVo takeDataAddVo) {
|
|
|
// TODO: Implement add logic
|
|
// TODO: Implement add logic
|
|
@@ -80,21 +82,58 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public GyjsydscdjRes get(String projectId) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 同步土地首次登记数据
|
|
|
|
|
+ * @param projectId
|
|
|
|
|
+ * @param nodeTableName
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
- public GyjsydscdjSinglRes getById(String id) {
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ public void syncLandNodeInfo(String projectId,String nodeTableName) {
|
|
|
|
|
+ Project project = projectMapper.get(projectId);
|
|
|
|
|
+ if (Objects.isNull(project) || StringUtils.isBlank(project.getCode())) {
|
|
|
|
|
+ throw new ServiceException("当前项目不具备同步条件,请检查项目代码是否存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<ThirdRecordStatusParamVo> syncRecordList = thirdRecordStatusMapper.selectByProjectIdAndType(projectId,"2");
|
|
|
|
|
+ if (CollectionUtils.isEmpty(syncRecordList)) {
|
|
|
|
|
+ throw new ServiceException("当前项目不具备同步条件,检查不动产是否已推送完成数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ for(ThirdRecordStatusParamVo paramVo : syncRecordList){
|
|
|
|
|
+ //这里调用相关同步方法
|
|
|
|
|
+ syncRemoteData(paramVo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 同步房屋首次登记数据
|
|
|
|
|
+ * @param projectId
|
|
|
|
|
+ * @param nodeTableName
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
- public void update(GyjsydscdjUpdateVo gyjsydscdjUpdateVo) {
|
|
|
|
|
|
|
+ public void syncHouseNodeInfo(String projectId,String nodeTableName) {
|
|
|
|
|
+ Project project = projectMapper.get(projectId);
|
|
|
|
|
+ if (Objects.isNull(project) || StringUtils.isBlank(project.getCode())) {
|
|
|
|
|
+ throw new ServiceException("当前项目不具备同步条件,请检查项目代码是否存在");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ List<Object> constructList = null;
|
|
|
|
|
+ if (CollectionUtils.isEmpty(constructList)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ //todo 这里最多支持8条数据
|
|
|
|
|
+ if (constructList.size() > 8) {
|
|
|
|
|
+ constructList = constructList.subList(0, 8);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 远程获取第三方最大序号
|
|
* 远程获取第三方最大序号
|
|
|
* 然后根据规则生成预赋不动产单元号
|
|
* 然后根据规则生成预赋不动产单元号
|
|
@@ -223,6 +262,8 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
if (Objects.isNull(immobileCodeRes)) {
|
|
if (Objects.isNull(immobileCodeRes)) {
|
|
|
throw new ServiceException("检查预赋不动产单元号是否正确");
|
|
throw new ServiceException("检查预赋不动产单元号是否正确");
|
|
|
}
|
|
}
|
|
|
|
|
+ //todo 这里根据 sourceId 确认是修改还是新增
|
|
|
|
|
+ //
|
|
|
|
|
|
|
|
String projectId = immobileCodeRes.getProjectId();
|
|
String projectId = immobileCodeRes.getProjectId();
|
|
|
//Project project = projectMapper.get(projectId);
|
|
//Project project = projectMapper.get(projectId);
|
|
@@ -264,6 +305,52 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public String addOrUpdateLandFirstRegistration( LandFirstParamVo body ,String projectId,String needUpdateNodeId,String ywh ) {
|
|
|
|
|
+ String addNodeId = "";
|
|
|
|
|
+ if (StringUtils.isNotBlank(needUpdateNodeId)) {
|
|
|
|
|
+ GyjsydscdjVo gyjsydscdjVo = new GyjsydscdjVo();
|
|
|
|
|
+ gyjsydscdjVo.setProjectId(projectId);
|
|
|
|
|
+ gyjsydscdjVo.setQlr(body.getQlr());
|
|
|
|
|
+
|
|
|
|
|
+ gyjsydscdjVo.setGyqk(body.getGyqk());
|
|
|
|
|
+ gyjsydscdjVo.setZl(body.getZl());
|
|
|
|
|
+ gyjsydscdjVo.setQllx(body.getQllx());
|
|
|
|
|
+ gyjsydscdjVo.setQlxz(body.getQlxz());
|
|
|
|
|
+
|
|
|
|
|
+ //土地用途转化
|
|
|
|
|
+ if (StringUtils.isNotBlank(body.getTdyt())) {
|
|
|
|
|
+ String code = null;
|
|
|
|
|
+ gyjsydscdjVo.setTdyt(code);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ 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());
|
|
|
|
|
+ gyjsydscdjVo.setSourceId(ywh);
|
|
|
|
|
+ String nodeId = gyjsydscdjService.add(gyjsydscdjVo);
|
|
|
|
|
+ addNodeId = nodeId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return addNodeId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Map<String, Object> remoteHouseFirstRegistration(ThirdRecordStatusParamVo paramVo) {
|
|
public Map<String, Object> remoteHouseFirstRegistration(ThirdRecordStatusParamVo paramVo) {
|
|
|
String yfbdcdyh = paramVo.getYfbdcdyh();
|
|
String yfbdcdyh = paramVo.getYfbdcdyh();
|
|
@@ -357,5 +444,49 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据登簿数据同步不动产数据
|
|
|
|
|
+ * 异步执行
|
|
|
|
|
+ * @param body
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void syncRemoteData(ThirdRecordStatusParamVo body) {
|
|
|
|
|
+ String yfbdcdyh = body.getYfbdcdyh();
|
|
|
|
|
+ String bdcdyh = body.getBdcdyh();
|
|
|
|
|
+ String ywh = body.getYwh();
|
|
|
|
|
+ String ywlx = body.getYwlx();
|
|
|
|
|
+
|
|
|
|
|
+ CompletableFuture.supplyAsync(() -> {
|
|
|
|
|
+ if ("1".equals(ywlx)) { //房屋首次登记(后来类型变更)
|
|
|
|
|
+ this.remoteHouseFirstRegistration(body);
|
|
|
|
|
+ } else if ("2".equals(ywlx)) { //土地首次登记
|
|
|
|
|
+ this.remoteLandFirstRegistration(body);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ThirdRecordStatusParamVo updateVo = new ThirdRecordStatusParamVo();
|
|
|
|
|
+ updateVo.setId(body.getId());
|
|
|
|
|
+ updateVo.setTbzt("1");
|
|
|
|
|
+ thirdRecordStatusMapper.updateById(updateVo);
|
|
|
|
|
+
|
|
|
|
|
+ //这里需要更新绑定关系
|
|
|
|
|
+ ProjectImmobileCode updateImmobileCode = new ProjectImmobileCode();
|
|
|
|
|
+ updateImmobileCode.setCode(bdcdyh);
|
|
|
|
|
+ updateImmobileCode.setPreAssignCode(yfbdcdyh);
|
|
|
|
|
+ projectImmobileCodeMapper.updateByPreCode(updateImmobileCode);
|
|
|
|
|
+ return body.getId();
|
|
|
|
|
+ }).exceptionally(e -> {
|
|
|
|
|
+ log.error("不动产远程抓取数据失败: ywh={}, ywlx={}", ywh, ywlx, e);
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ return null;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|