This commit is contained in:
2026-09-20 18:34:40 +08:00
parent 8cf9140f56
commit 780cd56ffe
6 changed files with 88 additions and 37 deletions
@@ -168,9 +168,9 @@ public class BusinessProcessServiceImpl extends ServiceImpl<BusinessProcessMappe
businessProcess.setProcessInstanceId(processInstanceId);
businessProcess.setApproveStatus(ApproveStatusEnum.APPROVING.getValue());
this.saveOrUpdate(businessProcess);
List<?> currentNodes = this.getCurrentNodes(processInstanceId, loginName);
this.syncCustomerArchiveCurrentNode(param.getFormInstanceId(), currentNodes);
this.getProcessInfo(processInstanceId, loginName);
this.getCurrentNodes(processInstanceId, loginName);
Object processInfo = this.getProcessInfo(processInstanceId, loginName);
this.syncCustomerArchiveFromProcessInfo(param.getFormInstanceId(), processInfo);
return processInstanceId;
}
@@ -226,9 +226,9 @@ public class BusinessProcessServiceImpl extends ServiceImpl<BusinessProcessMappe
}
}
private void syncCustomerArchiveCurrentNode(String formInstanceId, List<?> currentNodes) {
if (StringUtils.isBlank(formInstanceId) || CollectionUtil.isEmpty(currentNodes)) {
log.warn("同步客商当前节点跳过,formInstanceId或节点详情为空 formInstanceId={}", formInstanceId);
private void syncCustomerArchiveFromProcessInfo(String formInstanceId, Object processInfo) {
if (StringUtils.isBlank(formInstanceId) || processInfo == null) {
log.warn("同步客商当前节点跳过,formInstanceId或流程实例详情为空 formInstanceId={}", formInstanceId);
return;
}
Long customerId;
@@ -238,32 +238,15 @@ public class BusinessProcessServiceImpl extends ServiceImpl<BusinessProcessMappe
log.warn("同步客商当前节点失败,表单实例id不是数字:{}", formInstanceId);
return;
}
String currentNode = currentNodes.stream()
.map(this::readMkNodeName)
.filter(StringUtils::isNotBlank)
.distinct()
.collect(Collectors.joining(","));
String currentProcessor = currentNodes.stream()
.flatMap(this::readMkHandlerNames)
.filter(StringUtils::isNotBlank)
.distinct()
.collect(Collectors.joining(","));
if (StringUtils.isBlank(currentNode) && StringUtils.isBlank(currentProcessor)) {
log.warn("同步客商当前节点跳过,未解析到节点名称或处理人 customerId={}", customerId);
return;
}
CustomerProcessNodeSyncDTO param = new CustomerProcessNodeSyncDTO();
param.setId(customerId);
param.setCurrentNode(currentNode);
param.setCurrentProcessor(currentProcessor);
param.setProcessInfo(processInfo);
param.setApprovalStatus("reviewing");
try {
FR<Boolean> result = customerArchiveClient.syncProcessNode(param);
log.info("同步客商当前节点完成 customerId={} currentNode={} currentProcessor={} result={}",
customerId, currentNode, currentProcessor, JSON.toJSONString(result));
log.info("同步客商当前节点完成 customerId={} result={}", customerId, JSON.toJSONString(result));
} catch (Exception e) {
log.error("同步客商当前节点异常 customerId={} currentNode={} currentProcessor={}",
customerId, currentNode, currentProcessor, e);
log.error("同步客商当前节点异常 customerId={}", customerId, e);
}
}