Commit 836d3b34 by lili

版权保护是否包含条形码条件

parent f07e3fdb
......@@ -115,14 +115,14 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
//设置图书服务
bookAuthServeBiz.setBookAuthServes(setAuthOpenParam.getServes(), setAuthOpenParam.getBookId(), setAuthOpenParam.getChannelId(), adviserId);
//异步生成条形码并导出
asynExport(setAuthOpenParam.getBookId(), setAuthOpenParam.getChannelId(), adviserId, setAuthOpenParam.getCodeCount());
asynExport(setAuthOpenParam.getBookId(), setAuthOpenParam.getChannelId(), adviserId, setAuthOpenParam.getCodeCount(), setAuthOpenParam.getIsHaveBarCode());
String key = CopyrightConstants.BOOK_AUTH_INFO + bookAuthInfo.getBookId() + "-" + bookAuthInfo.getChannelId() + "-" + adviserId;
BookAuthInfoVO bookAuth = bookAuthInfoDao.getInfoByBook(setAuthOpenParam.getBookId(), setAuthOpenParam.getChannelId(), adviserId);
JedisClusterUtils.setJson(key, bookAuth);
}
@ParamLog("异步导出")
private void asynExport(Long bookId, Long channelId, Long adviserId, Integer codeCount) {
private void asynExport(Long bookId, Long channelId, Long adviserId, Integer codeCount, Integer isHaveBarCode) {
EXECUTOR_SERVICE.execute(() -> {
String commitTime = DateUtils.formatDate(new Date());
try {
......@@ -150,13 +150,20 @@ public class BookAuthInfoBizImpl implements BookAuthInfoBiz {
bookAuthCodes.add(bookAuthCode);
}
bookAuthCodeBiz.insert(bookAuthCodes);
String noticeUrl = "";
if(isHaveBarCode == null || isHaveBarCode.equals(0)){
String url = generateExcel(bookAuthCodes, bookDto.getBookName());
String zipUrl = CopyrightTools.generateBar4Zip(bookAuthCodes, bookDto.getBookName(), url);
noticeUrl = zipUrl;
}else {
String url = generateExcel(bookAuthCodes, bookDto.getBookName());
noticeUrl = url;
}
//发送站内信
sendLetter(adviserId, bookDto.getBookName(), zipUrl, commitTime);
sendLetter(adviserId, bookDto.getBookName(), noticeUrl, commitTime);
//新增导出记录
insertExportRecord(bookId, channelId, adviserId, num, zipUrl);
LOGGER.info("url" + zipUrl);
insertExportRecord(bookId, channelId, adviserId, num, noticeUrl);
LOGGER.info("url" + noticeUrl);
} catch (Exception e) {
LOGGER.error("导出条形码失败" + e.getMessage(), e);
}
......
......@@ -43,6 +43,9 @@ public class SetAuthOpenParam implements Serializable {
@ApiModelProperty("服务")
private List<ServeVO> serves;
@ApiModelProperty("是否包含条形码")
private Integer isHaveBarCode;
public List<ServeVO> getServes() {
return serves;
}
......@@ -115,6 +118,14 @@ public class SetAuthOpenParam implements Serializable {
this.checkType = checkType;
}
public Integer getIsHaveBarCode() {
return isHaveBarCode;
}
public void setIsHaveBarCode(Integer isHaveBarCode) {
this.isHaveBarCode = isHaveBarCode;
}
@Override
public String toString() {
return "SetAuthOpenVO{" +
......
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