tao.mo

biz-customer | 修改 | 不删除提交上传失败文件

mt
2024年12月23日20:56:32
......@@ -78,8 +78,8 @@ public class AttachmentServiceImpl extends BaseService implements IAttachmentSer
++i;
}
}catch(Exception ex){
//如果上传过程中存在失败,则所有已上传的文件进行删除
attachmentUtil.deleteAttachments(attachmentList);
//如果上传过程中存在失败,则所有已上传的文件进行删除,已上传文件不进行删除
// attachmentUtil.deleteAttachments(attachmentList);
throw ex;
}
return attachmentList;
......
......@@ -132,15 +132,15 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
consignmentUtil.submitInfo(consignment,attachmentList,uploadRecord,user);
}catch(OpErrorException ex){
/**
* 提交异常,需要删除对应已上传附件
* 提交异常,需要删除对应已上传附件,已上传文件不进行删除
*/
attachmentService.deleteAttachments(attachmentList);
// attachmentService.deleteAttachments(attachmentList);
throw ex;
}catch(Exception ex){
/**
* 提交异常,需要删除对应已上传附件
* 提交异常,需要删除对应已上传附件,已上传文件不进行删除
*/
attachmentService.deleteAttachments(attachmentList);
// attachmentService.deleteAttachments(attachmentList);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30016,ex);
}
return responseUtils.success(ResponseCode.MESSAGE_CODE_30015);
......
......@@ -35,7 +35,7 @@ public class AttachmentValidate {
public void validateFile(MultipartFile[] files, ConsignmentBo consignmentBo){
//文件为空
if(Objects.isNull(files)
|| files.length == DigitConstants.DIGIT_MINUS_ONE
|| files.length == DigitConstants.DIGIT_ZERO
|| Objects.isNull(consignmentBo)
|| Objects.isNull(consignmentBo.getAttachmentBizTypeList())){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30006);
......