From 4cb8a414766635bfe4591ac2756b146cfdc6eda3 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Tue, 11 Feb 2025 10:12:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue | 2 +- yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue index 69c90b8752..de13c1712d 100644 --- a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue +++ b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue @@ -33,7 +33,7 @@ - + diff --git a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue index 467a7bf81c..b63da66b25 100644 --- a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue +++ b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue @@ -32,7 +32,7 @@ - + From 75ff358d6d41bbc31061abc51b9ebc5ead99c8ad Mon Sep 17 00:00:00 2001 From: dimengzhe Date: Tue, 11 Feb 2025 10:32:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flowable/biz/flowtask/FlowTaskService.java | 17 ++++++++++------- .../yxt/anrui/portal/biz/flow/FlowableRest.java | 5 +++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java index cf22c64048..bd7b1cee9e 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java @@ -330,10 +330,12 @@ public class FlowTaskService extends MybatisBaseService 转换为以逗号分隔的字符串 String assigneeIdsStr = String.join(",", assigneeIds); - - // 远程调用批量查询用户信息 - Map userMap = sysUserFeign.fetchBySids(assigneeIdsStr).getData().stream() - .collect(Collectors.toMap(SysUserVo::getSid, user -> user)); + Map userMap = new HashMap<>(); + if(StringUtils.isNotBlank(assigneeIdsStr)){ + // 远程调用批量查询用户信息 + userMap = sysUserFeign.fetchBySids(assigneeIdsStr).getData().stream() + .collect(Collectors.toMap(SysUserVo::getSid, user -> user)); + } // 直接查询所有流程实例评论 List commentList = taskService.getProcessInstanceComments(procInsId); @@ -345,6 +347,7 @@ public class FlowTaskService extends MybatisBaseService finalHisFlowList = Collections.synchronizedList(hisFlowList); // 使用 parallelStream 前先进行 null 检查和过滤 + Map finalUserMap = userMap; hisFlowList = list.parallelStream() .filter(histIns -> histIns != null && histIns.getTaskId() != null) // 过滤掉 histIns 或 histIns.getTaskId() 为 null 的元素 .map(histIns -> { @@ -366,8 +369,8 @@ public class FlowTaskService extends MybatisBaseService> flowRecordAndComment(String procInsId, String deployId) { + long startTimes = System.currentTimeMillis(); // 记录开始时间 // 并行调用外部服务 CompletableFuture> flowRecordFuture = CompletableFuture.supplyAsync(() -> flowableService.flowRecord(procInsId, deployId)); @@ -266,6 +269,8 @@ public class FlowableRest implements FlowableFeign { // 返回结果 ResultBean> resultBean = new ResultBean>().success(); resultBean.setData(flowList); + long endTime = System.currentTimeMillis(); + log.info("流程记录接口耗时 {} ms", endTime - startTimes); return resultBean; }