|
@@ -97,6 +97,17 @@ public class SimulationMapServiceImpl implements SimulationMapService {
|
|
if (Objects.isNull(simulationMapVO)){
|
|
if (Objects.isNull(simulationMapVO)){
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "未找到有效的id");
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "未找到有效的id");
|
|
}
|
|
}
|
|
|
|
+ String mapPath = simulationMapVO.getMapPath();
|
|
|
|
+ ResponseBodyVO<String> publicUrl = fileDownService.getPublicUrl(mapPath);
|
|
|
|
+ if (publicUrl.isStatus()){
|
|
|
|
+ simulationMapVO.setMapPath(publicUrl.getInfo());
|
|
|
|
+ }
|
|
|
|
+ String mapOsgbPath = simulationMapVO.getMapOsgbPath();
|
|
|
|
+ ResponseBodyVO<String> osUrl = fileDownService.getPublicUrl(mapOsgbPath);
|
|
|
|
+ if (osUrl.isStatus()){
|
|
|
|
+ simulationMapVO.setMapOsgbPath(osUrl.getInfo());
|
|
|
|
+ }
|
|
|
|
+
|
|
SimulationMapPathParam simulationMapPathParam = new SimulationMapPathParam();
|
|
SimulationMapPathParam simulationMapPathParam = new SimulationMapPathParam();
|
|
simulationMapPathParam.setMapId(param.getMapId());
|
|
simulationMapPathParam.setMapId(param.getMapId());
|
|
List<SimulationMapPathVO> simulationMapPathPOS = mapPathMapper.selectSimulationMapPathList(simulationMapPathParam);
|
|
List<SimulationMapPathVO> simulationMapPathPOS = mapPathMapper.selectSimulationMapPathList(simulationMapPathParam);
|
|
@@ -195,6 +206,9 @@ public class SimulationMapServiceImpl implements SimulationMapService {
|
|
if (!response.isStatus()){
|
|
if (!response.isStatus()){
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "上传失败");
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "上传失败");
|
|
}
|
|
}
|
|
|
|
+ String previewUrl = response.getInfo();
|
|
|
|
+ String mapUrl = previewUrl.substring(previewUrl.indexOf("/" + DictConstants.MAP_DRIVER_FILE), previewUrl.indexOf("?"));
|
|
|
|
+
|
|
String osgbFileName = fileOsgb.getOriginalFilename();
|
|
String osgbFileName = fileOsgb.getOriginalFilename();
|
|
if (osgbFileName == null){
|
|
if (osgbFileName == null){
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "文件名为空,请检查!");
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "文件名为空,请检查!");
|
|
@@ -204,9 +218,11 @@ public class SimulationMapServiceImpl implements SimulationMapService {
|
|
if (!responseOs.isStatus()){
|
|
if (!responseOs.isStatus()){
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "上传失败");
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "上传失败");
|
|
}
|
|
}
|
|
- String previewUrl = response.getInfo();
|
|
|
|
|
|
+ String osUrl = responseOs.getInfo();
|
|
|
|
+ String osMinioUrl = osUrl.substring(osUrl.indexOf("/" + DictConstants.MAP_DRIVER_FILE), osUrl.indexOf("?"));
|
|
|
|
+
|
|
SimulationMapPO simulationMapPO = new SimulationMapPO();
|
|
SimulationMapPO simulationMapPO = new SimulationMapPO();
|
|
- simulationMapPO.setMapPath(previewUrl).setMapOsgbPath(responseOs.getInfo()).setMapName(param.getMapName()).setMapDescription(param.getMapDescription())
|
|
|
|
|
|
+ simulationMapPO.setMapPath(mapUrl).setMapOsgbPath(osMinioUrl).setMapName(param.getMapName()).setMapDescription(param.getMapDescription())
|
|
.setMapJson(object.toJSONString()).setPathNum(param.getPathNum()).setMapCode("").setId(StringUtil.getRandomUUID());
|
|
.setMapJson(object.toJSONString()).setPathNum(param.getPathNum()).setMapCode("").setId(StringUtil.getRandomUUID());
|
|
int i = mapMapper.addSimulationMap(simulationMapPO);
|
|
int i = mapMapper.addSimulationMap(simulationMapPO);
|
|
if (i <= 0){
|
|
if (i <= 0){
|