Commit 836d3b34 by lili

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

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