文件下载bug消缺

This commit is contained in:
xy
2024-11-08 14:06:41 +08:00
parent 9f6bb44b3b
commit 5c6d05b307
2 changed files with 8 additions and 1 deletions

View File

@@ -100,6 +100,7 @@ public class AskDeviceDataServiceImpl implements AskDeviceDataService {
} catch (Exception e) {
redisUtil.delete("fileDowning:"+nDid);
redisUtil.delete("fileCheck"+nDid+name);
redisUtil.delete("fileDownUserId"+nDid+name);
throw new BusinessException(AlgorithmResponseEnum.FILE_DOWNLOAD_ERROR);
}
return result;

View File

@@ -31,6 +31,7 @@ import com.njcn.oss.constant.OssPath;
import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.redis.pojo.enums.AppRedisKey;
import com.njcn.redis.utils.RedisUtil;
import com.njcn.user.api.UserFeignClient;
import com.njcn.zlevent.param.CsEventParam;
import com.njcn.zlevent.pojo.dto.FileInfoDto;
import com.njcn.zlevent.pojo.dto.FileStreamDto;
@@ -262,8 +263,13 @@ public class FileServiceImpl implements IFileService {
}
}
}
String userIndex = redisUtil.getObjectByKey("fileDownUserId"+appFileMessage.getId()+appFileMessage.getMsg().getName()).toString();
//推送mqtt
String json = "{fileName:"+appFileMessage.getMsg().getName()+",allStep:"+appFileMessage.getMsg().getFrameTotal()+",nowStep:"+ appFileMessage.getMsg().getFrameCurr() +"}";
String json = "{fileName:" + appFileMessage.getMsg().getName()
+ ",allStep:" + appFileMessage.getMsg().getFrameTotal()
+ ",nowStep:" + appFileMessage.getMsg().getFrameCurr()
+ ",userId:" + userIndex
+"}";
publisher.send("/Web/Progress/" + appFileMessage.getId(), new Gson().toJson(json), 1, false);
if (!Objects.isNull(filePath)){
redisUtil.saveByKeyWithExpire("downloadFilePath:" + appFileMessage.getId() + appFileMessage.getMsg().getName(),filePath,60L);