From a36c566ee372299b5c19c6e5c0bfc756b1c6635e Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 14 五月 2025 17:52:31 +0800
Subject: [PATCH] art: 设备管理-我的已办-查询修改

---
 lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java b/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java
index 804565c..5fd4330 100644
--- a/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java
+++ b/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java
@@ -1069,16 +1069,18 @@
             HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
                     .processInstanceId(flowTaskDto.getProcInsId())
                     .singleResult();
-            SysUser startUser = iFlowThirdService.getUserByUsername(historicProcessInstance.getStartUserId());
-            if(startUser == null) {
-                flowTaskDto.setStartUserId("");
-                flowTaskDto.setStartUserName("");
-            }else {
-                flowTaskDto.setStartUserId(startUser.getUsername());
-                flowTaskDto.setStartUserName(startUser.getRealname());
+            if(historicProcessInstance != null) {
+                SysUser startUser = iFlowThirdService.getUserByUsername(historicProcessInstance.getStartUserId());
+                if(startUser == null) {
+                    flowTaskDto.setStartUserId("");
+                    flowTaskDto.setStartUserName("");
+                }else {
+                    flowTaskDto.setStartUserId(startUser.getUsername());
+                    flowTaskDto.setStartUserName(startUser.getRealname());
+                }
+                List<String> departNamesByUsername = iFlowThirdService.getDepartNamesByUsername(historicProcessInstance.getStartUserId());
+                flowTaskDto.setStartDeptName(CollUtil.join(departNamesByUsername,"锛�"));
             }
-            List<String> departNamesByUsername = iFlowThirdService.getDepartNamesByUsername(historicProcessInstance.getStartUserId());
-            flowTaskDto.setStartDeptName(CollUtil.join(departNamesByUsername,"锛�"));
         });
         IPage<FlowTaskDto> flowTaskDtoIPage = new Page<>();
         flowTaskDtoIPage.setRecords(list);

--
Gitblit v1.9.3