|
@@ -1,5 +1,6 @@
|
|
package com.onemap.apply.service.gdbh.impl;
|
|
package com.onemap.apply.service.gdbh.impl;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.onemap.apply.domain.config.fzss.FxrwrzDTO;
|
|
import com.onemap.apply.domain.config.fzss.FxrwrzDTO;
|
|
@@ -9,9 +10,12 @@ import com.onemap.apply.mapper.gdbh.GdbhMapper;
|
|
import com.onemap.apply.mapper.gdbh.GdbhRwJgMapper;
|
|
import com.onemap.apply.mapper.gdbh.GdbhRwJgMapper;
|
|
import com.onemap.apply.mapper.gdbh.GdbhYzMapper;
|
|
import com.onemap.apply.mapper.gdbh.GdbhYzMapper;
|
|
import com.onemap.apply.service.analyse.HttpAnalyseService;
|
|
import com.onemap.apply.service.analyse.HttpAnalyseService;
|
|
|
|
+import com.onemap.apply.service.gdbh.ITGdbhJctbService;
|
|
|
|
+import com.onemap.apply.service.gdbh.ITGdbhRwGeomService;
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
import com.onemap.system.api.AnalyseService;
|
|
import com.onemap.system.api.AnalyseService;
|
|
|
|
+import com.onemap.system.api.RemoteFileService;
|
|
import com.onemap.system.api.domain.IntersectionTableWktVo;
|
|
import com.onemap.system.api.domain.IntersectionTableWktVo;
|
|
import com.onemap.system.api.domain.TablesAIdsVo;
|
|
import com.onemap.system.api.domain.TablesAIdsVo;
|
|
import com.onemap.system.api.domain.TargetTableVo;
|
|
import com.onemap.system.api.domain.TargetTableVo;
|
|
@@ -37,10 +41,17 @@ public class GdbhHandleService {
|
|
private AnalyseService analyseService;
|
|
private AnalyseService analyseService;
|
|
@Resource
|
|
@Resource
|
|
private FxrwrzMapper fxrwrzMapper;
|
|
private FxrwrzMapper fxrwrzMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private RemoteFileService fileService;
|
|
|
|
+ @Resource
|
|
|
|
+ private ITGdbhRwGeomService iTGdbhRwGeomService;
|
|
|
|
+ @Resource
|
|
|
|
+ private ITGdbhJctbService itGdbhJctbService;
|
|
|
|
|
|
void gdbhAnalysisHandle(GdbhDto gdbhDto) {
|
|
void gdbhAnalysisHandle(GdbhDto gdbhDto) {
|
|
//获取范围
|
|
//获取范围
|
|
String d_RawTableName = gdbhDto.getXzfwTbaleName();
|
|
String d_RawTableName = gdbhDto.getXzfwTbaleName();
|
|
|
|
+ List<String> d_RawTableAids = Arrays.asList(gdbhDto.getXzfwIds().split(","));
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析开始。。。", "info");
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析开始。。。", "info");
|
|
updateGdbg(gdbhDto.getBsm(), 1, new Date(), null, null);
|
|
updateGdbg(gdbhDto.getBsm(), 1, new Date(), null, null);
|
|
//获取因子
|
|
//获取因子
|
|
@@ -53,8 +64,6 @@ public class GdbhHandleService {
|
|
yzDataMap.put(yz.getId(), yz);
|
|
yzDataMap.put(yz.getId(), yz);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
//计算
|
|
//计算
|
|
List<GdbhRwMxDto> mxlist = gdbhDto.getMxlist();
|
|
List<GdbhRwMxDto> mxlist = gdbhDto.getMxlist();
|
|
if (mxlist == null || mxlist.size() == 0) {
|
|
if (mxlist == null || mxlist.size() == 0) {
|
|
@@ -86,6 +95,7 @@ public class GdbhHandleService {
|
|
|
|
|
|
TablesAIdsVo tablesAIdsVo = new TablesAIdsVo();
|
|
TablesAIdsVo tablesAIdsVo = new TablesAIdsVo();
|
|
tablesAIdsVo.setTableNameA(d_RawTableName);
|
|
tablesAIdsVo.setTableNameA(d_RawTableName);
|
|
|
|
+ tablesAIdsVo.setTableIdsA(d_RawTableAids);
|
|
tablesAIdsVo.setTableNameB(d_analysis_table);
|
|
tablesAIdsVo.setTableNameB(d_analysis_table);
|
|
String tableName = httpAnalyseService.intersectionTables(tablesAIdsVo);
|
|
String tableName = httpAnalyseService.intersectionTables(tablesAIdsVo);
|
|
|
|
|
|
@@ -98,6 +108,7 @@ public class GdbhHandleService {
|
|
targetTableVo.setSiweiArea(true);
|
|
targetTableVo.setSiweiArea(true);
|
|
targetTableVo.setTargetTableName(tableName);
|
|
targetTableVo.setTargetTableName(tableName);
|
|
targetTableVo.setRawTableName(d_RawTableName);
|
|
targetTableVo.setRawTableName(d_RawTableName);
|
|
|
|
+ targetTableVo.setIds(d_RawTableAids);
|
|
targetTableVo.setColumns(columns);
|
|
targetTableVo.setColumns(columns);
|
|
List<Map> map = httpAnalyseService.targetTable(targetTableVo);
|
|
List<Map> map = httpAnalyseService.targetTable(targetTableVo);
|
|
|
|
|
|
@@ -116,26 +127,26 @@ public class GdbhHandleService {
|
|
}
|
|
}
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护" + mx.getBsmmc() + "分析结束。。。", "info");
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护" + mx.getBsmmc() + "分析结束。。。", "info");
|
|
}
|
|
}
|
|
- insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成开始。。。", "info");
|
|
|
|
- RequestResult res_1 = gdbhJgService.gdbhAnalysisHandle(gdbhDto.getBsm());
|
|
|
|
- if (res_1.isError()) {
|
|
|
|
- insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成失败。。。", "error");
|
|
|
|
- updateGdbg(gdbhDto.getBsm(), 3, null, new Date(), null);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- Map jdMap_0 = (Map) res_1.get(RequestResult.DATA_TAG);
|
|
|
|
- RequestResult res_2 = analyseService.gdbhGenerateDocx(jdMap_0);
|
|
|
|
- if (res_2.isError()) {
|
|
|
|
- insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成失败。。。", "error");
|
|
|
|
- updateGdbg(gdbhDto.getBsm(), 3, null, new Date(), null);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- String path_0 = (String) res_2.get(RequestResult.DATA_TAG);
|
|
|
|
- System.out.println("path_0:"+path_0);
|
|
|
|
|
|
+// insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成开始。。。", "info");
|
|
|
|
+// RequestResult res_1 = gdbhJgService.gdbhAnalysisHandle(gdbhDto.getBsm());
|
|
|
|
+// if (res_1.isError()) {
|
|
|
|
+// insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成失败。。。", "error");
|
|
|
|
+// updateGdbg(gdbhDto.getBsm(), 3, null, new Date(), null);
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// Map jdMap_0 = (Map) res_1.get(RequestResult.DATA_TAG);
|
|
|
|
+// RequestResult res_2 = analyseService.gdbhGenerateDocx(jdMap_0);
|
|
|
|
+// if (res_2.isError()) {
|
|
|
|
+// insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成失败。。。", "error");
|
|
|
|
+// updateGdbg(gdbhDto.getBsm(), 3, null, new Date(), null);
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// String path_0 = (String) res_2.get(RequestResult.DATA_TAG);
|
|
|
|
+// System.out.println("path_0:"+path_0);
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成结束。。。", "info");
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析报告生成结束。。。", "info");
|
|
|
|
|
|
- updateGdbg(gdbhDto.getBsm(), 2, null, new Date(), path_0);
|
|
|
|
-// updateGdbg(gdbhDto.getBsm(), 2, null, new Date(), null);
|
|
|
|
|
|
+// updateGdbg(gdbhDto.getBsm(), 2, null, new Date(), path_0);
|
|
|
|
+ updateGdbg(gdbhDto.getBsm(), 2, null, new Date(), null);
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析结束。。。", "info");
|
|
insertFxrwrz(StringUtils.getUUID(), gdbhDto.getBsm(), gdbhDto.getXmmc(), "耕地保护分析结束。。。", "info");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -198,4 +209,72 @@ public class GdbhHandleService {
|
|
wrapper.eq("bsm", bsm);
|
|
wrapper.eq("bsm", bsm);
|
|
gdbhMapper.update(gdbhDto, wrapper);
|
|
gdbhMapper.update(gdbhDto, wrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public GdbhDto AddGdbhYpGeom(String xzfw, Integer yptype, GdbhDto gdbhDto) {
|
|
|
|
+ if (yptype != null && yptype == 2) {
|
|
|
|
+ //2 为图斑数据,从图像表中获取
|
|
|
|
+ String[] ids = xzfw.split(",");
|
|
|
|
+ int i0 = 0;
|
|
|
|
+ for (String id : ids) {
|
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
|
+ TGdbhJctb dto0 = itGdbhJctbService.selectTGdbhJctbById(id);
|
|
|
|
+ if (dto0 != null) {
|
|
|
|
+ String jsonString = JSON.toJSONString(dto0);
|
|
|
|
+ TGdbhRwGeom tGdbhRwGeom = new TGdbhRwGeom();
|
|
|
|
+ tGdbhRwGeom.setGeom(dto0.getGeom());
|
|
|
|
+ tGdbhRwGeom.setGeomarea(dto0.getJcmj());
|
|
|
|
+ tGdbhRwGeom.setGeomJson(jsonString);
|
|
|
|
+ tGdbhRwGeom.setSort(i0);
|
|
|
|
+ tGdbhRwGeom.setId(StringUtils.getUUID());
|
|
|
|
+ tGdbhRwGeom.setRwbsm(gdbhDto.getBsm());
|
|
|
|
+ iTGdbhRwGeomService.insertTGdbhRwGeom(tGdbhRwGeom);
|
|
|
|
+ i0++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (i0 == 0) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> retd0 = iTGdbhRwGeomService.sumTGdbhRwGeomByRwbsm(gdbhDto.getBsm());
|
|
|
|
+ Double area = Double.valueOf(retd0.get("geomarea").toString());
|
|
|
|
+ String ewkt = (String) retd0.get("geom");
|
|
|
|
+ Long number = (Long) retd0.get("geomnumber");
|
|
|
|
+ String d0_ids = (String) retd0.get("ids");
|
|
|
|
+ gdbhDto.setGeom(ewkt);
|
|
|
|
+ gdbhDto.setSumNumber(number.intValue());
|
|
|
|
+ gdbhDto.setXzfwTbaleId("tableId");
|
|
|
|
+ gdbhDto.setXzmj(area);
|
|
|
|
+ gdbhDto.setXzfwIds(d0_ids);
|
|
|
|
+ } else {
|
|
|
|
+ RequestResult resultGeom = fileService.uploadGeomV1Query(xzfw, 1);
|
|
|
|
+ if (resultGeom.isError()) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ String jsonString = JSON.toJSONString(resultGeom.get(RequestResult.DATA_TAG));
|
|
|
|
+ if (StringUtils.isEmpty(jsonString) || "null".equals(jsonString)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ TUploadGeomDTO tUploadGeomDTO = JSON.parseObject(jsonString, TUploadGeomDTO.class);
|
|
|
|
+ List<TUploadGeomDetailsDTO> tUploadGeomDetailsDTOList = tUploadGeomDTO.gettUploadGeomDetailsDTOList();
|
|
|
|
+ StringBuilder xzfwIds = new StringBuilder();
|
|
|
|
+ for (TUploadGeomDetailsDTO tUploadGeomDetailsDTO : tUploadGeomDetailsDTOList) {
|
|
|
|
+ TGdbhRwGeom tGdbhRwGeom = new TGdbhRwGeom();
|
|
|
|
+ tGdbhRwGeom.setGeom(tUploadGeomDetailsDTO.getGeom());
|
|
|
|
+ tGdbhRwGeom.setGeomarea(tUploadGeomDetailsDTO.getGeomarea());
|
|
|
|
+ tGdbhRwGeom.setGeomJson(tUploadGeomDetailsDTO.getGeomJson());
|
|
|
|
+ tGdbhRwGeom.setSort(tUploadGeomDetailsDTO.getSort());
|
|
|
|
+ tGdbhRwGeom.setId(tUploadGeomDetailsDTO.getId());
|
|
|
|
+ tGdbhRwGeom.setRwbsm(gdbhDto.getBsm());
|
|
|
|
+ iTGdbhRwGeomService.insertTGdbhRwGeom(tGdbhRwGeom);
|
|
|
|
+ xzfwIds.append(tUploadGeomDetailsDTO.getId()).append(",");
|
|
|
|
+ }
|
|
|
|
+ gdbhDto.setGeom(tUploadGeomDTO.getGeom());
|
|
|
|
+ gdbhDto.setSumNumber(tUploadGeomDTO.getSpotsnumber());
|
|
|
|
+ gdbhDto.setXzmj(tUploadGeomDTO.getSpotsarea());
|
|
|
|
+ gdbhDto.setXzfwIds(xzfwIds.toString());
|
|
|
|
+ }
|
|
|
|
+ gdbhDto.setXzfwTbaleName("t_gdbh_rw_geom");
|
|
|
|
+ return gdbhDto;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|