2025-07-26 10:05:43 +08:00
|
|
|
using DMS.Core.Models;
|
2025-09-04 13:40:07 +08:00
|
|
|
using DMS.Application.Interfaces;
|
|
|
|
|
using DMS.Application.Models;
|
2025-07-16 15:08:56 +08:00
|
|
|
|
2025-09-04 13:40:07 +08:00
|
|
|
namespace DMS.Application.Services.Processors;
|
2025-07-16 15:08:56 +08:00
|
|
|
|
2025-07-17 20:13:21 +08:00
|
|
|
public class CheckValueChangedProcessor : IVariableProcessor
|
2025-07-16 15:08:56 +08:00
|
|
|
{
|
|
|
|
|
|
2025-10-02 17:35:35 +08:00
|
|
|
|
2025-07-17 20:13:21 +08:00
|
|
|
public Task ProcessAsync(VariableContext context)
|
2025-07-16 15:08:56 +08:00
|
|
|
{
|
2025-09-04 13:40:07 +08:00
|
|
|
// Variable newVariable = context.Data;
|
2025-07-26 10:05:43 +08:00
|
|
|
// if (!_dataServices.AllVariables.TryGetValue(newVariable.Id, out Variable oldVariable))
|
|
|
|
|
// {
|
|
|
|
|
// NlogHelper.Warn($"检查变量值是否改变时在_dataServices.AllVariables中找不到Id:{newVariable.Id},Name:{newVariable.Name}的变量。");
|
|
|
|
|
// context.IsHandled = true;
|
|
|
|
|
// return Task.CompletedTask;
|
|
|
|
|
// }
|
2025-07-16 15:08:56 +08:00
|
|
|
|
2025-07-26 10:05:43 +08:00
|
|
|
// if (newVariable.DataValue == oldVariable.DataValue)
|
|
|
|
|
// {
|
|
|
|
|
// // 值没有变化,直接完成
|
|
|
|
|
// context.IsHandled = true;
|
|
|
|
|
// }
|
|
|
|
|
//
|
2025-07-16 15:08:56 +08:00
|
|
|
// 在这里处理 context.Data
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|