|
|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.scene.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
@@ -34,10 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -232,7 +230,17 @@ public class SceneDownloadLogServiceImpl extends ServiceImpl<ISceneDownloadLogMa
|
|
|
.eq(SceneDownloadLog::getSceneNum, num)
|
|
|
// .eq(SceneDownloadLog::getLang, lang)
|
|
|
.last("limit 1"));
|
|
|
- if(Objects.isNull(sceneDownloadLog)){//如果没有记录,则没有生成过
|
|
|
+ List<String> taskList = redisUtil.lGet(RedisKey.SCENE_DOWNLOADS_TASK_V4, 0, -1);
|
|
|
+ boolean onTask = false;
|
|
|
+ if(CollUtil.isNotEmpty(taskList) && taskList.contains(num)){
|
|
|
+ onTask = true;
|
|
|
+ }
|
|
|
+ List<String> downloadingList = redisUtil.lGet(RedisKey.SCENE_DOWNLOAD_ING, 0, -1);
|
|
|
+ boolean onDownloading = false;
|
|
|
+ if(CollUtil.isNotEmpty(downloadingList) && downloadingList.contains(num)){
|
|
|
+ onDownloading = true;
|
|
|
+ }
|
|
|
+ if(Objects.isNull(sceneDownloadLog) || (!onTask && !onDownloading)){//如果没有记录,则没有生成过
|
|
|
result.put("status", -1);
|
|
|
return result;
|
|
|
}
|