|
|
@ -209,8 +209,6 @@ public class FlowRuntime
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ChildNodes.Where(x => x.Id == "end").First().Id;
|
|
|
|
return ChildNodes.Where(x => x.Id == "end").First().Id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// return ChildNodes.Where(x => x.Pid == nodeId).First().Id;
|
|
|
|
// return ChildNodes.Where(x => x.Pid == nodeId).First().Id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -233,86 +231,15 @@ public class FlowRuntime
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var conditions = conditionNodes[i].Conditions;
|
|
|
|
var nodeSection = conditionNodes[i].Conditions;
|
|
|
|
var conditionalCollections = new List<ConditionalCollections>();
|
|
|
|
var list = new List<ConditionalCollections>();
|
|
|
|
if (conditions.LogicalOperator == "and")
|
|
|
|
var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>(nodeSection.Conditions.Count);
|
|
|
|
{
|
|
|
|
|
|
|
|
var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>();
|
|
|
|
|
|
|
|
foreach (var item in conditions.Conditions)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
conditionList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
|
|
|
|
(WhereType.And,
|
|
|
|
|
|
|
|
new ConditionalModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FieldName = item.Field,
|
|
|
|
|
|
|
|
ConditionalType = GetConditionalType(item.Operator),
|
|
|
|
|
|
|
|
FieldValue = item.Value
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (conditionList.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
conditionalCollections.Add(new ConditionalCollections
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ConditionalList = conditionList
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var groupList = new List<KeyValuePair<WhereType, ConditionalModel>>();
|
|
|
|
var whereType = Enum.Parse<WhereType>(nodeSection.LogicalOperator, true);
|
|
|
|
foreach (var group in conditions.Groups)
|
|
|
|
foreach (var item in nodeSection.Conditions)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (group.LogicalOperator == "and")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item1 in group.Conditions)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
|
|
|
|
(WhereType.And,
|
|
|
|
|
|
|
|
new ConditionalModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FieldName = item1.Field,
|
|
|
|
|
|
|
|
ConditionalType = GetConditionalType(item1.Operator),
|
|
|
|
|
|
|
|
FieldValue = item1.Value
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item1 in group.Conditions)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
|
|
|
|
(WhereType.Or,
|
|
|
|
|
|
|
|
new ConditionalModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FieldName = item1.Field,
|
|
|
|
|
|
|
|
ConditionalType = GetConditionalType(item1.Operator),
|
|
|
|
|
|
|
|
FieldValue = item1.Value
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (groupList.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
conditionalCollections.Add(new ConditionalCollections
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ConditionalList = groupList
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>();
|
|
|
|
|
|
|
|
foreach (var item in conditions.Conditions)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
conditionList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
conditionList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
(WhereType.Or,
|
|
|
|
(whereType,
|
|
|
|
new ConditionalModel
|
|
|
|
new ConditionalModel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FieldName = item.Field,
|
|
|
|
FieldName = item.Field,
|
|
|
@ -324,23 +251,21 @@ public class FlowRuntime
|
|
|
|
|
|
|
|
|
|
|
|
if (conditionList.Count > 0)
|
|
|
|
if (conditionList.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
conditionalCollections.Add(new ConditionalCollections
|
|
|
|
list.Add(new ConditionalCollections
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ConditionalList = conditionList
|
|
|
|
ConditionalList = conditionList
|
|
|
|
}
|
|
|
|
});
|
|
|
|
)
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var groupList = new List<KeyValuePair<WhereType, ConditionalModel>>();
|
|
|
|
var groupList = new List<KeyValuePair<WhereType, ConditionalModel>>();
|
|
|
|
foreach (var group in conditions.Groups)
|
|
|
|
foreach (var group in nodeSection.Groups)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (group.LogicalOperator == "and")
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var item1 in group.Conditions)
|
|
|
|
WhereType whereType2 = Enum.Parse<WhereType>(group.LogicalOperator, true);
|
|
|
|
|
|
|
|
for (int j = 0; j < group.Conditions.Count; j++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var item1 = group.Conditions[j];
|
|
|
|
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
(WhereType.And,
|
|
|
|
(j == 0 ? whereType : whereType2,
|
|
|
|
new ConditionalModel
|
|
|
|
new ConditionalModel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FieldName = item1.Field,
|
|
|
|
FieldName = item1.Field,
|
|
|
@ -350,38 +275,22 @@ public class FlowRuntime
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item1 in group.Conditions)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
|
|
|
|
|
|
|
|
(WhereType.Or,
|
|
|
|
|
|
|
|
new ConditionalModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FieldName = item1.Field,
|
|
|
|
|
|
|
|
ConditionalType = GetConditionalType(item1.Operator),
|
|
|
|
|
|
|
|
FieldValue = item1.Value
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (groupList.Count > 0)
|
|
|
|
if (groupList.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
conditionalCollections.Add(new ConditionalCollections
|
|
|
|
list.Add(new ConditionalCollections
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ConditionalList = groupList
|
|
|
|
ConditionalList = groupList
|
|
|
|
}
|
|
|
|
});
|
|
|
|
)
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var conditionalModels = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(JsonConvert.SerializeObject(conditionalCollections));
|
|
|
|
if (list.Count == 0) //跳过默认条件
|
|
|
|
if (conditionalModels.Count == 0) //跳过默认条件
|
|
|
|
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//string json = JsonConvert.SerializeObject(list);
|
|
|
|
|
|
|
|
//db.Utilities.JsonToConditionalModels(json);
|
|
|
|
|
|
|
|
List<IConditionalModel> conditionalModels = [.. list];
|
|
|
|
|
|
|
|
|
|
|
|
ISqlSugarClient sugarClient = tenantDb ?? db;
|
|
|
|
ISqlSugarClient sugarClient = tenantDb ?? db;
|
|
|
|
var exists = sugarClient.Queryable<object>().AS(ColumnView).Where("Id=@Id", new { Id = BusinessId }).Where(conditionalModels).Any();
|
|
|
|
var exists = sugarClient.Queryable<object>().AS(ColumnView).Where("Id=@Id", new { Id = BusinessId }).Where(conditionalModels).Any();
|
|
|
|
if (exists)
|
|
|
|
if (exists)
|
|
|
|