|
|
@@ -3,24 +3,25 @@ package com.siwei.apply.service.third.impl;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.siwei.apply.domain.*;
|
|
|
|
|
|
import com.siwei.apply.domain.vo.*;
|
|
|
import com.siwei.apply.enums.AloneWorkFlowEnum;
|
|
|
|
|
|
import com.siwei.apply.mapper.*;
|
|
|
-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.*;
|
|
|
import com.siwei.apply.service.third.TakeDataService;
|
|
|
+import com.siwei.apply.utils.ArcGisUtil;
|
|
|
import com.siwei.apply.utils.HttpClientUtil;
|
|
|
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.DateUtils;
|
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
|
import com.siwei.common.core.utils.bean.BeanUtils;
|
|
|
import com.siwei.spatial.api.RemoteSpatialFilesDbService;
|
|
|
+import com.siwei.spatial.api.domain.file.TGeomDb;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
@@ -77,6 +78,15 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
@Autowired
|
|
|
private LandOneCodeMapper landOneCodeMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProjectService projectService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ LandOneCodeService landOneCodeService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public String add(TakeDataAddVo takeDataAddVo) {
|
|
|
// TODO: Implement add logic
|
|
|
@@ -243,6 +253,11 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
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("业务编号为空");
|
|
|
@@ -284,6 +299,49 @@ public class TakeDataServiceImpl implements TakeDataService {
|
|
|
retMap.put("projectId",projectId);
|
|
|
retMap.put("nodeId",addNodeId);
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("调用不动产基本信息保存错误,业务编号:{}: ", ywh);
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //todo 这里进行远程请求,获取不动产矢量数据
|
|
|
+ try {
|
|
|
+
|
|
|
+ String projectId = retMap.get("projectId").toString();
|
|
|
+ String nodeId = retMap.get("nodeId").toString();
|
|
|
+
|
|
|
+ ArcGisUtil client = new ArcGisUtil(ArcGisUtil.ARCGIS_BASE_URL, ArcGisUtil.LAYER_ID, ArcGisUtil.SRID);
|
|
|
+ String where = "BDCDYH='"+bdcdyh+"'";
|
|
|
+ JsonNode page = client.query(where, ArcGisUtil.WITH_GEOMETRY, 0, ArcGisUtil.PAGE_SIZE);
|
|
|
+ log.info("run get ArcGIS service OK: {} (layer={}, srid={})", ArcGisUtil.PAGE_SIZE, ArcGisUtil.LAYER_ID, ArcGisUtil.SRID);
|
|
|
+ JsonNode features = page.path("features");
|
|
|
+ JsonNode f = features.get(0);
|
|
|
+ if (ArcGisUtil.WITH_GEOMETRY) {
|
|
|
+ JsonNode rings = f.path("geometry").path("rings");
|
|
|
+ String ewkt4490 = client.ringsToEwkt(rings);
|
|
|
+ log.info("ewkt OK: {} ", ewkt4490);
|
|
|
+ // 这里进行数据入库更新建立关联
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("geoms", ewkt4490);
|
|
|
+ map.put("sourceType", "bdc");
|
|
|
+ R<TGeomDb> saveGeomRes = remoteSpatialFilesDbService.saveGeom(map);
|
|
|
+ TGeomDb tGeomDb = saveGeomRes.getData();
|
|
|
+ log.info("远程调用geom保存,返回结果:{}", tGeomDb);
|
|
|
+ //这里保存geom映射关系
|
|
|
+ nodeLandService.createNodeLand(nodeId, tGeomDb.getId());
|
|
|
+ //预付码逻辑
|
|
|
+ projectService.addPreAssignCode(nodeId,projectId,tGeomDb.getId(),0);
|
|
|
+ //这里进行当上链操作:
|
|
|
+ gyjsydscdjService.updateHasOnchain(nodeId,true);
|
|
|
+ // 更新项目表的上链数量
|
|
|
+ projectService.countOnChinaNum(projectId);
|
|
|
+ //这里生成资源吗
|
|
|
+ landOneCodeService.addOrUpdateLandOneCodeInfo(projectId,nodeId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
log.error("调用矢量保存文件错误,业务编号:{}: ", ywh);
|
|
|
e.printStackTrace();
|