From a22c582a4867ee5a3f27e89da7d20fa52008b32c Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 26 二月 2025 10:19:39 +0800
Subject: [PATCH] 前置任务节点查出来未走的节点bug
---
business/src/main/java/com/ycl/task/FlowableTask.java | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/business/src/main/java/com/ycl/task/FlowableTask.java b/business/src/main/java/com/ycl/task/FlowableTask.java
index e5cefa7..37bc466 100644
--- a/business/src/main/java/com/ycl/task/FlowableTask.java
+++ b/business/src/main/java/com/ycl/task/FlowableTask.java
@@ -9,6 +9,7 @@
import com.ycl.domain.entity.ProjectProcess;
import com.ycl.factory.FlowServiceFactory;
import com.ycl.mapper.ProcessCodingMapper;
+import com.ycl.mapper.ProcessLogMapper;
import com.ycl.mapper.ProjectInfoMapper;
import com.ycl.mapper.ProjectProcessMapper;
import com.ycl.service.ProcessCodingService;
@@ -41,6 +42,9 @@
private ProcessCodingMapper processCodingMapper;
@Autowired
private ProcessLogService processLogService;
+ @Autowired
+ private ProcessLogMapper processLogMapper;
+
/**
* 璧嬬爜浠诲姟
* 涓や釜閫昏緫 鏀归」鐩爜銆佹敼鑺傜偣棰滆壊
@@ -50,6 +54,11 @@
//褰撳墠姝e湪杩愯鐨勬墍鏈変换鍔¤妭鐐�
List<Task> taskList = taskService.createTaskQuery().active().list();
if (CollectionUtils.isEmpty(taskList)) return;
+ //鎺掗櫎鎺夎妭鐐规寕璧风殑浠诲姟
+ List<String> allHangupTask = processLogMapper.getAllHangup();
+ taskList = taskList.stream()
+ .filter(task -> !allHangupTask.contains(task.getId()))
+ .collect(Collectors.toList());
//TODO锛氱瓫閫夊嚭娴佺▼瀹炰緥id锛岀敤浣滈」鐩寕璧�
Set<String> proInsIds = taskList.stream()
.map(TaskInfo::getProcessInstanceId)
@@ -103,17 +112,16 @@
durationTime = subNodeHangupTime(hangupLogMap, task, durationTime);
String status = GREEN; // 榛樿鐘舵�佷负缁胯壊
- if (redTime != null && redTime !=0 && durationTime >= redTime) {
+ if (redTime != null && redTime != 0 && durationTime >= redTime) {
status = RED; // 濡傛灉瓒呰繃绾㈣壊鏃堕棿闃堝�硷紝鍒欑姸鎬佷负绾㈣壊
- } else if (yellowTime != null && yellowTime !=0 && durationTime >= yellowTime) {
+ } else if (yellowTime != null && yellowTime != 0 && durationTime >= yellowTime) {
status = YELLOW; // 鍚﹀垯锛屽鏋滆秴杩囬粍鑹叉椂闂撮槇鍊硷紝鍒欑姸鎬佷负榛勮壊
}
//澶勭悊鍔炵悊鏈熼檺
String overtimeStatus = NORMAL;
- if (overtime != null && overtime !=0 && durationTime >= overtime) {
+ if (overtime != null && overtime != 0 && durationTime >= overtime) {
overtimeStatus = OVERTIME; // 濡傛灉瓒呰繃鍔炵悊鏈熼檺
- }
- else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) {
+ } else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) {
overtimeStatus = WILLOVERTIME; // 濡傛灉涓存湡(鍥哄畾瓒呮椂鍓�12灏忔椂涓轰复鏈�)
}
// else if (overtime != null && overtime != 0 && durationDay >= (overtime - 60)) {
@@ -122,9 +130,10 @@
map.get(status).add(task.getProcessInstanceId());
processCoding.setStatus(status);
processCoding.setOvertimeStatus(overtimeStatus);
+ processCoding.setStartTaskTime(task.getCreateTime());
list.add(processCoding);
} catch (Exception e) {
- log.error(e.getMessage(),"璧嬬爜鏃堕棿鏍煎紡鏈夎");
+ log.error(e.getMessage(), "璧嬬爜鏃堕棿鏍煎紡鏈夎");
}
}
//鏇存柊椤圭洰鐮�
--
Gitblit v1.8.0