| | |
| | | using CMS.Plugin.ProductManagement.Abstractions; |
| | | using CMS.Plugin.TraceManagement.Abstractions; |
| | | using CMS.Plugin.TraceManagement.Abstractions.Models.Traces; |
| | | using CMS.Unit.RuntimeValue.Models; |
| | | using CmsQueryExtensions; |
| | | using CmsQueryExtensions.Entitys; |
| | | using CmsQueryExtensions.Extension; |
| | |
| | | var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); |
| | | |
| | | // 查找数据 |
| | | var workTask = await workTaskRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode); |
| | | if (workTask == null) |
| | | { |
| | | throw new UserFriendlyException($"找不到作业计划"); |
| | | } |
| | | |
| | | var workPlan = await workPlanRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode); |
| | | if (workPlan == null) |
| | | { |
| | | throw new UserFriendlyException($"找不到作业计划"); |
| | | } |
| | | var workTask = await workTaskRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode && x.ProcessName == workPlan.ProcessName); |
| | | if (workTask == null) |
| | | { |
| | | throw new UserFriendlyException($"找不到作业任务"); |
| | | } |
| | | if (workPlan.ProcessName == "装配工序") |
| | | { |
| | |
| | | string _value = ""; |
| | | |
| | | //采集参数 |
| | | ReadWriteResult<IVariableValue?>? _getValue = null; |
| | | if (item.Name == $"{processName}压力") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | } |
| | | if (item.Name == $"{processName}位置") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | } |
| | | if (item.Name == $"{processName}速度") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | } |
| | | _value = _getValue?.Content?.Value?.SafeString().ToString(); |
| | | |
| | | if (item.Name == $"{processName}间隙") |
| | | { |
| | |
| | | string _value = ""; |
| | | |
| | | //采集参数 |
| | | ReadWriteResult<IVariableValue?>? _getValue = null; |
| | | if (item.Name == $"{processName}压力") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | } |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | if (item.Name == $"{processName}位置") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | } |
| | | if (item.Name == $"{processName}速度") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | } |
| | | |
| | | _value = _getValue?.Content?.Value?.SafeString().ToString(); |
| | | if (item.Name == $"{processName}间隙") |
| | | { |
| | | _value = "15mm"; |
| | |
| | | |
| | | await traceProvider.CreateTraceAsync(traceModel); |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | string _value = ""; |
| | | |
| | | //采集参数 |
| | | ReadWriteResult<IVariableValue?>? _getValue = null; |
| | | if (item.Name == $"{processName}压力") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | } |
| | | if (item.Name == $"{processName}位置") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | } |
| | | if (item.Name == $"{processName}速度") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | } |
| | | _value = _getValue?.Content?.Value?.SafeString().ToString(); |
| | | |
| | | if (item.Name == $"{processName}间隙") |
| | | { |
| | |
| | | string _value = ""; |
| | | |
| | | //采集参数 |
| | | ReadWriteResult<IVariableValue?>? _getValue = null; |
| | | if (item.Name == $"{processName}压力") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}压力"); |
| | | } |
| | | if (item.Name == $"{processName}位置") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}位置"); |
| | | } |
| | | if (item.Name == $"{processName}速度") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}速度"); |
| | | } |
| | | if (item.Name == $"{processName}内容") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}内容"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | _getValue = await _variableService.ReadValueAsync($"{processName}内容"); |
| | | } |
| | | _value = _getValue?.Content?.Value?.SafeString().ToString(); |
| | | |
| | | if (item.Name == $"{processName}间隙") |
| | | { |
| | |
| | | |
| | | await traceProvider.CreateTraceAsync(traceModel); |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |