|
|
@@ -1,13 +1,14 @@
|
|
|
package com.siwei.apply.service.third.impl;
|
|
|
|
|
|
import com.siwei.apply.domain.NodeAttachment;
|
|
|
+import com.siwei.apply.domain.ProjectImmobileCode;
|
|
|
import com.siwei.apply.domain.ProjectWorkflow;
|
|
|
-import com.siwei.apply.domain.vo.GyjsydjfwscdjVo;
|
|
|
-import com.siwei.apply.domain.vo.GyjsydscdjVo;
|
|
|
-import com.siwei.apply.domain.vo.HouseFirstParamVo;
|
|
|
-import com.siwei.apply.domain.vo.LandFirstParamVo;
|
|
|
+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.mapper.ThirdRecordStatusMapper;
|
|
|
import com.siwei.apply.service.GyjsydjfwscdjService;
|
|
|
import com.siwei.apply.service.GyjsydscdjService;
|
|
|
import com.siwei.apply.service.NodeAttachmentService;
|
|
|
@@ -16,6 +17,7 @@ import com.siwei.apply.service.third.OfferDataService;
|
|
|
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.uuid.IdUtils;
|
|
|
import com.siwei.spatial.api.RemoteSpatialFilesDbService;
|
|
|
import com.siwei.spatial.api.domain.file.TGeomDb;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -54,6 +56,18 @@ public class OfferDataServiceImpl implements OfferDataService {
|
|
|
@Autowired
|
|
|
private NodeLandService nodeLandService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProjectMapper projectMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ThirdRecordStatusMapper thirdRecordStatusMapper;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ProjectImmobileCodeMapper projectImmobileCodeMapper;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, String> get(String projectId) {
|
|
|
return Map.of();
|
|
|
@@ -61,9 +75,95 @@ public class OfferDataServiceImpl implements OfferDataService {
|
|
|
|
|
|
@Override
|
|
|
public Map<String, String> getById(String id) {
|
|
|
- return Map.of();
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("code", "200");
|
|
|
+ map.put("msg", "查询成功111");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取 1.项目与土地供应,两个表进行关联。
|
|
|
+ * 并且为上链的,并且不动产单元号不经存在的数据。
|
|
|
+ * 根据入参数据,多个取并集,获取项目的相关数据
|
|
|
+ * @param body
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> landSupplyAndProjectList(ThirdProjectParamVo body) {
|
|
|
+ String projectName = body.getXmmc();
|
|
|
+ String projectCode = body.getXmdm();
|
|
|
+ String srf = body.getSrf();
|
|
|
+ String yfbdcdyh = body.getYfbdcdyh();
|
|
|
+ String ewktString = body.getGeom();
|
|
|
+ List<Map<String,Object>> result = projectMapper.getTdyProjectList(
|
|
|
+ projectName, projectCode, srf, yfbdcdyh, ewktString);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> addRecordStatusData(ThirdRecordStatusParamVo body) {
|
|
|
+
|
|
|
+ // 字段校验:参考 landFirstRegistration 的校验方式
|
|
|
+ String yfbdydyh = body.getYfbdydyh();
|
|
|
+ if (StringUtils.isBlank(yfbdydyh)) {
|
|
|
+ throw new ServiceException("预赋不动产单元号为空");
|
|
|
+ }
|
|
|
+ if (yfbdydyh.length() != 19) {
|
|
|
+ throw new ServiceException("预赋不动产单元号长度必须为19位");
|
|
|
+ }
|
|
|
+
|
|
|
+ String ywlx = body.getYwlx();
|
|
|
+ if (StringUtils.isBlank(ywlx)) {
|
|
|
+ throw new ServiceException("业务类型为空");
|
|
|
+ }
|
|
|
+ if (!"1".equals(ywlx) && !"2".equals(ywlx)) {
|
|
|
+ throw new ServiceException("业务类型只能为1或2");
|
|
|
+ }
|
|
|
+
|
|
|
+ String sfdengbu = body.getSfdengbu();
|
|
|
+ if (StringUtils.isBlank(sfdengbu)) {
|
|
|
+ throw new ServiceException("是否登簿为空");
|
|
|
+ }
|
|
|
+ if (!"Y".equals(sfdengbu) && !"N".equals(sfdengbu)) {
|
|
|
+ throw new ServiceException("是否登簿只能为Y或N");
|
|
|
+ }
|
|
|
+
|
|
|
+ String dengburq = body.getDengburq();
|
|
|
+ if ("Y".equals(sfdengbu)) {
|
|
|
+ if (StringUtils.isBlank(dengburq)) {
|
|
|
+ throw new ServiceException("登簿日期为空");
|
|
|
+ }
|
|
|
+ if (!dengburq.matches("^\\d{4}-\\d{2}-\\d{2}$")) {
|
|
|
+ throw new ServiceException("登簿日期格式必须为yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String ywh = body.getYwh();
|
|
|
+ if (StringUtils.isBlank(ywh)) {
|
|
|
+ throw new ServiceException("业务号为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 入库:以 yfbdydyh 或 ywh 判重,已存在则按主键覆盖更新,避免重复插入
|
|
|
+ ThirdRecordStatusParamVo existing = thirdRecordStatusMapper.selectByYfbdydyhOrYwh(yfbdydyh, ywh);
|
|
|
+ String id;
|
|
|
+ if (existing != null) {
|
|
|
+ // 复用原主键,覆盖更新业务字段
|
|
|
+ id = existing.getId();
|
|
|
+ body.setId(id);
|
|
|
+ thirdRecordStatusMapper.updateById(body);
|
|
|
+ } else {
|
|
|
+ id = IdUtils.fastSimpleUUID();
|
|
|
+ body.setId(id);
|
|
|
+ body.setTbzt("0");
|
|
|
+ thirdRecordStatusMapper.insert(body);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("id", id);
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> landFirstRegistration(LandFirstParamVo body) {
|
|
|
String yfbdcdyh = body.getYfbdcdyh();
|
|
|
@@ -133,11 +233,9 @@ public class OfferDataServiceImpl implements OfferDataService {
|
|
|
throw new ServiceException("geom信息为空");
|
|
|
}
|
|
|
//todo 这里进行文件下载入库:
|
|
|
-
|
|
|
try {
|
|
|
GyjsydjfwscdjVo gyjsydjfwscdjVo = new GyjsydjfwscdjVo();
|
|
|
gyjsydjfwscdjVo.setProjectId(body.getXmbh());
|
|
|
-
|
|
|
// gyjsydjfwscdjVo.setYwh(body.getYwh());
|
|
|
// gyjsydjfwscdjVo.setGzdgzsj(body.getGzdgzsj());
|
|
|
// gyjsydjfwscdjVo.setKfdw(body.getKfdw());
|
|
|
@@ -171,8 +269,6 @@ public class OfferDataServiceImpl implements OfferDataService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public String getTheFile(String attachmentId, String dirName, String fileName) {
|
|
|
String fileAndPath = "";
|
|
|
@@ -192,17 +288,26 @@ public class OfferDataServiceImpl implements OfferDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public NodeAttachment getThirdNodeAttachment(String immobileCode, String projectId, String dqjd) throws Exception {
|
|
|
- String nodeTableName = dqjd.equals("00") ? AloneWorkFlowEnum.NODE_2.getTableName() : dqjd.equals("01") ? AloneWorkFlowEnum.NODE_6.getTableName() : "";
|
|
|
+ public NodeAttachment getThirdNodeAttachment(String preImmobileCode, String projectId, String dqjd) throws Exception {
|
|
|
NodeAttachment nodeAttachment = null;
|
|
|
- List<ProjectWorkflow> projectWorkflows = projectWorkflowMapper.selectByProjectIdAndNodeTableName(projectId, nodeTableName);
|
|
|
- Optional<ProjectWorkflow> res = projectWorkflows.stream().findFirst();
|
|
|
- if (res.isPresent()) {
|
|
|
- String nodeId = res.get().getNodeId();
|
|
|
- log.info("-------getAttachmentByProjectIdAndTable-----" + nodeId);
|
|
|
- nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId, null);
|
|
|
- //这里获取到所有附件文件路径进行转化拼接为新的
|
|
|
- ServiceUtil.convertFilePath(nodeAttachment);
|
|
|
+ //这里根据预赋不动产单元号获取项目id
|
|
|
+ if(StringUtils.isBlank(projectId)){
|
|
|
+ ProjectImmobileCode existing = projectImmobileCodeMapper.selectByPreAssignCode(preImmobileCode);
|
|
|
+ if (Objects.nonNull(existing)) {
|
|
|
+ projectId = existing.getProjectId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(projectId)){
|
|
|
+ String nodeTableName = dqjd.equals("00") ? AloneWorkFlowEnum.NODE_2.getTableName() : dqjd.equals("01") ? AloneWorkFlowEnum.NODE_6.getTableName() : "";
|
|
|
+ List<ProjectWorkflow> projectWorkflows = projectWorkflowMapper.selectByProjectIdAndNodeTableName(projectId, nodeTableName);
|
|
|
+ Optional<ProjectWorkflow> res = projectWorkflows.stream().findFirst();
|
|
|
+ if (res.isPresent()) {
|
|
|
+ String nodeId = res.get().getNodeId();
|
|
|
+ log.info("-------getAttachmentByProjectIdAndTable-----" + nodeId);
|
|
|
+ nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId, null);
|
|
|
+ //这里获取到所有附件文件路径进行转化拼接为新的
|
|
|
+ ServiceUtil.convertFilePath(nodeAttachment);
|
|
|
+ }
|
|
|
}
|
|
|
return nodeAttachment;
|
|
|
}
|