From 29cd467ba62b2bdf49c6546e78ae3ec809c4a723 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 19 六月 2025 17:50:28 +0800
Subject: [PATCH] 1
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 72 +++++++++++++++++++++++------------
1 files changed, 47 insertions(+), 25 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index d584a14..707c9bf 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -117,14 +117,14 @@
content = RelocationTaskCompleted(task);
break;
case TaskTypeEnum.AGVCarry:
-
+ content = AGVCarryTaskCompleted(task);
break;
default:
return content = WebResponseContent.Instance.Error("鏈壘鍒颁换鍔$被鍨嬪搴斾笟鍔″鐞嗛�昏緫");
}
if (content.Status)
{
- if (App.User.UserId > 0)
+ if (App.User.UserId > 0 && task.TaskType != TaskTypeEnum.AGVCarry.ObjToInt())
{
content = HttpHelper.Post<WebResponseContent>(url + "StackCraneTaskCompleted?taskNum=" + task.TaskNum, "", "浠诲姟瀹屾垚");
if (!content.Status) throw new Exception(content.Message);
@@ -160,31 +160,41 @@
return content = WebResponseContent.Instance.Error("鏈壘鍒颁换鍔′俊鎭�");
}
_unitOfWorkManage.BeginTran();
- MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCancel");
- if (methodInfo != null)
+ #region MyRegion
+ switch ((TaskTypeEnum)task.TaskType)
{
- WebResponseContent? responseContent = (WebResponseContent?)methodInfo.Invoke(this, new object[] { task });
- if (responseContent != null)
- {
- if (responseContent != null)
- {
- if (App.User.UserId > 0)
- {
- var response = HttpHelper.Post<WebResponseContent>(url + "TaskCancel?taskNum=" + task.TaskNum, "", "浠诲姟鍙栨秷");
- if (!response.Status)
- {
- _unitOfWorkManage.RollbackTran();
- return content = WebResponseContent.Instance.Error(response.Message);
- }
- _unitOfWorkManage.CommitTran();
- return content = responseContent;
- }
- _unitOfWorkManage.CommitTran();
- return content = responseContent;
- }
- }
+ case TaskTypeEnum.Inbound:
+ content = InboundTaskCancel(task);
+ break;
+ case TaskTypeEnum.Outbound:
+ content = OutboundTaskCancel(task);
+ break;
+ case TaskTypeEnum.PalletInbound:
+ content = PalletInboundTaskCancel(task);
+ break;
+ case TaskTypeEnum.PalletOutbound:
+ content = PalletOutboundTaskCancel(task);
+ break;
+ case TaskTypeEnum.Relocation:
+ content = RelocationTaskCancel(task);
+ break;
+ case TaskTypeEnum.AGVCarry:
+ content = AGVCarryTaskCompleted(task);
+ break;
+ default:
+ return content = WebResponseContent.Instance.Error("鏈壘鍒颁换鍔$被鍨嬪搴斾笟鍔″鐞嗛�昏緫");
}
- return content = WebResponseContent.Instance.Error("鏈壘鍒颁换鍔$被鍨嬪搴斾笟鍔″鐞嗛�昏緫");
+ if (content.Status)
+ {
+ if (App.User.UserId > 0 && task.TaskType != TaskTypeEnum.AGVCarry.ObjToInt())
+ {
+ content = HttpHelper.Post<WebResponseContent>(url + "TaskCancel?taskNum=" + task.TaskNum, "", "浠诲姟鍙栨秷");
+ if (!content.Status) throw new Exception(content.Message);
+ }
+ _unitOfWorkManage.CommitTran();
+ }
+ return content;
+ #endregion
}
catch (Exception ex)
{
@@ -499,6 +509,18 @@
return WebResponseContent.Instance.Error(ex.Message);
}
}
+ public WebResponseContent AGVCarryTaskCompleted(Dt_Task task)
+ {
+ try
+ {
+ BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
public WebResponseContent InboundTaskCancel(Dt_Task task)
{
--
Gitblit v1.9.3