|
@@ -7,6 +7,7 @@ import com.ruoyi.common.helper.LoginHelper;
|
|
|
import com.ruoyi.common.utils.JsonUtils;
|
|
|
import com.ruoyi.demo.constant.RedisContant;
|
|
|
import com.ruoyi.demo.entity.WdInfo;
|
|
|
+import com.ruoyi.demo.entity.bo.PointBo;
|
|
|
import com.ruoyi.demo.entity.vo.TopologicalWdAceeptVo;
|
|
|
import com.ruoyi.demo.service.TopologicalCommonService;
|
|
|
import com.ruoyi.demo.service.WdInfoService;
|
|
@@ -61,18 +62,18 @@ public class TopologicalCommonController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping(path = "/map",produces = {MediaType.TEXT_EVENT_STREAM_VALUE})
|
|
|
- public SseEmitter map(TopologicalWdAceeptVo topologicalWdAceeptVo) throws IOException {
|
|
|
+ public SseEmitter map(TopologicalWdAceeptVo topologicalWdAceeptVo) throws IOException {
|
|
|
String md5 = topologicalWdAceeptVo.getHash();
|
|
|
|
|
|
//2.查看redis中是否存在有缓存
|
|
|
- List<Point> wdCount = (List<Point>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_COMMON_MAP).get(md5);
|
|
|
+ List<PointBo> wdCount = (List<PointBo>) redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_COMMON_MAP).get(md5);
|
|
|
if (wdCount != null) {
|
|
|
SseEmitter sseEmitter = getSseEmitter(LoginHelper.getUserId());
|
|
|
sendFragment(sseEmitter,wdCount);
|
|
|
return sseEmitter;
|
|
|
}
|
|
|
|
|
|
- List<Point> map = topologicalCommonService.map(topologicalWdAceeptVo);
|
|
|
+ List<PointBo> map = topologicalCommonService.map(topologicalWdAceeptVo);
|
|
|
redisTemplate.boundHashOps(RedisContant.TOPOLOGICAL_COMMON_MAP).put(md5,map);
|
|
|
redisTemplate.expire(RedisContant.TOPOLOGICAL_COMMON_MAP,RedisContant.TOPOLOGICAL_COMMON_MAP_TIME, TimeUnit.MINUTES); //30分钟
|
|
|
SseEmitter sseEmitter = getSseEmitter(LoginHelper.getUserId());
|
|
@@ -97,7 +98,7 @@ public class TopologicalCommonController {
|
|
|
return sseEmitter1;
|
|
|
}
|
|
|
|
|
|
- public void sendFragment(SseEmitter sseEmitter,List<Point> wdCount){
|
|
|
+ public void sendFragment(SseEmitter sseEmitter,List<PointBo> wdCount){
|
|
|
int size = 1000;
|
|
|
int pages = wdCount.size()%size == 0 ? wdCount.size()/size:wdCount.size()/size+1;
|
|
|
int p1 = 0,p2 = size;
|