处理服务指令图片小图镜像不成功问题
This commit is contained in:
parent
24e818d79e
commit
54cec87eae
|
|
@ -294,6 +294,7 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
|
|
||||||
// 处理每个文件并获取更新后的路径
|
// 处理每个文件并获取更新后的路径
|
||||||
Map<String, String> newPreviewFileMap = NuFileUtils.processFile(mediaFileSavePath, previewFile);
|
Map<String, String> newPreviewFileMap = NuFileUtils.processFile(mediaFileSavePath, previewFile);
|
||||||
|
Map<String, String> newPreviewFileSmallMap = NuFileUtils.processFile(mediaFileSavePath, previewFileSmall);
|
||||||
Map<String, String> newImmediateFileMap = NuFileUtils.processFile(mediaFileSavePath, immediateFile);
|
Map<String, String> newImmediateFileMap = NuFileUtils.processFile(mediaFileSavePath, immediateFile);
|
||||||
Map<String, String> newMp3FileMap = NuFileUtils.processFile(mediaFileSavePath, mp3File);
|
Map<String, String> newMp3FileMap = NuFileUtils.processFile(mediaFileSavePath, mp3File);
|
||||||
Map<String, String> newMp4FileMap = NuFileUtils.processFile(mediaFileSavePath, mp4File);
|
Map<String, String> newMp4FileMap = NuFileUtils.processFile(mediaFileSavePath, mp4File);
|
||||||
|
|
@ -303,6 +304,10 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
configServiceDirective.setPreviewFile(newPreviewFileMap.get("path"));
|
configServiceDirective.setPreviewFile(newPreviewFileMap.get("path"));
|
||||||
configServiceDirective.setPreviewFileMd5(newPreviewFileMap.get("md5"));
|
configServiceDirective.setPreviewFileMd5(newPreviewFileMap.get("md5"));
|
||||||
}
|
}
|
||||||
|
if (newPreviewFileSmallMap != null) {
|
||||||
|
configServiceDirective.setPreviewFileSmall(newPreviewFileSmallMap.get("path"));
|
||||||
|
configServiceDirective.setPreviewFileSmallMd5(newPreviewFileSmallMap.get("md5"));
|
||||||
|
}
|
||||||
if (newImmediateFileMap != null) {
|
if (newImmediateFileMap != null) {
|
||||||
configServiceDirective.setImmediateFile(newImmediateFileMap.get("path"));
|
configServiceDirective.setImmediateFile(newImmediateFileMap.get("path"));
|
||||||
configServiceDirective.setImmediateFileMd5(newImmediateFileMap.get("md5"));
|
configServiceDirective.setImmediateFileMd5(newImmediateFileMap.get("md5"));
|
||||||
|
|
|
||||||
|
|
@ -575,11 +575,13 @@ public class DirectiveMQListener {
|
||||||
if (needAddIds.contains(directive.getId())) {
|
if (needAddIds.contains(directive.getId())) {
|
||||||
//这里都是新增的指令 不存储指令资源字段 在指令资源mq中会存储这个值
|
//这里都是新增的指令 不存储指令资源字段 在指令资源mq中会存储这个值
|
||||||
directive.setPreviewFile(null);
|
directive.setPreviewFile(null);
|
||||||
|
directive.setPreviewFileSmall(null);
|
||||||
directive.setImmediateFile(null);
|
directive.setImmediateFile(null);
|
||||||
directive.setMp3File(null);
|
directive.setMp3File(null);
|
||||||
directive.setMp4File(null);
|
directive.setMp4File(null);
|
||||||
directive.setServiceContent(null);
|
directive.setServiceContent(null);
|
||||||
directive.setPreviewFileMd5(null);
|
directive.setPreviewFileMd5(null);
|
||||||
|
directive.setPreviewFileSmallMd5(null);
|
||||||
directive.setImmediateFileMd5(null);
|
directive.setImmediateFileMd5(null);
|
||||||
directive.setMp3FileMd5(null);
|
directive.setMp3FileMd5(null);
|
||||||
directive.setMp4FileMd5(null);
|
directive.setMp4FileMd5(null);
|
||||||
|
|
@ -899,6 +901,7 @@ public class DirectiveMQListener {
|
||||||
|
|
||||||
//更新服务指令媒体资源字段
|
//更新服务指令媒体资源字段
|
||||||
ConfigServiceDirective configServiceDirective = new ConfigServiceDirective();
|
ConfigServiceDirective configServiceDirective = new ConfigServiceDirective();
|
||||||
|
log.info("======>>{}",dto.getId());
|
||||||
configServiceDirective.setId(dto.getId());
|
configServiceDirective.setId(dto.getId());
|
||||||
configServiceDirective.setServiceContent(dto.getServiceContent());//服务指令说明
|
configServiceDirective.setServiceContent(dto.getServiceContent());//服务指令说明
|
||||||
|
|
||||||
|
|
@ -908,7 +911,7 @@ public class DirectiveMQListener {
|
||||||
String baseUrl = apiAddress;
|
String baseUrl = apiAddress;
|
||||||
|
|
||||||
//处理服务指令图片大图
|
//处理服务指令图片大图
|
||||||
if (!dto.getPreviewFileMd5().equals(currentDirective.getPreviewFileMd5())) {
|
if (StringUtils.isNotBlank(dto.getPreviewFileMd5()) && !dto.getPreviewFileMd5().equals(currentDirective.getPreviewFileMd5())) {
|
||||||
String previewFile = dto.getPreviewFile();
|
String previewFile = dto.getPreviewFile();
|
||||||
if (StringUtils.isNotBlank(previewFile)) {
|
if (StringUtils.isNotBlank(previewFile)) {
|
||||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||||
|
|
@ -935,7 +938,7 @@ public class DirectiveMQListener {
|
||||||
}
|
}
|
||||||
//处理服务指令图片小图
|
//处理服务指令图片小图
|
||||||
if (StringUtils.isNotBlank(dto.getPreviewFileSmallMd5()) && !dto.getPreviewFileSmallMd5().equals(currentDirective.getPreviewFileSmallMd5())) {
|
if (StringUtils.isNotBlank(dto.getPreviewFileSmallMd5()) && !dto.getPreviewFileSmallMd5().equals(currentDirective.getPreviewFileSmallMd5())) {
|
||||||
String previewFileSmall = dto.getPreviewFileSmallMd5();
|
String previewFileSmall = dto.getPreviewFileSmall();
|
||||||
if (StringUtils.isNotBlank(previewFileSmall)) {
|
if (StringUtils.isNotBlank(previewFileSmall)) {
|
||||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFileSmall, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFileSmall, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||||
|
|
@ -960,7 +963,7 @@ public class DirectiveMQListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//处理即时指令图标
|
//处理即时指令图标
|
||||||
if (!dto.getImmediateFileMd5().equals(currentDirective.getImmediateFileMd5())) {
|
if (StringUtils.isNotBlank(dto.getImmediateFileMd5()) && !dto.getImmediateFileMd5().equals(currentDirective.getImmediateFileMd5())) {
|
||||||
String immediateFile = dto.getImmediateFile();
|
String immediateFile = dto.getImmediateFile();
|
||||||
if (StringUtils.isNotBlank(immediateFile)) {
|
if (StringUtils.isNotBlank(immediateFile)) {
|
||||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(immediateFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(immediateFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||||
|
|
@ -986,7 +989,7 @@ public class DirectiveMQListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//处理指令音频文件
|
//处理指令音频文件
|
||||||
if (!dto.getMp3FileMd5().equals(currentDirective.getMp3FileMd5())) {
|
if (StringUtils.isNotBlank(dto.getMp3FileMd5()) && !dto.getMp3FileMd5().equals(currentDirective.getMp3FileMd5())) {
|
||||||
String mp3File = dto.getMp3File();
|
String mp3File = dto.getMp3File();
|
||||||
if (StringUtils.isNotBlank(mp3File)) {
|
if (StringUtils.isNotBlank(mp3File)) {
|
||||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp3File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp3File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||||
|
|
@ -1012,7 +1015,7 @@ public class DirectiveMQListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//处理指令视频文件
|
//处理指令视频文件
|
||||||
if (!dto.getMp4FileMd5().equals(currentDirective.getMp4FileMd5())) {
|
if (StringUtils.isNotBlank(dto.getMp4FileMd5()) && !dto.getMp4FileMd5().equals(currentDirective.getMp4FileMd5())) {
|
||||||
String mp4File = dto.getMp4File();
|
String mp4File = dto.getMp4File();
|
||||||
if (StringUtils.isNotBlank(mp4File)) {
|
if (StringUtils.isNotBlank(mp4File)) {
|
||||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp4File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp4File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue