mirror of https://gitee.com/stylefeng/roses
【7.4.0】【file】更新删除业务文件关联的逻辑
parent
8f0c52e6ff
commit
60c8db2a81
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue