|
@@ -2,6 +2,7 @@ package com.onemap.analyse.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.onemap.analyse.controller.analyse.GetTableDateController;
|
|
|
import com.onemap.analyse.domain.*;
|
|
|
import com.onemap.analyse.domain.calculation.FzxzCalc;
|
|
|
import com.onemap.analyse.domain.res.FzxzResultDTO;
|
|
@@ -22,6 +23,7 @@ import com.onemap.common.core.utils.StringUtils;
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
|
import com.onemap.common.datasource.annotation.Master;
|
|
|
import com.onemap.common.security.utils.SecurityUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -69,6 +71,15 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
@Resource
|
|
|
private ILogService iLogService;
|
|
|
|
|
|
+ // **需要拿出来的逻辑**//
|
|
|
+ // @Resource
|
|
|
+ // AnalyseUtilsDBController analyseUtilsDBController;
|
|
|
+ @Resource
|
|
|
+ private CreateUtilsDBService createUtilsDBService;
|
|
|
+ @Resource
|
|
|
+ private TableDateServiceImpl tableDateService;
|
|
|
+ //**需要拿出来的逻辑**//
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
|
|
@@ -105,15 +116,6 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- // **需要拿出来的逻辑**//
|
|
|
- // @Resource
|
|
|
- // AnalyseUtilsDBController analyseUtilsDBController;
|
|
|
- @Resource
|
|
|
- private CreateUtilsDBService createUtilsDBService;
|
|
|
- @Resource
|
|
|
- private TableDateServiceImpl tableDateService;
|
|
|
- //**需要拿出来的逻辑**//
|
|
|
-
|
|
|
/**
|
|
|
* 保存选址参数
|
|
|
*
|
|
@@ -215,7 +217,7 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
intersectionTableWktVo.setEwkt(ewkt);
|
|
|
String temporaryTable = createUtilsDBService.intersectionTableWkt(intersectionTableWktVo.getTableName(), null, intersectionTableWktVo.getEwkt());
|
|
|
|
|
|
- Integer integer = ghdkaMapper.getTableCount(temporaryTable);
|
|
|
+ Integer integer = tableDateService.getTableCount(temporaryTable);
|
|
|
if (integer == 0) {
|
|
|
iLogService.saveLog(taskId, "辅助选址", "计算完成,未找到区域内数据", "info");
|
|
|
updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
@@ -239,16 +241,17 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
// iLogService.saveLog(taskId, "辅助选址", "地块面积分析完成", "info");
|
|
|
|
|
|
// 3.用地类型(性质)筛选
|
|
|
- ghdkaMapper.delByLandType(temporaryTable, fzxzDTO.getSjy(), fzxzDTO.getYdxz_bsm());
|
|
|
- integer = ghdkaMapper.getTableCount(temporaryTable);
|
|
|
+ tableDateService.delByLandType(temporaryTable, fzxzDTO.getSjy(), fzxzDTO.getYdxz_bsm());
|
|
|
+ integer = tableDateService.getTableCount(temporaryTable);
|
|
|
if (integer == 0) {
|
|
|
iLogService.saveLog(taskId, "辅助选址", "计算完成,未找到符合用地性质条件数据", "info");
|
|
|
updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
|
return RequestResult.error("区域筛选条件筛选未找到符合条件数据!", null);
|
|
|
}
|
|
|
|
|
|
- // 4.规划因子筛选
|
|
|
- factorFilter(taskId, temporaryTable, fzxzCalc.getFactorUseList(), ewkt);
|
|
|
+ // 4.根据因子切割地块
|
|
|
+ String rawTable = factorClip(taskId, temporaryTable, fzxzCalc.getFactorUseList(), ewkt);
|
|
|
+ if (rawTable.equals("")) return RequestResult.error("区域筛选条件筛选未找到符合条件数据!", null);
|
|
|
|
|
|
// 5.保存规划结果
|
|
|
Map<String, Object> scheduleResMap = new HashMap<>();
|
|
@@ -285,7 +288,7 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
|
|
|
// 1.查询因子地块
|
|
|
String tempTable = createUtilsDBService.intersectionTableWkt(tableName, null, ewkt);
|
|
|
- Integer integer = ghdkaMapper.getTableCount(tempTable);
|
|
|
+ Integer integer = tableDateService.getTableCount(tempTable);
|
|
|
if (integer == 0) return "";
|
|
|
// 2.生成因子地块缓冲区
|
|
|
if (factorRadius != 0) {
|
|
@@ -298,10 +301,6 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
return calculateEwkt;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成", "info");
|
|
|
- // iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成", "info");
|
|
|
-
|
|
|
/**
|
|
|
* 根据因子筛选地块
|
|
|
*
|
|
@@ -310,13 +309,18 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
* @param factorUseDTOS
|
|
|
* @param ewkt
|
|
|
*/
|
|
|
- private String factorFilter(String taskId, String rawTable, List<FactorUseDTO> factorUseDTOS, String ewkt) {
|
|
|
+ private String factorClip(String taskId, String rawTable, List<FactorUseDTO> factorUseDTOS, String ewkt) {
|
|
|
for (FactorUseDTO factorUseDTO : factorUseDTOS) {
|
|
|
if (factorUseDTO.getSpatialType().equals("intersect")) {
|
|
|
// 1.先切割因子地块
|
|
|
- String calculateEwkt = getFactorEwkt(factorUseDTO.getFactorName(), ewkt, factorUseDTO.getDefaultValue());
|
|
|
+ String calculateEwkt = getFactorEwkt(factorUseDTO.getFactorBsm(), ewkt, factorUseDTO.getDefaultValue(), 0);
|
|
|
// 2.切割地块
|
|
|
if (factorUseDTO.getDefaultType().equals("intersect")) {
|
|
|
+ if (calculateEwkt.equals("")) {
|
|
|
+ iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成,未找到符合要求地块", "info");
|
|
|
+ updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
|
+ return "";
|
|
|
+ }
|
|
|
// 地块与因子求交集
|
|
|
rawTable = createUtilsDBService.intersectionTableWkt(rawTable, null, calculateEwkt);
|
|
|
} else {
|
|
@@ -326,9 +330,14 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
} else if (factorUseDTO.getSpatialType().equals("contain")) {
|
|
|
// TODO 计算地块缓冲区可能有问题,但是现在包含没有缓冲区
|
|
|
// 1.先切割因子地块
|
|
|
- String calculateEwkt = getFactorEwkt(factorUseDTO.getFactorName(), ewkt, factorUseDTO.getDefaultValue(), 0);
|
|
|
+ String calculateEwkt = getFactorEwkt(factorUseDTO.getFactorBsm(), ewkt, factorUseDTO.getDefaultValue(), 0);
|
|
|
// 包含判断
|
|
|
if (factorUseDTO.getDefaultType().equals("contain")) {
|
|
|
+ if (calculateEwkt.equals("")) {
|
|
|
+ iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成,未找到符合要求地块", "info");
|
|
|
+ updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
|
+ return "";
|
|
|
+ }
|
|
|
// 地块与因子求差集
|
|
|
rawTable = createUtilsDBService.intersectionTableWkt(rawTable, null, calculateEwkt);
|
|
|
} else {
|
|
@@ -336,21 +345,29 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
rawTable = createUtilsDBService.differenceTableWkt(rawTable, null, calculateEwkt);
|
|
|
}
|
|
|
} else if (factorUseDTO.getSpatialType().equals("distance")) {
|
|
|
- String calculateEwkt = getFactorEwkt(factorUseDTO.getFactorName(), ewkt, factorUseDTO.getDefaultValue(), factorUseDTO.getDefaultValue());
|
|
|
+ String calculateEwkt = getFactorEwkt(factorUseDTO.getFactorBsm(), ewkt, factorUseDTO.getDefaultValue(), factorUseDTO.getDefaultValue());
|
|
|
// 距离判断
|
|
|
if (factorUseDTO.getDefaultType().equals("lt") || factorUseDTO.getDefaultType().equals("let")) {
|
|
|
// 地块与因子求差集
|
|
|
+ if (calculateEwkt.equals("")) {
|
|
|
+ iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成,未找到符合要求地块", "info");
|
|
|
+ updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
|
+ return "";
|
|
|
+ }
|
|
|
rawTable = createUtilsDBService.intersectionTableWkt(rawTable, null, calculateEwkt);
|
|
|
} else {
|
|
|
// 地块与因子求差集
|
|
|
rawTable = createUtilsDBService.differenceTableWkt(rawTable, null, calculateEwkt);
|
|
|
}
|
|
|
}
|
|
|
- if (0 == 0) {
|
|
|
- iLogService.saveLog(taskId, "辅助选址", "计算完成,未找到符合条件数据", "info");
|
|
|
+
|
|
|
+ Integer tableCount = tableDateService.getTableCount(rawTable);
|
|
|
+ if (tableCount == 0) {
|
|
|
+ iLogService.saveLog(taskId, "辅助选址",
|
|
|
+ factorUseDTO.getFactorName() + "计算完成,未找到符合条件数据",
|
|
|
+ "info");
|
|
|
updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
|
- // TODO
|
|
|
- // return RequestResult.error(fzxzXzyzDTO.getFactorName() + "条件筛选未找到符合条件数据!", null);
|
|
|
+ return "";
|
|
|
}
|
|
|
iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成", "info");
|
|
|
}
|