|
@@ -6,13 +6,10 @@ import com.onemap.apply.domain.table.TableDataVo;
|
|
|
import com.onemap.apply.domain.table.TableFiledDTO;
|
|
|
import com.onemap.apply.domain.table.TableResRuleDTO;
|
|
|
import com.onemap.apply.mapper.table.*;
|
|
|
+import com.onemap.apply.service.analyse.HttpAnalyseService;
|
|
|
import com.onemap.apply.service.table.TableDataSelectService;
|
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
|
-import com.onemap.common.core.web.domain.RequestResult;
|
|
|
-import com.onemap.system.api.AnalyseService;
|
|
|
-import com.onemap.system.api.domain.AnalyseUtilsVo;
|
|
|
-import oracle.jdbc.internal.ObjectData;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import com.onemap.system.api.domain.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -27,11 +24,12 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
|
|
|
@Resource
|
|
|
private TableDataSelectMapper tableDataSelectMapper;
|
|
|
@Resource
|
|
|
- private AnalyseService analyseService;
|
|
|
+ private HttpAnalyseService httpAnalyseService;
|
|
|
@Resource
|
|
|
private TableFiledRelationMapper tableFiledRelationMapper;
|
|
|
@Resource
|
|
|
private TableFiledMapper tableFiledMapper;
|
|
|
+ private final Integer SRID = 4525;
|
|
|
|
|
|
@Override
|
|
|
public Map dataSelectByPoint(String pointEWkt, String bsm) {
|
|
@@ -40,7 +38,6 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
|
|
|
QueryWrapper<TableResRuleDTO> queryResOneWrapper = new QueryWrapper<>();
|
|
|
queryResOneWrapper.eq("id", bsm);
|
|
|
TableResRuleDTO v_table_res_id = tableResRuleMapper.selectOne(queryResOneWrapper);
|
|
|
-
|
|
|
List<List<TableDataVo>> data = dataSelectById(pointEWkt, bsm);
|
|
|
if (data == null || data.size() <= 0) {
|
|
|
return retList;
|
|
@@ -133,23 +130,26 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
|
|
|
//intersection 交集
|
|
|
// v_table_Res.getAnalyseType();
|
|
|
if ("intersection".equals(v_analyse_type)) {
|
|
|
- return tabelIntersectionHandle(pointEWkt, v_from_table.getTableName(), v_from_table.getId());
|
|
|
+ return tableIntersectionHandle(pointEWkt, v_from_table.getTableName(), v_from_table.getId());
|
|
|
}
|
|
|
- return tabelIntersectsHandle(pointEWkt, v_from_table.getTableName(), v_from_table.getId());
|
|
|
+ return tableIntersectsHandle(pointEWkt, v_from_table.getTableName(), v_from_table.getId());
|
|
|
} else {
|
|
|
if ("intersection".equals(v_analyse_type)) {
|
|
|
- return tabelIntersectionHandle(pointEWkt, v_analyse_table.getTableName(), v_analyse_table.getId());
|
|
|
+ return tableIntersectionHandle(pointEWkt, v_analyse_table.getTableName(), v_analyse_table.getId());
|
|
|
}
|
|
|
- return tabelIntersectsHandle(pointEWkt, v_analyse_table.getTableName(), v_analyse_table.getId());
|
|
|
+ return tableIntersectsHandle(pointEWkt, v_analyse_table.getTableName(), v_analyse_table.getId());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//取相交的函数
|
|
|
- private List<List<TableDataVo>> tabelIntersectsHandle(String eWkt, String tableName, String tableId) {
|
|
|
+ private List<List<TableDataVo>> tableIntersectsHandle(String eWkt, String tableName, String tableId) {
|
|
|
List<List<TableDataVo>> retList = new ArrayList<>();
|
|
|
- List<String> from_kj_ids = intersectsTableWkt(tableName, null, null, eWkt, null);
|
|
|
- if (from_kj_ids == null || from_kj_ids.size() == 0) {
|
|
|
+ IntersectsTableWktVo intersectsTableWktVo = new IntersectsTableWktVo();
|
|
|
+ intersectsTableWktVo.setEwkt(eWkt);
|
|
|
+ intersectsTableWktVo.setTableName(tableName);
|
|
|
+ List<String> from_kj_ids = httpAnalyseService.intersectsTableWkt(intersectsTableWktVo);
|
|
|
+ if (from_kj_ids == null || from_kj_ids.size() <= 0) {
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
@@ -158,18 +158,26 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
|
|
|
for (TableFiledDTO v_data : filedlist) {
|
|
|
outputColumn.add(v_data.getFiledName());
|
|
|
}
|
|
|
- List<Map> retDataList = new ArrayList<>();
|
|
|
- for (String v_id : from_kj_ids) {
|
|
|
- Map map = tableDataSelectMapper.getTableDataById(tableName, v_id, outputColumn);
|
|
|
- retDataList.add(map);
|
|
|
+ RawTableVo rawTableVo = new RawTableVo();
|
|
|
+ rawTableVo.setRawTableName(tableName);
|
|
|
+ rawTableVo.setSrid(SRID);
|
|
|
+ rawTableVo.setIds(from_kj_ids);
|
|
|
+ rawTableVo.setsIsGeography(false);
|
|
|
+ rawTableVo.setColumns(outputColumn);
|
|
|
+ List<Map> retDataList = httpAnalyseService.rawTable(rawTableVo);
|
|
|
+ if (retDataList == null || retDataList.size() <= 0) {
|
|
|
+ return retList;
|
|
|
}
|
|
|
return dataMapTransFormZh(retDataList, filedlist);
|
|
|
}
|
|
|
|
|
|
//取并集的函数
|
|
|
- private List<List<TableDataVo>> tabelIntersectionHandle(String eWkt, String tableName, String tableId) {
|
|
|
+ private List<List<TableDataVo>> tableIntersectionHandle(String eWkt, String tableName, String tableId) {
|
|
|
List<List<TableDataVo>> retList = new ArrayList<>();
|
|
|
- List<String> from_kj_ids = intersectsTableWkt(tableName, null, null, eWkt, null);
|
|
|
+ IntersectsTableWktVo intersectsTableWktVo = new IntersectsTableWktVo();
|
|
|
+ intersectsTableWktVo.setEwkt(eWkt);
|
|
|
+ intersectsTableWktVo.setTableName(tableName);
|
|
|
+ List<String> from_kj_ids = httpAnalyseService.intersectsTableWkt(intersectsTableWktVo);
|
|
|
if (from_kj_ids == null || from_kj_ids.size() == 0) {
|
|
|
return retList;
|
|
|
}
|
|
@@ -179,7 +187,23 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
|
|
|
for (TableFiledDTO v_data : list) {
|
|
|
outputColumn.add(v_data.getFiledName());
|
|
|
}
|
|
|
- List<Map> from_jg = intersectionTableWkt(tableName, 4326, from_kj_ids, eWkt, 4525, outputColumn);
|
|
|
+
|
|
|
+ IntersectionTableWktVo intersectionTableWktVo = new IntersectionTableWktVo();
|
|
|
+ intersectionTableWktVo.setEwkt(eWkt);
|
|
|
+ intersectionTableWktVo.setTableIds(from_kj_ids);
|
|
|
+ intersectionTableWktVo.setTableName(tableName);
|
|
|
+ String from_kj_data = httpAnalyseService.intersectionTableWkt(intersectionTableWktVo);
|
|
|
+ if (StringUtils.isEmpty(from_kj_data)) {
|
|
|
+ return retList;
|
|
|
+ }
|
|
|
+
|
|
|
+ TargetTableVo targetTableVo = new TargetTableVo();
|
|
|
+ targetTableVo.setTargetTableName(from_kj_data);
|
|
|
+ targetTableVo.setColumns(outputColumn);
|
|
|
+ targetTableVo.setRawTableName(tableName);
|
|
|
+ targetTableVo.setsIsGeography(false);
|
|
|
+ targetTableVo.setSrid(SRID);
|
|
|
+ List<Map> from_jg = httpAnalyseService.targetTable(targetTableVo);
|
|
|
if (from_jg == null || from_jg.size() <= 0) {
|
|
|
return retList;
|
|
|
}
|
|
@@ -213,68 +237,6 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
- public List<String> intersectsTableWkt(String inputTable, Integer inputSRID, List<String> inputIds, String intersectsWkt, Integer intersectsWktSRID) {
|
|
|
- AnalyseUtilsVo vo = new AnalyseUtilsVo();
|
|
|
- vo.setInputTable(inputTable);
|
|
|
- vo.setInputSRID(inputSRID);
|
|
|
- vo.setInputIds(inputIds);
|
|
|
- vo.setAnalyseWkt(intersectsWkt);
|
|
|
- vo.setAnalyseWktSRID(intersectsWktSRID);
|
|
|
- RequestResult result = analyseService.intersectsTableWktV1(vo);
|
|
|
- if (StringUtils.isNull(result)) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Object code = result.get("code");
|
|
|
- Object statuscode = result.get("statuscode");
|
|
|
- if (code == null && statuscode == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (code != null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (statuscode != null && (Integer) statuscode != 200) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Object resultDataObject = result.get("data");
|
|
|
- if (StringUtils.isNotNull(resultDataObject)) {
|
|
|
- List<String> idsList = (List<String>) resultDataObject;
|
|
|
- return idsList;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- public List<Map> intersectionTableWkt(String inputTable, Integer inputSRID, List<String> inputIds, String intersectsWkt, Integer intersectsWktSRID, List<String> outputColumn) {
|
|
|
- AnalyseUtilsVo vo = new AnalyseUtilsVo();
|
|
|
- vo.setInputTable(inputTable);
|
|
|
- vo.setInputSRID(inputSRID);
|
|
|
- vo.setInputIds(inputIds);
|
|
|
- vo.setAnalyseWkt(intersectsWkt);
|
|
|
- vo.setAnalyseWktSRID(intersectsWktSRID);
|
|
|
- vo.setOutputColumn(outputColumn);
|
|
|
- RequestResult result = analyseService.intersectionTableWktV1(vo);
|
|
|
- if (StringUtils.isNull(result)) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Object code = result.get("code");
|
|
|
- Object statuscode = result.get("statuscode");
|
|
|
- if (code == null && statuscode == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (code != null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (statuscode != null && (Integer) statuscode != 200) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Object resultDataObject = result.get("data");
|
|
|
- if (StringUtils.isNotNull(resultDataObject)) {
|
|
|
- List<Map> idsList = (List<Map>) resultDataObject;
|
|
|
- return idsList;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
public List<TableFiledDTO> getFieldListByTableId(String tableId, Integer isDisplay) {
|
|
|
List<TableFiledDTO> list = tableFiledMapper.getFiledDTOByTableId(tableId, isDisplay);
|
|
|
return list;
|