Commit 37b9519d authored by 周健威's avatar 周健威

修改代码

parent 0bec694d
...@@ -118,13 +118,23 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo ...@@ -118,13 +118,23 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo
//shp 转 geom //shp 转 geom
// String shpPath = redisTemplate.opsForValue().get(dto.getShpKey()); // String shpPath = redisTemplate.opsForValue().get(dto.getShpKey());
// dto.setGeom(ShpToGeojson.shp2geojson(shpPath)); // dto.setGeom(ShpToGeojson.shp2geojson(shpPath));
dto.setGeom(redisTemplate.opsForValue().get(dto.getShpKey()).toString()); String redisStr = redisTemplate.opsForValue().get(dto.getShpKey()).toString();
ShpDTO shpDTO = JSONUtil.toBean(redisStr, ShpDTO.class);
if(CollUtil.isNotEmpty(shpDTO.getFeatures())) {
dto.setGeom(shpDTO.getFeatures().get(0));
// dto.setGeom(redisTemplate.opsForValue().get(dto.getShpKey()).toString());
}
return ObjectRestResponse.succ(baseBiz.queryDataAreaList(dto)); return ObjectRestResponse.succ(baseBiz.queryDataAreaList(dto));
} else { } else {
return ObjectRestResponse.succ(baseBiz.queryDataAreaList(dto)); return ObjectRestResponse.succ(baseBiz.queryDataAreaList(dto));
} }
} }
@Data
public static class ShpDTO {
List<String> features;
}
@RequestMapping(value = "/app/unauth/detailById", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/detailById", method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse<List<RscpImageDataTotal>> detailById(Long id){ public ObjectRestResponse<List<RscpImageDataTotal>> detailById(Long id){
......
...@@ -67,8 +67,8 @@ public class UploadService { ...@@ -67,8 +67,8 @@ public class UploadService {
//将文件写入指定位置 //将文件写入指定位置
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
String key = "shp:"+ UUIDUtils.generateShortUuid(); String key = "shp:"+ UUIDUtils.generateShortUuid();
// String geomJson = ShpToGeojson.shp2geojson(filePath); String geomJson = ShpToGeojson.shp2geojson(filePath);
String geomJson = ShpToGeojson.shp2OneGeojson(filePath); // String geomJson = ShpToGeojson.shp2OneGeojson(filePath);
redisTemplate.opsForValue().setIfAbsent(key, geomJson); redisTemplate.opsForValue().setIfAbsent(key, geomJson);
// realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath; // realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment