提交 ac3cfc3f 编写于 作者: W wq1234wq

处理回放失败

上级 c84b4e07
......@@ -1119,11 +1119,16 @@ namespace IoTSharp.Controllers
{
await Task.Run(() =>
{
var operevent =
_context.BaseEvents.SingleOrDefault(
c => c.EventId == result.FirstOrDefault().BaseEvent.EventId);
var list = result.Select(c => new FlowOperation
{
AddDate = c.AddDate,
BizId = c.BizId,
Data = c.Data,
Data = c.Data, BaseEvent = operevent,
Flow = flows.SingleOrDefault(x=>x.FlowId==c.Flow.FlowId
),
FlowRule = flowRule,
......
......@@ -90,10 +90,12 @@ namespace IoTSharp.FlowRuleEngine
{
using (var context = sp.ServiceProvider.GetRequiredService<ApplicationDbContext>())
{
var r = context.FlowRules.FirstOrDefault(c => c.RuleId == rule.RuleId);
var r = context.FlowRules.Include(c=>c.Customer).Include(c=>c.Tenant).FirstOrDefault(c => c.RuleId == rule.RuleId);
if (r != null)
{
@event.FlowRule = r;
@event.Tenant = r.Tenant;
@event.Customer = r.Customer;
context.BaseEvents.Add(@event);
context.SaveChanges();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册