Commit 5921d2fd4d8928901dfd5446a7bde864b979b244
1 parent
99b917a8
工作流 url 审批通过自带框架跳过附件更新的问题修复
Showing
1 changed file
with
19 additions
and
18 deletions
urbanops-module-bpm/src/main/java/com/zteits/urbanops/module/bpm/service/task/BpmTaskServiceImpl.java
| @@ -927,6 +927,25 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -927,6 +927,25 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 927 | * @param reqVO 前端参数封装 | 927 | * @param reqVO 前端参数封装 |
| 928 | */ | 928 | */ |
| 929 | public void returnTask(Long userId, BpmnModel bpmnModel, Task currentTask, FlowElement targetElement, BpmTaskReturnReqVO reqVO) { | 929 | public void returnTask(Long userId, BpmnModel bpmnModel, Task currentTask, FlowElement targetElement, BpmTaskReturnReqVO reqVO) { |
| 930 | + | ||
| 931 | + /** | ||
| 932 | + * add by yanhuiqing 审批附件 begin | ||
| 933 | + */ | ||
| 934 | + List<String> urlList = reqVO.getAttattmentUrls(); | ||
| 935 | + if(CollUtil.isNotEmpty(urlList)){ | ||
| 936 | + String targetUrls = CollUtil.isEmpty(urlList)?StrUtil.EMPTY:urlList.stream() | ||
| 937 | + .filter(StrUtil::isNotEmpty) | ||
| 938 | + .distinct() | ||
| 939 | + .collect(Collectors.joining(",")); | ||
| 940 | + String attachmentName = "审批附件-" + BpmCommentTypeEnum.RETURN.getType(); | ||
| 941 | + String attachmentType = "URL"; // 附件类型标记为URL(可自定义) | ||
| 942 | + String description = BpmCommentTypeEnum.RETURN.getName()+"的附件"; | ||
| 943 | + taskService.createAttachment(attachmentType,currentTask.getId(),currentTask.getProcessInstanceId(),attachmentName,description,targetUrls); | ||
| 944 | + } | ||
| 945 | + /** | ||
| 946 | + * add by yanhuiqing 审批附件 end | ||
| 947 | + */ | ||
| 948 | + | ||
| 930 | // 1. 获得所有需要回撤的任务 taskDefinitionKey,用于稍后的 moveActivityIdsToSingleActivityId 回撤 | 949 | // 1. 获得所有需要回撤的任务 taskDefinitionKey,用于稍后的 moveActivityIdsToSingleActivityId 回撤 |
| 931 | // 1.1 获取所有正常进行的任务节点 Key | 950 | // 1.1 获取所有正常进行的任务节点 Key |
| 932 | List<Task> taskList = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).list(); | 951 | List<Task> taskList = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).list(); |
| @@ -952,24 +971,6 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -952,24 +971,6 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 952 | // 2.1.1 添加评论 | 971 | // 2.1.1 添加评论 |
| 953 | taskService.addComment(task.getId(), currentTask.getProcessInstanceId(), BpmCommentTypeEnum.RETURN.getType(), | 972 | taskService.addComment(task.getId(), currentTask.getProcessInstanceId(), BpmCommentTypeEnum.RETURN.getType(), |
| 954 | BpmCommentTypeEnum.RETURN.formatComment(reqVO.getReason())); | 973 | BpmCommentTypeEnum.RETURN.formatComment(reqVO.getReason())); |
| 955 | - /** | ||
| 956 | - * add by yanhuiqing 审批附件 begin | ||
| 957 | - */ | ||
| 958 | - List<String> urlList = reqVO.getAttattmentUrls(); | ||
| 959 | - if(ObjectUtils.isNotAllEmpty()){ | ||
| 960 | - String targetUrls = CollUtil.isEmpty(urlList)?StrUtil.EMPTY:urlList.stream() | ||
| 961 | - .filter(StrUtil::isNotEmpty) | ||
| 962 | - .distinct() | ||
| 963 | - .collect(Collectors.joining(",")); | ||
| 964 | - String attachmentName = "审批附件-" + BpmCommentTypeEnum.RETURN.getType(); | ||
| 965 | - String attachmentType = "URL"; // 附件类型标记为URL(可自定义) | ||
| 966 | - String description = BpmCommentTypeEnum.RETURN.getName()+"的附件"; | ||
| 967 | - taskService.createAttachment(attachmentType,task.getId(),task.getProcessInstanceId(),attachmentName,description,targetUrls); | ||
| 968 | - } | ||
| 969 | - /** | ||
| 970 | - * add by yanhuiqing 审批附件 end | ||
| 971 | - */ | ||
| 972 | - | ||
| 973 | // 2.1.2 更新 task 状态 + 原因 | 974 | // 2.1.2 更新 task 状态 + 原因 |
| 974 | updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.RETURN.getStatus(), reqVO.getReason()); | 975 | updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.RETURN.getStatus(), reqVO.getReason()); |
| 975 | } else { // 情况二:别人的任务,进行 CANCEL 标记 | 976 | } else { // 情况二:别人的任务,进行 CANCEL 标记 |