From eaa07b80e3400da9be84e9a7a834e56d829a625b Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期三, 29 十月 2025 14:32:32 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs | 98 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 72 insertions(+), 26 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs"
index 719fc3a..2cf46b5 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs"
@@ -46,32 +46,33 @@
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;
+ 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浠诲姟绫诲瀷
-
- Dt_TaskExecuteDetail taskExecuteDetail = new()
- {
- IsManual = App.User.UserId > 0,
- IsNormal = isNormal,
- TaskNum = taskNum,
- TaskId = taskId,
- TaskState = taskState,
- Description = description,
- CurrentAddress = task.CurrentAddress,
- NextAddress = task.NextAddress,
- };
- BaseDal.AddData(taskExecuteDetail);
- }
- catch (Exception ex)
- {
+ string getstastr = GetEnumDescription(taskState);
+ string getrgvtasktyperema = GetEnumDescription2(TaskStateremark);
- }
+
+ Dt_TaskExecuteDetail taskExecuteDetail = new()
+ {
+ IsManual = App.User.UserId > 0,
+ IsNormal = isNormal,
+ TaskNum = taskNum,
+ TaskId = taskId,
+ TaskState = taskState,
+ Description = description,
+ CurrentAddress = task.CurrentAddress,
+ NextAddress = task.NextAddress,
+ Roadway = task.Roadway, //鏂板鎵ц璁惧
+ RGVTaskType = TaskStateremark,
+ TaskStateremark = getstastr,
+ RGVTaskTyperemark = getrgvtasktyperema
+ };
+ BaseDal.AddData(taskExecuteDetail);
}
public void AddTaskExecuteDetail(List<int> taskNums, string description = "")
@@ -202,8 +203,10 @@
active = steps.IndexOf(TaskState) + 1;
}
-
- content = WebResponseContent.Instance.OK(data: new { active, list });
+ string curradd = task.CurrentAddress;
+ string nextadd = task.NextAddress;
+ string rgvtasktype = task.RGVTaskType.ToString();
+ content = WebResponseContent.Instance.OK(data: new { active, list,curradd, nextadd, rgvtasktype });
}
catch (Exception ex)
{
@@ -256,5 +259,48 @@
}
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;
+ }
}
}
--
Gitblit v1.9.3