Commit d37bc069a3dad3d3c56b054a30abf981981c2b6d

Authored by jason
1 parent c7649efa

feat: 审批,拒绝任务时允许添加附件

yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java
@@ -605,10 +605,8 @@ public class BpmTaskServiceImpl implements BpmTaskService { @@ -605,10 +605,8 @@ public class BpmTaskServiceImpl implements BpmTaskService {
605 BpmCommentTypeEnum.APPROVE.formatComment(reqVO.getReason())); 605 BpmCommentTypeEnum.APPROVE.formatComment(reqVO.getReason()));
606 // 2.3 添加附件 606 // 2.3 添加附件
607 if (CollUtil.isNotEmpty(reqVO.getAttachments())) { 607 if (CollUtil.isNotEmpty(reqVO.getAttachments())) {
608 - reqVO.getAttachments().forEach(attachment -> {  
609 - taskService.createAttachment(BpmAttachmentTypeEnum.TASK_ATTACHMENT.getType(), task.getId(), task.getProcessInstanceId(),  
610 - FileUtil.getName(URLUtil.getPath(attachment)), null, attachment);  
611 - }); 608 + reqVO.getAttachments().forEach(attachment -> taskService.createAttachment(BpmAttachmentTypeEnum.TASK_ATTACHMENT.getType(),
  609 + task.getId(), task.getProcessInstanceId(), FileUtil.getName(URLUtil.getPath(attachment)), null, attachment));
612 } 610 }
613 611
614 // 3. 设置流程变量。如果流程变量前端传空,需要从历史实例中获取,原因:前端表单如果在当前节点无可编辑的字段时 variables 一定会为空 612 // 3. 设置流程变量。如果流程变量前端传空,需要从历史实例中获取,原因:前端表单如果在当前节点无可编辑的字段时 variables 一定会为空
@@ -837,10 +835,8 @@ public class BpmTaskServiceImpl implements BpmTaskService { @@ -837,10 +835,8 @@ public class BpmTaskServiceImpl implements BpmTaskService {
837 BpmCommentTypeEnum.REJECT.formatComment(reqVO.getReason())); 835 BpmCommentTypeEnum.REJECT.formatComment(reqVO.getReason()));
838 // 2.3 添加附件 836 // 2.3 添加附件
839 if (CollUtil.isNotEmpty(reqVO.getAttachments())) { 837 if (CollUtil.isNotEmpty(reqVO.getAttachments())) {
840 - reqVO.getAttachments().forEach(attachment -> {  
841 - taskService.createAttachment(BpmAttachmentTypeEnum.TASK_ATTACHMENT.getType(), task.getId(), task.getProcessInstanceId(),  
842 - FileUtil.getName(URLUtil.getPath(attachment)), null, attachment);  
843 - }); 838 + reqVO.getAttachments().forEach(attachment -> taskService.createAttachment(BpmAttachmentTypeEnum.TASK_ATTACHMENT.getType(),
  839 + task.getId(), task.getProcessInstanceId(), FileUtil.getName(URLUtil.getPath(attachment)), null, attachment));
844 } 840 }
845 841
846 // 2.4 如果当前任务时被加签的,则加它的根任务也标记成未通过 842 // 2.4 如果当前任务时被加签的,则加它的根任务也标记成未通过