| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using SHJX.Service.Dao;
- using System.Reflection;
- using WorkflowCore.Interface;
- using SHJX.Service.Model.Dao;
- using System.Collections.Generic;
- using SHJX.Service.Common.ReadXML;
- using SHJX.Service.Control.Interface;
- using SHJX.Service.Common.Logging;
- using Microsoft.Extensions.Logging;
- namespace SHJX.Service.Control
- {
- public class FlowContent
- {
- private static readonly ILogger logger = LogFactory.BuildLogger(typeof(FlowContent));
- protected ServiceDataManager DataManager;
- private readonly Dictionary<string, TaskFlowImp> _res;
- private readonly IWorkflowHost host;
- public FlowContent( ReadConfigUtil config)
- {
- try
- {
-
- _res = new Dictionary<string, TaskFlowImp>();
- var proxys = config.GetResponsibility;
- foreach (var item in proxys)
- {
- if (Assembly.GetExecutingAssembly().CreateInstance(item.Flow) is not TaskFlowImp operate) continue;
- operate.ProxyName = item.Name;
- _res.Add(item.Name, operate);
- }
- _res["CC"].SetNextFlow(_res["Ca"]).SetNextFlow(_res["DAL"])
- .SetNextFlow(_res["DAW"]).SetNextFlow(_res["DM"]).SetNextFlow(_res["DC"])
- .SetNextFlow(_res["LH"]).SetNextFlow(_res["LS"]).SetNextFlow(_res["Mani"])
- .SetNextFlow(_res["MTM"]).SetNextFlow(_res["MXM"]).SetNextFlow(_res["MYM"])
- .SetNextFlow(_res["MZM"]).SetNextFlow(_res["SAL1"]).SetNextFlow(_res["SAL2"])
- .SetNextFlow(_res["TAL1"]).SetNextFlow(_res["TAL2"]).SetNextFlow(_res["SC"]);
- }
- catch (Exception ex)
- {
- logger.LogError(ex.ToString());
- }
- }
- public void OperateControllerContent(EquipmentTask task)
- {
- try
- {
- var data = task.GetDataArgs();
- _res["CC"].OperateHandle(data);
- }
- catch (Exception ex)
- {
- logger.LogError(ex.ToString());
- }
- }
- }
- }
|