@@ -87,7 +87,9 @@ public void sign(ApprovalAddSignRequest request, String userId, String orgId) {
8787 handleNextApprovalNode (nextNode , instance , userId );
8888 }
8989 // 保存加签附件
90- saveInstanceAttachment (request .getAttachmentIds (), request .getInstanceId (), addSignTask .getId (), userId , orgId );
90+ if (CollectionUtils .isNotEmpty (request .getAttachmentIds ())) {
91+ saveInstanceAttachment (request .getAttachmentIds (), request .getInstanceId (), addSignTask .getId (), userId , orgId );
92+ }
9193 }
9294
9395 /**
@@ -105,7 +107,9 @@ public void back(ApprovalReturnBackRequest request, String userId, String orgId)
105107 // 保存执行任务
106108 saveActionTask (request , ApprovalAction .BACK , userId , orgId , null );
107109 // 保存退回附件
108- saveInstanceAttachment (request .getAttachmentIds (), request .getInstanceId (), backRecord .getId (), userId , orgId );
110+ if (CollectionUtils .isNotEmpty (request .getAttachmentIds ())) {
111+ saveInstanceAttachment (request .getAttachmentIds (), request .getInstanceId (), backRecord .getId (), userId , orgId );
112+ }
109113 }
110114
111115 /**
@@ -296,7 +300,9 @@ private void saveApprovalRecord(ApprovalTask currentTask, String comment, List<S
296300 record .setUpdateTime (System .currentTimeMillis ());
297301 record .setUpdateUser (currentUserId );
298302 approvalRecordMapper .insert (record );
299- saveInstanceAttachment (attachmentIds , currentTask .getInstanceId (), record .getId (), currentUserId , orgId );
303+ if (CollectionUtils .isNotEmpty (attachmentIds )) {
304+ saveInstanceAttachment (attachmentIds , currentTask .getInstanceId (), record .getId (), currentUserId , orgId );
305+ }
300306 }
301307
302308 /**
0 commit comments