delete 删除会议文件下载次数限制
This commit is contained in:
+26
-26
@@ -561,13 +561,13 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
}
|
||||
|
||||
ossFileService.updateById(ossFile);
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (loginUser.getIsCompanyUser()) {
|
||||
Integer integer = ossFileService.searchDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||
if (integer >= 5) {
|
||||
throw new JeroBootException("超出下载次数限制");
|
||||
}
|
||||
}
|
||||
//LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//if (loginUser.getIsCompanyUser()) {
|
||||
// Integer integer = ossFileService.searchDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||
// if (integer >= 5) {
|
||||
// throw new JeroBootException("超出下载次数限制");
|
||||
// }
|
||||
//}
|
||||
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1"));
|
||||
response.setContentType("application/force-download");// 设置强制下载不打开
|
||||
if (type == null) {
|
||||
@@ -586,25 +586,25 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
}
|
||||
response.flushBuffer();
|
||||
//统计下载和预览次数
|
||||
if ("download".equals(type)) {
|
||||
Integer downloadNumber = ossFile.getDownloadNumber();
|
||||
if (downloadNumber == null) {
|
||||
ossFile.setDownloadNumber(1);
|
||||
} else {
|
||||
ossFile.setDownloadNumber(downloadNumber + 1);
|
||||
}
|
||||
ossFileService.updateAndPush(ossFile);
|
||||
//增加下载次数
|
||||
ossFileService.saveDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||
} else {
|
||||
Integer viewNumber = ossFile.getViewNumber();
|
||||
if (viewNumber == null) {
|
||||
ossFile.setViewNumber(1);
|
||||
} else {
|
||||
ossFile.setViewNumber(viewNumber + 1);
|
||||
}
|
||||
ossFileService.updateAndPush(ossFile);
|
||||
}
|
||||
//if ("download".equals(type)) {
|
||||
// Integer downloadNumber = ossFile.getDownloadNumber();
|
||||
// if (downloadNumber == null) {
|
||||
// ossFile.setDownloadNumber(1);
|
||||
// } else {
|
||||
// ossFile.setDownloadNumber(downloadNumber + 1);
|
||||
// }
|
||||
// ossFileService.updateAndPush(ossFile);
|
||||
// //增加下载次数
|
||||
// ossFileService.saveDownloadTimes(ossFile.getId(), loginUser.getId());
|
||||
//} else {
|
||||
// Integer viewNumber = ossFile.getViewNumber();
|
||||
// if (viewNumber == null) {
|
||||
// ossFile.setViewNumber(1);
|
||||
// } else {
|
||||
// ossFile.setViewNumber(viewNumber + 1);
|
||||
// }
|
||||
// ossFileService.updateAndPush(ossFile);
|
||||
//}
|
||||
} catch (IOException e) {
|
||||
log.error("预览文件失败" + e.getMessage());
|
||||
response.setStatus(404);
|
||||
|
||||
Reference in New Issue
Block a user