File tree Expand file tree Collapse file tree 4 files changed +53
-10
lines changed
jane/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/service/impl
waterflow/java/waterflow-service/src/main/java/modelengine/fit/waterflow
domain/flows/context/repo/flowcontext Expand file tree Collapse file tree 4 files changed +53
-10
lines changed Original file line number Diff line number Diff line change 1212import static modelengine .fit .jober .aipp .constants .AippConst .BUSINESS_INFOS_KEY ;
1313import static modelengine .fit .jober .aipp .constants .AippConst .BUSINESS_INPUT_KEY ;
1414import static modelengine .fit .jober .aipp .enums .AppTypeEnum .APP ;
15- import static modelengine .fit .jober .aipp .service .impl .AippRunTimeServiceImpl .getMetaByAppId ;
1615
1716import modelengine .fit .jade .waterflow .FlowsService ;
1817import modelengine .fit .jane .common .entity .OperationContext ;
4140import modelengine .fit .jober .aipp .service .AippLogService ;
4241import modelengine .fit .jober .aipp .service .AippRunTimeService ;
4342import modelengine .fit .jober .aipp .service .AppChatService ;
44- import modelengine .fit .jober .aipp .util .*;
43+ import modelengine .fit .jober .aipp .util .AippLogUtils ;
44+ import modelengine .fit .jober .aipp .util .AppUtils ;
45+ import modelengine .fit .jober .aipp .util .CacheUtils ;
46+ import modelengine .fit .jober .aipp .util .FlowUtils ;
47+ import modelengine .fit .jober .aipp .util .JsonUtils ;
48+ import modelengine .fit .jober .aipp .util .UUIDUtil ;
4549import modelengine .fit .jober .common .ServerInternalException ;
4650import modelengine .fitframework .annotation .Component ;
4751import modelengine .fitframework .annotation .Value ;
Original file line number Diff line number Diff line change 1+ /*---------------------------------------------------------------------------------------------
2+ * Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
3+ * This file is a part of the ModelEngine Project.
4+ * Licensed under the MIT License. See License.txt in the project root for license information.
5+ *--------------------------------------------------------------------------------------------*/
6+
7+ package modelengine .fit .waterflow .common .utils ;
8+
9+ import java .util .UUID ;
10+ import java .util .concurrent .ThreadLocalRandom ;
11+
12+ /**
13+ * Uuid的Utils类。
14+ *
15+ * @author 孙怡菲
16+ * @since 1.0
17+ */
18+ public class UUIDUtil {
19+ /**
20+ * 随机生成uuid。
21+ *
22+ * @return 随机生成的uuid的 {@link String}。
23+ */
24+ public static String uuid () {
25+ return UUID .randomUUID ().toString ().replace ("-" , "" );
26+ }
27+
28+ /**
29+ * 使用线程本地随机数生成UUID。
30+ * 生成的 UUID 在唯一性和不可预测性上可能不如 UUID.randomUUID(),但在性能上有显著提升
31+ *
32+ * @return 生成的UUID。
33+ */
34+ public static String fastUuid () {
35+ long mostSigBits = ThreadLocalRandom .current ().nextLong ();
36+ long leastSigBits = ThreadLocalRandom .current ().nextLong ();
37+
38+ // 设置版本4和变体IETF
39+ mostSigBits &= 0xffffffffffff0fffL ;
40+ mostSigBits |= 0x0000000000004000L ;
41+ leastSigBits &= 0x3fffffffffffffffL ;
42+ leastSigBits |= 0x8000000000000000L ;
43+
44+ return new UUID (mostSigBits , leastSigBits ).toString ().replace ("-" , "" );
45+ }
46+ }
Original file line number Diff line number Diff line change @@ -169,24 +169,17 @@ public void save(List<FlowContext<FlowData>> flowContexts) {
169169 if (flowContexts == null || flowContexts .size () == 0 ) {
170170 return ;
171171 }
172- log .warn ("save before after" );
173172 FlowContextPO flowContextPO = contextMapper .find (flowContexts .get (0 ).getId ());
174- log .warn ("save find after" );
175173 List <FlowContextPO > flowContextPOS = flowContexts .stream ().map (this ::serializer ).collect (Collectors .toList ());
176- log .warn ("save after serializer" );
177174 if (flowContextPO == null ) {
178175 contextMapper .batchCreate (flowContextPOS );
179- log .warn ("save after batchCreate" );
180176 } else {
181177 batchUpdate (flowContextPOS );
182- log .warn ("save after batchUpdate" );
183178 }
184179 }
185180
186181 private void batchUpdate (List <FlowContextPO > flowContextPOS ) {
187- log .warn ("batchUpdate before" );
188182 contextMapper .batchUpdate (flowContextPOS );
189- log .warn ("batchUpdate after" );
190183 }
191184
192185 @ Override
Original file line number Diff line number Diff line change 1616import modelengine .fit .ohscript .script .interpreter .ASTEnv ;
1717import modelengine .fit .ohscript .script .parser .AST ;
1818import modelengine .fit .ohscript .script .parser .ParserBuilder ;
19- import modelengine .fit .ohscript .util .UUIDUtil ;
2019import modelengine .fit .waterflow .common .Constant ;
20+ import modelengine .fit .waterflow .common .utils .UUIDUtil ;
2121import modelengine .fit .waterflow .flowsengine .domain .flows .context .FlowData ;
2222import modelengine .fitframework .log .Logger ;
2323import modelengine .fitframework .util .ObjectUtils ;
You can’t perform that action at this time.
0 commit comments