【7.4.0】【file】更新删除业务文件关联的逻辑

dev-7.4.0-sync
fengshuonan 2023-04-14 15:21:15 +08:00
parent 8f0c52e6ff
commit 60c8db2a81
2 changed files with 13 additions and 3 deletions

View File

@ -68,10 +68,11 @@ public interface FileBusinessApi {
/**
* id
*
* @param businessId id
* @param businessCode
* @param businessId id
* @author fengshuonan
* @since 2023/3/31 14:23
*/
void removeBusinessIdFileList(Long businessId);
void removeBusinessIdFileList(String businessCode, Long businessId);
}

View File

@ -79,6 +79,9 @@ public class SysFileBusinessServiceImpl extends ServiceImpl<SysFileBusinessMappe
return;
}
// 删除业务id下的所有文件
this.removeBusinessIdFileList(businessCode, businessId);
ArrayList<SysFileBusiness> sysFileBusinesses = new ArrayList<>();
for (Long fileId : fileIdList) {
SysFileBusiness sysFileBusiness = new SysFileBusiness();
@ -142,8 +145,14 @@ public class SysFileBusinessServiceImpl extends ServiceImpl<SysFileBusinessMappe
}
@Override
public void removeBusinessIdFileList(Long businessId) {
public void removeBusinessIdFileList(String businessCode, Long businessId) {
if (ObjectUtil.isEmpty(businessCode) || ObjectUtil.isEmpty(businessId)) {
return;
}
LambdaQueryWrapper<SysFileBusiness> sysFileBusinessLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysFileBusinessLambdaQueryWrapper.eq(SysFileBusiness::getBusinessCode, businessCode);
sysFileBusinessLambdaQueryWrapper.eq(SysFileBusiness::getBusinessId, businessId);
this.remove(sysFileBusinessLambdaQueryWrapper);
}