|
@@ -9,6 +9,7 @@ import com.fdkankan.redis.constant.RedisKey;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.ucenter.common.DownloadStatusEnum;
|
|
import com.fdkankan.ucenter.common.DownloadStatusEnum;
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
|
|
+import com.fdkankan.ucenter.common.RedisKeyUtil;
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
import com.fdkankan.ucenter.constant.LoginConstant;
|
|
import com.fdkankan.ucenter.constant.LoginConstant;
|
|
import com.fdkankan.ucenter.entity.*;
|
|
import com.fdkankan.ucenter.entity.*;
|
|
@@ -113,11 +114,18 @@ public class DownService implements IDownService {
|
|
version = proEdit.getVersion();
|
|
version = proEdit.getVersion();
|
|
}
|
|
}
|
|
if(scenePro == null && scenePlus !=null){
|
|
if(scenePro == null && scenePlus !=null){
|
|
- SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
|
|
|
|
- if(sceneEditInfo == null){
|
|
|
|
- throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
|
|
|
+ String redisKey = String.format(RedisKeyUtil.SCENE_VERSION,scenePlus.getNum());
|
|
|
|
+ if(!redisUtil.hasKey(redisKey) || StringUtils.isBlank(redisUtil.get(redisKey))){
|
|
|
|
+ SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
|
|
|
|
+ if(sceneEditInfo == null){
|
|
|
|
+ throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
|
+ }
|
|
|
|
+ version = sceneEditInfo.getVersion();
|
|
|
|
+ }else {
|
|
|
|
+ String redisObj = redisUtil.get(redisKey);
|
|
|
|
+ JSONObject obj = JSONObject.parseObject(redisObj);
|
|
|
|
+ version = obj.getInteger("version");
|
|
}
|
|
}
|
|
- version = sceneEditInfo.getVersion();
|
|
|
|
}
|
|
}
|
|
return version;
|
|
return version;
|
|
}
|
|
}
|