Commit dd7cc2f5 by 田超

Merge branch 'bug/1031832' into 'master'

bug : [none] 版权保护导出加二维码名称

See merge request rays/pcloud-book!1456
parents d3199502 4099dca1
...@@ -192,11 +192,12 @@ public class BookSceneAuthBizImpl implements BookSceneAuthBiz { ...@@ -192,11 +192,12 @@ public class BookSceneAuthBizImpl implements BookSceneAuthBiz {
bookAuthCodes.add(bookAuthCode); bookAuthCodes.add(bookAuthCode);
} }
bookSceneAuthCodeDao.insert(bookAuthCodes); bookSceneAuthCodeDao.insert(bookAuthCodes);
String bookName=bookDto.getBookName() +"_"+sceneDto.getSceneName();
String noticeUrl; String noticeUrl;
String zipUrl = CopyrightTools.generateQrcode4ZipNew(bookAuthCodes, bookDto.getBookName(), sceneDto.getUrl(), authBookType); String zipUrl = CopyrightTools.generateQrcode4ZipNew(bookAuthCodes, bookDto.getBookName(), sceneDto.getSceneName(),sceneDto.getUrl(), authBookType);
noticeUrl = zipUrl; noticeUrl = zipUrl;
//发送站内信 //发送站内信
bookAuthInfoBiz.sendLetter(adviserId, bookDto.getBookName(), noticeUrl, commitTime); bookAuthInfoBiz.sendLetter(adviserId, bookName, noticeUrl, commitTime);
//新增导出记录 //新增导出记录
updateSuccessRecord(bookId, channelId, adviserId, num, noticeUrl, sceneId); updateSuccessRecord(bookId, channelId, adviserId, num, noticeUrl, sceneId);
BookSceneAuth authSceneInfo = bookSceneAuthDao.getAuthSceneInfo(bookId, sceneId); BookSceneAuth authSceneInfo = bookSceneAuthDao.getAuthSceneInfo(bookId, sceneId);
......
...@@ -232,7 +232,7 @@ public class CopyrightTools { ...@@ -232,7 +232,7 @@ public class CopyrightTools {
* @param sceneUrl * @param sceneUrl
* @return * @return
*/ */
public static String generateQrcode4ZipNew(List<BookSceneAuthCode> bookAuthCodes, String fileName, String sceneUrl,Integer authBookType) { public static String generateQrcode4ZipNew(List<BookSceneAuthCode> bookAuthCodes, String fileName,String sceneName, String sceneUrl,Integer authBookType) {
fileName = FileUtils.formatName(fileName); fileName = FileUtils.formatName(fileName);
String tempZipName = fileName + "_" + LocalDateUtils.getYmdhmss(); String tempZipName = fileName + "_" + LocalDateUtils.getYmdhmss();
String zipFilePath = ZIP_FILE_PATH + tempZipName + ".zip"; String zipFilePath = ZIP_FILE_PATH + tempZipName + ".zip";
...@@ -261,7 +261,7 @@ public class CopyrightTools { ...@@ -261,7 +261,7 @@ public class CopyrightTools {
} }
} }
// paintQrcodeText(bufferedImage, bookAuthCode.getFullCode()); // paintQrcodeText(bufferedImage, bookAuthCode.getFullCode());
File file = new File(fileFolderPath + "/" + bookAuthCode.getFullCode() + ".png"); File file = new File(fileFolderPath + "/" + sceneName+bookAuthCode.getFullCode() + ".png");
ImageIO.write(bufferedImage, ImageTypeEnum.PNG.value, file); ImageIO.write(bufferedImage, ImageTypeEnum.PNG.value, file);
String qrcodeUrl = QrcodeUtils.uploadImage(bufferedImage); String qrcodeUrl = QrcodeUtils.uploadImage(bufferedImage);
bookAuthCode.setUrl(content); bookAuthCode.setUrl(content);
...@@ -275,7 +275,7 @@ public class CopyrightTools { ...@@ -275,7 +275,7 @@ public class CopyrightTools {
FileUtils.isDir(ZIP_FILE_PATH); FileUtils.isDir(ZIP_FILE_PATH);
CompressUtils.zip(fileFolderPath, zipFilePath); CompressUtils.zip(fileFolderPath, zipFilePath);
// 上传文件到服务器中 // 上传文件到服务器中
uploadResultInfo = OssUtils.uploadLocalFile4CustomName(zipFilePath, fileName); uploadResultInfo = OssUtils.uploadLocalFile4CustomName(zipFilePath, fileName+"_"+sceneName);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("【压缩】压缩失败,<ERROR>:" + e.getMessage(), e); LOGGER.error("【压缩】压缩失败,<ERROR>:" + e.getMessage(), e);
throw new FileException(FileException.ZIP_ERROR, "压缩失败!"); throw new FileException(FileException.ZIP_ERROR, "压缩失败!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment