|
|
@@ -6,6 +6,7 @@ import com.siwei.apply.domain.vo.*;
|
|
|
import com.siwei.apply.enums.AloneWorkFlowEnum;
|
|
|
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;
|
|
|
@@ -14,6 +15,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;
|
|
|
@@ -55,6 +57,9 @@ public class OfferDataServiceImpl implements OfferDataService {
|
|
|
@Autowired
|
|
|
private ProjectMapper projectMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ThirdRecordStatusMapper thirdRecordStatusMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public Map<String, String> get(String projectId) {
|
|
|
@@ -85,7 +90,68 @@ public class OfferDataServiceImpl implements OfferDataService {
|
|
|
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
|