Merge branch 'feature/REQ-5965' into dev

This commit is contained in:
wangli 2025-11-10 16:47:26 +08:00
commit 34d0ff8ffc

View File

@ -1922,8 +1922,9 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
} else { } else {
tenantId = docs.get(0).getTenantId(); tenantId = docs.get(0).getTenantId();
} }
List<CustomDocDTO> bizCustomDocs = Optional.ofNullable( HistoricVariableInstance historicVariableInstance = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId)
runtimeService.getVariable(processInstanceId, SIGN_BIZ_CUSTOM_DOCS, List.class)) .variableName(SIGN_BIZ_CUSTOM_DOCS).singleResult();
List<CustomDocDTO> bizCustomDocs = Optional.ofNullable((List<CustomDocDTO>) historicVariableInstance.getValue())
.orElse(Collections.emptyList()); .orElse(Collections.emptyList());
// 业务自定义文档 // 业务自定义文档
@ -1936,7 +1937,8 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
t.setFileRelationId(s.getFileKey()); t.setFileRelationId(s.getFileKey());
}); });
List<String> basedFileTagOrder = runtimeService.getVariable(processInstanceId, SIGN_BIZ_BASED_FILE_TAG_ORDER, List.class); HistoricVariableInstance signBizOrder = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).variableName(SIGN_BIZ_BASED_FILE_TAG_ORDER).singleResult();
List<String> basedFileTagOrder = Optional.ofNullable((List<String>) signBizOrder.getValue()).orElse(Collections.emptyList());
if (!CollectionUtils.isEmpty(basedFileTagOrder)) { if (!CollectionUtils.isEmpty(basedFileTagOrder)) {
docs.addAll(customBizDocs); docs.addAll(customBizDocs);
// 基于 fileTag 排序 // 基于 fileTag 排序
@ -1948,7 +1950,8 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
docs = docs.stream().sorted(Comparator.comparingInt(d -> fileTagOrderMap.getOrDefault(d.getTag(), Integer.MAX_VALUE))) docs = docs.stream().sorted(Comparator.comparingInt(d -> fileTagOrderMap.getOrDefault(d.getTag(), Integer.MAX_VALUE)))
.collect(Collectors.toList()); .collect(Collectors.toList());
} else { } else {
String customAddType = runtimeService.getVariable(processInstanceId, SIGN_BIZ_CUSTOM_DOC_ADD_ORDER_TYPE, String.class); HistoricVariableInstance bizDocOrderType = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).variableName(SIGN_BIZ_CUSTOM_DOC_ADD_ORDER_TYPE).singleResult();
String customAddType = String.valueOf(bizDocOrderType.getValue());
if ("last".equals(customAddType)) { if ("last".equals(customAddType)) {
docs.addAll(customBizDocs); docs.addAll(customBizDocs);
} else { } else {