| | |
| | | |
| | | public void AddTaskExecuteDetail(int taskId, string description = "") |
| | | { |
| | | try |
| | | { |
| | | bool isNormal = true; |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskId == taskId); |
| | | if (task == null) return; |
| | | int taskNum = task.TaskNum; |
| | | int taskState = task.TaskState; |
| | | int TaskStateremark = task.RGVTaskType; //鏂板RGv浠诲姟绫诲瀷 |
| | | |
| | | string getstastr = GetEnumDescription(taskState); |
| | | string getrgvtasktyperema = GetEnumDescription2(TaskStateremark); |
| | | |
| | | |
| | | Dt_TaskExecuteDetail taskExecuteDetail = new() |
| | |
| | | Description = description, |
| | | CurrentAddress = task.CurrentAddress, |
| | | NextAddress = task.NextAddress, |
| | | Roadway = task.Roadway, //鏂板鎵ц璁惧 |
| | | RGVTaskType = TaskStateremark, |
| | | TaskStateremark = getstastr, |
| | | RGVTaskTyperemark = getrgvtasktyperema |
| | | }; |
| | | BaseDal.AddData(taskExecuteDetail); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | public void AddTaskExecuteDetail(List<int> taskNums, string description = "") |
| | |
| | | active = steps.IndexOf(TaskState) + 1; |
| | | |
| | | } |
| | | |
| | | content = WebResponseContent.Instance.OK(data: new { active, list }); |
| | | string curradd = task.CurrentAddress; |
| | | string nextadd = task.NextAddress; |
| | | content = WebResponseContent.Instance.OK(data: new { active, list,curradd, nextadd }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 浠诲姟绫诲瀷鏋氫妇 |
| | | /// </summary> |
| | | public string GetEnumDescription(int enumValue) |
| | | { |
| | | var enumType = typeof(TaskInStatusEnum); |
| | | var field = enumType.GetFields() |
| | | .FirstOrDefault(f => f.FieldType == enumType && |
| | | (int)f.GetValue(null) == enumValue); |
| | | |
| | | if (field != null) |
| | | { |
| | | var descriptionAttribute = field.GetCustomAttributes(typeof(DescriptionAttribute), false) |
| | | .FirstOrDefault() as DescriptionAttribute; |
| | | |
| | | return descriptionAttribute?.Description ?? field.Name; |
| | | } |
| | | |
| | | return string.Empty; |
| | | } |
| | | |
| | | public string GetEnumDescription2(int enumValue) |
| | | { |
| | | var enumType = typeof(RGVTaskTypeEnum); |
| | | var field = enumType.GetFields() |
| | | .FirstOrDefault(f => f.FieldType == enumType && |
| | | (int)f.GetValue(null) == enumValue); |
| | | |
| | | if (field != null) |
| | | { |
| | | var descriptionAttribute = field.GetCustomAttributes(typeof(DescriptionAttribute), false) |
| | | .FirstOrDefault() as DescriptionAttribute; |
| | | |
| | | return descriptionAttribute?.Description ?? field.Name; |
| | | } |
| | | |
| | | return string.Empty; |
| | | } |
| | | } |
| | | } |