QGIS地震专题图修改配置文件
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package com.gis.xian.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author zzw
|
||||
* @description: QGIS制图服务配置属性
|
||||
* @date 2026/6/3
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "qgis")
|
||||
public class QgisProperties {
|
||||
|
||||
/**
|
||||
* QGIS服务URL
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* QGIS基础路径
|
||||
*/
|
||||
private String basePath;
|
||||
|
||||
/**
|
||||
* 地震专题图模板路径
|
||||
*/
|
||||
private String eqMapsTemplatePath;
|
||||
|
||||
/**
|
||||
* 暴雨专题图模板路径
|
||||
*/
|
||||
private String rainMapsTemplatePath;
|
||||
|
||||
/**
|
||||
* 影响场GeoJSON保存路径
|
||||
*/
|
||||
private String intensityGeojsonPath;
|
||||
|
||||
/**
|
||||
* 地震专题图输出路径
|
||||
*/
|
||||
private String eqMapsOutputPath;
|
||||
|
||||
/**
|
||||
* 暴雨专题图输出路径
|
||||
*/
|
||||
private String rainMapsOutputPath;
|
||||
|
||||
|
||||
}
|
||||
@@ -13,16 +13,10 @@ public class BaseConstants {
|
||||
|
||||
|
||||
// url
|
||||
public static final String EQ_MAPS_TEMPLATE_PATH = "D:/home/dzxx/maps/eq/"; // 地震专题图模板路径
|
||||
public static final String RAIN_MAPS_TEMPLATE_PATH = "D:/home/dzxx/maps/rain/"; // 暴雨专题图模板路径
|
||||
public static final String INTENSITY_GEOJSON_PATH = "D:/home/dzxx/output/influence/"; // 影响场保存路径
|
||||
public static final String EQ_MAPS_OUTPUT_PATH = "D:/home/dzxx/output/eq/map/"; // 地震专题图文件输出路径
|
||||
public static final String RAIN_MAPS_OUTPUT_PATH = "D:/home/dzxx/output/rain/map/"; // 暴雨专题图文件输出路径
|
||||
public static final String EQ_DOCUMENT_OUTPUT_PATH = "D:/home/dzxx/output/eq/地震应急预评估报告.docx"; // 地震评估报告文件输出路径
|
||||
public static final String RAIN_DOCUMENT_OUTPUT_PATH = "D:/home/dzxx/output/rain/暴雨应急预评估报告.docx"; // 暴雨评估报告文件输出路径
|
||||
public static final String RAIN_MAPS_TEMPLATE_PATH = "F:/files/xian/dzxx/maps/rain/"; // 暴雨专题图模板路径
|
||||
public static final String RAIN_MAPS_OUTPUT_PATH = "F:/files/xian/dzxx/output/rain/map/"; // 暴雨专题图文件输出路径
|
||||
public static final String RAIN_DOCUMENT_OUTPUT_PATH = "F:/files/xian/dzxx/output/rain/暴雨应急预评估报告.docx"; // 暴雨评估报告文件输出路径
|
||||
|
||||
// ip
|
||||
public static final String HTTP_QGIS_THEMATIC = "http://localhost:18998/qgis/make/map"; // 专题图
|
||||
|
||||
// 提示语
|
||||
public static final String PARAMS_ERROR = "参数有误,请重新传入!";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.gis.xian.core.rabbitmq;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.gis.xian.bo.DlqMessage;
|
||||
import com.gis.xian.config.QgisProperties;
|
||||
import com.gis.xian.domain.DlqMessage;
|
||||
import com.gis.xian.constant.BaseConstants;
|
||||
import com.gis.xian.enums.BaseEnums;
|
||||
import com.gis.xian.params.QgisArgs;
|
||||
@@ -29,8 +30,10 @@ public class DlqConsumer {
|
||||
private HttpRestClient restclient;
|
||||
@Resource
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IDZEqQueueService idzEqQueueService;
|
||||
@Resource
|
||||
private QgisProperties qgisProperties;
|
||||
|
||||
// 最大重试次数
|
||||
private int maxRetry = 3;
|
||||
@@ -56,7 +59,7 @@ public class DlqConsumer {
|
||||
// 重试处理逻辑(复用原invoke的核心逻辑)
|
||||
ParameterizedTypeReference<String> res = new ParameterizedTypeReference<String>() {
|
||||
};
|
||||
String mapName = restclient.post(BaseConstants.HTTP_QGIS_THEMATIC, JSON.toJSON(arg), res);
|
||||
String mapName = restclient.post(qgisProperties.getUrl(), JSON.toJSON(arg), res);
|
||||
|
||||
if (mapName == null || mapName.equals("")) {
|
||||
throw new Exception("重试后产出图件仍失败");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.gis.xian.core.rabbitmq;
|
||||
|
||||
import com.gis.xian.bo.DlqMessage;
|
||||
import com.gis.xian.domain.DlqMessage;
|
||||
import com.gis.xian.constant.BaseConstants;
|
||||
import com.gis.xian.params.QgisArgs;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.gis.xian.bo;
|
||||
package com.gis.xian.domain;
|
||||
|
||||
import com.gis.xian.params.QgisArgs;
|
||||
import lombok.Builder;
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.gis.xian.handler;
|
||||
|
||||
import com.gis.xian.config.QgisProperties;
|
||||
import com.gis.xian.constant.BaseConstants;
|
||||
import com.gis.xian.enums.EqMapsEnums;
|
||||
import com.gis.xian.enums.RainMapsEnums;
|
||||
import com.gis.xian.utils.BaseUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -13,8 +16,11 @@ import java.time.format.DateTimeFormatter;
|
||||
* @description: 地震烈度核心服务
|
||||
* @date 2026/5/26 上午10:47
|
||||
*/
|
||||
@Component
|
||||
public class EarthquakeHandler {
|
||||
|
||||
@Resource
|
||||
private QgisProperties qgisProperties;
|
||||
|
||||
/**
|
||||
* 获取不同烈度下的面积
|
||||
@@ -23,7 +29,7 @@ public class EarthquakeHandler {
|
||||
* @param b 短轴
|
||||
* @return 返回椭圆的面积
|
||||
*/
|
||||
public static double calculateArea(double a, double b) {
|
||||
public double calculateArea(double a, double b) {
|
||||
return Math.PI * a * b;
|
||||
}
|
||||
|
||||
@@ -35,7 +41,7 @@ public class EarthquakeHandler {
|
||||
* @description: 计算椭圆的长轴
|
||||
* @return: 返回长轴
|
||||
*/
|
||||
public static double calculateRa(double M, double Ia) {
|
||||
public double calculateRa(double M, double Ia) {
|
||||
return (Math.pow(10, (4.0293 + 1.3003 * M - Ia) / 3.6404) - 10) * 1000;
|
||||
}
|
||||
|
||||
@@ -47,25 +53,25 @@ public class EarthquakeHandler {
|
||||
* @description: 计算椭圆的短轴
|
||||
* @return: 返回短轴
|
||||
*/
|
||||
public static double calculateRb(double M, double Ib) {
|
||||
public double calculateRb(double M, double Ib) {
|
||||
return (Math.pow(10, (2.3816 + 1.3003 * M - Ib) / 2.8573) - 5) * 1000;
|
||||
}
|
||||
|
||||
|
||||
// 格式化地震三要素信息
|
||||
public static String parseInfo(LocalDateTime eqTime, double magnitude, String addr) {
|
||||
public String parseInfo(LocalDateTime eqTime, double magnitude, String addr) {
|
||||
String time = BaseUtils.formatTime(eqTime, true);
|
||||
return String.format("时间:%s\r\n震级:%s级\r\n位置:%s", time, magnitude, addr);
|
||||
}
|
||||
|
||||
// 格式化暴雨三要素信息
|
||||
public static String parseRInfo(LocalDateTime eqTime, String magnitude, String addr) {
|
||||
public String parseRInfo(LocalDateTime eqTime, String magnitude, String addr) {
|
||||
String time = BaseUtils.formatTime(eqTime, true);
|
||||
return String.format("时间:%s\r\n累计降雨量:%s毫米\r\n已持续:%s小时", time, magnitude, addr);
|
||||
}
|
||||
|
||||
// 拼接地震图件标题
|
||||
public static String combine(String eqName, String eqType, EqMapsEnums map) {
|
||||
public String combine(String eqName, String eqType, EqMapsEnums map) {
|
||||
// 地点 + 震级
|
||||
String name = eqName;
|
||||
// 图名称 + 地震类型
|
||||
@@ -74,7 +80,7 @@ public class EarthquakeHandler {
|
||||
}
|
||||
|
||||
// 拼接暴雨图件标题
|
||||
public static String combineR(String rainName, String rainType, RainMapsEnums map) {
|
||||
public String combineR(String rainName, String rainType, RainMapsEnums map) {
|
||||
// 地点 + 暴雨名称
|
||||
String name = rainName;
|
||||
// 图名称 + 暴雨类型
|
||||
@@ -83,28 +89,28 @@ public class EarthquakeHandler {
|
||||
}
|
||||
|
||||
// 拼接导出路径
|
||||
public static String getPath(String event, String queueId, String size, EqMapsEnums map) {
|
||||
public String getPath(String event, String queueId, String size, EqMapsEnums map) {
|
||||
// 地震事件 + 批次
|
||||
String batch = queueId.substring(event.length());
|
||||
String path = event + "/" + batch + "/" + size + "/" + map.getName();
|
||||
return String.format("%s", BaseConstants.EQ_MAPS_OUTPUT_PATH + path + ".jpg");
|
||||
return String.format("%s", qgisProperties.getBasePath() + qgisProperties.getEqMapsOutputPath() + path + ".jpg");
|
||||
}
|
||||
|
||||
// 拼接导出路径
|
||||
public static String getRPath(String rainId, String queueId, String size, RainMapsEnums map) {
|
||||
public String getRPath(String rainId, String queueId, String size, RainMapsEnums map) {
|
||||
// 地震事件 + 批次
|
||||
String batch = queueId.substring(rainId.length());
|
||||
String path = rainId + "/" + batch + "/" + size + "/" + map.getName();
|
||||
return String.format("%s", BaseConstants.RAIN_MAPS_OUTPUT_PATH + path + ".jpg");
|
||||
}
|
||||
|
||||
public static String format(LocalDateTime time) {
|
||||
public String format(LocalDateTime time) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM月dd日HH时mm分");
|
||||
String timestamp = time.format(formatter);
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public static String formatTime(LocalDateTime time) {
|
||||
public String formatTime(LocalDateTime time) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分");
|
||||
String timestamp = time.format(formatter);
|
||||
return timestamp;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.gis.xian.handler;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.gis.xian.config.QgisProperties;
|
||||
import com.gis.xian.constant.BaseConstants;
|
||||
import com.gis.xian.dto.dzxx.DZXXInfluenceDTO;
|
||||
import com.gis.xian.dto.pub.IntyGeoJsonDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.locationtech.jts.geom.CoordinateSequence;
|
||||
import org.locationtech.jts.geom.GeometryFactory;
|
||||
@@ -29,6 +31,9 @@ import java.util.List;
|
||||
@Component
|
||||
public class GeoFilesHandler {
|
||||
|
||||
@Resource
|
||||
private QgisProperties qgisProperties;
|
||||
|
||||
private static final GeometryFactory GEOMETRY_FACTORY = new GeometryFactory();
|
||||
private static final WKTReader WKT_READER = new WKTReader(GEOMETRY_FACTORY);
|
||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||
@@ -37,7 +42,7 @@ public class GeoFilesHandler {
|
||||
// 序列化
|
||||
String geoJsonStr = OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(featureCollection);
|
||||
// geojson文件路径
|
||||
String path = BaseConstants.INTENSITY_GEOJSON_PATH + fileName + ".geojson";
|
||||
String path = qgisProperties.getBasePath() + qgisProperties.getIntensityGeojsonPath() + fileName + ".geojson";
|
||||
// 创建文件目录
|
||||
File file = new File(path);
|
||||
File parentDir = file.getParentFile();
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.gis.xian.service.dzxx.IDZXXInfluenceService;
|
||||
import com.gis.xian.service.ex.ParmaException;
|
||||
import com.gis.xian.service.ex.ServiceException;
|
||||
import com.gis.xian.service.pub.IDZInfluenceService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.locationtech.jts.geom.Polygon;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -45,6 +46,8 @@ public class DZXXInfluenceServiceImpl extends ServiceImpl<DZXXInfluenceMapper, D
|
||||
private EllipseToWktHandler ellipseToWktHandler;
|
||||
@Autowired
|
||||
private IDZInfluenceService idzInfluenceService;
|
||||
@Resource
|
||||
private EarthquakeHandler earthquakeHandler;
|
||||
|
||||
// 处理地震影响场数据
|
||||
@Override
|
||||
@@ -60,11 +63,11 @@ public class DZXXInfluenceServiceImpl extends ServiceImpl<DZXXInfluenceMapper, D
|
||||
// 根据烈度值和震级生成影响场
|
||||
for (int intensity : intensities) {
|
||||
// 根据烈度和震级计算长轴
|
||||
double longUranium = EarthquakeHandler.calculateRa(assess.getEqMagnitude(), intensity);
|
||||
double longUranium = earthquakeHandler.calculateRa(assess.getEqMagnitude(), intensity);
|
||||
// 根据烈度和震级计算短轴
|
||||
double shortUranium = EarthquakeHandler.calculateRb(assess.getEqMagnitude(), intensity);
|
||||
double shortUranium = earthquakeHandler.calculateRb(assess.getEqMagnitude(), intensity);
|
||||
// 根据长短轴计算面积
|
||||
double area = EarthquakeHandler.calculateArea(longUranium, shortUranium);
|
||||
double area = earthquakeHandler.calculateArea(longUranium, shortUranium);
|
||||
|
||||
// 获取断层走向 角度
|
||||
ActiveFaultDTO shortlyFault = faultService.getShortlyFault(assess.getLongitude(), assess.getLatitude());
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gis.xian.config.DataSource;
|
||||
import com.gis.xian.config.QgisProperties;
|
||||
import com.gis.xian.constant.BaseConstants;
|
||||
import com.gis.xian.dto.dzxx.DZXXInfluenceDTO;
|
||||
import com.gis.xian.dto.pub.DZInfluenceDTO;
|
||||
@@ -15,6 +16,7 @@ import com.gis.xian.query.EqQuery;
|
||||
import com.gis.xian.service.ex.ParmaException;
|
||||
import com.gis.xian.service.ex.ServiceException;
|
||||
import com.gis.xian.service.pub.IDZInfluenceService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.locationtech.jts.geom.Polygon;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -36,8 +38,10 @@ import java.util.Map;
|
||||
@DataSource("slave1")
|
||||
public class DZInfluenceServiceImpl extends ServiceImpl<DZInfluenceMapper, DZInfluence> implements IDZInfluenceService {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private GeoFilesHandler handler;
|
||||
@Resource
|
||||
private QgisProperties qgisProperties;
|
||||
|
||||
|
||||
// 将影响场以文件形式保存
|
||||
@@ -76,7 +80,7 @@ public class DZInfluenceServiceImpl extends ServiceImpl<DZInfluenceMapper, DZInf
|
||||
handler.writeGeoJsonToFile(features, fineName);
|
||||
log.info("地震影响场GeoJson文件已生成成功!");
|
||||
|
||||
influence.setPath(BaseConstants.INTENSITY_GEOJSON_PATH + fineName + ".geojson");
|
||||
influence.setPath(qgisProperties.getBasePath() + qgisProperties.getIntensityGeojsonPath() + fineName + ".geojson");
|
||||
handleDzxxData(influence);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gis.xian.config.DataSource;
|
||||
import com.gis.xian.config.QgisProperties;
|
||||
import com.gis.xian.constant.BaseConstants;
|
||||
import com.gis.xian.dto.pub.DZProductDTO;
|
||||
import com.gis.xian.dto.pub.EqAssessmentDTO;
|
||||
@@ -20,6 +21,7 @@ import com.gis.xian.service.ex.ServeException;
|
||||
import com.gis.xian.service.pub.IDZProductService;
|
||||
import com.gis.xian.service.pub.IFeignService;
|
||||
import com.gis.xian.utils.BaseUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -45,12 +47,16 @@ public class DZProductServiceImpl extends ServiceImpl<DZProductMapper, DZProduct
|
||||
|
||||
private static final SecureRandom secureRandom = new SecureRandom();
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IFeignService iFeignService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IActiveFaultService iActiveFaultService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IDZXXInfluenceService idzxxInfluenceService;
|
||||
@Resource
|
||||
private QgisProperties qgisProperties;
|
||||
@Resource
|
||||
private EarthquakeHandler earthquakeHandler;
|
||||
|
||||
// qgis 地震制图服务
|
||||
@Override
|
||||
@@ -113,15 +119,15 @@ public class DZProductServiceImpl extends ServiceImpl<DZProductMapper, DZProduct
|
||||
arg.setQueueId(assess.getEqQueueId());
|
||||
arg.setCenterX(assess.getLongitude());
|
||||
arg.setCenterY(assess.getLatitude());
|
||||
arg.setInfo(EarthquakeHandler.parseInfo(assess.getEqTime(), assess.getEqMagnitude(), assess.getEqAddr()));
|
||||
arg.setMapTitle(EarthquakeHandler.combine(assess.getEqName(), assess.getEqType(), map));
|
||||
arg.setInfo(earthquakeHandler.parseInfo(assess.getEqTime(), assess.getEqMagnitude(), assess.getEqAddr()));
|
||||
arg.setMapTitle(earthquakeHandler.combine(assess.getEqName(), assess.getEqType(), map));
|
||||
arg.setMapTime(BaseUtils.formatTime(LocalDateTime.now(), false));
|
||||
arg.setMapLayout(BaseConstants.MAP_LAYOUT_A4); // A4
|
||||
arg.setMapUint(BaseConstants.MAP_UNIT); // 单位
|
||||
// 死信队列中获取单张图片
|
||||
arg.setName(map.getName());
|
||||
arg.setOutFile(EarthquakeHandler.getPath(assess.getEvent(), assess.getEqQueueId(), BaseConstants.MAP_LAYOUT_A4, map));
|
||||
arg.setPath(BaseConstants.EQ_MAPS_TEMPLATE_PATH + map.getName() + ".qgz");
|
||||
arg.setOutFile(earthquakeHandler.getPath(assess.getEvent(), assess.getEqQueueId(), BaseConstants.MAP_LAYOUT_A4, map));
|
||||
arg.setPath(qgisProperties.getEqMapsTemplatePath() + map.getName() + ".qgz");
|
||||
arg.setDisaster(BaseConstants.EQ_DISASTER_MAP); // 地震灾害
|
||||
|
||||
// 缩放规则
|
||||
@@ -141,15 +147,15 @@ public class DZProductServiceImpl extends ServiceImpl<DZProductMapper, DZProduct
|
||||
arg.setQueueId(assess.getEqQueueId());
|
||||
arg.setCenterX(assess.getLongitude());
|
||||
arg.setCenterY(assess.getLatitude());
|
||||
arg.setInfo(EarthquakeHandler.parseInfo(assess.getEqTime(), assess.getEqMagnitude(), assess.getEqAddr()));
|
||||
arg.setMapTitle(EarthquakeHandler.combine(assess.getEqName(), assess.getEqType(), map));
|
||||
arg.setInfo(earthquakeHandler.parseInfo(assess.getEqTime(), assess.getEqMagnitude(), assess.getEqAddr()));
|
||||
arg.setMapTitle(earthquakeHandler.combine(assess.getEqName(), assess.getEqType(), map));
|
||||
arg.setMapTime(BaseUtils.formatTime(LocalDateTime.now(), false));
|
||||
arg.setMapLayout(BaseConstants.MAP_LAYOUT_A3); // A3
|
||||
arg.setMapUint(BaseConstants.MAP_UNIT); // 单位
|
||||
// 死信队列中获取单张图片
|
||||
arg.setName(map.getName());
|
||||
arg.setOutFile(EarthquakeHandler.getPath(assess.getEvent(), assess.getEqQueueId(), BaseConstants.MAP_LAYOUT_A3, map));
|
||||
arg.setPath(BaseConstants.EQ_MAPS_TEMPLATE_PATH + map.getName() + ".qgz");
|
||||
arg.setOutFile(earthquakeHandler.getPath(assess.getEvent(), assess.getEqQueueId(), BaseConstants.MAP_LAYOUT_A3, map));
|
||||
arg.setPath(qgisProperties.getEqMapsTemplatePath() + map.getName() + ".qgz");
|
||||
arg.setDisaster(BaseConstants.EQ_DISASTER_MAP); // 地震灾害
|
||||
|
||||
// 缩放规则
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gis.xian.service.pub.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.gis.xian.config.DataSource;
|
||||
import com.gis.xian.config.QgisProperties;
|
||||
import com.gis.xian.constant.BaseConstants;
|
||||
import com.gis.xian.core.rabbitmq.DlqOperate;
|
||||
import com.gis.xian.enums.BaseEnums;
|
||||
@@ -36,11 +37,13 @@ public class FeignServiceImpl implements IFeignService {
|
||||
private HttpRestClient restclient;
|
||||
@Resource
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
@Autowired
|
||||
@Resource
|
||||
@Lazy
|
||||
private IDZEqQueueService idzEqQueueService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private DlqOperate dlqOperate;
|
||||
@Resource
|
||||
private QgisProperties qgisProperties;
|
||||
|
||||
// 调用制图服务
|
||||
@Override
|
||||
@@ -60,7 +63,7 @@ public class FeignServiceImpl implements IFeignService {
|
||||
ParameterizedTypeReference<String> res = new ParameterizedTypeReference<String>() {
|
||||
};
|
||||
// 制图
|
||||
String mapName = restclient.post(BaseConstants.HTTP_QGIS_THEMATIC, JSON.toJSON(arg), res);
|
||||
String mapName = restclient.post(qgisProperties.getUrl(), JSON.toJSON(arg), res);
|
||||
// 专题图名称
|
||||
if (mapName == null || mapName.equals("")) {
|
||||
log.error("产出图件失败!");
|
||||
|
||||
@@ -5,7 +5,10 @@ server:
|
||||
# 开发环境配置
|
||||
spring:
|
||||
config:
|
||||
import: classpath:config/database/application-database-dev.yml
|
||||
import:
|
||||
- classpath:config/database/application-database-dev.yml
|
||||
- classpath:config/qgis/application-qgis-dev.yml
|
||||
- classpath:config/customize/application-customize-dev.yml
|
||||
|
||||
|
||||
# redis
|
||||
|
||||
@@ -5,7 +5,10 @@ server:
|
||||
# 生产环境配置
|
||||
spring:
|
||||
config:
|
||||
import: classpath:config/database/application-database-prod.yml
|
||||
import:
|
||||
- classpath:config/database/application-database-prod.yml
|
||||
- classpath:config/qgis/application-qgis-prod.yml
|
||||
- classpath:config/customize/application-customize-prod.yml
|
||||
|
||||
# redis
|
||||
data:
|
||||
|
||||
@@ -5,8 +5,8 @@ spring:
|
||||
config:
|
||||
import: classpath:config/redis/redis-key.yml
|
||||
|
||||
# MyBatis 配置
|
||||
mybatis:
|
||||
# MyBatis-plus 配置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:com/gis/xian/mapper/*.xml
|
||||
type-aliases-package: com.gis.xian.entity
|
||||
configuration:
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# qgis配置
|
||||
qgis:
|
||||
# 地震专题图模板路径
|
||||
eq-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/eq/
|
||||
# 暴雨专题图模板路径
|
||||
rain-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/rain/
|
||||
# QGIS基础路径
|
||||
base-path: F:/files/xian/maps/
|
||||
@@ -0,0 +1,8 @@
|
||||
# qgis配置
|
||||
qgis:
|
||||
# 地震专题图模板路径
|
||||
eq-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/eq/
|
||||
# 暴雨专题图模板路径
|
||||
rain-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/rain/
|
||||
# QGIS基础路径
|
||||
base-path: F:/files/xian/maps/
|
||||
@@ -38,7 +38,7 @@ spring:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
||||
slave1:
|
||||
url: jdbc:postgresql://localhost:5432/yjzyk_xian?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai&postgis=true
|
||||
url: jdbc:postgresql://47.92.216.173:7654/yjzyk_xian?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai&postgis=true
|
||||
username: postgres
|
||||
password: Zzw.0401
|
||||
password: zhangsan
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
||||
@@ -35,7 +35,7 @@ spring:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
||||
slave1:
|
||||
url: jdbc:postgresql://localhost:5432/yjzyk_xian?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai&postgis=true
|
||||
url: jdbc:postgresql://47.92.216.173:7654/yjzyk_xian?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai&postgis=true
|
||||
username: postgres
|
||||
password: Zzw.0401
|
||||
password: zhangsan
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# qgis配置
|
||||
qgis:
|
||||
# QGIS服务地址
|
||||
url: http://localhost:18998/qgis/make/map
|
||||
# 影响场GeoJSON保存路径
|
||||
intensity-geojson-path: influence/
|
||||
# 地震专题图文件输出路径
|
||||
eq-maps-output-path: output/eq/map/
|
||||
# 暴雨专题图文件输出路径
|
||||
rain-maps-output-path: output/rain/map/
|
||||
@@ -0,0 +1,10 @@
|
||||
# qgis配置
|
||||
qgis:
|
||||
# QGIS服务地址
|
||||
url: http://localhost:18998/qgis/make/map
|
||||
# 影响场GeoJSON保存路径
|
||||
intensity-geojson-path: influence/
|
||||
# 地震专题图文件输出路径
|
||||
eq-maps-output-path: output/eq/map/
|
||||
# 暴雨专题图文件输出路径
|
||||
rain-maps-output-path: output/rain/map/
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user