|
@@ -1,11 +1,13 @@
|
|
|
package com.siwei.apply.service.zrzysite.impl;
|
|
package com.siwei.apply.service.zrzysite.impl;
|
|
|
|
|
|
|
|
import com.siwei.apply.domain.Jsydghxk;
|
|
import com.siwei.apply.domain.Jsydghxk;
|
|
|
|
|
+import com.siwei.apply.domain.LandType;
|
|
|
import com.siwei.apply.domain.Project;
|
|
import com.siwei.apply.domain.Project;
|
|
|
import com.siwei.apply.domain.vo.JsydghxkUpdateVo;
|
|
import com.siwei.apply.domain.vo.JsydghxkUpdateVo;
|
|
|
import com.siwei.apply.domain.vo.JsydghxkVo;
|
|
import com.siwei.apply.domain.vo.JsydghxkVo;
|
|
|
import com.siwei.apply.domain.zrzysite.ZrzysiteLand;
|
|
import com.siwei.apply.domain.zrzysite.ZrzysiteLand;
|
|
|
import com.siwei.apply.mapper.JsydghxkMapper;
|
|
import com.siwei.apply.mapper.JsydghxkMapper;
|
|
|
|
|
+import com.siwei.apply.mapper.LandTypeMapper;
|
|
|
import com.siwei.apply.mapper.ProjectMapper;
|
|
import com.siwei.apply.mapper.ProjectMapper;
|
|
|
import com.siwei.apply.mapper.zrzysite.ZrzysiteLandMapper;
|
|
import com.siwei.apply.mapper.zrzysite.ZrzysiteLandMapper;
|
|
|
import com.siwei.apply.service.JsydghxkService;
|
|
import com.siwei.apply.service.JsydghxkService;
|
|
@@ -22,8 +24,11 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
|
public class ZrzysiteLandServiceImpl implements IZrzysiteLandService {
|
|
public class ZrzysiteLandServiceImpl implements IZrzysiteLandService {
|
|
@@ -40,11 +45,24 @@ public class ZrzysiteLandServiceImpl implements IZrzysiteLandService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private JsydghxkService jsydghxkService;
|
|
private JsydghxkService jsydghxkService;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LandTypeMapper landTypeMapper;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IZrzysiteCommonService zrzysiteCommonService;
|
|
private IZrzysiteCommonService zrzysiteCommonService;
|
|
|
|
|
|
|
|
private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD);
|
|
private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD);
|
|
|
|
|
|
|
|
|
|
+ private static final Pattern YDMJ_PATTERN = Pattern.compile("([\\d.]+)\\s*(.+)");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private static List<LandType> allLandTypeList = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void syncLandInfo() {
|
|
public void syncLandInfo() {
|
|
|
List<Project> landProjectList = projectMapper.getZrzysiteProjectList("t_jsydghxk");
|
|
List<Project> landProjectList = projectMapper.getZrzysiteProjectList("t_jsydghxk");
|
|
@@ -170,13 +188,18 @@ public class ZrzysiteLandServiceImpl implements IZrzysiteLandService {
|
|
|
updateVo.setYddw(land.getXddw());
|
|
updateVo.setYddw(land.getXddw());
|
|
|
updateVo.setYdwz(land.getYdwz());
|
|
updateVo.setYdwz(land.getYdwz());
|
|
|
if (StringUtils.isNotBlank(land.getYdmj())) {
|
|
if (StringUtils.isNotBlank(land.getYdmj())) {
|
|
|
- try {
|
|
|
|
|
- updateVo.setYdArea(Float.parseFloat(land.getYdmj()));
|
|
|
|
|
- } catch (NumberFormatException e) {
|
|
|
|
|
- log.warn("用地面积转换失败: {}", land.getYdmj());
|
|
|
|
|
|
|
+ Matcher m = YDMJ_PATTERN.matcher(land.getYdmj().trim());
|
|
|
|
|
+ if (m.find()) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ updateVo.setYdArea(Float.parseFloat(m.group(1)));
|
|
|
|
|
+ updateVo.setYdUnit(m.group(2).trim());
|
|
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
|
|
+ log.warn("用地面积转换失败: {}", land.getYdmj());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- updateVo.setTdyt(land.getTdyt());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ updateVo.setTdyt(getTdytCodeByName(land.getTdyt()));
|
|
|
updateVo.setTdhqfs(land.getTdhqfs());
|
|
updateVo.setTdhqfs(land.getTdhqfs());
|
|
|
updateVo.setPzydjg(land.getPzydjg());
|
|
updateVo.setPzydjg(land.getPzydjg());
|
|
|
updateVo.setPzydwh(land.getPzydwh());
|
|
updateVo.setPzydwh(land.getPzydwh());
|
|
@@ -195,13 +218,17 @@ public class ZrzysiteLandServiceImpl implements IZrzysiteLandService {
|
|
|
vo.setYddw(land.getXddw());
|
|
vo.setYddw(land.getXddw());
|
|
|
vo.setYdwz(land.getYdwz());
|
|
vo.setYdwz(land.getYdwz());
|
|
|
if (StringUtils.isNotBlank(land.getYdmj())) {
|
|
if (StringUtils.isNotBlank(land.getYdmj())) {
|
|
|
- try {
|
|
|
|
|
- vo.setYdArea(Float.parseFloat(land.getYdmj()));
|
|
|
|
|
- } catch (NumberFormatException e) {
|
|
|
|
|
- log.warn("用地面积转换失败: {}", land.getYdmj());
|
|
|
|
|
|
|
+ Matcher m = YDMJ_PATTERN.matcher(land.getYdmj().trim());
|
|
|
|
|
+ if (m.find()) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ vo.setYdArea(Float.parseFloat(m.group(1)));
|
|
|
|
|
+ vo.setYdUnit(m.group(2).trim());
|
|
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
|
|
+ log.warn("用地面积转换失败: {}", land.getYdmj());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- vo.setTdyt(land.getTdyt());
|
|
|
|
|
|
|
+ vo.setTdyt(getTdytCodeByName(land.getTdyt()));
|
|
|
vo.setTdhqfs(land.getTdhqfs());
|
|
vo.setTdhqfs(land.getTdhqfs());
|
|
|
vo.setPzydjg(land.getPzydjg());
|
|
vo.setPzydjg(land.getPzydjg());
|
|
|
vo.setPzydwh(land.getPzydwh());
|
|
vo.setPzydwh(land.getPzydwh());
|
|
@@ -216,4 +243,30 @@ public class ZrzysiteLandServiceImpl implements IZrzysiteLandService {
|
|
|
}
|
|
}
|
|
|
return addNodeId;
|
|
return addNodeId;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据名称获取编码
|
|
|
|
|
+ * @param useName
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String getTdytCodeByName(String useName) {
|
|
|
|
|
+ if (allLandTypeList.isEmpty()) {
|
|
|
|
|
+ List<LandType> all = landTypeMapper.selectAll();
|
|
|
|
|
+ allLandTypeList.addAll(all);
|
|
|
|
|
+ }
|
|
|
|
|
+ String code = "23";
|
|
|
|
|
+ // 转换为节点
|
|
|
|
|
+ Optional<LandType> filterRes = allLandTypeList.stream().filter(s -> s.getName().equalsIgnoreCase(useName)).findFirst();
|
|
|
|
|
+ if (filterRes.isPresent()) {
|
|
|
|
|
+ code = filterRes.get().getCode();
|
|
|
|
|
+ }
|
|
|
|
|
+ return code;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|