Commit 6de80776 authored by tangtuo's avatar tangtuo

debug

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