|
|
@@ -54,6 +54,7 @@ import java.nio.charset.StandardCharsets;
|
|
|
import java.util.*;
|
|
|
import java.util.Map.Entry;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -253,12 +254,13 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
private void addOrUpdateHotData(String num, List<HotParamVO> hotDataList) throws Exception{
|
|
|
Map<String, String> addOrUpdateMap = new HashMap<>();
|
|
|
- int i = 0;
|
|
|
- for (HotParamVO hotParamVO : hotDataList) {
|
|
|
- JSONObject jsonObject = JSON.parseObject(hotParamVO.getHotData());
|
|
|
- jsonObject.put("createTime", Calendar.getInstance().getTimeInMillis() + i++);
|
|
|
- addOrUpdateMap.put(hotParamVO.getSid(), jsonObject.toJSONString());
|
|
|
- }
|
|
|
+ AtomicInteger i = new AtomicInteger();
|
|
|
+ long timeInMillis = Calendar.getInstance().getTimeInMillis();
|
|
|
+ CollUtil.reverse(hotDataList).stream().forEach(v->{
|
|
|
+ JSONObject jsonObject = JSON.parseObject(v.getHotData());
|
|
|
+ jsonObject.put("createTime", timeInMillis + i.getAndIncrement());
|
|
|
+ addOrUpdateMap.put(v.getSid(), jsonObject.toJSONString());
|
|
|
+ });
|
|
|
|
|
|
this.syncHotFromFileToRedis(num);
|
|
|
|