|
|
@@ -1,19 +1,27 @@
|
|
|
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.Project;
|
|
|
+import com.siwei.apply.domain.ProjectImmobileCode;
|
|
|
import com.siwei.apply.domain.ProjectWorkflow;
|
|
|
import com.siwei.apply.domain.res.GyjsydscdjRes;
|
|
|
import com.siwei.apply.domain.res.GyjsydscdjSinglRes;
|
|
|
import com.siwei.apply.domain.vo.*;
|
|
|
import com.siwei.apply.enums.AloneWorkFlowEnum;
|
|
|
|
|
|
+import com.siwei.apply.mapper.ProjectImmobileCodeMapper;
|
|
|
import com.siwei.apply.mapper.ProjectMapper;
|
|
|
import com.siwei.apply.mapper.ProjectWorkflowMapper;
|
|
|
import com.siwei.apply.service.GyjsydjfwscdjService;
|
|
|
import com.siwei.apply.service.GyjsydscdjService;
|
|
|
+import com.siwei.apply.service.NodeAttachmentService;
|
|
|
import com.siwei.apply.service.NodeLandService;
|
|
|
import com.siwei.apply.service.third.TakeDataService;
|
|
|
import com.siwei.apply.utils.HttpClientUtil;
|
|
|
+import com.siwei.apply.utils.ServiceFileUtil;
|
|
|
+import com.siwei.apply.utils.ServiceUtil;
|
|
|
import com.siwei.common.core.domain.R;
|
|
|
import com.siwei.common.core.exception.ServiceException;
|
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
|
@@ -26,10 +34,7 @@ import org.apache.commons.lang3.RandomStringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 获取三方数据服务实现类
|
|
|
@@ -57,6 +62,18 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
private RemoteSpatialFilesDbService remoteSpatialFilesDbService;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private NodeAttachmentService nodeAttachmentService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ProjectImmobileCodeMapper projectImmobileCodeMapper;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ DealExcelServiceImpl dealExcelService;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public String add(TakeDataAddVo takeDataAddVo) {
|
|
|
// TODO: Implement add logic
|
|
|
@@ -79,6 +96,7 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 远程获取第三方最大序号
|
|
|
* 然后根据规则生成预赋不动产单元号
|
|
|
@@ -168,75 +186,92 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
/**
|
|
|
* 远程获取国有建设用地使用权首次登记数据
|
|
|
* 并且入库
|
|
|
- *
|
|
|
* @param paramVo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public Map<String, Object> remoteLandFirstRegistration(ThirdRecordStatusParamVo paramVo) {
|
|
|
String yfbdcdyh = paramVo.getYfbdcdyh();
|
|
|
- if (org.apache.commons.lang3.StringUtils.isBlank(yfbdcdyh)) {
|
|
|
+ if (StringUtils.isBlank(yfbdcdyh)) {
|
|
|
throw new ServiceException("预分不动产单元号为空");
|
|
|
}
|
|
|
String ywh = paramVo.getYwh();
|
|
|
- if (org.apache.commons.lang3.StringUtils.isBlank(ywh)) {
|
|
|
+ if (StringUtils.isBlank(ywh)) {
|
|
|
throw new ServiceException("业务编号为空");
|
|
|
}
|
|
|
String ywlx = paramVo.getYwlx();
|
|
|
- if (org.apache.commons.lang3.StringUtils.isBlank(ywlx)) {
|
|
|
+ if (StringUtils.isBlank(ywlx)) {
|
|
|
throw new ServiceException("业务类型为空");
|
|
|
}
|
|
|
+ Map<String, Object> retMap = new HashMap<>();
|
|
|
|
|
|
//todo 这里进行远程请求,获取相关数据,解析后入库
|
|
|
- LandFirstParamVo body = new LandFirstParamVo(); //这里需要调整
|
|
|
- List<String> geomsList = body.getGeoms();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (CollectionUtils.isEmpty(geomsList)) {
|
|
|
- throw new ServiceException("geom信息为空");
|
|
|
- }
|
|
|
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 (org.apache.commons.lang3.StringUtils.isNotBlank(body.getTdmj())) {
|
|
|
- gyjsydscdjVo.setArea(Float.valueOf(body.getTdmj()));
|
|
|
+ Map<String,Object> paramMap = new LinkedHashMap<>();
|
|
|
+ paramMap.put("ywbh","");
|
|
|
+ paramMap.put("yfbdcdyh",yfbdcdyh);
|
|
|
+ String remoteResult = ServiceUtil.getRemoteDataByHttpClient("query.landRegist.datas",paramMap);
|
|
|
+ JSONObject root = JSON.parseObject(remoteResult);
|
|
|
+ JSONObject innerData = root.getJSONObject("data").getJSONObject("data");
|
|
|
+ LandFirstParamVo body = JSON.parseObject(innerData.toString(), LandFirstParamVo.class);
|
|
|
+ if(Objects.nonNull(body)){
|
|
|
+ ProjectImmobileCode immobileCodeRes = projectImmobileCodeMapper.selectByPreAssignCode(yfbdcdyh);
|
|
|
+ if (Objects.isNull(immobileCodeRes)) {
|
|
|
+ throw new ServiceException("检查预赋不动产单元号是否正确");
|
|
|
+ }
|
|
|
+
|
|
|
+ String projectId = immobileCodeRes.getProjectId();
|
|
|
+ //Project project = projectMapper.get(projectId);
|
|
|
+ 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 = dealExcelService.getTdytCodeByName(body.getTdyt());
|
|
|
+ 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());
|
|
|
+ String nodeId = gyjsydscdjService.add(gyjsydscdjVo);
|
|
|
+ retMap.put("id", nodeId);
|
|
|
+ //这里保存附件信息
|
|
|
+ if(Objects.nonNull(body.getAttachment()) && !body.getAttachment().isEmpty()){
|
|
|
+ nodeAttachmentService.getThirdAttachment(projectId,nodeId,AloneWorkFlowEnum.NODE_3.getName(),body.getAttachment());
|
|
|
+ }
|
|
|
}
|
|
|
- gyjsydscdjVo.setAreaUnit(body.getTdmjdw());
|
|
|
- gyjsydscdjVo.setBdcdyh(org.apache.commons.lang3.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("调用矢量保存文件错误,业务编号:{}: ", ywh);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
//todo 同步完成之后,需要修改t_third_record_status 表的状态值,同步完成;
|
|
|
-
|
|
|
- return null;
|
|
|
+ return retMap;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> remoteHouseFirstRegistration(ThirdRecordStatusParamVo paramVo) {
|
|
|
String yfbdcdyh = paramVo.getYfbdcdyh();
|