From 1866b69e8f67e382a0a75268d63e6418c8ae02e7 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 13 一月 2026 09:55:01 +0800
Subject: [PATCH] 1
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs | 266 ++++++++++++++++++++++++----------------------------
1 files changed, 123 insertions(+), 143 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index e5090c9..901532d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -88,31 +88,6 @@
_unitOfWorkManage.CommitTran();
- TaskModel esstask = new TaskModel()
- {
- taskType = "carry",
- taskGroupCode = "",
- groupPriority = 0,
- tasks = new List<TasksType>
- {
- new()
- {
- taskCode=task.TaskNum.ToString(),
- taskPriority=0,
- taskDescribe=new TaskDescribeType{
- containerCode=stockInfo.PalletCode,
- containerType= "CT_KUBOT_STANDARD",
- fromLocationCode=stockInfo.LocationCode??"",
- toStationCode="",
- toLocationCode="1-2",
- deadline=0,storageTag=""
- }
- }
- }
- };
- var result = await _eSSApiService.CreateTaskAsync(esstask);
-
- _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
}
return content.OK("绌烘墭鍑哄簱鎴愬姛!");
}
@@ -314,45 +289,46 @@
_outboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
}
_unitOfWorkManage.CommitTran();
- TaskModel esstask = new TaskModel()
- {
- taskType = "carry",
- taskGroupCode = "",
- groupPriority = 0,
- tasks = new List<TasksType>()
- };
+ return WebResponseContent.Instance.OK();
+ //TaskModel esstask = new TaskModel()
+ //{
+ // taskType = "carry",
+ // taskGroupCode = "",
+ // groupPriority = 0,
+ // tasks = new List<TasksType>()
+ //};
- foreach (var task in tasks)
- {
- esstask.
- tasks.Add(new TasksType
- {
- taskCode = task.TaskNum.ToString(),
- taskPriority = 0,
- taskDescribe = new TaskDescribeType
- {
- containerCode = task.PalletCode,
- containerType = "CT_KUBOT_STANDARD",
- fromLocationCode = task.SourceAddress ?? "",
- toStationCode = "",
- toLocationCode = task.TargetAddress,
- deadline = 0,
- storageTag = ""
- }
- }
- );
- }
- var result = await _eSSApiService.CreateTaskAsync(esstask);
+ //foreach (var task in tasks)
+ //{
+ // esstask.
+ // tasks.Add(new TasksType
+ // {
+ // taskCode = task.TaskNum.ToString(),
+ // taskPriority = 0,
+ // taskDescribe = new TaskDescribeType
+ // {
+ // containerCode = task.PalletCode,
+ // containerType = "CT_KUBOT_STANDARD",
+ // fromLocationCode = task.SourceAddress ?? "",
+ // toStationCode = "",
+ // toLocationCode = task.TargetAddress,
+ // deadline = 0,
+ // storageTag = ""
+ // }
+ // }
+ // );
+ //}
+ //var result = await _eSSApiService.CreateTaskAsync(esstask);
- _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
- if (result)
- {
- return WebResponseContent.Instance.OK();
- }
- else
- {
- return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
- }
+ //_logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
+ //if (result)
+ //{
+ // return WebResponseContent.Instance.OK();
+ //}
+ //else
+ //{
+ // return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
+ //}
}
catch (Exception ex)
{
@@ -390,7 +366,7 @@
TargetAddress = outStation,
TaskStatus = TaskStatusEnum.New.ObjToInt(),
TaskType = taskType.ObjToInt(),
- // TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+ //TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
PalletType = stockInfo.PalletType,
WarehouseId = stockInfo.WarehouseId,
};
@@ -776,46 +752,47 @@
_outboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
}
_unitOfWorkManage.CommitTran();
+ return WebResponseContent.Instance.OK();
//PushTasksToWCS(tasks);
- TaskModel esstask = new TaskModel()
- {
- taskType = "carry",
- taskGroupCode = "",
- groupPriority = 0,
- tasks = new List<TasksType>()
- };
+ //TaskModel esstask = new TaskModel()
+ //{
+ // taskType = "carry",
+ // taskGroupCode = "",
+ // groupPriority = 0,
+ // tasks = new List<TasksType>()
+ //};
- foreach (var task in tasks)
- {
- esstask.
- tasks.Add(new TasksType
- {
- taskCode = task.TaskNum.ToString(),
- taskPriority = 0,
- taskDescribe = new TaskDescribeType
- {
- containerCode = task.PalletCode,
- containerType = "CT_KUBOT_STANDARD",
- fromLocationCode = task.SourceAddress ?? "",
- toStationCode = "",
- toLocationCode = task.TargetAddress,
- deadline = 0,
- storageTag = ""
- }
- }
- );
- }
- var result = await _eSSApiService.CreateTaskAsync(esstask);
+ //foreach (var task in tasks)
+ //{
+ // esstask.
+ // tasks.Add(new TasksType
+ // {
+ // taskCode = task.TaskNum.ToString(),
+ // taskPriority = 0,
+ // taskDescribe = new TaskDescribeType
+ // {
+ // containerCode = task.PalletCode,
+ // containerType = "CT_KUBOT_STANDARD",
+ // fromLocationCode = task.SourceAddress ?? "",
+ // toStationCode = "",
+ // toLocationCode = task.TargetAddress,
+ // deadline = 0,
+ // storageTag = ""
+ // }
+ // }
+ // );
+ //}
+ //var result = await _eSSApiService.CreateTaskAsync(esstask);
- _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
- if (result)
- {
- return WebResponseContent.Instance.OK();
- }
- else
- {
- return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
- }
+ //_logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
+ //if (result)
+ //{
+ // return WebResponseContent.Instance.OK();
+ //}
+ //else
+ //{
+ // return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
+ //}
}
catch (Exception ex)
@@ -826,7 +803,7 @@
}
-
+
#region 鍒嗘壒鍒嗛厤搴撳瓨
#region 鍐呭瓨閿佺鐞嗗櫒
private static readonly ConcurrentDictionary<string, SemaphoreSlim> _materialLocks =
@@ -1123,7 +1100,7 @@
}
//鑾峰彇璐т綅
List<string> locStrs = stockInfos.Select(x => x.LocationCode).ToList();
- List<Dt_LocationInfo> locationInfos = (List<Dt_LocationInfo>)_locationInfoService.Db.Queryable<Dt_LocationInfo>().Where(x => locStrs.Contains(x.LocationCode));
+ List<Dt_LocationInfo> locationInfos =_locationInfoService.Db.Queryable<Dt_LocationInfo>().Where(x => locStrs.Contains(x.LocationCode)).ToList();
if (stockInfos.Count != locationInfos.Count)
{
string? locStr = locStrs.FirstOrDefault(x => !locationInfos.Select(x => x.LocationCode).ToList().Contains(x));
@@ -1134,7 +1111,9 @@
WarehouseId = stockInfos.FirstOrDefault().WarehouseId,
TakeStockStatus = TakeStockStatusEnum.鐩樼偣涓�.ObjToInt(),
OrderNo = CreateCodeByRule(nameof(RuleCodeEnum.PDCodeRule)),
- Details = new List<Dt_TakeStockOrderDetail>()
+ AllPalletCode = string.Join(",", stockInfos.Select(item => item.PalletCode).Where(palletCode => !string.IsNullOrEmpty(palletCode))),
+ Remark = outStation
+
};
foreach (var item in stockInfos)
{
@@ -1168,51 +1147,52 @@
_unitOfWorkManage.BeginTran();
//鏇存柊搴撳瓨鐘舵��
_stockRepository.UpdateData(stockInfos);
- BaseDal.Db.InsertNav(takeStockOrder);
+ _takeStockOrder.AddData(takeStockOrder);
//鏂板缓浠诲姟
BaseDal.AddData(tasks);
_locationInfoService.UpdateData(locationInfos);
_unitOfWorkManage.CommitTran();
- TaskModel esstask = new TaskModel()
- {
- taskType = "carry",
- taskGroupCode = "",
- groupPriority = 0,
- tasks = new List<TasksType>()
- };
-
- foreach (var task in tasks)
- {
- esstask.
- tasks.Add(new TasksType
- {
- taskCode = task.TaskNum.ToString(),
- taskPriority = 0,
- taskDescribe = new TaskDescribeType
- {
- containerCode = task.PalletCode,
- containerType = "CT_KUBOT_STANDARD",
- fromLocationCode = task.SourceAddress ?? "",
- toStationCode = "",
- toLocationCode = task.TargetAddress,
- deadline = 0,
- storageTag = ""
- }
- }
- );
- }
- var result = await _eSSApiService.CreateTaskAsync(esstask);
-
- _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
- if (result)
- {
- return WebResponseContent.Instance.OK();
- }
- else
- {
- return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
- }
content.OK();
+ //TaskModel esstask = new TaskModel()
+ //{
+ // taskType = "carry",
+ // taskGroupCode = "",
+ // groupPriority = 0,
+ // tasks = new List<TasksType>()
+ //};
+
+ //foreach (var task in tasks)
+ //{
+ // esstask.
+ // tasks.Add(new TasksType
+ // {
+ // taskCode = task.TaskNum.ToString(),
+ // taskPriority = 0,
+ // taskDescribe = new TaskDescribeType
+ // {
+ // containerCode = task.PalletCode,
+ // containerType = "CT_KUBOT_STANDARD",
+ // fromLocationCode = task.SourceAddress ?? "",
+ // toStationCode = "",
+ // toLocationCode = task.TargetAddress,
+ // deadline = 0,
+ // storageTag = ""
+ // }
+ // }
+ // );
+ //}
+ //var result = await _eSSApiService.CreateTaskAsync(esstask);
+
+ //_logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
+ //if (result)
+ //{
+ // return WebResponseContent.Instance.OK();
+ //}
+ //else
+ //{
+ // return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
+ //}
+ //content.OK();
}
catch (Exception ex)
{
--
Gitblit v1.9.3