|
@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.onemap.apply.domain.gdbh.*;
|
|
|
import com.onemap.apply.mapper.gdbh.*;
|
|
|
import com.onemap.apply.service.analyse.HttpAnalyseService;
|
|
|
+import com.onemap.common.core.utils.NumberUtil;
|
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
|
import com.onemap.system.api.domain.IntersectionTableWktVo;
|
|
|
import com.onemap.system.api.domain.IntersectsTableWktVo;
|
|
|
+import com.onemap.system.api.domain.RawTableVo;
|
|
|
import com.onemap.system.api.domain.TargetTableVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -32,7 +34,7 @@ public class GdbhJgService {
|
|
|
@Autowired
|
|
|
private GdbhRwMxYzMapper gdbhRwMxYzMapper;
|
|
|
|
|
|
- RequestResult gdbhAnalysisHandle(String rwBsm) {
|
|
|
+ public RequestResult gdbhAnalysisHandle(String rwBsm) {
|
|
|
QueryWrapper<GdbhDto> wrapper0_1 = new QueryWrapper<>();
|
|
|
wrapper0_1.eq("bsm", rwBsm);
|
|
|
GdbhDto gdbhDto = gdbhMapper.selectOne(wrapper0_1);
|
|
@@ -100,6 +102,7 @@ public class GdbhJgService {
|
|
|
if (StringUtils.isEmpty(bsmmc)) {
|
|
|
bsmmc = yiRus.getName();
|
|
|
}
|
|
|
+ retMapData0.put("bsm", v_yz_0);
|
|
|
retMapData0.put("bsmmc", bsmmc);
|
|
|
mxret.add(retMapData0);
|
|
|
}
|
|
@@ -115,4 +118,165 @@ public class GdbhJgService {
|
|
|
retMap.put("sandiao", d_retMapData1);
|
|
|
return RequestResult.success(retMap);
|
|
|
}
|
|
|
+
|
|
|
+ RequestResult QueryGdbhJgYz(String bsm, String mxbsm, String yzbsm) {
|
|
|
+ if (StringUtils.isEmpty(bsm)) {
|
|
|
+ return RequestResult.error("bsm参数为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(mxbsm)) {
|
|
|
+ return RequestResult.error("mxbsm参数为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(yzbsm)) {
|
|
|
+ return RequestResult.error("yzbsm参数为空");
|
|
|
+ }
|
|
|
+ String d_RawTableName = "TB_GPL0";
|
|
|
+ List<Map<String, Object>> d_sandiao = gdbhRwJgMapper.selectGdbhRwJgGroup(bsm, mxbsm, yzbsm);
|
|
|
+ List<String> ids = new ArrayList<>();
|
|
|
+ for (Map<String, Object> mx : d_sandiao) {
|
|
|
+ String idvalue = (String) mx.get("groupvalue");
|
|
|
+ ids.add(idvalue);
|
|
|
+ }
|
|
|
+ if (ids == null || ids.size() == 0) {
|
|
|
+ return RequestResult.error("查询结果为空");
|
|
|
+ }
|
|
|
+ List<String> columns = new ArrayList<>(); // 列名
|
|
|
+ columns.add("id");
|
|
|
+ RawTableVo d0_vo = new RawTableVo();
|
|
|
+ d0_vo.setIds(ids);
|
|
|
+ d0_vo.setSrid(4525);
|
|
|
+ d0_vo.setRawTableName(d_RawTableName);
|
|
|
+ d0_vo.setSiweiArea(true);
|
|
|
+ d0_vo.setIsGeography(false);
|
|
|
+ d0_vo.setColumns(columns);
|
|
|
+ Object objectData = httpAnalyseService.getHttpAnalyse(d0_vo);
|
|
|
+ if (objectData != null) {
|
|
|
+ List<Map> objectDataList = (List<Map>) objectData;
|
|
|
+ for (Map d_map_01 : objectDataList) {
|
|
|
+ d_map_01.put("siweiarea", NumberUtil.double2TwoDecimal(Double.parseDouble(d_map_01.get("siweiarea").toString())));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return RequestResult.success(objectData);
|
|
|
+ }
|
|
|
+
|
|
|
+ public RequestResult QueryGdbhJgId(String rwBsm, String id) {
|
|
|
+ if (StringUtils.isEmpty(rwBsm)) {
|
|
|
+ return RequestResult.error("bsm参数为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ return RequestResult.error("id参数为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ QueryWrapper<GdbhDto> wrapper0_1 = new QueryWrapper<>();
|
|
|
+ wrapper0_1.eq("bsm", rwBsm);
|
|
|
+ GdbhDto gdbhDto = gdbhMapper.selectOne(wrapper0_1);
|
|
|
+ if (StringUtils.isNull(gdbhDto)) {
|
|
|
+ return RequestResult.error("未查询到数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ gdbhDto.setSumMj(255D);
|
|
|
+ gdbhDto.setSumNumber(255);
|
|
|
+
|
|
|
+ //获取范围
|
|
|
+ Map xzfw = gdbhMapper.selectGdbhXzfw(gdbhDto.getXzfw());
|
|
|
+ if (StringUtils.isEmpty(xzfw)) {
|
|
|
+ return RequestResult.error("选址范围参数为空");
|
|
|
+ }
|
|
|
+ Double area = Double.valueOf(xzfw.get("area").toString());
|
|
|
+ String ewkt = (String) xzfw.get("geom");
|
|
|
+ if (StringUtils.isEmpty(ewkt)) {
|
|
|
+ return RequestResult.error("选址范围参数为空");
|
|
|
+ }
|
|
|
+ gdbhDto.setGeom(ewkt);
|
|
|
+ gdbhDto.setXzmj(area);
|
|
|
+
|
|
|
+ //计算1 模型
|
|
|
+ QueryWrapper<GdbhRwMxDto> wrapper0_2 = new QueryWrapper<>();
|
|
|
+ wrapper0_2.eq("rwbsm", rwBsm);
|
|
|
+ List<GdbhRwMxDto> mxlist = gdbhRwMxMapper.selectList(wrapper0_2);
|
|
|
+ //计算
|
|
|
+ if (mxlist == null || mxlist.size() == 0) {
|
|
|
+ return RequestResult.error("模型参数为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ //三调
|
|
|
+ List<Map<String, Object>> ret = new ArrayList<>();
|
|
|
+ for (GdbhRwMxDto mx : mxlist) {
|
|
|
+ Map<String, Object> mxMap = new HashMap<>();
|
|
|
+ List<Map<String, Object>> mxret = new ArrayList<>();
|
|
|
+
|
|
|
+ //计算1 模型
|
|
|
+ QueryWrapper<GdbhRwMxYzDto> wrapper0_3 = new QueryWrapper<>();
|
|
|
+ wrapper0_3.eq("rwbsm", rwBsm);
|
|
|
+ wrapper0_3.eq("mx_bsm", mx.getBsm());
|
|
|
+ List<GdbhRwMxYzDto> yiList = gdbhRwMxYzMapper.selectList(wrapper0_3);
|
|
|
+ if (yiList == null || yiList.size() == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (GdbhRwMxYzDto yi : yiList) {
|
|
|
+ String v_yz_0 = yi.getBsm();
|
|
|
+ if (StringUtils.isEmpty(v_yz_0)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //计算1 模型
|
|
|
+ QueryWrapper<GdbhYzDTO> wrapper0_4 = new QueryWrapper<>();
|
|
|
+ wrapper0_4.eq("id", yi.getBsm());
|
|
|
+ GdbhYzDTO yiRus = gdbhYzMapper.selectOne(wrapper0_4);
|
|
|
+
|
|
|
+ Map<String, Object> retMapData0 = gdbhRwJgMapper.selectGdbhRwJgMapById(gdbhDto.getBsm(), mx.getBsm(), v_yz_0, id);
|
|
|
+ String bsmmc = yiRus.getRetbsmmc();
|
|
|
+ if (StringUtils.isEmpty(bsmmc)) {
|
|
|
+ bsmmc = yiRus.getName();
|
|
|
+ }
|
|
|
+ retMapData0.put("bsm", v_yz_0);
|
|
|
+ retMapData0.put("bsmmc", bsmmc);
|
|
|
+ mxret.add(retMapData0);
|
|
|
+ }
|
|
|
+ mxMap.put("mx_bsm", mx.getBsm());
|
|
|
+ mxMap.put("mx_bsmmc", mx.getBsmmc());
|
|
|
+ mxMap.put("mx_data", mxret);
|
|
|
+ ret.add(mxMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ String d_RawTableName = "TB_GPL0";
|
|
|
+ List<String> ids = new ArrayList<>();
|
|
|
+ ids.add(id);
|
|
|
+
|
|
|
+ List<String> columns = new ArrayList<>(); // 列名
|
|
|
+ columns.add("tbbh");
|
|
|
+ columns.add("nfqsmc");
|
|
|
+ columns.add("xfrq");
|
|
|
+ columns.add("mj");
|
|
|
+ columns.add("zygdmj");
|
|
|
+ columns.add("zyjbntmj");
|
|
|
+ columns.add("qsx");
|
|
|
+ columns.add("hsx");
|
|
|
+ columns.add("qqyxmc");
|
|
|
+ columns.add("dqyxmc");
|
|
|
+ columns.add("tbfl");
|
|
|
+ columns.add("bz");
|
|
|
+ columns.add("sfhcmc");
|
|
|
+ columns.add("sfdcmc");
|
|
|
+
|
|
|
+ RawTableVo d0_vo = new RawTableVo();
|
|
|
+ d0_vo.setIds(ids);
|
|
|
+ d0_vo.setSrid(4525);
|
|
|
+ d0_vo.setRawTableName(d_RawTableName);
|
|
|
+ d0_vo.setSiweiArea(true);
|
|
|
+ d0_vo.setIsGeography(false);
|
|
|
+ d0_vo.setColumns(columns);
|
|
|
+ Object objectData = httpAnalyseService.getHttpAnalyse(d0_vo);
|
|
|
+ Map<String, Object> retMap = new HashMap<>();
|
|
|
+ retMap.put("yzjg", ret);
|
|
|
+ if (objectData != null) {
|
|
|
+ List<Map> objectDataList = (List<Map>) objectData;
|
|
|
+ for (Map d_map_01 : objectDataList) {
|
|
|
+ d_map_01.put("siweiarea", NumberUtil.double2TwoDecimal(Double.parseDouble(d_map_01.get("siweiarea").toString())));
|
|
|
+ }
|
|
|
+ if (objectDataList != null && objectDataList.size() > 0) {
|
|
|
+ retMap.put("tbxx", objectDataList.get(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return RequestResult.success(retMap);
|
|
|
+ }
|
|
|
}
|