update 优化 调整变量修改

This commit is contained in:
疯狂的狮子Li
2025-08-04 16:11:57 +08:00
parent 986082eef3
commit a0519521a5

View File

@@ -424,6 +424,10 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
}
try {
Map<String, Object> variableMap = new HashMap<>(Optional.ofNullable(flowInstance.getVariableMap()).orElse(Collections.emptyMap()));
if (!variableMap.containsKey(bo.getKey())) {
log.error("变量不存在: {}", bo.getKey());
return false;
}
variableMap.put(bo.getKey(), bo.getValue());
flowInstance.setVariable(FlowEngine.jsonConvert.objToStr(variableMap));
flowInstanceMapper.updateById(flowInstance);