|
@@ -2,15 +2,14 @@ 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.GetTableDateController;
|
|
|
import com.onemap.analyse.domain.*;
|
|
|
import com.onemap.analyse.domain.calculation.FzxzCalc;
|
|
|
import com.onemap.analyse.domain.res.FzxzResultDTO;
|
|
|
import com.onemap.analyse.domain.res.GeomRes;
|
|
|
import com.onemap.analyse.domain.vo.RawTableVo;
|
|
|
-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.domain.vo.TableWktVo;
|
|
|
import com.onemap.analyse.mapper.*;
|
|
|
import com.onemap.analyse.mapper.base.FzxzResMapper;
|
|
|
import com.onemap.analyse.mapper.base.ShpFileMapper;
|
|
@@ -23,7 +22,6 @@ import com.onemap.common.core.utils.StringUtils;
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
|
import com.onemap.common.datasource.annotation.Master;
|
|
|
import com.onemap.common.security.utils.SecurityUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -72,8 +70,6 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
private ILogService iLogService;
|
|
|
|
|
|
// **需要拿出来的逻辑**//
|
|
|
- // @Resource
|
|
|
- // AnalyseUtilsDBController analyseUtilsDBController;
|
|
|
@Resource
|
|
|
private CreateUtilsDBService createUtilsDBService;
|
|
|
@Resource
|
|
@@ -162,7 +158,7 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
*/
|
|
|
private void updateFzxzStatus(String bsm, Integer rwzt) {
|
|
|
UpdateWrapper<FzxzDTO> wrapper = new UpdateWrapper<>();
|
|
|
- wrapper.eq("bsm", bsm).set("rwzt", Rwzt.getRun());
|
|
|
+ wrapper.eq("bsm", bsm).set("rwzt", rwzt);
|
|
|
fzxzMapper.update(null, wrapper);
|
|
|
}
|
|
|
|
|
@@ -242,36 +238,40 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
// iLogService.saveLog(taskId, "辅助选址", "地块面积分析完成", "info");
|
|
|
|
|
|
// 3.用地类型(性质)筛选
|
|
|
- tableDateService.delByLandType(temporaryTable, fzxzDTO.getSjy(), fzxzDTO.getYdxz_bsm());
|
|
|
- integer = tableDateService.getTableCount(temporaryTable);
|
|
|
- if (integer == 0) {
|
|
|
- iLogService.saveLog(taskId, "辅助选址", "计算完成,未找到符合用地性质条件数据", "info");
|
|
|
- updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
|
- return RequestResult.error("区域筛选条件筛选未找到符合条件数据!", null);
|
|
|
+ if (fzxzDTO.getUseLandType()) {
|
|
|
+ // 与用地性质保持一致,删除不符合用地性质的数据
|
|
|
+ tableDateService.delByLandType(temporaryTable, fzxzDTO.getSjy(), fzxzDTO.getYdxz_bsm());
|
|
|
+ integer = tableDateService.getTableCount(temporaryTable);
|
|
|
+ if (integer == 0) {
|
|
|
+ iLogService.saveLog(taskId, "辅助选址", "计算完成,未找到符合用地性质条件数据", "info");
|
|
|
+ updateFzxzStatus(taskId, Rwzt.getNoJX());
|
|
|
+ return RequestResult.error("区域筛选条件筛选未找到符合条件数据!", null);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 4.根据因子切割地块
|
|
|
String rawTable = factorClip(taskId, temporaryTable, fzxzCalc.getFactorUseList(), ewkt);
|
|
|
if (rawTable.equals("")) return RequestResult.error("区域筛选条件筛选未找到符合条件数据!", null);
|
|
|
+ // 5.切割地块,面积筛选
|
|
|
+
|
|
|
|
|
|
- // 5.保存规划结果
|
|
|
+ // 6.保存规划结果
|
|
|
Map<String, Object> scheduleResMap = new HashMap<>();
|
|
|
scheduleResMap.put("rawTableName", rawTable);
|
|
|
scheduleResMap.put("rwbsm", fzxzDTO.getBsm());
|
|
|
scheduleResMap.put("sjyb", fzxzDTO.getSjy());
|
|
|
- // TODO 用地性质待定
|
|
|
scheduleResMap.put("ydxz", fzxzDTO.getYdxz_bsm());
|
|
|
saveScheduleRes(scheduleResMap);
|
|
|
|
|
|
// 保存成功日志
|
|
|
iLogService.saveLog(fzxzDTO.getBsm(), "辅助选址", "计算完成", "info");
|
|
|
|
|
|
- // 6.生成报告,生成world文件
|
|
|
+ // 7.生成报告,生成world文件
|
|
|
FzxzReport fzxzReport = iReportService.createReport(fzxzDTO.getBsm(), null);
|
|
|
- updateFzxzReport(fzxzDTO.getBsm(), fzxzReport.getReportfile());
|
|
|
+ updateFzxzReport(taskId, fzxzReport.getReportfile());
|
|
|
|
|
|
- // 7.开始规划,更新任务状态
|
|
|
- updateFzxzStatus(fzxzDTO.getBsm(), Rwzt.getComplete());
|
|
|
+ // 8.开始规划,更新任务状态
|
|
|
+ updateFzxzStatus(taskId, Rwzt.getComplete());
|
|
|
Map<String, Object> resMap = new HashMap<>();
|
|
|
resMap.put("rwbsm", fzxzDTO.getBsm());
|
|
|
resMap.put("finalTable", rawTable);
|
|
@@ -279,7 +279,7 @@ public class FzssServiceImpl implements IFzssService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 花落去因子的大地块
|
|
|
+ * 获取因子的地块
|
|
|
*/
|
|
|
private String getFactorEwkt(String tableName, String ewkt, float factorRadius, float ewktRadius) {
|
|
|
// 0.生成范围的缓冲区
|