From 1519a7c81e6566dd0cbc6acfb1b5e92c3aaba7df Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期日, 02 三月 2025 10:53:57 +0800
Subject: [PATCH] 赋码定时任务只判断超时,且用红码时间判断

---
 business/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/business/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java b/business/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java
index d638720..ed9e5f5 100644
--- a/business/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java
@@ -74,6 +74,7 @@
 
 import java.io.InputStream;
 import java.lang.reflect.Field;
+import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
@@ -160,7 +161,14 @@
                 newV.put(task.getTaskDefinitionKey() + "&" + key, variables.get(key));
                 //瀛楀吀閲屾湁灏辨斁鍏ユ祦绋嬪彉閲忎腑
                 if (!CollectionUtils.isEmpty(dictList) && dictList.contains(key)) {
-                    processVariables.put(key,variables.get(key));
+                    if ("money".equals(key)) {
+                        // 涓囧厓杞厓
+                        Object w = variables.get(key);
+                        BigDecimal y = new BigDecimal(w.toString()).multiply(new BigDecimal(10000));
+                        processVariables.put(key, y);
+                    } else {
+                        processVariables.put(key,variables.get(key));
+                    }
                 }
             }
         }
@@ -1183,8 +1191,9 @@
                     .list();
 
             //鎵╁睍 鑾峰彇杩欎釜娴佺▼瀹炰緥鐨勭洃鎺т俊鎭� key:TaskId value:瀹炰綋绫�
-            Map<String, ProcessCoding> processCodingMap = processCodingMapper
-                    .selectList(new QueryWrapper<ProcessCoding>().eq("process_ins_id", procInsId))
+            Map<String, ProcessCoding> processCodingMap = new LambdaQueryChainWrapper<>(processCodingMapper)
+                    .eq(ProcessCoding::getProcessInsId, procInsId)
+                    .list()
                     .stream()
                     .collect(Collectors.toMap(ProcessCoding::getTaskId, Function.identity()));
             // 淇濆瓨宸茬粡瀹屾垚鐨勬祦绋嬭妭鐐圭紪鍙�
@@ -1264,13 +1273,14 @@
         // 鍒ゆ柇鍓嶇疆浠诲姟鏄笉鏄拰褰撳墠浠诲姟涓哄悓涓�涓猠xecuteId
         // 鍒ゆ柇褰撳墠浠诲姟鏄惁琚寕璧蜂腑
         String finalProcessInsId = processInsId;
-        beforeNodes.stream().filter(node -> {
+        beforeNodes = beforeNodes.stream().filter(node -> {
             if (node.getCurrent()) {
                 return Boolean.TRUE;
             }
             HistoricTaskInstance beforeTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(finalProcessInsId).finished().taskDefinitionKey(node.getBeforeNodeDefId()).singleResult();
             return Objects.nonNull(beforeTask);
-        }).forEach(node -> {
+        }).collect(Collectors.toList());
+        beforeNodes.forEach(node -> {
             if (node.getCurrent()) {
                 if (processLogService.taskIsHangup(taskId, finalProcessInsId)) {
                     node.setTaskStatus(TaskStatusEnum.HANGUP);

--
Gitblit v1.8.0