From 0bc021a1c7515af5a0f102776488f0457d418d27 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 30 十二月 2024 11:46:05 +0800
Subject: [PATCH] 获取最新代码
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index 42c290b..a872ab6 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -21,17 +21,20 @@
/// <param name="palletCode">鎵樼洏鍙�</param>
/// <param name="stationCode">绔欏彴鍙�</param>
/// <returns></returns>
- public WebResponseContent RequestInboundTask(string palletCode, string stationCode)
+ public WebResponseContent RequestInboundTask(SaveModel saveModel)
{
try
{
- Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode);
+ var palletCode = saveModel.MainData["barcode"].ToString();
+ var warehouseId = saveModel.MainData["warehouseId"].ObjToInt();
+ var stationCode = saveModel.MainData["startPoint"].ToString();
+ Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode && x.WarehouseId == warehouseId);
if (task != null)
{
return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡鐢熸垚浠诲姟");
}
- if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskInStatusEnum.InNew.ObjToInt()) != null)
+ if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
{
return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
}
@@ -49,6 +52,10 @@
{
return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅");
}
+ if(warehouseId != stockInfo.WarehouseId)
+ {
+ return WebResponseContent.Instance.Error($"浠撳簱涓嶆纭�");
+ }
Dt_Task newTask = new Dt_Task()
{
@@ -59,8 +66,10 @@
Roadway = "",
SourceAddress = stationCode,
TargetAddress = "",
- TaskType = TaskInboundTypeEnum.Inbound.ObjToInt(),
- TaskStatus = TaskInStatusEnum.InNew.ObjToInt(),
+ TaskType = TaskTypeEnum.Inbound.ObjToInt(),
+ TaskStatus = TaskStatusEnum.New.ObjToInt(),
+ WarehouseId = stockInfo.WarehouseId,
+ PalletType = stockInfo.PalletType
};
stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
@@ -70,7 +79,7 @@
newTask.TaskId = taskId;
_stockRepository.StockInfoRepository.UpdateData(stockInfo);
_unitOfWorkManage.CommitTran();
-
+ PushTasksToWCS(new List<Dt_Task> { newTask });
return WebResponseContent.Instance.OK(data: newTask);
}
catch (Exception ex)
@@ -96,6 +105,11 @@
return WebResponseContent.Instance.Error($"鏈壘鍒拌鍏ュ簱浠诲姟");
}
+ if(_basicRepository.LocationInfoRepository.QueryFirst(x=>x.LocationCode == task.TargetAddress) != null)
+ {
+ return WebResponseContent.Instance.OK(data: task.TargetAddress);
+ }
+
Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayNo, (PalletTypeEnum)task.PalletType, task.WarehouseId);
if (locationInfo == null)
{
@@ -104,7 +118,7 @@
task.Roadway = roadwayNo;
task.TargetAddress = locationInfo.LocationCode;
- task.TaskStatus = TaskInStatusEnum.SC_InExecute.ObjToInt();
+ task.TaskStatus = TaskStatusEnum.SC_Execute.ObjToInt();
LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
--
Gitblit v1.9.3