Commit 6de80776 authored by tangtuo's avatar tangtuo

debug

parent cb8a3cc5
...@@ -26,5 +26,5 @@ public interface CopyrightFileService extends IService<CopyrightFile> { ...@@ -26,5 +26,5 @@ public interface CopyrightFileService extends IService<CopyrightFile> {
* @param id * @param id
* @return * @return
*/ */
Integer delByCopyrightId(Integer id); Integer delByCopyrightId(Integer id, boolean delFile);
} }
...@@ -201,7 +201,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, ...@@ -201,7 +201,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
obsUtil.delete(copyright.getAuthorityAscriptionProve()); obsUtil.delete(copyright.getAuthorityAscriptionProve());
} }
// 删除附件列表 // 删除附件列表
copyrightFileService.delByCopyrightId(id); copyrightFileService.delByCopyrightId(id, true);
// 删除作者列表 // 删除作者列表
copyrightAuthorService.delByCopyrightId(id); copyrightAuthorService.delByCopyrightId(id);
// 删除版权权力拥有情况 // 删除版权权力拥有情况
...@@ -259,7 +259,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, ...@@ -259,7 +259,7 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
} }
CopyrightApply copyrightApply = new CopyrightApply(copyrightDTO); CopyrightApply copyrightApply = new CopyrightApply(copyrightDTO);
if (CollectionUtil.isNotEmpty(copyrightDTO.getFiles())) { if (CollectionUtil.isNotEmpty(copyrightDTO.getFiles())) {
copyrightFileService.delByCopyrightId(copyrightDTO.getId()); copyrightFileService.delByCopyrightId(copyrightDTO.getId(), false);
ArrayList<CopyrightFile> files = new ArrayList<>(); ArrayList<CopyrightFile> files = new ArrayList<>();
for (CopyrightDTO.File file : copyrightDTO.getFiles()) { for (CopyrightDTO.File file : copyrightDTO.getFiles()) {
CopyrightFile copyrightFile = new CopyrightFile(file); CopyrightFile copyrightFile = new CopyrightFile(file);
......
...@@ -34,11 +34,14 @@ public class CopyrightFileServiceImpl extends ServiceImpl<CopyrightFileMapper, C ...@@ -34,11 +34,14 @@ public class CopyrightFileServiceImpl extends ServiceImpl<CopyrightFileMapper, C
} }
@Override @Override
public Integer delByCopyrightId(Integer copyrightId) { public Integer delByCopyrightId(Integer copyrightId, boolean delFile) {
if (delFile) {
List<CopyrightFile> list = getByCopyrightId(copyrightId); List<CopyrightFile> list = getByCopyrightId(copyrightId);
for (CopyrightFile file : list) { for (CopyrightFile file : list) {
obsUtil.delete(file.getFileUrl()); obsUtil.delete(file.getFileUrl());
} }
}
UpdateWrapper<CopyrightFile> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<CopyrightFile> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("copyright_id", copyrightId); updateWrapper.eq("copyright_id", copyrightId);
return copyrightFileMapper.delete(updateWrapper); return copyrightFileMapper.delete(updateWrapper);
......
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