diff --git a/src/main/java/com/wflow/workflow/service/impl/ProcessTaskServiceImpl.java b/src/main/java/com/wflow/workflow/service/impl/ProcessTaskServiceImpl.java index 31325fb..9fb59ad 100644 --- a/src/main/java/com/wflow/workflow/service/impl/ProcessTaskServiceImpl.java +++ b/src/main/java/com/wflow/workflow/service/impl/ProcessTaskServiceImpl.java @@ -36,7 +36,6 @@ import com.wflow.workflow.config.WflowGlobalVarDef; import com.wflow.workflow.extension.cmd.RecallToHisApprovalNodeCmd; import com.wflow.workflow.service.*; import com.wflow.workflow.utils.FlowableUtils; -import com.zhgd.xmgl.security.SecurityUtil; import com.zhgd.xmgl.security.util.SecurityUtils; import com.zhgd.xmgl.tenant.TenantContextHolder; import lombok.extern.slf4j.Slf4j; @@ -63,7 +62,6 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.time.Instant; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -75,9 +73,6 @@ import java.util.stream.Collectors; @Slf4j @Service("processTaskService") public class ProcessTaskServiceImpl implements ProcessTaskService { - @Autowired - private WflowCcmeReadMapper ccmeReadMapper; - //超时缓存,数据缓存20秒,用来存储审批人防止flowable高频调用 private static final TimedCache> taskCache = CacheUtil.newTimedCache(20000); //用来存储正在处理的节点,防止并发处理 @@ -87,6 +82,8 @@ public class ProcessTaskServiceImpl implements ProcessTaskService { taskCache.schedulePrune(10000); } + @Autowired + private WflowCcmeReadMapper ccmeReadMapper; @Lazy @Autowired private ProcessInstanceService processService; @@ -650,7 +647,7 @@ public class ProcessTaskServiceImpl implements ProcessTaskService { refuseListPage.getRecords().forEach(o -> { o.setIsRefuse(true); }); - List ccMeInstanceList = ccMeInstance.getRecords(); + List ccMeInstanceList = ccMeInstance.getRecords().size() > 0 ? ccMeInstance.getRecords() : new ArrayList<>(); ccMeInstanceList.addAll(refuseListPage.getRecords()); List ccMeList = ccMeInstanceList.stream().map(o -> { ProcessTaskVo vo = new ProcessTaskVo(); @@ -666,7 +663,7 @@ public class ProcessTaskServiceImpl implements ProcessTaskService { o.setStatus("审批进行中"); o.setResult(ProcessResultEnum.RUNNING); }); - List allRecords = userTodoList.getRecords(); + List allRecords = userTodoList.getRecords().size() > 0 ? userTodoList.getRecords() : new ArrayList<>(); allRecords.addAll(ccMeList); allRecords.sort((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime())); Page page = new Page<>();