|
@@ -2,15 +2,13 @@ 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.AnalyseUtilsDBController;
|
|
|
-import com.onemap.analyse.controller.analyse.CreateUtilsDBController;
|
|
|
import com.onemap.analyse.domain.*;
|
|
|
import com.onemap.analyse.domain.calculation.FzxzCalc;
|
|
|
-import com.onemap.analyse.domain.query.GhdkaFilter;
|
|
|
import com.onemap.analyse.domain.res.FzxzResultDTO;
|
|
|
import com.onemap.analyse.domain.res.GeomRes;
|
|
|
-import com.onemap.analyse.domain.vo.IntersectionTableWktVo;
|
|
|
+import com.onemap.analyse.domain.vo.TableWktVo;
|
|
|
import com.onemap.analyse.domain.vo.SelectPilotVo;
|
|
|
+import com.onemap.analyse.domain.vo.TableNameIdsVo;
|
|
|
import com.onemap.analyse.mapper.*;
|
|
|
import com.onemap.analyse.mapper.base.FzxzResMapper;
|
|
|
import com.onemap.analyse.mapper.base.ShpFileMapper;
|
|
@@ -112,6 +110,8 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
// AnalyseUtilsDBController analyseUtilsDBController;
|
|
|
@Resource
|
|
|
private CreateUtilsDBService createUtilsDBService;
|
|
|
+ @Resource
|
|
|
+ private TableDateServiceImpl tableDateService;
|
|
|
//**需要拿出来的逻辑**//
|
|
|
|
|
|
/**
|
|
@@ -210,7 +210,7 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
|
|
|
// 地块切割
|
|
|
String ewkt = geomRes.getGeom();
|
|
|
- IntersectionTableWktVo intersectionTableWktVo = new IntersectionTableWktVo();
|
|
|
+ TableWktVo intersectionTableWktVo = new TableWktVo();
|
|
|
intersectionTableWktVo.setTableName(fzxzDTO.getSjy());
|
|
|
intersectionTableWktVo.setEwkt(ewkt);
|
|
|
String temporaryTable = createUtilsDBService.intersectionTableWkt(intersectionTableWktVo.getTableName(), null, intersectionTableWktVo.getEwkt());
|
|
@@ -282,40 +282,45 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
* @param factorUseDTOS
|
|
|
* @param ewkt
|
|
|
*/
|
|
|
- private void factorFilter(String taskId, String rawTable, List<FactorUseDTO> factorUseDTOS, String ewkt) {
|
|
|
+ private String factorFilter(String taskId, String rawTable, List<FactorUseDTO> factorUseDTOS, String ewkt) {
|
|
|
+
|
|
|
for (FactorUseDTO factorUseDTO : factorUseDTOS) {
|
|
|
if (factorUseDTO.getSpatialType().equals("intersect")) {
|
|
|
// 相交判断
|
|
|
// 1.先切割因子地块
|
|
|
- String temporaryTable = createUtilsDBService.intersectionTableWkt(factorUseDTO.getFactorBsm(), null, ewkt);
|
|
|
- Integer integer = ghdkaMapper.getTableCount(temporaryTable);
|
|
|
+ String tempTable = createUtilsDBService.intersectionTableWkt(factorUseDTO.getFactorBsm(), null, ewkt);
|
|
|
+ Integer integer = ghdkaMapper.getTableCount(tempTable);
|
|
|
if (integer == 0) {
|
|
|
// TODO 再定
|
|
|
iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成", "info");
|
|
|
continue;
|
|
|
}
|
|
|
// 2.生成因子地块缓冲区
|
|
|
- if (factorUseDTO.getDefaultValue() == 0) {
|
|
|
+ if (factorUseDTO.getDefaultValue() != 0) {
|
|
|
// 没有值直接计算
|
|
|
- temporaryTable = createUtilsDBService.bufferTable(temporaryTable, factorUseDTO.getDefaultValue());
|
|
|
+ tempTable = createUtilsDBService.bufferTable(tempTable, factorUseDTO.getDefaultValue());
|
|
|
|
|
|
- integer = ghdkaMapper.getTableCount(temporaryTable);
|
|
|
+ integer = ghdkaMapper.getTableCount(tempTable);
|
|
|
if (integer == 0) {
|
|
|
// TODO 再定
|
|
|
iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成", "info");
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// 3.地块切割
|
|
|
+ // 3.1查询需要切割的地块
|
|
|
+ TableNameIdsVo tableNameIdsVo = new TableNameIdsVo();
|
|
|
+ tableNameIdsVo.setTableName(tempTable);
|
|
|
+ String calculateEwkt = tableDateService.getGeomUnion(tableNameIdsVo);
|
|
|
+
|
|
|
+ // 3.2切割
|
|
|
if (factorUseDTO.getDefaultType().equals("intersect")) {
|
|
|
// 相交判断
|
|
|
- temporaryTable = createUtilsDBService.differenceTables(rawTable, null, temporaryTable);
|
|
|
+ rawTable = createUtilsDBService.intersectionTableWkt(rawTable, null, calculateEwkt);
|
|
|
} else {
|
|
|
// 不相交判断
|
|
|
- temporaryTable = createUtilsDBService.differenceTables(rawTable, null, temporaryTable);
|
|
|
+ rawTable = createUtilsDBService.differenceTableWkt(rawTable, null, calculateEwkt);
|
|
|
}
|
|
|
- System.out.println(temporaryTable);
|
|
|
} else if (factorUseDTO.getSpatialType().equals("contain")) {
|
|
|
// 包含判断
|
|
|
if (factorUseDTO.getDefaultValue() == 0) {
|
|
@@ -339,6 +344,7 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
}
|
|
|
iLogService.saveLog(taskId, "辅助选址", factorUseDTO.getFactorName() + "因子影响分析完成", "info");
|
|
|
}
|
|
|
+ return rawTable;
|
|
|
}
|
|
|
|
|
|
/**
|