Commit d5340c66 authored by 周健威's avatar 周健威

修改代码

parent 08ba96d7
package com.upyuns.platform.rs.datacenter.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* ${DESCRIPTION}
*
* @author wanghaobin
* @create 2017-06-21 8:39
*/
@Configuration
@Primary
public class RedisConfiguration {
@Bean
public RedisTemplate<String, Object> customRedisTemplate(RedisConnectionFactory factory) {
RedisTemplate redisTemplate = new RedisTemplate();
redisTemplate.setConnectionFactory(factory);
RedisSerializer<String> stringSerializer = new StringRedisSerializer();
redisTemplate.setKeySerializer(stringSerializer);
redisTemplate.setValueSerializer(stringSerializer);
redisTemplate.setHashKeySerializer(stringSerializer);
redisTemplate.setHashValueSerializer(stringSerializer);
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
}
\ No newline at end of file
...@@ -62,8 +62,8 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo ...@@ -62,8 +62,8 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo
@Autowired @Autowired
GtDataRestClient gtDataRestClient; GtDataRestClient gtDataRestClient;
// @Autowired @Autowired
// private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
@RequestMapping(value = "/app/unauth/query", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/query", method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
...@@ -118,7 +118,7 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo ...@@ -118,7 +118,7 @@ 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())); dto.setGeom(redisTemplate.opsForValue().get(dto.getShpKey()));
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));
......
...@@ -68,7 +68,7 @@ public class UploadService { ...@@ -68,7 +68,7 @@ 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);
redisTemplate.opsForValue().set(key, geomJson); redisTemplate.opsForValue().setIfAbsent(key, geomJson);
// realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath; // realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath;
Map map = CollUtil.newHashMap(); Map map = CollUtil.newHashMap();
......
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