|
@@ -2,16 +2,19 @@ package com.onemap.apply.service.gdbh.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.onemap.apply.domain.gdbh.*;
|
|
|
+import com.onemap.apply.mapper.gdbh.GdbhMapper;
|
|
|
import com.onemap.apply.mapper.gdbh.GdbhRwJgMapper;
|
|
|
import com.onemap.apply.mapper.gdbh.GdbhYzMapper;
|
|
|
import com.onemap.apply.service.analyse.HttpAnalyseService;
|
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
|
import com.onemap.system.api.domain.IntersectionTableWktVo;
|
|
|
import com.onemap.system.api.domain.IntersectsTableWktVo;
|
|
|
+import com.onemap.system.api.domain.TablesAIdsVo;
|
|
|
import com.onemap.system.api.domain.TargetTableVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -21,6 +24,8 @@ public class GdbhHandleService {
|
|
|
@Autowired
|
|
|
private GdbhYzMapper gdbhYzMapper;
|
|
|
@Autowired
|
|
|
+ private GdbhMapper gdbhMapper;
|
|
|
+ @Autowired
|
|
|
private HttpAnalyseService httpAnalyseService;
|
|
|
@Autowired
|
|
|
private GdbhRwJgMapper gdbhRwJgMapper;
|
|
@@ -28,6 +33,7 @@ public class GdbhHandleService {
|
|
|
void gdbhAnalysisHandle(GdbhDto gdbhDto) {
|
|
|
//获取范围
|
|
|
String xzfw = gdbhDto.getGeom();
|
|
|
+ String d_RawTableName = "TB_GPL0";
|
|
|
|
|
|
//获取因子
|
|
|
QueryWrapper<GdbhYzDTO> yzWrapper = new QueryWrapper<>();
|
|
@@ -40,11 +46,16 @@ public class GdbhHandleService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//计算
|
|
|
List<GdbhRwMxDto> mxlist = gdbhDto.getMxlist();
|
|
|
if (mxlist == null || mxlist.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
+ //计算三调结果
|
|
|
+ sandiao(gdbhDto.getBsm(), d_RawTableName);
|
|
|
+
|
|
|
+ //计算因子结果
|
|
|
for (GdbhRwMxDto mx : mxlist) {
|
|
|
List<GdbhRwMxYzDto> yiList = mx.getGdbhMxYz();
|
|
|
if (yiList == null || yiList.size() == 0) {
|
|
@@ -59,41 +70,77 @@ public class GdbhHandleService {
|
|
|
if (StringUtils.isNull(d_yz_dto)) {
|
|
|
continue;
|
|
|
}
|
|
|
- String d_analysis_xzfw = xzfw;
|
|
|
String d_analysis_table = d_yz_dto.getBsm();
|
|
|
- //交集
|
|
|
- IntersectsTableWktVo analyseUtilsVo = new IntersectsTableWktVo();
|
|
|
- analyseUtilsVo.setEwkt(d_analysis_xzfw);
|
|
|
- analyseUtilsVo.setTableName(d_analysis_table);
|
|
|
- List<String> ids = httpAnalyseService.intersectsTableWkt(analyseUtilsVo);
|
|
|
- if (ids != null && ids.size() > 0) {
|
|
|
- //相交
|
|
|
- IntersectionTableWktVo intersectionTableWktVo = new IntersectionTableWktVo();
|
|
|
- intersectionTableWktVo.setTableName(d_analysis_table);
|
|
|
- intersectionTableWktVo.setEwkt(d_analysis_xzfw);
|
|
|
- intersectionTableWktVo.setTableIds(ids);
|
|
|
- String tableName = httpAnalyseService.intersectionTableWkt(intersectionTableWktVo);
|
|
|
-
|
|
|
- TargetTableVo targetTableVo = new TargetTableVo();
|
|
|
- targetTableVo.setSrid(4525);
|
|
|
- targetTableVo.setIsGeography(false);
|
|
|
- targetTableVo.setSiweiArea(true);
|
|
|
- targetTableVo.setTargetTableName(tableName);
|
|
|
- targetTableVo.setRawTableName(d_analysis_table);
|
|
|
- List<Map> map = httpAnalyseService.targetTable(targetTableVo);
|
|
|
-
|
|
|
- for (Map map1 : map) {
|
|
|
- GdbhRwJgDTO d_dto_0 = new GdbhRwJgDTO();
|
|
|
- d_dto_0.setId(StringUtils.getUUID());
|
|
|
- d_dto_0.setRwbsm(gdbhDto.getBsm());
|
|
|
- d_dto_0.setMx_bsm(mx.getBsm());
|
|
|
- d_dto_0.setYz_bsm(d_yz_dto.getId());
|
|
|
- d_dto_0.setSumvalue(((Double) map1.get("siweiarea")).toString());
|
|
|
- d_dto_0.setGeomvalue((String) map1.get("geom"));
|
|
|
- gdbhRwJgMapper.insertGdbhRwJgGeom(d_dto_0);
|
|
|
- }
|
|
|
+
|
|
|
+ TablesAIdsVo tablesAIdsVo = new TablesAIdsVo();
|
|
|
+ tablesAIdsVo.setTableNameA(d_RawTableName);
|
|
|
+ tablesAIdsVo.setTableNameB(d_analysis_table);
|
|
|
+ String tableName = httpAnalyseService.intersectionTables(tablesAIdsVo);
|
|
|
+
|
|
|
+ System.out.println(tableName);
|
|
|
+ List<String> columns = new ArrayList<>(); // 列名
|
|
|
+ columns.add("id");
|
|
|
+ TargetTableVo targetTableVo = new TargetTableVo();
|
|
|
+ targetTableVo.setSrid(4525);
|
|
|
+ targetTableVo.setIsGeography(false);
|
|
|
+ targetTableVo.setSiweiArea(true);
|
|
|
+ targetTableVo.setTargetTableName(tableName);
|
|
|
+ targetTableVo.setRawTableName(d_RawTableName);
|
|
|
+ targetTableVo.setColumns(columns);
|
|
|
+ List<Map> map = httpAnalyseService.targetTable(targetTableVo);
|
|
|
+
|
|
|
+ for (Map map1 : map) {
|
|
|
+ GdbhRwJgDTO d_dto_0 = new GdbhRwJgDTO();
|
|
|
+ d_dto_0.setId(StringUtils.getUUID());
|
|
|
+ d_dto_0.setRwbsm(gdbhDto.getBsm());
|
|
|
+ d_dto_0.setMx_bsm(mx.getBsm());
|
|
|
+ d_dto_0.setYz_bsm(d_yz_dto.getId());
|
|
|
+ d_dto_0.setGroupvalue((map1.get("id")).toString());
|
|
|
+ d_dto_0.setSumvalue(((Double) map1.get("siweiarea")).toString());
|
|
|
+ d_dto_0.setGeomvalue((String) map1.get("geom"));
|
|
|
+ gdbhRwJgMapper.insertGdbhRwJgGeom(d_dto_0);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //查询三调数据
|
|
|
+ public void sandiao(String rwbsm, String d_RawTableName) {
|
|
|
+ List<Map<String, String>> tableNameList = new ArrayList<>();
|
|
|
+ Map<String, String> tableNameMap = new HashMap<>();
|
|
|
+ tableNameMap.put("xh", "0");
|
|
|
+ tableNameMap.put("tableName", d_RawTableName);
|
|
|
+ tableNameList.add(tableNameMap);
|
|
|
+ String ewkt = gdbhMapper.queryGdbhXmfwTC(tableNameList);
|
|
|
+
|
|
|
+ //相交
|
|
|
+ IntersectionTableWktVo intersectionTableWktVo = new IntersectionTableWktVo();
|
|
|
+ intersectionTableWktVo.setTableName("TEMP_DLTU_BPQ");
|
|
|
+ intersectionTableWktVo.setEwkt(ewkt);
|
|
|
+ String tableName = httpAnalyseService.intersectionTableWkt(intersectionTableWktVo);
|
|
|
+
|
|
|
+ List<String> columns = new ArrayList<>(); // 列名
|
|
|
+ columns.add("dlmc");
|
|
|
+ TargetTableVo targetTableVo = new TargetTableVo();
|
|
|
+ targetTableVo.setSrid(4525);
|
|
|
+ targetTableVo.setIsGeography(false);
|
|
|
+ targetTableVo.setSiweiArea(true);
|
|
|
+ targetTableVo.setTargetTableName(tableName);
|
|
|
+ targetTableVo.setRawTableName("TEMP_DLTU_BPQ");
|
|
|
+ targetTableVo.setColumns(columns);
|
|
|
+ List<Map> map = httpAnalyseService.targetTable(targetTableVo);
|
|
|
+
|
|
|
+ for (Map map1 : map) {
|
|
|
+ GdbhRwJgDTO d_dto_0 = new GdbhRwJgDTO();
|
|
|
+ d_dto_0.setId(StringUtils.getUUID());
|
|
|
+ d_dto_0.setRwbsm(rwbsm);
|
|
|
+ d_dto_0.setMx_bsm("三调数据");
|
|
|
+ d_dto_0.setYz_bsm("三调数据");
|
|
|
+ d_dto_0.setGroupvalue((map1.get("dlmc")).toString());
|
|
|
+ d_dto_0.setSumvalue(((Double) map1.get("siweiarea")).toString());
|
|
|
+ d_dto_0.setGeomvalue((String) map1.get("geom"));
|
|
|
+ gdbhRwJgMapper.insertGdbhRwJgGeom(d_dto_0);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|